Changes in [1466:e67efe636ce1:1468:3132a0aca046]
- Files:
-
- 3 added
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
r1216 r1350 1 Dotclear 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 1 18 Dotclear 2.5.1 - 2013-07-20 2 19 =========================================================== -
Makefile
r1046 r1451 69 69 find $(DC)/admin/js/jquery/*.js -exec ./build-tools/min-js.php \{\} \; 70 70 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 \{\} \; 71 72 find $(DC)/admin/js/tool-man/*.js -exec ./build-tools/min-js.php \{\} \; 72 73 find $(DC)/plugins -name '*.js' -exec ./build-tools/min-js.php \{\} \; -
admin/categories.php
r1399 r1468 31 31 $mov_cat = $mov_cat ? $mov_cat : null; 32 32 if ($mov_cat !== null) { 33 $c = $core->blog->getCategory((integer) $_POST[' del_cat']);33 $c = $core->blog->getCategory((integer) $_POST['mov_cat']); 34 34 if ($c->isEmpty()) { 35 35 throw new Exception(__('This category does not exist.')); … … 144 144 echo '</div>'; 145 145 146 $categories_combo = array(); 147 if (!$rs->isEmpty()) 148 { 149 while ($rs->fetch()) { 150 $catparents_combo[] = $categories_combo[] = new formSelectOption( 151 str_repeat(' ',$rs->level-1).($rs->level-1 == 0 ? '' : '• ').html::escapeHTML($rs->cat_title), 152 $rs->cat_id 153 ); 154 } 155 } 156 146 157 echo '<div class="col">'. 147 158 … … 149 160 '<h3>'.__('Add a new category').'</h3>'. 150 161 '<p><label class="required" for="cat_title"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').'</label> '. 151 form::field('cat_title',30,255 ).'</p>'.162 form::field('cat_title',30,255,'','maximal').'</p>'. 152 163 '<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(' ',$rs->level-1).($rs->level-1 == 0 ? '' : '• '). 158 html::escapeHTML($rs->cat_title).'</option>'; 159 } 160 echo 161 '</select></p>'. 164 form::combo('new_cat_parent',array_merge(array(__('(No cat)') => 0),$categories_combo),'','maximal'). 165 '</p>'. 162 166 '<p><input type="submit" value="'.__('Create').'" />'. 163 167 $core->formNonce().'</p>'. 168 164 169 '</form>'; 165 170 166 171 if (!$rs->isEmpty()) 167 172 { 168 $cats = array();169 $dest = array(' ' => '');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 187 173 echo 188 '<form action="categories.php" method="post" id="delete-category" class="border-top">'.174 '<form action="categories.php" method="post" id="delete-category">'. 189 175 '<h3>'.__('Remove a category').'</h3>'. 190 176 '<p><label for="del_cat">'.__('Choose a category to remove:').'</label> '. 191 form::combo('del_cat',$cat s).'</p> '.177 form::combo('del_cat',$categories_combo,'','maximal').'</p> '. 192 178 '<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> '. 194 180 '<p><input type="submit" value="'.__('Delete').'" class="delete" />'. 195 181 $core->formNonce().'</p>'. 182 196 183 '</form>'; 197 184 -
admin/index.php
r1422 r1468 59 59 if (!$core->auth->user_prefs->dashboard->prefExists('quickentry')) { 60 60 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'); 64 64 } 65 65 … … 309 309 if ($core->auth->check('usage,contentadmin',$core->blog->id)) 310 310 { 311 $categories_combo = array(' ' => ''); 311 # Getting categories 312 $categories_combo = array(__('(No cat)') => ''); 312 313 try { 313 314 $categories = $core->blog->getCategories(array('post_type'=>'post')); 314 while ($categories->fetch()) { 315 $categories_combo[] = new formSelectOption( 316 str_repeat(' ',$categories->level-1). 317 ($categories->level-1 == 0 ? '' : '• ').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(' ',$categories->level-1).($categories->level-1 == 0 ? '' : '• ').html::escapeHTML($categories->cat_title), 319 $categories->cat_id 320 ); 321 } 320 322 } 321 323 } catch (Exception $e) { } … … 333 335 form::textarea('post_content',50,7). 334 336 '</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 : ''). 337 349 '<p><input type="submit" value="'.__('Save').'" name="save" /> '. 338 350 ($core->auth->check('publish',$core->blog->id) -
admin/js/_index.js
r1140 r1418 61 61 }); 62 62 } 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 ); 63 67 } 64 68 -
admin/js/_post.js
r1392 r1468 115 115 hide: $('#post_notes').val() == '' 116 116 }); 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 ); 117 121 $('#post_lang').parent().toggleWithLegend($('#post_lang'),{ 118 122 cookie: 'dcx_post_lang' -
admin/js/_posts_actions.js
r1035 r1419 6 6 matchContains: true 7 7 }); 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 ); 8 12 }); -
admin/js/_users_actions.js
r935 r1449 1 1 jQuery.fn.updatePermissionsForm = function() { 2 2 return this.each(function() { 3 3 4 var perms = {}; 4 5 var re = /^perm\[(.+?)\]\[(.+?)\]$/; … … 12 13 continue; 13 14 } 15 var prop; 14 16 prop = e.name.match(re); 15 17 if (!prop) { … … 20 22 } 21 23 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 } 22 50 } 23 51 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; 54 69 } 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 55 90 }); 56 91 }; -
admin/post.php
r1460 r1468 218 218 if (!empty($_POST) && !empty($_POST['save']) && $can_edit_post && !$bad_dt) 219 219 { 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 220 238 $cur = $core->con->openCursor($core->prefix.'post'); 221 239 … … 283 301 } 284 302 } 303 304 # Getting categories 305 $categories_combo = array(__('(No cat)') => ''); 306 try { 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(' ',$categories->level-1).($categories->level-1 == 0 ? '' : '• ').html::escapeHTML($categories->cat_title), 312 $categories->cat_id 313 ); 314 } 315 } 316 } catch (Exception $e) { } 285 317 286 318 /* DISPLAY … … 423 455 '<p><label for="cat_id" class="ib">'.__('Category').'</label>'. 424 456 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 : ''))), 426 468 'options-box' => array( 427 469 'title' => __('Options'), -
admin/posts_actions.php
r1399 r1468 16 16 17 17 $params = array(); 18 $action = ''; 18 19 19 20 /* Actions … … 126 127 elseif ($action == 'category' && isset($_POST['new_cat_id'])) 127 128 { 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); 131 151 132 152 http::redirect($redir); … … 246 266 echo '<h2 class="page-title">'.__('Change category for entries').'</h2>'; 247 267 248 # categories list249 268 # Getting categories 250 $categories_combo = array( ' '=> '');269 $categories_combo = array(__('(No cat)') => ''); 251 270 try { 252 271 $categories = $core->blog->getCategories(array('post_type'=>'post')); 253 while ($categories->fetch()) { 254 $categories_combo[] = new formSelectOption( 255 str_repeat(' ',$categories->level-1). 256 ($categories->level-1 == 0 ? '' : '• ').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(' ',$categories->level-1).($categories->level-1 == 0 ? '' : '• ').html::escapeHTML($categories->cat_title), 276 $categories->cat_id 277 ); 278 } 259 279 } 260 280 } catch (Exception $e) { } … … 264 284 '<p><label for="new_cat_id" class="classic">'.__('Category:').'</label> '. 265 285 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 } 266 298 267 299 echo -
admin/preferences.php
r1399 r1468 344 344 ($user_acc_nodragdrop ? '' : dcPage::jsLoad('js/_preferences-dragdrop.js')). 345 345 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". 346 359 dcPage::jsPageTabs($default_tab). 347 360 dcPage::jsConfirmClose('user-form'). … … 420 433 '<legend>'.__('Change your password').'</legend>'. 421 434 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>'. 424 443 425 444 '<p><label for="new_pwd_c">'.__('Confirm password:').'</label>'. -
admin/style/default.css
r1465 r1468 541 541 } 542 542 543 #upg-notify { 544 } 545 #upg-notify ul { 546 padding-left: 15px; 547 } 548 #upg-notify li { 549 color: #fff; 550 } 543 551 /* ------------------------------------------------------------------ post */ 544 552 #entry-wrapper { … … 1617 1625 } 1618 1626 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 1619 1667 /* --------------------------------------------------------------------------- 1620 1668 Media queries vite fait en attendant la reprise complète du layout -
admin/update.php
r1358 r1468 27 27 28 28 $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'])); 30 30 $zip_file = $new_v ? DC_BACKUP_PATH.'/'.basename($updater->getFileURL()) : ''; 31 31 $version_info = $new_v ? $updater->getInfoURL() : ''; … … 168 168 -------------------------------------------------------- */ 169 169 dcPage::open(__('Dotclear update'), 170 (!$step ? dcPage::jsPageTabs($default_tab) : ''), 170 (!$step ? 171 dcPage::jsPageTabs($default_tab). 172 dcPage::jsLoad('js/_update.js') 173 : ''), 171 174 dcPage::breadcrumb( 172 175 array( … … 176 179 ); 177 180 181 if (!$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 178 189 if (!$step) 179 190 { … … 181 192 if (empty($new_v)) 182 193 { 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>'; 184 199 } 185 200 else -
inc/admin/lib.dc.page.php
r1461 r1468 164 164 if ($core->error->flag()) { 165 165 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>'. 167 167 $core->error->toHTML(). 168 168 '</div>'; … … 508 508 self::jsVar('dotclear.msg.confirm_delete_theme', 509 509 __('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?')). 510 512 self::jsVar('dotclear.msg.zip_file_content', 511 513 __('Zip file content')). -
inc/admin/lib.pager.php
r1415 r1468 87 87 html::escapeHTML($this->rs->cat_title)); 88 88 } else { 89 $cat_title = __(' None');89 $cat_title = __('(No cat)'); 90 90 } 91 91 -
inc/core/class.dc.blog.php
r1353 r1468 634 634 private function checkCategory($title,$url,$id=null) 635 635 { 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'; 644 643 645 644 $rs = $this->con->select($strReq); 646 645 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; 650 687 } 651 688 … … 669 706 670 707 # 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); 672 709 673 710 if ($cur->cat_desc !== null) { -
inc/core/class.dc.media.php
r1280 r1468 30 30 31 31 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) 32 33 33 34 /** … … 298 299 $f->media_thumb = array(); 299 300 $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'); 302 304 303 305 # Cleaner URLs … … 920 922 921 923 $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'); 923 926 924 927 try … … 939 942 $rate = ($s[0] < 100 ? 95 : ($s[0] < 600 ? 90 : 85)); 940 943 $img->resize($s[0],$s[0],$s[1]); 941 $img->output( 'jpeg',$thumb_file,$rate);944 $img->output(($alpha ? 'png' : 'jpeg'),$thumb_file,$rate); 942 945 $img->loadImage($file); 943 946 } … … 958 961 { 959 962 $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'); 961 965 962 966 $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'); 964 969 965 970 foreach ($this->thumb_sizes as $suffix => $s) { … … 974 979 { 975 980 $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'); 977 983 978 984 foreach ($this->thumb_sizes as $suffix => $s) { -
locales/en/main.po
r1425 r1468 2139 2139 msgstr "" 2140 2140 2141 msgid "Are you sure you want to delete this backup?" 2142 msgstr "" 2143 2141 2144 msgid "Zip file content" 2142 2145 msgstr "" … … 2787 2790 msgid "The following error was encountered while trying to read the database:" 2788 2791 msgstr "" 2792 2793 msgid "(No cat)" 2794 msgstr "(none)" -
locales/fr/main.po
r1454 r1468 1038 1038 #, fuzzy, php-format 1039 1039 msgid "Path <strong>%s</strong> is not writable." 1040 msgstr "Le répertoire de cache %sn'est pas accessible en écriture."1040 msgstr "Le répertoire de cache <strong>%s</strong> n'est pas accessible en écriture." 1041 1041 1042 1042 #, fuzzy … … 1193 1193 msgstr "Gestionnaire de médias" 1194 1194 1195 msgid "Go to %s folder" 1196 msgstr "Aller au dossier %s" 1197 1198 msgid "Media details of %s" 1199 msgstr "Détails du média %s" 1200 1195 1201 msgid "confirm removal" 1196 1202 msgstr "Confirmer la suppression" … … 1994 2000 msgstr "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>." 1995 2001 2002 msgid "Manual checking of update done successfully." 2003 msgstr "Vérification manuelle de mise à jour effectuée avec succès." 2004 1996 2005 msgid "No newer Dotclear version available." 1997 2006 msgstr "Aucune nouvelle version de Dotclear n'est disponible." 1998 2007 2008 msgid "Force checking update Dotclear" 2009 msgstr "Forcer la vérification de mise à jour de Dotclear" 2010 1999 2011 #, php-format 2000 2012 msgid "Dotclear %s is available." … … 2133 2145 #, fuzzy 2134 2146 msgid "Go to the content" 2135 msgstr " Voir ce billet sur le site"2147 msgstr "Aller au contenu" 2136 2148 2137 2149 #, fuzzy 2138 2150 msgid "Go to the menu" 2139 msgstr "Aller sur le site"2151 msgstr "Aller au menu" 2140 2152 2141 2153 msgid "Go to site" … … 2201 2213 2202 2214 msgid "Users with posts cannot be deleted." 2203 msgstr "Les utilisateurs ayant écrit des billets ne peuvent être effacées."2215 msgstr "Les utilisateurs ayant écrit des billets ne peuvent être supprimés." 2204 2216 2205 2217 #, php-format … … 2243 2255 msgstr "Êtes-vous certain de vouloir supprimer le thème \"%s\" ?" 2244 2256 2257 msgid "Are you sure you want to delete this backup?" 2258 msgstr "Êtes-vous certain de vouloir supprimer cette sauvegarde ?" 2259 2245 2260 msgid "Zip file content" 2246 2261 msgstr "Contenu du fichier zip" … … 2258 2273 msgstr "Vous avez des modifications non sauvegardées. Changer de format vous fera perdre ces modifications. Continuer ?" 2259 2274 2275 msgid "Warning: post format change will not convert existing content. You will need to apply new format by yourself. Proceed anyway?" 2276 msgstr "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 2260 2278 msgid "Loading enhanced uploader, please wait." 2261 2279 msgstr "Chargement de l'interface avancée." … … 2506 2524 #, fuzzy 2507 2525 msgid "You are not allowed to reset categories order" 2508 msgstr "Vous n'êtes pas autorisé à supprimerdes catégories"2526 msgstr "Vous n'êtes pas autorisé à réinitialiser l'ordre des catégories" 2509 2527 2510 2528 msgid "Category URL must be unique." … … 3060 3078 msgid "Add an introduction to the page." 3061 3079 msgstr "Ajoute une introduction à la page." 3080 3081 msgid "(No cat)" 3082 msgstr "(aucune)" 3083 3084 msgid "Password strength: %s" 3085 msgstr "Force du mot de passe : %s" 3086 3087 msgid "very weak" 3088 msgstr "très faible" 3089 3090 msgid "weak" 3091 msgstr "faible" 3092 3093 msgid "mediocre" 3094 msgstr "moyen" 3095 3096 msgid "strong" 3097 msgstr "fort" 3098 3099 msgid "very strong" 3100 msgstr "très fort" -
locales/fr/plugins.po
r1396 r1468 1166 1166 msgstr "Pages" 1167 1167 1168 msgid "My first page" 1169 msgstr "Ma première page" 1170 1171 msgid "This is your first page. When you\'re ready to blog, log in to edit or delete it." 1172 msgstr "Ceci est votre première page. Quand vous serez prêt à bloguer, connectez-vous pour l'éditer ou la supprimer." 1173 1168 1174 #, php-format 1169 1175 msgid "%d page" -
plugins/antispam/filters/class.dc.filter.iplookup.php
r1454 r1468 44 44 } 45 45 46 $match = array();47 48 46 $bls = $this->getServers(); 49 47 $bls = preg_split('/\s*,\s*/',$bls); 50 48 51 foreach ($bls as $bl) 52 { 49 foreach ($bls as $bl) { 53 50 if ($this->dnsblLookup($ip,$bl)) { 54 $match[] = $bl; 51 // Pass by reference $status to contain matching DNSBL 52 $status = $bl; 53 return true; 55 54 } 56 }57 58 if (!empty($match)) {59 $status = substr(implode(', ',$match),0,128);60 return true;61 55 } 62 56 } -
plugins/antispam/filters/class.dc.filter.linkslookup.php
r1179 r1366 64 64 private function getLinks($text) 65 65 { 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]; 80 70 } 81 71 } -
plugins/attachments/_admin.php
r1398 r1468 41 41 '<img src="'.$f->media_icon.'" alt="" title="'.$f->basename.'" /></a>'. 42 42 '<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.'" '. 44 44 'title="'.$f->basename.'">'.$ftitle.'</a></li>'. 45 45 '<li>'.$f->media_dtstr.'</li>'. -
plugins/pages/_define.php
r1179 r1442 16 16 /* Description*/ "Serve entries as simple web pages", 17 17 /* Author */ "Olivier Meunier", 18 /* Version */ '1. 2',18 /* Version */ '1.3', 19 19 array( 20 20 'permissions' => 'contentadmin,pages', … … 22 22 ) 23 23 ); 24 ?>
Note: See TracChangeset
for help on using the changeset viewer.