Dotclear


Ignore:
Files:
12 added
28 edited

Legend:

Unmodified
Added
Removed
  • .hgsubstate

    r3063 r3102  
    1 8be811511655a8c3aabd56fe1cb627811dc43600 inc/libs/clearbricks 
     108a2862f246a89b713a74750b510eee9c9175392 inc/libs/clearbricks 
  • .hgtags

    r3096 r3098  
    2525c45489df2bde825c7ed9c756e00444b54caf8e10 2.7.3 
    262627e258e592e45b56a803038279adb6faa5865265 2.7.4 
     275e377b0f479e0f45cf199b24c3f997449a6f5a8a 2.8.0 
    27287b52a5c13c7e8129f9a07f38482fe58b25e96349 2.8.1 
  • admin/blog_pref.php

    r3030 r3091  
    587587     '<div class="col">'. 
    588588     '<h5>'.__('Generated image sizes (in pixels)').'</h5>'. 
    589      '<p class="field"><label for="media_img_t_size">Thumbnail</label> '. 
     589     '<p class="field"><label for="media_img_t_size">'.__('Thumbnail').'</label> '. 
    590590     form::field('media_img_t_size',3,3,$blog_settings->system->media_img_t_size).'</p>'. 
    591591 
    592      '<p class="field"><label for="media_img_s_size">Small</label> '. 
     592     '<p class="field"><label for="media_img_s_size">'.__('Small').'</label> '. 
    593593     form::field('media_img_s_size',3,3,$blog_settings->system->media_img_s_size).'</p>'. 
    594594 
    595      '<p class="field"><label for="media_img_m_size">Medium</label> '. 
     595     '<p class="field"><label for="media_img_m_size">'.__('Medium').'</label> '. 
    596596     form::field('media_img_m_size',3,3,$blog_settings->system->media_img_m_size).'</p>'. 
    597597     '</div>'. 
  • admin/comments.php

    r3053 r3091  
    245245     '<p><label for="order" class="ib">'.__('Sort:').'</label> '. 
    246246     form::combo('order',$order_combo,$order).'</p>'. 
    247      '<p><span class="label ib">Afficher</span> <label for="nb" class="classic">'. 
     247     '<p><span class="label ib">'.__('Show').'</span> <label for="nb" class="classic">'. 
    248248     form::field('nb',3,3,$nb_per_page).' '. 
    249249     __('comments per page').'</label></p>'. 
  • admin/media.php

    r3034 r3101  
    4444} 
    4545 
    46 # We set session information about directory and page 
     46# We set session information about directory, page and display mode 
    4747if ($d) { 
    4848     $_SESSION['media_manager_dir'] = $d; 
     
    5555     unset($_SESSION['media_manager_page']); 
    5656} 
     57 
     58# Get query in any 
     59$q = isset($_REQUEST['q']) ? $_REQUEST['q'] : null; 
    5760 
    5861# Sort combo 
     
    6467     ); 
    6568 
     69if (!empty($_GET['file_mode'])) { 
     70     $_SESSION['media_file_mode'] = $_GET['file_mode']; 
     71} 
     72$file_mode = !empty($_SESSION['media_file_mode']) ? $_SESSION['media_file_mode'] : false; 
     73 
    6674if (!empty($_GET['file_sort']) && in_array($_GET['file_sort'],$sort_combo)) { 
    6775     $_SESSION['media_file_sort'] = $_GET['file_sort']; 
    6876} 
    6977$file_sort = !empty($_SESSION['media_file_sort']) ? $_SESSION['media_file_sort'] : null; 
     78 
    7079$nb_per_page = !empty($_SESSION['nb_per_page']) ? (integer)$_SESSION['nb_per_page'] : $nb_per_page; 
    7180if (!empty($_GET['nb_per_page']) && (integer)$_GET['nb_per_page'] > 0) { 
     
    8190if ($plugin_id != '') { 
    8291     $page_url_params['plugin_id'] = $plugin_id; 
     92} 
     93if ($q) { 
     94     $page_url_params['q'] = $q; 
    8395} 
    8496 
     
    100112          $core->media->setFileSort($file_sort); 
    101113     } 
    102      $core->media->chdir($d); 
    103      $core->media->getDir(); 
     114     $query = false; 
     115     if ($q) { 
     116          $query = $core->media->searchMedia($q); 
     117     } 
     118     if (!$query) { 
     119          $core->media->chdir($d); 
     120          $core->media->getDir(); 
     121     } else { 
     122          $d = null; 
     123          $core->media->chdir($d); 
     124     } 
    104125     $core_media_writable = $core->media->writable(); 
    105126     $dir =& $core->media->dir; 
     
    170191                    'name' => $upfile['name'], 
    171192                    'size' => $upfile['size'], 
    172                     'html' => mediaItemLine($core->media->getFile($new_file_id), 1) 
     193                    'html' => mediaItemLine($core->media->getFile($new_file_id),1,$query) 
    173194               ); 
    174195          } catch (Exception $e) { 
     
    187208               $f_private = (isset($_POST['upfilepriv']) ? $_POST['upfilepriv'] : false); 
    188209 
    189                $core->media->uploadFile($upfile['tmp_name'], $upfile['name'], $f_title, $f_private); 
     210               $core->media->uploadFile($upfile['tmp_name'],$upfile['name'],$f_title,$f_private); 
    190211 
    191212               dcPage::addSuccessNotice(__('Files have been successfully uploaded.')); 
     
    273294     ' &nbsp; <input type="submit" name="rmyes" value="'.__('Yes').'" />'. 
    274295     form::hidden('d',$d). 
     296     form::hidden('q',$q). 
    275297     $core->adminurl->getHiddenFormFields('admin.media',$page_url_params). 
    276298     $core->formNonce(). 
     
    296318     ); 
    297319} else { 
    298      $temp_params = $page_url_params; 
    299      $temp_params['d']='%s'; 
    300      $bc_template = $core->adminurl->get('admin.media',$temp_params,'&amp;',true); 
    301      $breadcrumb_media = $core->media->breadCrumb($bc_template,'<span class="page-title">%s</span>'); 
    302      if ($breadcrumb_media == '') { 
     320     if ($query || (!$query && $q)) { 
     321          $count = $query ? count($dir['files']) : 0; 
     322          $home_params = $page_url_params; 
     323          $home_params['d']=''; 
     324          $home_params['q']=''; 
    303325          $breadcrumb = dcPage::breadcrumb( 
    304326               array( 
    305327                    html::escapeHTML($core->blog->name) => '', 
    306                     __('Media manager') => '' 
     328                    __('Media manager') => $core->adminurl->get('admin.media',$home_params), 
     329                    __('Search:').' '.$q.' ('.sprintf(__('%s file found','%s files found',$count),$count).')' => '' 
    307330               ), 
    308331               array('home_link' => !$popup) 
    309332          ); 
    310333     } else { 
    311           $home_params = $page_url_params; 
    312           $home_params['d']=''; 
    313  
    314           $breadcrumb = dcPage::breadcrumb( 
    315                array( 
    316                     html::escapeHTML($core->blog->name) => '', 
    317                     __('Media manager') => $core->adminurl->get('admin.media',$home_params), 
    318                     $breadcrumb_media => '' 
    319                ), 
    320                array( 
    321                     'home_link' => !$popup, 
    322                     'hl' => false 
    323                ) 
    324           ); 
     334          $temp_params = $page_url_params; 
     335          $temp_params['d']='%s'; 
     336          $bc_template = $core->adminurl->get('admin.media',$temp_params,'&amp;',true); 
     337          $breadcrumb_media = $core->media->breadCrumb($bc_template,'<span class="page-title">%s</span>'); 
     338          if ($breadcrumb_media == '') { 
     339               $breadcrumb = dcPage::breadcrumb( 
     340                    array( 
     341                         html::escapeHTML($core->blog->name) => '', 
     342                         __('Media manager') => '' 
     343                    ), 
     344                    array('home_link' => !$popup) 
     345               ); 
     346          } else { 
     347               $home_params = $page_url_params; 
     348               $home_params['d']=''; 
     349 
     350               $breadcrumb = dcPage::breadcrumb( 
     351                    array( 
     352                         html::escapeHTML($core->blog->name) => '', 
     353                         __('Media manager') => $core->adminurl->get('admin.media',$home_params), 
     354                         $breadcrumb_media => '' 
     355                    ), 
     356                    array( 
     357                         'home_link' => !$popup, 
     358                         'hl' => false 
     359                    ) 
     360               ); 
     361          } 
    325362     } 
    326363} 
     
    371408 
    372409if ($post_id) { 
    373      echo '<div class="form-note info"><p>'.sprintf(__('Choose a file to attach to entry %s by clicking on %s.'), 
     410     echo '<div class="form-note info"><p>'.sprintf(__('Choose a file to attach to entry %s by clicking on %s'), 
    374411          '<a href="'.$core->getPostAdminURL($post_type,$post_id).'">'.html::escapeHTML($post_title).'</a>', 
    375           '<img src="images/plus.png" alt="'.__('Attach this file to entry').'" />').'</p></div>'; 
     412          '<img src="images/plus.png" alt="'.__('Attach this file to entry').'" />'); 
     413     if ($core_media_writable) { 
     414          echo ' '.__('or').' '.sprintf('<a href="#fileupload">%s</a>',__('upload a new file')); 
     415     } 
     416     echo '</p></div>'; 
    376417} 
    377418if ($popup) { 
    378      echo '<div class="info"><p>'.sprintf(__('Choose a file to insert into entry by clicking on %s.'), 
    379           '<img src="images/plus.png" alt="'.__('Attach this file to entry').'" />').'</p></div>'; 
     419     echo '<div class="info"><p>'.sprintf(__('Choose a file to insert into entry by clicking on %s'), 
     420          '<img src="images/plus.png" alt="'.__('Attach this file to entry').'" />'); 
     421     if ($core_media_writable) { 
     422          echo ' '.__('or').' '.sprintf('<a href="#fileupload">%s</a>',__('upload a new file')); 
     423     } 
     424     echo '</p></div>'; 
    380425} 
    381426 
     
    394439$fmt_form_media = '<form action="'.$core->adminurl->get("admin.media").'" method="post" id="form-medias">'. 
    395440     '<div class="files-group">%s</div>'. 
    396      '<p class="hidden">'.$core->formNonce() . form::hidden(array('d'),$d).form::hidden(array('plugin_id'),$plugin_id).'</p>'; 
     441     '<p class="hidden">'.$core->formNonce(). 
     442     form::hidden(array('d'),$d). 
     443     form::hidden(array('q'),$q). 
     444     form::hidden(array('plugin_id'),$plugin_id). 
     445     '</p>'; 
    397446 
    398447if (!$popup) { 
     
    418467 
    419468     echo 
     469     '<form action="'.$core->adminurl->get("admin.media").'" method="get" id="search-form">'. 
     470     '<p><label for="search" class="classic">'.__('Search:').'</label> '. 
     471     form::field('q',20,255,$q).' '. 
     472     '<input type="submit" value="'.__('OK').'" />'.' '. 
     473     '<span class="form-note">'.__('Will search into media filename (including path), title and description').'</span>'. 
     474     form::hidden(array('popup'),$popup). 
     475     form::hidden(array('plugin_id'),$plugin_id). 
     476     form::hidden(array('post_id'),$post_id). 
     477     '</p>'. 
     478     '</form>'. 
    420479     '<form action="'.$core->adminurl->get("admin.media").'" method="get" id="filters-form">'. 
    421      '<p class="two-boxes"><label for="file_sort" class="classic">'.__('Sort files:').'</label> '. 
     480     '<span class="media-file-mode">'. 
     481     '<a href="'.$core->adminurl->get("admin.media",array_merge($page_url_params,array('file_mode' => 'grid'))).'" title="'.__('Grid display mode').'">'. 
     482     '<img src="images/grid-'.($file_mode == 'grid' ? 'on' : 'off').'.png" alt="'.__('Grid display mode').'" />'. 
     483     '</a>'. 
     484     '<a href="'.$core->adminurl->get("admin.media",array_merge($page_url_params,array('file_mode' => 'list'))).'" title="'.__('List display mode').'">'. 
     485     '<img src="images/list-'.($file_mode == 'list' ? 'on' : 'off').'.png" alt="'.__('List display mode').'" />'. 
     486     '</a>'. 
     487     '</span>'. 
     488     '<p class="three-boxes"><label for="file_sort" class="classic">'.__('Sort files:').'</label> '. 
    422489     form::combo('file_sort',$sort_combo,$file_sort).'</p>'. 
    423      '<p class="two-boxes"><label for="nb_per_page" class="classic">'.__('Number of elements displayed per page:').'</label> '. 
     490     '<p class="three-boxes"><label for="nb_per_page" class="classic">'.__('Number of elements displayed per page:').'</label> '. 
    424491     form::field('nb_per_page',5,3,(integer) $nb_per_page).' '. 
    425492     '<input type="submit" value="'.__('OK').'" />'. 
     
    427494     form::hidden(array('plugin_id'),$plugin_id). 
    428495     form::hidden(array('post_id'),$post_id). 
     496     form::hidden(array('q'),$q). 
    429497     '</p>'. 
    430498     '</form>'. 
    431499     $pager->getLinks(); 
    432500 
    433      $dgroup = ''; 
    434      $fgroup = ''; 
    435      for ($i=$pager->index_start, $j=0; $i<=$pager->index_end; $i++,$j++) 
    436      { 
    437           if ($items[$i]->d) { 
    438                $dgroup .= mediaItemLine($items[$i],$j); 
    439           } else { 
    440                $fgroup .= mediaItemLine($items[$i],$j); 
    441           } 
    442      } 
    443  
    444      echo 
    445      ($dgroup != '' ? '<div class="folders-group">'.$dgroup.'</div>' : ''). 
    446      sprintf($fmt_form_media,$fgroup,''); 
     501     if ($file_mode == 'list') { 
     502          $table = 
     503          '<div class="table-outer">'. 
     504          '<table>'. 
     505          '<caption class="hidden">'.__('Media list').'</caption>'. 
     506          '<tr>'. 
     507          '<th colspan="2" class="first">'.__('Name').'</th>'. 
     508          '<th scope="col">'.__('Date').'</th>'. 
     509          '<th scope="col">'.__('Size').'</th>'. 
     510          '</tr>'; 
     511 
     512          $dlist = ''; 
     513          $flist = ''; 
     514          for ($i=$pager->index_start, $j=0; $i<=$pager->index_end; $i++,$j++) 
     515          { 
     516               if ($items[$i]->d) { 
     517                    $dlist .= mediaItemLine($items[$i],$j,$query,true); 
     518               } else { 
     519                    $flist .= mediaItemLine($items[$i],$j,$query,true); 
     520               } 
     521          } 
     522          $table .= $dlist.$flist; 
     523 
     524          $table .= 
     525          '</table></div>'; 
     526          echo sprintf($fmt_form_media,$table,''); 
     527     } else { 
     528          $dgroup = ''; 
     529          $fgroup = ''; 
     530          for ($i=$pager->index_start, $j=0; $i<=$pager->index_end; $i++,$j++) 
     531          { 
     532               if ($items[$i]->d) { 
     533                    $dgroup .= mediaItemLine($items[$i],$j,$query); 
     534               } else { 
     535                    $fgroup .= mediaItemLine($items[$i],$j,$query); 
     536               } 
     537          } 
     538          echo 
     539          ($dgroup != '' ? '<div class="folders-group">'.$dgroup.'</div>' : ''). 
     540          sprintf($fmt_form_media,$fgroup,''); 
     541     } 
    447542 
    448543     echo $pager->getLinks(); 
     
    458553     !(count($items) == 0 || (count($items) == 1 && $items[0]->parent)); 
    459554 
    460 if ($core_media_writable || $core_media_archivable) { 
     555if ((!$query) && ($core_media_writable || $core_media_archivable)) { 
    461556     echo 
    462557     '<div class="vertical-separator">'. 
     
    464559} 
    465560 
    466 if ($core_media_writable || $core_media_archivable) { 
     561if ((!$query) && ($core_media_writable || $core_media_archivable)) { 
    467562     echo 
    468563     '<div class="two-boxes odd">'; 
     
    500595} 
    501596 
    502 if ($core_media_writable) 
     597if (!$query && $core_media_writable) 
    503598{ 
    504599     echo 
     
    561656form::hidden('rmyes',1).form::hidden('d',html::escapeHTML($d)). 
    562657form::hidden(array('plugin_id'),$plugin_id).form::hidden('remove',''). 
     658form::hidden(array('q'),$q). 
    563659$core->formNonce(). 
    564660'</div>'. 
    565661'</form>'; 
    566662 
    567 if ($core_media_writable || $core_media_archivable) { 
     663if ((!$query) && ($core_media_writable || $core_media_archivable)) { 
    568664     echo 
    569665     '</div>'; 
     
    578674 
    579675/* ----------------------------------------------------- */ 
    580 function mediaItemLine($f,$i) 
     676function mediaItemLine($f,$i,$query,$table=false) 
    581677{ 
    582678     global $core, $page_url, $popup, $post_id, $plugin_id,$page_url_params; 
    583679 
    584680     $fname = $f->basename; 
    585  
    586      $class = 'media-item media-col-'.($i%2); 
     681     $file = $query ? $f->relname : $f->basename; 
     682 
     683     $class = $table ? '' : 'media-item media-col-'.($i%2); 
    587684 
    588685     if ($f->d) { 
     
    615712          $fname = substr($fname, 0, $maxchars-4).'...'.($f->d ? '' : files::getExtension($fname)); 
    616713     } 
    617      $res = 
    618      '<div class="'.$class.'"><p><a class="media-icon media-link" href="'.rawurldecode($link).'">'. 
    619      '<img src="'.$f->media_icon.'" alt="" />'.$fname.'</a></p>'; 
    620  
    621      $lst = ''; 
    622  
    623      if (!$f->d) { 
    624           $lst .= 
    625           '<li>'.$f->media_title.'</li>'. 
    626           '<li>'. 
    627           $f->media_dtstr.' - '. 
    628           files::size($f->size).' - '. 
    629           '<a href="'.$f->file_url.'">'.__('open').'</a>'. 
    630           '</li>'; 
    631      } 
    632714 
    633715     $act = ''; 
    634  
    635716     if ($post_id && !$f->d) { 
     717          // Media attachment button 
    636718          $act .= 
    637719          '<a class="attach-media" title="'.__('Attach this file to entry').'" href="'. 
     
    641723          '</a>'; 
    642724     } 
    643  
    644725     if ($popup && !$f->d) { 
     726          // Media insertion button 
    645727          $act .= '<a href="'.$link.'"><img src="images/plus.png" alt="'.__('Insert this file into entry').'" '. 
    646728          'title="'.__('Insert this file into entry').'" /></a> '; 
    647729     } 
    648  
    649730     if ($f->del) { 
     731          // Deletion button or checkbox 
    650732          if (!$popup && !$f->d) { 
    651                $act .= form::checkbox(array('medias[]', 'media_'.rawurlencode($f->basename)),rawurlencode($f->basename)); 
     733               $act .= form::checkbox(array('medias[]', 'media_'.rawurlencode($file)),$file); 
    652734          } else { 
    653735               $act .= '<a class="media-remove" '. 
    654                'href="'.html::escapeURL($page_url).'&amp;plugin_id='.$plugin_id.'&amp;d='. 
    655                rawurlencode($GLOBALS['d']).'&amp;remove='.rawurlencode($f->basename).'">'. 
     736               'href="'.html::escapeURL($page_url). 
     737               '&amp;plugin_id='.$plugin_id. 
     738               '&amp;d='.rawurlencode($GLOBALS['d']). 
     739               '&amp;q='.rawurlencode($GLOBALS['q']). 
     740               '&amp;remove='.rawurlencode($file).'">'. 
    656741               '<img src="images/trash.png" alt="'.__('Delete').'" title="'.__('delete').'" /></a>'; 
    657742          } 
    658743     } 
    659744 
    660      $lst .= ($act != '' ? '<li class="media-action">&nbsp;'.$act.'</li>' : ''); 
    661  
    662      // Show player if relevant 
    663      $file_type = explode('/',$f->type); 
    664      if ($file_type[0] == 'audio') 
    665      { 
    666           $lst .= '<li>'.dcMedia::audioPlayer($f->type,$f->file_url,$core->adminurl->get("admin.home",array('pf' => 'player_mp3.swf'))).'</li>'; 
    667      } 
    668  
    669      $res .=   ($lst != '' ? '<ul>'.$lst.'</ul>' : ''); 
    670  
    671      $res .= '</div>'; 
     745     if (!$table) { 
     746          $res = 
     747          '<div class="'.$class.'"><p><a class="media-icon media-link" href="'.rawurldecode($link).'">'. 
     748          '<img src="'.$f->media_icon.'" alt="" />'.($query ? $file : $fname).'</a></p>'; 
     749 
     750          $lst = ''; 
     751          if (!$f->d) { 
     752               $lst .= 
     753               '<li>'.$f->media_title.'</li>'. 
     754               '<li>'. 
     755               $f->media_dtstr.' - '. 
     756               files::size($f->size).' - '. 
     757               '<a href="'.$f->file_url.'">'.__('open').'</a>'. 
     758               '</li>'; 
     759          } 
     760          $lst .= ($act != '' ? '<li class="media-action">&nbsp;'.$act.'</li>' : ''); 
     761 
     762          // Show player if relevant 
     763          $file_type = explode('/',$f->type); 
     764          if ($file_type[0] == 'audio') 
     765          { 
     766               $lst .= '<li>'.dcMedia::audioPlayer($f->type,$f->file_url,$core->adminurl->get("admin.home",array('pf' => 'player_mp3.swf'))).'</li>'; 
     767          } 
     768 
     769          $res .=   ($lst != '' ? '<ul>'.$lst.'</ul>' : ''); 
     770          $res .= '</div>'; 
     771     } else { 
     772          $res = '<tr class="'.$class.'">'; 
     773          $res .= '<td class="media-action">'.$act.'</td>'; 
     774          $res .= '<td class="maximal" scope="row"><a class="media-flag media-link" href="'.rawurldecode($link).'">'. 
     775                    '<img src="'.$f->media_icon.'" alt="" />'.($query ? $file : $fname).'</a>'. 
     776                    '<br />'.($f->d ? '' : $f->media_title).'</td>'; 
     777          $res .= '<td class="nowrap count">'.($f->d ? '' : $f->media_dtstr).'</td>'; 
     778          $res .= '<td class="nowrap count">'.($f->d ? '' : files::size($f->size).' - '.'<a href="'.$f->file_url.'">'.__('open').'</a>').'</td>'; 
     779          $res .= '</tr>'; 
     780     } 
    672781 
    673782     return $res; 
  • admin/media_item.php

    r2889 r3093  
    498498     echo '<a href="'.$core->adminurl->get('admin.media.item',array_merge($page_url_params,array("size" => "o","tab"=>"media-details-tab"))).'">'.__('original').'</a>'; 
    499499     echo '</p>'; 
     500 
     501     if ($thumb_size != 'o' && isset($file->media_thumb[$thumb_size])) { 
     502          $p = path::info($file->file); 
     503          $alpha = ($p['extension'] == 'png') || ($p['extension'] == 'PNG'); 
     504          $thumb = sprintf(($alpha ? $core->media->thumb_tp_alpha : $core->media->thumb_tp),$p['dirname'],$p['base'],'%s'); 
     505          $thumb_file = sprintf($thumb,$thumb_size); 
     506          $T = getimagesize($thumb_file); 
     507          $stats = stat($thumb_file); 
     508          echo 
     509          '<h3>'.__('Thumbnail details').'</h3>'. 
     510          '<ul>'. 
     511          '<li><strong>'.__('Image width:').'</strong> '.$T[0].' px</li>'. 
     512          '<li><strong>'.__('Image height:').'</strong> '.$T[1].' px</li>'. 
     513          '<li><strong>'.__('File size:').'</strong> '.files::size($stats[7]).'</li>'. 
     514          '<li><strong>'.__('File URL:').'</strong> <a href="'.$file->media_thumb[$thumb_size].'">'. 
     515               $file->media_thumb[$thumb_size].'</a></li>'. 
     516          '</ul>'; 
     517     } 
    500518} 
    501519 
     
    514532'<ul>'. 
    515533     '<li><strong>'.__('File owner:').'</strong> '.$file->media_user.'</li>'. 
    516      '<li><strong>'.__('File type:').'</strong> '.$file->type.'</li>'. 
     534     '<li><strong>'.__('File type:').'</strong> '.$file->type.'</li>'; 
     535if ($file->media_image) 
     536{ 
     537     $S = getimagesize($file->file); 
     538     echo 
     539     '<li><strong>'.__('Image width:').'</strong> '.$S[0].' px</li>'. 
     540     '<li><strong>'.__('Image height:').'</strong> '.$S[1].' px</li>'; 
     541     unset($S); 
     542} 
     543echo 
    517544     '<li><strong>'.__('File size:').'</strong> '.files::size($file->size).'</li>'. 
    518545     '<li><strong>'.__('File URL:').'</strong> <a href="'.$file->file_url.'">'.$file->file_url.'</a></li>'. 
  • admin/style/default.css

    r2796 r3101  
    18451845     } 
    18461846/* ------------------------------------------------------------------ media.php */ 
     1847span.media-file-mode { 
     1848     margin-right: 1em; 
     1849} 
     1850.media-file-mode a { 
     1851     border-bottom: none; 
     1852} 
     1853.media-file-mode img { 
     1854     margin-right: 1em; 
     1855} 
    18471856.media-item { 
    18481857     position: relative; 
     
    18801889     display: block; 
    18811890     } 
     1891a.media-flag { 
     1892     border-bottom: none; 
     1893} 
     1894.media-flag img { 
     1895     float: left; 
     1896     margin-right: .5em; 
     1897} 
    18821898.media-link { 
    18831899     font-size: 1.1em; 
     
    19271943     border-color: #eee; 
    19281944     } 
     1945tr.media-folder { 
     1946     background: transparent; 
     1947} 
    19291948.media-folder-up { 
    19301949     border-color: #fff; 
  • inc/admin/class.dc.favorites.php

    r2725 r3075  
    315315                    true, 
    316316                    $v['id'], 
    317                     $v['class'] 
     317                    $v['class'], 
     318                    true 
    318319               ); 
    319320          } 
  • inc/admin/class.dc.menu.php

    r2566 r3075  
    2222          $this->title = $title; 
    2323          $this->itemSpace = $itemSpace; 
     24          $this->pinned = array(); 
    2425          $this->items = array(); 
    2526     } 
    2627 
    27      public function addItem($title,$url,$img,$active,$show=true,$id=null,$class=null) 
     28     public function addItem($title,$url,$img,$active,$show=true,$id=null,$class=null,$pinned=false) 
    2829     { 
    2930          if($show) { 
    30                $this->items[] = $this->itemDef($title,$url,$img,$active,$id,$class); 
     31               $item = $this->itemDef($title,$url,$img,$active,$id,$class); 
     32               if ($pinned) { 
     33                    $this->pinned[] = $item; 
     34               } else { 
     35                    $this->items[$title] = $item; 
     36               } 
    3137          } 
    3238     } 
    3339 
    34      public function prependItem($title,$url,$img,$active,$show=true,$id=null,$class=null) 
     40     public function prependItem($title,$url,$img,$active,$show=true,$id=null,$class=null,$pinned=false) 
    3541     { 
    3642          if ($show) { 
    37                array_unshift($this->items,$this->itemDef($title,$url,$img,$active,$id,$class)); 
     43               $item = $this->itemDef($title,$url,$img,$active,$id,$class); 
     44               if ($pinned) { 
     45                    array_unshift($this->pinned,$item); 
     46               } else { 
     47                    $this->items[$title] = $item; 
     48               } 
    3849          } 
    3950     } 
     
    4152     public function draw() 
    4253     { 
    43           if (count($this->items) == 0) { 
     54          if (count($this->items) + count($this->pinned) == 0) { 
    4455               return ''; 
    4556          } 
     
    5061          '<ul>'."\n"; 
    5162 
    52           for ($i=0; $i<count($this->items); $i++) 
     63          // 1. Display pinned items (unsorted) 
     64          for ($i=0; $i<count($this->pinned); $i++) 
     65          { 
     66               if ($i+1 < count($this->pinned) && $this->itemSpace != '') { 
     67                    $res .= preg_replace('|</li>$|',$this->itemSpace.'</li>',$this->pinned[$i]); 
     68                    $res .= "\n"; 
     69               } else { 
     70                    $res .= $this->pinned[$i]."\n"; 
     71               } 
     72          } 
     73 
     74          // 2. Display unpinned itmes (sorted) 
     75          $i = 0; 
     76          dcUtils::lexicalKeySort($this->items); 
     77          foreach ($this->items as $title => $item) 
    5378          { 
    5479               if ($i+1 < count($this->items) && $this->itemSpace != '') { 
    55                     $res .= preg_replace('|</li>$|',$this->itemSpace.'</li>',$this->items[$i]); 
     80                    $res .= preg_replace('|</li>$|',$this->itemSpace.'</li>',$item); 
    5681                    $res .= "\n"; 
    5782               } else { 
    58                     $res .= $this->items[$i]."\n"; 
     83                    $res .= $item."\n"; 
    5984               } 
     85               $i++; 
    6086          } 
    6187 
  • inc/admin/lib.admincombos.php

    r3011 r3082  
    3737          while ($categories->fetch()) { 
    3838               $categories_combo[] = new formSelectOption ( 
    39                     str_repeat('&nbsp;&nbsp;',$categories->level-1).($categories->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($categories->cat_title).' ('.$categories->nb_post.')', 
     39                html::escapeHTML($categories->cat_title).' ('.$categories->nb_post.')', 
    4040                    ($use_url ? $categories->cat_url : $categories->cat_id), 
    4141                    ($categories->level-1 ? 'sub-option'.($categories->level-1) : '') 
     
    152152               $editors_combo[$v] = $v; 
    153153          } 
    154            
     154 
    155155          return $editors_combo; 
    156156     } 
  • inc/admin/lib.dc.page.php

    r3080 r3086  
    177177          } 
    178178 
    179           // Display breadcrumb (if given) before any error message 
     179          // Display breadcrumb (if given) before any error messages 
    180180          echo $breadcrumb; 
    181181 
    182           if ($core->error->flag()) { 
    183                echo 
    184                '<div class="error"><p><strong>'.(count($core->error->getErrors()) > 1 ? __('Errors:') : __('Error:')).'</strong></p>'. 
     182          // Display notices and errors 
     183          echo self::notices(); 
     184     } 
     185 
     186     public static function notices() 
     187     { 
     188          global $core; 
     189          static $error_displayed = false; 
     190          $res = ''; 
     191 
     192          // return error messages if any 
     193          if ($core->error->flag() && !$error_displayed) { 
     194               $res .= '<div class="error"><p><strong>'.(count($core->error->getErrors()) > 1 ? __('Errors:') : __('Error:')).'</strong></p>'. 
    185195               $core->error->toHTML(). 
    186196               '</div>'; 
    187           } 
    188  
    189           // Display notices 
    190           echo self::notices(); 
    191      } 
    192  
    193      public static function notices() 
    194      { 
     197               $error_displayed = true; 
     198          } 
     199 
    195200          // return notices if any 
    196           $res = ''; 
    197201          if (isset($_SESSION['notifications'])) { 
    198                $notifications = $_SESSION['notifications']; 
    199202               foreach ($_SESSION['notifications'] as $notification) { 
    200203                    $res .= self::getNotification($notification); 
     
    366369          echo $breadcrumb; 
    367370 
    368           if ($core->error->flag()) { 
    369                echo 
    370                '<div class="error" role="alert"><strong>'.__('Errors:').'</strong>'. 
    371                $core->error->toHTML(). 
    372                '</div>'; 
    373           } 
     371          // Display notices and errors 
     372          echo self::notices(); 
    374373     } 
    375374 
     
    545544     } 
    546545 
    547      public static function cssLoad($src, $media='screen') 
     546     public static function cssLoad($src,$media='screen',$v='') 
    548547     { 
    549548          $escaped_src = html::escapeHTML($src); 
    550549          if (!isset(self::$loaded_css[$escaped_src])) { 
    551550               self::$loaded_css[$escaped_src] = true; 
    552                $escaped_src = self::appendVersion($escaped_src); 
     551               $escaped_src = self::appendVersion($escaped_src,$v); 
    553552 
    554553               return '<link rel="stylesheet" href="'.$escaped_src.'" type="text/css" media="'.$media.'" />'."\n"; 
     
    556555     } 
    557556 
    558      public static function jsLoad($src) 
     557     public static function jsLoad($src,$v='') 
    559558     { 
    560559          $escaped_src = html::escapeHTML($src); 
    561560          if (!isset(self::$loaded_js[$escaped_src])) { 
    562561               self::$loaded_js[$escaped_src] = true; 
    563                $escaped_src = self::appendVersion($escaped_src); 
     562               $escaped_src = self::appendVersion($escaped_src,$v); 
    564563               return '<script type="text/javascript" src="'.$escaped_src.'"></script>'."\n"; 
    565564          } 
    566565     } 
    567566 
    568      private static function appendVersion($src) 
    569      { 
    570           if (strpos($src,'?')===false) { 
    571                $src .= '?v='; 
    572           } else { 
    573                $src .= '&v='; 
    574           } 
    575  
     567     private static function appendVersion($src,$v='') 
     568     { 
     569          $src .= (strpos($src,'?') === false ? '?' : '&').'v='; 
    576570          if (defined('DC_DEV') && DC_DEV === true) { 
    577571               $src .= md5(uniqid()); 
    578572          } else { 
    579                $src .= DC_VERSION; 
    580           } 
    581  
     573               $src .= ($v === '' ? DC_VERSION : $v); 
     574          } 
    582575          return $src; 
    583576     } 
  • inc/admin/lib.pager.php

    r3087 r3089  
    180180               } 
    181181 
    182                $html_block .= '<tr>'. 
    183                '<th colspan="2" class="first">'.__('Title').'</th>'. 
    184                '<th scope="col">'.__('Date').'</th>'. 
    185                '<th scope="col">'.__('Category').'</th>'. 
    186                '<th scope="col">'.__('Author').'</th>'. 
    187                '<th scope="col"><img src="images/comments.png" alt="" title="'.__('Comments').'" /><span class="hidden">'.__('Comments').'</span></th>'. 
    188                '<th scope="col"><img src="images/trackbacks.png" alt="" title="'.__('Trackbacks').'" /><span class="hidden">'.__('Trackbacks').'</span></th>'. 
    189                '<th scope="col">'.__('Status').'</th>'. 
    190                '</tr>%s</table></div>'; 
    191  
     182               $cols = array( 
     183                    'title' =>               '<th colspan="2" class="first">'.__('Title').'</th>', 
     184                    'date' =>           '<th scope="col">'.__('Date').'</th>', 
     185                    'category' =>       '<th scope="col">'.__('Category').'</th>', 
     186                    'author' =>              '<th scope="col">'.__('Author').'</th>', 
     187                    'comments' =>       '<th scope="col"><img src="images/comments.png" alt="" title="'.__('Comments'). 
     188                                             '" /><span class="hidden">'.__('Comments').'</span></th>', 
     189                    'trackbacks' =>          '<th scope="col"><img src="images/trackbacks.png" alt="" title="'.__('Trackbacks'). 
     190                                             '" /><span class="hidden">'.__('Trackbacks').'</span></th>', 
     191                    'status' =>              '<th scope="col">'.__('Status').'</th>' 
     192               ); 
     193               $cols = new ArrayObject($cols); 
     194               $this->core->callBehavior('adminPostListHeader',$this->core,$this->rs,$cols); 
     195 
     196               $html_block .= '<tr>'.implode(iterator_to_array($cols)).'</tr>%s</table></div>'; 
    192197               if ($enclose_block) { 
    193198                    $html_block = sprintf($enclose_block,$html_block); 
     
    262267          ' id="p'.$this->rs->post_id.'">'; 
    263268 
    264           $res .= 
    265           '<td class="nowrap">'. 
    266           form::checkbox(array('entries[]'),$this->rs->post_id,$checked,'','',!$this->rs->isEditable()).'</td>'. 
    267           '<td class="maximal" scope="row"><a href="'.$this->core->getPostAdminURL($this->rs->post_type,$this->rs->post_id).'">'. 
    268           html::escapeHTML($this->rs->post_title).'</a></td>'. 
    269           '<td class="nowrap count">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$this->rs->post_dt).'</td>'. 
    270           '<td class="nowrap">'.$cat_title.'</td>'. 
    271           '<td class="nowrap">'.html::escapeHTML($this->rs->user_id).'</td>'. 
    272           '<td class="nowrap count">'.$this->rs->nb_comment.'</td>'. 
    273           '<td class="nowrap count">'.$this->rs->nb_trackback.'</td>'. 
    274           '<td class="nowrap status">'.$img_status.' '.$selected.' '.$protected.' '.$attach.'</td>'. 
    275           '</tr>'; 
     269          $cols = array( 
     270               'check' =>               '<td class="nowrap">'. 
     271                                        form::checkbox(array('entries[]'),$this->rs->post_id,$checked,'','',!$this->rs->isEditable()). 
     272                                        '</td>', 
     273               'title' =>               '<td class="maximal" scope="row"><a href="'. 
     274                                        $this->core->getPostAdminURL($this->rs->post_type,$this->rs->post_id).'">'. 
     275                                        html::escapeHTML($this->rs->post_title).'</a></td>', 
     276               'date' =>           '<td class="nowrap count">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$this->rs->post_dt).'</td>', 
     277               'category' =>       '<td class="nowrap">'.$cat_title.'</td>', 
     278               'author' =>              '<td class="nowrap">'.html::escapeHTML($this->rs->user_id).'</td>', 
     279               'comments' =>       '<td class="nowrap count">'.$this->rs->nb_comment.'</td>', 
     280               'trackbacks' =>          '<td class="nowrap count">'.$this->rs->nb_trackback.'</td>', 
     281               'status' =>              '<td class="nowrap status">'.$img_status.' '.$selected.' '.$protected.' '.$attach.'</td>' 
     282          ); 
     283          $cols = new ArrayObject($cols); 
     284          $this->core->callBehavior('adminPostListValue',$this->core,$this->rs,$cols); 
     285 
     286          $res .= implode(iterator_to_array($cols)); 
     287          $res .= '</tr>'; 
    276288 
    277289          return $res; 
     
    293305               $html_block = 
    294306               '<div class="table-outer clear">'. 
    295                '<table><caption class="hidden">'.__('Entries list').'</caption><tr>'. 
    296                '<th scope="col">'.__('Title').'</th>'. 
    297                '<th scope="col">'.__('Date').'</th>'. 
    298                '<th scope="col">'.__('Author').'</th>'. 
    299                '<th scope="col">'.__('Status').'</th>'. 
    300                '</tr>%s</table></div>'; 
    301  
     307               '<table><caption class="hidden">'.__('Entries list').'</caption><tr>'; 
     308 
     309               $cols = array( 
     310                    'title' =>          '<th scope="col">'.__('Title').'</th>', 
     311                    'date' =>      '<th scope="col">'.__('Date').'</th>', 
     312                    'author' =>         '<th scope="col">'.__('Author').'</th>', 
     313                    'status' =>         '<th scope="col">'.__('Status').'</th>' 
     314               ); 
     315 
     316               $cols = new ArrayObject($cols); 
     317               $this->core->callBehavior('adminPostMiniListHeader',$this->core,$this->rs,$cols); 
     318 
     319               $html_block .= '<tr>'.implode(iterator_to_array($cols)).'</tr>%s</table></div>'; 
    302320               if ($enclose_block) { 
    303321                    $html_block = sprintf($enclose_block,$html_block); 
     
    359377          ' id="p'.$this->rs->post_id.'">'; 
    360378 
    361           $res .= 
    362           '<td scope="row" class="maximal"><a href="'.$this->core->getPostAdminURL($this->rs->post_type,$this->rs->post_id).'" '. 
    363           'title="'.html::escapeHTML($this->rs->getURL()).'">'. 
    364           html::escapeHTML($this->rs->post_title).'</a></td>'. 
    365           '<td class="nowrap count">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$this->rs->post_dt).'</td>'. 
    366           '<td class="nowrap">'.html::escapeHTML($this->rs->user_id).'</td>'. 
    367           '<td class="nowrap status">'.$img_status.' '.$selected.' '.$protected.' '.$attach.'</td>'. 
    368           '</tr>'; 
     379          $cols = array( 
     380               'title' =>          '<td scope="row" class="maximal"><a href="'. 
     381                                   $this->core->getPostAdminURL($this->rs->post_type,$this->rs->post_id).'" '. 
     382                                   'title="'.html::escapeHTML($this->rs->getURL()).'">'. 
     383                                   html::escapeHTML($this->rs->post_title).'</a></td>', 
     384               'date' =>      '<td class="nowrap count">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$this->rs->post_dt).'</td>', 
     385               'author' =>         '<td class="nowrap">'.html::escapeHTML($this->rs->user_id).'</td>', 
     386               'status' =>         '<td class="nowrap status">'.$img_status.' '.$selected.' '.$protected.' '.$attach.'</td>' 
     387          ); 
     388 
     389          $cols = new ArrayObject($cols); 
     390          $this->core->callBehavior('adminPostMiniListValue',$this->core,$this->rs,$cols); 
     391 
     392          $res .= implode(iterator_to_array($cols)); 
     393          $res .= '</tr>'; 
    369394 
    370395          return $res; 
     
    422447               } 
    423448 
    424                $html_block .= '<tr>'. 
    425                '<th colspan="2" scope="col" abbr="comm" class="first">'.__('Type').'</th>'. 
    426                '<th scope="col">'.__('Author').'</th>'. 
    427                '<th scope="col">'.__('Date').'</th>'. 
    428                '<th scope="col" class="txt-center">'.__('Status').'</th>'; 
     449               $cols = array( 
     450                    'type' => '<th colspan="2" scope="col" abbr="comm" class="first">'.__('Type').'</th>', 
     451                    'author' =>    '<th scope="col">'.__('Author').'</th>', 
     452                    'date' => '<th scope="col">'.__('Date').'</th>', 
     453                    'status' =>    '<th scope="col" class="txt-center">'.__('Status').'</th>' 
     454               ); 
    429455               if ($spam) { 
    430                     $html_block .= 
    431                     '<th scope="col">'.__('IP').'</th>'. 
    432                     '<th scope="col">'.__('Spam filter').'</th>'; 
    433                } 
    434                $html_block .= 
    435                '<th scope="col" abbr="entry">'.__('Entry').'</th>'. 
    436                '</tr>%s</table></div>'; 
     456                    $cols['ip'] = '<th scope="col">'.__('IP').'</th>'; 
     457                    $cols['spam_filter'] = '<th scope="col">'.__('Spam filter').'</th>'; 
     458               } 
     459               $cols['entry'] = '<th scope="col" abbr="entry">'.__('Entry').'</th>'; 
     460 
     461               $cols = new ArrayObject($cols); 
     462               $this->core->callBehavior('adminCommentListHeader',$this->core,$this->rs,$cols); 
     463 
     464               $html_block .= '<tr>'.implode(iterator_to_array($cols)).'</tr>%s</table></div>'; 
    437465 
    438466               if ($enclose_block) { 
     
    505533          ' id="c'.$this->rs->comment_id.'">'; 
    506534 
    507           $res .= 
    508           '<td class="nowrap">'. 
    509           form::checkbox(array('comments[]'),$this->rs->comment_id,$checked,'','',0).'</td>'. 
    510           '<td class="nowrap" abbr="'.__('Type and author').'" scope="row">'. 
    511                '<a href="'.$comment_url.'" title="'.$comment_title.'">'. 
    512                '<img src="images/edit-mini.png" alt="'.__('Edit').'"/> '. 
    513                ($this->rs->comment_trackback ? __('trackback') : __('comment')).' '.'</a></td>'. 
    514           '<td class="nowrap maximal"><a href="'.$author_url.'">'.html::escapeHTML($this->rs->comment_author).'</a></td>'. 
    515           '<td class="nowrap count">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$this->rs->comment_dt).'</td>'. 
    516           '<td class="nowrap status txt-center">'.$img_status.'</td>'; 
     535          $cols = array( 
     536               'check' =>     '<td class="nowrap">'. 
     537                              form::checkbox(array('comments[]'),$this->rs->comment_id,$checked,'','',0).'</td>', 
     538               'type' => '<td class="nowrap" abbr="'.__('Type and author').'" scope="row">'. 
     539                              '<a href="'.$comment_url.'" title="'.$comment_title.'">'. 
     540                              '<img src="images/edit-mini.png" alt="'.__('Edit').'"/> '. 
     541                              ($this->rs->comment_trackback ? __('trackback') : __('comment')).' '.'</a></td>', 
     542               'author' =>    '<td class="nowrap maximal"><a href="'.$author_url.'">'. 
     543                              html::escapeHTML($this->rs->comment_author).'</a></td>', 
     544               'date'    =>   '<td class="nowrap count">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$this->rs->comment_dt).'</td>', 
     545               'status' =>    '<td class="nowrap status txt-center">'.$img_status.'</td>' 
     546          ); 
     547 
    517548          if ($spam) { 
    518549               $filter_name = ''; 
     
    524555                    } 
    525556               } 
    526                $res .= 
    527                '<td class="nowrap"><a href="'.$core->adminurl->get("admin.comments",array('ip' => $this->rs->comment_ip)).'">'.$this->rs->comment_ip.'</a></td>'. 
    528                '<td class="nowrap">'.$filter_name.'</td>'; 
    529           } 
    530           $res .= 
    531           '<td class="nowrap discrete"><a href="'.$post_url.'">'. 
    532           $post_title.'</a>'. 
    533           ($this->rs->post_type != 'post' ? ' ('.html::escapeHTML($this->rs->post_type).')' : '').'</td>'; 
    534  
     557               $cols['ip'] = '<td class="nowrap"><a href="'. 
     558                    $core->adminurl->get("admin.comments",array('ip' => $this->rs->comment_ip)).'">'. 
     559                    $this->rs->comment_ip.'</a></td>'; 
     560               $cols['spam_filter'] = '<td class="nowrap">'.$filter_name.'</td>'; 
     561          } 
     562          $cols['entry'] = '<td class="nowrap discrete"><a href="'.$post_url.'">'.$post_title.'</a>'. 
     563               ($this->rs->post_type != 'post' ? ' ('.html::escapeHTML($this->rs->post_type).')' : '').'</td>'; 
     564 
     565          $cols = new ArrayObject($cols); 
     566          $this->core->callBehavior('adminCommentListValue',$this->core,$this->rs,$cols); 
     567 
     568          $res .= implode(iterator_to_array($cols)); 
    535569          $res .= '</tr>'; 
    536570 
     
    565599               } 
    566600 
    567                $html_block .= '<tr>'. 
    568                '<th colspan="2" scope="col" class="first">'.__('Username').'</th>'. 
    569                '<th scope="col">'.__('First Name').'</th>'. 
    570                '<th scope="col">'.__('Last Name').'</th>'. 
    571                '<th scope="col">'.__('Display name').'</th>'. 
    572                '<th scope="col" class="nowrap">'.__('Entries (all types)').'</th>'. 
    573                '</tr>%s</table></div>'; 
    574  
     601               $cols = array( 
     602                    'username' =>       '<th colspan="2" scope="col" class="first">'.__('Username').'</th>', 
     603                    'first_name' =>          '<th scope="col">'.__('First Name').'</th>', 
     604                    'last_name' =>      '<th scope="col">'.__('Last Name').'</th>', 
     605                    'display_name' =>   '<th scope="col">'.__('Display name').'</th>', 
     606                    'entries' =>        '<th scope="col" class="nowrap">'.__('Entries (all types)').'</th>' 
     607               ); 
     608 
     609               $cols = new ArrayObject($cols); 
     610               $this->core->callBehavior('adminUserListHeader',$this->core,$this->rs,$cols); 
     611 
     612               $html_block .= '<tr>'.implode(iterator_to_array($cols)).'</tr>%s</table></div>'; 
    575613               if ($enclose_block) { 
    576614                    $html_block = sprintf($enclose_block,$html_block); 
     
    607645               $img_status = sprintf($img,__('superadmin'),'superadmin.png'); 
    608646          } 
    609           return 
    610           '<tr class="line">'. 
    611           '<td class="nowrap">'.form::hidden(array('nb_post[]'),(integer) $this->rs->nb_post). 
    612           form::checkbox(array('users[]'),$this->rs->user_id).'</td>'. 
    613           '<td class="maximal" scope="row"><a href="'.$this->core->adminurl->get('admin.user',array('id' => $this->rs->user_id)).'">'. 
    614           $this->rs->user_id.'</a>&nbsp;'.$img_status.'</td>'. 
    615           '<td class="nowrap">'.html::escapeHTML($this->rs->user_firstname).'</td>'. 
    616           '<td class="nowrap">'.html::escapeHTML($this->rs->user_name).'</td>'. 
    617           '<td class="nowrap">'.html::escapeHTML($this->rs->user_displayname).'</td>'. 
    618           '<td class="nowrap count"><a href="'.$this->core->adminurl->get('admin.posts',array('user_id' => $this->rs->user_id)).'">'. 
    619           $this->rs->nb_post.'</a></td>'. 
    620           '</tr>'; 
     647 
     648          $res = '<tr class="line">'; 
     649 
     650          $cols = array( 
     651               'check' =>               '<td class="nowrap">'.form::hidden(array('nb_post[]'),(integer) $this->rs->nb_post). 
     652                                        form::checkbox(array('users[]'),$this->rs->user_id).'</td>', 
     653               'username' =>       '<td class="maximal" scope="row"><a href="'. 
     654                                        $this->core->adminurl->get('admin.user',array('id' => $this->rs->user_id)).'">'. 
     655                                        $this->rs->user_id.'</a>&nbsp;'.$img_status.'</td>', 
     656               'first_name' =>          '<td class="nowrap">'.html::escapeHTML($this->rs->user_firstname).'</td>', 
     657               'last_name' =>      '<td class="nowrap">'.html::escapeHTML($this->rs->user_name).'</td>', 
     658               'display_name' =>   '<td class="nowrap">'.html::escapeHTML($this->rs->user_displayname).'</td>', 
     659               'entries' =>        '<td class="nowrap count"><a href="'. 
     660                                        $this->core->adminurl->get('admin.posts',array('user_id' => $this->rs->user_id)).'">'. 
     661                                        $this->rs->nb_post.'</a></td>' 
     662          ); 
     663 
     664          $cols = new ArrayObject($cols); 
     665          $this->core->callBehavior('adminUserListValue',$this->core,$this->rs,$cols); 
     666 
     667          $res .= implode(iterator_to_array($cols)); 
     668          $res .= '</tr>'; 
     669 
     670          return $res; 
    621671     } 
    622672} 
  • inc/admin/prepend.php

    r3059 r3075  
    6969 
    7070     $url = $core->adminurl->get($adminurl); 
    71      $_menu[$section]->prependItem($desc,$url,$icon,preg_match('/'.preg_quote($url).'(\?.*)?$/',$_SERVER['REQUEST_URI']),$perm); 
     71     $_menu[$section]->prependItem($desc,$url,$icon, 
     72          preg_match('/'.preg_quote($url).'(\?.*)?$/',$_SERVER['REQUEST_URI']),$perm,null,null,true); 
    7273} 
    7374 
  • inc/core/class.dc.error.php

    r2566 r3074  
    3030     /** @var string HTML error item pattern */ 
    3131     protected $html_item = "<li>%s</li>\n"; 
    32  
    33      /** 
    34      * Object constructor. 
    35      */ 
    36      public function __construct() 
    37      { 
    38           $this->code = 0; 
    39           $this->msg = ''; 
    40      } 
    4132 
    4233     /** 
  • inc/core/class.dc.media.php

    r2768 r3099  
    368368                    return strcasecmp($a->basename,$b->basename); 
    369369          } 
    370  
    371370     } 
    372371 
     
    520519 
    521520     /** 
     521     Search into media db (only). 
     522 
     523     @param    query          <b>string</b>       Search query 
     524     @return boolean     true or false if nothing found 
     525     */ 
     526     public function searchMedia($query) 
     527     { 
     528          if ($query == '') { 
     529               return false; 
     530          } 
     531 
     532          $strReq = 
     533          'SELECT media_file, media_id, media_path, media_title, media_meta, media_dt, '. 
     534          'media_creadt, media_upddt, media_private, user_id '. 
     535          'FROM '.$this->table.' '. 
     536          "WHERE media_path = '".$this->path."' ". 
     537          "AND (media_title LIKE '%".$this->con->escape($query)."%' ". 
     538          "    OR media_file LIKE '%".$this->con->escape($query)."%' ". 
     539          "    OR media_meta LIKE '<Description>%".$this->con->escape($query)."%</Description>')"; 
     540 
     541          if (!$this->core->auth->check('media_admin',$this->core->blog->id)) 
     542          { 
     543               $strReq .= 'AND (media_private <> 1 '; 
     544 
     545               if ($this->core->auth->userID()) { 
     546                    $strReq .= "OR user_id = '".$this->con->escape($this->core->auth->userID())."'"; 
     547               } 
     548               $strReq .= ') '; 
     549          } 
     550 
     551          $rs = $this->con->select($strReq); 
     552 
     553          $this->dir = array('dirs' => array(),'files' => array()); 
     554          $f_res = array(); 
     555          while ($rs->fetch()) 
     556          { 
     557               $fr = $this->fileRecord($rs); 
     558               if ($fr) { 
     559                    $f_res[] = $fr; 
     560               } 
     561          } 
     562          $this->dir['files'] = $f_res; 
     563 
     564          try { 
     565               usort($this->dir['files'],array($this,'sortFileHandler')); 
     566          } catch (Exception $e) {} 
     567 
     568          return (count($f_res) > 0 ? true : false); 
     569     } 
     570 
     571     /** 
    522572     Returns media items attached to a blog post. Result is an array containing 
    523573     fileItems objects. 
  • inc/prepend.php

    r3097 r3098  
    140140# Constants 
    141141define('DC_ROOT',path::real(dirname(__FILE__).'/..')); 
    142 define('DC_VERSION','2.8.2'); 
     142define('DC_VERSION','2.9-dev'); 
    143143define('DC_DIGESTS',dirname(__FILE__).'/digests'); 
    144144define('DC_L10N_ROOT',dirname(__FILE__).'/../locales'); 
  • locales/fr/main.po

    r3047 r3101  
    14081408 
    14091409#, php-format 
    1410 msgid "Choose a file to attach to entry %s by clicking on %s." 
    1411 msgstr "Choisissez un fichier à attacher au billet %s en cliquant sur %s." 
     1410msgid "Choose a file to attach to entry %s by clicking on %s" 
     1411msgstr "Choisissez un fichier à attacher au billet %s en cliquant sur %s" 
    14121412 
    14131413msgid "Attach this file to entry" 
     
    14151415 
    14161416#, php-format 
    1417 msgid "Choose a file to insert into entry by clicking on %s." 
    1418 msgstr "Choisissez un fichier à insérer dans le billet en cliquant sur %s." 
     1417msgid "Choose a file to insert into entry by clicking on %s" 
     1418msgstr "Choisissez un fichier à insérer dans le billet en cliquant sur %s" 
     1419 
     1420msgid "upload a new file" 
     1421msgstr "envoyez un nouveau fichier" 
    14191422 
    14201423msgid "Remove selected medias" 
     
    14241427msgstr "Aucun fichier." 
    14251428 
     1429msgid "Grid display mode" 
     1430msgstr "Afficher sous forme de grille" 
     1431 
     1432msgid "List display mode" 
     1433msgstr "Afficher sous forme de liste" 
     1434 
    14261435msgid "Sort files:" 
    14271436msgstr "Trier les fichiers :" 
     
    14841493msgid "Current settings for medias and images are defined in %s" 
    14851494msgstr "Les réglages actuels pour les médias et les images sont définis dans les %s" 
     1495 
     1496#, php-format 
     1497msgid "%s file found" 
     1498msgid_plural "%s files found" 
     1499msgstr[0] "%s fichier trouvé" 
     1500msgstr[1] "%s fichiers trouvés" 
     1501 
     1502msgid "Will search into media filename (including path), title and description" 
     1503msgstr "Recherche parmi les noms des fichiers (incluant leur chemin), les titres et descriptions" 
    14861504 
    14871505msgid "Blog parameters" 
     
    36723690msgstr "Format :" 
    36733691 
     3692msgid "Thumbnail details" 
     3693msgstr "Détails de la miniature" 
     3694 
     3695msgid "Image width:" 
     3696msgstr "Largeur de l'image :" 
     3697 
     3698msgid "Image height:" 
     3699msgstr "Hauteur de l'image :" 
     3700 
    36743701#~ msgid "visual" 
    36753702#~ msgstr "visuel" 
  • plugins/aboutConfig/index.php

    r2824 r3091  
    133133'<thead>'. 
    134134'<tr>'."\n". 
    135 '  <th class="nowrap">Setting ID</th>'."\n". 
     135'  <th class="nowrap">'.__('Setting ID').'</th>'."\n". 
    136136'  <th>'.__('Value').'</th>'."\n". 
    137137'  <th>'.__('Type').'</th>'."\n". 
  • plugins/dcCKEditor/_define.php

    r3056 r3090  
    1616     /* Description*/         "dotclear CKEditor integration", 
    1717     /* Author */             "dotclear Team", 
    18      /* Version */            "1.0.3", 
     18     /* Version */            "1.1.0", 
    1919     array( 
    2020          'permissions' =>    'usage,contentadmin', 
  • plugins/dcCKEditor/_install.php

    r3052 r3090  
    2525$settings->dcckeditor->put('list_buttons', true, 'boolean', 'Add list buttons?', false, true); 
    2626$settings->dcckeditor->put('textcolor_button', false, 'boolean', 'Add text color button?', false, true); 
     27$settings->dcckeditor->put('background_textcolor_button', false, 'boolean', 'Add background text color button?', false, true); 
    2728$settings->dcckeditor->put('cancollapse_button', false, 'boolean', 'Add collapse button?', false, true); 
    2829$settings->dcckeditor->put('format_select', true, 'boolean', 'Add format selection?', false, true); 
  • plugins/dcCKEditor/_post_config.php

    r3056 r3090  
    9696     CKEDITOR.plugins.addExternal('media',dotclear.dcckeditor_plugin_url+'/js/ckeditor-plugins/media/'); 
    9797     CKEDITOR.plugins.addExternal('img',dotclear.dcckeditor_plugin_url+'/js/ckeditor-plugins/img/'); 
     98     <?php if (!empty($dcckeditor_textcolor_button) || !empty($dcckeditor_background_textcolor_button)):?> 
     99     // button add "More Colors..." can be added if colordialog plugin is enabled 
     100     CKEDITOR.config.colorButton_enableMore = true; 
     101     <?php endif;?> 
    98102 
    99103<?php if (!empty($extraPlugins) && count($extraPlugins)>0) { 
     
    120124          // format tags 
    121125<?php if (!empty($dcckeditor_format_tags)):?> 
    122         format_tags: '<?php echo $dcckeditor_format_tags;?>', 
     126          format_tags: '<?php echo $dcckeditor_format_tags;?>', 
    123127<?php else:?> 
    124128          format_tags: 'p;h1;h2;h3;h4;h5;h6;pre;address', 
     
    178182                         'Source' 
    179183<?php if (!empty($dcckeditor_textcolor_button)):?> 
    180                 ,'TextColor' 
     184                         ,'TextColor' 
     185<?php endif;?> 
     186<?php if (!empty($dcckeditor_background_textcolor_button)):?> 
     187                         ,'BGColor' 
    181188<?php endif;?> 
    182189                    ] 
    183190               }, 
    184             { 
    185                 name: 'special', 
    186                 items: [ 
    187                     'Maximize' 
    188                 ] 
    189             }, 
     191               { 
     192                    name: 'special', 
     193                    items: [ 
     194                         'Maximize' 
     195                    ] 
     196               }, 
    190197               <?php // add extra buttons comming from dotclear plugins 
    191198               if (!empty($extraPlugins) && count($extraPlugins)>0) { 
  • plugins/dcCKEditor/inc/_config.php

    r3052 r3090  
    3030               $dcckeditor_textcolor_button = (empty($_POST['dcckeditor_textcolor_button']))?false:true; 
    3131               $core->blog->settings->dcckeditor->put('textcolor_button', $dcckeditor_textcolor_button, 'boolean'); 
     32 
     33               $dcckeditor_background_textcolor_button = (empty($_POST['dcckeditor_background_textcolor_button']))?false:true; 
     34               $core->blog->settings->dcckeditor->put('background_textcolor_button', $dcckeditor_background_textcolor_button, 'boolean'); 
    3235 
    3336               $dcckeditor_cancollapse_button = (empty($_POST['dcckeditor_cancollapse_button']))?false:true; 
  • plugins/dcCKEditor/index.php

    r3052 r3090  
    2020$dcckeditor_list_buttons = $core->blog->settings->dcckeditor->list_buttons; 
    2121$dcckeditor_textcolor_button = $core->blog->settings->dcckeditor->textcolor_button; 
     22$dcckeditor_background_textcolor_button = $core->blog->settings->dcckeditor->background_textcolor_button; 
    2223$dcckeditor_cancollapse_button = $core->blog->settings->dcckeditor->cancollapse_button; 
    2324$dcckeditor_format_select = $core->blog->settings->dcckeditor->format_select; 
  • plugins/dcCKEditor/locales/fr/main.po

    r3055 r3090  
    5050msgstr "Ajouter le bouton pour changer la couleur du texte" 
    5151 
     52#: tpl/index.tpl:37 
     53msgid "Add background text color button" 
     54msgstr "Ajouter le bouton pour changer la couleur de fond du texte" 
     55 
    5256#: tpl/index.tpl:41 
    5357msgid "Add collapse button" 
  • plugins/dcCKEditor/tpl/index.tpl

    r3052 r3090  
    3333       <?php echo form::checkbox('dcckeditor_textcolor_button', 1, $dcckeditor_textcolor_button); ?> 
    3434       <label class="classic" for="dcckeditor_textcolor_button">&nbsp;<?php echo __('Add text color button');?></label> 
     35     </p> 
     36     <p> 
     37       <?php echo form::checkbox('dcckeditor_background_textcolor_button', 1, $dcckeditor_background_textcolor_button); ?> 
     38       <label class="classic" for="dcckeditor_background_textcolor_button">&nbsp;<?php echo __('Add background text color button');?></label> 
    3539     </p> 
    3640     <p> 
  • plugins/maintenance/index.php

    r2849 r3073  
    158158               html::escapeHTML($task->name())=> '' 
    159159          ) 
    160      ); 
     160     ).dcPage::notices(); 
    161161 
    162162     // content 
     
    193193               __('Maintenance') => '' 
    194194          ) 
    195      ); 
     195     ).dcPage::notices(); 
    196196 
    197197     // Simple task (with only a button to start it) 
  • plugins/pages/class.listpage.php

    r2566 r3089  
    3232               $html_block = 
    3333               '<div class="table-outer">'. 
    34                '<table class="maximal dragable"><thead><tr>'. 
    35                '<th colspan="3" scope="col" class="first">'.__('Title').'</th>'. 
    36                '<th scope="col">'.__('Date').'</th>'. 
    37                '<th scope="col">'.__('Author').'</th>'. 
    38                '<th scope="col"><img src="images/comments.png" alt="" title="'.__('Comments').'" /><span class="hidden">'.__('Comments').'</span></th>'. 
    39                '<th scope="col"><img src="images/trackbacks.png" alt="" title="'.__('Trackbacks').'" /><span class="hidden">'.__('Trackbacks').'</span></th>'. 
    40                '<th scope="col">'.__('Status').'</th>'. 
    41                '</tr></thead><tbody id="pageslist">%s</tbody></table></div>'; 
     34               '<table class="maximal dragable"><thead><tr>'; 
     35 
     36               $cols = array( 
     37                    'title' =>               '<th colspan="3" scope="col" class="first">'.__('Title').'</th>', 
     38                    'date' =>           '<th scope="col">'.__('Date').'</th>', 
     39                    'author' =>              '<th scope="col">'.__('Author').'</th>', 
     40                    'comments' =>       '<th scope="col"><img src="images/comments.png" alt="" title="'.__('Comments'). 
     41                                             '" /><span class="hidden">'.__('Comments').'</span></th>', 
     42                    'trackbacks' =>          '<th scope="col"><img src="images/trackbacks.png" alt="" title="'.__('Trackbacks'). 
     43                                             '" /><span class="hidden">'.__('Trackbacks').'</span></th>', 
     44                    'status' =>              '<th scope="col">'.__('Status').'</th>' 
     45               ); 
     46 
     47               $cols = new ArrayObject($cols); 
     48               $this->core->callBehavior('adminPagesListHeader',$this->core,$this->rs,$cols); 
     49 
     50               $html_block .= '<tr>'.implode(iterator_to_array($cols)). 
     51                    '</tr></thead><tbody id="pageslist">%s</tbody></table></div>'; 
    4252 
    4353               if ($enclose_block) { 
     
    102112          ' id="p'.$this->rs->post_id.'">'; 
    103113 
    104           $res .= 
    105           '<td class="nowrap handle minimal">'.form::field(array('order['.$this->rs->post_id.']'),2,3,$count+1,'position','',false,'title="'.sprintf(__('position of %s'),html::escapeHTML($this->rs->post_title)).'"').'</td>'. 
    106           '<td class="nowrap">'. 
    107           form::checkbox(array('entries[]'),$this->rs->post_id,$checked,'','',!$this->rs->isEditable(),'title="'.__('Select this page').'"').'</td>'. 
    108           '<td class="maximal" scope="row"><a href="'.$this->core->getPostAdminURL($this->rs->post_type,$this->rs->post_id).'">'. 
    109           html::escapeHTML($this->rs->post_title).'</a></td>'. 
    110           '<td class="nowrap">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$this->rs->post_dt).'</td>'. 
    111           '<td class="nowrap">'.$this->rs->user_id.'</td>'. 
    112           '<td class="nowrap count">'.$this->rs->nb_comment.'</td>'. 
    113           '<td class="nowrap count">'.$this->rs->nb_trackback.'</td>'. 
    114           '<td class="nowrap status">'.$img_status.' '.$selected.' '.$protected.' '.$attach.'</td>'. 
    115           '</tr>'; 
     114          $cols = array( 
     115               'position' =>       '<td class="nowrap handle minimal">'. 
     116                                        form::field(array('order['.$this->rs->post_id.']'),2,3,$count+1,'position','',false,'title="'.sprintf(__('position of %s'),html::escapeHTML($this->rs->post_title)).'"').'</td>', 
     117               'check' =>               '<td class="nowrap">'. 
     118                                        form::checkbox(array('entries[]'),$this->rs->post_id,$checked,'','',!$this->rs->isEditable(),'title="'.__('Select this page').'"').'</td>', 
     119               'title' =>               '<td class="maximal" scope="row"><a href="'. 
     120                                        $this->core->getPostAdminURL($this->rs->post_type,$this->rs->post_id).'">'. 
     121                                        html::escapeHTML($this->rs->post_title).'</a></td>', 
     122               'date' =>           '<td class="nowrap">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$this->rs->post_dt).'</td>', 
     123               'author' =>              '<td class="nowrap">'.$this->rs->user_id.'</td>', 
     124               'comments' =>       '<td class="nowrap count">'.$this->rs->nb_comment.'</td>', 
     125               'trackbacks' =>          '<td class="nowrap count">'.$this->rs->nb_trackback.'</td>', 
     126               'status' =>              '<td class="nowrap status">'.$img_status.' '.$selected.' '.$protected.' '.$attach.'</td>' 
     127          ); 
     128 
     129          $cols = new ArrayObject($cols); 
     130          $this->core->callBehavior('adminPagesListValue',$this->core,$this->rs,$cols); 
     131 
     132          $res .= implode(iterator_to_array($cols)); 
     133          $res .= '</tr>'; 
    116134 
    117135          return $res; 
  • plugins/userPref/index.php

    r2824 r3091  
    132132'<thead>'. 
    133133'<tr>'."\n". 
    134 '  <th class="nowrap">Setting ID</th>'."\n". 
     134'  <th class="nowrap">'.__('Setting ID').'</th>'."\n". 
    135135'  <th>'.__('Value').'</th>'."\n". 
    136136'  <th>'.__('Type').'</th>'."\n". 
Note: See TracChangeset for help on using the changeset viewer.

Sites map