echo '<p><strong><a href="blog.php">' . __('Create a new blog') . '</a></strong></p>'; } if (!$show_filters) { echo '<p><a id="filter-control" class="form-control" href="#">' . __('Filters') . '</a></p>'; } echo '<form action="blogs.php" method="get" id="filters-form">' . '<fieldset class="two-cols"><legend>' . __('Filters') . '</legend>' . '<div class="col">' . '<p><label>' . __('Order by:') . ' ' . form::combo('sortby', $sortby_combo, html::escapeHTML($sortby)) . '</label> ' . '<label>' . __('Sort:') . ' ' . form::combo('order', $order_combo, html::escapeHTML($order)) . '</label></p>' . '</div>' . '<div class="col">' . '<p><label>' . __('Search:') . ' ' . form::field('q', 20, 255, html::escapeHTML($q)) . '</label></p>' . '<p><label class="classic">' . form::field('nb', 3, 3, $nb_per_page) . ' ' . __('Blogs per page') . '</label> ' . '<input type="submit" value="' . __('filter') . '" /></p>' . '</div>' . '<br class="clear" />' . '</fieldset>' . '</form>'; # Show blogs if ($nb_blog == 0) { echo '<p><strong>' . __('No blog') . '</strong></p>'; } else { $pager = new pager($page, $nb_blog, $nb_per_page, 10); $pager->var_page = 'page'; echo '<p>' . __('Page(s)') . ' : ' . $pager->getLinks() . '</p>'; echo '<table class="clear"><tr>' . '<th>' . __('Blog name') . '</th>' . '<th class="nowrap">' . __('Last update') . '</th>' . '<th class="nowrap">' . __('Entries') . '</th>' . '<th class="nowrap">' . __('Blog ID') . '</th>' . '<th> </th>' . '<th class="nowrap">' . __('Status') . '</th>' . '</tr>'; while ($rs->fetch()) { echo blogLine($rs); } echo '</table>'; echo '<p>' . __('Page(s)') . ' : ' . $pager->getLinks() . '</p>'; } } dcPage::close(); function blogLine(&$rs) { global $core; $blog_id = html::escapeHTML($rs->blog_id); $edit_link = ''; if ($GLOBALS['core']->auth->isSuperAdmin()) { $edit_link = '<a href="blog.php?id=' . $blog_id . '" ' . 'title="' . sprintf(__('Edit blog %s'), $blog_id) . '">' . __('edit') . '</a>'; } $img_status = $rs->blog_status == 1 ? 'check-on' : 'check-off';
echo '<p><strong>' . __('No blog matches the filter') . '</strong></p>'; } else { echo '<p><strong>' . __('No blog') . '</strong></p>'; } } else { $pager = new dcPager($page, $nb_blog, $nb_per_page, 10); echo $pager->getLinks(); echo '<div class="table-outer">' . '<table class="clear">'; if ($show_filters) { echo '<caption>' . sprintf(__('%d blog matches the filter.', '%d blogs match the filter.', $nb_blog), $nb_blog) . '</caption>'; } else { echo '<caption class="hidden">' . __('Blogs list') . '</caption>'; } echo '<tr>' . '<th scope="col" class="nowrap">' . __('Blog id') . '</th>' . '<th scope="col">' . __('Blog name') . '</th>' . '<th scope="col" class="nowrap">' . __('URL') . '</th>' . '<th scope="col" class="nowrap">' . __('Entries (all types)') . '</th>' . '<th scope="col" class="nowrap">' . __('Last update') . '</th>' . '<th scope="col" class="nowrap">' . __('Status') . '</th>' . '</tr>'; while ($rsStatic->fetch()) { echo blogLine($rsStatic); } echo '</table></div>'; echo $pager->getLinks(); } } dcPage::helpBlock('core_blogs'); dcPage::close(); function blogLine($rs) { global $core; $blog_id = html::escapeHTML($rs->blog_id); $edit_link = ''; if ($GLOBALS['core']->auth->isSuperAdmin()) { $edit_link = '<a href="' . $core->adminurl->get("admin.blog", array('id' => $blog_id)) . '" title="' . sprintf(__('Edit blog settings for %s'), $blog_id) . '">' . '<img src="images/edit-mini.png" alt="' . __('Edit blog settings') . '" /> ' . $blog_id . '</a> '; } else {