Changeset 2313:ef1db3d7c388 for inc/admin
- Timestamp:
- 10/08/13 15:27:39 (12 years ago)
- Branch:
- twig
- Parents:
- 1524:913f5a36bbb0 (diff), 2312:d01c85eaa37d (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:
-
- 7 edited
-
default-templates/auth.html.twig (modified) (3 diffs)
-
default-templates/forms/form_layout.html.twig (modified) (2 diffs)
-
default-templates/js_helpers.html.twig (modified) (1 diff)
-
lib.dc.page.php (modified) (34 diffs)
-
lib.dc.page.php (modified) (9 diffs)
-
prepend.php (modified) (7 diffs)
-
prepend.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
inc/admin/default-templates/auth.html.twig
r1517 r2313 1 1 {% import "js_helpers.html.twig" as js %} 2 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang=" <?php echo $dlang; ?>" lang="en">3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{{dlang}}" lang="{{dlang}}"> 4 4 <head> 5 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 6 <meta http-equiv="Content-Script-Type" content="text/javascript" /> 7 7 <meta http-equiv="Content-Style-Type" content="text/css" /> 8 <meta http-equiv="Content-Language" content=" en" />8 <meta http-equiv="Content-Language" content="{{dlang}}" /> 9 9 <meta name="ROBOTS" content="NOARCHIVE,NOINDEX,NOFOLLOW" /> 10 10 <meta name="GOOGLEBOT" content="NOSNIPPET" /> 11 11 <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 12 12 <title>{{vendor_name}}</title> 13 <link rel="stylesheet" href="{{theme_url}}style/default.css" type="text/css" media="screen" /> 13 <link rel="icon" type="image/png" href="images/favicon96-logout.png" /> 14 <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> 14 15 {{ js.load_IE7 }} 15 16 {{ js.common }} 16 <script type="text/javascript" src="{{theme_url}}js/_auth.js"></script> 17 <link rel="stylesheet" href="{{theme_url}}style/default.css" type="text/css" media="screen" /> 18 <script type="text/javascript"> 19 //<![CDATA[ 20 $(window).load(function() { 21 var uid = $('input[name=user_id]'); 22 var upw = $('input[name=user_pwd]'); 23 uid.focus(); 24 25 if (upw.length == 0) { return; } 26 27 uid.keypress(processKey); 28 29 function processKey(evt) { 30 if (evt.which == 13 && upw.val() == '') { 31 upw.focus(); 32 return false; 33 } 34 return true; 35 }; 36 $.cookie('dc_admin_test_cookie',true); 37 if ($.cookie('dc_admin_test_cookie')) { 38 $('#cookie_help').hide(); 39 $.cookie('dc_admin_test_cookie', '', {'expires': -1}); 40 } else { 41 $('#cookie_help').show(); 42 } 43 $('#issue #more').toggleWithLegend($('#issue').children().not('#more')); 44 }); 45 //]]> 46 </script> 17 47 </head> 18 48 19 49 <body id="dotclear-admin" class="auth"> 20 50 21 {% form 'auth' %}22 <div id="login-screen"> 51 {% form 'auth' with {'id':'login-screen'} %} 52 23 53 <h1>{{vendor_name}}</h1> 24 54 {% if messages.alert is not empty %} … … 64 94 <p>{{ form_field('user_id') }}</p> 65 95 <p>{{ form_field('user_pwd') }}</p> 66 <p>{{ form_field('user_remember',{},{'nestedlabel': true, 'labelclass':'classic'}) }}</p>67 <p>{{ form_field('auth_login',{"class":" add button"}) }}</p>96 <p>{{ form_field('user_remember',{},{'nestedlabel':false}) }}</p> 97 <p>{{ form_field('auth_login',{"class":"login"}) }}{{ form_hidden() }}</p> 68 98 {% if safe_mode %} 69 99 </fieldset> … … 84 114 </div> 85 115 {% endif %} 86 </div>87 116 {% endform %} 88 117 </body> -
inc/admin/default-templates/forms/form_layout.html.twig
r1517 r2313 38 38 {% endblock field_hidden %} 39 39 40 {% block field_input %}40 {% block field_input -%} 41 41 {% autoescape "html" %} 42 42 {% spaceless %} 43 43 {% set type = type|default('text') %} 44 {{ block('startlabel')}}45 <input type="{{ type }}" {{ block('field_attr') }} {% if value is not empty %}value="{{ value }}" {% endif%} />46 {{ block('endlabel')}}44 {{- block('startlabel') -}} 45 <input type="{{ type }}" {{ block('field_attr') }} {% if value is not empty %}value="{{ value }}" {%- endif -%} /> 46 {{- block('endlabel') -}} 47 47 {% endspaceless %} 48 48 {% endautoescape %} 49 {% endblock field_input %}49 {%- endblock field_input %} 50 50 51 {% block field_checkbox %} 52 {% spaceless %} 51 {% block field_checkbox -%} 53 52 {% set type = type|default('checkbox') %} 54 53 {% set nestedlabel = true %} 55 54 {% set labelclass = "classic" %} 56 {% set descafter = true %}55 {% set descafter = true -%} 57 56 {{ block('field_input') }} 58 {% endspaceless %} 59 {% endblock field_checkbox %} 57 {%- endblock field_checkbox %} 60 58 61 59 {% block field_attr %} 62 60 {% spaceless %} 63 {% if id %}id="{{id}}"{% endif %} name="{{name}}" {% if read_only %} disabled="disabled"{% endif %}{#{% if required %} required="required"{% endif %}#}{% if maxlength %} maxlength="{{ maxlength }}"{% endif %}{% if checked %} checked="{{ checked }}"{% endif %}{% if pattern %} pattern="{{ pattern }}"{% endif %}64 {% for attrname,attrvalue in attr %}{{attrname}}="{{attrvalue}}" {% endfor%}61 {% if id %}id="{{id}}"{% endif %} name="{{name}}" {% if read_only %} disabled="disabled"{% endif %}{#{% if required %} required="required"{% endif %}#}{% if maxlength %} maxlength="{{ maxlength }}"{% endif %}{% if checked %} checked="{{ checked }}"{% endif %}{% if pattern %} pattern="{{ pattern }}"{% endif -%} 62 {%- for attrname,attrvalue in attr -%}{{attrname}}="{{attrvalue}}" {%- endfor -%} 65 63 {% endspaceless %} 66 64 {% endblock field_attr %} … … 92 90 {% endblock field_combo %} 93 91 94 {% block startlabel %}92 {% block startlabel -%} 95 93 {% spaceless %} 96 {% if label is not empty %} 97 {% if required is not empty %} 98 {% set labelclass = labelclass ~ " required" %} 99 {% endif %} 100 <label for="{{name}}" {% if labelclass is not empty %}class="{{labelclass}}"{% endif %}>{% if required is not empty %}<abbr title="{{__('Required field')}}">*</abbr>{% endif %} 101 102 {% if descafter is empty %} {{label}} {% endif %} 103 {% if nestedlabel is empty %}</label> {% endif %} 104 {% endif %} 94 {%- if label is not empty -%} 95 {%- if required is not empty -%} 96 {%- set labelclass = labelclass ~ " required" -%} 97 {%- endif -%} 98 <label for="{{name}}" {% if labelclass is not empty %}class="{{labelclass}}"{% endif %}>{% if required is not empty %}<abbr title="{{__('Required field')}}">*</abbr>{% endif -%} 99 {%- if descafter is empty -%} {{label}} {%- endif -%} 100 {%- if nestedlabel is empty -%}</label> {%- endif -%} 101 {%- endif -%} 105 102 {% endspaceless %} 106 {% endblock startlabel %}103 {%- endblock startlabel %} 107 104 108 105 {% block endlabel %} 109 106 {% spaceless %} 110 {% if label is not empty%}111 {% if descafter %} {{label}} {% endif%}112 {% if nestedlabel is not empty %}</label>{% endif%}113 {% endif %}107 {%- if label is not empty -%} 108 {%- if descafter -%} {{label}} {%- endif -%} 109 {%- if nestedlabel is not empty -%}</label>{%- endif -%} 110 {%- endif %} 114 111 {% endspaceless %} 115 112 {% endblock endlabel %} -
inc/admin/default-templates/js_helpers.html.twig
r1507 r2313 10 10 11 11 {% macro common() %} 12 <!-- jsCommon --> 13 {{ _self.load('js/jquery/jquery.js') }} 14 {{ _self.load('js/jquery/jquery.biscuit.js') }} 15 {{ _self.load('js/jquery/jquery.bgFade.js') }} 16 {{ _self.load('js/common.js') }} 17 {{ _self.load('js/prelude.js') }} 18 <script type="text/javascript"> 19 {% autoescape 'js' %} 20 //<![CDATA[ 21 dotclear.nonce = '{{session.nonce}}'; 22 dotclear.img_plus_src = '{{theme_url}}images/expand.png'; 23 dotclear.img_plus_alt = '{{__('uncover')}}'; 24 dotclear.img_minus_src = '{{theme_url}}images/hide.png'; 25 dotclear.img_minus_alt = '{{__('hide')}}'; 26 dotclear.img_menu_on = '{{theme_url}}images/menu_on.png'; 27 dotclear.img_menu_off = '{{theme_url}}images/menu_off.png'; 28 dotclear.msg.help = '{{__('help')}}'; 29 dotclear.msg.no_selection = '{{__('no selection')}}'; 30 dotclear.msg.select_all = '{{__('select all')}}'; 31 dotclear.msg.invert_sel = '{{__('invert selection')}}'; 32 dotclear.msg.website = '{{__('Web site:')}}'; 33 dotclear.msg.email = '{{__('Email:')}}'; 34 dotclear.msg.ip_address = '{{__('IP address:')}}'; 35 dotclear.msg.error = '{{__('Error:')}}'; 36 dotclear.msg.entry_created = '{{__('Entry has been successfully created.')}}'; 37 dotclear.msg.edit_entry = '{{__('Edit entry')}}'; 38 dotclear.msg.view_entry = '{{__('view entry')}}'; 39 dotclear.msg.confirm_delete_posts = '{{__("Are you sure you want to delete selected entries (%s)?")}}'; 40 dotclear.msg.confirm_delete_post = '{{__("Are you sure you want to delete this entry?")}}'; 41 dotclear.msg.confirm_spam_delete = '{{__('Are you sure you want to delete all spams?')}}'; 42 dotclear.msg.confirm_delete_comments = '{{__('Are you sure you want to delete selected comments (%s)?')}}'; 43 dotclear.msg.confirm_delete_comment = '{{__('Are you sure you want to delete this comment?')}}'; 44 dotclear.msg.cannot_delete_users = '{{__('Users with posts cannot be deleted.')}}'; 45 dotclear.msg.confirm_delete_user = '{{__('Are you sure you want to delete selected users (%s)?')}}'; 46 dotclear.msg.confirm_delete_category = '{{__('Are you sure you want to delete category "%s"?')}}'; 47 dotclear.msg.confirm_reorder_categories = '{{__('Are you sure you want to reorder all categories?')}}'; 48 dotclear.msg.confirm_delete_media = '{{__('Are you sure you want to remove media "%s"?')}}'; 49 dotclear.msg.confirm_extract_current = '{{__('Are you sure you want to extract archive in current directory?')}}'; 50 dotclear.msg.confirm_remove_attachment = '{{__('Are you sure you want to remove attachment "%s"?')}}'; 51 dotclear.msg.confirm_delete_lang = '{{__('Are you sure you want to delete "%s" language?')}}'; 52 dotclear.msg.confirm_delete_plugin = '{{__('Are you sure you want to delete "%s" plugin?')}}'; 53 dotclear.msg.use_this_theme = '{{__('Use this theme')}}'; 54 dotclear.msg.remove_this_theme = '{{__('Remove this theme')}}'; 55 dotclear.msg.confirm_delete_theme = '{{__('Are you sure you want to delete "%s" theme?')}}'; 56 dotclear.msg.zip_file_content = '{{__('Zip file content')}}'; 57 dotclear.msg.xhtml_validator = '{{__('XHTML markup validator')}}'; 58 dotclear.msg.xhtml_valid = '{{__('XHTML content is valid.')}}'; 59 dotclear.msg.xhtml_not_valid = '{{__('There are XHTML markup errors.')}}'; 60 dotclear.msg.confirm_change_post_format = '{{__('You have unsaved changes. Switch post format will loose these changes. Proceed anyway?')}}'; 61 dotclear.msg.load_enhanced_uploader = '{{__('Loading enhanced uploader =>please wait.')}}'; 62 //]]> 63 </script> 64 {% endautoescape %} 12 <!-- jsCommon --> 13 {{ _self.load('js/jquery/jquery.js') }} 14 {% if current_blog is defined and jquery_migrate_mute -%} 15 <script type="text/javascript"> 16 //<![CDATA[ 17 jQuery.migrateMute = true 18 //]]> 19 </script> 20 {%- endif %} 21 {{ _self.load('js/jquery/jquery-migrate-1.2.1.js') }} 22 {{ _self.load('js/jquery/jquery.biscuit.js') }} 23 {{ _self.load('js/jquery/jquery.bgFade.js') }} 24 {{ _self.load('js/common.js') }} 25 {{ _self.load('js/prelude.js') }} 26 <script type="text/javascript"> 27 {% autoescape 'js' %} 28 //<![CDATA[ 29 dotclear.nonce = '{{session.nonce}}'; 30 dotclear.img_plus_src = 'images/expand.png'; 31 dotclear.img_plus_alt = '{{ __('uncover') }}'; 32 dotclear.img_minus_src = 'images/hide.png'; 33 dotclear.img_minus_alt = '{{ __('hide') }}'; 34 dotclear.img_menu_on = 'images/menu_on.png'; 35 dotclear.img_menu_off = 'images/menu_off.png'; 36 dotclear.img_plus_theme_src = 'images/plus-theme.png'; 37 dotclear.img_plus_theme_alt = '{{ __('uncover') }}'; 38 dotclear.img_minus_theme_src = 'images/minus-theme.png'; 39 dotclear.img_minus_theme_alt = '{{ __('hide') }}'; 40 dotclear.msg.help = '{{ __('Need help?') }}'; 41 dotclear.msg.new_window = '{{ __('new window') }}'; 42 dotclear.msg.help_hide = '{{ __('Hide') }}'; 43 dotclear.msg.to_select = '{{ __('Select:') }}'; 44 dotclear.msg.no_selection = '{{ __('no selection') }}'; 45 dotclear.msg.select_all = '{{ __('select all') }}'; 46 dotclear.msg.invert_sel = '{{ __('Invert selection') }}'; 47 dotclear.msg.website = '{{ __('Web site:') }}'; 48 dotclear.msg.email = '{{ __('Email:') }}'; 49 dotclear.msg.ip_address = '{{ __('IP address:') }}'; 50 dotclear.msg.error = '{{ __('Error:') }}'; 51 dotclear.msg.entry_created = '{{ __('Entry has been successfully created.') }}'; 52 dotclear.msg.edit_entry = '{{ __('Edit entry') }}'; 53 dotclear.msg.view_entry = '{{ __('view entry') }}'; 54 dotclear.msg.confirm_delete_posts = '{{ __("Are you sure you want to delete selected entries (%s)?") }}'; 55 dotclear.msg.confirm_delete_medias = '{{ __("Are you sure you want to delete selected medias (%d)?") }}'; 56 dotclear.msg.confirm_delete_categories = '{{ __("Are you sure you want to delete selected categories (%s)?") }}'; 57 dotclear.msg.confirm_delete_post = '{{ __("Are you sure you want to delete this entry?") }}'; 58 dotclear.msg.click_to_unlock = '{{ __("Click here to unlock the field") }}'; 59 dotclear.msg.confirm_spam_delete = '{{ __('Are you sure you want to delete all spams?') }}'; 60 dotclear.msg.confirm_delete_comments = '{{ __('Are you sure you want to delete selected comments (%s)?') }}'; 61 dotclear.msg.confirm_delete_comment = '{{ __('Are you sure you want to delete this comment?') }}'; 62 dotclear.msg.cannot_delete_users = '{{ __('Users with posts cannot be deleted.') }}'; 63 dotclear.msg.confirm_delete_user = '{{ __('Are you sure you want to delete selected users (%s)?') }}'; 64 dotclear.msg.confirm_delete_category = '{{ __('Are you sure you want to delete category "%s"?') }}'; 65 dotclear.msg.confirm_reorder_categories = '{{ __('Are you sure you want to reorder all categories?') }}'; 66 dotclear.msg.confirm_delete_media = '{{ __('Are you sure you want to remove media "%s"?') }}'; 67 dotclear.msg.confirm_extract_current = '{{ __('Are you sure you want to extract archive in current directory?') }}'; 68 dotclear.msg.confirm_remove_attachment = '{{ __('Are you sure you want to remove attachment "%s"?') }}'; 69 dotclear.msg.confirm_delete_lang = '{{ __('Are you sure you want to delete "%s" language?') }}'; 70 dotclear.msg.confirm_delete_plugin = '{{ __('Are you sure you want to delete "%s" plugin?') }}'; 71 dotclear.msg.use_this_theme = '{{ __('Use this theme') }}'; 72 dotclear.msg.remove_this_theme = '{{ __('Remove this theme') }}'; 73 dotclear.msg.confirm_delete_theme = '{{ __('Are you sure you want to delete "%s" theme?') }}'; 74 dotclear.msg.confirm_delete_backup = '{{ __('Are you sure you want to delete this backup?') }}'; 75 dotclear.msg.zip_file_content = '{{ __('Zip file content') }}'; 76 dotclear.msg.xhtml_validator = '{{ __('XHTML markup validator') }}'; 77 dotclear.msg.xhtml_valid = '{{ __('XHTML content is valid.') }}'; 78 dotclear.msg.xhtml_not_valid = '{{ __('There are XHTML markup errors.') }}'; 79 dotclear.msg.warning_validate_no_save_content = '{{ __('Attention: an audit of a content not yet registered.') }}'; 80 dotclear.msg.confirm_change_post_format = '{{ __('You have unsaved changes. Switch post format will loose these changes. Proceed anyway?') }}'; 81 dotclear.msg.confirm_change_post_format_noconvert = '{{ __("Warning: post format change will not convert existing content. You will need to apply new format by yourself. Proceed anyway?") }}'; 82 dotclear.msg.load_enhanced_uploader = '{{ __('Loading enhanced uploader, please wait.') }}'; 83 dotclear.msg.module_author = '{{ __('Author:') }}'; 84 dotclear.msg.module_details = '{{ __('Details') }}'; 85 dotclear.msg.module_support = '{{ __('Support') }}'; 86 dotclear.msg.module_help = '{{ __('Help:') }}'; 87 dotclear.msg.module_section = '{{ __('Section:') }}'; 88 dotclear.msg.module_tags = '{{ __('Tags:') }}'; 89 //]]> 90 </script> 91 {% endautoescape %} 65 92 {% endmacro %} 66 93 67 94 {% macro load_IE7() %} 68 <!--[if lt IE 8]>69 {{ _self.load('ie7/IE8.js') }}70 <link rel="stylesheet" type="text/css" href="{{theme_url}}style/iesucks.css" />71 <![endif]-->95 <!--[if lt IE 9]> 96 {{ _self.load('js/ie7/IE9.js') }} 97 <link rel="stylesheet" type="text/css" href="style/iesucks.css" /> 98 <![endif]--> 72 99 {% endmacro %} 73 100 -
inc/admin/lib.dc.page.php
r1492 r2313 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; 54 54 55 55 # List of user's blogs 56 if ($core->auth-> blog_count == 1 || $core->auth->blog_count> 20)56 if ($core->auth->getBlogCount() == 1 || $core->auth->getBlogCount() > 20) 57 57 { 58 58 $blog_box = … … 60 60 html::escapeHTML($core->blog->name).'</strong>'; 61 61 62 if ($core->auth-> blog_count> 20) {62 if ($core->auth->getBlogCount() > 20) { 63 63 $blog_box .= ' - <a href="blogs.php">'.__('Change blog').'</a>'; 64 64 } … … 73 73 } 74 74 $blog_box = 75 '<p><label for="switchblog" class="classic nomobile">'.75 '<p><label for="switchblog" class="classic">'. 76 76 __('Blogs:').'</label> '. 77 77 $core->formNonce(). 78 78 form::combo('switchblog',$blogs,$core->blog->id). 79 '</p>'. 80 '<noscript><p><input type="submit" value="'.__('ok').'" /></p></noscript>'; 79 '<input type="submit" value="'.__('ok').'" class="hidden-if-js" /></p>'; 81 80 } 82 81 … … 109 108 $user_ui_hide_std_favicon = $core->auth->user_prefs->interface->hide_std_favicon; 110 109 if (!$user_ui_hide_std_favicon) { 111 echo '<link rel="icon" type="image/png" href="images/favicon.png" />'; 110 echo 111 '<link rel="icon" type="image/png" href="images/favicon96-login.png" />'. 112 '<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />'; 112 113 } 113 114 114 115 echo 115 116 self::jsCommon(). 117 self::jsToggles(). 116 118 $head; 117 119 … … 122 124 "</head>\n". 123 125 '<body id="dotclear-admin'. 124 ($safe_mode ? ' safe-mode' : ''). 125 '">'."\n". 126 126 ($safe_mode ? ' safe-mode' : '').'" class="no-js">'."\n". 127 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 '<li><a href="#help">'.__('Go to help').'</a></li>'. 133 '</ul>'."\n". 127 134 '<div id="header">'. 128 '<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". 129 '<div id="top"><h1><a href="index.php">'.DC_VENDOR_NAME.'</a></h1></div>'."\n"; 130 131 echo 132 '<div id="info-boxes">'. 133 '<div id="info-box1">'. 134 '<form action="index.php" method="post">'. 135 '<h1><a href="index.php"><span class="hidden">'.DC_VENDOR_NAME.'</span></a></h1>'."\n"; 136 137 echo 138 '<form action="index.php" method="post" id="top-info-blog">'. 135 139 $blog_box. 136 '<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>'. 140 '<p><a href="'.$core->blog->url.'" class="outgoing" title="'.__('Go to site'). 141 '">'.__('Go to site').'<img src="images/outgoing.png" alt="" /></a>'. 137 142 '</p></form>'. 138 '</div>'. 139 '<div id="info-box2">'. 140 '<a class="smallscreen'.(preg_match('/index.php$/',$_SERVER['REQUEST_URI']) ? ' active' : '').'" href="index.php">'.__('My dashboard').'</a>'. 141 '<span class="smallscreen"> | </span><a class="smallscreen'.(preg_match('/preferences.php(\?.*)?$/',$_SERVER['REQUEST_URI']) ? ' active' : '').'" href="preferences.php">'.__('My preferences').'</a>'. 142 '<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>'. 143 '</div>'. 144 '</div>'. 145 '</div>'; 146 147 echo 148 '<div id="wrapper">'."\n". 143 '<ul id="top-info-user">'. 144 '<li><a class="'.(preg_match('/index.php$/',$_SERVER['REQUEST_URI']) ? ' active' : '').'" href="index.php">'.__('My dashboard').'</a></li>'. 145 '<li><a class="smallscreen'.(preg_match('/preferences.php(\?.*)?$/',$_SERVER['REQUEST_URI']) ? ' active' : ''). 146 '" href="preferences.php">'.__('My preferences').'</a></li>'. 147 '<li><a href="index.php?logout=1" class="logout"><span class="nomobile">'.sprintf(__('Logout %s'),$core->auth->userID()). 148 '</span><img src="images/logout.png" alt="" /></a></li>'. 149 '</ul>'. 150 '</div>'; // end header 151 152 echo 153 '<div id="wrapper" class="clearfix">'."\n". 154 '<div class="hidden-if-no-js collapser-box"><a href="#" id="collapser">'. 155 '<img class="collapse-mm" src="images/collapser-hide.png" alt="'.__('Hide main menu').'" />'. 156 '<img class="expand-mm" src="images/collapser-show.png" alt="'.__('Show main menu').'" />'. 157 '</a></div>'. 149 158 '<div id="main">'."\n". 150 '<div id="content" >'."\n";159 '<div id="content" class="clearfix">'."\n"; 151 160 152 161 # Safe mode … … 154 163 { 155 164 echo 156 '<div class=" error"><h3>'.__('Safe mode').'</h3>'.165 '<div class="warning"><h3>'.__('Safe mode').'</h3>'. 157 166 '<p>'.__('You are in safe mode. All plugins have been temporarily disabled. Remind to log out then log in again normally to get back all functionalities').'</p>'. 158 167 '</div>'; 159 168 } 160 169 170 // Display breadcrumb (if given) before any error message 171 echo $breadcrumb; 172 161 173 if ($core->error->flag()) { 162 174 echo 163 '<div class="error"><p><strong>'.(count($core->error->getErrors()) > 1 ? __('Errors:') : __('Error:')).'</ p></strong>'.175 '<div class="error"><p><strong>'.(count($core->error->getErrors()) > 1 ? __('Errors:') : __('Error:')).'</strong></p>'. 164 176 $core->error->toHTML(). 165 177 '</div>'; 166 178 } 179 180 // Display notices 181 echo self::notices(); 182 } 183 184 public static function notices() 185 { 186 // return notices if any 187 $res = ''; 188 if (isset($_SESSION['notifications'])) { 189 $types = array("success" => "success", "warning" => "warning-msg", "error" => "error"); 190 $notifications = $_SESSION['notifications']; 191 foreach ($types as $type => $class) { 192 if (isset($notifications[$type])) { 193 foreach ($notifications[$type] as $n) { 194 $res .= self::getNotification($n,$class); 195 } 196 } 197 } 198 unset($_SESSION['notifications']); 199 } 200 return $res; 201 } 202 203 public static function addNotice($type,$message) 204 { 205 $notification = isset($_SESSION['notifications']) ? $_SESSION['notifications'] : array(); 206 $notification[$type][] = array('ts' => time(), 'text' => $message); 207 $_SESSION['notifications'] = $notification; 208 } 209 210 public static function addSuccessNotice($message) 211 { 212 self::addNotice("success",$message); 213 } 214 215 public static function addWarningNotice($message) 216 { 217 self::addNotice("warning",$message); 218 } 219 220 public static function addErrorNotice($message) 221 { 222 self::addNotice("error",$message); 223 } 224 225 protected static function getNotification($msg,$class) 226 { 227 global $core; 228 229 $res = '<p class="'.$class.'">'.dt::str(__('[%H:%M:%S]'),$msg['ts'],$core->auth->getInfo('user_tz')).' '.$msg['text'].'</p>'; 230 return $res; 167 231 } 168 232 … … 170 234 { 171 235 global $core; 236 237 if (!$GLOBALS['__resources']['ctxhelp']) { 238 echo 239 '<p id="help-button"><a href="help.php" class="outgoing" title="'. 240 __('Global help').'">'.__('Global help').'</a></p>'; 241 } 172 242 173 243 $menu =& $GLOBALS['_menu']; … … 180 250 181 251 '<form id="search-menu" action="search.php" method="get">'. 182 '<p><label for="q " class="hidden">'.__('Search:').' </label>'.form::field('q',30,255,'').252 '<p><label for="qx" class="hidden">'.__('Search:').' </label>'.form::field('qx',30,255,''). 183 253 '<input type="submit" value="'.__('OK').'" /></p>'. 184 254 '</form>'; … … 199 269 echo 200 270 '</div>'."\n". // End of #main-menu 201 '<div id="footer"><a href="http://dotclear.org/" title="'.$text.'"><img src="style/dc_logos/w-dotclear90.png" alt="'.$text.'" /></a></div>'."\n".202 271 "</div>\n"; // End of #wrapper 272 273 echo 274 '<div id="footer">'. 275 '<a href="http://dotclear.org/" title="'.$text.'">'. 276 '<img src="style/dc_logos/w-dotclear90.png" alt="'.$text.'" /></a></div>'."\n". 277 "<!-- \n \n ,;:'`'::\n". 278 " __||\n _____/LLLL\_\n \__________\"|\n". 279 " ~^~^~^~^~^~^~^~^~^~\n -->\n"; 203 280 204 281 if (defined('DC_DEV') && DC_DEV === true) { … … 210 287 } 211 288 212 public static function openPopup($title='', $head='')289 public static function openPopup($title='',$head='',$breadcrumb='') 213 290 { 214 291 global $core; … … 239 316 echo 240 317 self::jsCommon(). 318 self::jsToggles(). 241 319 $head; 242 320 … … 248 326 '<body id="dotclear-admin" class="popup">'."\n". 249 327 250 '< div id="top hidden"><h1>'.DC_VENDOR_NAME.'</h1></div>'."\n";328 '<h1>'.DC_VENDOR_NAME.'</h1>'."\n"; 251 329 252 330 echo … … 254 332 '<div id="main">'."\n". 255 333 '<div id="content">'."\n"; 334 335 // display breadcrumb if given 336 echo $breadcrumb; 256 337 257 338 if ($core->error->flag()) { … … 268 349 "</div>\n". // End of #content 269 350 "</div>\n". // End of #main 351 "</div>\n". // End of #wrapper 270 352 '<div id="footer"><p> </p></div>'."\n". 271 "</div>\n". // End of #wrapper272 353 '</body></html>'; 273 354 } 274 355 275 public static function breadcrumb($elements=null,$no_home_link=false) 276 { 356 public static function breadcrumb($elements=null,$options=array()) 357 { 358 $with_home_link = isset($options['home_link'])?$options['home_link']:true; 359 $hl = isset($options['hl'])?$options['hl']:true; 360 $hl_pos = isset($options['hl_pos'])?$options['hl_pos']:-1; 277 361 // First item of array elements should be blog's name, System or Plugins 278 $res = '<h2>'.($ no_home_link ?279 '< img src="style/dashboard-alt.png" alt="" />' :280 '< a class="go_home" href="index.php"><img src="style/dashboard.png" alt="'.__('Go to dashboard').'" /></a>');362 $res = '<h2>'.($with_home_link ? 363 '<a class="go_home" href="index.php"><img src="style/dashboard.png" alt="'.__('Go to dashboard').'" /></a>' : 364 '<img src="style/dashboard-alt.png" alt="" />'); 281 365 $index = 0; 366 if ($hl_pos < 0) { 367 $hl_pos = count($elements)+$hl_pos; 368 } 282 369 foreach ($elements as $element => $url) { 283 $res .= ($no_home_link ? ' ' : ($index == 1 ? ' : ' : ' › ')).($url ? '<a href="'.$url.'">' : '').$element.($url ? '</a>' : ''); 370 if ($hl && $index == $hl_pos) { 371 $element = sprintf('<span class="page-title">%s</span>',$element); 372 } 373 $res .= ($with_home_link ? ($index == 1 ? ' : ' : ' › ') : ($index == 0 ? ' ' : ' › ')). 374 ($url ? '<a href="'.$url.'">' : '').$element.($url ? '</a>' : ''); 284 375 $index++; 285 376 } … … 288 379 } 289 380 290 public static function message($msg,$timestamp=true,$div=false,$echo=true )381 public static function message($msg,$timestamp=true,$div=false,$echo=true,$class='message') 291 382 { 292 383 global $core; … … 294 385 $res = ''; 295 386 if ($msg != '') { 296 $res = ($div ? '<div class=" message">' : '').'<p'.($div ? '' : ' class="message"').'>'.297 ($timestamp ? dt::str(__(' %H:%M:%S:'),null,$core->auth->getInfo('user_tz')).' ' : '').$msg.387 $res = ($div ? '<div class="'.$class.'">' : '').'<p'.($div ? '' : ' class="'.$class.'"').'>'. 388 ($timestamp ? dt::str(__('[%H:%M:%S]'),null,$core->auth->getInfo('user_tz')).' ' : '').$msg. 298 389 '</p>'.($div ? '</div>' : ''); 299 390 if ($echo) { … … 302 393 } 303 394 return $res; 395 } 396 397 public static function success($msg,$timestamp=true,$div=false,$echo=true) 398 { 399 return self::message($msg,$timestamp,$div,$echo,"success"); 400 } 401 402 public static function warning($msg,$timestamp=true,$div=false,$echo=true) 403 { 404 return self::message($msg,$timestamp,$div,$echo,"warning-msg"); 304 405 } 305 406 … … 355 456 { 356 457 $args = func_get_args(); 458 459 $args = new ArrayObject($args); 460 461 # --BEHAVIOR-- adminPageHelpBlock 462 $GLOBALS['core']->callBehavior('adminPageHelpBlock',$args); 463 357 464 if (empty($args)) { 358 465 return; … … 392 499 } 393 500 394 echo 395 '<div id="help"><hr /><div class="help-content clear"><h2>'.__('Help').'</h2>'. 501 // Set contextual help global flag 502 $GLOBALS['__resources']['ctxhelp'] = true; 503 504 echo 505 '<div id="help"><hr /><div class="help-content clear"><h3>'.__('Help about this page').'</h3>'. 396 506 $content. 507 '</div>'. 508 '<div id="helplink"><hr />'. 509 '<p>'. 510 sprintf(__('See also %s'),sprintf('<a href="help.php">%s</a>',__('the global help'))). 511 '.</p>'. 397 512 '</div></div>'; 398 513 } … … 412 527 } 413 528 529 public static function jsToggles() 530 { 531 if($GLOBALS['core']->auth->user_prefs->toggles) { 532 $unfolded_sections = explode(',',$GLOBALS['core']->auth->user_prefs->toggles->unfolded_sections); 533 foreach ($unfolded_sections as $k=>&$v) { 534 if ($v == '') { 535 unset($unfolded_sections[$k]); 536 } else { 537 $v = "'".html::escapeJS($v)."':true"; 538 } 539 } 540 } else { 541 $unfolded_sections=array(); 542 } 543 return '<script type="text/javascript">'."\n". 544 "//<![CDATA[\n". 545 'dotclear.unfolded_sections = {'.join(",",$unfolded_sections)."};\n". 546 "\n//]]>\n". 547 "</script>\n"; 548 } 549 414 550 public static function jsCommon() 415 551 { 552 $mute_or_no = ''; 553 if (empty($GLOBALS['core']->blog) || $GLOBALS['core']->blog->settings->system->jquery_migrate_mute) { 554 $mute_or_no .= 555 '<script type="text/javascript">'."\n". 556 "//<![CDATA[\n". 557 'jQuery.migrateMute = true;'. 558 "\n//]]>\n". 559 "</script>\n"; 560 } 561 416 562 return 417 563 self::jsLoad('js/jquery/jquery.js'). 564 $mute_or_no. 565 self::jsLoad('js/jquery/jquery-migrate-1.2.1.js'). 418 566 self::jsLoad('js/jquery/jquery.biscuit.js'). 419 567 self::jsLoad('js/jquery/jquery.bgFade.js'). … … 432 580 self::jsVar('dotclear.img_menu_off','images/menu_off.png'). 433 581 582 self::jsVar('dotclear.img_plus_theme_src','images/plus-theme.png'). 583 self::jsVar('dotclear.img_plus_theme_alt',__('uncover')). 584 self::jsVar('dotclear.img_minus_theme_src','images/minus-theme.png'). 585 self::jsVar('dotclear.img_minus_theme_alt',__('hide')). 586 434 587 self::jsVar('dotclear.msg.help', 435 __('Help about this page')). 588 __('Need help?')). 589 self::jsVar('dotclear.msg.new_window', 590 __('new window')). 436 591 self::jsVar('dotclear.msg.help_hide', 437 592 __('Hide')). 593 self::jsVar('dotclear.msg.to_select', 594 __('Select:')). 438 595 self::jsVar('dotclear.msg.no_selection', 439 596 __('no selection')). … … 441 598 __('select all')). 442 599 self::jsVar('dotclear.msg.invert_sel', 443 __(' invert selection')).600 __('Invert selection')). 444 601 self::jsVar('dotclear.msg.website', 445 602 __('Web site:')). … … 458 615 self::jsVar('dotclear.msg.confirm_delete_posts', 459 616 __("Are you sure you want to delete selected entries (%s)?")). 617 self::jsVar('dotclear.msg.confirm_delete_medias', 618 __("Are you sure you want to delete selected medias (%d)?")). 619 self::jsVar('dotclear.msg.confirm_delete_categories', 620 __("Are you sure you want to delete selected categories (%s)?")). 460 621 self::jsVar('dotclear.msg.confirm_delete_post', 461 622 __("Are you sure you want to delete this entry?")). 623 self::jsVar('dotclear.msg.click_to_unlock', 624 __("Click here to unlock the field")). 462 625 self::jsVar('dotclear.msg.confirm_spam_delete', 463 626 __('Are you sure you want to delete all spams?')). … … 490 653 self::jsVar('dotclear.msg.confirm_delete_theme', 491 654 __('Are you sure you want to delete "%s" theme?')). 655 self::jsVar('dotclear.msg.confirm_delete_backup', 656 __('Are you sure you want to delete this backup?')). 492 657 self::jsVar('dotclear.msg.zip_file_content', 493 658 __('Zip file content')). … … 498 663 self::jsVar('dotclear.msg.xhtml_not_valid', 499 664 __('There are XHTML markup errors.')). 665 self::jsVar('dotclear.msg.warning_validate_no_save_content', 666 __('Attention: an audit of a content not yet registered.')). 500 667 self::jsVar('dotclear.msg.confirm_change_post_format', 501 668 __('You have unsaved changes. Switch post format will loose these changes. Proceed anyway?')). 669 self::jsVar('dotclear.msg.confirm_change_post_format_noconvert', 670 __("Warning: post format change will not convert existing content. You will need to apply new format by yourself. Proceed anyway?")). 502 671 self::jsVar('dotclear.msg.load_enhanced_uploader', 503 672 __('Loading enhanced uploader, please wait.')). 673 674 self::jsVar('dotclear.msg.module_author', 675 __('Author:')). 676 self::jsVar('dotclear.msg.module_details', 677 __('Details')). 678 self::jsVar('dotclear.msg.module_support', 679 __('Support')). 680 self::jsVar('dotclear.msg.module_help', 681 __('Help:')). 682 self::jsVar('dotclear.msg.module_section', 683 __('Section:')). 684 self::jsVar('dotclear.msg.module_tags', 685 __('Tags:')). 504 686 "\n//]]>\n". 505 687 "</script>\n"; … … 509 691 { 510 692 return 511 '<!--[if lt IE 8]>'."\n".512 self::jsLoad('js/ie7/IE 8.js').693 '<!--[if lt IE 9]>'."\n". 694 self::jsLoad('js/ie7/IE9.js'). 513 695 '<link rel="stylesheet" type="text/css" href="style/iesucks.css" />'."\n". 514 696 '<![endif]-->'."\n"; … … 547 729 '<script type="text/javascript">'."\n". 548 730 "//<![CDATA[\n". 549 "\$(function() {\n". 550 " \$.pageTabs(".$default.");\n". 551 "});\n". 552 "\n//]]>\n". 553 "</script>\n"; 554 } 555 556 public static function jsModal() 557 { 731 '$(function() {'."\n". 732 '$.pageTabs('.$default.');'."\n". 733 '});'. 734 "\n//]]>\n". 735 "</script>\n". 736 '<!--[if lt IE 8]>'."\n". 737 self::jsLoad('js/ie7/ie7-hashchange.js'). 738 '<script type="text/javascript">'."\n". 739 "//<![CDATA[\n". 740 '$(window).hashchange();'. 741 "\n//]]>\n". 742 "</script>\n". 743 '<![endif]-->'."\n"; 744 } 745 746 public static function jsModal() 747 { 558 748 return 559 749 '<link rel="stylesheet" type="text/css" href="style/modal/modal.css" />'."\n". … … 565 755 "\n//]]>\n". 566 756 "</script>\n"; 567 }568 569 public static function jsColorPicker()570 {757 } 758 759 public static function jsColorPicker() 760 { 571 761 return 572 762 '<link rel="stylesheet" type="text/css" href="style/farbtastic/farbtastic.css" />'."\n". 573 763 self::jsLoad('js/jquery/jquery.farbtastic.js'). 574 764 self::jsLoad('js/color-picker.js'); 575 }576 577 public static function jsDatePicker()578 {765 } 766 767 public static function jsDatePicker() 768 { 579 769 return 580 770 '<link rel="stylesheet" type="text/css" href="style/date-picker.css" />'."\n". … … 611 801 "\n//]]>\n". 612 802 "</script>\n"; 613 }614 615 public static function jsToolBar()616 {803 } 804 805 public static function jsToolBar() 806 { 617 807 $res = 618 808 '<link rel="stylesheet" type="text/css" href="style/jsToolBar/jsToolBar.css" />'. … … 695 885 696 886 return $res; 697 }698 699 public static function jsUpload($params=array(),$base_url=null)700 {887 } 888 889 public static function jsUpload($params=array(),$base_url=null) 890 { 701 891 if (!$base_url) { 702 892 $base_url = path::clean(dirname(preg_replace('/(\?.*$)?/','',$_SERVER['REQUEST_URI']))).'/'; … … 710 900 711 901 return 712 '<link rel="stylesheet" type="text/css" href="style/jsUpload/style.css" />'."\n".713 714 '<script id="template-upload" type="text/x-tmpl">715 {% for (var i=0, file; file=o.files[i]; i++) { %}716 <div class="template-upload fade">717 <div class="upload-file">718 <div class="upload-fileinfo">719 <span class="upload-filename">{%=file.name%}</span>720 <span class="upload-filesize">({%=o.formatFileSize(file.size)%})</span>721 <span class="upload-filecancel cancel">'.__('Cancel').'</span>722 {% if (!o.files.error && !i && !o.options.autoUpload) { %}723 <input type="submit" class="button start" value="'.__('Send').'"/>724 {% } %}725 <span class="upload-filemsg"></span>726 </div>727 {% if (!o.files.error) { %}728 <div class="upload-progress progress progress-success progress-striped active"><div class="bar" style="width:0%;"></div></div>729 {% } %}730 </div>731 {% } %}732 </script>733 <!-- The template to display files available for download -->734 <script id="template-download" type="text/x-tmpl">735 {% for (var i=0, file; file=o.files[i]; i++) { %}736 <div class="template-download fade">737 <div class="upload-file">738 <div class="upload-fileinfo">739 <span class="upload-filename">{%=file.name%}</span>740 <span class="upload-filesize">({%=o.formatFileSize(file.size)%})</span>741 <span class="upload-filemsg{% if (file.error) { %} upload-error{% } %}">742 {% if (file.error) { %}743 '.__('Error:').' {%=file.error%}744 {% } else { %}745 '.__('File successfully uploaded.').'746 {% } %}747 </span>748 </div>749 <div class="upload-progress">750 {% if (!file.error) { %}751 <div class="bar" style="width:100%;">100%</div>752 {% } %}753 </div>754 </div>755 {% } %}756 </script>'.757 758 self::jsLoad('js/jsUpload/vendor/jquery.ui.widget.js').759 self::jsLoad('js/jsUpload/tmpl.js').760 self::jsLoad('js/jsUpload/load-image.js').761 self::jsLoad('js/jsUpload/jquery.iframe-transport.js').762 self::jsLoad('js/jsUpload/jquery.fileupload.js').763 self::jsLoad('js/jsUpload/jquery.fileupload-process.js').764 self::jsLoad('js/jsUpload/jquery.fileupload-resize.js').765 self::jsLoad('js/jsUpload/jquery.fileupload-ui.js').766 767 902 '<script type="text/javascript">'."\n". 768 903 "//<![CDATA[\n". … … 781 916 self::jsVar('dotclear.jsUpload.msg.clean',__('Clean')). 782 917 self::jsVar('dotclear.jsUpload.msg.upload',__('Upload')). 918 self::jsVar('dotclear.jsUpload.msg.send',__('Send')). 919 self::jsVar('dotclear.jsUpload.msg.file_successfully_uploaded',__('File successfully uploaded.')). 783 920 self::jsVar('dotclear.jsUpload.msg.no_file_in_queue',__('No file in queue.')). 784 921 self::jsVar('dotclear.jsUpload.msg.file_in_queue',__('1 file in queue.')). … … 787 924 self::jsVar('dotclear.jsUpload.base_url',$base_url). 788 925 "\n//]]>\n". 789 "</script>\n"; 790 } 791 792 public static function jsToolMan() 793 { 926 "</script>\n". 927 928 self::jsLoad('js/jsUpload/vendor/jquery.ui.widget.js'). 929 self::jsLoad('js/jsUpload/tmpl.js'). 930 self::jsLoad('js/jsUpload/template-upload.js'). 931 self::jsLoad('js/jsUpload/template-download.js'). 932 self::jsLoad('js/jsUpload/load-image.js'). 933 self::jsLoad('js/jsUpload/jquery.iframe-transport.js'). 934 self::jsLoad('js/jsUpload/jquery.fileupload.js'). 935 self::jsLoad('js/jsUpload/jquery.fileupload-process.js'). 936 self::jsLoad('js/jsUpload/jquery.fileupload-resize.js'). 937 self::jsLoad('js/jsUpload/jquery.fileupload-ui.js'); 938 } 939 940 public static function jsToolMan() 941 { 794 942 return 795 943 '<script type="text/javascript" src="js/tool-man/core.js"></script>'. … … 800 948 '<script type="text/javascript" src="js/tool-man/dragsort.js"></script>'. 801 949 '<script type="text/javascript" src="js/dragsort-tablerows.js"></script>'; 802 }803 804 public static function jsMetaEditor()805 {950 } 951 952 public static function jsMetaEditor() 953 { 806 954 return 807 955 '<script type="text/javascript" src="js/meta-editor.js"></script>'; 956 } 808 957 } 809 }810 ?> -
inc/admin/lib.dc.page.php
r2306 r2313 99 99 100 100 self::jsLoadIE7(). 101 ' <link rel="stylesheet" href="style/default.css" type="text/css" media="screen" />'."\n";101 ' <link rel="stylesheet" href="style/default.css" type="text/css" media="screen" />'."\n"; 102 102 if (l10n::getTextDirection($GLOBALS['_lang']) == 'rtl') { 103 103 echo 104 ' <link rel="stylesheet" href="style/default-rtl.css" type="text/css" media="screen" />'."\n";104 ' <link rel="stylesheet" href="style/default-rtl.css" type="text/css" media="screen" />'."\n"; 105 105 } 106 106 … … 112 112 '<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />'; 113 113 } 114 114 115 echo 115 116 self::jsCommon(). … … 307 308 308 309 self::jsLoadIE7(). 309 ' <link rel="stylesheet" href="style/default.css" type="text/css" media="screen" />'."\n";310 ' <link rel="stylesheet" href="style/default.css" type="text/css" media="screen" />'."\n"; 310 311 if (l10n::getTextDirection($GLOBALS['_lang']) == 'rtl') { 311 312 echo 312 ' <link rel="stylesheet" href="style/default-rtl.css" type="text/css" media="screen" />'."\n";313 ' <link rel="stylesheet" href="style/default-rtl.css" type="text/css" media="screen" />'."\n"; 313 314 } 314 315 … … 571 572 "//<![CDATA[\n". 572 573 self::jsVar('dotclear.nonce',$GLOBALS['core']->getNonce()). 574 573 575 self::jsVar('dotclear.img_plus_src','images/expand.png'). 574 576 self::jsVar('dotclear.img_plus_alt',__('uncover')). … … 577 579 self::jsVar('dotclear.img_menu_on','images/menu_on.png'). 578 580 self::jsVar('dotclear.img_menu_off','images/menu_off.png'). 579 581 580 582 self::jsVar('dotclear.img_plus_theme_src','images/plus-theme.png'). 581 583 self::jsVar('dotclear.img_plus_theme_alt',__('uncover')). … … 682 684 self::jsVar('dotclear.msg.module_tags', 683 685 __('Tags:')). 684 "\n//]]>\n".686 "\n//]]>\n". 685 687 "</script>\n"; 686 688 } … … 722 724 $default = "'".html::escapeJS($default)."'"; 723 725 } 724 726 725 727 return 726 728 self::jsLoad('js/jquery/jquery.pageTabs.js'). … … 744 746 public static function jsModal() 745 747 { 746 return747 '<link rel="stylesheet" type="text/css" href="style/modal/modal.css" />'."\n".748 self::jsLoad('js/jquery/jquery.modal.js').749 '<script type="text/javascript">'."\n".750 "//<![CDATA[\n".751 self::jsVar('$.modal.prototype.params.loader_img','style/modal/loader.gif').752 self::jsVar('$.modal.prototype.params.close_img','style/modal/close.png').753 "\n//]]>\n".754 "</script>\n";748 return 749 '<link rel="stylesheet" type="text/css" href="style/modal/modal.css" />'."\n". 750 self::jsLoad('js/jquery/jquery.modal.js'). 751 '<script type="text/javascript">'."\n". 752 "//<![CDATA[\n". 753 self::jsVar('$.modal.prototype.params.loader_img','style/modal/loader.gif'). 754 self::jsVar('$.modal.prototype.params.close_img','style/modal/close.png'). 755 "\n//]]>\n". 756 "</script>\n"; 755 757 } 756 758 757 759 public static function jsColorPicker() 758 760 { 759 return760 '<link rel="stylesheet" type="text/css" href="style/farbtastic/farbtastic.css" />'."\n".761 self::jsLoad('js/jquery/jquery.farbtastic.js').762 self::jsLoad('js/color-picker.js');761 return 762 '<link rel="stylesheet" type="text/css" href="style/farbtastic/farbtastic.css" />'."\n". 763 self::jsLoad('js/jquery/jquery.farbtastic.js'). 764 self::jsLoad('js/color-picker.js'); 763 765 } 764 766 765 767 public static function jsDatePicker() 766 768 { 767 return768 '<link rel="stylesheet" type="text/css" href="style/date-picker.css" />'."\n".769 self::jsLoad('js/date-picker.js').770 '<script type="text/javascript">'."\n".771 "//<![CDATA[\n".772 773 "datePicker.prototype.months[0] = '".html::escapeJS(__('January'))."'; ".774 "datePicker.prototype.months[1] = '".html::escapeJS(__('February'))."'; ".775 "datePicker.prototype.months[2] = '".html::escapeJS(__('March'))."'; ".776 "datePicker.prototype.months[3] = '".html::escapeJS(__('April'))."'; ".777 "datePicker.prototype.months[4] = '".html::escapeJS(__('May'))."'; ".778 "datePicker.prototype.months[5] = '".html::escapeJS(__('June'))."'; ".779 "datePicker.prototype.months[6] = '".html::escapeJS(__('July'))."'; ".780 "datePicker.prototype.months[7] = '".html::escapeJS(__('August'))."'; ".781 "datePicker.prototype.months[8] = '".html::escapeJS(__('September'))."'; ".782 "datePicker.prototype.months[9] = '".html::escapeJS(__('October'))."'; ".783 "datePicker.prototype.months[10] = '".html::escapeJS(__('November'))."'; ".784 "datePicker.prototype.months[11] = '".html::escapeJS(__('December'))."'; ".785 786 "datePicker.prototype.days[0] = '".html::escapeJS(__('Monday'))."'; ".787 "datePicker.prototype.days[1] = '".html::escapeJS(__('Tuesday'))."'; ".788 "datePicker.prototype.days[2] = '".html::escapeJS(__('Wednesday'))."'; ".789 "datePicker.prototype.days[3] = '".html::escapeJS(__('Thursday'))."'; ".790 "datePicker.prototype.days[4] = '".html::escapeJS(__('Friday'))."'; ".791 "datePicker.prototype.days[5] = '".html::escapeJS(__('Saturday'))."'; ".792 "datePicker.prototype.days[6] = '".html::escapeJS(__('Sunday'))."'; ".793 794 "datePicker.prototype.img_src = 'images/date-picker.png'; ".795 796 "datePicker.prototype.close_msg = '".html::escapeJS(__('close'))."'; ".797 "datePicker.prototype.now_msg = '".html::escapeJS(__('now'))."'; ".798 799 "\n//]]>\n".800 "</script>\n";769 return 770 '<link rel="stylesheet" type="text/css" href="style/date-picker.css" />'."\n". 771 self::jsLoad('js/date-picker.js'). 772 '<script type="text/javascript">'."\n". 773 "//<![CDATA[\n". 774 775 "datePicker.prototype.months[0] = '".html::escapeJS(__('January'))."'; ". 776 "datePicker.prototype.months[1] = '".html::escapeJS(__('February'))."'; ". 777 "datePicker.prototype.months[2] = '".html::escapeJS(__('March'))."'; ". 778 "datePicker.prototype.months[3] = '".html::escapeJS(__('April'))."'; ". 779 "datePicker.prototype.months[4] = '".html::escapeJS(__('May'))."'; ". 780 "datePicker.prototype.months[5] = '".html::escapeJS(__('June'))."'; ". 781 "datePicker.prototype.months[6] = '".html::escapeJS(__('July'))."'; ". 782 "datePicker.prototype.months[7] = '".html::escapeJS(__('August'))."'; ". 783 "datePicker.prototype.months[8] = '".html::escapeJS(__('September'))."'; ". 784 "datePicker.prototype.months[9] = '".html::escapeJS(__('October'))."'; ". 785 "datePicker.prototype.months[10] = '".html::escapeJS(__('November'))."'; ". 786 "datePicker.prototype.months[11] = '".html::escapeJS(__('December'))."'; ". 787 788 "datePicker.prototype.days[0] = '".html::escapeJS(__('Monday'))."'; ". 789 "datePicker.prototype.days[1] = '".html::escapeJS(__('Tuesday'))."'; ". 790 "datePicker.prototype.days[2] = '".html::escapeJS(__('Wednesday'))."'; ". 791 "datePicker.prototype.days[3] = '".html::escapeJS(__('Thursday'))."'; ". 792 "datePicker.prototype.days[4] = '".html::escapeJS(__('Friday'))."'; ". 793 "datePicker.prototype.days[5] = '".html::escapeJS(__('Saturday'))."'; ". 794 "datePicker.prototype.days[6] = '".html::escapeJS(__('Sunday'))."'; ". 795 796 "datePicker.prototype.img_src = 'images/date-picker.png'; ". 797 798 "datePicker.prototype.close_msg = '".html::escapeJS(__('close'))."'; ". 799 "datePicker.prototype.now_msg = '".html::escapeJS(__('now'))."'; ". 800 801 "\n//]]>\n". 802 "</script>\n"; 801 803 } 802 804 803 805 public static function jsToolBar() 804 806 { 805 $res =806 '<link rel="stylesheet" type="text/css" href="style/jsToolBar/jsToolBar.css" />'.807 '<script type="text/javascript" src="js/jsToolBar/jsToolBar.js"></script>';808 809 if (isset($GLOBALS['core']->auth) && $GLOBALS['core']->auth->getOption('enable_wysiwyg')) {810 $res .= '<script type="text/javascript" src="js/jsToolBar/jsToolBar.wysiwyg.js"></script>';811 }812 813 $res .=814 '<script type="text/javascript" src="js/jsToolBar/jsToolBar.dotclear.js"></script>'.815 '<script type="text/javascript">'."\n".816 "//<![CDATA[\n".817 "jsToolBar.prototype.dialog_url = 'popup.php'; ".818 "jsToolBar.prototype.iframe_css = '".819 'body{'.820 'font: 12px "DejaVu Sans","Lucida Grande","Lucida Sans Unicode",Arial,sans-serif;'.821 'color : #000;'.822 'background: #f9f9f9;'.823 'margin: 0;'.824 'padding : 2px;'.825 'border: none;'.826 (l10n::getTextDirection($GLOBALS['_lang']) == 'rtl' ? 'direction:rtl;' : '').827 '}'.828 'pre, code, kbd, samp {'.829 'font-family:"Courier New",Courier,monospace;'.830 'font-size : 1.1em;'.831 '}'.832 'code {'.833 'color : #666;'.834 'font-weight : bold;'.835 '}'.836 'body > p:first-child {'.837 'margin-top: 0;'.838 '}'.839 "'; ".840 "jsToolBar.prototype.base_url = '".html::escapeJS($GLOBALS['core']->blog->host)."'; ".841 "jsToolBar.prototype.switcher_visual_title = '".html::escapeJS(__('visual'))."'; ".842 "jsToolBar.prototype.switcher_source_title = '".html::escapeJS(__('source'))."'; ".843 "jsToolBar.prototype.legend_msg = '".844 html::escapeJS(__('You can use the following shortcuts to format your text.'))."'; ".845 "jsToolBar.prototype.elements.blocks.options.none = '".html::escapeJS(__('-- none --'))."'; ".846 "jsToolBar.prototype.elements.blocks.options.nonebis = '".html::escapeJS(__('-- block format --'))."'; ".847 "jsToolBar.prototype.elements.blocks.options.p = '".html::escapeJS(__('Paragraph'))."'; ".848 "jsToolBar.prototype.elements.blocks.options.h1 = '".html::escapeJS(__('Level 1 header'))."'; ".849 "jsToolBar.prototype.elements.blocks.options.h2 = '".html::escapeJS(__('Level 2 header'))."'; ".850 "jsToolBar.prototype.elements.blocks.options.h3 = '".html::escapeJS(__('Level 3 header'))."'; ".851 "jsToolBar.prototype.elements.blocks.options.h4 = '".html::escapeJS(__('Level 4 header'))."'; ".852 "jsToolBar.prototype.elements.blocks.options.h5 = '".html::escapeJS(__('Level 5 header'))."'; ".853 "jsToolBar.prototype.elements.blocks.options.h6 = '".html::escapeJS(__('Level 6 header'))."'; ".854 "jsToolBar.prototype.elements.strong.title = '".html::escapeJS(__('Strong emphasis'))."'; ".855 "jsToolBar.prototype.elements.em.title = '".html::escapeJS(__('Emphasis'))."'; ".856 "jsToolBar.prototype.elements.ins.title = '".html::escapeJS(__('Inserted'))."'; ".857 "jsToolBar.prototype.elements.del.title = '".html::escapeJS(__('Deleted'))."'; ".858 "jsToolBar.prototype.elements.quote.title = '".html::escapeJS(__('Inline quote'))."'; ".859 "jsToolBar.prototype.elements.code.title = '".html::escapeJS(__('Code'))."'; ".860 "jsToolBar.prototype.elements.br.title = '".html::escapeJS(__('Line break'))."'; ".861 "jsToolBar.prototype.elements.blockquote.title = '".html::escapeJS(__('Blockquote'))."'; ".862 "jsToolBar.prototype.elements.pre.title = '".html::escapeJS(__('Preformated text'))."'; ".863 "jsToolBar.prototype.elements.ul.title = '".html::escapeJS(__('Unordered list'))."'; ".864 "jsToolBar.prototype.elements.ol.title = '".html::escapeJS(__('Ordered list'))."'; ".865 866 "jsToolBar.prototype.elements.link.title = '".html::escapeJS(__('Link'))."'; ".867 "jsToolBar.prototype.elements.link.href_prompt = '".html::escapeJS(__('URL?'))."'; ".868 "jsToolBar.prototype.elements.link.hreflang_prompt = '".html::escapeJS(__('Language?'))."'; ".869 870 "jsToolBar.prototype.elements.img.title = '".html::escapeJS(__('External image'))."'; ".871 "jsToolBar.prototype.elements.img.src_prompt = '".html::escapeJS(__('URL?'))."'; ".872 873 "jsToolBar.prototype.elements.img_select.title = '".html::escapeJS(__('Media chooser'))."'; ".874 "jsToolBar.prototype.elements.post_link.title = '".html::escapeJS(__('Link to an entry'))."'; ";875 876 if (!$GLOBALS['core']->auth->check('media,media_admin',$GLOBALS['core']->blog->id)) {877 $res .= "jsToolBar.prototype.elements.img_select.disabled = true;\n";878 }879 880 $res .=881 "\n//]]>\n".882 "</script>\n";883 884 return $res;807 $res = 808 '<link rel="stylesheet" type="text/css" href="style/jsToolBar/jsToolBar.css" />'. 809 '<script type="text/javascript" src="js/jsToolBar/jsToolBar.js"></script>'; 810 811 if (isset($GLOBALS['core']->auth) && $GLOBALS['core']->auth->getOption('enable_wysiwyg')) { 812 $res .= '<script type="text/javascript" src="js/jsToolBar/jsToolBar.wysiwyg.js"></script>'; 813 } 814 815 $res .= 816 '<script type="text/javascript" src="js/jsToolBar/jsToolBar.dotclear.js"></script>'. 817 '<script type="text/javascript">'."\n". 818 "//<![CDATA[\n". 819 "jsToolBar.prototype.dialog_url = 'popup.php'; ". 820 "jsToolBar.prototype.iframe_css = '". 821 'body{'. 822 'font: 12px "DejaVu Sans","Lucida Grande","Lucida Sans Unicode",Arial,sans-serif;'. 823 'color : #000;'. 824 'background: #f9f9f9;'. 825 'margin: 0;'. 826 'padding : 2px;'. 827 'border: none;'. 828 (l10n::getTextDirection($GLOBALS['_lang']) == 'rtl' ? 'direction:rtl;' : ''). 829 '}'. 830 'pre, code, kbd, samp {'. 831 'font-family:"Courier New",Courier,monospace;'. 832 'font-size : 1.1em;'. 833 '}'. 834 'code {'. 835 'color : #666;'. 836 'font-weight : bold;'. 837 '}'. 838 'body > p:first-child {'. 839 'margin-top: 0;'. 840 '}'. 841 "'; ". 842 "jsToolBar.prototype.base_url = '".html::escapeJS($GLOBALS['core']->blog->host)."'; ". 843 "jsToolBar.prototype.switcher_visual_title = '".html::escapeJS(__('visual'))."'; ". 844 "jsToolBar.prototype.switcher_source_title = '".html::escapeJS(__('source'))."'; ". 845 "jsToolBar.prototype.legend_msg = '". 846 html::escapeJS(__('You can use the following shortcuts to format your text.'))."'; ". 847 "jsToolBar.prototype.elements.blocks.options.none = '".html::escapeJS(__('-- none --'))."'; ". 848 "jsToolBar.prototype.elements.blocks.options.nonebis = '".html::escapeJS(__('-- block format --'))."'; ". 849 "jsToolBar.prototype.elements.blocks.options.p = '".html::escapeJS(__('Paragraph'))."'; ". 850 "jsToolBar.prototype.elements.blocks.options.h1 = '".html::escapeJS(__('Level 1 header'))."'; ". 851 "jsToolBar.prototype.elements.blocks.options.h2 = '".html::escapeJS(__('Level 2 header'))."'; ". 852 "jsToolBar.prototype.elements.blocks.options.h3 = '".html::escapeJS(__('Level 3 header'))."'; ". 853 "jsToolBar.prototype.elements.blocks.options.h4 = '".html::escapeJS(__('Level 4 header'))."'; ". 854 "jsToolBar.prototype.elements.blocks.options.h5 = '".html::escapeJS(__('Level 5 header'))."'; ". 855 "jsToolBar.prototype.elements.blocks.options.h6 = '".html::escapeJS(__('Level 6 header'))."'; ". 856 "jsToolBar.prototype.elements.strong.title = '".html::escapeJS(__('Strong emphasis'))."'; ". 857 "jsToolBar.prototype.elements.em.title = '".html::escapeJS(__('Emphasis'))."'; ". 858 "jsToolBar.prototype.elements.ins.title = '".html::escapeJS(__('Inserted'))."'; ". 859 "jsToolBar.prototype.elements.del.title = '".html::escapeJS(__('Deleted'))."'; ". 860 "jsToolBar.prototype.elements.quote.title = '".html::escapeJS(__('Inline quote'))."'; ". 861 "jsToolBar.prototype.elements.code.title = '".html::escapeJS(__('Code'))."'; ". 862 "jsToolBar.prototype.elements.br.title = '".html::escapeJS(__('Line break'))."'; ". 863 "jsToolBar.prototype.elements.blockquote.title = '".html::escapeJS(__('Blockquote'))."'; ". 864 "jsToolBar.prototype.elements.pre.title = '".html::escapeJS(__('Preformated text'))."'; ". 865 "jsToolBar.prototype.elements.ul.title = '".html::escapeJS(__('Unordered list'))."'; ". 866 "jsToolBar.prototype.elements.ol.title = '".html::escapeJS(__('Ordered list'))."'; ". 867 868 "jsToolBar.prototype.elements.link.title = '".html::escapeJS(__('Link'))."'; ". 869 "jsToolBar.prototype.elements.link.href_prompt = '".html::escapeJS(__('URL?'))."'; ". 870 "jsToolBar.prototype.elements.link.hreflang_prompt = '".html::escapeJS(__('Language?'))."'; ". 871 872 "jsToolBar.prototype.elements.img.title = '".html::escapeJS(__('External image'))."'; ". 873 "jsToolBar.prototype.elements.img.src_prompt = '".html::escapeJS(__('URL?'))."'; ". 874 875 "jsToolBar.prototype.elements.img_select.title = '".html::escapeJS(__('Media chooser'))."'; ". 876 "jsToolBar.prototype.elements.post_link.title = '".html::escapeJS(__('Link to an entry'))."'; "; 877 878 if (!$GLOBALS['core']->auth->check('media,media_admin',$GLOBALS['core']->blog->id)) { 879 $res .= "jsToolBar.prototype.elements.img_select.disabled = true;\n"; 880 } 881 882 $res .= 883 "\n//]]>\n". 884 "</script>\n"; 885 886 return $res; 885 887 } 886 888 887 889 public static function jsUpload($params=array(),$base_url=null) 888 890 { 889 if (!$base_url) {890 $base_url = path::clean(dirname(preg_replace('/(\?.*$)?/','',$_SERVER['REQUEST_URI']))).'/';891 }892 893 $params = array_merge($params,array(894 'sess_id='.session_id(),895 'sess_uid='.$_SESSION['sess_browser_uid'],896 'xd_check='.$GLOBALS['core']->getNonce()891 if (!$base_url) { 892 $base_url = path::clean(dirname(preg_replace('/(\?.*$)?/','',$_SERVER['REQUEST_URI']))).'/'; 893 } 894 895 $params = array_merge($params,array( 896 'sess_id='.session_id(), 897 'sess_uid='.$_SESSION['sess_browser_uid'], 898 'xd_check='.$GLOBALS['core']->getNonce() 897 899 )); 898 900 899 return900 '<script type="text/javascript">'."\n".901 "//<![CDATA[\n".902 "dotclear.jsUpload = {};\n".903 "dotclear.jsUpload.msg = {};\n".904 self::jsVar('dotclear.msg.enhanced_uploader_activate',__('Temporarily activate enhanced uploader')).905 self::jsVar('dotclear.msg.enhanced_uploader_disable',__('Temporarily disable enhanced uploader')).906 self::jsVar('dotclear.jsUpload.msg.limit_exceeded',__('Limit exceeded.')).907 self::jsVar('dotclear.jsUpload.msg.size_limit_exceeded',__('File size exceeds allowed limit.')).908 self::jsVar('dotclear.jsUpload.msg.canceled',__('Canceled.')).909 self::jsVar('dotclear.jsUpload.msg.http_error',__('HTTP Error:')).910 self::jsVar('dotclear.jsUpload.msg.error',__('Error:')).911 self::jsVar('dotclear.jsUpload.msg.choose_file',__('Choose file')).912 self::jsVar('dotclear.jsUpload.msg.choose_files',__('Choose files')).913 self::jsVar('dotclear.jsUpload.msg.cancel',__('Cancel')).914 self::jsVar('dotclear.jsUpload.msg.clean',__('Clean')).915 self::jsVar('dotclear.jsUpload.msg.upload',__('Upload')).901 return 902 '<script type="text/javascript">'."\n". 903 "//<![CDATA[\n". 904 "dotclear.jsUpload = {};\n". 905 "dotclear.jsUpload.msg = {};\n". 906 self::jsVar('dotclear.msg.enhanced_uploader_activate',__('Temporarily activate enhanced uploader')). 907 self::jsVar('dotclear.msg.enhanced_uploader_disable',__('Temporarily disable enhanced uploader')). 908 self::jsVar('dotclear.jsUpload.msg.limit_exceeded',__('Limit exceeded.')). 909 self::jsVar('dotclear.jsUpload.msg.size_limit_exceeded',__('File size exceeds allowed limit.')). 910 self::jsVar('dotclear.jsUpload.msg.canceled',__('Canceled.')). 911 self::jsVar('dotclear.jsUpload.msg.http_error',__('HTTP Error:')). 912 self::jsVar('dotclear.jsUpload.msg.error',__('Error:')). 913 self::jsVar('dotclear.jsUpload.msg.choose_file',__('Choose file')). 914 self::jsVar('dotclear.jsUpload.msg.choose_files',__('Choose files')). 915 self::jsVar('dotclear.jsUpload.msg.cancel',__('Cancel')). 916 self::jsVar('dotclear.jsUpload.msg.clean',__('Clean')). 917 self::jsVar('dotclear.jsUpload.msg.upload',__('Upload')). 916 918 self::jsVar('dotclear.jsUpload.msg.send',__('Send')). 917 919 self::jsVar('dotclear.jsUpload.msg.file_successfully_uploaded',__('File successfully uploaded.')). 918 self::jsVar('dotclear.jsUpload.msg.no_file_in_queue',__('No file in queue.')).919 self::jsVar('dotclear.jsUpload.msg.file_in_queue',__('1 file in queue.')).920 self::jsVar('dotclear.jsUpload.msg.files_in_queue',__('%d files in queue.')).921 self::jsVar('dotclear.jsUpload.msg.queue_error',__('Queue error:')).922 self::jsVar('dotclear.jsUpload.base_url',$base_url).923 "\n//]]>\n".920 self::jsVar('dotclear.jsUpload.msg.no_file_in_queue',__('No file in queue.')). 921 self::jsVar('dotclear.jsUpload.msg.file_in_queue',__('1 file in queue.')). 922 self::jsVar('dotclear.jsUpload.msg.files_in_queue',__('%d files in queue.')). 923 self::jsVar('dotclear.jsUpload.msg.queue_error',__('Queue error:')). 924 self::jsVar('dotclear.jsUpload.base_url',$base_url). 925 "\n//]]>\n". 924 926 "</script>\n". 925 927 … … 938 940 public static function jsToolMan() 939 941 { 940 return941 '<script type="text/javascript" src="js/tool-man/core.js"></script>'.942 '<script type="text/javascript" src="js/tool-man/events.js"></script>'.943 '<script type="text/javascript" src="js/tool-man/css.js"></script>'.944 '<script type="text/javascript" src="js/tool-man/coordinates.js"></script>'.945 '<script type="text/javascript" src="js/tool-man/drag.js"></script>'.946 '<script type="text/javascript" src="js/tool-man/dragsort.js"></script>'.947 '<script type="text/javascript" src="js/dragsort-tablerows.js"></script>';942 return 943 '<script type="text/javascript" src="js/tool-man/core.js"></script>'. 944 '<script type="text/javascript" src="js/tool-man/events.js"></script>'. 945 '<script type="text/javascript" src="js/tool-man/css.js"></script>'. 946 '<script type="text/javascript" src="js/tool-man/coordinates.js"></script>'. 947 '<script type="text/javascript" src="js/tool-man/drag.js"></script>'. 948 '<script type="text/javascript" src="js/tool-man/dragsort.js"></script>'. 949 '<script type="text/javascript" src="js/dragsort-tablerows.js"></script>'; 948 950 } 949 951 950 952 public static function jsMetaEditor() 951 953 { 952 return953 '<script type="text/javascript" src="js/meta-editor.js"></script>';954 return 955 '<script type="text/javascript" src="js/meta-editor.js"></script>'; 954 956 } 955 957 } -
inc/admin/prepend.php
r1490 r2313 22 22 header("Pragma: no-cache"); 23 23 24 function dc_valid_fav($url) {25 global $core;26 27 if (preg_match('#plugin\.php\?p=([^&]+)#',$url,$matches)) {28 if (isset($matches[1])) {29 if (!$core->plugins->moduleExists($matches[1])) {30 return false;31 }32 }33 }34 return true;35 }36 37 function dc_prepare_url($url) {38 39 $u = str_replace(array('?','&','/'),array('\?','&','\\/'),$url);40 return (!strpos($u,'\?') ?41 '/'.$u.'$/' :42 (!strpos($u,'&') ?43 '/'.$u.'(\?.*)?$/' :44 '/'.$u.'(&.*)?$/'));45 }46 47 24 function dc_load_locales() { 48 25 global $_lang, $core; … … 51 28 $_lang = preg_match('/^[a-z]{2}(-[a-z]{2})?$/',$_lang) ? $_lang : 'en'; 52 29 30 l10n::lang($_lang); 53 31 if (l10n::set(dirname(__FILE__).'/../../locales/'.$_lang.'/date') === false && $_lang != 'en') { 54 32 l10n::set(dirname(__FILE__).'/../../locales/en/date'); … … 216 194 } 217 195 unset($hfiles,$locales_root); 196 // Contextual help flag 197 $GLOBALS['__resources']['ctxhelp'] = false; 218 198 219 199 $core->auth->user_prefs->addWorkspace('interface'); 220 200 $user_ui_nofavmenu = $core->auth->user_prefs->interface->nofavmenu; 221 201 222 # Standard favorites223 $_fav = new ArrayObject(); 202 $core->favs = new dcFavorites($core); 203 224 204 225 205 # [] : Title, URL, small icon, large icon, permissions, id, class 226 206 # NB : '*' in permissions means any, null means super admin only 227 207 228 $_fav['prefs'] = new ArrayObject(array('prefs','My preferences','preferences.php',229 'images/menu/user-pref.png','images/menu/user-pref-b.png',230 '*',null,null));231 232 $_fav['new_post'] = new ArrayObject(array('new_post','New entry','post.php',233 'images/menu/edit.png','images/menu/edit-b.png',234 'usage,contentadmin',null,'menu-new-post'));235 $_fav['posts'] = new ArrayObject(array('posts','Entries','posts.php',236 'images/menu/entries.png','images/menu/entries-b.png',237 'usage,contentadmin',null,null));238 $_fav['comments'] = new ArrayObject(array('comments','Comments','comments.php',239 'images/menu/comments.png','images/menu/comments-b.png',240 'usage,contentadmin',null,null));241 $_fav['search'] = new ArrayObject(array('search','Search','search.php',242 'images/menu/search.png','images/menu/search-b.png',243 'usage,contentadmin',null,null));244 $_fav['categories'] = new ArrayObject(array('categories','Categories','categories.php',245 'images/menu/categories.png','images/menu/categories-b.png',246 'categories',null,null));247 $_fav['media'] = new ArrayObject(array('media','Media manager','media.php',248 'images/menu/media.png','images/menu/media-b.png',249 'media,media_admin',null,null));250 $_fav['blog_pref'] = new ArrayObject(array('blog_pref','Blog settings','blog_pref.php',251 'images/menu/blog-pref.png','images/menu/blog-pref-b.png',252 'admin',null,null));253 $_fav['blog_theme'] = new ArrayObject(array('blog_theme','Blog appearance','blog_theme.php',254 'images/menu/themes.png','images/menu/blog-theme-b.png',255 'admin',null,null));256 257 $_fav['blogs'] = new ArrayObject(array('blogs','Blogs','blogs.php',258 'images/menu/blogs.png','images/menu/blogs-b.png',259 'usage,contentadmin',null,null));260 $_fav['users'] = new ArrayObject(array('users','Users','users.php',261 'images/menu/users.png','images/menu/users-b.png',262 null,null,null));263 $_fav['plugins'] = new ArrayObject(array('plugins','Plugins','plugins.php',264 'images/menu/plugins.png','images/menu/plugins-b.png',265 null,null,null));266 $_fav['langs'] = new ArrayObject(array('langs','Languages','langs.php',267 'images/menu/langs.png','images/menu/langs-b.png',268 null,null,null));269 208 270 209 # Menus creation 210 $_menu = new ArrayObject(); 271 211 $_menu['Dashboard'] = new dcMenu('dashboard-menu',null); 272 if (!$user_ui_nofavmenu) 273 $_menu['Favorites'] = new dcMenu('favorites-menu','My favorites'); 212 if (!$user_ui_nofavmenu) { 213 $core->favs->appendMenuTitle($_menu); 214 } 274 215 $_menu['Blog'] = new dcMenu('blog-menu','Blog'); 275 216 $_menu['System'] = new dcMenu('system-menu','System'); 276 217 $_menu['Plugins'] = new dcMenu('plugins-menu','Plugins'); 277 278 218 # Loading plugins 279 219 $core->plugins->loadModules(DC_PLUGINS_ROOT,'admin',$_lang); 280 281 # Loading favorites info from plugins 282 $core->callBehavior('adminDashboardFavs', $core, $_fav); 220 $core->favs->setup(); 221 222 if (!$user_ui_nofavmenu) { 223 $core->favs->appendMenu($_menu); 224 } 225 283 226 284 227 # Set menu titles … … 286 229 $_menu['System']->title = __('System settings'); 287 230 $_menu['Blog']->title = __('Blog'); 288 $_menu['Plugins']->title = __('Additional plugins'); 289 if (!$user_ui_nofavmenu) 290 $_menu['Favorites']->title = __('My favorites'); 291 292 /* 293 if (!preg_match('/index.php$/',$_SERVER['REQUEST_URI'])) { 294 # Admin index can't be add in fav's 295 $_menu['Dashboard']->prependItem(__('Add this page to my favorites'),'#','images/menu/add_to_favorites.png', 296 false,$core->auth->check('usage,contentadmin',$core->blog->id),'fav-add'); 297 } 298 */ 231 $_menu['Plugins']->title = __('Plugins'); 232 233 299 234 $_menu['Blog']->prependItem(__('Blog appearance'),'blog_theme.php','images/menu/themes.png', 300 235 preg_match('/blog_theme.php(\?.*)?$/',$_SERVER['REQUEST_URI']), … … 320 255 $_menu['Blog']->prependItem(__('New entry'),'post.php','images/menu/edit.png', 321 256 preg_match('/post.php$/',$_SERVER['REQUEST_URI']), 322 $core->auth->check('usage,contentadmin',$core->blog->id) ,'menu-new-post');323 324 $_menu['System']->prependItem(__('Update s'),'update.php','images/menu/update.png',257 $core->auth->check('usage,contentadmin',$core->blog->id)); 258 259 $_menu['System']->prependItem(__('Update'),'update.php','images/menu/update.png', 325 260 preg_match('/update.php(\?.*)?$/',$_SERVER['REQUEST_URI']), 326 261 $core->auth->isSuperAdmin() && is_readable(DC_DIGESTS)); … … 328 263 preg_match('/langs.php(\?.*)?$/',$_SERVER['REQUEST_URI']), 329 264 $core->auth->isSuperAdmin()); 330 $_menu['System']->prependItem(__('Plugins '),'plugins.php','images/menu/plugins.png',265 $_menu['System']->prependItem(__('Plugins management'),'plugins.php','images/menu/plugins.png', 331 266 preg_match('/plugins.php(\?.*)?$/',$_SERVER['REQUEST_URI']), 332 267 $core->auth->isSuperAdmin()); … … 337 272 preg_match('/blogs.php$/',$_SERVER['REQUEST_URI']), 338 273 $core->auth->isSuperAdmin() || 339 $core->auth->check('usage,contentadmin',$core->blog->id) && $core->auth->blog_count > 1); 340 341 if (!$user_ui_nofavmenu) { 342 // Set favorites menu 343 $ws = $core->auth->user_prefs->addWorkspace('favorites'); 344 $count = 0; 345 foreach ($ws->dumpPrefs() as $k => $v) { 346 // User favorites only 347 if (!$v['global']) { 348 $fav = unserialize($v['value']); 349 if (dc_valid_fav($fav['url'])) { 350 $count++; 351 $_menu['Favorites']->addItem(__($fav['title']),$fav['url'],$fav['small-icon'], 352 preg_match(dc_prepare_url($fav['url']),$_SERVER['REQUEST_URI']), 353 (($fav['permissions'] == '*') || $core->auth->check($fav['permissions'],$core->blog->id)),$fav['id'],$fav['class']); 354 } 355 } 356 } 357 if (!$count) { 358 // Global favorites if any 359 foreach ($ws->dumpPrefs() as $k => $v) { 360 $fav = unserialize($v['value']); 361 if (dc_valid_fav($fav['url'])) { 362 $count++; 363 $_menu['Favorites']->addItem(__($fav['title']),$fav['url'],$fav['small-icon'], 364 preg_match(dc_prepare_url($fav['url']),$_SERVER['REQUEST_URI']), 365 (($fav['permissions'] == '*') || $core->auth->check($fav['permissions'],$core->blog->id)),$fav['id'],$fav['class']); 366 } 367 } 368 } 369 if (!$count) { 370 // No user or global favorites, add "new entry" fav 371 $_menu['Favorites']->addItem(__('New entry'),'post.php','images/menu/edit.png', 372 preg_match('/post.php$/',$_SERVER['REQUEST_URI']), 373 $core->auth->check('usage,contentadmin',$core->blog->id),'menu-new-post',null); 374 } 274 $core->auth->check('usage,contentadmin',$core->blog->id) && $core->auth->getBlogCount() > 1); 275 276 if (empty($core->blog->settings->system->jquery_migrate_mute)) { 277 $core->blog->settings->system->put('jquery_migrate_mute', true, 'boolean', 'Mute warnings for jquery migrate plugin ?', false); 375 278 } 376 279 } -
inc/admin/prepend.php
r2277 r2313 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 … … 219 219 $core->plugins->loadModules(DC_PLUGINS_ROOT,'admin',$_lang); 220 220 $core->favs->setup(); 221 221 222 222 if (!$user_ui_nofavmenu) { 223 223 $core->favs->appendMenu($_menu); … … 273 273 $core->auth->isSuperAdmin() || 274 274 $core->auth->check('usage,contentadmin',$core->blog->id) && $core->auth->getBlogCount() > 1); 275 275 276 276 if (empty($core->blog->settings->system->jquery_migrate_mute)) { 277 277 $core->blog->settings->system->put('jquery_migrate_mute', true, 'boolean', 'Mute warnings for jquery migrate plugin ?', false); 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); 280 289 ?>
Note: See TracChangeset
for help on using the changeset viewer.
