Changeset 3874:ab8368569446 for inc/admin/lib.dc.page.php
- Timestamp:
- 09/14/18 12:16:17 (7 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/admin/lib.dc.page.php
r3872 r3874 14 14 class dcPage 15 15 { 16 private static $loaded_js = array();17 private static $loaded_css = array();16 private static $loaded_js = []; 17 private static $loaded_css = []; 18 18 private static $xframe_loaded = false; 19 private static $N_TYPES = array(19 private static $N_TYPES = [ 20 20 "success" => "success", 21 21 "warning" => "warning-msg", 22 22 "error" => "error", 23 23 "message" => "message", 24 "static" => "static-msg" );24 "static" => "static-msg"]; 25 25 26 26 # Auth check … … 53 53 54 54 # Top of admin page 55 public static function open($title = '', $head = '', $breadcrumb = '', $options = array())55 public static function open($title = '', $head = '', $breadcrumb = '', $options = []) 56 56 { 57 57 global $core; … … 68 68 $blog_box .= '</p>'; 69 69 } else { 70 $rs_blogs = $core->getBlogs( array('order' => 'LOWER(blog_name)', 'limit' => 20));71 $blogs = array();70 $rs_blogs = $core->getBlogs(['order' => 'LOWER(blog_name)', 'limit' => 20]); 71 $blogs = []; 72 72 while ($rs_blogs->fetch()) { 73 73 $blogs[html::escapeHTML($rs_blogs->blog_name . ' - ' . $rs_blogs->blog_url)] = $rs_blogs->blog_id; … … 84 84 85 85 # Display 86 $headers = new ArrayObject( array());86 $headers = new ArrayObject([]); 87 87 88 88 # Content-Type … … 102 102 if (!$safe_mode && $core->blog->settings->system->csp_admin_on) { 103 103 // Get directives from settings if exist, else set defaults 104 $csp = new ArrayObject( array());104 $csp = new ArrayObject([]); 105 105 106 106 // SQlite Clearbricks driver does not allow using single quote at beginning or end of a field value … … 135 135 136 136 // Construct CSP header 137 $directives = array();137 $directives = []; 138 138 foreach ($csp as $key => $value) { 139 139 if ($value) { … … 168 168 169 169 if ($core->auth->user_prefs->interface->darkmode) { 170 echo self::jsVars( array('dotclear_darkMode' => 1));170 echo self::jsVars(['dotclear_darkMode' => 1]); 171 171 echo self::cssLoad('style/default-dark.css'); 172 172 } else { 173 echo self::jsVars( array('dotclear_darkMode' => 0));173 echo self::jsVars(['dotclear_darkMode' => 0]); 174 174 echo self::cssLoad('style/default.css'); 175 175 } … … 237 237 '<li><a class="smallscreen' . (preg_match('/' . preg_quote($core->adminurl->get('admin.user.preferences')) . '(\?.*)?$/', $_SERVER['REQUEST_URI']) ? ' active' : '') . 238 238 '" href="' . $core->adminurl->get("admin.user.preferences") . '">' . __('My preferences') . '</a></li>' . 239 '<li><a href="' . $core->adminurl->get("admin.home", array('logout' => 1)) . '" class="logout"><span class="nomobile">' . sprintf(__('Logout %s'), $core->auth->userID()) .239 '<li><a href="' . $core->adminurl->get("admin.home", ['logout' => 1]) . '" class="logout"><span class="nomobile">' . sprintf(__('Logout %s'), $core->auth->userID()) . 240 240 '</span><img src="images/logout.png" alt="" /></a></li>' . 241 241 '</ul>' . … … 303 303 } 304 304 305 public static function addNotice($type, $message, $options = array())305 public static function addNotice($type, $message, $options = []) 306 306 { 307 307 if (isset(self::$N_TYPES[$type])) { … … 313 313 $notifications = $_SESSION['notifications']; 314 314 } else { 315 $notifications = array();316 } 317 318 $n = array_merge($options, array('class' => $class, 'ts' => time(), 'text' => $message));315 $notifications = []; 316 } 317 318 $n = array_merge($options, ['class' => $class, 'ts' => time(), 'text' => $message]); 319 319 if ($type != "static") { 320 320 $notifications[] = $n; … … 325 325 } 326 326 327 public static function addSuccessNotice($message, $options = array())327 public static function addSuccessNotice($message, $options = []) 328 328 { 329 329 self::addNotice("success", $message, $options); 330 330 } 331 331 332 public static function addWarningNotice($message, $options = array())332 public static function addWarningNotice($message, $options = []) 333 333 { 334 334 self::addNotice("warning", $message, $options); 335 335 } 336 336 337 public static function addErrorNotice($message, $options = array())337 public static function addErrorNotice($message, $options = []) 338 338 { 339 339 self::addNotice("error", $message, $options); … … 449 449 450 450 if ($core->auth->user_prefs->interface->darkmode) { 451 echo self::jsVars( array('dotclear_darkMode' => 1));451 echo self::jsVars(['dotclear_darkMode' => 1]); 452 452 echo self::cssLoad('style/default-dark.css'); 453 453 } else { 454 echo self::jsVars( array('dotclear_darkMode' => 0));454 echo self::jsVars(['dotclear_darkMode' => 0]); 455 455 echo self::cssLoad('style/default.css'); 456 456 } … … 520 520 } 521 521 522 public static function breadcrumb($elements = null, $options = array())522 public static function breadcrumb($elements = null, $options = []) 523 523 { 524 524 global $core; … … 742 742 } 743 743 } else { 744 $unfolded_sections = array();744 $unfolded_sections = []; 745 745 } 746 746 return '<script type="text/javascript">' . "\n" . … … 1003 1003 } 1004 1004 1005 public static function jsUpload($params = array(), $base_url = null)1005 public static function jsUpload($params = [], $base_url = null) 1006 1006 { 1007 1007 if (!$base_url) { … … 1009 1009 } 1010 1010 1011 $params = array_merge($params, array(1011 $params = array_merge($params, [ 1012 1012 'sess_id=' . session_id(), 1013 1013 'sess_uid=' . $_SESSION['sess_browser_uid'], 1014 1014 'xd_check=' . $GLOBALS['core']->getNonce() 1015 ));1015 ]); 1016 1016 1017 1017 return … … 1068 1068 } 1069 1069 1070 public static function jsLoadCodeMirror($theme = '', $multi = true, $modes = array('css', 'htmlmixed', 'javascript', 'php', 'xml'))1070 public static function jsLoadCodeMirror($theme = '', $multi = true, $modes = ['css', 'htmlmixed', 'javascript', 'php', 'xml']) 1071 1071 { 1072 1072 $ret = … … 1115 1115 public static function getCodeMirrorThemes() 1116 1116 { 1117 $themes = array();1117 $themes = []; 1118 1118 $themes_root = dirname(__FILE__) . '/../../admin' . '/js/codemirror/theme/'; 1119 1119 if (is_dir($themes_root) && is_readable($themes_root)) { … … 1132 1132 public static function getPF($file) 1133 1133 { 1134 return $GLOBALS['core']->adminurl->get('load.plugin.file', array('pf' => $file));1134 return $GLOBALS['core']->adminurl->get('load.plugin.file', ['pf' => $file]); 1135 1135 } 1136 1136 1137 1137 public static function getVF($file) 1138 1138 { 1139 return $GLOBALS['core']->adminurl->get('load.var.file', array('vf' => $file));1139 return $GLOBALS['core']->adminurl->get('load.var.file', ['vf' => $file]); 1140 1140 } 1141 1141
Note: See TracChangeset
for help on using the changeset viewer.