Changeset 2609:c26642f775e2 for inc/admin
- 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. - Location:
- inc/admin
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/admin/class.dc.menu.php
r2566 r2593 4 4 # This file is part of Dotclear 2. 5 5 # 6 # Copyright (c) 2003-201 3Olivier Meunier & Association Dotclear6 # Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear 7 7 # Licensed under the GPL version 2.0 license. 8 8 # See LICENSE file or … … 14 14 class dcMenu 15 15 { 16 private $items; 16 17 private $id; 17 18 public $title; 18 19 public function __construct($id,$title,$itemSpace='') 19 public $separator; 20 21 public function __construct($id,$title,$separator='') 20 22 { 21 23 $this->id = $id; 22 24 $this->title = $title; 23 $this-> itemSpace = $itemSpace;25 $this->separator = $separator; 24 26 $this->items = array(); 25 27 } 26 28 29 public function getID() 30 { 31 return $this->id; 32 } 33 34 public function getTitle() 35 { 36 return $this->title; 37 } 38 39 public function getSeparator() 40 { 41 return $this->separator; 42 } 43 44 public function getItems() 45 { 46 return $this->items; 47 } 48 27 49 public function addItem($title,$url,$img,$active,$show=true,$id=null,$class=null) 28 50 { … … 31 53 } 32 54 } 33 55 34 56 public function prependItem($title,$url,$img,$active,$show=true,$id=null,$class=null) 35 57 { … … 38 60 } 39 61 } 40 41 public function draw() 42 { 43 if (count($this->items) == 0) { 44 return ''; 45 } 46 47 $res = 48 '<div id="'.$this->id.'">'. 49 ($this->title ? '<h3>'.$this->title.'</h3>' : ''). 50 '<ul>'."\n"; 51 52 for ($i=0; $i<count($this->items); $i++) 53 { 54 if ($i+1 < count($this->items) && $this->itemSpace != '') { 55 $res .= preg_replace('|</li>$|',$this->itemSpace.'</li>',$this->items[$i]); 56 $res .= "\n"; 57 } else { 58 $res .= $this->items[$i]."\n"; 59 } 60 } 61 62 $res .= '</ul></div>'."\n"; 63 64 return $res; 65 } 66 62 67 63 protected function itemDef($title,$url,$img,$active,$id=null,$class=null) 68 64 { … … 74 70 $ahtml = ''; 75 71 } 76 77 $img = dc_admin_icon_url($img); 78 72 73 return array( 74 'title' => $title, 75 'link' => $link, 76 'ahtml' => $ahtml, 77 'img' => dc_admin_icon_url($img), 78 'active' => (boolean) $active, 79 'id' => $id, 80 'class' => $class 81 ); 82 } 83 84 /** 85 @deprecated Use Template engine instead 86 */ 87 public function draw() 88 { 89 if (count($this->items) == 0) { 90 return ''; 91 } 92 93 $res = 94 '<div id="'.$this->id.'">'. 95 ($this->title ? '<h3>'.$this->title.'</h3>' : ''). 96 '<ul>'."\n"; 97 98 for ($i=0; $i<count($this->items); $i++) 99 { 100 if ($i+1 < count($this->items) && $this->separator != '') { 101 $res .= preg_replace('|</li>$|',$this->separator.'</li>',$this->drawItem($this->items[$i])); 102 $res .= "\n"; 103 } else { 104 $res .= $this->drawItem($this->items[$i])."\n"; 105 } 106 } 107 108 $res .= '</ul></div>'."\n"; 109 110 return $res; 111 } 112 113 /** 114 @deprecated Use Template engine instead 115 */ 116 protected function drawItem($item) 117 { 79 118 return 80 '<li'.(($ active || $class) ? ' class="'.(($active) ? 'active ' : '').(($class) ? $class: '').'"' : '').81 (($i d) ? ' id="'.$id.'"' : '').82 (($i mg) ? ' style="background-image: url('.$img.');"' : '').119 '<li'.(($item['active'] || $item['class']) ? ' class="'.(($item['active']) ? 'active ' : '').(($item['class']) ? $item['class'] : '').'"' : ''). 120 (($item['id']) ? ' id="'.$item['id'].'"' : ''). 121 (($item['img']) ? ' style="background-image: url('.$item['img'].');"' : ''). 83 122 '>'. 84 85 '<a href="'.$ link.'"'.$ahtml.'>'.$title.'</a></li>'."\n";123 124 '<a href="'.$item['link'].'"'.$item['ahtml'].'>'.$item['title'].'</a></li>'."\n"; 86 125 } 87 126 } 127 ?> -
inc/admin/lib.dc.page.php
r2468 r2609 16 16 class dcPage 17 17 { 18 private static $loaded_js =array();18 private static $loaded_js = array(); 19 19 private static $N_TYPES = array( 20 20 "success" => "success", … … 29 29 global $core; 30 30 31 if ($core->blog && $core->auth->check($permissions,$core->blog->id)) 32 { 31 if ($core->blog && $core->auth->check($permissions,$core->blog->id)) { 33 32 return; 34 33 } … … 319 318 'xml:lang="'.$core->auth->getInfo('user_lang').'" '. 320 319 'lang="'.$core->auth->getInfo('user_lang').'">'."\n". 321 '<meta name="viewport" content="width=device-width, initial-scale=1.0" />'."\n".322 320 "<head>\n". 321 ' <meta name="viewport" content="width=device-width, initial-scale=1.0" />'."\n". 323 322 ' <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'."\n". 324 323 ' <title>'.$title.' - '.html::escapeHTML($core->blog->name).' - '.html::escapeHTML(DC_VENDOR_NAME).' - '.DC_VERSION.'</title>'."\n". … … 659 658 self::jsVar('dotclear.msg.confirm_delete_media', 660 659 __('Are you sure you want to remove media "%s"?')). 660 self::jsVar('dotclear.msg.confirm_delete_directory', 661 __('Are you sure you want to remove directory "%s"?')). 661 662 self::jsVar('dotclear.msg.confirm_extract_current', 662 663 __('Are you sure you want to extract archive in current directory?')). … … 667 668 self::jsVar('dotclear.msg.confirm_delete_plugin', 668 669 __('Are you sure you want to delete "%s" plugin?')). 670 self::jsVar('dotclear.msg.confirm_delete_plugins', 671 __('Are you sure you want to delete selected plugins?')). 669 672 self::jsVar('dotclear.msg.use_this_theme', 670 673 __('Use this theme')). … … 673 676 self::jsVar('dotclear.msg.confirm_delete_theme', 674 677 __('Are you sure you want to delete "%s" theme?')). 678 self::jsVar('dotclear.msg.confirm_delete_themes', 679 __('Are you sure you want to delete selected themes?')). 675 680 self::jsVar('dotclear.msg.confirm_delete_backup', 676 681 __('Are you sure you want to delete this backup?')). 682 self::jsVar('dotclear.msg.confirm_revert_backup', 683 __('Are you sure you want to revert to this backup?')). 677 684 self::jsVar('dotclear.msg.zip_file_content', 678 685 __('Zip file content')). … … 894 901 895 902 "jsToolBar.prototype.elements.img_select.title = '".html::escapeJS(__('Media chooser'))."'; ". 896 "jsToolBar.prototype.elements.post_link.title = '".html::escapeJS(__('Link to an entry'))."'; "; 903 "jsToolBar.prototype.elements.post_link.title = '".html::escapeJS(__('Link to an entry'))."'; ". 904 905 "jsToolBar.prototype.elements.removeFormat.title = '".html::escapeJS(__('Remove text formating'))."'; "; 897 906 898 907 if (!$GLOBALS['core']->auth->check('media,media_admin',$GLOBALS['core']->blog->id)) { -
inc/admin/lib.dc.page.php
r2513 r2609 18 18 private static $loaded_js = array(); 19 19 private static $N_TYPES = array( 20 "success" => "success", 21 "warning" => "warning-msg", 22 "error" => "error", 23 "message" => "message", 20 "success" => "success", 21 "warning" => "warning-msg", 22 "error" => "error", 23 "message" => "message", 24 24 "static" => "static-msg"); 25 25 … … 104 104 105 105 self::jsLoadIE7(). 106 ' <link rel="stylesheet" href="style/default.css" type="text/css" media="screen" />'."\n";106 ' <link rel="stylesheet" href="style/default.css" type="text/css" media="screen" />'."\n"; 107 107 if (l10n::getTextDirection($GLOBALS['_lang']) == 'rtl') { 108 108 echo 109 ' <link rel="stylesheet" href="style/default-rtl.css" type="text/css" media="screen" />'."\n";109 ' <link rel="stylesheet" href="style/default-rtl.css" type="text/css" media="screen" />'."\n"; 110 110 } 111 111 … … 113 113 $user_ui_hide_std_favicon = $core->auth->user_prefs->interface->hide_std_favicon; 114 114 if (!$user_ui_hide_std_favicon) { 115 echo 115 echo 116 116 '<link rel="icon" type="image/png" href="images/favicon96-login.png" />'. 117 117 '<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />'; 118 118 } 119 119 120 echo 120 121 self::jsCommon(). … … 212 213 $notifications = array(); 213 214 } 214 215 215 216 $n = array_merge($options,array('class' => $class,'ts' => time(), 'text' => $message)); 216 217 if ($type != "static") { … … 326 327 327 328 self::jsLoadIE7(). 328 ' <link rel="stylesheet" href="style/default.css" type="text/css" media="screen" />'."\n";329 ' <link rel="stylesheet" href="style/default.css" type="text/css" media="screen" />'."\n"; 329 330 if (l10n::getTextDirection($GLOBALS['_lang']) == 'rtl') { 330 331 echo 331 ' <link rel="stylesheet" href="style/default-rtl.css" type="text/css" media="screen" />'."\n";332 ' <link rel="stylesheet" href="style/default-rtl.css" type="text/css" media="screen" />'."\n"; 332 333 } 333 334 … … 565 566 "</script>\n"; 566 567 } 567 568 568 569 public static function jsCommon() 569 570 { … … 590 591 "//<![CDATA[\n". 591 592 self::jsVar('dotclear.nonce',$GLOBALS['core']->getNonce()). 593 592 594 self::jsVar('dotclear.img_plus_src','images/expand.png'). 593 595 self::jsVar('dotclear.img_plus_alt',__('uncover')). … … 709 711 self::jsVar('dotclear.msg.module_tags', 710 712 __('Tags:')). 711 713 "\n//]]>\n". 712 714 "</script>\n"; 713 715 } … … 771 773 public static function jsModal() 772 774 { 773 774 775 776 777 778 779 780 781 775 return 776 '<link rel="stylesheet" type="text/css" href="style/modal/modal.css" />'."\n". 777 self::jsLoad('js/jquery/jquery.modal.js'). 778 '<script type="text/javascript">'."\n". 779 "//<![CDATA[\n". 780 self::jsVar('$.modal.prototype.params.loader_img','style/modal/loader.gif'). 781 self::jsVar('$.modal.prototype.params.close_img','style/modal/close.png'). 782 "\n//]]>\n". 783 "</script>\n"; 782 784 } 783 785 784 786 public static function jsColorPicker() 785 787 { 786 787 788 789 788 return 789 '<link rel="stylesheet" type="text/css" href="style/farbtastic/farbtastic.css" />'."\n". 790 self::jsLoad('js/jquery/jquery.farbtastic.js'). 791 self::jsLoad('js/color-picker.js'); 790 792 } 791 793 792 794 public static function jsDatePicker() 793 795 { 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 796 return 797 '<link rel="stylesheet" type="text/css" href="style/date-picker.css" />'."\n". 798 self::jsLoad('js/date-picker.js'). 799 '<script type="text/javascript">'."\n". 800 "//<![CDATA[\n". 801 802 "datePicker.prototype.months[0] = '".html::escapeJS(__('January'))."'; ". 803 "datePicker.prototype.months[1] = '".html::escapeJS(__('February'))."'; ". 804 "datePicker.prototype.months[2] = '".html::escapeJS(__('March'))."'; ". 805 "datePicker.prototype.months[3] = '".html::escapeJS(__('April'))."'; ". 806 "datePicker.prototype.months[4] = '".html::escapeJS(__('May'))."'; ". 807 "datePicker.prototype.months[5] = '".html::escapeJS(__('June'))."'; ". 808 "datePicker.prototype.months[6] = '".html::escapeJS(__('July'))."'; ". 809 "datePicker.prototype.months[7] = '".html::escapeJS(__('August'))."'; ". 810 "datePicker.prototype.months[8] = '".html::escapeJS(__('September'))."'; ". 811 "datePicker.prototype.months[9] = '".html::escapeJS(__('October'))."'; ". 812 "datePicker.prototype.months[10] = '".html::escapeJS(__('November'))."'; ". 813 "datePicker.prototype.months[11] = '".html::escapeJS(__('December'))."'; ". 814 815 "datePicker.prototype.days[0] = '".html::escapeJS(__('Monday'))."'; ". 816 "datePicker.prototype.days[1] = '".html::escapeJS(__('Tuesday'))."'; ". 817 "datePicker.prototype.days[2] = '".html::escapeJS(__('Wednesday'))."'; ". 818 "datePicker.prototype.days[3] = '".html::escapeJS(__('Thursday'))."'; ". 819 "datePicker.prototype.days[4] = '".html::escapeJS(__('Friday'))."'; ". 820 "datePicker.prototype.days[5] = '".html::escapeJS(__('Saturday'))."'; ". 821 "datePicker.prototype.days[6] = '".html::escapeJS(__('Sunday'))."'; ". 822 823 "datePicker.prototype.img_src = 'images/date-picker.png'; ". 824 825 "datePicker.prototype.close_msg = '".html::escapeJS(__('close'))."'; ". 826 "datePicker.prototype.now_msg = '".html::escapeJS(__('now'))."'; ". 827 828 "\n//]]>\n". 829 "</script>\n"; 828 830 } 829 831 830 832 public static function jsToolBar() 831 833 { 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 834 $res = 835 '<link rel="stylesheet" type="text/css" href="style/jsToolBar/jsToolBar.css" />'. 836 '<script type="text/javascript" src="js/jsToolBar/jsToolBar.js"></script>'; 837 838 if (isset($GLOBALS['core']->auth) && $GLOBALS['core']->auth->getOption('enable_wysiwyg')) { 839 $res .= '<script type="text/javascript" src="js/jsToolBar/jsToolBar.wysiwyg.js"></script>'; 840 } 841 842 $res .= 843 '<script type="text/javascript" src="js/jsToolBar/jsToolBar.dotclear.js"></script>'. 844 '<script type="text/javascript">'."\n". 845 "//<![CDATA[\n". 846 "jsToolBar.prototype.dialog_url = 'popup.php'; ". 847 "jsToolBar.prototype.iframe_css = '". 848 'body{'. 849 'font: 12px "DejaVu Sans","Lucida Grande","Lucida Sans Unicode",Arial,sans-serif;'. 850 'color : #000;'. 851 'background: #f9f9f9;'. 852 'margin: 0;'. 853 'padding : 2px;'. 854 'border: none;'. 855 (l10n::getTextDirection($GLOBALS['_lang']) == 'rtl' ? 'direction:rtl;' : ''). 856 '}'. 857 'pre, code, kbd, samp {'. 858 'font-family:"Courier New",Courier,monospace;'. 859 'font-size : 1.1em;'. 860 '}'. 861 'code {'. 862 'color : #666;'. 863 'font-weight : bold;'. 864 '}'. 865 'body > p:first-child {'. 866 'margin-top: 0;'. 867 '}'. 868 "'; ". 869 "jsToolBar.prototype.base_url = '".html::escapeJS($GLOBALS['core']->blog->host)."'; ". 870 "jsToolBar.prototype.switcher_visual_title = '".html::escapeJS(__('visual'))."'; ". 871 "jsToolBar.prototype.switcher_source_title = '".html::escapeJS(__('source'))."'; ". 872 "jsToolBar.prototype.legend_msg = '". 873 html::escapeJS(__('You can use the following shortcuts to format your text.'))."'; ". 874 "jsToolBar.prototype.elements.blocks.options.none = '".html::escapeJS(__('-- none --'))."'; ". 875 "jsToolBar.prototype.elements.blocks.options.nonebis = '".html::escapeJS(__('-- block format --'))."'; ". 876 "jsToolBar.prototype.elements.blocks.options.p = '".html::escapeJS(__('Paragraph'))."'; ". 877 "jsToolBar.prototype.elements.blocks.options.h1 = '".html::escapeJS(__('Level 1 header'))."'; ". 878 "jsToolBar.prototype.elements.blocks.options.h2 = '".html::escapeJS(__('Level 2 header'))."'; ". 879 "jsToolBar.prototype.elements.blocks.options.h3 = '".html::escapeJS(__('Level 3 header'))."'; ". 880 "jsToolBar.prototype.elements.blocks.options.h4 = '".html::escapeJS(__('Level 4 header'))."'; ". 881 "jsToolBar.prototype.elements.blocks.options.h5 = '".html::escapeJS(__('Level 5 header'))."'; ". 882 "jsToolBar.prototype.elements.blocks.options.h6 = '".html::escapeJS(__('Level 6 header'))."'; ". 883 "jsToolBar.prototype.elements.strong.title = '".html::escapeJS(__('Strong emphasis'))."'; ". 884 "jsToolBar.prototype.elements.em.title = '".html::escapeJS(__('Emphasis'))."'; ". 885 "jsToolBar.prototype.elements.ins.title = '".html::escapeJS(__('Inserted'))."'; ". 886 "jsToolBar.prototype.elements.del.title = '".html::escapeJS(__('Deleted'))."'; ". 887 "jsToolBar.prototype.elements.quote.title = '".html::escapeJS(__('Inline quote'))."'; ". 888 "jsToolBar.prototype.elements.code.title = '".html::escapeJS(__('Code'))."'; ". 889 "jsToolBar.prototype.elements.br.title = '".html::escapeJS(__('Line break'))."'; ". 890 "jsToolBar.prototype.elements.blockquote.title = '".html::escapeJS(__('Blockquote'))."'; ". 891 "jsToolBar.prototype.elements.pre.title = '".html::escapeJS(__('Preformated text'))."'; ". 892 "jsToolBar.prototype.elements.ul.title = '".html::escapeJS(__('Unordered list'))."'; ". 893 "jsToolBar.prototype.elements.ol.title = '".html::escapeJS(__('Ordered list'))."'; ". 894 895 "jsToolBar.prototype.elements.link.title = '".html::escapeJS(__('Link'))."'; ". 896 "jsToolBar.prototype.elements.link.href_prompt = '".html::escapeJS(__('URL?'))."'; ". 897 "jsToolBar.prototype.elements.link.hreflang_prompt = '".html::escapeJS(__('Language?'))."'; ". 898 899 "jsToolBar.prototype.elements.img.title = '".html::escapeJS(__('External image'))."'; ". 900 "jsToolBar.prototype.elements.img.src_prompt = '".html::escapeJS(__('URL?'))."'; ". 901 902 "jsToolBar.prototype.elements.img_select.title = '".html::escapeJS(__('Media chooser'))."'; ". 901 903 "jsToolBar.prototype.elements.post_link.title = '".html::escapeJS(__('Link to an entry'))."'; ". 902 904 903 905 "jsToolBar.prototype.elements.removeFormat.title = '".html::escapeJS(__('Remove text formating'))."'; "; 904 906 905 906 907 908 909 910 911 912 913 907 if (!$GLOBALS['core']->auth->check('media,media_admin',$GLOBALS['core']->blog->id)) { 908 $res .= "jsToolBar.prototype.elements.img_select.disabled = true;\n"; 909 } 910 911 $res .= 912 "\n//]]>\n". 913 "</script>\n"; 914 915 return $res; 914 916 } 915 917 916 918 public static function jsUpload($params=array(),$base_url=null) 917 919 { 918 919 920 921 922 923 924 925 920 if (!$base_url) { 921 $base_url = path::clean(dirname(preg_replace('/(\?.*$)?/','',$_SERVER['REQUEST_URI']))).'/'; 922 } 923 924 $params = array_merge($params,array( 925 'sess_id='.session_id(), 926 'sess_uid='.$_SESSION['sess_browser_uid'], 927 'xd_check='.$GLOBALS['core']->getNonce() 926 928 )); 927 929 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 930 return 931 '<script type="text/javascript">'."\n". 932 "//<![CDATA[\n". 933 "dotclear.jsUpload = {};\n". 934 "dotclear.jsUpload.msg = {};\n". 935 self::jsVar('dotclear.msg.enhanced_uploader_activate',__('Temporarily activate enhanced uploader')). 936 self::jsVar('dotclear.msg.enhanced_uploader_disable',__('Temporarily disable enhanced uploader')). 937 self::jsVar('dotclear.jsUpload.msg.limit_exceeded',__('Limit exceeded.')). 938 self::jsVar('dotclear.jsUpload.msg.size_limit_exceeded',__('File size exceeds allowed limit.')). 939 self::jsVar('dotclear.jsUpload.msg.canceled',__('Canceled.')). 940 self::jsVar('dotclear.jsUpload.msg.http_error',__('HTTP Error:')). 941 self::jsVar('dotclear.jsUpload.msg.error',__('Error:')). 942 self::jsVar('dotclear.jsUpload.msg.choose_file',__('Choose file')). 943 self::jsVar('dotclear.jsUpload.msg.choose_files',__('Choose files')). 944 self::jsVar('dotclear.jsUpload.msg.cancel',__('Cancel')). 945 self::jsVar('dotclear.jsUpload.msg.clean',__('Clean')). 946 self::jsVar('dotclear.jsUpload.msg.upload',__('Upload')). 945 947 self::jsVar('dotclear.jsUpload.msg.send',__('Send')). 946 948 self::jsVar('dotclear.jsUpload.msg.file_successfully_uploaded',__('File successfully uploaded.')). 947 948 949 950 951 952 949 self::jsVar('dotclear.jsUpload.msg.no_file_in_queue',__('No file in queue.')). 950 self::jsVar('dotclear.jsUpload.msg.file_in_queue',__('1 file in queue.')). 951 self::jsVar('dotclear.jsUpload.msg.files_in_queue',__('%d files in queue.')). 952 self::jsVar('dotclear.jsUpload.msg.queue_error',__('Queue error:')). 953 self::jsVar('dotclear.jsUpload.base_url',$base_url). 954 "\n//]]>\n". 953 955 "</script>\n". 954 956 … … 967 969 public static function jsToolMan() 968 970 { 969 970 971 972 973 974 975 976 971 return 972 '<script type="text/javascript" src="js/tool-man/core.js"></script>'. 973 '<script type="text/javascript" src="js/tool-man/events.js"></script>'. 974 '<script type="text/javascript" src="js/tool-man/css.js"></script>'. 975 '<script type="text/javascript" src="js/tool-man/coordinates.js"></script>'. 976 '<script type="text/javascript" src="js/tool-man/drag.js"></script>'. 977 '<script type="text/javascript" src="js/tool-man/dragsort.js"></script>'. 978 '<script type="text/javascript" src="js/dragsort-tablerows.js"></script>'; 977 979 } 978 980 979 981 public static function jsMetaEditor() 980 982 { 981 982 983 return 984 '<script type="text/javascript" src="js/meta-editor.js"></script>'; 983 985 } 984 986 } -
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.