Dotclear


Ignore:
Files:
89 added
47 deleted
47 edited

Legend:

Unmodified
Added
Removed
  • .hgsubstate

    r2618 r2624  
    1 94b97f44f94e951b8b6392bd76d8c9a3791388e2 inc/libs/clearbricks 
     1d80e4972aaaa26450e5d2f45d55ed8eca0706f9d inc/libs/clearbricks 
  • Makefile

    r2558 r2615  
    4040     ./$(DC)/themes/ 
    4141 
    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') \ 
    6146     ./$(DC)/plugins/ 
    6247 
     
    6853     find $(DC)/admin/js/ie7/*.js -exec ./build-tools/min-js.php \{\} \; 
    6954     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 \{\} \; 
    7155     find $(DC)/admin/js/jsUpload/*.js -exec ./build-tools/min-js.php \{\} \; 
    7256     find $(DC)/plugins -name '*.js' -exec ./build-tools/min-js.php \{\} \; 
     
    134118 
    135119 
     120copy-plugins: clean 
  • admin/_charte.php

    r2501 r2504  
    3131     <script type="text/javascript" src="js/jquery/jquery.js"></script> 
    3232     <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> 
    3334     <script type="text/javascript" src="js/jquery/jquery.pageTabs.js"></script> 
    3435     <script type="text/javascript" src="js/jquery/jquery.biscuit.js"></script> 
  • admin/blog.php

    r2566 r2596  
    2121 
    2222# Create a blog 
    23 if (!isset($_POST['id']) && !empty($_POST['blog_id'])) 
     23if (!isset($_POST['id']) && (isset($_POST['create']))) 
    2424{ 
    2525     $cur = $core->con->openCursor($core->prefix.'blog'); 
     
    8484     '<p class="form-note">'.__('At least 2 characters using letters, numbers or symbols.').'</p> '; 
    8585 
    86      if ($blog_id) { 
    87           echo 
    88           '<p class="form-note warn">'.__('Please note that changing your blog ID may require changes in your public index.php file.').'</p>'; 
    89      } 
    90  
    9186     echo 
    9287     '<p><label class="required" for="blog_name"><abbr title="'.__('Required field').'">*</abbr> '.__('Blog name:').'</label> '. 
     
    9994     form::textarea('blog_desc',60,5,html::escapeHTML($blog_desc)).'</p>'. 
    10095 
    101      '<p><input type="submit" accesskey="s" value="'.__('Create').'" /></p>'. 
     96     '<p><input type="submit" accesskey="s" name="create" value="'.__('Create').'" /></p>'. 
    10297     '</form>'; 
    10398 
  • admin/blog_pref.php

    r2566 r2577  
    166166     $media_img_m_size = abs((integer) $_POST['media_img_m_size']); 
    167167     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; } 
    168171 
    169172     $nb_post_per_page = abs((integer) $_POST['nb_post_per_page']); 
     
    231234          $blog_settings->system->put('note_title_tag',$_POST['note_title_tag']); 
    232235 
     236          $blog_settings->system->put('nb_post_for_home',$nb_post_for_home); 
    233237          $blog_settings->system->put('nb_post_per_page',$nb_post_per_page); 
    234238          $blog_settings->system->put('use_smilies',!empty($_POST['use_smilies'])); 
     
    512516 
    513517     '<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 
    514522     '<p><label for="nb_post_per_page" class="classic">'.sprintf(__('Display %s entries per page'), 
    515523     form::field('nb_post_per_page',2,3,$blog_settings->system->nb_post_per_page)). 
  • admin/categories.php

    r2566 r2567  
    109109     && $rs->count()>1) { 
    110110          $starting_script .= dcPage::jsLoad('js/jquery/jquery-ui.custom.js'); 
     111          $starting_script .= dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'); 
    111112          $starting_script .= dcPage::jsLoad('js/jquery/jquery.mjs.nestedSortable.js'); 
    112113} 
  • admin/category.php

    r2566 r2614  
    176176dcPage::open($title, 
    177177     dcPage::jsConfirmClose('category-form'). 
    178      dcPage::jsToolBar(). 
    179178     dcPage::jsLoad('js/_category.js'), 
     179     $core->callBehavior('adminPostEditor'). 
    180180     dcPage::breadcrumb($elements) 
    181181); 
  • admin/comment.php

    r2566 r2614  
    181181dcPage::open(__('Edit comment'), 
    182182     dcPage::jsConfirmClose('comment-form'). 
    183      dcPage::jsToolBar(). 
    184183     dcPage::jsLoad('js/_comment.js'). 
     184     $core->callBehavior('adminPostEditor'). 
    185185     # --BEHAVIOR-- adminCommentHeaders 
    186186     $core->callBehavior('adminCommentHeaders'), 
  • admin/index.php

    r2566 r2614  
    171171-------------------------------------------------------- */ 
    172172dcPage::open(__('Dashboard'), 
    173      dcPage::jsToolBar(). 
    174173     dcPage::jsLoad('js/_index.js'). 
     174     $core->callBehavior('adminPostEditor'). 
    175175     # --BEHAVIOR-- adminDashboardHeaders 
    176176     $core->callBehavior('adminDashboardHeaders'), 
  • admin/js/_category.js

    r2566 r2614  
    22     dotclear.hideLockable(); 
    33 
    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     } 
    68}); 
  • admin/js/_comment.js

    r2566 r2614  
    11$(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     } 
    66 
    77     $('#comment-form input[name="delete"]').click(function() { 
  • admin/js/_index.js

    r1699 r2614  
    22     var f = $('#quick-entry'); 
    33     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          } 
    68 
    79          $('input[name=save]',f).click(function() { 
     
    2123 
    2224          function quickPost(f,status) { 
    23                if (contentTb.getMode() == 'wysiwyg') { 
     25               if ($.isFunction('jsToolBar') && (contentTb.getMode() == 'wysiwyg')) { 
    2426                    contentTb.syncContents('iframe'); 
    2527               } 
     
    5557                         $('#post_title',f).val(''); 
    5658                         $('#post_content',f).val(''); 
    57                          if (contentTb.getMode() == 'wysiwyg') { 
     59                         if ($.isFunction('jsToolBar') &&  (contentTb.getMode() == 'wysiwyg')) { 
    5860                              contentTb.syncContents('textarea'); 
    5961                         } 
  • admin/js/_post.js

    r2556 r2614  
    5151 
    5252$(function() { 
    53      if (!document.getElementById) { return; } 
    54  
    55      if (document.getElementById('edit-entry')) 
    56      { 
    57           // Get document format and prepare toolbars 
    58           var formatField = $('#post_format').get(0); 
    59           var last_post_format = $(formatField).val(); 
    60           $(formatField).change(function() { 
    61                // Confirm post format change 
    62                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 cancelled 
    68                     $(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  
    8553     // Post preview 
    8654     $('#post-preview').modalWeb($(window).width()-40,$(window).height()-40); 
     
    9967               return window.confirm(dotclear.msg.confirm_delete_post); 
    10068          }); 
    101  
    102           // Markup validator 
    103           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).value 
    120                }; 
    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'); 
    16969 
    17070          // Hide some fields 
     
    218118          }); 
    219119 
    220           // Load toolbars 
    221           contentTb.switchMode(formatField.value); 
    222           excerptTb.switchMode(formatField.value); 
    223  
    224120          // Replace attachment remove links by a POST form submit 
    225121          $('a.attachment-remove').click(function() { 
     
    232128               } 
    233129               return false; 
    234           }); 
    235  
    236           // Check unsaved changes before XHTML conversion 
    237           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                } 
    243130          }); 
    244131     }); 
  • admin/media.php

    r2529 r2629  
    7575 
    7676$page_url = 'media.php?popup='.$popup.'&post_id='.$post_id; 
    77  
     77$temp = $core->callBehavior('adminMediaURL',$page_url); 
     78if ($temp != '') { 
     79     $page_url=$temp; 
     80} 
    7881if ($popup) { 
    7982     $open_f = array('dcPage','openPopup'); 
     
    362365} 
    363366 
     367// Remove hidden directories (unless DC_SHOW_HIDDEN_DIRS is set to true) 
     368if (!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} 
    364377$items = array_values(array_merge($dir['dirs'],$dir['files'])); 
    365378 
     
    565578          } 
    566579     } else { 
    567           $link = 
    568           'media_item.php?id='.$f->media_id.'&amp;popup='.$popup.'&amp;post_id='.$post_id; 
     580          $link = 'media_item.php?id='.$f->media_id.'&amp;popup='.$popup.'&amp;post_id='.$post_id; 
     581          $link = $core->callBehavior('adminMediaURL',$link); 
    569582     } 
    570583 
  • admin/media_item.php

    r2566 r2614  
    209209if ($popup) { 
    210210     $starting_scripts .= 
    211      dcPage::jsLoad('js/jsToolBar/popup_media.js'); 
     211     $core->callBehavior('adminPopupMedia'); 
    212212} 
    213213call_user_func($open_f,__('Media manager'), 
  • admin/popup_link.php

    r2566 r2614  
    1919$title = !empty($_GET['title']) ? $_GET['title'] : ''; 
    2020 
    21 dcPage::openPopup(__('Add a link'),dcPage::jsLoad('js/jsToolBar/popup_link.js')); 
     21dcPage::openPopup(__('Add a link'),$core->callBehavior('adminPopupLink')); 
    2222 
    2323echo '<h2 class="page-title">'.__('Add a link').'</h2>'; 
  • admin/popup_posts.php

    r2566 r2614  
    4848dcPage::openPopup(__('Add a link to an entry'), 
    4949     dcPage::jsLoad('js/_posts_list.js'). 
    50      dcPage::jsLoad('js/jsToolBar/popup_posts.js')); 
     50     $core->callBehavior('adminPopupPosts')); 
    5151 
    5252echo '<h2 class="page-title">'.__('Add a link to an entry').'</h2>'; 
  • admin/post.php

    r2566 r2614  
    375375dcPage::open($page_title.' - '.__('Entries'), 
    376376     dcPage::jsDatePicker(). 
    377      dcPage::jsToolBar(). 
    378377     dcPage::jsModal(). 
    379378     dcPage::jsMetaEditor(). 
    380379     dcPage::jsLoad('js/_post.js'). 
     380     $core->callBehavior('adminPostEditor'). 
    381381     dcPage::jsConfirmClose('entry-form','comment-form'). 
    382382     # --BEHAVIOR-- adminPostHeaders 
  • admin/preferences.php

    r2566 r2567  
    305305     ($user_acc_nodragdrop ? '' : dcPage::jsLoad('js/_preferences-dragdrop.js')). 
    306306     dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 
     307     dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'). 
    307308     dcPage::jsLoad('js/jquery/jquery.pwstrength.js'). 
    308309          '<script type="text/javascript">'."\n". 
  • inc/admin/lib.dc.page.php

    r2513 r2614  
    589589          '<script type="text/javascript">'."\n". 
    590590          "//<![CDATA[\n". 
     591          'jsToolBar = {}, jsToolBar.prototype = { elements : {} };'."\n". 
    591592          self::jsVar('dotclear.nonce',$GLOBALS['core']->getNonce()). 
    592593          self::jsVar('dotclear.img_plus_src','images/expand.png'). 
     
    828829     } 
    829830 
     831      
    830832     public static function jsToolBar() 
    831833     { 
    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. 
    914835     } 
    915836 
  • inc/core/class.dc.blog.php

    r2626 r2628  
    18941894     - post_id: (integer) Get comments belonging to given post_id 
    18951895     - cat_id: (integer or array) Get comments belonging to entries of given category ID 
    1896      - comment_id: (integer) Get comment with given ID 
     1896     - comment_id: (integer or array) Get comment with given ID (or IDs) 
    18971897     - comment_site: (string) Get comments with given comment_site 
    18981898     - comment_status: (integer) Get comments with given comment_status 
     
    19841984 
    19851985          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']); 
    19871992          } 
    19881993 
  • inc/core/class.dc.core.php

    r2566 r2596  
    3939     public $rest;       ///< <b>dcRestServer</b> dcRestServer object 
    4040     public $log;        ///< <b>dcLog</b>             dcLog object 
     41     public $stime;      ///< <b>float</b>             starting time 
    4142 
    4243     private $versions = null; 
     
    5960     public function __construct($driver, $host, $db, $user, $password, $prefix, $persist) 
    6061     { 
     62          if (defined('DC_START_TIME')) { 
     63               $this->stime=DC_START_TIME; 
     64          } else { 
     65               $this->stime = microtime(true); 
     66          } 
     67 
    6168          $this->con = dbLayer::init($driver,$host,$db,$user,$password,$persist); 
    6269 
     
    982989     private function getBlogCursor($cur) 
    983990     { 
    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)) { 
    986994               throw new Exception(__('Blog ID must contain at least 2 characters using letters, numbers or symbols.')); 
    987995          } 
    988996 
    989           if ($cur->blog_name !== null && $cur->blog_name == '') { 
     997          if (($cur->blog_name !== null && $cur->blog_name == '') || 
     998               (!$cur->blog_name)) { 
    990999               throw new Exception(__('No blog name')); 
    9911000          } 
    9921001 
    993           if ($cur->blog_url !== null && $cur->blog_url == '') { 
     1002          if (($cur->blog_url !== null && $cur->blog_url == '') || 
     1003               (!$cur->blog_url)) { 
    9941004               throw new Exception(__('No blog URL')); 
    9951005          } 
     
    13061316                    array('media_img_title_pattern','string','Title ;; Date(%b %Y) ;; separator(, )', 
    13071317                    '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'), 
    13081320                    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'), 
    13101322                    array('nb_post_per_feed','integer',20, 
    13111323                    'Number of entries on feeds'), 
     
    14691481          } 
    14701482     } 
     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     } 
    14711497     //@} 
     1498 
     1499 
     1500 
    14721501} 
  • inc/core/class.dc.namespace.php

    r2566 r2567  
    125125 
    126126     /** 
     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     /** 
    127157     Magic __get method. 
    128158     @copydoc ::get 
  • inc/core/class.dc.themes.php

    r2566 r2607  
    5959          # Themes specifics properties 
    6060          $properties = array_merge( 
    61                array('parent' => null), 
     61               array('parent' => null, 'tplset' => DC_DEFAULT_TPLSET), 
    6262               $properties, 
    6363               array('permissions' => 'admin') // force themes perms 
  • inc/prepend.php

    r2591 r2615  
    1010# 
    1111# -- END LICENSE BLOCK ----------------------------------------- 
     12 
     13/* Start tick  */ 
     14define('DC_START_TIME',microtime(true)); 
    1215 
    1316/* ------------------------------------------------------------------------------------------- */ 
     
    135138# Constants 
    136139define('DC_ROOT',path::real(dirname(__FILE__).'/..')); 
    137 define('DC_VERSION','2.6.2'); 
     140define('DC_VERSION','2.7-dev'); 
    138141define('DC_DIGESTS',dirname(__FILE__).'/digests'); 
    139142define('DC_L10N_ROOT',dirname(__FILE__).'/../locales'); 
    140143define('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'); 
     144define('DC_DISTRIB_PLUGINS','aboutConfig,akismet,antispam,attachments,blogroll,blowupConfig,dclegacy,fairTrackbacks,importExport,maintenance,pages,pings,simpleMenu,tags,themeEditor,userPref,widgets,dcLegacyEditor'); 
    142145define('DC_DISTRIB_THEMES','blueSilence,blowupConfig,customCSS,default,ductile'); 
     146define('DC_DEFAULT_TPLSET','mustek'); 
    143147 
    144148if (!defined('DC_VENDOR_NAME')) { 
  • inc/public/class.dc.template.php

    r2590 r2610  
    235235     } 
    236236 
    237      protected function compileFile($file) 
    238      { 
    239           $fc = file_get_contents($file); 
    240  
    241           $this->compile_stack[] = $file; 
    242  
    243           # Remove every PHP tags 
    244           if ($this->remove_php) 
    245           { 
    246                $fc = preg_replace('/<\?(?=php|=|\s).*?\?>/ms','',$fc); 
    247           } 
    248  
    249           # Transform what could be considered as PHP short tags 
    250           $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 pieces 
    257           # each array entry will be either a tag or plain text 
    258           $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 node 
    271                          $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 tag 
    277                               // Search if it closes a parent tag 
    278                               $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 tag 
    296                          $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 it 
    306                          $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 text 
    313                     $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  
    335237     public function compileBlockNode($tag,$attr,$content) 
    336238     { 
     
    343245          $this->core->callBehavior('templateInsideBlock',$this->core,$this->current_tag,$attr,array(&$content)); 
    344246 
    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); 
    350248 
    351249          # --BEHAVIOR-- templateAfterBlock 
     
    363261          $res = $this->core->callBehavior('templateBeforeValue',$this->core,$this->current_tag,$attr); 
    364262 
    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); 
    370264 
    371265          # --BEHAVIOR-- templateAfterValue 
     
    373267 
    374268          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           } 
    389269     } 
    390270 
     
    11731053 
    11741054          if ($lastn != 0) { 
     1055               // Set limit (aka nb of entries needed) 
    11751056               if ($lastn > 0) { 
     1057                    // nb of entries per page specified in template -> regular pagination 
    11761058                    $p .= "\$params['limit'] = ".$lastn.";\n"; 
    11771059               } 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"; 
    11791062               } 
    1180  
     1063               // Set offset (aka index of first entry) 
    11811064               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"; 
    11831067               } else { 
     1068                    // no pagination, get all posts from 0 to limit 
    11841069                    $p .= "\$params['limit'] = array(0, \$params['limit']);\n"; 
    11851070               } 
  • inc/public/lib.tpl.context.php

    r2566 r2577  
    206206 
    207207          $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); 
    211209 
    212210          return $nb_pages; 
  • inc/public/lib.urlhandlers.php

    r2634 r2635  
    8686               $_ctx->nb_entry_per_page = $core->blog->settings->system->nb_post_per_page; 
    8787          } 
     88          if ($_ctx->nb_entry_first_page === null) { 
     89               $_ctx->nb_entry_first_page = $_ctx->nb_entry_per_page; 
     90          } 
    8891 
    8992          $tpl_file = $core->tpl->getFilePath($tpl); 
     
    188191          else 
    189192          { 
     193               $_ctx =& $GLOBALS['_ctx']; 
    190194               $core =& $GLOBALS['core']; 
    191195 
     
    196200 
    197201               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                    } 
    198205                    self::serveDocument('home.html'); 
    199206                    $core->blog->publishScheduledEntries(); 
     
    416423                         if ($content != '') 
    417424                         { 
    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; 
    420429                              } 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); 
    422436                              } 
    423                               $content = $core->wikiTransform($content); 
    424437                              $content = $core->HTMLfilter($content); 
    425438                         } 
  • inc/public/prepend.php

    r2566 r2567  
    134134     $__theme_tpl_path[] = $core->blog->themes_path.'/'.$__parent_theme.'/tpl'; 
    135135} 
    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'); 
     137if (!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} 
    142147$core->url->mode = $core->blog->settings->system->url_scan; 
    143148 
  • locales/fr/main.po

    r2512 r2577  
    399399 
    400400#, php-format 
     401msgid "Display %s entries on home page" 
     402msgstr "Afficher %s billets sur la page d'accueil" 
     403 
     404#, php-format 
    401405msgid "Display %s entries per page" 
    402406msgstr "Afficher %s billets par page" 
  • plugins/antispam/filters/class.dc.filter.linkslookup.php

    r2566 r2567  
    4848 
    4949               $i = count($domain_elem) - 1; 
     50               if ($i == 0) { 
     51                    // "domain" is 1 word long, don't check it 
     52                    return null; 
     53               } 
    5054               $host = $domain_elem[$i]; 
    5155               do 
  • plugins/antispam/index.php

    r2566 r2567  
    117117     echo 
    118118          dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 
     119          dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'). 
    119120          dcPage::jsLoad('index.php?pf=antispam/antispam.js'); 
    120121  } 
  • plugins/blogroll/index.php

    r2566 r2567  
    177177     echo 
    178178          dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 
     179          dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'). 
    179180          dcPage::jsLoad('index.php?pf=blogroll/blogroll.js'); 
    180181     } 
  • plugins/pages/_public.php

    r2634 r2635  
    117117                         if ($content != '') 
    118118                         { 
    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; 
    121123                              } 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                              } 
    125131                              $content = $core->HTMLfilter($content); 
    126132                         } 
     
    189195                         header('X-Pingback: '.$core->blog->url.$core->url->getURLFor("xmlrpc",$core->blog->id)); 
    190196                    } 
    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                    } 
    192204                    self::serveDocument('page.html'); 
    193205               } 
  • plugins/pages/list.php

    r2566 r2567  
    5555  <title><?php echo __('Pages'); ?></title> 
    5656  <?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'). 
    5860          dcPage::jsLoad('index.php?pf=pages/list.js'). 
    5961          '<script type="text/javascript">'. 
  • plugins/pages/page.php

    r2511 r2614  
    289289  <?php echo 
    290290  dcPage::jsDatePicker(). 
    291   dcPage::jsToolBar(). 
    292291  dcPage::jsModal(). 
    293292  dcPage::jsLoad('js/_post.js'). 
     293  $core->callBehavior('adminPostEditor'). 
    294294  dcPage::jsConfirmClose('entry-form','comment-form'). 
    295295  # --BEHAVIOR-- adminPageHeaders 
  • plugins/simpleMenu/_public.php

    r2576 r2605  
    127127               // Final rendering 
    128128               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>'; 
    130130               } 
    131131          } 
  • plugins/simpleMenu/index.php

    r2576 r2588  
    347347               echo 
    348348                    dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 
     349                    dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'). 
    349350                    dcPage::jsLoad('index.php?pf=simpleMenu/simplemenu.js'); 
    350351          } 
  • plugins/tags/_public.php

    r2566 r2607  
    8282     public static function addTplPath($core) 
    8383     { 
    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          } 
    8590     } 
    8691 
  • plugins/themeEditor/class.themeEditor.php

    r2566 r2607  
    1616     protected $core; 
    1717 
    18      protected $default_theme; 
    1918     protected $user_theme; 
    2019     protected $parent_theme; 
    21  
    22      protected $default_tpl = array(); 
     20     protected $tplset_theme; 
     21 
    2322     public $tpl = array(); 
    2423     public $css = array(); 
     
    3130          $this->default_theme = path::real($this->core->blog->themes_path.'/default'); 
    3231          $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; 
    3333          if (null !== $this->core->themes) { 
    3434               $parent_theme = $this->core->themes->moduleInfo($this->core->blog->settings->system->theme,'parent'); 
    3535               if ($parent_theme) { 
    3636                    $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; 
    3741               } 
    3842          } 
     
    207211     protected function findTemplates() 
    208212     { 
    209           # First, we look in template paths 
    210           $this->default_tpl = $this->getFilesInDir($this->default_theme.'/tpl'); 
    211  
    212213          $this->tpl = array_merge( 
    213                $this->default_tpl, 
     214               $this->getFilesInDir($this->tplset_theme), 
    214215               $this->getFilesInDir($this->parent_theme.'/tpl'), 
    215216               $this->getFilesInDir($this->user_theme.'/tpl') 
    216217               ); 
    217           $this->tpl = array_merge($this->getFilesInDir(DC_ROOT.'/inc/public/default-templates'),$this->tpl); 
    218218 
    219219          # Then we look in 'default-templates' plugins directory 
  • plugins/widgets/_widgets_functions.php

    r2565 r2605  
    2929          ($w->content_only ? '' : '<div id="search"'.($w->class ? ' class="'.html::escapeHTML($w->class).'"' : '').'>'). 
    3030          ($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">'. 
    3232          '<fieldset>'. 
    3333          '<p><input type="text" size="10" maxlength="255" id="q" name="q" value="'.$value.'" /> '. 
     
    5050          ($w->content_only ? '' : '<div id="topnav"'.($w->class ? ' class="'.html::escapeHTML($w->class).'"' : '').'>'). 
    5151          ($w->title ? '<h2>'.html::escapeHTML($w->title).'</h2>' : ''). 
    52           '<ul>'; 
     52          '<ul role="navigation">'; 
    5353 
    5454          if ($core->url->type != 'default') { 
  • plugins/widgets/index.php

    r2509 r2520  
    218218          echo 
    219219               dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 
     220               dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'). 
    220221               dcPage::jsLoad('index.php?pf=widgets/widgets.js'); 
    221222  ?> 
     
    366367          $altUp = $i == 0 ? ' alt=""' : ' alt="'.__('Up the widget').'"'; 
    367368          $altDown = $i == count($widgets->elements())-1 ? ' alt=""' : ' alt="'.__('Down the widget').'"'; 
    368  
     369           
    369370          $iname = 'w['.$pr.']['.$i.']'; 
    370371 
  • themes/default/js/post.js

    r2566 r2633  
    11$(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])'). 
    33          before( 
    44               '<p class="remember"><input type="checkbox" id="c_remember" name="c_remember" /> ' + 
  • themes/ductile/_config.php

    r2566 r2581  
    273273$ductile_counts_base = array( 
    274274     'default' => null, 
     275     'default-page' => null, 
    275276     'category' => null, 
    276277     'tag' => null, 
     
    290291     $ductile_lists = $ductile_lists_base; 
    291292} 
     293$ductile_lists = array_merge($ductile_lists_base,$ductile_lists); 
    292294 
    293295$ductile_counts = $core->blog->settings->themes->get($core->blog->settings->system->theme.'_entries_counts'); 
     
    296298     $ductile_counts = $ductile_counts_base; 
    297299} 
     300$ductile_counts = array_merge($ductile_counts_base,$ductile_counts); 
    298301 
    299302$ductile_stickers = $core->blog->settings->themes->get($core->blog->settings->system->theme.'_stickers'); 
  • themes/ductile/_define.php

    r2566 r2581  
    1515     /* Description*/         "Mediaqueries compliant elegant theme", 
    1616     /* Author */             "Dotclear Team", 
    17      /* Version */            '1.3.1', 
     17     /* Version */            '1.4', 
    1818     /* Properties */         array( 
    1919                                        'standalone_config' => true, 
  • themes/ductile/_prepend.php

    r2566 r2567  
    2626          if (!$core->auth->user_prefs->accessibility->nodragdrop) { 
    2727               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'); 
    2930                    echo <<<EOT 
    3031<script type="text/javascript"> 
  • themes/ductile/_public.php

    r2566 r2581  
    3636          global $_ctx; 
    3737 
    38           $nb = 0; 
     38          $nb_other = $nb_first = 0; 
     39 
    3940          $s = $GLOBALS['core']->blog->settings->themes->get($GLOBALS['core']->blog->settings->system->theme.'_entries_counts'); 
    4041          if ($s !== null) { 
    4142               $s = @unserialize($s); 
    4243               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) { 
    5665               if (!empty($attr['nb'])) { 
    5766                    // 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          } 
    6477     } 
    6578 
Note: See TracChangeset for help on using the changeset viewer.

Sites map