Dotclear

source: admin/post.php @ 933:16f917091b24

Revision 933:16f917091b24, 20.1 KB checked in by franck <carnet.franck.paul@…>, 11 years ago (diff)

Add post status icon after his title on edit entry page, (may be) fixes #814

Line 
1<?php
2# -- BEGIN LICENSE BLOCK ---------------------------------------
3#
4# This file is part of Dotclear 2.
5#
6# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
7# Licensed under the GPL version 2.0 license.
8# See LICENSE file or
9# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10#
11# -- END LICENSE BLOCK -----------------------------------------
12
13require dirname(__FILE__).'/../inc/admin/prepend.php';
14
15dcPage::check('usage,contentadmin');
16
17$post_id = '';
18$cat_id = '';
19$post_dt = '';
20$post_format = $core->auth->getOption('post_format');
21$post_password = '';
22$post_url = '';
23$post_lang = $core->auth->getInfo('user_lang');
24$post_title = '';
25$post_excerpt = '';
26$post_excerpt_xhtml = '';
27$post_content = '';
28$post_content_xhtml = '';
29$post_notes = '';
30$post_status = $core->auth->getInfo('user_post_status');
31$post_selected = false;
32$post_open_comment = $core->blog->settings->system->allow_comments;
33$post_open_tb = $core->blog->settings->system->allow_trackbacks;
34
35$page_title = __('New entry');
36
37$can_view_page = true;
38$can_edit_post = $core->auth->check('usage,contentadmin',$core->blog->id);
39$can_publish = $core->auth->check('publish,contentadmin',$core->blog->id);
40$can_delete = false;
41
42$post_headlink = '<link rel="%s" title="%s" href="post.php?id=%s" />';
43$post_link = '<a href="post.php?id=%s" title="%s">%s</a>';
44
45$next_link = $prev_link = $next_headlink = $prev_headlink = null;
46
47# If user can't publish
48if (!$can_publish) {
49     $post_status = -2;
50}
51
52# Getting categories
53$categories_combo = array('&nbsp;' => '');
54try {
55     $categories = $core->blog->getCategories(array('post_type'=>'post'));
56     while ($categories->fetch()) {
57          $categories_combo[] = new formSelectOption(
58               str_repeat('&nbsp;&nbsp;',$categories->level-1).($categories->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($categories->cat_title),
59               $categories->cat_id
60          );
61     }
62} catch (Exception $e) { }
63
64# Status combo
65foreach ($core->blog->getAllPostStatus() as $k => $v) {
66     $status_combo[$v] = (string) $k;
67}
68$img_status_pattern = '<img class="img_select_option" alt="%1$s" title="%1$s" src="images/%2$s" />';
69
70# Formaters combo
71foreach ($core->getFormaters() as $v) {
72     $formaters_combo[$v] = $v;
73}
74
75# Languages combo
76$rs = $core->blog->getLangs(array('order'=>'asc'));
77$all_langs = l10n::getISOcodes(0,1);
78$lang_combo = array('' => '', __('Most used') => array(), __('Available') => l10n::getISOcodes(1,1));
79while ($rs->fetch()) {
80     if (isset($all_langs[$rs->post_lang])) {
81          $lang_combo[__('Most used')][$all_langs[$rs->post_lang]] = $rs->post_lang;
82          unset($lang_combo[__('Available')][$all_langs[$rs->post_lang]]);
83     } else {
84          $lang_combo[__('Most used')][$rs->post_lang] = $rs->post_lang;
85     }
86}
87unset($all_langs);
88unset($rs);
89
90
91# Get entry informations
92if (!empty($_REQUEST['id']))
93{
94     $params['post_id'] = $_REQUEST['id'];
95     
96     $post = $core->blog->getPosts($params);
97     
98     if ($post->isEmpty())
99     {
100          $core->error->add(__('This entry does not exist.'));
101          $can_view_page = false;
102     }
103     else
104     {
105          $post_id = $post->post_id;
106          $cat_id = $post->cat_id;
107          $post_dt = date('Y-m-d H:i',strtotime($post->post_dt));
108          $post_format = $post->post_format;
109          $post_password = $post->post_password;
110          $post_url = $post->post_url;
111          $post_lang = $post->post_lang;
112          $post_title = $post->post_title;
113          $post_excerpt = $post->post_excerpt;
114          $post_excerpt_xhtml = $post->post_excerpt_xhtml;
115          $post_content = $post->post_content;
116          $post_content_xhtml = $post->post_content_xhtml;
117          $post_notes = $post->post_notes;
118          $post_status = $post->post_status;
119          $post_selected = (boolean) $post->post_selected;
120          $post_open_comment = (boolean) $post->post_open_comment;
121          $post_open_tb = (boolean) $post->post_open_tb;
122         
123          $page_title = __('Edit entry');
124         
125          $can_edit_post = $post->isEditable();
126          $can_delete= $post->isDeletable();
127         
128          $next_rs = $core->blog->getNextPost($post,1);
129          $prev_rs = $core->blog->getNextPost($post,-1);
130         
131          if ($next_rs !== null) {
132               $next_link = sprintf($post_link,$next_rs->post_id,
133                    html::escapeHTML($next_rs->post_title),__('next entry').'&nbsp;&#187;');
134               $next_headlink = sprintf($post_headlink,'next',
135                    html::escapeHTML($next_rs->post_title),$next_rs->post_id);
136          }
137         
138          if ($prev_rs !== null) {
139               $prev_link = sprintf($post_link,$prev_rs->post_id,
140                    html::escapeHTML($prev_rs->post_title),'&#171;&nbsp;'.__('previous entry'));
141               $prev_headlink = sprintf($post_headlink,'previous',
142                    html::escapeHTML($prev_rs->post_title),$prev_rs->post_id);
143          }
144         
145          try {
146               $core->media = new dcMedia($core);
147          } catch (Exception $e) {}
148     }
149}
150
151# Format excerpt and content
152if (!empty($_POST) && $can_edit_post)
153{
154     $post_format = $_POST['post_format'];
155     $post_excerpt = $_POST['post_excerpt'];
156     $post_content = $_POST['post_content'];
157     
158     $post_title = $_POST['post_title'];
159     
160     $cat_id = (integer) $_POST['cat_id'];
161     
162     if (isset($_POST['post_status'])) {
163          $post_status = (integer) $_POST['post_status'];
164     }
165     
166     if (empty($_POST['post_dt'])) {
167          $post_dt = '';
168     } else {
169          $post_dt = strtotime($_POST['post_dt']);
170          $post_dt = date('Y-m-d H:i',$post_dt);
171     }
172     
173     $post_open_comment = !empty($_POST['post_open_comment']);
174     $post_open_tb = !empty($_POST['post_open_tb']);
175     $post_selected = !empty($_POST['post_selected']);
176     $post_lang = $_POST['post_lang'];
177     $post_password = !empty($_POST['post_password']) ? $_POST['post_password'] : null;
178     
179     $post_notes = $_POST['post_notes'];
180     
181     if (isset($_POST['post_url'])) {
182          $post_url = $_POST['post_url'];
183     }
184     
185     $core->blog->setPostContent(
186          $post_id,$post_format,$post_lang,
187          $post_excerpt,$post_excerpt_xhtml,$post_content,$post_content_xhtml
188     );
189}
190
191# Create or update post
192if (!empty($_POST) && !empty($_POST['save']) && $can_edit_post)
193{
194     $cur = $core->con->openCursor($core->prefix.'post');
195     
196     $cur->post_title = $post_title;
197     $cur->cat_id = ($cat_id ? $cat_id : null);
198     $cur->post_dt = $post_dt ? date('Y-m-d H:i:00',strtotime($post_dt)) : '';
199     $cur->post_format = $post_format;
200     $cur->post_password = $post_password;
201     $cur->post_lang = $post_lang;
202     $cur->post_title = $post_title;
203     $cur->post_excerpt = $post_excerpt;
204     $cur->post_excerpt_xhtml = $post_excerpt_xhtml;
205     $cur->post_content = $post_content;
206     $cur->post_content_xhtml = $post_content_xhtml;
207     $cur->post_notes = $post_notes;
208     $cur->post_status = $post_status;
209     $cur->post_selected = (integer) $post_selected;
210     $cur->post_open_comment = (integer) $post_open_comment;
211     $cur->post_open_tb = (integer) $post_open_tb;
212     
213     if (isset($_POST['post_url'])) {
214          $cur->post_url = $post_url;
215     }
216     
217     # Update post
218     if ($post_id)
219     {
220          try
221          {
222               # --BEHAVIOR-- adminBeforePostUpdate
223               $core->callBehavior('adminBeforePostUpdate',$cur,$post_id);
224               
225               $core->blog->updPost($post_id,$cur);
226               
227               # --BEHAVIOR-- adminAfterPostUpdate
228               $core->callBehavior('adminAfterPostUpdate',$cur,$post_id);
229               
230               http::redirect('post.php?id='.$post_id.'&upd=1');
231          }
232          catch (Exception $e)
233          {
234               $core->error->add($e->getMessage());
235          }
236     }
237     else
238     {
239          $cur->user_id = $core->auth->userID();
240         
241          try
242          {
243               # --BEHAVIOR-- adminBeforePostCreate
244               $core->callBehavior('adminBeforePostCreate',$cur);
245               
246               $return_id = $core->blog->addPost($cur);
247               
248               # --BEHAVIOR-- adminAfterPostCreate
249               $core->callBehavior('adminAfterPostCreate',$cur,$return_id);
250               
251               http::redirect('post.php?id='.$return_id.'&crea=1');
252          }
253          catch (Exception $e)
254          {
255               $core->error->add($e->getMessage());
256          }
257     }
258}
259
260if (!empty($_POST['delete']) && $can_delete)
261{
262     try {
263          # --BEHAVIOR-- adminBeforePostDelete
264          $core->callBehavior('adminBeforePostDelete',$post_id);
265          $core->blog->delPost($post_id);
266          http::redirect('posts.php');
267     } catch (Exception $e) {
268          $core->error->add($e->getMessage());
269     }
270}
271
272/* DISPLAY
273-------------------------------------------------------- */
274$default_tab = 'edit-entry';
275if (!$can_edit_post) {
276     $default_tab = '';
277}
278if (!empty($_GET['co'])) {
279     $default_tab = 'comments';
280}
281
282dcPage::open($page_title.' - '.__('Entries'),
283     dcPage::jsDatePicker().
284     dcPage::jsToolBar().
285     dcPage::jsModal().
286     dcPage::jsMetaEditor().
287     dcPage::jsLoad('js/_post.js').
288     dcPage::jsConfirmClose('entry-form','comment-form').
289     # --BEHAVIOR-- adminPostHeaders
290     $core->callBehavior('adminPostHeaders').
291     dcPage::jsPageTabs($default_tab).
292     $next_headlink."\n".$prev_headlink
293);
294
295if (!empty($_GET['upd'])) {
296     dcPage::message(__('Entry has been successfully updated.'));
297}
298elseif (!empty($_GET['crea'])) {
299     dcPage::message(__('Entry has been successfully created.'));
300}
301elseif (!empty($_GET['attached'])) {
302     dcPage::message(__('File has been successfully attached.'));
303}
304elseif (!empty($_GET['rmattach'])) {
305     dcPage::message(__('Attachment has been successfully removed.'));
306}
307
308if (!empty($_GET['creaco'])) {
309     dcPage::message(__('Comment has been successfully created.'));
310}
311
312# XHTML conversion
313if (!empty($_GET['xconv']))
314{
315     $post_excerpt = $post_excerpt_xhtml;
316     $post_content = $post_content_xhtml;
317     $post_format = 'xhtml';
318     
319     dcPage::message(__('Don\'t forget to validate your XHTML conversion by saving your post.'));
320}
321
322echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; '.'<a href="posts.php">'.__('Entries').'</a> &rsaquo; <span class="page-title">'.$page_title;
323if ($post_id) {
324     switch ($post_status) {
325          case 1:
326               $img_status = sprintf($img_status_pattern,__('published'),'check-on.png');
327               break;
328          case 0:
329               $img_status = sprintf($img_status_pattern,__('unpublished'),'check-off.png');
330               break;
331          case -1:
332               $img_status = sprintf($img_status_pattern,__('scheduled'),'scheduled.png');
333               break;
334          case -2:
335               $img_status = sprintf($img_status_pattern,__('pending'),'check-wrn.png');
336               break;
337          default:
338               $img_status = '';
339     }
340     echo ' &ldquo;'.$post_title.'&rdquo;'.' '.$img_status;
341}
342echo '</span></h2>';
343
344if ($post_id && $post->post_status == 1) {
345     echo '<p><a href="'.$post->getURL().'" onclick="window.open(this.href);return false;" title="'.$post_title.' ('.__('new window').')'.'">'.__('Go to this entry on the site').' <img src="images/outgoing-blue.png" alt="" /></a></p>';
346}
347if ($post_id)
348{
349     echo '<p>';
350     if ($prev_link) { echo $prev_link; }
351     if ($next_link && $prev_link) { echo ' - '; }
352     if ($next_link) { echo $next_link; }
353     
354     # --BEHAVIOR-- adminPostNavLinks
355     $core->callBehavior('adminPostNavLinks',isset($post) ? $post : null);
356     
357     echo '</p>';
358}
359
360# Exit if we cannot view page
361if (!$can_view_page) {
362     dcPage::helpBlock('core_post');
363     dcPage::close();
364     exit;
365}
366
367/* Post form if we can edit post
368-------------------------------------------------------- */
369if ($can_edit_post)
370{
371     echo '<div class="multi-part" title="'.__('Edit entry').'" id="edit-entry">';
372     echo '<form action="post.php" method="post" id="entry-form">';
373     echo '<div id="entry-wrapper">';
374     echo '<div id="entry-content"><div class="constrained">';
375     
376     echo
377     '<p class="col"><label class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').
378     form::field('post_title',20,255,html::escapeHTML($post_title),'maximal').
379     '</label></p>'.
380     
381     '<p class="area" id="excerpt-area"><label for="post_excerpt">'.__('Excerpt:').'</label> '.
382     form::textarea('post_excerpt',50,5,html::escapeHTML($post_excerpt)).
383     '</p>'.
384     
385     '<p class="area"><label class="required" '.
386     'for="post_content"><abbr title="'.__('Required field').'">*</abbr> '.__('Content:').'</label> '.
387     form::textarea('post_content',50,$core->auth->getOption('edit_size'),html::escapeHTML($post_content)).
388     '</p>'.
389     
390     '<p class="area" id="notes-area"><label for="post_notes">'.__('Notes:').'</label>'.
391     form::textarea('post_notes',50,5,html::escapeHTML($post_notes)).
392     '</p>';
393     
394     # --BEHAVIOR-- adminPostForm
395     $core->callBehavior('adminPostForm',isset($post) ? $post : null);
396     
397     echo
398     '<p>'.
399     ($post_id ? form::hidden('id',$post_id) : '').
400     '<input type="submit" value="'.__('Save').' (s)" '.
401     'accesskey="s" name="save" /> ';
402     if ($post_id) {
403          $preview_url =
404          $core->blog->url.$core->url->getURLFor('preview',$core->auth->userID().'/'.
405          http::browserUID(DC_MASTER_KEY.$core->auth->userID().$core->auth->getInfo('user_pwd')).
406          '/'.$post->post_url);
407          echo '<a id="post-preview" href="'.$preview_url.'" class="button">'.__('Preview').'</a> ';
408     }
409     echo
410     ($can_delete ? '<input type="submit" class="delete" value="'.__('Delete').'" name="delete" />' : '').
411     $core->formNonce().
412     '</p>';
413     
414     echo '</div></div>';          // End #entry-content
415     echo '</div>';      // End #entry-wrapper
416
417     echo '<div id="entry-sidebar">';
418     
419     echo
420     '<p><label for="cat_id">'.__('Category:').
421     form::combo('cat_id',$categories_combo,$cat_id,'maximal').
422     '</label></p>'.
423     
424     '<p><label for="post_status">'.__('Entry status:').
425     form::combo('post_status',$status_combo,$post_status,'','',!$can_publish).
426     '</label></p>'.
427     
428     '<p><label for="post_dt">'.__('Published on:').
429     form::field('post_dt',16,16,$post_dt).
430     '</label></p>'.
431     
432     '<p><label for="post_format">'.__('Text formating:').
433     form::combo('post_format',$formaters_combo,$post_format).
434     '</label>'.
435     '</p>'.
436     '<p>'.($post_id && $post_format != 'xhtml' ? '<a id="convert-xhtml" class="button" href="post.php?id='.$post_id.'&amp;xconv=1">'.__('Convert to XHTML').'</a>' : '').'</p>'.
437     
438     '<p><label for="post_open_comment" class="classic">'.form::checkbox('post_open_comment',1,$post_open_comment).' '.
439     __('Accept comments').'</label></p>'.
440     ($core->blog->settings->system->allow_comments ? 
441          (isContributionAllowed($post_id,strtotime($post_dt),true) ? 
442               '' :
443               '<p class="form-note warn">'.__('Warning: Comments are not more accepted for this entry.').'</p>') : 
444          '<p class="form-note warn">'.__('Warning: Comments are not accepted on this blog.').'</p>').
445
446     '<p><label for="post_open_tb" class="classic">'.form::checkbox('post_open_tb',1,$post_open_tb).' '.
447     __('Accept trackbacks').'</label></p>'.
448     ($core->blog->settings->system->allow_trackbacks ? 
449          (isContributionAllowed($post_id,strtotime($post_dt),false) ? 
450               '' :
451               '<p class="form-note warn">'.__('Warning: Trackbacks are not more accepted for this entry.').'</p>') : 
452          '<p class="form-note warn">'.__('Warning: Trackbacks are not accepted on this blog.').'</p>').
453
454     '<p><label for="post_selected" class="classic">'.form::checkbox('post_selected',1,$post_selected).' '.
455     __('Selected entry').'</label></p>'.
456     
457     '<p><label for="post_lang">'.__('Entry lang:').
458     form::combo('post_lang',$lang_combo,$post_lang).
459     '</label></p>'.
460     
461     '<p><label for="post_password">'.__('Entry password:').
462     form::field('post_password',10,32,html::escapeHTML($post_password),'maximal').
463     '</label></p>'.
464     
465     '<div class="lockable">'.
466     '<p><label for="post_url">'.__('Basename:').
467     form::field('post_url',10,255,html::escapeHTML($post_url),'maximal').
468     '</label></p>'.
469     '<p class="form-note warn">'.
470     __('Warning: If you set the URL manually, it may conflict with another entry.').
471     '</p>'.
472     '</div>';
473     
474     # --BEHAVIOR-- adminPostFormSidebar
475     $core->callBehavior('adminPostFormSidebar',isset($post) ? $post : null);
476     
477     echo '</div>';      // End #entry-sidebar
478
479     echo '</form>';
480     
481     # --BEHAVIOR-- adminPostForm
482     $core->callBehavior('adminPostAfterForm',isset($post) ? $post : null);
483     
484     echo '</div>';
485     
486     if ($post_id && $post->post_status == 1) {
487          echo '<p><a href="trackbacks.php?id='.$post_id.'" class="multi-part">'.
488          __('Ping blogs').'</a></p>';
489     }
490     
491}
492
493
494/* Comments and trackbacks
495-------------------------------------------------------- */
496if ($post_id)
497{
498     $params = array('post_id' => $post_id, 'order' => 'comment_dt ASC');
499     
500     $comments = $core->blog->getComments(array_merge($params,array('comment_trackback'=>0)));
501     $trackbacks = $core->blog->getComments(array_merge($params,array('comment_trackback'=>1)));
502     
503     # Actions combo box
504     $combo_action = array();
505     if ($can_edit_post && $core->auth->check('publish,contentadmin',$core->blog->id))
506     {
507          $combo_action[__('publish')] = 'publish';
508          $combo_action[__('unpublish')] = 'unpublish';
509          $combo_action[__('mark as pending')] = 'pending';
510          $combo_action[__('mark as junk')] = 'junk';
511     }
512     
513     if ($can_edit_post && $core->auth->check('delete,contentadmin',$core->blog->id))
514     {
515          $combo_action[__('Delete')] = 'delete';
516     }
517     
518     # --BEHAVIOR-- adminCommentsActionsCombo
519     $core->callBehavior('adminCommentsActionsCombo',array(&$combo_action));
520     
521     $has_action = !empty($combo_action) && (!$trackbacks->isEmpty() || !$comments->isEmpty());
522     
523     echo
524     '<div id="comments" class="multi-part" title="'.__('Comments').'">';
525     
526     if ($has_action) {
527          echo '<form action="comments_actions.php" id="form-comments" method="post">';
528     }
529     
530     echo '<h3>'.__('Trackbacks').'</h3>';
531     
532     if (!$trackbacks->isEmpty()) {
533          showComments($trackbacks,$has_action,true);
534     } else {
535          echo '<p>'.__('No trackback').'</p>';
536     }
537     
538     echo '<h3>'.__('Comments').'</h3>';
539     if (!$comments->isEmpty()) {
540          showComments($comments,$has_action);
541     } else {
542          echo '<p>'.__('No comment').'</p>';
543     }
544     
545     if ($has_action) {
546          echo
547          '<div class="two-cols">'.
548          '<p class="col checkboxes-helpers"></p>'.
549         
550          '<p class="col right"><label for="action" class="classic">'.__('Selected comments action:').'</label> '.
551          form::combo('action',$combo_action).
552          form::hidden('redir','post.php?id='.$post_id.'&amp;co=1').
553          $core->formNonce().
554          '<input type="submit" value="'.__('ok').'" /></p>'.
555          '</div>'.
556          '</form>';
557     }
558     
559     echo '</div>';
560}
561
562/* Add a comment
563-------------------------------------------------------- */
564if ($post_id)
565{
566     echo
567     '<div class="multi-part" id="add-comment" title="'.__('Add a comment').'">'.
568     '<h3>'.__('Add a comment').'</h3>'.
569     
570     '<form action="comment.php" method="post" id="comment-form">'.
571     '<div class="constrained">'.
572     '<p><label for="comment_author" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Name:').
573     form::field('comment_author',30,255,html::escapeHTML($core->auth->getInfo('user_cn'))).
574     '</label></p>'.
575     
576     '<p><label for="comment_email">'.__('Email:').
577     form::field('comment_email',30,255,html::escapeHTML($core->auth->getInfo('user_email'))).
578     '</label></p>'.
579     
580     '<p><label for="comment_site">'.__('Web site:').
581     form::field('comment_site',30,255,html::escapeHTML($core->auth->getInfo('user_url'))).
582     '</label></p>'.
583     
584     '<p class="area"><label for="comment_content" class="required"><abbr title="'.__('Required field').'">*</abbr> '.
585     __('Comment:').'</label> '.
586     form::textarea('comment_content',50,8,html::escapeHTML('')).
587     '</p>'.
588     
589     '<p>'.form::hidden('post_id',$post_id).
590     $core->formNonce().
591     '<input type="submit" name="add" value="'.__('Save').'" /></p>'.
592     '</div>'.
593     '</form>'.
594     '</div>';
595}
596
597# Controls comments or trakbacks capabilities
598function isContributionAllowed($id,$dt,$com=true)
599{
600     global $core;
601
602     if (!$id) {
603          return true;
604     }
605     if ($com) {
606          if (($core->blog->settings->system->comments_ttl == 0) || 
607               (time() - $core->blog->settings->system->comments_ttl*86400 < $dt)) {
608               return true;
609          }
610     } else {
611          if (($core->blog->settings->system->trackbacks_ttl == 0) || 
612               (time() - $core->blog->settings->system->trackbacks_ttl*86400 < $dt)) {
613               return true;
614          }
615     }
616     return false;
617}
618
619# Show comments or trackbacks
620function showComments($rs,$has_action,$tb=false)
621{
622     echo
623     '<table class="comments-list"><tr>'.
624     '<th colspan="2">'.__('Author').'</th>'.
625     '<th>'.__('Date').'</th>'.
626     '<th class="nowrap">'.__('IP address').'</th>'.
627     '<th>'.__('Status').'</th>'.
628     '<th>&nbsp;</th>'.
629     '</tr>';
630     
631     while($rs->fetch())
632     {
633          $comment_url = 'comment.php?id='.$rs->comment_id;
634         
635          $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />';
636          switch ($rs->comment_status) {
637               case 1:
638                    $img_status = sprintf($img,__('published'),'check-on.png');
639                    break;
640               case 0:
641                    $img_status = sprintf($img,__('unpublished'),'check-off.png');
642                    break;
643               case -1:
644                    $img_status = sprintf($img,__('pending'),'check-wrn.png');
645                    break;
646               case -2:
647                    $img_status = sprintf($img,__('junk'),'junk.png');
648                    break;
649          }
650         
651          echo
652          '<tr class="line'.($rs->comment_status != 1 ? ' offline' : '').'"'.
653          ' id="c'.$rs->comment_id.'">'.
654         
655          '<td class="nowrap">'.
656          ($has_action ? form::checkbox(array('comments[]'),$rs->comment_id,'','','',0,'title="'.($tb ? __('select this trackback') : __('select this comment')).'"') : '').'</td>'.
657          '<td class="maximal">'.html::escapeHTML($rs->comment_author).'</td>'.
658          '<td class="nowrap">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$rs->comment_dt).'</td>'.
659          '<td class="nowrap"><a href="comments.php?ip='.$rs->comment_ip.'">'.$rs->comment_ip.'</a></td>'.
660          '<td class="nowrap status">'.$img_status.'</td>'.
661          '<td class="nowrap status"><a href="'.$comment_url.'">'.
662          '<img src="images/edit-mini.png" alt="" title="'.__('Edit this comment').'" /></a></td>'.
663         
664          '</tr>';
665     }
666     
667     echo '</table>';
668}
669
670dcPage::helpBlock('core_post','core_wiki');
671dcPage::close();
672?>
Note: See TracBrowser for help on using the repository browser.

Sites map