public function draw() { if (count($this->items) + count($this->pinned) == 0) { return ''; } $res = '<div id="' . $this->id . '">' . ($this->title ? '<h3>' . $this->title . '</h3>' : '') . '<ul>' . "\n"; // 1. Display pinned items (unsorted) for ($i = 0; $i < count($this->pinned); $i++) { if ($i + 1 < count($this->pinned) && $this->itemSpace != '') { $res .= preg_replace('|</li>$|', $this->itemSpace . '</li>', $this->pinned[$i]); $res .= "\n"; } else { $res .= $this->pinned[$i] . "\n"; } } // 2. Display unpinned itmes (sorted) $i = 0; dcUtils::lexicalKeySort($this->items); foreach ($this->items as $title => $item) { if ($i + 1 < count($this->items) && $this->itemSpace != '') { $res .= preg_replace('|</li>$|', $this->itemSpace . '</li>', $item); $res .= "\n"; } else { $res .= $item . "\n"; } $i++; } $res .= '</ul></div>' . "\n"; return $res; }
try { $dates = $core->blog->getDates(array('type' => 'month')); } catch (Exception $e) { $core->error->add($e->getMessage()); } # Getting langs try { $langs = $core->blog->getLangs(); } catch (Exception $e) { $core->error->add($e->getMessage()); } # Creating filter combo boxes if (!$core->error->flag()) { # Filter form we'll put in html_block $users_combo = dcAdminCombos::getUsersCombo($users); dcUtils::lexicalKeySort($users_combo); $users_combo = array_merge(array('-' => ''), $users_combo); $categories_combo = array_merge(array(new formSelectOption('-', ''), new formSelectOption(__('(No cat)'), 'NULL')), dcAdminCombos::getCategoriesCombo($categories, false)); $categories_values = array(); foreach ($categories_combo as $cat) { if (isset($cat->value)) { $categories_values[$cat->value] = true; } } $status_combo = array_merge(array('-' => ''), dcAdminCombos::getPostStatusesCombo()); $selected_combo = array('-' => '', __('Selected') => '1', __('Not selected') => '0'); $comment_combo = array('-' => '', __('Opened') => '1', __('Closed') => '0'); $trackback_combo = array('-' => '', __('Opened') => '1', __('Closed') => '0'); $attachment_combo = array('-' => '', __('With attachments') => '1', __('Without attachments') => '0'); $password_combo = array('-' => '', __('With password') => '1', __('Without password') => '0'); # Months array
echo '</div>'; # # Users on the blog (with permissions) $blog_users = $core->getBlogPermissions($blog_id, $core->auth->isSuperAdmin()); $perm_types = $core->auth->getPermissionsTypes(); echo '<div class="multi-part" id="users" title="' . __('Users') . '">' . '<h3 class="out-of-screen-if-js">' . __('Users on this blog') . '</h3>'; if (empty($blog_users)) { echo '<p>' . __('No users') . '</p>'; } else { if ($core->auth->isSuperAdmin()) { $user_url_p = '<a href="' . $core->adminurl->get("admin.user", array('id' => '%1$s'), '&', true) . '">%1$s</a>'; } else { $user_url_p = '%1$s'; } # Sort users list on user_id key dcUtils::lexicalKeySort($blog_users); $post_type = $core->getPostTypes(); $current_blog_id = $core->blog->id; if ($blog_id != $core->blog->id) { $core->setBlog($blog_id); } foreach ($blog_users as $k => $v) { if (count($v['p']) > 0) { echo '<div class="user-perm">' . '<h4>' . sprintf($user_url_p, html::escapeHTML($k)) . ' (' . html::escapeHTML(dcUtils::getUserCN($k, $v['name'], $v['firstname'], $v['displayname'])) . ')</h4>'; if ($core->auth->isSuperAdmin()) { echo '<p>' . __('Email:') . ' ' . ($v['email'] != '' ? '<a href="mailto:' . $v['email'] . '">' . $v['email'] . '</a>' : __('(none)')) . '</p>'; } echo '<h5>' . __('Publications on this blog:') . '</h5>' . '<ul>'; foreach ($post_type as $type => $pt_info) { $params = array('post_type' => $type, 'user_id' => $k); echo '<li>' . sprintf(__('%1$s: %2$s'), __($pt_info['label']), $core->blog->getPosts($params, true)->f(0)) . '</li>';