Changes in [2634:d60876d7e4e4:2635:ad168cf3085a]
- Files:
-
- 89 added
- 47 deleted
- 47 edited
Legend:
- Unmodified
- Added
- Removed
-
.hgsubstate
r2618 r2624 1 94b97f44f94e951b8b6392bd76d8c9a3791388e2inc/libs/clearbricks1 d80e4972aaaa26450e5d2f45d55ed8eca0706f9d inc/libs/clearbricks -
Makefile
r2558 r2615 40 40 ./$(DC)/themes/ 41 41 42 ## Copy built-in plugins 43 cp -pRf \ 44 ./plugins/aboutConfig \ 45 ./plugins/akismet \ 46 ./plugins/antispam \ 47 ./plugins/attachments \ 48 ./plugins/blogroll \ 49 ./plugins/blowupConfig \ 50 ./plugins/dclegacy \ 51 ./plugins/fairTrackbacks \ 52 ./plugins/importExport \ 53 ./plugins/maintenance \ 54 ./plugins/tags \ 55 ./plugins/pages \ 56 ./plugins/pings \ 57 ./plugins/simpleMenu \ 58 ./plugins/themeEditor \ 59 ./plugins/userPref \ 60 ./plugins/widgets \ 42 ## Copy built-in plugins based on DC_DISTRIB_PLUGINS constant 43 cp -pRf $$(grep DC_DISTRIB_PLUGINS inc/prepend.php | \ 44 sed -e "s/.*,'//" -e "s/'.*//" | \ 45 sed -e 's/\(^\|,\)/ .\/plugins\//g') \ 61 46 ./$(DC)/plugins/ 62 47 … … 68 53 find $(DC)/admin/js/ie7/*.js -exec ./build-tools/min-js.php \{\} \; 69 54 find $(DC)/admin/js/jquery/*.js -exec ./build-tools/min-js.php \{\} \; 70 find $(DC)/admin/js/jsToolBar/*.js -exec ./build-tools/min-js.php \{\} \;71 55 find $(DC)/admin/js/jsUpload/*.js -exec ./build-tools/min-js.php \{\} \; 72 56 find $(DC)/plugins -name '*.js' -exec ./build-tools/min-js.php \{\} \; … … 134 118 135 119 120 copy-plugins: clean -
admin/_charte.php
r2501 r2504 31 31 <script type="text/javascript" src="js/jquery/jquery.js"></script> 32 32 <script type="text/javascript" src="js/jquery/jquery-ui.custom.js"></script> 33 <script type="text/javascript" src="js/jquery/jquery.ui.touch-punch.js"></script> 33 34 <script type="text/javascript" src="js/jquery/jquery.pageTabs.js"></script> 34 35 <script type="text/javascript" src="js/jquery/jquery.biscuit.js"></script> -
admin/blog.php
r2566 r2596 21 21 22 22 # Create a blog 23 if (!isset($_POST['id']) && !empty($_POST['blog_id']))23 if (!isset($_POST['id']) && (isset($_POST['create']))) 24 24 { 25 25 $cur = $core->con->openCursor($core->prefix.'blog'); … … 84 84 '<p class="form-note">'.__('At least 2 characters using letters, numbers or symbols.').'</p> '; 85 85 86 if ($blog_id) {87 echo88 '<p class="form-note warn">'.__('Please note that changing your blog ID may require changes in your public index.php file.').'</p>';89 }90 91 86 echo 92 87 '<p><label class="required" for="blog_name"><abbr title="'.__('Required field').'">*</abbr> '.__('Blog name:').'</label> '. … … 99 94 form::textarea('blog_desc',60,5,html::escapeHTML($blog_desc)).'</p>'. 100 95 101 '<p><input type="submit" accesskey="s" value="'.__('Create').'" /></p>'.96 '<p><input type="submit" accesskey="s" name="create" value="'.__('Create').'" /></p>'. 102 97 '</form>'; 103 98 -
admin/blog_pref.php
r2566 r2577 166 166 $media_img_m_size = abs((integer) $_POST['media_img_m_size']); 167 167 if ($media_img_m_size < 0) { $media_img_m_size = 448; } 168 169 $nb_post_for_home = abs((integer) $_POST['nb_post_for_home']); 170 if ($nb_post_for_home <= 1) { $nb_post_for_home = 1; } 168 171 169 172 $nb_post_per_page = abs((integer) $_POST['nb_post_per_page']); … … 231 234 $blog_settings->system->put('note_title_tag',$_POST['note_title_tag']); 232 235 236 $blog_settings->system->put('nb_post_for_home',$nb_post_for_home); 233 237 $blog_settings->system->put('nb_post_per_page',$nb_post_per_page); 234 238 $blog_settings->system->put('use_smilies',!empty($_POST['use_smilies'])); … … 512 516 513 517 '<div class="col">'. 518 '<p><label for="nb_post_for_home" class="classic">'.sprintf(__('Display %s entries on home page'), 519 form::field('nb_post_for_home',2,3,$blog_settings->system->nb_post_for_home)). 520 '</label></p>'. 521 514 522 '<p><label for="nb_post_per_page" class="classic">'.sprintf(__('Display %s entries per page'), 515 523 form::field('nb_post_per_page',2,3,$blog_settings->system->nb_post_per_page)). -
admin/categories.php
r2566 r2567 109 109 && $rs->count()>1) { 110 110 $starting_script .= dcPage::jsLoad('js/jquery/jquery-ui.custom.js'); 111 $starting_script .= dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'); 111 112 $starting_script .= dcPage::jsLoad('js/jquery/jquery.mjs.nestedSortable.js'); 112 113 } -
admin/category.php
r2566 r2614 176 176 dcPage::open($title, 177 177 dcPage::jsConfirmClose('category-form'). 178 dcPage::jsToolBar().179 178 dcPage::jsLoad('js/_category.js'), 179 $core->callBehavior('adminPostEditor'). 180 180 dcPage::breadcrumb($elements) 181 181 ); -
admin/comment.php
r2566 r2614 181 181 dcPage::open(__('Edit comment'), 182 182 dcPage::jsConfirmClose('comment-form'). 183 dcPage::jsToolBar().184 183 dcPage::jsLoad('js/_comment.js'). 184 $core->callBehavior('adminPostEditor'). 185 185 # --BEHAVIOR-- adminCommentHeaders 186 186 $core->callBehavior('adminCommentHeaders'), -
admin/index.php
r2566 r2614 171 171 -------------------------------------------------------- */ 172 172 dcPage::open(__('Dashboard'), 173 dcPage::jsToolBar().174 173 dcPage::jsLoad('js/_index.js'). 174 $core->callBehavior('adminPostEditor'). 175 175 # --BEHAVIOR-- adminDashboardHeaders 176 176 $core->callBehavior('adminDashboardHeaders'), -
admin/js/_category.js
r2566 r2614 2 2 dotclear.hideLockable(); 3 3 4 var tbCategory = new jsToolBar(document.getElementById('cat_desc')); 5 tbCategory.draw('xhtml'); 4 if ($.isFunction('jsToolBar')) { 5 var tbCategory = new jsToolBar(document.getElementById('cat_desc')); 6 tbCategory.draw('xhtml'); 7 } 6 8 }); -
admin/js/_comment.js
r2566 r2614 1 1 $(function() { 2 if ( !document.getElementById) { return; }3 4 var tbComment = new jsToolBar(document.getElementById('comment_content'));5 tbComment.draw('xhtml');2 if ($.isFunction('jsToolBar')) { 3 var tbComment = new jsToolBar(document.getElementById('comment_content')); 4 tbComment.draw('xhtml'); 5 } 6 6 7 7 $('#comment-form input[name="delete"]').click(function() { -
admin/js/_index.js
r1699 r2614 2 2 var f = $('#quick-entry'); 3 3 if (f.length > 0) { 4 var contentTb = new jsToolBar($('#post_content',f)[0]); 5 contentTb.switchMode($('#post_format',f).val()); 4 if ($.isFunction('jsToolBar')) { 5 var contentTb = new jsToolBar($('#post_content',f)[0]); 6 contentTb.switchMode($('#post_format',f).val()); 7 } 6 8 7 9 $('input[name=save]',f).click(function() { … … 21 23 22 24 function quickPost(f,status) { 23 if ( contentTb.getMode() == 'wysiwyg') {25 if ($.isFunction('jsToolBar') && (contentTb.getMode() == 'wysiwyg')) { 24 26 contentTb.syncContents('iframe'); 25 27 } … … 55 57 $('#post_title',f).val(''); 56 58 $('#post_content',f).val(''); 57 if ( contentTb.getMode() == 'wysiwyg') {59 if ($.isFunction('jsToolBar') && (contentTb.getMode() == 'wysiwyg')) { 58 60 contentTb.syncContents('textarea'); 59 61 } -
admin/js/_post.js
r2556 r2614 51 51 52 52 $(function() { 53 if (!document.getElementById) { return; }54 55 if (document.getElementById('edit-entry'))56 {57 // Get document format and prepare toolbars58 var formatField = $('#post_format').get(0);59 var last_post_format = $(formatField).val();60 $(formatField).change(function() {61 // Confirm post format change62 if(window.confirm(dotclear.msg.confirm_change_post_format_noconvert)){63 excerptTb.switchMode(this.value);64 contentTb.switchMode(this.value);65 last_post_format = $(this).val();66 }else{67 // Restore last format if change cancelled68 $(this).val(last_post_format);69 }70 71 $('.format_control > *').addClass('hide');72 $('.format_control:not(.control_no_'+$(this).val()+') > *').removeClass('hide');73 });74 75 var excerptTb = new jsToolBar(document.getElementById('post_excerpt'));76 var contentTb = new jsToolBar(document.getElementById('post_content'));77 excerptTb.context = contentTb.context = 'post';78 }79 80 if (document.getElementById('comment_content')) {81 var commentTb = new jsToolBar(document.getElementById('comment_content'));82 commentTb.draw('xhtml');83 }84 85 53 // Post preview 86 54 $('#post-preview').modalWeb($(window).width()-40,$(window).height()-40); … … 99 67 return window.confirm(dotclear.msg.confirm_delete_post); 100 68 }); 101 102 // Markup validator103 var v = $('<div class="format_control"><p><a id="a-validator"></a></p><div/>').get(0);104 $('.format_control').before(v);105 var a = $('#a-validator').get(0);106 a.href = '#';107 a.className = 'button ';108 $(a).click(function() {109 110 excerpt_content = $('#post_excerpt').css('display') != 'none' ? $('#post_excerpt').val() : $('#excerpt-area iframe').contents().find('body').html();111 post_content = $('#post_content').css('display') != 'none' ? $('#post_content').val() : $('#content-area iframe').contents().find('body').html();112 113 var params = {114 xd_check: dotclear.nonce,115 f: 'validatePostMarkup',116 excerpt: excerpt_content,117 content: post_content,118 format: $('#post_format').get(0).value,119 lang: $('#post_lang').get(0).value120 };121 122 $.post('services.php',params,function(data) {123 if ($(data).find('rsp').attr('status') != 'ok') {124 alert($(data).find('rsp message').text());125 return false;126 }127 128 $('.message, .success, .error, .warning-msg').remove();129 130 if ($(data).find('valid').text() == 1) {131 var p = document.createElement('p');132 p.id = 'markup-validator';133 134 $(p).addClass('success');135 $(p).text(dotclear.msg.xhtml_valid);136 $('#entry-content h3').after(p);137 $(p).backgroundFade({sColor: dotclear.fadeColor.beginValidatorMsg, eColor: dotclear.fadeColor.endValidatorMsg, steps: 50},function() {138 $(this).backgroundFade({sColor: dotclear.fadeColor.endValidatorMsg, eColor: dotclear.fadeColor.beginValidatorMsg});139 });140 } else {141 var div = document.createElement('div');142 div.id = 'markup-validator';143 144 $(div).addClass('error');145 $(div).html('<p><strong>' + dotclear.msg.xhtml_not_valid + '</strong></p>' + $(data).find('errors').text());146 $('#entry-content h3').after(div);147 $(div).backgroundFade({sColor: dotclear.fadeColor.beginValidatorErr,eColor: dotclear.fadeColor.endValidatorErr, steps: 50},function() {148 $(this).backgroundFade({sColor: dotclear.fadeColor.endValidatorErr, eColor: dotclear.fadeColor.beginValidatorErr});149 });150 }151 152 if ( $('#post_excerpt').text() != excerpt_content || $('#post_content').text() != post_content ) {153 var pn = document.createElement('p');154 $(pn).addClass('warning-msg');155 $(pn).text(dotclear.msg.warning_validate_no_save_content);156 $('#entry-content h3').after(pn);157 }158 159 return false;160 });161 162 return false;163 });164 165 a.appendChild(document.createTextNode(dotclear.msg.xhtml_validator));166 167 $('.format_control > *').addClass('hide');168 $('.format_control:not(.control_no_'+last_post_format+') > *').removeClass('hide');169 69 170 70 // Hide some fields … … 218 118 }); 219 119 220 // Load toolbars221 contentTb.switchMode(formatField.value);222 excerptTb.switchMode(formatField.value);223 224 120 // Replace attachment remove links by a POST form submit 225 121 $('a.attachment-remove').click(function() { … … 232 128 } 233 129 return false; 234 });235 236 // Check unsaved changes before XHTML conversion237 var excerpt = $('#post_excerpt').val();238 var content = $('#post_content').val();239 $('#convert-xhtml').click(function() {240 if (excerpt != $('#post_excerpt').val() || content != $('#post_content').val()) {241 return window.confirm(dotclear.msg.confirm_change_post_format);242 }243 130 }); 244 131 }); -
admin/media.php
r2529 r2629 75 75 76 76 $page_url = 'media.php?popup='.$popup.'&post_id='.$post_id; 77 77 $temp = $core->callBehavior('adminMediaURL',$page_url); 78 if ($temp != '') { 79 $page_url=$temp; 80 } 78 81 if ($popup) { 79 82 $open_f = array('dcPage','openPopup'); … … 362 365 } 363 366 367 // Remove hidden directories (unless DC_SHOW_HIDDEN_DIRS is set to true) 368 if (!defined('DC_SHOW_HIDDEN_DIRS') || (DC_SHOW_HIDDEN_DIRS == false)) { 369 for ($i = count($dir['dirs']) - 1; $i >= 0; $i--) { 370 if ($dir['dirs'][$i]->d) { 371 if (strpos($dir['dirs'][$i]->relname,'.') !== false) { 372 unset($dir['dirs'][$i]); 373 } 374 } 375 } 376 } 364 377 $items = array_values(array_merge($dir['dirs'],$dir['files'])); 365 378 … … 565 578 } 566 579 } else { 567 $link = 568 'media_item.php?id='.$f->media_id.'&popup='.$popup.'&post_id='.$post_id;580 $link = 'media_item.php?id='.$f->media_id.'&popup='.$popup.'&post_id='.$post_id; 581 $link = $core->callBehavior('adminMediaURL',$link); 569 582 } 570 583 -
admin/media_item.php
r2566 r2614 209 209 if ($popup) { 210 210 $starting_scripts .= 211 dcPage::jsLoad('js/jsToolBar/popup_media.js');211 $core->callBehavior('adminPopupMedia'); 212 212 } 213 213 call_user_func($open_f,__('Media manager'), -
admin/popup_link.php
r2566 r2614 19 19 $title = !empty($_GET['title']) ? $_GET['title'] : ''; 20 20 21 dcPage::openPopup(__('Add a link'), dcPage::jsLoad('js/jsToolBar/popup_link.js'));21 dcPage::openPopup(__('Add a link'),$core->callBehavior('adminPopupLink')); 22 22 23 23 echo '<h2 class="page-title">'.__('Add a link').'</h2>'; -
admin/popup_posts.php
r2566 r2614 48 48 dcPage::openPopup(__('Add a link to an entry'), 49 49 dcPage::jsLoad('js/_posts_list.js'). 50 dcPage::jsLoad('js/jsToolBar/popup_posts.js'));50 $core->callBehavior('adminPopupPosts')); 51 51 52 52 echo '<h2 class="page-title">'.__('Add a link to an entry').'</h2>'; -
admin/post.php
r2566 r2614 375 375 dcPage::open($page_title.' - '.__('Entries'), 376 376 dcPage::jsDatePicker(). 377 dcPage::jsToolBar().378 377 dcPage::jsModal(). 379 378 dcPage::jsMetaEditor(). 380 379 dcPage::jsLoad('js/_post.js'). 380 $core->callBehavior('adminPostEditor'). 381 381 dcPage::jsConfirmClose('entry-form','comment-form'). 382 382 # --BEHAVIOR-- adminPostHeaders -
admin/preferences.php
r2566 r2567 305 305 ($user_acc_nodragdrop ? '' : dcPage::jsLoad('js/_preferences-dragdrop.js')). 306 306 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 307 dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'). 307 308 dcPage::jsLoad('js/jquery/jquery.pwstrength.js'). 308 309 '<script type="text/javascript">'."\n". -
inc/admin/lib.dc.page.php
r2513 r2614 589 589 '<script type="text/javascript">'."\n". 590 590 "//<![CDATA[\n". 591 'jsToolBar = {}, jsToolBar.prototype = { elements : {} };'."\n". 591 592 self::jsVar('dotclear.nonce',$GLOBALS['core']->getNonce()). 592 593 self::jsVar('dotclear.img_plus_src','images/expand.png'). … … 828 829 } 829 830 831 830 832 public static function jsToolBar() 831 833 { 832 $res = 833 '<link rel="stylesheet" type="text/css" href="style/jsToolBar/jsToolBar.css" />'. 834 '<script type="text/javascript" src="js/jsToolBar/jsToolBar.js"></script>'; 835 836 if (isset($GLOBALS['core']->auth) && $GLOBALS['core']->auth->getOption('enable_wysiwyg')) { 837 $res .= '<script type="text/javascript" src="js/jsToolBar/jsToolBar.wysiwyg.js"></script>'; 838 } 839 840 $res .= 841 '<script type="text/javascript" src="js/jsToolBar/jsToolBar.dotclear.js"></script>'. 842 '<script type="text/javascript">'."\n". 843 "//<![CDATA[\n". 844 "jsToolBar.prototype.dialog_url = 'popup.php'; ". 845 "jsToolBar.prototype.iframe_css = '". 846 'body{'. 847 'font: 12px "DejaVu Sans","Lucida Grande","Lucida Sans Unicode",Arial,sans-serif;'. 848 'color : #000;'. 849 'background: #f9f9f9;'. 850 'margin: 0;'. 851 'padding : 2px;'. 852 'border: none;'. 853 (l10n::getTextDirection($GLOBALS['_lang']) == 'rtl' ? 'direction:rtl;' : ''). 854 '}'. 855 'pre, code, kbd, samp {'. 856 'font-family:"Courier New",Courier,monospace;'. 857 'font-size : 1.1em;'. 858 '}'. 859 'code {'. 860 'color : #666;'. 861 'font-weight : bold;'. 862 '}'. 863 'body > p:first-child {'. 864 'margin-top: 0;'. 865 '}'. 866 "'; ". 867 "jsToolBar.prototype.base_url = '".html::escapeJS($GLOBALS['core']->blog->host)."'; ". 868 "jsToolBar.prototype.switcher_visual_title = '".html::escapeJS(__('visual'))."'; ". 869 "jsToolBar.prototype.switcher_source_title = '".html::escapeJS(__('source'))."'; ". 870 "jsToolBar.prototype.legend_msg = '". 871 html::escapeJS(__('You can use the following shortcuts to format your text.'))."'; ". 872 "jsToolBar.prototype.elements.blocks.options.none = '".html::escapeJS(__('-- none --'))."'; ". 873 "jsToolBar.prototype.elements.blocks.options.nonebis = '".html::escapeJS(__('-- block format --'))."'; ". 874 "jsToolBar.prototype.elements.blocks.options.p = '".html::escapeJS(__('Paragraph'))."'; ". 875 "jsToolBar.prototype.elements.blocks.options.h1 = '".html::escapeJS(__('Level 1 header'))."'; ". 876 "jsToolBar.prototype.elements.blocks.options.h2 = '".html::escapeJS(__('Level 2 header'))."'; ". 877 "jsToolBar.prototype.elements.blocks.options.h3 = '".html::escapeJS(__('Level 3 header'))."'; ". 878 "jsToolBar.prototype.elements.blocks.options.h4 = '".html::escapeJS(__('Level 4 header'))."'; ". 879 "jsToolBar.prototype.elements.blocks.options.h5 = '".html::escapeJS(__('Level 5 header'))."'; ". 880 "jsToolBar.prototype.elements.blocks.options.h6 = '".html::escapeJS(__('Level 6 header'))."'; ". 881 "jsToolBar.prototype.elements.strong.title = '".html::escapeJS(__('Strong emphasis'))."'; ". 882 "jsToolBar.prototype.elements.em.title = '".html::escapeJS(__('Emphasis'))."'; ". 883 "jsToolBar.prototype.elements.ins.title = '".html::escapeJS(__('Inserted'))."'; ". 884 "jsToolBar.prototype.elements.del.title = '".html::escapeJS(__('Deleted'))."'; ". 885 "jsToolBar.prototype.elements.quote.title = '".html::escapeJS(__('Inline quote'))."'; ". 886 "jsToolBar.prototype.elements.code.title = '".html::escapeJS(__('Code'))."'; ". 887 "jsToolBar.prototype.elements.br.title = '".html::escapeJS(__('Line break'))."'; ". 888 "jsToolBar.prototype.elements.blockquote.title = '".html::escapeJS(__('Blockquote'))."'; ". 889 "jsToolBar.prototype.elements.pre.title = '".html::escapeJS(__('Preformated text'))."'; ". 890 "jsToolBar.prototype.elements.ul.title = '".html::escapeJS(__('Unordered list'))."'; ". 891 "jsToolBar.prototype.elements.ol.title = '".html::escapeJS(__('Ordered list'))."'; ". 892 893 "jsToolBar.prototype.elements.link.title = '".html::escapeJS(__('Link'))."'; ". 894 "jsToolBar.prototype.elements.link.href_prompt = '".html::escapeJS(__('URL?'))."'; ". 895 "jsToolBar.prototype.elements.link.hreflang_prompt = '".html::escapeJS(__('Language?'))."'; ". 896 897 "jsToolBar.prototype.elements.img.title = '".html::escapeJS(__('External image'))."'; ". 898 "jsToolBar.prototype.elements.img.src_prompt = '".html::escapeJS(__('URL?'))."'; ". 899 900 "jsToolBar.prototype.elements.img_select.title = '".html::escapeJS(__('Media chooser'))."'; ". 901 "jsToolBar.prototype.elements.post_link.title = '".html::escapeJS(__('Link to an entry'))."'; ". 902 903 "jsToolBar.prototype.elements.removeFormat.title = '".html::escapeJS(__('Remove text formating'))."'; "; 904 905 if (!$GLOBALS['core']->auth->check('media,media_admin',$GLOBALS['core']->blog->id)) { 906 $res .= "jsToolBar.prototype.elements.img_select.disabled = true;\n"; 907 } 908 909 $res .= 910 "\n//]]>\n". 911 "</script>\n"; 912 913 return $res; 834 # Deprecated but we keep this for plugins. 914 835 } 915 836 -
inc/core/class.dc.blog.php
r2626 r2628 1894 1894 - post_id: (integer) Get comments belonging to given post_id 1895 1895 - cat_id: (integer or array) Get comments belonging to entries of given category ID 1896 - comment_id: (integer ) Get comment with given ID1896 - comment_id: (integer or array) Get comment with given ID (or IDs) 1897 1897 - comment_site: (string) Get comments with given comment_site 1898 1898 - comment_status: (integer) Get comments with given comment_status … … 1984 1984 1985 1985 if (isset($params['comment_id']) && $params['comment_id'] !== '') { 1986 $strReq .= 'AND comment_id = '.(integer) $params['comment_id'].' '; 1986 if (is_array($params['comment_id'])) { 1987 array_walk($params['comment_id'],create_function('&$v,$k','if($v!==null){$v=(integer)$v;}')); 1988 } else { 1989 $params['comment_id'] = array((integer) $params['comment_id']); 1990 } 1991 $strReq .= 'AND comment_id '.$this->con->in($params['comment_id']); 1987 1992 } 1988 1993 -
inc/core/class.dc.core.php
r2566 r2596 39 39 public $rest; ///< <b>dcRestServer</b> dcRestServer object 40 40 public $log; ///< <b>dcLog</b> dcLog object 41 public $stime; ///< <b>float</b> starting time 41 42 42 43 private $versions = null; … … 59 60 public function __construct($driver, $host, $db, $user, $password, $prefix, $persist) 60 61 { 62 if (defined('DC_START_TIME')) { 63 $this->stime=DC_START_TIME; 64 } else { 65 $this->stime = microtime(true); 66 } 67 61 68 $this->con = dbLayer::init($driver,$host,$db,$user,$password,$persist); 62 69 … … 982 989 private function getBlogCursor($cur) 983 990 { 984 if ($cur->blog_id !== null 985 && !preg_match('/^[A-Za-z0-9._-]{2,}$/',$cur->blog_id)) { 991 if (($cur->blog_id !== null 992 && !preg_match('/^[A-Za-z0-9._-]{2,}$/',$cur->blog_id)) || 993 (!$cur->blog_id)) { 986 994 throw new Exception(__('Blog ID must contain at least 2 characters using letters, numbers or symbols.')); 987 995 } 988 996 989 if ($cur->blog_name !== null && $cur->blog_name == '') { 997 if (($cur->blog_name !== null && $cur->blog_name == '') || 998 (!$cur->blog_name)) { 990 999 throw new Exception(__('No blog name')); 991 1000 } 992 1001 993 if ($cur->blog_url !== null && $cur->blog_url == '') { 1002 if (($cur->blog_url !== null && $cur->blog_url == '') || 1003 (!$cur->blog_url)) { 994 1004 throw new Exception(__('No blog URL')); 995 1005 } … … 1306 1316 array('media_img_title_pattern','string','Title ;; Date(%b %Y) ;; separator(, )', 1307 1317 'Pattern to set image title when you insert it in a post'), 1318 array('nb_post_for_home','integer',20, 1319 'Number of entries on first home page'), 1308 1320 array('nb_post_per_page','integer',20, 1309 'Number of entries on home page and category pages'),1321 'Number of entries on home pages and category pages'), 1310 1322 array('nb_post_per_feed','integer',20, 1311 1323 'Number of entries on feeds'), … … 1469 1481 } 1470 1482 } 1483 1484 /** 1485 Return elapsed time since script has been started 1486 @param $mtime <b>float</b> timestamp (microtime format) to evaluate delta from 1487 current time is taken if null 1488 @return <b>float</b> elapsed time 1489 */ 1490 public function getElapsedTime ($mtime=null) { 1491 if ($mtime !== null) { 1492 return $mtime-$this->stime; 1493 } else { 1494 return microtime(true)-$this->stime; 1495 } 1496 } 1471 1497 //@} 1498 1499 1500 1472 1501 } -
inc/core/class.dc.namespace.php
r2566 r2567 125 125 126 126 /** 127 Returns global setting value if exists. 128 129 @param n <b>string</b> setting name 130 @return <b>mixed</b> 131 */ 132 public function getGlobal($n) 133 { 134 if (isset($this->global_settings[$n]['value'])) { 135 return $this->global_settings[$n]['value']; 136 } 137 138 return null; 139 } 140 141 /** 142 Returns local setting value if exists. 143 144 @param n <b>string</b> setting name 145 @return <b>mixed</b> 146 */ 147 public function getLocal($n) 148 { 149 if (isset($this->local_settings[$n]['value'])) { 150 return $this->local_settings[$n]['value']; 151 } 152 153 return null; 154 } 155 156 /** 127 157 Magic __get method. 128 158 @copydoc ::get -
inc/core/class.dc.themes.php
r2566 r2607 59 59 # Themes specifics properties 60 60 $properties = array_merge( 61 array('parent' => null ),61 array('parent' => null, 'tplset' => DC_DEFAULT_TPLSET), 62 62 $properties, 63 63 array('permissions' => 'admin') // force themes perms -
inc/prepend.php
r2591 r2615 10 10 # 11 11 # -- END LICENSE BLOCK ----------------------------------------- 12 13 /* Start tick */ 14 define('DC_START_TIME',microtime(true)); 12 15 13 16 /* ------------------------------------------------------------------------------------------- */ … … 135 138 # Constants 136 139 define('DC_ROOT',path::real(dirname(__FILE__).'/..')); 137 define('DC_VERSION','2. 6.2');140 define('DC_VERSION','2.7-dev'); 138 141 define('DC_DIGESTS',dirname(__FILE__).'/digests'); 139 142 define('DC_L10N_ROOT',dirname(__FILE__).'/../locales'); 140 143 define('DC_L10N_UPDATE_URL','http://services.dotclear.net/dc2.l10n/?version=%s'); 141 define('DC_DISTRIB_PLUGINS','aboutConfig,akismet,antispam,attachments,blogroll,blowupConfig,dclegacy,fairTrackbacks,importExport,maintenance,pages,pings,simpleMenu,tags,themeEditor,userPref,widgets ');144 define('DC_DISTRIB_PLUGINS','aboutConfig,akismet,antispam,attachments,blogroll,blowupConfig,dclegacy,fairTrackbacks,importExport,maintenance,pages,pings,simpleMenu,tags,themeEditor,userPref,widgets,dcLegacyEditor'); 142 145 define('DC_DISTRIB_THEMES','blueSilence,blowupConfig,customCSS,default,ductile'); 146 define('DC_DEFAULT_TPLSET','mustek'); 143 147 144 148 if (!defined('DC_VENDOR_NAME')) { -
inc/public/class.dc.template.php
r2590 r2610 235 235 } 236 236 237 protected function compileFile($file)238 {239 $fc = file_get_contents($file);240 241 $this->compile_stack[] = $file;242 243 # Remove every PHP tags244 if ($this->remove_php)245 {246 $fc = preg_replace('/<\?(?=php|=|\s).*?\?>/ms','',$fc);247 }248 249 # Transform what could be considered as PHP short tags250 $fc = preg_replace('/(<\?(?!php|=|\s))(.*?)(\?>)/ms',251 '<?php echo "$1"; ?>$2<?php echo "$3"; ?>',$fc);252 253 # Remove template comments <!-- #... -->254 $fc = preg_replace('/(^\s*)?<!-- #(.*?)-->/ms','',$fc);255 256 # Lexer part : split file into small pieces257 # each array entry will be either a tag or plain text258 $blocks = preg_split(259 '#(<tpl:\w+[^>]*>)|(</tpl:\w+>)|({{tpl:\w+[^}]*}})#msu',$fc,-1,260 PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);261 262 # Next : build semantic tree from tokens.263 $rootNode = new tplNode();264 $node = $rootNode;265 $errors = array();266 foreach ($blocks as $id => $block) {267 $isblock = preg_match('#<tpl:(\w+)(?:(\s+.*?)>|>)|</tpl:(\w+)>|{{tpl:(\w+)(\s(.*?))?}}#ms',$block,$match);268 if ($isblock == 1) {269 if (substr($match[0],1,1) == '/') {270 // Closing tag, check if it matches current opened node271 $tag = $match[3];272 if (($node instanceof tplNodeBlock) && $node->getTag() == $tag) {273 $node->setClosing();274 $node = $node->getParent();275 } else {276 // Closing tag does not match opening tag277 // Search if it closes a parent tag278 $search = $node;279 while($search->getTag() != 'ROOT' && $search->getTag() != $tag) {280 $search = $search->getParent();281 }282 if ($search->getTag() == $tag) {283 $errors[] = sprintf(284 __('Did not find closing tag for block <tpl:%s>. Content has been ignored.'),285 html::escapeHTML($node->getTag()));286 $search->setClosing();287 $node = $search->getParent();288 } else {289 $errors[]=sprintf(290 __('Unexpected closing tag </tpl:%s> found.'),291 $tag);;292 }293 }294 } elseif (substr($match[0],0,1) == '{') {295 // Value tag296 $tag = $match[4];297 $str_attr = '';298 $attr = array();299 if (isset($match[6])) {300 $str_attr = $match[6];301 $attr = $this->getAttrs($match[6]);302 }303 $node->addChild(new tplNodeValue($tag,$attr,$str_attr));304 } else {305 // Opening tag, create new node and dive into it306 $tag = $match[1];307 $newnode = new tplNodeBlock($tag,isset($match[2])?$this->getAttrs($match[2]):array());308 $node->addChild($newnode);309 $node = $newnode;310 }311 } else {312 // Simple text313 $node->addChild(new tplNodeText($block));314 }315 }316 317 if (($node instanceof tplNodeBlock) && !$node->isClosed()) {318 $errors[] = sprintf(319 __('Did not find closing tag for block <tpl:%s>. Content has been ignored.'),320 html::escapeHTML($node->getTag()));321 }322 323 $err = "";324 if (count($errors) > 0) {325 $err = "\n\n<!-- \n".326 __('WARNING: the following errors have been found while parsing template file :').327 "\n * ".328 join("\n * ",$errors).329 "\n -->\n";330 }331 332 return $rootNode->compile($this).$err;333 }334 335 237 public function compileBlockNode($tag,$attr,$content) 336 238 { … … 343 245 $this->core->callBehavior('templateInsideBlock',$this->core,$this->current_tag,$attr,array(&$content)); 344 246 345 if (isset($this->blocks[$this->current_tag])) { 346 $res .= call_user_func($this->blocks[$this->current_tag],$attr,$content); 347 } elseif ($this->unknown_block_handler != null) { 348 $res .= call_user_func($this->unknown_block_handler,$this->current_tag,$attr,$content); 349 } 247 $res .= parent::compileBlockNode($this->current_tag,$attr,$content); 350 248 351 249 # --BEHAVIOR-- templateAfterBlock … … 363 261 $res = $this->core->callBehavior('templateBeforeValue',$this->core,$this->current_tag,$attr); 364 262 365 if (isset($this->values[$this->current_tag])) { 366 $res .= call_user_func($this->values[$this->current_tag],$attr,ltrim($str_attr)); 367 } elseif ($this->unknown_value_handler != null) { 368 $res .= call_user_func($this->unknown_value_handler,$this->current_tag,$attr,$str_attr); 369 } 263 $res .= parent::compileValueNode($this->current_tag,$attr,$str_attr); 370 264 371 265 # --BEHAVIOR-- templateAfterValue … … 373 267 374 268 return $res; 375 }376 377 public function setUnknownValueHandler($callback)378 {379 if (is_callable($callback)) {380 $this->unknown_value_handler = $callback;381 }382 }383 384 public function setUnknownBlockHandler($callback)385 {386 if (is_callable($callback)) {387 $this->unknown_block_handler = $callback;388 }389 269 } 390 270 … … 1173 1053 1174 1054 if ($lastn != 0) { 1055 // Set limit (aka nb of entries needed) 1175 1056 if ($lastn > 0) { 1057 // nb of entries per page specified in template -> regular pagination 1176 1058 $p .= "\$params['limit'] = ".$lastn.";\n"; 1177 1059 } else { 1178 $p .= "\$params['limit'] = \$_ctx->nb_entry_per_page;\n"; 1060 // nb of entries per page not specified -> use ctx settings 1061 $p .= "\$params['limit'] = (\$_page_number == 1 ? \$_ctx->nb_entry_first_page : \$_ctx->nb_entry_per_page);\n"; 1179 1062 } 1180 1063 // Set offset (aka index of first entry) 1181 1064 if (!isset($attr['ignore_pagination']) || $attr['ignore_pagination'] == "0") { 1182 $p .= "\$params['limit'] = array(((\$_page_number-1)*\$params['limit']),\$params['limit']);\n"; 1065 // standard pagination, set offset 1066 $p .= "\$params['limit'] = array((\$_page_number == 1 ? 0 : (\$_page_number - 2) * \$_ctx->nb_entry_per_page + \$_ctx->nb_entry_first_page),\$params['limit']);\n"; 1183 1067 } else { 1068 // no pagination, get all posts from 0 to limit 1184 1069 $p .= "\$params['limit'] = array(0, \$params['limit']);\n"; 1185 1070 } -
inc/public/lib.tpl.context.php
r2566 r2577 206 206 207 207 $nb_posts = $_ctx->pagination->f(0); 208 $nb_per_page = $_ctx->post_params['limit'][1]; 209 210 $nb_pages = ceil($nb_posts/$nb_per_page); 208 $nb_pages = ceil(($nb_posts - $_ctx->nb_entry_first_page) / $_ctx->nb_entry_per_page + 1); 211 209 212 210 return $nb_pages; -
inc/public/lib.urlhandlers.php
r2634 r2635 86 86 $_ctx->nb_entry_per_page = $core->blog->settings->system->nb_post_per_page; 87 87 } 88 if ($_ctx->nb_entry_first_page === null) { 89 $_ctx->nb_entry_first_page = $_ctx->nb_entry_per_page; 90 } 88 91 89 92 $tpl_file = $core->tpl->getFilePath($tpl); … … 188 191 else 189 192 { 193 $_ctx =& $GLOBALS['_ctx']; 190 194 $core =& $GLOBALS['core']; 191 195 … … 196 200 197 201 if (empty($_GET['q'])) { 202 if ($core->blog->settings->system->nb_post_for_home !== null) { 203 $_ctx->nb_entry_first_page = $core->blog->settings->system->nb_post_for_home; 204 } 198 205 self::serveDocument('home.html'); 199 206 $core->blog->publishScheduledEntries(); … … 416 423 if ($content != '') 417 424 { 418 if ($core->blog->settings->system->wiki_comments) { 419 $core->initWikiComment(); 425 # --BEHAVIOR-- publicBeforeCommentTransform 426 $buffer = $core->callBehavior('publicBeforeCommentTransform',$content); 427 if ($buffer != '') { 428 $content = $buffer; 420 429 } else { 421 $core->initWikiSimpleComment(); 430 if ($core->blog->settings->system->wiki_comments) { 431 $core->initWikiComment(); 432 } else { 433 $core->initWikiSimpleComment(); 434 } 435 $content = $core->wikiTransform($content); 422 436 } 423 $content = $core->wikiTransform($content);424 437 $content = $core->HTMLfilter($content); 425 438 } -
inc/public/prepend.php
r2566 r2567 134 134 $__theme_tpl_path[] = $core->blog->themes_path.'/'.$__parent_theme.'/tpl'; 135 135 } 136 137 $core->tpl->setPath( 138 $__theme_tpl_path, 139 dirname(__FILE__).'/default-templates', 140 $core->tpl->getPath()); 141 136 $tplset = $core->themes->moduleInfo($core->blog->settings->system->theme,'tplset'); 137 if (!empty($tplset) && is_dir(dirname(__FILE__).'/default-templates/'.$tplset)) { 138 $core->tpl->setPath( 139 $__theme_tpl_path, 140 dirname(__FILE__).'/default-templates/'.$tplset, 141 $core->tpl->getPath()); 142 } else { 143 $core->tpl->setPath( 144 $__theme_tpl_path, 145 $core->tpl->getPath()); 146 } 142 147 $core->url->mode = $core->blog->settings->system->url_scan; 143 148 -
locales/fr/main.po
r2512 r2577 399 399 400 400 #, php-format 401 msgid "Display %s entries on home page" 402 msgstr "Afficher %s billets sur la page d'accueil" 403 404 #, php-format 401 405 msgid "Display %s entries per page" 402 406 msgstr "Afficher %s billets par page" -
plugins/antispam/filters/class.dc.filter.linkslookup.php
r2566 r2567 48 48 49 49 $i = count($domain_elem) - 1; 50 if ($i == 0) { 51 // "domain" is 1 word long, don't check it 52 return null; 53 } 50 54 $host = $domain_elem[$i]; 51 55 do -
plugins/antispam/index.php
r2566 r2567 117 117 echo 118 118 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 119 dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'). 119 120 dcPage::jsLoad('index.php?pf=antispam/antispam.js'); 120 121 } -
plugins/blogroll/index.php
r2566 r2567 177 177 echo 178 178 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 179 dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'). 179 180 dcPage::jsLoad('index.php?pf=blogroll/blogroll.js'); 180 181 } -
plugins/pages/_public.php
r2634 r2635 117 117 if ($content != '') 118 118 { 119 if ($core->blog->settings->system->wiki_comments) { 120 $core->initWikiComment(); 119 # --BEHAVIOR-- publicBeforeCommentTransform 120 $buffer = $core->callBehavior('publicBeforeCommentTransform',$content); 121 if ($buffer != '') { 122 $content = $buffer; 121 123 } else { 122 $core->initWikiSimpleComment(); 123 } 124 $content = $core->wikiTransform($content); 124 if ($core->blog->settings->system->wiki_comments) { 125 $core->initWikiComment(); 126 } else { 127 $core->initWikiSimpleComment(); 128 } 129 $content = $core->wikiTransform($content); 130 } 125 131 $content = $core->HTMLfilter($content); 126 132 } … … 189 195 header('X-Pingback: '.$core->blog->url.$core->url->getURLFor("xmlrpc",$core->blog->id)); 190 196 } 191 $core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__).'/default-templates'); 197 198 $tplset = $core->themes->moduleInfo($core->blog->settings->system->theme,'tplset'); 199 if (!empty($tplset) && is_dir(dirname(__FILE__).'/default-templates/'.$tplset)) { 200 $core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__).'/default-templates/'.$tplset); 201 } else { 202 $core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__).'/default-templates/'.DC_DEFAULT_TPLSET); 203 } 192 204 self::serveDocument('page.html'); 193 205 } -
plugins/pages/list.php
r2566 r2567 55 55 <title><?php echo __('Pages'); ?></title> 56 56 <?php 57 echo dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 57 echo 58 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 59 dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'). 58 60 dcPage::jsLoad('index.php?pf=pages/list.js'). 59 61 '<script type="text/javascript">'. -
plugins/pages/page.php
r2511 r2614 289 289 <?php echo 290 290 dcPage::jsDatePicker(). 291 dcPage::jsToolBar().292 291 dcPage::jsModal(). 293 292 dcPage::jsLoad('js/_post.js'). 293 $core->callBehavior('adminPostEditor'). 294 294 dcPage::jsConfirmClose('entry-form','comment-form'). 295 295 # --BEHAVIOR-- adminPageHeaders -
plugins/simpleMenu/_public.php
r2576 r2605 127 127 // Final rendering 128 128 if ($ret) { 129 $ret = '<ul '.($id ? 'id="'.$id.'"' : '').' class="simple-menu'.($class ? ' '.$class : '').'" >'."\n".$ret."\n".'</ul>';129 $ret = '<ul '.($id ? 'id="'.$id.'"' : '').' class="simple-menu'.($class ? ' '.$class : '').'" role="navigation">'."\n".$ret."\n".'</ul>'; 130 130 } 131 131 } -
plugins/simpleMenu/index.php
r2576 r2588 347 347 echo 348 348 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 349 dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'). 349 350 dcPage::jsLoad('index.php?pf=simpleMenu/simplemenu.js'); 350 351 } -
plugins/tags/_public.php
r2566 r2607 82 82 public static function addTplPath($core) 83 83 { 84 $core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__).'/default-templates'); 84 $tplset = $core->themes->moduleInfo($core->blog->settings->system->theme,'tplset'); 85 if (!empty($tplset) && is_dir(dirname(__FILE__).'/default-templates/'.$tplset)) { 86 $core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__).'/default-templates/'.$tplset); 87 } else { 88 $core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__).'/default-templates/'.DC_DEFAULT_TPLSET); 89 } 85 90 } 86 91 -
plugins/themeEditor/class.themeEditor.php
r2566 r2607 16 16 protected $core; 17 17 18 protected $default_theme;19 18 protected $user_theme; 20 19 protected $parent_theme; 21 22 protected $default_tpl = array(); 20 protected $tplset_theme; 21 23 22 public $tpl = array(); 24 23 public $css = array(); … … 31 30 $this->default_theme = path::real($this->core->blog->themes_path.'/default'); 32 31 $this->user_theme = path::real($this->core->blog->themes_path.'/'.$this->core->blog->settings->system->theme); 32 $this->tplset_theme = DC_ROOT.'/inc/public/default-templates/'.DC_DEFAULT_TPLSET; 33 33 if (null !== $this->core->themes) { 34 34 $parent_theme = $this->core->themes->moduleInfo($this->core->blog->settings->system->theme,'parent'); 35 35 if ($parent_theme) { 36 36 $this->parent_theme = path::real($this->core->blog->themes_path.'/'.$parent_theme); 37 } 38 $tplset = $this->core->themes->moduleInfo($this->core->blog->settings->system->theme,'tplset'); 39 if ($tplset) { 40 $this->tplset_theme = DC_ROOT.'/inc/public/default-templates/'.$tplset; 37 41 } 38 42 } … … 207 211 protected function findTemplates() 208 212 { 209 # First, we look in template paths210 $this->default_tpl = $this->getFilesInDir($this->default_theme.'/tpl');211 212 213 $this->tpl = array_merge( 213 $this-> default_tpl,214 $this->getFilesInDir($this->tplset_theme), 214 215 $this->getFilesInDir($this->parent_theme.'/tpl'), 215 216 $this->getFilesInDir($this->user_theme.'/tpl') 216 217 ); 217 $this->tpl = array_merge($this->getFilesInDir(DC_ROOT.'/inc/public/default-templates'),$this->tpl);218 218 219 219 # Then we look in 'default-templates' plugins directory -
plugins/widgets/_widgets_functions.php
r2565 r2605 29 29 ($w->content_only ? '' : '<div id="search"'.($w->class ? ' class="'.html::escapeHTML($w->class).'"' : '').'>'). 30 30 ($w->title ? '<h2><label for="q">'.html::escapeHTML($w->title).'</label></h2>' : ''). 31 '<form action="'.$core->blog->url.'" method="get" >'.31 '<form action="'.$core->blog->url.'" method="get" role="search">'. 32 32 '<fieldset>'. 33 33 '<p><input type="text" size="10" maxlength="255" id="q" name="q" value="'.$value.'" /> '. … … 50 50 ($w->content_only ? '' : '<div id="topnav"'.($w->class ? ' class="'.html::escapeHTML($w->class).'"' : '').'>'). 51 51 ($w->title ? '<h2>'.html::escapeHTML($w->title).'</h2>' : ''). 52 '<ul >';52 '<ul role="navigation">'; 53 53 54 54 if ($core->url->type != 'default') { -
plugins/widgets/index.php
r2509 r2520 218 218 echo 219 219 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 220 dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'). 220 221 dcPage::jsLoad('index.php?pf=widgets/widgets.js'); 221 222 ?> … … 366 367 $altUp = $i == 0 ? ' alt=""' : ' alt="'.__('Up the widget').'"'; 367 368 $altDown = $i == count($widgets->elements())-1 ? ' alt=""' : ' alt="'.__('Down the widget').'"'; 368 369 369 370 $iname = 'w['.$pr.']['.$i.']'; 370 371 -
themes/default/js/post.js
r2566 r2633 1 1 $(function() { 2 $('#comment-form p:has(input[type=submit][name=preview] )').2 $('#comment-form p:has(input[type=submit][name=preview],button[type=submit][name=preview])'). 3 3 before( 4 4 '<p class="remember"><input type="checkbox" id="c_remember" name="c_remember" /> ' + -
themes/ductile/_config.php
r2566 r2581 273 273 $ductile_counts_base = array( 274 274 'default' => null, 275 'default-page' => null, 275 276 'category' => null, 276 277 'tag' => null, … … 290 291 $ductile_lists = $ductile_lists_base; 291 292 } 293 $ductile_lists = array_merge($ductile_lists_base,$ductile_lists); 292 294 293 295 $ductile_counts = $core->blog->settings->themes->get($core->blog->settings->system->theme.'_entries_counts'); … … 296 298 $ductile_counts = $ductile_counts_base; 297 299 } 300 $ductile_counts = array_merge($ductile_counts_base,$ductile_counts); 298 301 299 302 $ductile_stickers = $core->blog->settings->themes->get($core->blog->settings->system->theme.'_stickers'); -
themes/ductile/_define.php
r2566 r2581 15 15 /* Description*/ "Mediaqueries compliant elegant theme", 16 16 /* Author */ "Dotclear Team", 17 /* Version */ '1. 3.1',17 /* Version */ '1.4', 18 18 /* Properties */ array( 19 19 'standalone_config' => true, -
themes/ductile/_prepend.php
r2566 r2567 26 26 if (!$core->auth->user_prefs->accessibility->nodragdrop) { 27 27 echo 28 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'); 28 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 29 dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'); 29 30 echo <<<EOT 30 31 <script type="text/javascript"> -
themes/ductile/_public.php
r2566 r2581 36 36 global $_ctx; 37 37 38 $nb = 0; 38 $nb_other = $nb_first = 0; 39 39 40 $s = $GLOBALS['core']->blog->settings->themes->get($GLOBALS['core']->blog->settings->system->theme.'_entries_counts'); 40 41 if ($s !== null) { 41 42 $s = @unserialize($s); 42 43 if (is_array($s)) { 43 if (isset($s[$GLOBALS['core']->url->type])) { 44 // Nb de billets par page défini par la config du thème 45 $nb = (integer) $s[$GLOBALS['core']->url->type]; 46 } else { 47 if (($GLOBALS['core']->url->type == 'default-page') && (isset($s['default']))) { 48 // Les pages 2 et suivantes de la home ont le même nombre de billet que la première page 49 $nb = (integer) $s['default']; 50 } 51 } 52 } 53 } 54 55 if ($nb == 0) { 44 switch ($GLOBALS['core']->url->type) { 45 case 'default': 46 case 'default-page': 47 if (isset($s['default'])) { 48 $nb_first = $nb_other = (integer) $s['default']; 49 } 50 if (isset($s['default-page'])) { 51 $nb_other = (integer) $s['default-page']; 52 } 53 break; 54 default: 55 if (isset($s[$GLOBALS['core']->url->type])) { 56 // Nb de billets par page défini par la config du thème 57 $nb_first = $nb_other = (integer) $s[$GLOBALS['core']->url->type]; 58 } 59 break; 60 } 61 } 62 } 63 64 if ($nb_other == 0) { 56 65 if (!empty($attr['nb'])) { 57 66 // Nb de billets par page défini par défaut dans le template 58 $nb = (integer) $attr['nb']; 59 } 60 } 61 62 if ($nb > 0) 63 $_ctx->nb_entry_per_page = $nb; 67 $nb_other = $nb_first = (integer) $attr['nb']; 68 } 69 } 70 71 if ($nb_other > 0) { 72 $_ctx->nb_entry_per_page = $nb_other; 73 } 74 if ($nb_first > 0) { 75 $_ctx->nb_entry_first_page = $nb_first; 76 } 64 77 } 65 78
Note: See TracChangeset
for help on using the changeset viewer.