$author_url = ${$pp . 'author_url'}; $include_emptyurl = ${$pp . 'include_emptyurl'}; $author_IP = ${$pp . 'author_IP'}; load_funcs('skins/_skin.funcs.php'); $Widget = new Widget(); $template = $AdminUI->get_template('side_item'); $Widget->title = T_('Filters'); echo $Widget->replace_vars($template['block_start']); $Form = new Form(NULL, 'comment_filter_form', 'get', 'none'); $Form->begin_form(''); $Form->hidden_ctrl(); $Form->hidden('tab3', $tab3); $Form->submit(array('submit', T_('Search'), 'search', '', 'float:right')); echo '<fieldset>'; echo '<legend>' . T_('Comments to show') . '</legend>'; $exclude_statuses = array_merge(get_restricted_statuses($Blog->ID, 'blog_comment!'), array('redirected')); $statuses = get_visibility_statuses('notes-array', $exclude_statuses); foreach ($statuses as $status_key => $status_name) { // show statuses ?> <input type="checkbox" name="<?php echo $pp; ?> show_statuses[]" value="<?php echo $status_key; ?> " id="sh_<?php echo $status_key; ?> " class="checkbox" <?php if (in_array($status_key, $show_statuses)) {
echo 'checked="checked" '; } ?> /> <label for="ts_max"><?php echo T_('Future'); ?> </label> </div> <div> <?php // Get those statuses that current User can't view in this blog, and don't display those as filters $exclude_statuses = array_merge(get_restricted_statuses($Blog->ID, 'blog_post!'), array('trash')); $statuses = get_visibility_statuses('notes-array', $exclude_statuses); foreach ($statuses as $status_key => $status_name) { // show statuses ?> <input type="checkbox" name="<?php echo $pp; ?> show_statuses[]" value="<?php echo $status_key; ?> " id="sh_<?php echo $status_key; ?> " class="checkbox" <?php if (in_array($status_key, $show_statuses)) {
/** * Get buttons to change item type * * @param object Item * @param integer Index of the row on page * @return string */ function item_row_status($Item, $index) { global $current_User, $AdminUI, $Blog, $admin_url; if (empty($Blog)) { // global Blog object is not set, e.g. back-office User activity tab $Item->load_Blog(); $blog_ID = $Item->Blog->ID; } else { $blog_ID = $Blog->ID; } // Get those statuses which are not allowed for the current User to create posts in this blog $exclude_statuses = array_merge(get_restricted_statuses($blog_ID, 'blog_post!', 'create'), array('trash')); // Get allowed visibility statuses $status_options = get_visibility_statuses('', $exclude_statuses); if (is_logged_in() && $current_User->check_perm('item_post!CURSTATUS', 'edit', false, $Item) && isset($AdminUI, $AdminUI->skin_name) && $AdminUI->skin_name == 'bootstrap') { // Use dropdown for bootstrap skin and if current user can edit this post $status_icon_options = get_visibility_statuses('icons', $exclude_statuses); $r = '<div class="btn-group ' . ($index > 5 ? 'dropup' : 'dropdown') . ' post_status_dropdown">' . '<button type="button" class="btn btn-sm btn-status-' . $Item->status . ' dropdown-toggle" data-toggle="dropdown" aria-expanded="false" id="post_status_dropdown">' . '<span>' . $status_options[$Item->status] . '</span>' . ' <span class="caret"></span></button>' . '<ul class="dropdown-menu" role="menu" aria-labelledby="post_status_dropdown">'; foreach ($status_options as $status_key => $status_title) { $r .= '<li rel="' . $status_key . '" role="presentation"><a href="' . $admin_url . '?ctrl=items&blog=' . $blog_ID . '&action=update_status&post_ID=' . $Item->ID . '&status=' . $status_key . '&' . url_crumb('item') . '" role="menuitem" tabindex="-1">' . $status_icon_options[$status_key] . ' <span>' . $status_title . '</span></a></li>'; } $r .= '</ul>' . '</div>'; } else { // Display only status badge when user has no permission to edit this post and for chicago skin $r = $Item->get_format_status(array('template' => '<span class="note status_$status$"><span>$status_title$</span></span>')); } return $r; }
$comment_date_input .= $Form->time_input('comment_issue_time', $edited_Comment->date, ''); $Form->switch_template_parts($disp_params['edit_form_params']); $Form->info(T_('Comment date'), $comment_date_input, ''); } if ($comment_Item->can_rate() || !empty($edited_Comment->rating)) { // Rating is editable $edit_form_params = $disp_params['edit_form_params']; $before_rating = $edit_form_params['fieldstart'] . $edit_form_params['labelstart'] . T_('Rating') . $edit_form_params['labelend'] . $edit_form_params['inputstart']; $after_rating = $edit_form_params['inputend'] . $edit_form_params['fieldend']; $edited_Comment->rating_input(array('before' => $before_rating, 'after' => $after_rating)); } $comment_Item =& $edited_Comment->get_Item(); // Comment status cannot be more than post status, restrict it: $restrict_max_allowed_status = $comment_Item ? $comment_Item->status : ''; // Get those statuses which are not allowed for the current User to create comments in this blog $exclude_statuses = array_merge(get_restricted_statuses($Blog->ID, 'blog_comment!', 'edit', $edited_Comment->status, $restrict_max_allowed_status), array('redirected', 'trash')); // Get allowed visibility statuses $sharing_options = get_visibility_statuses('radio-options', $exclude_statuses); if (count($sharing_options) == 1) { // Only one visibility status is available, don't show radio but set hidden field $Form->hidden('comment_status', $sharing_options[0][0]); } else { // Display visibiliy options $Form->radio('comment_status', $edited_Comment->status, $sharing_options, T_('Visibility'), true); } // Display renderers $comment_renderer_checkboxes = $edited_Comment->renderer_checkboxes(NULL, false); if (!empty($comment_renderer_checkboxes)) { $Form->info(T_('Text Renderers'), $comment_renderer_checkboxes); } // Display comment attachments
/** * Display buttons to update a comment * * @param object Form * @param object edited Comment */ function echo_comment_status_buttons($Form, $edited_Comment) { global $Blog; // Get those statuses which are not allowed for the current User to create posts in this blog $exclude_statuses = array_merge(get_restricted_statuses($Blog->ID, 'blog_comment!', 'edit'), array('redirected', 'trash')); // Get allowed visibility statuses $status_options = get_visibility_statuses('button-titles', $exclude_statuses); $status_icon_options = get_visibility_statuses('icons', $exclude_statuses); $Form->hidden('comment_status', $edited_Comment->status); echo '<div class="btn-group dropup comment_status_dropdown">'; echo '<button type="submit" class="btn btn-status-' . $edited_Comment->status . '" name="actionArray[update]">' . '<span>' . $status_options[$edited_Comment->status] . '</span>' . '</button>' . '<button type="button" class="btn btn-status-' . $edited_Comment->status . ' dropdown-toggle" data-toggle="dropdown" aria-expanded="false" id="comment_status_dropdown">' . '<span class="caret"></span>' . '</button>'; echo '<ul class="dropdown-menu" role="menu" aria-labelledby="comment_status_dropdown">'; foreach ($status_options as $status_key => $status_title) { echo '<li rel="' . $status_key . '" role="presentation"><a href="#" role="menuitem" tabindex="-1">' . $status_icon_options[$status_key] . ' <span>' . $status_title . '</span></a></li>'; } echo '</ul>'; echo '</div>'; }