Dotclear


Ignore:
Files:
3 added
24 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    r1216 r1350  
     1Dotclear 2.5.2 - 2013-08-14 
     2=========================================================== 
     3* Security fix: Fixed potential XSS 
     4* Bugfix: l10n Clearbricks library 
     5* <tpl:LoopPosition> now works <tpl:Attachments> 
     6* Dotclear update check may now be forced (ignoring cache) 
     7* Enforce integration of daInstaller plugin 
     8* Tags link button is now available on page editor 
     9* Default cache age is now 1 week instead of 2 hours 
     10* Quick entry dashboard module is not activated by default on new installation 
     11* New template {{tpl:BlogParentThemeURL}} (return URL of parent theme of blog's theme if any, URL of blog's theme otherwise) 
     12* Fix post comments number on comments deletion 
     13* Fix order of backup files 
     14* Minor enhancements 
     15* Various bug fixes 
     16* Various cosmetic adjustments 
     17 
    118Dotclear 2.5.1 - 2013-07-20 
    219=========================================================== 
  • Makefile

    r1046 r1451  
    6969     find $(DC)/admin/js/jquery/*.js -exec ./build-tools/min-js.php \{\} \; 
    7070     find $(DC)/admin/js/jsToolBar/*.js -exec ./build-tools/min-js.php \{\} \; 
     71     find $(DC)/admin/js/jsUpload/*.js -exec ./build-tools/min-js.php \{\} \; 
    7172     find $(DC)/admin/js/tool-man/*.js -exec ./build-tools/min-js.php \{\} \; 
    7273     find $(DC)/plugins -name '*.js' -exec ./build-tools/min-js.php \{\} \; 
  • admin/categories.php

    r1399 r1468  
    3131          $mov_cat = $mov_cat ? $mov_cat : null; 
    3232          if ($mov_cat !== null) { 
    33                $c = $core->blog->getCategory((integer) $_POST['del_cat']); 
     33               $c = $core->blog->getCategory((integer) $_POST['mov_cat']); 
    3434               if ($c->isEmpty()) { 
    3535                    throw new Exception(__('This category does not exist.')); 
     
    144144echo '</div>'; 
    145145 
     146$categories_combo = array(); 
     147if (!$rs->isEmpty()) 
     148{ 
     149     while ($rs->fetch()) { 
     150          $catparents_combo[] = $categories_combo[] = new formSelectOption( 
     151               str_repeat('&nbsp;&nbsp;',$rs->level-1).($rs->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($rs->cat_title), 
     152               $rs->cat_id 
     153          ); 
     154     } 
     155} 
     156 
    146157echo '<div class="col">'. 
    147158 
     
    149160'<h3>'.__('Add a new category').'</h3>'. 
    150161'<p><label class="required" for="cat_title"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').'</label> '. 
    151 form::field('cat_title',30,255).'</p>'. 
     162form::field('cat_title',30,255,'','maximal').'</p>'. 
    152163'<p><label for="new_cat_parent">'.__('Parent:').'</label> '. 
    153 '<select id="new_cat_parent" name="new_cat_parent">'. 
    154 '<option value="0">'.__('Top level').'</option>'; 
    155 while ($rs->fetch()) { 
    156      echo '<option value="'.$rs->cat_id.'">'. 
    157           str_repeat('&nbsp;&nbsp;',$rs->level-1).($rs->level-1 == 0 ? '' : '&bull; '). 
    158           html::escapeHTML($rs->cat_title).'</option>'; 
    159 } 
    160 echo 
    161 '</select></p>'. 
     164form::combo('new_cat_parent',array_merge(array(__('(No cat)') => 0),$categories_combo),'','maximal'). 
     165'</p>'. 
    162166'<p><input type="submit" value="'.__('Create').'" />'. 
    163167$core->formNonce().'</p>'. 
     168 
    164169'</form>'; 
    165170 
    166171if (!$rs->isEmpty()) 
    167172{ 
    168      $cats = array(); 
    169      $dest = array('&nbsp;' => ''); 
    170      $l = $rs->level; 
    171      $full_name = array($rs->cat_title); 
    172      while ($rs->fetch()) 
    173      { 
    174           if ($rs->level < $l) { 
    175                $full_name = array(); 
    176           } elseif ($rs->level == $l) { 
    177                array_pop($full_name); 
    178           } 
    179           $full_name[] = html::escapeHTML($rs->cat_title); 
    180            
    181           $cats[implode(' / ',$full_name)] = $rs->cat_id; 
    182           $dest[implode(' / ',$full_name)] = $rs->cat_id; 
    183            
    184           $l = $rs->level; 
    185      } 
    186       
    187173     echo 
    188      '<form action="categories.php" method="post" id="delete-category" class="border-top">'. 
     174     '<form action="categories.php" method="post" id="delete-category">'. 
    189175     '<h3>'.__('Remove a category').'</h3>'. 
    190176     '<p><label for="del_cat">'.__('Choose a category to remove:').'</label> '. 
    191      form::combo('del_cat',$cats).'</p> '. 
     177     form::combo('del_cat',$categories_combo,'','maximal').'</p> '. 
    192178     '<p><label for="mov_cat">'.__('And choose the category which will receive its entries:').'</label> '. 
    193      form::combo('mov_cat',$dest).'</p> '. 
     179     form::combo('mov_cat',array_merge(array(__('(No cat)') => ''),$categories_combo),'','maximal').'</p> '. 
    194180     '<p><input type="submit" value="'.__('Delete').'" class="delete" />'. 
    195181     $core->formNonce().'</p>'. 
     182 
    196183     '</form>'; 
    197184      
  • admin/index.php

    r1422 r1468  
    5959if (!$core->auth->user_prefs->dashboard->prefExists('quickentry')) { 
    6060     if (!$core->auth->user_prefs->dashboard->prefExists('quickentry',true)) { 
    61           $core->auth->user_prefs->dashboard->put('quickentry',true,'boolean','',null,true); 
    62      } 
    63      $core->auth->user_prefs->dashboard->put('quickentry',true,'boolean'); 
     61          $core->auth->user_prefs->dashboard->put('quickentry',false,'boolean','',null,true); 
     62     } 
     63     $core->auth->user_prefs->dashboard->put('quickentry',false,'boolean'); 
    6464} 
    6565 
     
    309309     if ($core->auth->check('usage,contentadmin',$core->blog->id)) 
    310310     { 
    311           $categories_combo = array('&nbsp;' => ''); 
     311          # Getting categories 
     312          $categories_combo = array(__('(No cat)') => ''); 
    312313          try { 
    313314               $categories = $core->blog->getCategories(array('post_type'=>'post')); 
    314                while ($categories->fetch()) { 
    315                     $categories_combo[] = new formSelectOption( 
    316                          str_repeat('&nbsp;&nbsp;',$categories->level-1). 
    317                          ($categories->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($categories->cat_title), 
    318                          $categories->cat_id 
    319                     ); 
     315               if (!$categories->isEmpty()) { 
     316                    while ($categories->fetch()) { 
     317                         $catparents_combo[] = $categories_combo[] = new formSelectOption( 
     318                              str_repeat('&nbsp;&nbsp;',$categories->level-1).($categories->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($categories->cat_title), 
     319                              $categories->cat_id 
     320                         ); 
     321                    } 
    320322               } 
    321323          } catch (Exception $e) { } 
     
    333335          form::textarea('post_content',50,7). 
    334336          '</p>'. 
    335           '<p><label for="cat_id" class="classic">'.__('Category:').'</label> '. 
    336           form::combo('cat_id',$categories_combo).'</p>'. 
     337          '<p><label for="cat_id" class="classic">'.__('Category:').' '. 
     338          form::combo('cat_id',$categories_combo).'</label></p>'. 
     339          ($core->auth->check('categories', $core->blog->id) 
     340               ? '<div>'. 
     341               '<p id="new_cat">'.__('Add a new category').'</p>'. 
     342               '<p><label for="new_cat_title">'.__('Title:').' '. 
     343               form::field('new_cat_title',30,255,'','maximal').'</label></p>'. 
     344               '<p><label for="new_cat_parent">'.__('Parent:').' '. 
     345               form::combo('new_cat_parent',$categories_combo,'','maximal'). 
     346               '</label></p>'. 
     347               '</div>' 
     348               : ''). 
    337349          '<p><input type="submit" value="'.__('Save').'" name="save" /> '. 
    338350          ($core->auth->check('publish',$core->blog->id) 
  • admin/js/_index.js

    r1140 r1418  
    6161               }); 
    6262          } 
     63          $('#new_cat').toggleWithLegend( 
     64               $('#new_cat').parent().children().not('#new_cat'), 
     65               {} // no cookie on new category as we don't use this every day 
     66          ); 
    6367     } 
    6468 
  • admin/js/_post.js

    r1392 r1468  
    115115               hide: $('#post_notes').val() == '' 
    116116          }); 
     117          $('#new_cat').toggleWithLegend( 
     118               $('#new_cat').parent().children().not('#new_cat'), 
     119               {} // no cookie on new category as we don't use this every day 
     120          ); 
    117121          $('#post_lang').parent().toggleWithLegend($('#post_lang'),{ 
    118122               cookie: 'dcx_post_lang' 
  • admin/js/_posts_actions.js

    r1035 r1419  
    66          matchContains: true 
    77     }); 
     8     $('#new_cat').toggleWithLegend( 
     9          $('#new_cat').parent().children().not('#new_cat'), 
     10          {} // no cookie on new category as we don't use this every day 
     11     ); 
    812}); 
  • admin/js/_users_actions.js

    r935 r1449  
    11jQuery.fn.updatePermissionsForm = function() { 
    22     return this.each(function() { 
     3           
    34          var perms = {}; 
    45          var re = /^perm\[(.+?)\]\[(.+?)\]$/; 
     
    1213                    continue; 
    1314               } 
     15               var prop; 
    1416               prop = e.name.match(re); 
    1517               if (!prop) { 
     
    2022               } 
    2123               perms[prop[1]][prop[2]] = e; 
     24                
     25               // select related permissions for admin 
     26               if (prop[2] == 'admin') { 
     27                    if (e.checked) { 
     28                         admin(e,perms,re); 
     29                    } 
     30                    $(e).click(function(){ 
     31                         admin(this,perms,re); 
     32                    }); 
     33               // select related permissions for content admin 
     34               } else if (prop[2] == 'contentadmin') { 
     35                    if (e.checked) { 
     36                         contentadmin(e,perms,re); 
     37                    } 
     38                    $(e).click(function(){ 
     39                         contentadmin(this,perms,re); 
     40                    }); 
     41               // select related permissions for media admin 
     42               } else if (prop[2] == 'media_admin') { 
     43                    if (e.checked) { 
     44                         mediaadmin(e,perms,re); 
     45                    } 
     46                    $(e).click(function(){ 
     47                         mediaadmin(this,perms,re); 
     48                    }); 
     49               } 
    2250          } 
    2351           
    24           // Update elements status 
    25           var E; 
    26           for (blog in perms) { 
    27                for (perm in perms[blog]) { 
    28                     E = perms[blog][perm]; 
    29                     E.onclick = function() {}; 
    30                      
    31                     if (perm == 'admin' && !E.disabled) { 
    32                          perms[blog]['usage'].disabled = E.checked; 
    33                          perms[blog]['publish'].disabled = E.checked; 
    34                          perms[blog]['delete'].disabled = E.checked; 
    35                          perms[blog]['contentadmin'].disabled = E.checked; 
    36                          perms[blog]['categories'].disabled = E.checked; 
    37                          perms[blog]['media'].disabled = E.checked; 
    38                          perms[blog]['media_admin'].disabled = E.checked; 
    39                          E.onclick = function() { $(this.form).updatePermissionsForm(); }; 
    40                     } else if (perm == 'contentadmin' && !E.disabled) { 
    41                          perms[blog]['usage'].checked = E.checked; 
    42                          perms[blog]['publish'].checked = E.checked; 
    43                          perms[blog]['delete'].checked = E.checked; 
    44                          perms[blog]['usage'].disabled = E.checked; 
    45                          perms[blog]['publish'].disabled = E.checked; 
    46                          perms[blog]['delete'].disabled = E.checked; 
    47                          E.onclick = function() { $(this.form).updatePermissionsForm(); }; 
    48                     } else if (perm == 'media_admin' && !E.disabled) { 
    49                          perms[blog]['media'].checked = E.checked; 
    50                          perms[blog]['media'].disabled = E.checked; 
    51                          E.onclick = function() { $(this.form).updatePermissionsForm(); }; 
    52                     } 
    53                } 
     52          function admin(E,perms,re) { 
     53                         P = E.name.match(re); 
     54                          
     55                         perms[P[1]]['usage'].checked = E.checked; 
     56                         perms[P[1]]['publish'].checked = E.checked; 
     57                         perms[P[1]]['delete'].checked = E.checked; 
     58                         perms[P[1]]['contentadmin'].checked = E.checked; 
     59                         perms[P[1]]['categories'].checked = E.checked; 
     60                         perms[P[1]]['media'].checked = E.checked; 
     61                         perms[P[1]]['media_admin'].checked = E.checked; 
     62                         perms[P[1]]['usage'].disabled = E.checked; 
     63                         perms[P[1]]['publish'].disabled = E.checked; 
     64                         perms[P[1]]['delete'].disabled = E.checked; 
     65                         perms[P[1]]['contentadmin'].disabled = E.checked; 
     66                         perms[P[1]]['categories'].disabled = E.checked; 
     67                         perms[P[1]]['media'].disabled = E.checked; 
     68                         perms[P[1]]['media_admin'].disabled = E.checked; 
    5469          } 
     70           
     71          function contentadmin(E,perms,re) { 
     72                         P = E.name.match(re); 
     73                          
     74                         perms[P[1]]['usage'].checked = E.checked; 
     75                         perms[P[1]]['publish'].checked = E.checked; 
     76                         perms[P[1]]['delete'].checked = E.checked; 
     77                         perms[P[1]]['usage'].disabled = E.checked; 
     78                         perms[P[1]]['publish'].disabled = E.checked; 
     79                         perms[P[1]]['delete'].disabled = E.checked; 
     80          } 
     81           
     82          function mediaadmin(E,perms,re) { 
     83                         P = E.name.match(re); 
     84                          
     85                         perms[P[1]]['media'].checked = E.checked; 
     86                         perms[P[1]]['media'].disabled = E.checked; 
     87          } 
     88           
     89           
    5590     }); 
    5691}; 
  • admin/post.php

    r1460 r1468  
    218218if (!empty($_POST) && !empty($_POST['save']) && $can_edit_post && !$bad_dt) 
    219219{ 
     220     # Create category 
     221     if (!empty($_POST['new_cat_title']) && $core->auth->check('categories', $core->blog->id)) { 
     222      
     223          $cur_cat = $core->con->openCursor($core->prefix.'category'); 
     224          $cur_cat->cat_title = $_POST['new_cat_title']; 
     225          $cur_cat->cat_url = ''; 
     226           
     227          $parent_cat = !empty($_POST['new_cat_parent']) ? $_POST['new_cat_parent'] : ''; 
     228           
     229          # --BEHAVIOR-- adminBeforeCategoryCreate 
     230          $core->callBehavior('adminBeforeCategoryCreate', $cur_cat); 
     231           
     232          $cat_id = $core->blog->addCategory($cur_cat, (integer) $parent_cat); 
     233           
     234          # --BEHAVIOR-- adminAfterCategoryCreate 
     235          $core->callBehavior('adminAfterCategoryCreate', $cur_cat, $cat_id); 
     236     } 
     237      
    220238     $cur = $core->con->openCursor($core->prefix.'post'); 
    221239      
     
    283301     } 
    284302} 
     303 
     304# Getting categories 
     305$categories_combo = array(__('(No cat)') => ''); 
     306try { 
     307     $categories = $core->blog->getCategories(array('post_type'=>'post')); 
     308     if (!$categories->isEmpty()) { 
     309          while ($categories->fetch()) { 
     310               $catparents_combo[] = $categories_combo[] = new formSelectOption( 
     311                    str_repeat('&nbsp;&nbsp;',$categories->level-1).($categories->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($categories->cat_title), 
     312                    $categories->cat_id 
     313               ); 
     314          } 
     315     } 
     316} catch (Exception $e) { } 
    285317 
    286318/* DISPLAY 
     
    423455                         '<p><label for="cat_id" class="ib">'.__('Category').'</label>'. 
    424456                         form::combo('cat_id',$categories_combo,$cat_id,'maximal'). 
    425                          '</p>')), 
     457                         '</p>'. 
     458                         ($core->auth->check('categories', $core->blog->id) ? 
     459                              '<div>'. 
     460                              '<p id="new_cat">'.__('Add a new category').'</p>'. 
     461                              '<p><label for="new_cat_title">'.__('Title:').' '. 
     462                              form::field('new_cat_title',30,255,'','maximal').'</label></p>'. 
     463                              '<p><label for="new_cat_parent">'.__('Parent:').' '. 
     464                              form::combo('new_cat_parent',$categories_combo,'','maximal'). 
     465                              '</label></p>'. 
     466                              '</div>' 
     467                         : ''))), 
    426468          'options-box' => array( 
    427469               'title' => __('Options'), 
  • admin/posts_actions.php

    r1399 r1468  
    1616 
    1717$params = array(); 
     18$action = ''; 
    1819 
    1920/* Actions 
     
    126127     elseif ($action == 'category' && isset($_POST['new_cat_id'])) 
    127128     { 
    128           try 
    129           { 
    130                $core->blog->updPostsCategory($posts_ids,$_POST['new_cat_id']); 
     129          $new_cat_id = $_POST['new_cat_id']; 
     130           
     131          try 
     132          { 
     133               if (!empty($_POST['new_cat_title']) && $core->auth->check('categories', $core->blog->id)) 
     134               { 
     135                    $cur_cat = $core->con->openCursor($core->prefix.'category'); 
     136                    $cur_cat->cat_title = $_POST['new_cat_title']; 
     137                    $cur_cat->cat_url = ''; 
     138                     
     139                    $parent_cat = !empty($_POST['new_cat_parent']) ? $_POST['new_cat_parent'] : ''; 
     140                     
     141                    # --BEHAVIOR-- adminBeforeCategoryCreate 
     142                    $core->callBehavior('adminBeforeCategoryCreate', $cur_cat); 
     143                     
     144                    $new_cat_id = $core->blog->addCategory($cur_cat, (integer) $parent_cat); 
     145                     
     146                    # --BEHAVIOR-- adminAfterCategoryCreate 
     147                    $core->callBehavior('adminAfterCategoryCreate', $cur_cat, $new_cat_id); 
     148               } 
     149                
     150               $core->blog->updPostsCategory($posts_ids, $new_cat_id); 
    131151                
    132152               http::redirect($redir); 
     
    246266     echo '<h2 class="page-title">'.__('Change category for entries').'</h2>'; 
    247267      
    248      # categories list 
    249268     # Getting categories 
    250      $categories_combo = array('&nbsp;' => ''); 
     269     $categories_combo = array(__('(No cat)') => ''); 
    251270     try { 
    252271          $categories = $core->blog->getCategories(array('post_type'=>'post')); 
    253           while ($categories->fetch()) { 
    254                $categories_combo[] = new formSelectOption( 
    255                     str_repeat('&nbsp;&nbsp;',$categories->level-1). 
    256                     ($categories->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($categories->cat_title), 
    257                     $categories->cat_id 
    258                ); 
     272          if (!$categories->isEmpty()) { 
     273               while ($categories->fetch()) { 
     274                    $catparents_combo[] = $categories_combo[] = new formSelectOption( 
     275                         str_repeat('&nbsp;&nbsp;',$categories->level-1).($categories->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($categories->cat_title), 
     276                         $categories->cat_id 
     277                    ); 
     278               } 
    259279          } 
    260280     } catch (Exception $e) { } 
     
    264284     '<p><label for="new_cat_id" class="classic">'.__('Category:').'</label> '. 
    265285     form::combo('new_cat_id',$categories_combo,''); 
     286      
     287     if ($core->auth->check('categories', $core->blog->id)) { 
     288          echo  
     289          '<div>'. 
     290          '<p id="new_cat">'.__('Add a new category').'</p>'. 
     291          '<p><label for="new_cat_title">'.__('Title:').' '. 
     292          form::field('new_cat_title',30,255,'','maximal').'</label></p>'. 
     293          '<p><label for="new_cat_parent">'.__('Parent:').' '. 
     294          form::combo('new_cat_parent',$categories_combo,'','maximal'). 
     295          '</label></p>'. 
     296          '</div>'; 
     297     } 
    266298      
    267299     echo 
  • admin/preferences.php

    r1399 r1468  
    344344     ($user_acc_nodragdrop ? '' : dcPage::jsLoad('js/_preferences-dragdrop.js')). 
    345345     dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 
     346     dcPage::jsLoad('js/jquery/jquery.pwstrength.js'). 
     347          '<script type="text/javascript">'."\n". 
     348          "//<![CDATA[\n". 
     349          "\$(function() {\n". 
     350          "    \$('#new_pwd').pwstrength({texts: ['". 
     351                    sprintf(__('Password strength: %s'),__('very weak'))."', '". 
     352                    sprintf(__('Password strength: %s'),__('weak'))."', '". 
     353                    sprintf(__('Password strength: %s'),__('mediocre'))."', '". 
     354                    sprintf(__('Password strength: %s'),__('strong'))."', '". 
     355                    sprintf(__('Password strength: %s'),__('very strong'))."']});\n". 
     356          "});\n". 
     357          "\n//]]>\n". 
     358          "</script>\n". 
    346359     dcPage::jsPageTabs($default_tab). 
    347360     dcPage::jsConfirmClose('user-form'). 
     
    420433     '<legend>'.__('Change your password').'</legend>'. 
    421434      
    422      '<p><label for="new_pwd">'.__('New password:').'</label>'. 
    423      form::password('new_pwd',20,255).'</p>'. 
     435     '<div class="pw-table">'. 
     436     '<p class="pw-cell"><label for="new_pwd">'.__('New password:').'</label>'. 
     437     form::password('new_pwd',20,255,'','','',false,' data-indicator="pwindicator" ').'</p>'. 
     438     '<div id="pwindicator">'. 
     439     '    <div class="bar"></div>'. 
     440     '    <p class="label no-margin"></p>'. 
     441     '</div>'. 
     442     '</div>'. 
    424443      
    425444     '<p><label for="new_pwd_c">'.__('Confirm password:').'</label>'. 
  • admin/style/default.css

    r1465 r1468  
    541541} 
    542542 
     543#upg-notify { 
     544} 
     545#upg-notify ul { 
     546     padding-left: 15px; 
     547} 
     548#upg-notify li { 
     549     color: #fff; 
     550} 
    543551/* ------------------------------------------------------------------ post */ 
    544552#entry-wrapper { 
     
    16171625} 
    16181626 
     1627/* --------------------------------------------------------------- password indcator */ 
     1628.pw-table { 
     1629     display: table; 
     1630     margin-bottom: 1em; 
     1631} 
     1632.pw-cell { 
     1633     display: table-cell; 
     1634     margin-bottom: 1em; 
     1635} 
     1636#pwindicator { 
     1637     display: table-cell; 
     1638     vertical-align: bottom; 
     1639     padding-left: 1.5em; 
     1640     height: 3.8em; 
     1641} 
     1642#pwindicator .bar { 
     1643     height: 6px; 
     1644     margin-bottom: 4px; 
     1645} 
     1646.pw-very-weak .bar { 
     1647     background: #900; 
     1648     width: 30px; 
     1649} 
     1650.pw-weak .bar { 
     1651     background: #c00; 
     1652     width: 60px; 
     1653} 
     1654.pw-mediocre .bar { 
     1655     background: #f60; 
     1656     width: 90px; 
     1657} 
     1658.pw-strong .bar { 
     1659     background: #060; 
     1660     width: 120px; 
     1661} 
     1662.pw-very-strong .bar { 
     1663     background: #0c0; 
     1664     width: 150px; 
     1665} 
     1666 
    16191667/* --------------------------------------------------------------------------- 
    16201668     Media queries vite fait en attendant la reprise complète du layout 
  • admin/update.php

    r1358 r1468  
    2727 
    2828$updater = new dcUpdate(DC_UPDATE_URL,'dotclear',DC_UPDATE_VERSION,DC_TPL_CACHE.'/versions'); 
    29 $new_v = $updater->check(DC_VERSION); 
     29$new_v = $updater->check(DC_VERSION, !empty($_GET['nocache'])); 
    3030$zip_file = $new_v ? DC_BACKUP_PATH.'/'.basename($updater->getFileURL()) : ''; 
    3131$version_info = $new_v ? $updater->getInfoURL() : ''; 
     
    168168-------------------------------------------------------- */ 
    169169dcPage::open(__('Dotclear update'), 
    170      (!$step ? dcPage::jsPageTabs($default_tab) : ''), 
     170     (!$step ?  
     171          dcPage::jsPageTabs($default_tab). 
     172          dcPage::jsLoad('js/_update.js') 
     173          : ''), 
    171174     dcPage::breadcrumb( 
    172175          array( 
     
    176179); 
    177180 
     181if (!$core->error->flag()) { 
     182     echo '<h2>'.__('Dotclear update').'</h2>'; 
     183      
     184     if (!empty($_GET['nocache'])) { 
     185          dcPage::message(__('Manual checking of update done successfully.')); 
     186     } 
     187} 
     188 
    178189if (!$step) 
    179190{ 
     
    181192     if (empty($new_v)) 
    182193     { 
    183           echo '<p><strong>'.__('No newer Dotclear version available.').'</strong></p>'; 
     194          echo '<p><strong>'.__('No newer Dotclear version available.').'</strong></p>'. 
     195          '<form action="'.$p_url.'" method="get">'. 
     196          '<p><input type="hidden" name="nocache" value="1" />'. 
     197          '<input type="submit" value="'.__('Force checking update Dotclear').'" /></p>'. 
     198          '</form>'; 
    184199     } 
    185200     else 
  • inc/admin/lib.dc.page.php

    r1461 r1468  
    164164          if ($core->error->flag()) { 
    165165               echo 
    166                '<div class="error"><p><strong>'.(count($core->error->getErrors()) > 1 ? __('Errors:') : __('Error:')).'</p></strong>'. 
     166               '<div class="error"><p><strong>'.(count($core->error->getErrors()) > 1 ? __('Errors:') : __('Error:')).'</strong></p>'. 
    167167               $core->error->toHTML(). 
    168168               '</div>'; 
     
    508508          self::jsVar('dotclear.msg.confirm_delete_theme', 
    509509               __('Are you sure you want to delete "%s" theme?')). 
     510          self::jsVar('dotclear.msg.confirm_delete_backup', 
     511               __('Are you sure you want to delete this backup?')). 
    510512          self::jsVar('dotclear.msg.zip_file_content', 
    511513               __('Zip file content')). 
  • inc/admin/lib.pager.php

    r1415 r1468  
    8787               html::escapeHTML($this->rs->cat_title)); 
    8888          } else { 
    89                $cat_title = __('None'); 
     89               $cat_title = __('(No cat)'); 
    9090          } 
    9191           
  • inc/core/class.dc.blog.php

    r1353 r1468  
    634634     private function checkCategory($title,$url,$id=null) 
    635635     { 
    636           $strReq = 'SELECT cat_id '. 
    637                     'FROM '.$this->prefix.'category '. 
    638                     "WHERE cat_url = '".$this->con->escape($url)."' ". 
    639                     "AND blog_id = '".$this->con->escape($this->id)."' "; 
    640            
    641           if ($id !== null) { 
    642                $strReq .= 'AND cat_id <> '.(integer) $id.' '; 
    643           } 
     636          # Let's check if URL is taken... 
     637          $strReq =  
     638               'SELECT cat_url FROM '.$this->prefix.'category '. 
     639               "WHERE cat_url = '".$this->con->escape($url)."' ". 
     640               ($id ? 'AND cat_id <> '.(integer) $id. ' ' : ''). 
     641               "AND blog_id = '".$this->con->escape($this->id)."' ". 
     642               'ORDER BY cat_url DESC'; 
    644643           
    645644          $rs = $this->con->select($strReq); 
    646645           
    647           if (!$rs->isEmpty()) { 
    648                throw new Exception(__('Category URL must be unique.')); 
    649           } 
     646          if (!$rs->isEmpty()) 
     647          { 
     648               if ($this->con->driver() == 'mysql') { 
     649                    $clause = "REGEXP '^".$this->con->escape($url)."[0-9]+$'"; 
     650               } elseif ($this->con->driver() == 'pgsql') { 
     651                    $clause = "~ '^".$this->con->escape($url)."[0-9]+$'"; 
     652               } else { 
     653                    $clause = "LIKE '".$this->con->escape($url)."%'"; 
     654               } 
     655               $strReq =  
     656                    'SELECT cat_url FROM '.$this->prefix.'category '. 
     657                    "WHERE cat_url ".$clause.' '. 
     658                    ($id ? 'AND cat_id <> '.(integer) $id. ' ' : ''). 
     659                    "AND blog_id = '".$this->con->escape($this->id)."' ". 
     660                    'ORDER BY cat_url DESC '; 
     661                
     662               $rs = $this->con->select($strReq); 
     663               $a = array(); 
     664               while ($rs->fetch()) { 
     665                    $a[] = $rs->cat_url; 
     666               } 
     667                
     668               natsort($a); 
     669               $t_url = end($a); 
     670                
     671               if (preg_match('/(.*?)([0-9]+)$/',$t_url,$m)) { 
     672                    $i = (integer) $m[2]; 
     673                    $url = $m[1]; 
     674               } else { 
     675                    $i = 1; 
     676               } 
     677                
     678               return $url.($i+1); 
     679          } 
     680           
     681          # URL is empty? 
     682          if ($url == '') { 
     683               throw new Exception(__('Empty category URL')); 
     684          } 
     685           
     686          return $url; 
    650687     } 
    651688      
     
    669706           
    670707          # Check if title or url are unique 
    671           $this->checkCategory($cur->cat_title,$cur->cat_url,$id); 
     708          $cur->cat_url = $this->checkCategory($cur->cat_title,$cur->cat_url,$id); 
    672709           
    673710          if ($cur->cat_desc !== null) { 
  • inc/core/class.dc.media.php

    r1280 r1468  
    3030      
    3131     public $thumb_tp = '%s/.%s_%s.jpg';     ///< <b>string</b> Thumbnail file pattern 
     32     public $thumb_tp_alpha = '%s/.%s_%s.png'; ///< <b>string</b> Thumbnail file pattern (with alpha layer) 
    3233      
    3334     /** 
     
    298299               $f->media_thumb = array(); 
    299300               $p = path::info($f->relname); 
    300                $thumb = sprintf($this->thumb_tp,$this->root.'/'.$p['dirname'],$p['base'],'%s'); 
    301                $thumb_url = sprintf($this->thumb_tp,$this->root_url.$p['dirname'],$p['base'],'%s'); 
     301               $alpha = ($p['extension'] == 'png') || ($p['extension'] == 'PNG'); 
     302               $thumb = sprintf(($alpha ? $this->thumb_tp_alpha : $this->thumb_tp),$this->root.'/'.$p['dirname'],$p['base'],'%s'); 
     303               $thumb_url = sprintf(($alpha ? $this->thumb_tp_alpha : $this->thumb_tp),$this->root_url.$p['dirname'],$p['base'],'%s'); 
    302304                
    303305               # Cleaner URLs 
     
    920922           
    921923          $p = path::info($file); 
    922           $thumb = sprintf($this->thumb_tp,$p['dirname'],$p['base'],'%s'); 
     924          $alpha = ($p['extension'] == 'png') || ($p['extension'] == 'PNG'); 
     925          $thumb = sprintf(($alpha ? $this->thumb_tp_alpha : $this->thumb_tp),$p['dirname'],$p['base'],'%s'); 
    923926           
    924927          try 
     
    939942                         $rate = ($s[0] < 100 ? 95 : ($s[0] < 600 ? 90 : 85)); 
    940943                         $img->resize($s[0],$s[0],$s[1]); 
    941                          $img->output('jpeg',$thumb_file,$rate); 
     944                         $img->output(($alpha ? 'png' : 'jpeg'),$thumb_file,$rate); 
    942945                         $img->loadImage($file); 
    943946                    } 
     
    958961          { 
    959962               $p = path::info($file->relname); 
    960                $thumb_old = sprintf($this->thumb_tp,$p['dirname'],$p['base'],'%s'); 
     963               $alpha = ($p['extension'] == 'png') || ($p['extension'] == 'PNG'); 
     964               $thumb_old = sprintf(($alpha ? $this->thumb_tp_alpha : $this->thumb_tp),$p['dirname'],$p['base'],'%s'); 
    961965                
    962966               $p = path::info($newFile->relname); 
    963                $thumb_new = sprintf($this->thumb_tp,$p['dirname'],$p['base'],'%s'); 
     967               $alpha = ($p['extension'] == 'png') || ($p['extension'] == 'PNG'); 
     968               $thumb_new = sprintf(($alpha ? $this->thumb_tp_alpha : $this->thumb_tp),$p['dirname'],$p['base'],'%s'); 
    964969                
    965970               foreach ($this->thumb_sizes as $suffix => $s) { 
     
    974979     { 
    975980          $p = path::info($f); 
    976           $thumb = sprintf($this->thumb_tp,'',$p['base'],'%s'); 
     981          $alpha = ($p['extension'] == 'png') || ($p['extension'] == 'PNG'); 
     982          $thumb = sprintf(($alpha ? $this->thumb_tp_alpha : $this->thumb_tp),'',$p['base'],'%s'); 
    977983           
    978984          foreach ($this->thumb_sizes as $suffix => $s) { 
  • locales/en/main.po

    r1425 r1468  
    21392139msgstr "" 
    21402140 
     2141msgid "Are you sure you want to delete this backup?" 
     2142msgstr "" 
     2143 
    21412144msgid "Zip file content" 
    21422145msgstr "" 
     
    27872790msgid "The following error was encountered while trying to read the database:" 
    27882791msgstr "" 
     2792 
     2793msgid "(No cat)" 
     2794msgstr "(none)" 
  • locales/fr/main.po

    r1454 r1468  
    10381038#, fuzzy, php-format 
    10391039msgid "Path <strong>%s</strong> is not writable." 
    1040 msgstr "Le répertoire de cache %s n'est pas accessible en écriture." 
     1040msgstr "Le répertoire de cache <strong>%s</strong> n'est pas accessible en écriture." 
    10411041 
    10421042#, fuzzy 
     
    11931193msgstr "Gestionnaire de médias" 
    11941194 
     1195msgid "Go to %s folder" 
     1196msgstr "Aller au dossier %s" 
     1197 
     1198msgid "Media details of %s" 
     1199msgstr "Détails du média %s" 
     1200 
    11951201msgid "confirm removal" 
    11961202msgstr "Confirmer la suppression" 
     
    19942000msgstr "Les fichiers suivants de votre installation de Dotclear ne peuvent pas être écrits. Veuillez corriger la situation ou <a href=\"http://fr.dotclear.org/download\">mettre à jour manuellement</a>." 
    19952001 
     2002msgid "Manual checking of update done successfully." 
     2003msgstr "Vérification manuelle de mise à jour effectuée avec succès." 
     2004 
    19962005msgid "No newer Dotclear version available." 
    19972006msgstr "Aucune nouvelle version de Dotclear n'est disponible." 
    19982007 
     2008msgid "Force checking update Dotclear" 
     2009msgstr "Forcer la vérification de mise à jour de Dotclear" 
     2010 
    19992011#, php-format 
    20002012msgid "Dotclear %s is available." 
     
    21332145#, fuzzy 
    21342146msgid "Go to the content" 
    2135 msgstr "Voir ce billet sur le site" 
     2147msgstr "Aller au contenu" 
    21362148 
    21372149#, fuzzy 
    21382150msgid "Go to the menu" 
    2139 msgstr "Aller sur le site" 
     2151msgstr "Aller au menu" 
    21402152 
    21412153msgid "Go to site" 
     
    22012213 
    22022214msgid "Users with posts cannot be deleted." 
    2203 msgstr "Les utilisateurs ayant écrit des billets ne peuvent être effacées." 
     2215msgstr "Les utilisateurs ayant écrit des billets ne peuvent être supprimés." 
    22042216 
    22052217#, php-format 
     
    22432255msgstr "Êtes-vous certain de vouloir supprimer le thème \"%s\" ?" 
    22442256 
     2257msgid "Are you sure you want to delete this backup?" 
     2258msgstr "Êtes-vous certain de vouloir supprimer cette sauvegarde ?" 
     2259 
    22452260msgid "Zip file content" 
    22462261msgstr "Contenu du fichier zip" 
     
    22582273msgstr "Vous avez des modifications non sauvegardées. Changer de format vous fera perdre ces modifications. Continuer ?" 
    22592274 
     2275msgid "Warning: post format change will not convert existing content. You will need to apply new format by yourself. Proceed anyway?" 
     2276msgstr "Attention : le changement de syntaxe ne transformera pas les balises des contenus déjà saisis. Pensez à les réadapter après cette opération. Confirmez-vous ce changement de syntaxe ?" 
     2277 
    22602278msgid "Loading enhanced uploader, please wait." 
    22612279msgstr "Chargement de l'interface avancée." 
     
    25062524#, fuzzy 
    25072525msgid "You are not allowed to reset categories order" 
    2508 msgstr "Vous n'êtes pas autorisé à supprimer des catégories" 
     2526msgstr "Vous n'êtes pas autorisé à réinitialiser l'ordre des catégories" 
    25092527 
    25102528msgid "Category URL must be unique." 
     
    30603078msgid "Add an introduction to the page." 
    30613079msgstr "Ajoute une introduction à la page." 
     3080 
     3081msgid "(No cat)" 
     3082msgstr "(aucune)" 
     3083 
     3084msgid "Password strength: %s" 
     3085msgstr "Force du mot de passe : %s" 
     3086 
     3087msgid "very weak" 
     3088msgstr "très faible" 
     3089 
     3090msgid "weak" 
     3091msgstr "faible" 
     3092 
     3093msgid "mediocre" 
     3094msgstr "moyen" 
     3095 
     3096msgid "strong" 
     3097msgstr "fort" 
     3098 
     3099msgid "very strong" 
     3100msgstr "très fort" 
  • locales/fr/plugins.po

    r1396 r1468  
    11661166msgstr "Pages" 
    11671167 
     1168msgid "My first page" 
     1169msgstr "Ma première page" 
     1170 
     1171msgid "This is your first page. When you\'re ready to blog, log in to edit or delete it." 
     1172msgstr "Ceci est votre première page. Quand vous serez prêt à bloguer, connectez-vous pour l'éditer ou la supprimer." 
     1173 
    11681174#, php-format 
    11691175msgid "%d page" 
  • plugins/antispam/filters/class.dc.filter.iplookup.php

    r1454 r1468  
    4444          } 
    4545 
    46           $match = array(); 
    47  
    4846          $bls = $this->getServers(); 
    4947          $bls = preg_split('/\s*,\s*/',$bls); 
    5048 
    51           foreach ($bls as $bl) 
    52           { 
     49          foreach ($bls as $bl) { 
    5350               if ($this->dnsblLookup($ip,$bl)) { 
    54                     $match[] = $bl; 
     51                    // Pass by reference $status to contain matching DNSBL 
     52                    $status = $bl; 
     53                    return true; 
    5554               } 
    56           } 
    57  
    58           if (!empty($match)) { 
    59                $status = substr(implode(', ',$match),0,128); 
    60                return true; 
    6155          } 
    6256     } 
  • plugins/antispam/filters/class.dc.filter.linkslookup.php

    r1179 r1366  
    6464     private function getLinks($text) 
    6565     { 
    66           $res = array(); 
    67            
    68           # href attribute on "a" tags 
    69           if (preg_match_all('/<a ([^>]+)>/ms', $text, $match, PREG_SET_ORDER)) 
    70           { 
    71                for ($i = 0; $i<count($match); $i++) 
    72                { 
    73                     if (preg_match('/href="(http:\/\/[^"]+)"/ms', $match[$i][1], $matches)) { 
    74                          $res[] = $matches[1]; 
    75                     } 
    76                } 
    77           } 
    78            
    79           return $res; 
     66          // href attribute on "a" tags is second match 
     67          preg_match_all('|<a.*?href="(http.*?)"|', $text, $parts); 
     68 
     69          return $parts[1]; 
    8070     } 
    8171} 
  • plugins/attachments/_admin.php

    r1398 r1468  
    4141                    '<img src="'.$f->media_icon.'" alt="" title="'.$f->basename.'" /></a>'. 
    4242                    '<ul>'. 
    43                     '<li><a class="media-link" href="media_item.php?id='.$f->media_id.'"'. 
     43                    '<li><a class="media-link" href="media_item.php?id='.$f->media_id.'" '. 
    4444                    'title="'.$f->basename.'">'.$ftitle.'</a></li>'. 
    4545                    '<li>'.$f->media_dtstr.'</li>'. 
  • plugins/pages/_define.php

    r1179 r1442  
    1616     /* Description*/    "Serve entries as simple web pages", 
    1717     /* Author */        "Olivier Meunier", 
    18      /* Version */       '1.2', 
     18     /* Version */       '1.3', 
    1919     array( 
    2020          'permissions' =>    'contentadmin,pages', 
     
    2222     ) 
    2323); 
    24 ?> 
Note: See TracChangeset for help on using the changeset viewer.

Sites map