Changeset 1107:3943962d69b8 for inc/admin
- Timestamp:
- 02/27/13 11:48:32 (12 years ago)
- 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. - Location:
- inc/admin
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/admin/lib.dc.page.php
r873 r1107 57 57 { 58 58 $blog_box = 59 __('Blog:').' <strong title="'.html::escapeHTML($core->blog->url).'">'.59 '<p>'.__('Blog:').' <strong title="'.html::escapeHTML($core->blog->url).'">'. 60 60 html::escapeHTML($core->blog->name).'</strong>'; 61 61 … … 63 63 $blog_box .= ' - <a href="blogs.php">'.__('Change blog').'</a>'; 64 64 } 65 $blog_box .= '</p>'; 65 66 } 66 67 else … … 72 73 } 73 74 $blog_box = 74 '< label for="switchblog" class="classic">'.75 '<p><label for="switchblog" class="classic">'. 75 76 __('Blogs:').' '. 76 77 $core->formNonce(). 77 78 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>'; 80 81 } 81 82 … … 132 133 '<form action="index.php" method="post">'. 133 134 $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>'. 136 137 '</div>'. 137 138 '<div id="info-box2">'. … … 159 160 if ($core->error->flag()) { 160 161 echo 161 '<div class="error">< strong>'.__('Errors:').'</strong>'.162 '<div class="error"><p><strong>'.(count($core->error->getErrors()) > 1 ? __('Errors:') : __('Error:')).'</p></strong>'. 162 163 $core->error->toHTML(). 163 164 '</div>'; … … 167 168 public static function close() 168 169 { 170 global $core; 171 169 172 $menu =& $GLOBALS['_menu']; 170 173 … … 179 182 } 180 183 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 181 189 echo 182 190 '</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". 186 192 "</div>\n"; // End of #wrapper 187 193 … … 254 260 "</div>\n". // End of #wrapper 255 261 '</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; 256 278 } 257 279 … … 370 392 self::jsLoad('js/jquery/jquery.biscuit.js'). 371 393 self::jsLoad('js/jquery/jquery.bgFade.js'). 394 self::jsLoad('js/jquery/jquery.constantfooter.js'). 372 395 self::jsLoad('js/common.js'). 373 396 self::jsLoad('js/prelude.js'). … … 377 400 self::jsVar('dotclear.nonce',$GLOBALS['core']->getNonce()). 378 401 379 self::jsVar('dotclear.img_plus_src','images/ plus.png').402 self::jsVar('dotclear.img_plus_src','images/expand.png'). 380 403 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'). 382 405 self::jsVar('dotclear.img_minus_alt',__('hide')). 383 406 self::jsVar('dotclear.img_menu_on','images/menu_on.png'). … … 410 433 self::jsVar('dotclear.msg.confirm_delete_post', 411 434 __("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?')). 412 437 self::jsVar('dotclear.msg.cannot_delete_users', 413 438 __('Users with posts cannot be deleted.')). -
inc/admin/lib.dc.page.php
r1049 r1107 69 69 $rs_blogs = $core->getBlogs(array('order'=>'LOWER(blog_name)','limit'=>20)); 70 70 $blogs = array(); 71 while ($rs_blogs->fetch()) {72 $blogs[html::escapeHTML($rs_blog s->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; 73 73 } 74 74 $blog_box = … … 435 435 self::jsVar('dotclear.msg.confirm_spam_delete', 436 436 __('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?')).441 437 self::jsVar('dotclear.msg.cannot_delete_users', 442 438 __('Users with posts cannot be deleted.')). 443 439 self::jsVar('dotclear.msg.confirm_delete_user', 444 440 __('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"?')).451 441 self::jsVar('dotclear.msg.confirm_extract_current', 452 442 __('Are you sure you want to extract archive in current directory?')). … … 586 576 } 587 577 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 return685 '<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 }715 578 716 579 public static function jsToolMan() -
inc/admin/lib.pager.php
r877 r1107 15 15 { 16 16 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) 21 21 { 22 22 $this->core =& $core; 23 $this-> items =& $items;24 $this-> item_count = $item_count;23 $this->rs =& $rs; 24 $this->rs_count = $rs_count; 25 25 $this->html_prev = __('«prev.'); 26 26 $this->html_next = __('next»'); … … 32 32 public function display($page,$nb_per_page,$enclose_block='') 33 33 { 34 if ( count($this->items) == 0)34 if ($this->rs->isEmpty()) 35 35 { 36 36 echo '<p><strong>'.__('No entry').'</strong></p>'; … … 38 38 else 39 39 { 40 $pager = new pager($page,$this-> item_count,$nb_per_page,10);40 $pager = new pager($page,$this->rs_count,$nb_per_page,10); 41 41 $pager->html_prev = $this->html_prev; 42 42 $pager->html_next = $this->html_next; … … 61 61 echo $blocks[0]; 62 62 63 foreach ($this->items as $item)63 while ($this->rs->fetch()) 64 64 { 65 echo $this->postLine( $item);65 echo $this->postLine(); 66 66 } 67 67 … … 72 72 } 73 73 74 private function postLine( $item)74 private function postLine() 75 75 { 76 76 $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; 77 switch ($ item->post_status) {77 switch ($this->rs->post_status) { 78 78 case 1: 79 79 $img_status = sprintf($img,__('published'),'check-on.png'); … … 91 91 92 92 $selected = ''; 93 if ($ item->post_selected) {93 if ($this->rs->post_selected) { 94 94 $selected = sprintf($img,__('selected'),'selected.png'); 95 95 } 96 96 97 97 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.'">'; 100 100 101 101 $res .= 102 102 '<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>'. 108 108 '<td class="nowrap status">'.$img_status.' '.$selected.'</td>'. 109 109 '</tr>'; … … 117 117 public function display($page,$nb_per_page,$enclose_block='') 118 118 { 119 if ( count($this->items) == 0)119 if ($this->rs->isEmpty()) 120 120 { 121 121 echo '<p><strong>'.__('No entry').'</strong></p>'; … … 123 123 else 124 124 { 125 $pager = new pager($page,$this-> item_count,$nb_per_page,10);125 $pager = new pager($page,$this->rs_count,$nb_per_page,10); 126 126 $pager->html_prev = $this->html_prev; 127 127 $pager->html_next = $this->html_next; … … 146 146 echo $blocks[0]; 147 147 148 foreach ($this->items as $item)148 while ($this->rs->fetch()) 149 149 { 150 echo $this->postLine( $item);150 echo $this->postLine(); 151 151 } 152 152 … … 157 157 } 158 158 159 private function postLine( $item)159 private function postLine() 160 160 { 161 161 $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; 162 switch ($ item->post_status) {162 switch ($this->rs->post_status) { 163 163 case 1: 164 164 $img_status = sprintf($img,__('published'),'check-on.png'); … … 176 176 177 177 $selected = ''; 178 if ($ item->post_selected) {178 if ($this->rs->post_selected) { 179 179 $selected = sprintf($img,__('selected'),'selected.png'); 180 180 } 181 181 182 182 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.'">'; 185 185 186 186 $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>'. 192 192 '<td class="nowrap status">'.$img_status.' '.$selected.'</td>'. 193 193 '</tr>'; … … 201 201 public function display($page,$nb_per_page,$enclose_block='') 202 202 { 203 if ( count($this->items) == 0)203 if ($this->rs->isEmpty()) 204 204 { 205 205 echo '<p><strong>'.__('No user').'</strong></p>'; … … 207 207 else 208 208 { 209 $pager = new pager($page,$this-> item_count,$nb_per_page,10);209 $pager = new pager($page,$this->rs_count,$nb_per_page,10); 210 210 $pager->html_prev = $this->html_prev; 211 211 $pager->html_next = $this->html_next; … … 231 231 echo $blocks[0]; 232 232 233 foreach ($this->items as $item)233 while ($this->rs->fetch()) 234 234 { 235 echo $this->userLine( $item);235 echo $this->userLine(); 236 236 } 237 237 … … 242 242 } 243 243 244 private function userLine( $item)244 private function userLine() 245 245 { 246 246 $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; 247 247 $img_status = ''; 248 248 249 $p = $this->core->getUserPermissions($ item->user_id);249 $p = $this->core->getUserPermissions($this->rs->user_id); 250 250 251 251 if (isset($p[$this->core->blog->id]['p']['admin'])) { 252 252 $img_status = sprintf($img,__('admin'),'admin.png'); 253 253 } 254 if ($ item->user_super) {254 if ($this->rs->user_super) { 255 255 $img_status = sprintf($img,__('superadmin'),'superadmin.png'); 256 256 } 257 257 return 258 258 '<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> '.$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> '.$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>'. 268 268 '</tr>'; 269 269 } -
inc/admin/lib.pager.php
r860 r1107 47 47 '<th colspan="2">'.__('Title').'</th>'. 48 48 '<th>'.__('Date').'</th>'. 49 '<th>'.__('Category').'</th>'.50 49 '<th>'.__('Author').'</th>'. 51 '<th>'.__('Comments').'</th>'.52 '<th>'.__('Trackbacks').'</th>'.53 50 '<th>'.__('Status').'</th>'. 54 51 '</tr>%s</table>'; … … 77 74 private function postLine() 78 75 { 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 92 76 $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; 93 77 switch ($this->rs->post_status) { … … 106 90 } 107 91 108 $protected = '';109 if ($this->rs->post_password) {110 $protected = sprintf($img,__('protected'),'locker.png');111 }112 113 92 $selected = ''; 114 93 if ($this->rs->post_selected) { … … 116 95 } 117 96 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 }124 97 125 98 $res = '<tr class="line'.($this->rs->post_status != 1 ? ' offline' : '').'"'. … … 132 105 html::escapeHTML($this->rs->post_title).'</a></td>'. 133 106 '<td class="nowrap">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$this->rs->post_dt).'</td>'. 134 '<td class="nowrap">'.$cat_title.'</td>'.135 107 '<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>'. 139 109 '</tr>'; 140 110 … … 205 175 } 206 176 207 $protected = '';208 if ($this->rs->post_password) {209 $protected = sprintf($img,__('protected'),'locker.png');210 }211 212 177 $selected = ''; 213 178 if ($this->rs->post_selected) { … … 215 180 } 216 181 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 }223 182 224 183 $res = '<tr class="line'.($this->rs->post_status != 1 ? ' offline' : '').'"'. … … 231 190 '<td class="nowrap">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$this->rs->post_dt).'</td>'. 232 191 '<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>'. 234 193 '</tr>'; 235 236 return $res;237 }238 }239 240 class adminCommentList extends adminGenericList241 {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 else249 {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> </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 '&status='.$status.293 '&sortby='.$sortby.294 '&order='.$order.295 '&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>';343 194 344 195 return $res; … … 407 258 '<tr class="line">'. 408 259 '<td class="nowrap">'.form::hidden(array('nb_post[]'),(integer) $this->rs->nb_post). 409 form::checkbox(array('user s[]'),$this->rs->user_id).'</td>'.260 form::checkbox(array('user_id[]'),$this->rs->user_id).'</td>'. 410 261 '<td class="maximal"><a href="user.php?id='.$this->rs->user_id.'">'. 411 262 $this->rs->user_id.'</a> '.$img_status.'</td>'. -
inc/admin/prepend.php
r852 r1107 11 11 # -- END LICENSE BLOCK ----------------------------------------- 12 12 13 define('DC_CONTEXT_ADMIN',true); 14 13 15 require_once dirname(__FILE__).'/../prepend.php'; 14 16 … … 19 21 // HTTP/1.0 20 22 header("Pragma: no-cache"); 21 22 define('DC_CONTEXT_ADMIN',true);23 23 24 24 function dc_valid_fav($url) { … … 37 37 function dc_prepare_url($url) { 38 38 39 $u = str_replace(array('?','&' ),array('\?','&'),$url);39 $u = str_replace(array('?','&','/'),array('\?','&','\\/'),$url); 40 40 return (!strpos($u,'\?') ? 41 41 '/'.$u.'$/' : … … 55 55 } 56 56 l10n::set(dirname(__FILE__).'/../../locales/'.$_lang.'/main'); 57 l10n::set(dirname(__FILE__).'/../../locales/'.$_lang.'/public'); 57 58 l10n::set(dirname(__FILE__).'/../../locales/'.$_lang.'/plugins'); 58 59 } -
inc/admin/prepend.php
r1069 r1107 147 147 { 148 148 $_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 156 150 # Removing switchblog from URL 157 151 $redir = $_SERVER['REQUEST_URI']; … … 236 230 'images/menu/entries.png','images/menu/entries-b.png', 237 231 '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));241 232 $_fav['search'] = new ArrayObject(array('search','Search','search.php', 242 233 'images/menu/search.png','images/menu/search-b.png', 243 234 '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));250 235 $_fav['blog_pref'] = new ArrayObject(array('blog_pref','Blog settings','blog_pref.php', 251 236 'images/menu/blog-pref.png','images/menu/blog-pref-b.png', … … 303 288 preg_match('/blog_pref.php(\?.*)?$/',$_SERVER['REQUEST_URI']), 304 289 $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));311 290 $_menu['Blog']->prependItem(__('Search'),'search.php','images/menu/search.png', 312 291 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']),316 292 $core->auth->check('usage,contentadmin',$core->blog->id)); 317 293 $_menu['Blog']->prependItem(__('Entries'),'posts.php','images/menu/entries.png',
Note: See TracChangeset
for help on using the changeset viewer.