Changeset 2715:a87ddf7dbfb5 for inc/admin
- Timestamp:
- 05/20/14 08:39:33 (11 years ago)
- Branch:
- twig
- Parents:
- 2683:fb8aa74332f1 (diff), 2714:eed2e5727277 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/admin/prepend.php
r2613 r2715 4 4 # This file is part of Dotclear 2. 5 5 # 6 # Copyright (c) 2003-201 1Olivier Meunier & Association Dotclear6 # Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear 7 7 # Licensed under the GPL version 2.0 license. 8 8 # See LICENSE file or … … 174 174 */ 175 175 } 176 177 $core->adminurl = new dcAdminURL($core); 178 179 $core->adminurl->register('admin.posts','posts.php'); 180 $core->adminurl->register('admin.post','post.php'); 181 $core->adminurl->register('admin.blog.theme','blog_theme.php'); 182 $core->adminurl->register('admin.blog.pref','blog_pref.php'); 183 $core->adminurl->register('admin.blogs','blogs.php'); 184 $core->adminurl->register('admin.categories','categories.php'); 185 $core->adminurl->register('admin.category','category.php'); 186 $core->adminurl->register('admin.comments','comments.php'); 187 $core->adminurl->register('admin.comments','comment.php'); 188 $core->adminurl->register('admin.help','help.php'); 189 $core->adminurl->register('admin.home','index.php'); 190 $core->adminurl->register('admin.langs','langs.php'); 191 $core->adminurl->register('admin.media','media.php'); 192 $core->adminurl->register('admin.media_item','media_item.php'); 193 $core->adminurl->register('admin.plugins','plugins.php'); 194 $core->adminurl->register('admin.plugin','plugin.php'); 195 $core->adminurl->register('admin.user.preferences','preferences.php'); 196 $core->adminurl->register('admin.user','user.php'); 197 $core->adminurl->register('admin.users','users.php'); 176 198 177 199 if ($core->auth->userID() && $core->blog !== null) -
inc/admin/prepend.php
r2708 r2715 24 24 function dc_load_locales() { 25 25 global $_lang, $core; 26 26 27 27 $_lang = $core->auth->getInfo('user_lang'); 28 28 $_lang = preg_match('/^[a-z]{2}(-[a-z]{2})?$/',$_lang) ? $_lang : 'en'; 29 29 30 30 l10n::lang($_lang); 31 31 if (l10n::set(dirname(__FILE__).'/../../locales/'.$_lang.'/date') === false && $_lang != 'en') { … … 40 40 { 41 41 global $core; 42 42 43 43 $core->auth->user_prefs->addWorkspace('interface'); 44 44 $user_ui_iconset = @$core->auth->user_prefs->interface->iconset; 45 45 if (($user_ui_iconset) && ($img)) { 46 46 $icon = false; 47 if ((preg_match('/^images\/menu\/(.+)$/',$img,$m)) || 47 if ((preg_match('/^images\/menu\/(.+)$/',$img,$m)) || 48 48 (preg_match('/^index\.php\?pf=(.+)$/',$img,$m))) { 49 49 if ($m[1]) { … … 65 65 # We have session information in constants 66 66 $_COOKIE[DC_SESSION_NAME] = DC_AUTH_SESS_ID; 67 67 68 68 if (!$core->auth->checkSession(DC_AUTH_SESS_UID)) { 69 69 throw new Exception('Invalid session data.'); 70 70 } 71 71 72 72 # Check nonce from POST requests 73 73 if (!empty($_POST)) … … 77 77 } 78 78 } 79 79 80 80 if (empty($_SESSION['sess_blog_id'])) { 81 81 throw new Exception('Permission denied.'); 82 82 } 83 83 84 84 # Loading locales 85 85 dc_load_locales(); 86 86 87 87 $core->setBlog($_SESSION['sess_blog_id']); 88 88 if (!$core->blog->id) { … … 100 100 $p[3] = '/'; 101 101 call_user_func_array('setcookie',$p); 102 102 103 103 http::redirect('auth.php'); 104 104 } … … 108 108 ,20); 109 109 } 110 110 111 111 # Check nonce from POST requests 112 112 if (!empty($_POST)) … … 119 119 } 120 120 } 121 122 121 122 123 123 if (!empty($_REQUEST['switchblog']) 124 124 && $core->auth->getPermissions($_REQUEST['switchblog']) !== false) … … 131 131 unset($_SESSION['media_manager_page']); 132 132 } 133 133 134 134 # Removing switchblog from URL 135 135 $redir = $_SERVER['REQUEST_URI']; … … 139 139 exit; 140 140 } 141 141 142 142 # Check blog to use and log out if no result 143 143 if (isset($_SESSION['sess_blog_id'])) … … 154 154 } 155 155 } 156 156 157 157 # Loading locales 158 158 dc_load_locales(); 159 159 160 160 if (isset($_SESSION['sess_blog_id'])) { 161 161 $core->setBlog($_SESSION['sess_blog_id']); … … 165 165 } 166 166 167 /* 167 /* 168 168 # Check add to my fav fired 169 169 if (!empty($_REQUEST['add-favorite'])) { … … 206 206 } 207 207 unset($f); 208 208 209 209 if (($hfiles = @scandir($locales_root.$_lang.'/help')) !== false) 210 210 { … … 227 227 # [] : Title, URL, small icon, large icon, permissions, id, class 228 228 # NB : '*' in permissions means any, null means super admin only 229 230 229 230 231 231 # Menus creation 232 232 $_menu = new ArrayObject(); … … 246 246 } 247 247 248 248 249 249 # Set menu titles 250 250 251 251 $_menu['System']->title = __('System settings'); 252 252 $_menu['Blog']->title = __('Blog'); … … 278 278 preg_match('/post.php$/',$_SERVER['REQUEST_URI']), 279 279 $core->auth->check('usage,contentadmin',$core->blog->id)); 280 280 281 281 $_menu['System']->prependItem(__('Update'),'update.php','images/menu/update.png', 282 282 preg_match('/update.php(\?.*)?$/',$_SERVER['REQUEST_URI']), … … 301 301 } 302 302 303 # Add admin default templates path 304 $core->tpl->getLoader()->addPath(dirname(__FILE__).'/default-templates'); 305 # Set admin context 306 $_ctx = new dcAdminContext($core); 307 $core->tpl->addExtension($_ctx); 308 309 # --BEHAVIOR-- adminPrepend 310 $core->callBehavior('adminPrepend',$core,$_ctx); 311 ?>
Note: See TracChangeset
for help on using the changeset viewer.