function catarts() { if ($_SESSION['auth'] >= 6) { $ret = edit_categories(); } $csa = 'txtbox" align="center'; $css = 'txtx'; $r = sql('frm', 'qda', 'k', 'nod="' . ses('qb') . '" ORDER BY frm'); $rt = balc("tr", "", balc("td", $csa, nms(9)) . balc("td", $csa, 'nb')); if ($_SESSION['auth'] >= 6) { $lk = '/?admin=categories&modif='; } else { $lk = '/section/'; } if ($r) { foreach ($r as $k => $v) { $lnkcat = lka($lk . $k, $k); $rt .= bal("tr", balc("td", $css, $lnkcat) . balc("td", $css, $v)); } } $ret .= bal("table", $rt); return $ret; }
echo '<h1>' . $name . '</h1>'; break; case 'permissions': if ($func == 'mod_permissions') { mod_permissions($_POST['Sel'], $_POST['dest_group']); } $button_submit = $button->get_button($cmdOk, "this.form.Sel.value = makeStringFromSelect(this.form.SelItems); this.form.submit();"); $button_left = $button->get_button($cmdAdd, "javascript:addItems(this.form.AvailItems, this.form.SelItems);"); $button_right = $button->get_button($cmdDelete, "javascript:removeItems(this.form.SelItems);"); edit_permissions(); break; case 'categories': if ($func == 'update_categories') { update_categories($_POST['Sel']); } edit_categories(); break; case 'agents': if ($func == 'update_agents') { update_agents($_POST['Sel'], $_POST['dest_group']); } $button_submit = $button->get_button($cmdOk, "this.form.Sel.value = makeStringFromSelect(this.form.SelItems); this.form.submit();"); $button_left = $button->get_button($cmdAdd, "javascript:addItems(this.form.AvailItems, this.form.SelItems);"); $button_right = $button->get_button($cmdDelete, "javascript:removeItems(this.form.SelItems);"); echo '<table width=100%><tr>'; echo '<td>' . edit_agents() . '</td></tr></table>'; break; case 'projects': if ($func == 'update_projects') { update_projects($_POST['Sel']); }
/** * Handles conditionals for admin functions * * @return void */ function blog_admin_controller() { $Blog = new Blog(); getBlogUserPermissions(); global $blogUserPermissions; showAdminNav(); if (isset($_GET['edit_post']) && $blogUserPermissions['blogeditpost'] == true) { editPost($_GET['edit_post']); } elseif (isset($_GET['create_post']) && $blogUserPermissions['blogcreatepost'] == true) { editPost(); } elseif (isset($_GET['categories']) && $blogUserPermissions['blogcategories'] == true) { if (isset($_GET['edit_category'])) { $add_category = $Blog->saveCategory($_POST['new_category']); if ($add_category == true) { echo '<div class="updated">'; i18n(BLOGFILE . '/CATEGORY_ADDED'); echo '</div>'; } else { echo '<div class="error">'; i18n(BLOGFILE . '/CATEGORY_ERROR'); echo '</div>'; } } if (isset($_GET['delete_category'])) { $Blog->deleteCategory($_GET['delete_category']); } edit_categories(); } elseif (isset($_GET['auto_importer']) && $blogUserPermissions['blogrssimporter'] == true) { if (isset($_POST['post-rss'])) { $post_data = array(); $post_data['name'] = $_POST['post-rss']; $post_data['category'] = $_POST['post-category']; $add_feed = $Blog->saveRSS($post_data); if ($add_feed == true) { echo '<div class="updated">'; i18n(BLOGFILE . '/FEED_ADDED'); echo '</div>'; } else { echo '<div class="error">'; i18n(BLOGFILE . '/FEED_ERROR'); echo '</div>'; } } elseif (isset($_GET['delete_rss'])) { $delete_feed = $Blog->deleteRSS($_GET['delete_rss']); if ($delete_feed == true) { echo '<div class="updated">'; i18n(BLOGFILE . '/FEED_DELETED'); echo '</div>'; } else { echo '<div class="error">'; i18n(BLOGFILE . '/FEED_DELETE_ERROR'); echo '</div>'; } } edit_rss(); } elseif (isset($_GET['settings']) && $blogUserPermissions['blogsettings'] == true) { show_settings_admin(); } elseif (isset($_GET['help']) && $blogUserPermissions['bloghelp'] == true) { show_help_admin(); } elseif (isset($_GET['custom_fields']) && $blogUserPermissions['blogcustomfields'] == true) { $CustomFields = new customFields(); if (isset($_POST['save_custom_fields'])) { $saveCustomFields = $CustomFields->saveCustomFields(); if ($saveCustomFields) { echo '<div class="updated">' . i18n_r(BLOGFILE . '/EDIT_OK') . '</div>'; } } show_custom_fields(); } else { if (isset($_GET['save_post'])) { savePost(); } elseif (isset($_GET['delete_post']) && $blogUserPermissions['blogdeletepost'] == true) { $post_id = urldecode($_GET['delete_post']); $delete_post = $Blog->deletePost($post_id); if ($delete_post == true) { echo '<div class="updated">'; i18n(BLOGFILE . '/POST_DELETED'); echo '</div>'; } else { echo '<div class="error">'; i18n(BLOGFILE . '/FEED_DELETE_ERROR'); echo '</div>'; } } show_posts_admin(); } }