Changeset 2609:c26642f775e2 for inc/admin/prepend.php
- Timestamp:
- 12/10/13 09:00:09 (12 years ago)
- Branch:
- twig
- Parents:
- 2468:d7fda5a0bd39 (diff), 2608:3365c9df16a6 (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
r2313 r2609 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 -
inc/admin/prepend.php
r2566 r2609 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'])) { … … 184 184 } 185 185 unset($f); 186 186 187 187 if (($hfiles = @scandir($locales_root.$_lang.'/help')) !== false) 188 188 { … … 205 205 # [] : Title, URL, small icon, large icon, permissions, id, class 206 206 # NB : '*' in permissions means any, null means super admin only 207 208 207 208 209 209 # Menus creation 210 210 $_menu = new ArrayObject(); … … 224 224 } 225 225 226 226 227 227 # Set menu titles 228 228 229 229 $_menu['System']->title = __('System settings'); 230 230 $_menu['Blog']->title = __('Blog'); … … 256 256 preg_match('/post.php$/',$_SERVER['REQUEST_URI']), 257 257 $core->auth->check('usage,contentadmin',$core->blog->id)); 258 258 259 259 $_menu['System']->prependItem(__('Update'),'update.php','images/menu/update.png', 260 260 preg_match('/update.php(\?.*)?$/',$_SERVER['REQUEST_URI']), … … 278 278 } 279 279 } 280 281 # Add admin default templates path 282 $core->tpl->getLoader()->addPath(dirname(__FILE__).'/default-templates'); 283 # Set admin context 284 $_ctx = new dcAdminContext($core); 285 $core->tpl->addExtension($_ctx); 286 287 # --BEHAVIOR-- adminPrepend 288 $core->callBehavior('adminPrepend',$core,$_ctx); 289 ?>
Note: See TracChangeset
for help on using the changeset viewer.