Esempio n. 1
0
<?php

$page_title = 'Удаление категории';
$errors = array();
$id = intval(get_request_variable('id', 0));
$_REQUEST['callback'] = get_request_variable('callback', '');
$cat = new io_categories();
$cat->id = $id;
if ($id > 0) {
    if ($cat->Load()) {
        $errors = $cat->IsValidData();
        if (!$errors) {
            $cat->Delete();
        }
    }
}
include SITE_FILE_ROOT . 'template/simple_header.php';
include SITE_FILE_ROOT . 'template/' . $STORAGE['module'] . '/' . $STORAGE['action'] . '.php';
include SITE_FILE_ROOT . 'template/simple_footer.php';
Esempio n. 2
0
    }
}
if ($save && $kio_id > 0) {
    $category->is_system = $is_system;
    //
    $category->is_main = $is_main;
    //
    $category->id_child = $id_child;
    //
    $category->id_io_type = $kio_id;
    $category->name = $name;
    $category->code = $code;
    $category->description = $description;
    if ($id == 0) {
    }
    $errors = $category->IsValidData();
    if (count($errors) == 0) {
        $db->begin();
        $category->Save();
        $db->commit();
    } else {
        $save = 0;
    }
}
for ($i = 0; $i < count($STORAGE['menu']); $i++) {
    if (strpos($STORAGE['menu'][$i]['path'], 'category') !== false) {
        $menulevel = $STORAGE['menu'][$i];
        break;
    }
}
$STORAGE['site_path'][] = array('name' => $menulevel['name'], 'path' => $menulevel['path']);