Dotclear


Ignore:
Timestamp:
02/27/13 11:48:32 (12 years ago)
Author:
JcDenis
Branch:
sexy
Parents:
880:02c78f56f430 (diff), 1105:ce855d61f9ce (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge with default branch in 2.5-RC

Location:
inc/admin
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • inc/admin/lib.dc.page.php

    r873 r1107  
    5757          { 
    5858               $blog_box = 
    59                __('Blog:').' <strong title="'.html::escapeHTML($core->blog->url).'">'. 
     59               '<p>'.__('Blog:').' <strong title="'.html::escapeHTML($core->blog->url).'">'. 
    6060               html::escapeHTML($core->blog->name).'</strong>'; 
    6161                
     
    6363                    $blog_box .= ' - <a href="blogs.php">'.__('Change blog').'</a>'; 
    6464               } 
     65               $blog_box .= '</p>'; 
    6566          } 
    6667          else 
     
    7273               } 
    7374               $blog_box = 
    74                '<label for="switchblog" class="classic">'. 
     75               '<p><label for="switchblog" class="classic">'. 
    7576               __('Blogs:').' '. 
    7677               $core->formNonce(). 
    7778               form::combo('switchblog',$blogs,$core->blog->id). 
    78                '</label>'. 
    79                '<noscript><div><input type="submit" value="'.__('ok').'" /></div></noscript>'; 
     79               '</label></p>'. 
     80               '<noscript><p><input type="submit" value="'.__('ok').'" /></p></noscript>'; 
    8081          } 
    8182           
     
    132133          '<form action="index.php" method="post">'. 
    133134          $blog_box. 
    134           '<a href="'.$core->blog->url.'" onclick="window.open(this.href);return false;" title="'.__('Go to site').' ('.__('new window').')'.'">'.__('Go to site').' <img src="images/outgoing.png" alt="" /></a>'. 
    135           '</form>'. 
     135          '<p><a href="'.$core->blog->url.'" onclick="window.open(this.href);return false;" title="'.__('Go to site').' ('.__('new window').')'.'">'.__('Go to site').' <img src="images/outgoing.png" alt="" /></a>'. 
     136          '</p></form>'. 
    136137          '</div>'. 
    137138          '<div id="info-box2">'. 
     
    159160          if ($core->error->flag()) { 
    160161               echo 
    161                '<div class="error"><strong>'.__('Errors:').'</strong>'. 
     162               '<div class="error"><p><strong>'.(count($core->error->getErrors()) > 1 ? __('Errors:') : __('Error:')).'</p></strong>'. 
    162163               $core->error->toHTML(). 
    163164               '</div>'; 
     
    167168     public static function close() 
    168169     { 
     170          global $core; 
     171 
    169172          $menu =& $GLOBALS['_menu']; 
    170173           
     
    179182          } 
    180183           
     184          $text = sprintf(__('Thank you for using %s.'),'<a href="http://dotclear.org/">Dotclear '.DC_VERSION.'</a>'); 
     185 
     186          # --BEHAVIOR-- adminPageFooter 
     187          $textAlt = $core->callBehavior('adminPageFooter',$core,$text); 
     188 
    181189          echo 
    182190          '</div>'."\n".      // End of #main-menu 
    183           '<div id="footer"><p>'. 
    184           sprintf(__('Thank you for using %s.'),'<a href="http://dotclear.org/">Dotclear '.DC_VERSION.'</a>'). 
    185           '</p></div>'."\n". 
     191          '<div id="footer"><p>'.($textAlt != '' ? $textAlt : $text).'</p></div>'."\n". 
    186192          "</div>\n";         // End of #wrapper 
    187193           
     
    254260          "</div>\n".         // End of #wrapper 
    255261          '</body></html>'; 
     262     } 
     263 
     264     public static function message($msg,$timestamp=true,$div=false,$echo=true) 
     265     { 
     266          global $core; 
     267           
     268          $res = ''; 
     269          if ($msg != '') { 
     270               $res = ($div ? '<div class="message">' : '').'<p'.($div ? '' : ' class="message"').'>'. 
     271                    ($timestamp ? dt::str(__('%H:%M:%S:'),null,$core->auth->getInfo('user_tz')).' ' : '').$msg. 
     272                    '</p>'.($div ? '</div>' : ''); 
     273               if ($echo) { 
     274                    echo $res; 
     275               } 
     276          } 
     277          return $res; 
    256278     } 
    257279      
     
    370392          self::jsLoad('js/jquery/jquery.biscuit.js'). 
    371393          self::jsLoad('js/jquery/jquery.bgFade.js'). 
     394          self::jsLoad('js/jquery/jquery.constantfooter.js'). 
    372395          self::jsLoad('js/common.js'). 
    373396          self::jsLoad('js/prelude.js'). 
     
    377400          self::jsVar('dotclear.nonce',$GLOBALS['core']->getNonce()). 
    378401           
    379           self::jsVar('dotclear.img_plus_src','images/plus.png'). 
     402          self::jsVar('dotclear.img_plus_src','images/expand.png'). 
    380403          self::jsVar('dotclear.img_plus_alt',__('uncover')). 
    381           self::jsVar('dotclear.img_minus_src','images/minus.png'). 
     404          self::jsVar('dotclear.img_minus_src','images/hide.png'). 
    382405          self::jsVar('dotclear.img_minus_alt',__('hide')). 
    383406          self::jsVar('dotclear.img_menu_on','images/menu_on.png'). 
     
    410433          self::jsVar('dotclear.msg.confirm_delete_post', 
    411434               __("Are you sure you want to delete this entry?")). 
     435          self::jsVar('dotclear.msg.confirm_spam_delete', 
     436               __('Are you sure you want to delete all spams?')). 
    412437          self::jsVar('dotclear.msg.cannot_delete_users', 
    413438               __('Users with posts cannot be deleted.')). 
  • inc/admin/lib.dc.page.php

    r1049 r1107  
    6969               $rs_blogs = $core->getBlogs(array('order'=>'LOWER(blog_name)','limit'=>20)); 
    7070               $blogs = array(); 
    71                while ($rs_blogs->fetch()) { 
    72                     $blogs[html::escapeHTML($rs_blogs->blog_name.' - '.$rs_blogs->blog_url)] = $rs_blogs->blog_id; 
     71               foreach ($rs_blogs as $rs_blog) { 
     72                    $blogs[html::escapeHTML($rs_blog->blog_name.' - '.$rs_blog->blog_url)] = $rs_blog->blog_id; 
    7373               } 
    7474               $blog_box = 
     
    435435          self::jsVar('dotclear.msg.confirm_spam_delete', 
    436436               __('Are you sure you want to delete all spams?')). 
    437           self::jsVar('dotclear.msg.confirm_delete_comments', 
    438                __('Are you sure you want to delete selected comments (%s)?')). 
    439           self::jsVar('dotclear.msg.confirm_delete_comment', 
    440                __('Are you sure you want to delete this comment?')). 
    441437          self::jsVar('dotclear.msg.cannot_delete_users', 
    442438               __('Users with posts cannot be deleted.')). 
    443439          self::jsVar('dotclear.msg.confirm_delete_user', 
    444440               __('Are you sure you want to delete selected users (%s)?')). 
    445           self::jsVar('dotclear.msg.confirm_delete_category', 
    446                __('Are you sure you want to delete category "%s"?')). 
    447           self::jsVar('dotclear.msg.confirm_reorder_categories', 
    448                __('Are you sure you want to reorder all categories?')). 
    449           self::jsVar('dotclear.msg.confirm_delete_media', 
    450                __('Are you sure you want to remove media "%s"?')). 
    451441          self::jsVar('dotclear.msg.confirm_extract_current', 
    452442               __('Are you sure you want to extract archive in current directory?')). 
     
    586576     } 
    587577      
    588      public static function jsToolBar() 
    589      { 
    590           $res = 
    591           '<link rel="stylesheet" type="text/css" href="style/jsToolBar/jsToolBar.css" />'. 
    592           '<script type="text/javascript" src="js/jsToolBar/jsToolBar.js"></script>'; 
    593            
    594           if (isset($GLOBALS['core']->auth) && $GLOBALS['core']->auth->getOption('enable_wysiwyg')) { 
    595                $res .= '<script type="text/javascript" src="js/jsToolBar/jsToolBar.wysiwyg.js"></script>'; 
    596           } 
    597            
    598           $res .= 
    599           '<script type="text/javascript" src="js/jsToolBar/jsToolBar.dotclear.js"></script>'. 
    600           '<script type="text/javascript">'."\n". 
    601           "//<![CDATA[\n". 
    602           "jsToolBar.prototype.dialog_url = 'popup.php'; ". 
    603           "jsToolBar.prototype.iframe_css = '". 
    604                'body{'. 
    605                     'font: 12px "DejaVu Sans","Lucida Grande","Lucida Sans Unicode",Arial,sans-serif;'. 
    606                     'color : #000;'. 
    607                     'background: #f9f9f9;'. 
    608                     'margin: 0;'. 
    609                     'padding : 2px;'. 
    610                     'border: none;'. 
    611                     (l10n::getTextDirection($GLOBALS['_lang']) == 'rtl' ? 'direction:rtl;' : ''). 
    612                '}'. 
    613                'pre, code, kbd, samp {'. 
    614                     'font-family:"Courier New",Courier,monospace;'. 
    615                     'font-size : 1.1em;'. 
    616                '}'. 
    617                'code {'. 
    618                     'color : #666;'. 
    619                     'font-weight : bold;'. 
    620                '}'. 
    621                'body > p:first-child {'. 
    622                     'margin-top: 0;'. 
    623                '}'. 
    624           "'; ". 
    625           "jsToolBar.prototype.base_url = '".html::escapeJS($GLOBALS['core']->blog->host)."'; ". 
    626           "jsToolBar.prototype.switcher_visual_title = '".html::escapeJS(__('visual'))."'; ". 
    627           "jsToolBar.prototype.switcher_source_title = '".html::escapeJS(__('source'))."'; ". 
    628           "jsToolBar.prototype.legend_msg = '". 
    629           html::escapeJS(__('You can use the following shortcuts to format your text.'))."'; ". 
    630           "jsToolBar.prototype.elements.blocks.options.none = '".html::escapeJS(__('-- none --'))."'; ". 
    631           "jsToolBar.prototype.elements.blocks.options.nonebis = '".html::escapeJS(__('-- block format --'))."'; ". 
    632           "jsToolBar.prototype.elements.blocks.options.p = '".html::escapeJS(__('Paragraph'))."'; ". 
    633           "jsToolBar.prototype.elements.blocks.options.h1 = '".html::escapeJS(__('Level 1 header'))."'; ". 
    634           "jsToolBar.prototype.elements.blocks.options.h2 = '".html::escapeJS(__('Level 2 header'))."'; ". 
    635           "jsToolBar.prototype.elements.blocks.options.h3 = '".html::escapeJS(__('Level 3 header'))."'; ". 
    636           "jsToolBar.prototype.elements.blocks.options.h4 = '".html::escapeJS(__('Level 4 header'))."'; ". 
    637           "jsToolBar.prototype.elements.blocks.options.h5 = '".html::escapeJS(__('Level 5 header'))."'; ". 
    638           "jsToolBar.prototype.elements.blocks.options.h6 = '".html::escapeJS(__('Level 6 header'))."'; ". 
    639           "jsToolBar.prototype.elements.strong.title = '".html::escapeJS(__('Strong emphasis'))."'; ". 
    640           "jsToolBar.prototype.elements.em.title = '".html::escapeJS(__('Emphasis'))."'; ". 
    641           "jsToolBar.prototype.elements.ins.title = '".html::escapeJS(__('Inserted'))."'; ". 
    642           "jsToolBar.prototype.elements.del.title = '".html::escapeJS(__('Deleted'))."'; ". 
    643           "jsToolBar.prototype.elements.quote.title = '".html::escapeJS(__('Inline quote'))."'; ". 
    644           "jsToolBar.prototype.elements.code.title = '".html::escapeJS(__('Code'))."'; ". 
    645           "jsToolBar.prototype.elements.br.title = '".html::escapeJS(__('Line break'))."'; ". 
    646           "jsToolBar.prototype.elements.blockquote.title = '".html::escapeJS(__('Blockquote'))."'; ". 
    647           "jsToolBar.prototype.elements.pre.title = '".html::escapeJS(__('Preformated text'))."'; ". 
    648           "jsToolBar.prototype.elements.ul.title = '".html::escapeJS(__('Unordered list'))."'; ". 
    649           "jsToolBar.prototype.elements.ol.title = '".html::escapeJS(__('Ordered list'))."'; ". 
    650            
    651           "jsToolBar.prototype.elements.link.title = '".html::escapeJS(__('Link'))."'; ". 
    652           "jsToolBar.prototype.elements.link.href_prompt = '".html::escapeJS(__('URL?'))."'; ". 
    653           "jsToolBar.prototype.elements.link.hreflang_prompt = '".html::escapeJS(__('Language?'))."'; ". 
    654            
    655           "jsToolBar.prototype.elements.img.title = '".html::escapeJS(__('External image'))."'; ". 
    656           "jsToolBar.prototype.elements.img.src_prompt = '".html::escapeJS(__('URL?'))."'; ". 
    657            
    658           "jsToolBar.prototype.elements.img_select.title = '".html::escapeJS(__('Media chooser'))."'; ". 
    659           "jsToolBar.prototype.elements.post_link.title = '".html::escapeJS(__('Link to an entry'))."'; "; 
    660            
    661           if (!$GLOBALS['core']->auth->check('media,media_admin',$GLOBALS['core']->blog->id)) { 
    662                $res .= "jsToolBar.prototype.elements.img_select.disabled = true;\n"; 
    663           } 
    664            
    665           $res .= 
    666           "\n//]]>\n". 
    667           "</script>\n"; 
    668            
    669           return $res; 
    670      } 
    671       
    672      public static function jsCandyUpload($params=array(),$base_url=null) 
    673      { 
    674           if (!$base_url) { 
    675                $base_url = path::clean(dirname(preg_replace('/(\?.*$)?/','',$_SERVER['REQUEST_URI']))).'/'; 
    676           } 
    677            
    678           $params = array_merge($params,array( 
    679                'sess_id='.session_id(), 
    680                'sess_uid='.$_SESSION['sess_browser_uid'], 
    681                'xd_check='.$GLOBALS['core']->getNonce() 
    682           )); 
    683            
    684           return 
    685           '<link rel="stylesheet" type="text/css" href="style/candyUpload/style.css" />'."\n". 
    686           self::jsLoad('js/jquery/jquery.candyUpload.js'). 
    687            
    688           '<script type="text/javascript">'."\n". 
    689           "//<![CDATA[\n". 
    690           "dotclear.candyUpload = {};\n". 
    691           self::jsVar('dotclear.msg.activate_enhanced_uploader',__('Temporarily activate enhanced uploader')). 
    692           self::jsVar('dotclear.msg.disable_enhanced_uploader',__('Temporarily disable enhanced uploader')). 
    693           self::jsVar('$._candyUpload.prototype.locales.file_uploaded',__('File successfully uploaded.')). 
    694           self::jsVar('$._candyUpload.prototype.locales.max_file_size',__('Maximum file size allowed:')). 
    695           self::jsVar('$._candyUpload.prototype.locales.limit_exceeded',__('Limit exceeded.')). 
    696           self::jsVar('$._candyUpload.prototype.locales.size_limit_exceeded',__('File size exceeds allowed limit.')). 
    697           self::jsVar('$._candyUpload.prototype.locales.canceled',__('Canceled.')). 
    698           self::jsVar('$._candyUpload.prototype.locales.http_error',__('HTTP Error:')). 
    699           self::jsVar('$._candyUpload.prototype.locales.error',__('Error:')). 
    700           self::jsVar('$._candyUpload.prototype.locales.choose_file',__('Choose file')). 
    701           self::jsVar('$._candyUpload.prototype.locales.choose_files',__('Choose files')). 
    702           self::jsVar('$._candyUpload.prototype.locales.cancel',__('Cancel')). 
    703           self::jsVar('$._candyUpload.prototype.locales.clean',__('Clean')). 
    704           self::jsVar('$._candyUpload.prototype.locales.upload',__('Upload')). 
    705           self::jsVar('$._candyUpload.prototype.locales.no_file_in_queue',__('No file in queue.')). 
    706           self::jsVar('$._candyUpload.prototype.locales.file_in_queue',__('1 file in queue.')). 
    707           self::jsVar('$._candyUpload.prototype.locales.files_in_queue',__('%d files in queue.')). 
    708           self::jsVar('$._candyUpload.prototype.locales.queue_error',__('Queue error:')). 
    709           self::jsVar('dotclear.candyUpload.base_url',$base_url). 
    710           self::jsVar('dotclear.candyUpload.movie_url',$base_url.'index.php?pf=swfupload.swf'). 
    711           self::jsVar('dotclear.candyUpload.params',implode('&',$params)). 
    712           "\n//]]>\n". 
    713           "</script>\n"; 
    714      } 
    715578      
    716579     public static function jsToolMan() 
  • inc/admin/lib.pager.php

    r877 r1107  
    1515{ 
    1616     protected $core; 
    17      protected $items; 
    18      protected $item_count; 
    19       
    20      public function __construct($core,$items,$item_count) 
     17     protected $rs; 
     18     protected $rs_count; 
     19      
     20     public function __construct($core,$rs,$rs_count) 
    2121     { 
    2222          $this->core =& $core; 
    23           $this->items =& $items; 
    24           $this->item_count = $item_count; 
     23          $this->rs =& $rs; 
     24          $this->rs_count = $rs_count; 
    2525          $this->html_prev = __('&#171;prev.'); 
    2626          $this->html_next = __('next&#187;'); 
     
    3232     public function display($page,$nb_per_page,$enclose_block='') 
    3333     { 
    34           if (count($this->items) == 0) 
     34          if ($this->rs->isEmpty()) 
    3535          { 
    3636               echo '<p><strong>'.__('No entry').'</strong></p>'; 
     
    3838          else 
    3939          { 
    40                $pager = new pager($page,$this->item_count,$nb_per_page,10); 
     40               $pager = new pager($page,$this->rs_count,$nb_per_page,10); 
    4141               $pager->html_prev = $this->html_prev; 
    4242               $pager->html_next = $this->html_next; 
     
    6161               echo $blocks[0]; 
    6262                
    63                foreach ($this->items as $item) 
     63               while ($this->rs->fetch()) 
    6464               { 
    65                     echo $this->postLine($item); 
     65                    echo $this->postLine(); 
    6666               } 
    6767                
     
    7272     } 
    7373      
    74      private function postLine($item) 
     74     private function postLine() 
    7575     { 
    7676          $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; 
    77           switch ($item->post_status) { 
     77          switch ($this->rs->post_status) { 
    7878               case 1: 
    7979                    $img_status = sprintf($img,__('published'),'check-on.png'); 
     
    9191           
    9292          $selected = ''; 
    93           if ($item->post_selected) { 
     93          if ($this->rs->post_selected) { 
    9494               $selected = sprintf($img,__('selected'),'selected.png'); 
    9595          } 
    9696           
    9797           
    98           $res = '<tr class="line'.($item->post_status != 1 ? ' offline' : '').'"'. 
    99           ' id="p'.$item->post_id.'">'; 
     98          $res = '<tr class="line'.($this->rs->post_status != 1 ? ' offline' : '').'"'. 
     99          ' id="p'.$this->rs->post_id.'">'; 
    100100           
    101101          $res .= 
    102102          '<td class="nowrap">'. 
    103           form::checkbox(array('entries[]'),$item->post_id,'','','',!$item->isEditable()).'</td>'. 
    104           '<td class="maximal"><a href="'.$this->core->getPostAdminURL($item->post_type,$item->post_id).'">'. 
    105           html::escapeHTML($item->post_title).'</a></td>'. 
    106           '<td class="nowrap">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$item->post_dt).'</td>'. 
    107           '<td class="nowrap">'.$item->user_id.'</td>'. 
     103          form::checkbox(array('entries[]'),$this->rs->post_id,'','','',!$this->rs->isEditable()).'</td>'. 
     104          '<td class="maximal"><a href="'.$this->core->getPostAdminURL($this->rs->post_type,$this->rs->post_id).'">'. 
     105          html::escapeHTML($this->rs->post_title).'</a></td>'. 
     106          '<td class="nowrap">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$this->rs->post_dt).'</td>'. 
     107          '<td class="nowrap">'.$this->rs->user_id.'</td>'. 
    108108          '<td class="nowrap status">'.$img_status.' '.$selected.'</td>'. 
    109109          '</tr>'; 
     
    117117     public function display($page,$nb_per_page,$enclose_block='') 
    118118     { 
    119           if (count($this->items) == 0) 
     119          if ($this->rs->isEmpty()) 
    120120          { 
    121121               echo '<p><strong>'.__('No entry').'</strong></p>'; 
     
    123123          else 
    124124          { 
    125                $pager = new pager($page,$this->item_count,$nb_per_page,10); 
     125               $pager = new pager($page,$this->rs_count,$nb_per_page,10); 
    126126               $pager->html_prev = $this->html_prev; 
    127127               $pager->html_next = $this->html_next; 
     
    146146               echo $blocks[0]; 
    147147                
    148                foreach ($this->items as $item) 
     148               while ($this->rs->fetch()) 
    149149               { 
    150                     echo $this->postLine($item); 
     150                    echo $this->postLine(); 
    151151               } 
    152152                
     
    157157     } 
    158158      
    159      private function postLine($item) 
     159     private function postLine() 
    160160     { 
    161161          $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; 
    162           switch ($item->post_status) { 
     162          switch ($this->rs->post_status) { 
    163163               case 1: 
    164164                    $img_status = sprintf($img,__('published'),'check-on.png'); 
     
    176176           
    177177          $selected = ''; 
    178           if ($item->post_selected) { 
     178          if ($this->rs->post_selected) { 
    179179               $selected = sprintf($img,__('selected'),'selected.png'); 
    180180          } 
    181181           
    182182           
    183           $res = '<tr class="line'.($item->post_status != 1 ? ' offline' : '').'"'. 
    184           ' id="p'.$item->post_id.'">'; 
     183          $res = '<tr class="line'.($this->rs->post_status != 1 ? ' offline' : '').'"'. 
     184          ' id="p'.$this->rs->post_id.'">'; 
    185185           
    186186          $res .= 
    187           '<td class="maximal"><a href="'.$this->core->getPostAdminURL($item->post_type,$item->post_id).'" '. 
    188           'title="'.html::escapeHTML($item->getURL()).'">'. 
    189           html::escapeHTML($item->post_title).'</a></td>'. 
    190           '<td class="nowrap">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$item->post_dt).'</td>'. 
    191           '<td class="nowrap">'.$item->user_id.'</td>'. 
     187          '<td class="maximal"><a href="'.$this->core->getPostAdminURL($this->rs->post_type,$this->rs->post_id).'" '. 
     188          'title="'.html::escapeHTML($this->rs->getURL()).'">'. 
     189          html::escapeHTML($this->rs->post_title).'</a></td>'. 
     190          '<td class="nowrap">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$this->rs->post_dt).'</td>'. 
     191          '<td class="nowrap">'.$this->rs->user_id.'</td>'. 
    192192          '<td class="nowrap status">'.$img_status.' '.$selected.'</td>'. 
    193193          '</tr>'; 
     
    201201     public function display($page,$nb_per_page,$enclose_block='') 
    202202     { 
    203           if (count($this->items) == 0) 
     203          if ($this->rs->isEmpty()) 
    204204          { 
    205205               echo '<p><strong>'.__('No user').'</strong></p>'; 
     
    207207          else 
    208208          { 
    209                $pager = new pager($page,$this->item_count,$nb_per_page,10); 
     209               $pager = new pager($page,$this->rs_count,$nb_per_page,10); 
    210210               $pager->html_prev = $this->html_prev; 
    211211               $pager->html_next = $this->html_next; 
     
    231231               echo $blocks[0]; 
    232232                
    233                foreach ($this->items as $item) 
     233               while ($this->rs->fetch()) 
    234234               { 
    235                     echo $this->userLine($item); 
     235                    echo $this->userLine(); 
    236236               } 
    237237                
     
    242242     } 
    243243      
    244      private function userLine($item) 
     244     private function userLine() 
    245245     { 
    246246          $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; 
    247247          $img_status = ''; 
    248248           
    249           $p = $this->core->getUserPermissions($item->user_id); 
     249          $p = $this->core->getUserPermissions($this->rs->user_id); 
    250250           
    251251          if (isset($p[$this->core->blog->id]['p']['admin'])) { 
    252252               $img_status = sprintf($img,__('admin'),'admin.png'); 
    253253          } 
    254           if ($item->user_super) { 
     254          if ($this->rs->user_super) { 
    255255               $img_status = sprintf($img,__('superadmin'),'superadmin.png'); 
    256256          } 
    257257          return 
    258258          '<tr class="line">'. 
    259           '<td class="nowrap">'.form::hidden(array('nb_post[]'),(integer) $item->nb_post). 
    260           form::checkbox(array('user_id[]'),$item->user_id).'</td>'. 
    261           '<td class="maximal"><a href="user.php?id='.$item->user_id.'">'. 
    262           $item->user_id.'</a>&nbsp;'.$img_status.'</td>'. 
    263           '<td class="nowrap">'.$item->user_firstname.'</td>'. 
    264           '<td class="nowrap">'.$item->user_name.'</td>'. 
    265           '<td class="nowrap">'.$item->user_displayname.'</td>'. 
    266           '<td class="nowrap"><a href="posts.php?user_id='.$item->user_id.'">'. 
    267           $item->nb_post.'</a></td>'. 
     259          '<td class="nowrap">'.form::hidden(array('nb_post[]'),(integer) $this->rs->nb_post). 
     260          form::checkbox(array('user_id[]'),$this->rs->user_id).'</td>'. 
     261          '<td class="maximal"><a href="user.php?id='.$this->rs->user_id.'">'. 
     262          $this->rs->user_id.'</a>&nbsp;'.$img_status.'</td>'. 
     263          '<td class="nowrap">'.$this->rs->user_firstname.'</td>'. 
     264          '<td class="nowrap">'.$this->rs->user_name.'</td>'. 
     265          '<td class="nowrap">'.$this->rs->user_displayname.'</td>'. 
     266          '<td class="nowrap"><a href="posts.php?user_id='.$this->rs->user_id.'">'. 
     267          $this->rs->nb_post.'</a></td>'. 
    268268          '</tr>'; 
    269269     } 
  • inc/admin/lib.pager.php

    r860 r1107  
    4747               '<th colspan="2">'.__('Title').'</th>'. 
    4848               '<th>'.__('Date').'</th>'. 
    49                '<th>'.__('Category').'</th>'. 
    5049               '<th>'.__('Author').'</th>'. 
    51                '<th>'.__('Comments').'</th>'. 
    52                '<th>'.__('Trackbacks').'</th>'. 
    5350               '<th>'.__('Status').'</th>'. 
    5451               '</tr>%s</table>'; 
     
    7774     private function postLine() 
    7875     { 
    79           if ($this->core->auth->check('categories',$this->core->blog->id)) { 
    80                $cat_link = '<a href="category.php?id=%s">%s</a>'; 
    81           } else { 
    82                $cat_link = '%2$s'; 
    83           } 
    84            
    85           if ($this->rs->cat_title) { 
    86                $cat_title = sprintf($cat_link,$this->rs->cat_id, 
    87                html::escapeHTML($this->rs->cat_title)); 
    88           } else { 
    89                $cat_title = __('None'); 
    90           } 
    91            
    9276          $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; 
    9377          switch ($this->rs->post_status) { 
     
    10690          } 
    10791           
    108           $protected = ''; 
    109           if ($this->rs->post_password) { 
    110                $protected = sprintf($img,__('protected'),'locker.png'); 
    111           } 
    112            
    11392          $selected = ''; 
    11493          if ($this->rs->post_selected) { 
     
    11695          } 
    11796           
    118           $attach = ''; 
    119           $nb_media = $this->rs->countMedia(); 
    120           if ($nb_media > 0) { 
    121                $attach_str = $nb_media == 1 ? __('%d attachment') : __('%d attachments'); 
    122                $attach = sprintf($img,sprintf($attach_str,$nb_media),'attach.png'); 
    123           } 
    12497           
    12598          $res = '<tr class="line'.($this->rs->post_status != 1 ? ' offline' : '').'"'. 
     
    132105          html::escapeHTML($this->rs->post_title).'</a></td>'. 
    133106          '<td class="nowrap">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$this->rs->post_dt).'</td>'. 
    134           '<td class="nowrap">'.$cat_title.'</td>'. 
    135107          '<td class="nowrap">'.$this->rs->user_id.'</td>'. 
    136           '<td class="nowrap">'.$this->rs->nb_comment.'</td>'. 
    137           '<td class="nowrap">'.$this->rs->nb_trackback.'</td>'. 
    138           '<td class="nowrap status">'.$img_status.' '.$selected.' '.$protected.' '.$attach.'</td>'. 
     108          '<td class="nowrap status">'.$img_status.' '.$selected.'</td>'. 
    139109          '</tr>'; 
    140110           
     
    205175          } 
    206176           
    207           $protected = ''; 
    208           if ($this->rs->post_password) { 
    209                $protected = sprintf($img,__('protected'),'locker.png'); 
    210           } 
    211            
    212177          $selected = ''; 
    213178          if ($this->rs->post_selected) { 
     
    215180          } 
    216181           
    217           $attach = ''; 
    218           $nb_media = $this->rs->countMedia(); 
    219           if ($nb_media > 0) { 
    220                $attach_str = $nb_media == 1 ? __('%d attachment') : __('%d attachments'); 
    221                $attach = sprintf($img,sprintf($attach_str,$nb_media),'attach.png'); 
    222           } 
    223182           
    224183          $res = '<tr class="line'.($this->rs->post_status != 1 ? ' offline' : '').'"'. 
     
    231190          '<td class="nowrap">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$this->rs->post_dt).'</td>'. 
    232191          '<td class="nowrap">'.$this->rs->user_id.'</td>'. 
    233           '<td class="nowrap status">'.$img_status.' '.$selected.' '.$protected.' '.$attach.'</td>'. 
     192          '<td class="nowrap status">'.$img_status.' '.$selected.'</td>'. 
    234193          '</tr>'; 
    235            
    236           return $res; 
    237      } 
    238 } 
    239  
    240 class adminCommentList extends adminGenericList 
    241 { 
    242      public function display($page,$nb_per_page,$enclose_block='') 
    243      { 
    244           if ($this->rs->isEmpty()) 
    245           { 
    246                echo '<p><strong>'.__('No comment').'</strong></p>'; 
    247           } 
    248           else 
    249           { 
    250                $pager = new pager($page,$this->rs_count,$nb_per_page,10); 
    251                $pager->html_prev = $this->html_prev; 
    252                $pager->html_next = $this->html_next; 
    253                $pager->var_page = 'page'; 
    254                 
    255                $html_block = 
    256                '<table><tr>'. 
    257                '<th colspan="2">'.__('Title').'</th>'. 
    258                '<th>'.__('Date').'</th>'. 
    259                '<th>'.__('Author').'</th>'. 
    260                '<th>'.__('Type').'</th>'. 
    261                '<th>'.__('Status').'</th>'. 
    262                '<th>&nbsp;</th>'. 
    263                '</tr>%s</table>'; 
    264                 
    265                if ($enclose_block) { 
    266                     $html_block = sprintf($enclose_block,$html_block); 
    267                } 
    268                 
    269                echo '<p>'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 
    270                 
    271                $blocks = explode('%s',$html_block); 
    272                 
    273                echo $blocks[0]; 
    274                 
    275                while ($this->rs->fetch()) 
    276                { 
    277                     echo $this->commentLine(); 
    278                } 
    279                 
    280                echo $blocks[1]; 
    281                 
    282                echo '<p>'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 
    283           } 
    284      } 
    285       
    286      private function commentLine() 
    287      { 
    288           global $author, $status, $sortby, $order, $nb_per_page; 
    289            
    290           $author_url = 
    291           'comments.php?n='.$nb_per_page. 
    292           '&amp;status='.$status. 
    293           '&amp;sortby='.$sortby. 
    294           '&amp;order='.$order. 
    295           '&amp;author='.rawurlencode($this->rs->comment_author); 
    296            
    297           $post_url = $this->core->getPostAdminURL($this->rs->post_type,$this->rs->post_id); 
    298            
    299           $comment_url = 'comment.php?id='.$this->rs->comment_id; 
    300            
    301           $comment_dt = 
    302           dt::dt2str($this->core->blog->settings->system->date_format.' - '. 
    303           $this->core->blog->settings->system->time_format,$this->rs->comment_dt); 
    304            
    305           $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; 
    306           switch ($this->rs->comment_status) { 
    307                case 1: 
    308                     $img_status = sprintf($img,__('published'),'check-on.png'); 
    309                     break; 
    310                case 0: 
    311                     $img_status = sprintf($img,__('unpublished'),'check-off.png'); 
    312                     break; 
    313                case -1: 
    314                     $img_status = sprintf($img,__('pending'),'check-wrn.png'); 
    315                     break; 
    316                case -2: 
    317                     $img_status = sprintf($img,__('junk'),'junk.png'); 
    318                     break; 
    319           } 
    320            
    321           $comment_author = html::escapeHTML($this->rs->comment_author); 
    322           if (mb_strlen($comment_author) > 20) { 
    323                $comment_author = mb_strcut($comment_author,0,17).'...'; 
    324           } 
    325            
    326           $res = '<tr class="line'.($this->rs->comment_status != 1 ? ' offline' : '').'"'. 
    327           ' id="c'.$this->rs->comment_id.'">'; 
    328            
    329           $res .= 
    330           '<td class="nowrap">'. 
    331           form::checkbox(array('comments[]'),$this->rs->comment_id,'','','',0).'</td>'. 
    332           '<td class="maximal"><a href="'.$post_url.'">'. 
    333           html::escapeHTML($this->rs->post_title).'</a>'. 
    334           ($this->rs->post_type != 'post' ? ' ('.html::escapeHTML($this->rs->post_type).')' : '').'</td>'. 
    335           '<td class="nowrap">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$this->rs->comment_dt).'</td>'. 
    336           '<td class="nowrap"><a href="'.$author_url.'">'.$comment_author.'</a></td>'. 
    337           '<td class="nowrap">'.($this->rs->comment_trackback ? __('trackback') : __('comment')).'</td>'. 
    338           '<td class="nowrap status">'.$img_status.'</td>'. 
    339           '<td class="nowrap status"><a href="'.$comment_url.'">'. 
    340           '<img src="images/edit-mini.png" alt="" title="'.__('Edit this comment').'" /></a></td>'; 
    341            
    342           $res .= '</tr>'; 
    343194           
    344195          return $res; 
     
    407258          '<tr class="line">'. 
    408259          '<td class="nowrap">'.form::hidden(array('nb_post[]'),(integer) $this->rs->nb_post). 
    409           form::checkbox(array('users[]'),$this->rs->user_id).'</td>'. 
     260          form::checkbox(array('user_id[]'),$this->rs->user_id).'</td>'. 
    410261          '<td class="maximal"><a href="user.php?id='.$this->rs->user_id.'">'. 
    411262          $this->rs->user_id.'</a>&nbsp;'.$img_status.'</td>'. 
  • inc/admin/prepend.php

    r852 r1107  
    1111# -- END LICENSE BLOCK ----------------------------------------- 
    1212 
     13define('DC_CONTEXT_ADMIN',true); 
     14 
    1315require_once dirname(__FILE__).'/../prepend.php'; 
    1416 
     
    1921// HTTP/1.0 
    2022header("Pragma: no-cache"); 
    21  
    22 define('DC_CONTEXT_ADMIN',true); 
    2323 
    2424function dc_valid_fav($url) { 
     
    3737function dc_prepare_url($url) { 
    3838 
    39      $u = str_replace(array('?','&amp;'),array('\?','&'),$url); 
     39     $u = str_replace(array('?','&amp;','/'),array('\?','&','\\/'),$url); 
    4040     return (!strpos($u,'\?') ?  
    4141          '/'.$u.'$/' : 
     
    5555     } 
    5656     l10n::set(dirname(__FILE__).'/../../locales/'.$_lang.'/main'); 
     57     l10n::set(dirname(__FILE__).'/../../locales/'.$_lang.'/public'); 
    5758     l10n::set(dirname(__FILE__).'/../../locales/'.$_lang.'/plugins'); 
    5859} 
  • inc/admin/prepend.php

    r1069 r1107  
    147147     { 
    148148          $_SESSION['sess_blog_id'] = $_REQUEST['switchblog']; 
    149           if (isset($_SESSION['media_manager_dir'])) { 
    150                unset($_SESSION['media_manager_dir']); 
    151           } 
    152           if (isset($_SESSION['media_manager_page'])) { 
    153                unset($_SESSION['media_manager_page']); 
    154           } 
    155            
     149 
    156150          # Removing switchblog from URL 
    157151          $redir = $_SERVER['REQUEST_URI']; 
     
    236230          'images/menu/entries.png','images/menu/entries-b.png', 
    237231          'usage,contentadmin',null,null)); 
    238      $_fav['comments'] = new ArrayObject(array('comments','Comments','comments.php', 
    239           'images/menu/comments.png','images/menu/comments-b.png', 
    240           'usage,contentadmin',null,null)); 
    241232     $_fav['search'] = new ArrayObject(array('search','Search','search.php', 
    242233          'images/menu/search.png','images/menu/search-b.png', 
    243234          'usage,contentadmin',null,null)); 
    244      $_fav['categories'] = new ArrayObject(array('categories','Categories','categories.php', 
    245           'images/menu/categories.png','images/menu/categories-b.png', 
    246           'categories',null,null)); 
    247      $_fav['media'] = new ArrayObject(array('media','Media manager','media.php', 
    248           'images/menu/media.png','images/menu/media-b.png', 
    249           'media,media_admin',null,null)); 
    250235     $_fav['blog_pref'] = new ArrayObject(array('blog_pref','Blog settings','blog_pref.php', 
    251236          'images/menu/blog-pref.png','images/menu/blog-pref-b.png', 
     
    303288          preg_match('/blog_pref.php(\?.*)?$/',$_SERVER['REQUEST_URI']), 
    304289          $core->auth->check('admin',$core->blog->id)); 
    305      $_menu['Blog']->prependItem(__('Media manager'),'media.php','images/menu/media.png', 
    306           preg_match('/media(_item)?.php(\?.*)?$/',$_SERVER['REQUEST_URI']), 
    307           $core->auth->check('media,media_admin',$core->blog->id)); 
    308      $_menu['Blog']->prependItem(__('Categories'),'categories.php','images/menu/categories.png', 
    309           preg_match('/categories.php(\?.*)?$/',$_SERVER['REQUEST_URI']), 
    310           $core->auth->check('categories',$core->blog->id)); 
    311290     $_menu['Blog']->prependItem(__('Search'),'search.php','images/menu/search.png', 
    312291          preg_match('/search.php(\?.*)?$/',$_SERVER['REQUEST_URI']), 
    313           $core->auth->check('usage,contentadmin',$core->blog->id)); 
    314      $_menu['Blog']->prependItem(__('Comments'),'comments.php','images/menu/comments.png', 
    315           preg_match('/comments.php(\?.*)?$/',$_SERVER['REQUEST_URI']), 
    316292          $core->auth->check('usage,contentadmin',$core->blog->id)); 
    317293     $_menu['Blog']->prependItem(__('Entries'),'posts.php','images/menu/entries.png', 
Note: See TracChangeset for help on using the changeset viewer.

Sites map