Changeset 1718:5bbbd8bb73fb for inc/admin
- Timestamp:
- 09/04/13 14:28:18 (12 years ago)
- Branch:
- default
- Children:
- 1719:b8c48f380463, 1720:f23f530dfb4a
- Parents:
- 1717:9df047961e9c (diff), 1710:f6287a0366e3 (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/lib.dc.page.php
r1700 r1718 49 49 50 50 # Top of admin page 51 public static function open($title='', $head='')51 public static function open($title='',$head='',$breadcrumb='') 52 52 { 53 53 global $core; … … 73 73 } 74 74 $blog_box = 75 '<p><label for="switchblog" class="classic ">'.76 __('Blogs:').' '.75 '<p><label for="switchblog" class="classic nomobile">'. 76 __('Blogs:').'</label> '. 77 77 $core->formNonce(). 78 78 form::combo('switchblog',$blogs,$core->blog->id). 79 '</ label></p>'.79 '</p>'. 80 80 '<noscript><p><input type="submit" value="'.__('ok').'" /></p></noscript>'; 81 81 } … … 93 93 "<head>\n". 94 94 ' <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'."\n". 95 ' <title>'.$title.' - '.html::escapeHTML($core->blog->name).' - '.html::escapeHTML(DC_VENDOR_NAME).' - '.DC_VERSION.'</title>'."\n".96 97 95 ' <meta name="ROBOTS" content="NOARCHIVE,NOINDEX,NOFOLLOW" />'."\n". 98 96 ' <meta name="GOOGLEBOT" content="NOSNIPPET" />'."\n". 97 ' <meta name="viewport" content="width=device-width, initial-scale=1.0" />'."\n". 98 ' <title>'.$title.' - '.html::escapeHTML($core->blog->name).' - '.html::escapeHTML(DC_VENDOR_NAME).' - '.DC_VERSION.'</title>'."\n". 99 99 100 100 101 self::jsLoadIE7(). 101 ' 102 ' <link rel="stylesheet" href="style/default.css" type="text/css" media="screen" />'."\n"; 102 103 if (l10n::getTextDirection($GLOBALS['_lang']) == 'rtl') { 103 104 echo 104 ' 105 ' <link rel="stylesheet" href="style/default-rtl.css" type="text/css" media="screen" />'."\n"; 105 106 } 106 107 … … 113 114 echo 114 115 self::jsCommon(). 116 self::jsToggles(). 115 117 $head; 116 118 … … 121 123 "</head>\n". 122 124 '<body id="dotclear-admin'. 123 ($safe_mode ? ' safe-mode' : ''). 124 '">'."\n". 125 ($safe_mode ? ' safe-mode' : '').'" class="no-js">'."\n". 125 126 126 127 '<div id="header">'. 127 '<ul id="prelude"><li><a href="#content">'.__('Go to the content').'</a></li><li><a href="#main-menu">'.__('Go to the menu').'</a></li></ul>'."\n". 128 '<ul id="prelude">'. 129 '<li><a href="#content">'.__('Go to the content').'</a></li>'. 130 '<li><a href="#main-menu">'.__('Go to the menu').'</a></li>'. 131 '<li><a href="#qx">'.__('Go to search').'</a></li>'. 132 '</ul>'."\n". 128 133 '<div id="top"><h1><a href="index.php">'.DC_VENDOR_NAME.'</a></h1></div>'."\n"; 129 134 … … 133 138 '<form action="index.php" method="post">'. 134 139 $blog_box. 135 '<p ><a href="'.$core->blog->url.'" onclick="window.open(this.href);return false;" title="'.__('Go to site').' ('.__('new window').')'.'">'.__('Go to site').'<img src="images/outgoing.png" alt="" /></a>'.140 '<p class="nomobile"><a href="'.$core->blog->url.'" onclick="window.open(this.href);return false;" title="'.__('Go to site').' ('.__('new window').')'.'">'.__('Go to site').'<img src="images/outgoing.png" alt="" /></a>'. 136 141 '</p></form>'. 137 142 '</div>'. 138 143 '<div id="info-box2">'. 139 '<a '.(preg_match('/index.php$/',$_SERVER['REQUEST_URI']) ? ' class="active"' : '').'href="index.php">'.__('My dashboard').'</a>'.140 '<span > | </span><a'.(preg_match('/preferences.php(\?.*)?$/',$_SERVER['REQUEST_URI']) ? ' class="active"' : '').'href="preferences.php">'.__('My preferences').'</a>'.141 '<span > | </span><a href="index.php?logout=1" class="logout">'.sprintf(__('Logout %s'),$core->auth->userID()).'<img src="images/logout.png" alt="" /></a>'.144 '<a class="smallscreen'.(preg_match('/index.php$/',$_SERVER['REQUEST_URI']) ? ' active' : '').'" href="index.php">'.__('My dashboard').'</a>'. 145 '<span class="smallscreen"> | </span><a class="smallscreen'.(preg_match('/preferences.php(\?.*)?$/',$_SERVER['REQUEST_URI']) ? ' active' : '').'" href="preferences.php">'.__('My preferences').'</a>'. 146 '<span class="smallscreen"> | </span><a href="index.php?logout=1" class="logout">'.sprintf(__('Logout %s'),$core->auth->userID()).'<img src="images/logout.png" alt="" /></a>'. 142 147 '</div>'. 143 148 '</div>'. … … 158 163 } 159 164 165 // Display breadcrumb (if given) before any error message 166 echo $breadcrumb; 167 160 168 if ($core->error->flag()) { 161 169 echo … … 176 184 "</div>\n". // End of #main 177 185 178 '<div id="main-menu">'."\n"; 186 '<div id="main-menu">'."\n". 187 188 '<form id="search-menu" action="search.php" method="get">'. 189 '<p><label for="qx" class="hidden">'.__('Search:').' </label>'.form::field('qx',30,255,''). 190 '<input type="submit" value="'.__('OK').'" /></p>'. 191 '</form>'; 179 192 180 193 foreach ($menu as $k => $v) { … … 193 206 echo 194 207 '</div>'."\n". // End of #main-menu 195 '<div id="footer"><a href="http://dotclear.org/" title="'.$text.'"><img src="style/dc_logo_footer.png" alt="'.$text.'" /></a></div>'."\n". 208 '<div id="footer"><a href="http://dotclear.org/" title="'.$text.'"><img src="style/dc_logos/w-dotclear90.png" alt="'.$text.'" /></a></div>'."\n". 209 '<!-- '."\n". 210 ' .'."\n". 211 ' ,;:\'`\'::'."\n". 212 ' __||'."\n". 213 ' _____/LLLL\_'."\n". 214 ' \__________"|'."\n". 215 ' ~^~^~^~^~^~^~^~^~^~'."\n". 216 ' -->'."\n". 196 217 "</div>\n"; // End of #wrapper 197 218 … … 204 225 } 205 226 206 public static function openPopup($title='', $head='')227 public static function openPopup($title='',$head='',$breadcrumb='') 207 228 { 208 229 global $core; … … 216 237 'xml:lang="'.$core->auth->getInfo('user_lang').'" '. 217 238 'lang="'.$core->auth->getInfo('user_lang').'">'."\n". 239 '<meta name="viewport" content="width=device-width, initial-scale=1.0" />'."\n". 218 240 "<head>\n". 219 241 ' <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'."\n". … … 232 254 echo 233 255 self::jsCommon(). 256 self::jsToggles(). 234 257 $head; 235 258 … … 241 264 '<body id="dotclear-admin" class="popup">'."\n". 242 265 243 '<div id="top "><h1>'.DC_VENDOR_NAME.'</h1></div>'."\n";266 '<div id="top hidden"><h1>'.DC_VENDOR_NAME.'</h1></div>'."\n"; 244 267 245 268 echo … … 247 270 '<div id="main">'."\n". 248 271 '<div id="content">'."\n"; 272 273 // display breadcrumb if given 274 echo $breadcrumb; 249 275 250 276 if ($core->error->flag()) { … … 266 292 } 267 293 268 public static function message($msg,$timestamp=true,$div=false,$echo=true) 294 public static function breadcrumb($elements=null,$with_home_link=true,$echo=false) 295 { 296 // First item of array elements should be blog's name, System or Plugins 297 $res = '<h2>'.($with_home_link ? 298 '<a class="go_home" href="index.php"><img src="style/dashboard.png" alt="'.__('Go to dashboard').'" /></a>' : 299 '<img src="style/dashboard-alt.png" alt="" />'); 300 $index = 0; 301 foreach ($elements as $element => $url) { 302 $res .= ($with_home_link ? ($index == 1 ? ' : ' : ' › ') : ($index == 0 ? ' ' : ' › ')). 303 ($url ? '<a href="'.$url.'">' : '').$element.($url ? '</a>' : ''); 304 $index++; 305 } 306 $res .= '</h2>'; 307 if ($echo) { 308 echo $res; 309 } 310 return $res; 311 } 312 313 public static function message($msg,$timestamp=true,$div=false,$echo=true,$class='message') 269 314 { 270 315 global $core; … … 272 317 $res = ''; 273 318 if ($msg != '') { 274 $res = ($div ? '<div class=" message">' : '').'<p'.($div ? '' : ' class="message"').'>'.319 $res = ($div ? '<div class="'.$class.'">' : '').'<p'.($div ? '' : ' class="'.$class.'"').'>'. 275 320 ($timestamp ? dt::str(__('%H:%M:%S:'),null,$core->auth->getInfo('user_tz')).' ' : '').$msg. 276 321 '</p>'.($div ? '</div>' : ''); … … 280 325 } 281 326 return $res; 327 } 328 329 public static function success($msg,$timestamp=true,$div=false,$echo=true) 330 { 331 self::message($msg,$timestamp,$div,$echo,"success"); 282 332 } 283 333 … … 333 383 { 334 384 $args = func_get_args(); 385 386 $args = new ArrayObject($args); 387 388 # --BEHAVIOR-- adminPageHelpBlock 389 $GLOBALS['core']->callBehavior('adminPageHelpBlock',$args); 390 335 391 if (empty($args)) { 336 392 return; … … 371 427 372 428 echo 373 '<div id="help"><hr /><div class="help-content clear"><h 2>'.__('Help').'</h2>'.429 '<div id="help"><hr /><div class="help-content clear"><h3>'.__('Help about this page').'</h3>'. 374 430 $content. 375 431 '</div></div>'; … … 390 446 } 391 447 448 public static function jsToggles() 449 { 450 if($GLOBALS['core']->auth->user_prefs->toggles) { 451 $unfolded_sections = explode(',',$GLOBALS['core']->auth->user_prefs->toggles->unfolded_sections); 452 foreach ($unfolded_sections as $k=>&$v) { 453 if ($v == '') { 454 unset($unfolded_sections[$k]); 455 } else { 456 $v = "'".html::escapeJS($v)."':true"; 457 } 458 } 459 } else { 460 $unfolded_sections=array(); 461 } 462 return '<script type="text/javascript">'."\n". 463 "//<![CDATA[\n". 464 'dotclear.unfolded_sections = {'.join(",",$unfolded_sections)."};\n". 465 "\n//]]>\n". 466 "</script>\n"; 467 } 468 392 469 public static function jsCommon() 393 470 { … … 411 488 412 489 self::jsVar('dotclear.msg.help', 413 __('help')). 490 __('Help about this page')). 491 self::jsVar('dotclear.msg.help_hide', 492 __('Hide')). 493 self::jsVar('dotclear.msg.to_select', 494 __('Select:')). 414 495 self::jsVar('dotclear.msg.no_selection', 415 496 __('no selection')). … … 417 498 __('select all')). 418 499 self::jsVar('dotclear.msg.invert_sel', 419 __(' invert selection')).500 __('Invert selection')). 420 501 self::jsVar('dotclear.msg.website', 421 502 __('Web site:')). … … 434 515 self::jsVar('dotclear.msg.confirm_delete_posts', 435 516 __("Are you sure you want to delete selected entries (%s)?")). 517 self::jsVar('dotclear.msg.confirm_delete_categories', 518 __("Are you sure you want to delete selected categories (%s)?")). 436 519 self::jsVar('dotclear.msg.confirm_delete_post', 437 520 __("Are you sure you want to delete this entry?")). 521 self::jsVar('dotclear.msg.click_to_unlock', 522 __("Click here to unlock the field")). 438 523 self::jsVar('dotclear.msg.confirm_spam_delete', 439 524 __('Are you sure you want to delete all spams?')). … … 482 567 self::jsVar('dotclear.msg.load_enhanced_uploader', 483 568 __('Loading enhanced uploader, please wait.')). 484 "\n//]]>\n".569 "\n//]]>\n". 485 570 "</script>\n"; 486 571 } … … 489 574 { 490 575 return 491 '<!--[if lt IE 8]>'."\n".492 self::jsLoad('js/ie7/IE 8.js').576 '<!--[if lt IE 9]>'."\n". 577 self::jsLoad('js/ie7/IE9.js'). 493 578 '<link rel="stylesheet" type="text/css" href="style/iesucks.css" />'."\n". 494 579 '<![endif]-->'."\n"; … … 704 789 '<link rel="stylesheet" type="text/css" href="style/jsUpload/style.css" />'."\n". 705 790 706 '<script id="template-upload" type="text/x-tmpl">707 {% for (var i=0, file; file=o.files[i]; i++) { %}708 <div class="template-upload fade">709 <div class="upload-file">710 <div class="upload-fileinfo">711 <span class="upload-filename">{%=file.name%}</span>712 <span class="upload-filesize">({%=o.formatFileSize(file.size)%})</span>713 <span class="upload-filecancel cancel">'.__('Cancel').'</span>714 {% if (!o.files.error && !i && !o.options.autoUpload) { %}715 <input type="submit" class="button start" value="'.__('Send').'"/>716 {% } %}717 <span class="upload-filemsg"></span>718 </div>719 {% if (!o.files.error) { %}720 <div class="upload-progress progress progress-success progress-striped active"><div class="bar" style="width:0%;"></div></div>721 {% } %}722 </div>723 {% } %}724 </script>725 <!-- The template to display files available for download -->726 <script id="template-download" type="text/x-tmpl">727 {% for (var i=0, file; file=o.files[i]; i++) { %}728 <div class="template-download fade">729 <div class="upload-file">730 <div class="upload-fileinfo">731 <span class="upload-filename">{%=file.name%}</span>732 <span class="upload-filesize">({%=o.formatFileSize(file.size)%})</span>733 <span class="upload-filemsg{% if (file.error) { %} upload-error{% } %}">734 {% if (file.error) { %}735 '.__('Error:').' {%=file.error%}736 {% } else { %}737 '.__('File successfully uploaded.').'738 {% } %}739 </span>740 </div>741 <div class="upload-progress">742 {% if (!file.error) { %}743 <div class="bar" style="width:100%;">100%</div>744 {% } %}745 </div>746 </div>747 {% } %}748 </script>'.749 750 self::jsLoad('js/jsUpload/vendor/jquery.ui.widget.js').751 self::jsLoad('js/jsUpload/tmpl.js').752 self::jsLoad('js/jsUpload/load-image.js').753 self::jsLoad('js/jsUpload/jquery.iframe-transport.js').754 self::jsLoad('js/jsUpload/jquery.fileupload.js').755 self::jsLoad('js/jsUpload/jquery.fileupload-process.js').756 self::jsLoad('js/jsUpload/jquery.fileupload-resize.js').757 self::jsLoad('js/jsUpload/jquery.fileupload-ui.js').758 759 791 '<script type="text/javascript">'."\n". 760 792 "//<![CDATA[\n". … … 773 805 self::jsVar('dotclear.jsUpload.msg.clean',__('Clean')). 774 806 self::jsVar('dotclear.jsUpload.msg.upload',__('Upload')). 807 self::jsVar('dotclear.jsUpload.msg.send',__('Send')). 808 self::jsVar('dotclear.jsUpload.msg.file_successfully_uploaded',__('File successfully uploaded.')). 775 809 self::jsVar('dotclear.jsUpload.msg.no_file_in_queue',__('No file in queue.')). 776 810 self::jsVar('dotclear.jsUpload.msg.file_in_queue',__('1 file in queue.')). … … 779 813 self::jsVar('dotclear.jsUpload.base_url',$base_url). 780 814 "\n//]]>\n". 781 "</script>\n"; 815 "</script>\n". 816 817 self::jsLoad('js/jsUpload/vendor/jquery.ui.widget.js'). 818 self::jsLoad('js/jsUpload/tmpl.js'). 819 self::jsLoad('js/jsUpload/template-upload.js'). 820 self::jsLoad('js/jsUpload/template-download.js'). 821 self::jsLoad('js/jsUpload/load-image.js'). 822 self::jsLoad('js/jsUpload/jquery.iframe-transport.js'). 823 self::jsLoad('js/jsUpload/jquery.fileupload.js'). 824 self::jsLoad('js/jsUpload/jquery.fileupload-process.js'). 825 self::jsLoad('js/jsUpload/jquery.fileupload-resize.js'). 826 self::jsLoad('js/jsUpload/jquery.fileupload-ui.js'); 782 827 } 783 828 -
inc/admin/lib.dc.page.php
r1699 r1718 613 613 "//<![CDATA[\n". 614 614 "\$(function() {\n". 615 " \$.pageTabs(".$default.");\n".615 " pagetabs = \$.pageTabs(".$default.");\n". 616 616 "});\n". 617 617 "\n//]]>\n". 618 "</script>\n"; 618 "</script>\n". 619 "<!--[if lt IE 8]>\n". 620 self::jsLoad('js/ie7/ie7-hashchange.js'). 621 '<script type="text/javascript">'."\n". 622 "//<![CDATA[\n". 623 "\$(function() {". 624 "\$(window).hashchange( function(){". 625 "pagetabs.showDiv(document.location.hash.split('#').join(''));". 626 "});". 627 "});". 628 "\n//]]>\n". 629 "</script>\n". 630 "<![endif]-->\n"; 619 631 } 620 632
Note: See TracChangeset
for help on using the changeset viewer.