Dotclear

source: plugins/muppet/item.php @ 2485

Revision 2485, 20.2 KB checked in by Osku, 3 years ago (diff)

muppet - 0.6.1

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

Sites map