Beispiel #1
0
 * other free or open source software licenses.
 * See COPYRIGHT.php for copyright notices and details.
 */
// no direct access
defined('_JEXEC') or die('Restricted access');
require_once JApplicationHelper::getPath('admin_html');
// get parameters from the URL or submitted form
$section = JRequest::getCmd('section', 'com_content');
$cid = JRequest::getVar('cid', array(0), '', 'array');
JArrayHelper::toInteger($cid, array(0));
switch (JRequest::getCmd('task')) {
    case 'add':
        editCategory(false);
        break;
    case 'edit':
        editCategory(true);
        break;
    case 'moveselect':
        moveCategorySelect($option, $cid, $section);
        break;
    case 'movesave':
        moveCategorySave($cid, $section);
        break;
    case 'copyselect':
        copyCategorySelect($option, $cid, $section);
        break;
    case 'copysave':
        copyCategorySave($cid, $section);
        break;
    case 'go2menu':
    case 'go2menuitem':
/**
 * newCategory()
 *
 * @return
 */
function newCategory()
{
    editCategory();
}
Beispiel #3
0
    }
    return $msg;
}
//Control logic
if ($privs >= 4) {
    //manager or admin
    $msg = '';
    if (isset($_POST['addExe'])) {
        $msg = addCat($cat);
    } elseif (isset($_POST['updExe'])) {
        $msg = updateCat($cat);
    } elseif (isset($_GET['delExe'])) {
        $msg = deleteCat($cat);
    }
    echo "<p class='error'>{$msg}</p>\n\t\t<div class='scrollBoxAd'>\n\t\t<div class='centerBox'>\n";
    if ($mode == 'sort') {
        sortCategories();
        //sort on name
    }
    if ($mode != 'add' and $mode != 'edit' or isset($_POST['back'])) {
        showCategories(false);
        //no add / no edit
    } else {
        editCategory($cat);
        //add or edit
        showCategories(true);
    }
    echo "</div>\n</div>\n";
} else {
    echo "<p class='error'>{$ax['no_way']}</p>\n";
}
Beispiel #4
0
             break;
         }
     }
 case 'editcategory':
     if ($isallowed && $mode == 'editcategory') {
         $smarty->assign('languages', $lang->listLanguages());
         $grouplist = $rights->getAllGroups();
         $smarty->assign('groups', $grouplist);
         if (isset($_POST['save'])) {
             $assigned_groups = array();
             foreach ($grouplist as $group) {
                 if (@$_POST['group_' . $group['groupid']] == '1') {
                     $assigned_groups[] = $group['groupid'];
                 }
             }
             editCategory($categoryid, $_POST['name'], $assigned_groups, $_POST['language']);
         } else {
             $breadcrumbs->addElement($lang->get('editcategory'), makeURL($mod, array('mode' => 'editcategory', 'categoryid' => $categoryid)));
             $category = getCategory($categoryid);
             $smarty->assign('category', $category);
             $assigned_groups = array_row($db->selectList('media_categories_permissions', '*', '`categoryid`=' . $categoryid), 'groupid');
             $smarty->assign('permissions', $assigned_groups);
             $smarty->assign('path', $template_dir . "/editcategory.tpl");
             break;
         }
     }
 case 'createcategory':
     if ($isallowed && $mode == 'createcategory') {
         $smarty->assign('languages', $lang->listLanguages());
         $grouplist = $rights->getAllGroups();
         $smarty->assign('groups', $grouplist);
Beispiel #5
0
/* TEST DE LA VARIABLE ACTION PASSER EN AJAX 
	POUR DETERMINER QUELLE FONCTION EST APPELER */
if (isset($_POST['action']) && !empty($_POST['action'])) {
    $action = $_POST['action'];
    switch ($action) {
        case 'getAllCategoriesDT':
            echo getAllCategoriesDT();
            break;
        case 'deleteCategory':
            $id = $_POST['id'];
            echo deleteCategory($id);
            break;
        case 'editCategory':
            $id = $_POST['id'];
            $category = $_POST['category'];
            echo editCategory($id, $category);
            break;
        case 'createCategory':
            $category = $_POST['category'];
            echo createCategory($category);
            break;
    }
}
function getAllCategoriesDT()
{
    global $bdd, $_TABLES;
    if (!is_null($bdd) && !is_null($_TABLES)) {
        $content = '<thead>';
        $content .= '<tr>';
        $content .= '<th>Id</th>';
        $content .= '<th>Category</th>';
Beispiel #6
0
 case "config":
     editConfig($fpss_config, $option);
     break;
     // CATEGORIES
 // CATEGORIES
 case "cancel_category":
     cancelCategory($option);
     break;
 case "categories":
     showCategories($option);
     break;
 case "new_category":
     editCategory(0, $option);
     break;
 case "edit_category":
     editCategory($cid, $option);
     break;
 case "save_category":
     saveCategory($option);
     break;
 case "delete_category":
     deleteCategories($option);
     break;
 case "publish_category":
     publishCategories(1, $option);
     break;
 case "unpublish_category":
     publishCategories(0, $option);
     break;
     // SLIDES
 // SLIDES
Beispiel #7
0
*/
/** ensure this file is being included by a parent file */
defined('_VALID_MOS') or die('Direct Access to this location is not allowed.');
require_once $mainframe->getPath('admin_html');
// get parameters from the URL or submitted form
$section = mosGetParam($_REQUEST, 'section', '');
$cid = mosGetParam($_REQUEST, 'cid', array(0));
if (!is_array($cid)) {
    $cid = array(0);
}
switch ($task) {
    case "new":
        editCategory(0, $section);
        break;
    case "edit":
        editCategory(intval($cid[0]));
        break;
    case "moveselect":
        moveCategorySelect($option, $cid, $section);
        break;
    case "movesave":
        moveCategorySave($option, $cid, $section);
        break;
    case "copyselect":
        copyCategorySelect($option, $cid, $section);
        break;
    case "copysave":
        copyCategorySave($option, $cid, $section);
        break;
    case "save":
        saveCategory();
"></p>
</form>
<?php 
}
if (!$_SESSION["user_id"]) {
    mysql_close($link);
    header("Location: " . $path . "login.php?return_to=" . $PHP_SELF);
} else {
    include "includes/header.php";
    $query = mysql_query("SELECT add_categories from " . $table_prefix . "users where user_id = " . $_SESSION["user_id"] . " limit 1");
    $row = mysql_fetch_row($query);
    if ($row[0] == 1) {
        $edit = true;
    } else {
        echo "<p class=\"warning\">" . $lang["not_authorized_edit_categories"] . "</p>\n";
    }
}
if ($edit) {
    switch ($_REQUEST["mode"]) {
        case "edit_category":
            editCategory($id);
            break;
        case "delete_category":
            deleteCategory($id);
            break;
        default:
            showCategories();
            break;
    }
}
include "includes/footer.php";
Beispiel #9
0
    if (strlen($name) < 3 || strlen($name) > 32) {
        $error['name'] = $lang['error_category_name'];
    }
    if (empty($error)) {
        if ($action == "insert") {
            $insert_data = array('name' => $name);
            $insert_query = insertCategory($insert_data);
            if ($insert_query) {
                $_SESSION['success'] = $lang['success_insert'];
            } else {
                $error_warning = $lang['error_query'];
            }
        } else {
            if ($action == "update") {
                $edit_data = array('categoryId' => $category_id, 'name' => $name);
                $edit_query = editCategory($edit_data);
                if ($edit_query) {
                    $_SESSION['success'] = $lang['success_edit'];
                } else {
                    $_SESSION['error_warning'] = $lang['error_query'];
                }
            }
        }
        header('Location:category.html');
    } else {
        $error_name = $error['name'];
    }
}
?>

<div id="content">
function Categories_Spider_Catalog()
{
    ////////including functions for categories
    require_once "Categories.php";
    require_once "Categories.html.php";
    if (!function_exists('print_html_nav')) {
        require_once "nav_function/nav_html_func.php";
    }
    if (isset($_GET["task"])) {
        $task = $_GET["task"];
    } else {
        $task = '';
    }
    if (isset($_GET["id"])) {
        $id = $_GET["id"];
    } else {
        $id = 0;
    }
    global $wpdb;
    switch ($task) {
        case 'add_cat':
            add_category();
            break;
        case 'publish_cat':
            $nonce_sp_cat = $_REQUEST['_wpnonce'];
            if (!wp_verify_nonce($nonce_sp_cat, 'nonce_sp_cat')) {
                die("Are you sure you want to do this?");
            }
            change_cat($id);
            showCategory();
            break;
        case 'publish':
            check_admin_referer('nonce_sp_cat', 'nonce_sp_cat');
            publish_all(TRUE);
            showCategory();
            break;
        case 'unpublish_cat':
            $nonce_sp_cat = $_REQUEST['_wpnonce'];
            if (!wp_verify_nonce($nonce_sp_cat, 'nonce_sp_cat')) {
                die("Are you sure you want to do this?");
            }
            change_cat($id);
            showCategory();
            break;
        case 'unpublish':
            check_admin_referer('nonce_sp_cat', 'nonce_sp_cat');
            publish_all(FALSE);
            showCategory();
            break;
        case 'edit_cat':
            if ($id) {
                editCategory($id);
            } else {
                $id = $wpdb->get_var("SELECT MAX( id ) FROM " . $wpdb->prefix . "spidercatalog_product_categories");
                editCategory($id);
            }
            break;
        case 'save':
            if ($id) {
                check_admin_referer('nonce_sp_cat', 'nonce_sp_cat');
                apply_cat($id);
            } else {
                save_cat();
                check_admin_referer('nonce_sp_cat', 'nonce_sp_cat');
            }
            showCategory();
            break;
        case 'apply':
            if ($id) {
                check_admin_referer('nonce_sp_cat', 'nonce_sp_cat');
                apply_cat($id);
                editCategory($id);
            } else {
                check_admin_referer('nonce_sp_cat', 'nonce_sp_cat');
                $true = save_cat();
                if ($true) {
                    $id = $wpdb->get_var("SELECT MAX( id ) FROM " . $wpdb->prefix . "spidercatalog_product_categories");
                    editCategory($id);
                } else {
                    ?>
<h1>Database Error Please install plugin again</h1><?php 
                    showCategory();
                }
            }
            break;
        case 'remove_cat':
            $nonce_sp_cat = $_REQUEST['_wpnonce'];
            if (!wp_verify_nonce($nonce_sp_cat, 'nonce_sp_cat')) {
                die("Are you sure you want to do this?");
            }
            removeCategory($id);
            showCategory();
            break;
        case 'delete':
            check_admin_referer('nonce_sp_cat', 'nonce_sp_cat');
            delete_all();
            showCategory();
            break;
        default:
            showCategory();
            break;
    }
}
Beispiel #11
0
 function _editCategory($post)
 {
     $retval = true;
     require_once './include/spCategory.inc.php';
     if ($post) {
         $this->_ajaxResult = editCategory($this->_db, $this->_action);
     } else {
         if ($this->_action !== ACT_BMCAT_ADD) {
             getCategory($this->_db, $GLOBALS[ARG_BMCAT_ID]);
         }
         $this->_theme->render('dlgCatEdit.tpl');
     }
 }
Beispiel #12
0
}
switch ($cmd) {
    case "addCategory":
        addCategory();
        break;
    case "finishCategory":
        finishCategory($_POST['name'], $_POST['parent'], $_POST['image']);
        break;
    case "addBlogEntry":
        addBlogEntry($_POST['blog_category']);
        break;
    case "finishBlogEntry":
        finishBlogEntry($_POST['entry_category'], $_POST['entry_title'], $_POST['entry_text'], $_POST['entry_ext_text']);
        break;
    case "editCategory":
        editCategory($_GET['id']);
        break;
    case "finishEditCategory":
        finishEditCategory($_POST['id'], $_POST['name'], $_POST['parent'], $_POST['image']);
        break;
    case "deleteCategory":
        deleteCategory($_GET['id']);
        break;
    case "edit":
        editBlogEntry($_GET['id']);
        break;
    case "finishEdit":
        finishEditBlogEntry($_POST['id'], $_POST['editBlogCategory'], $_POST['editBlogTitle'], $_POST['editBlogText'], $_POST['editBlogExtText']);
        break;
    case "delete":
        deleteBlogEntry($_GET['id']);
// no direct access
defined('_VALID_MOS') or die('Restricted access');
require_once $mainframe->getPath('admin_html');
define('COM_IMAGE_BASE', $mosConfig_absolute_path . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'stories');
// get parameters from the URL or submitted form
$section = stripslashes(strval(mosGetParam($_REQUEST, 'section', 'content')));
$cid = josGetArrayInts('cid');
switch ($task) {
    case 'new':
        editCategory(0, $section);
        break;
    case 'edit':
        editCategory(intval($cid[0]));
        break;
    case 'editA':
        editCategory(intval($id));
        break;
    case 'moveselect':
        moveCategorySelect($option, $cid, $section);
        break;
    case 'movesave':
        moveCategorySave($cid, $section);
        break;
    case 'copyselect':
        copyCategorySelect($option, $cid, $section);
        break;
    case 'copysave':
        copyCategorySave($cid, $section);
        break;
    case 'go2menu':
    case 'go2menuitem':
Beispiel #14
0
                dbQuery("UPDATE [db]categories SET sequence=" . $count++ . " WHERE category_id = " . $row['cid']);
            }
        }
    }
    return $msg;
}
//Control logic
if ($privs >= 4) {
    //manager or admin
    $msg = '';
    if (isset($_POST['addExe'])) {
        $msg = addCat();
    } elseif (isset($_POST['updExe'])) {
        $msg = updateCat();
    } elseif (isset($_GET['delExe'])) {
        $msg = deleteCat();
    }
    echo "<p class='error'>{$msg}</p>\n\t\t<div class='scrollBoxAd'>\n\t\t<div class='centerBox'>\n";
    if (!$editCat or isset($_POST['back'])) {
        showCategories(false);
        //no edit
    } else {
        editCategory($editCat, $cid);
        //action = "add" or "edit"
        showCategories(true);
        //edit
    }
    echo "</div>\n</div>\n";
} else {
    echo "<p class='error'>{$ax['no_way']}</p>\n";
}
require_once $_SERVER['DOCUMENT_ROOT'] . '/LibraryManagement/Classes/Entity/Account.php';
redirectPageWithoutSession();
require_once $_SERVER['DOCUMENT_ROOT'] . '/LibraryManagement/Classes/Global/PreDefinedConstants.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/LibraryManagement/Classes/Global/CommonFunctions.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/LibraryManagement/Classes/DatabaseLogic/DBConnection.php';
$actionType = ACTION_ADD;
// Default Action
if (isset($_GET[ACTION_TYPE]) && $_GET[ACTION_TYPE] != NULL) {
    switch ($_GET[ACTION_TYPE]) {
        case ACTION_EDIT:
            $actionType = ACTION_EDIT;
            checkNullwithRedirect(ADD_CATEGORY_PAGE, $_GET[CATEGORY_ID]);
            checkNullwithRedirect(ADD_CATEGORY_PAGE, $_GET[CATEGORY_NAME]);
            checkNullwithRedirect(ADD_CATEGORY_PAGE, $_GET[SECTION_ID]);
            checkNullwithRedirect(ADD_CATEGORY_PAGE, $_GET[PARENT_CATEGORY_ID]);
            editCategory();
            exit;
            break;
        case ACTION_DEL:
            $actionType = ACTION_DEL;
            checkNullwithRedirect(ADD_CATEGORY_PAGE, $_GET[CATEGORY_ID]);
            delCategory();
            exit;
            break;
        case ACTION_ADD:
        default:
            break;
    }
}
checkNullwithRedirect(ADD_CATEGORY_PAGE, $_GET[CATEGORY_NAME]);
checkNullwithRedirect(ADD_CATEGORY_PAGE, $_GET[SECTION_ID]);
Beispiel #16
0
 * @version		$Id: categories.php 1050 2009-12-14 17:32:05Z mathias $
 * @category	DOCman
 * @package		DOCman15
 * @copyright	Copyright (C) 2003 - 2009 Johan Janssens and Mathias Verraes. All rights reserved.
 * @license		GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
 * @link     	http://www.joomladocman.org
 */
defined('_JEXEC') or die('Restricted access');
include_once dirname(__FILE__) . '/categories.html.php';
JArrayHelper::toInteger($cid);
switch ($task) {
    case "edit":
        editCategory($option, $cid[0]);
        break;
    case "new":
        editCategory($option, 0);
        break;
    case "cancel":
        cancelCategory();
        break;
    case "save":
    case "apply":
        saveCategory();
        break;
    case "remove":
        removeCategories($option, $cid);
        break;
    case "publish":
        publishCategories("com_docman", $id, $cid, 1);
        break;
    case "unpublish":
Beispiel #17
0
if ($_GET['delete_id']) {

    $delete_id = $_GET['delete_id'];
    $sql = "DELETE FROM sohorepro_category WHERE id = " . $delete_id . " ";

    $sql_result = mysql_query($sql);
    if ($sql_result) {
        $result = "success_del";
    } else {
        $result = "failure_del";
    }
}
?>
<?php
$id = $_GET['id'];
$editSubCategory = editCategory($id);
$active_category = getCategoryActive();
if ($_REQUEST['edi_subcat'] == '1') {
    extract($_POST);
    $sql = "UPDATE sohorepro_category
			SET     category_name = '" . $subcategory_name . "',
                                parent_id     = '" . $category_name . "',
				status = '" . $status . "' WHERE id = " . $id . " ";

    $sql_result = mysql_query($sql);
    if ($sql_result) {
        $result = "success";
    } else {
        $result = "failure";
    }
}
<?php

include_once __DIR__ . '/templates/_libAdmin.php';
include_once __DIR__ . '/templates/_header.php';
include_once __DIR__ . '/templates/_top_menu.php';
echo "<div class='wr_cont'>";
if (isset($_GET['item_act'])) {
    if (isset($_GET['item_id'])) {
        $t_id = $_GET['item_id'];
    }
    switch ($_GET['item_act']) {
        case 'edit':
            editCategory($connection);
            echo "Категория с id='" . $t_id . "' успешно изменена<br/><br/>";
            break;
        case 'del':
            deleteCategory($t_id, $connection);
            echo "Категория с id='" . $t_id . "' успешно удалена<br/><br/>";
            break;
        case 'add':
            addCategory($connection);
            echo "Категория успешно добавлена<br/><br/>";
            break;
    }
}
//вывод таблицы категорий на странице редактирования категорий
showTableCategories($connection);
echo "</div>";
include_once __DIR__ . '/templates/_footer.php';