}
if ($bbcode_plugin_is_enabled && $Item->can_comment(NULL)) {
    // Display button to quote this post
    echo '<a href="' . $Item->get_permanent_url() . '?mode=quote&amp;qp=' . $Item->ID . '#form_p' . $Item->ID . '" title="' . T_('Reply with quote') . '" class="roundbutton_text floatleft quote_button">' . get_icon('comments', 'imgtag', array('title' => T_('Reply with quote'))) . T_('Quote') . '</a>';
}
echo '</div>';
// List all tags attached to this topic:
$Item->tags(array('before' => '<span class="topic_tags">' . T_('Tags') . ': ', 'after' => '</span>', 'separator' => ', '));
echo '<div class="floatright">';
$Item->edit_link(array('before' => ' ', 'after' => '', 'title' => T_('Edit this topic'), 'text' => '#', 'class' => 'roundbutton_text'));
echo ' <span class="roundbutton_group">';
// Set redirect after publish to the same category view of the items permanent url
$redirect_after_publish = $Item->add_navigation_param($Item->get_permanent_url(), 'same_category', $current_cat);
$Item->next_status_link(array('before' => ' ', 'class' => 'roundbutton_text', 'post_navigation' => 'same_category', 'nav_target' => $current_cat), true);
$Item->next_status_link(array('class' => 'roundbutton_text', 'before_text' => '', 'post_navigation' => 'same_category', 'nav_target' => $current_cat), false);
$Item->delete_link('', '', '#', T_('Delete this topic'), 'roundbutton_text', false, '#', TS_('You are about to delete this post!\\nThis cannot be undone!'), get_caturl($current_cat));
echo '</span>';
echo '</div>';
?>
		</td>
	</tr>
<?php 
if (!$Item->can_see_comments(true) || $preview) {
    // If comments are disabled for this post we should close the <table> tag that was opened above for post content
    // Otherwise this tag will be closed below by 'comment_list_end'
    echo '</table>';
}
?>

	<?php 
$Item->locale_temp_switch();
Exemple #2
0
 /**
  * Display next Publish/Restrict to link
  *
  * @param array link params
  * @param boolean true to display next publish status, and false to display next restrict status link
  * @return boolean true if link was displayed | false otherwise
  */
 function next_status_link($params, $publish)
 {
     global $admin_url;
     $params = array_merge(array('before' => '', 'after' => '', 'before_text' => '', 'after_text' => '', 'text' => '#', 'title' => '', 'class' => '', 'glue' => '&amp;', 'redirect_to' => '', 'post_navigation' => 'same_blog', 'nav_target' => NULL), $params);
     if ($publish) {
         $next_status_in_row = $this->get_next_status(true);
         $action = 'publish';
         $button_default_icon = 'move_up_' . $next_status_in_row[2];
     } else {
         $next_status_in_row = $this->get_next_status(false);
         $action = 'restrict';
         $button_default_icon = 'move_down_' . $next_status_in_row[2];
     }
     if ($next_status_in_row === false) {
         // Next status is not allowed for current user
         return false;
     }
     $next_status = $next_status_in_row[0];
     $next_status_label = $next_status_in_row[1];
     if (isset($params['text_' . $next_status])) {
         // Set text from params for next status
         $text = $params['text_' . $next_status];
     } elseif ($params['text'] != '#') {
         // Set text from params for any atatus
         $text = $params['text'];
     } else {
         // Default text
         $text = get_icon($button_default_icon, 'imgtag', array('title' => '')) . ' ' . $next_status_label;
     }
     if (empty($params['title'])) {
         $status_title = get_visibility_statuses('moderation-titles');
         $params['title'] = $status_title[$next_status];
     }
     $glue = $params['glue'];
     $r = $params['before'];
     $r .= '<a href="' . $admin_url . '?ctrl=items' . $glue . 'action=' . $action . $glue . 'post_status=' . $next_status . $glue . 'post_ID=' . $this->ID . $glue . url_crumb('item');
     // set redirect_to
     $redirect_to = $params['redirect_to'];
     if (empty($redirect_to) && !is_admin_page()) {
         // we are in front office
         if ($next_status == 'deprecated') {
             if ($params['post_navigation'] == 'same_category') {
                 $redirect_to = get_caturl($params['nav_target']);
             } else {
                 $this->get_Blog();
                 $redirect_to = $this->Blog->gen_blogurl();
             }
         } else {
             $redirect_to = $this->add_navigation_param($this->get_permanent_url(), $params['post_navigation'], $params['nav_target']);
         }
     }
     if (!empty($redirect_to)) {
         $r .= $glue . 'redirect_to=' . rawurlencode($redirect_to);
     }
     $r .= '" title="' . $params['title'] . '"';
     if (empty($params['class_' . $next_status])) {
         // Set class for all statuses
         $class = empty($params['class']) ? '' : $params['class'];
     } else {
         // Set special class for next status
         $class = $params['class_' . $next_status];
     }
     if (!empty($class)) {
         $r .= ' class="' . $class . '"';
     }
     $r .= '>' . $params['before_text'] . $text . $params['after_text'] . '</a>';
     $r .= $params['after'];
     echo $r;
     return true;
 }