本文整理汇总了PHP中categories::deleteCat方法的典型用法代码示例。如果您正苦于以下问题:PHP categories::deleteCat方法的具体用法?PHP categories::deleteCat怎么用?PHP categories::deleteCat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类categories
的用法示例。
在下文中一共展示了categories::deleteCat方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Categories
function Categories($act = 'getlist', $val = '', $adminPanel = 'NULL')
{
global $db, $smarty, $conf;
$categories = new categories();
switch ($act) {
case 'getlist':
$output = $categories->build_list($val);
break;
case 'getlistcollapsed':
$output = $categories->build_list($val, "collapsed");
break;
case 'getsubcat':
$output = $categories->browse_by_id($val);
break;
case 'getParent':
$output = $categories->getParent($val);
break;
case 'add':
$output = $categories->add_new($val['parent'], $val["name"], $val["desc"], $val["icon"], $val["strip"]);
break;
case 'update':
$output = $categories->update($val['id'], $val['parent'], $val["name"], $val["desc"], $val["icon"], $val["strip"]);
break;
case 'delete':
$output = $categories->deleteCat($val['catFrom'], $val['catTo'], $val["cat_action"]);
break;
case 'getOne':
$output = $categories->getOne($val);
break;
case 'html':
if ($adminPanel === true) {
$categories->HtmlTree = array("header" => "<ul class='unstyled'>", "BodyUnselected" => '<li> [prefix] <a href="' . $conf['baseurl'] . '/admincp/categories/?catid=[id]&tokenAdmin=' . $_COOKIE['tokenAdmin'] . '"> [name] </a> </li>', "BodySelected" => '<li> [prefix] <a href="' . $conf['baseurl'] . '/admincp/categories/?catid=[id]&tokenAdmin=' . $_COOKIE['tokenAdmin'] . '"><strong><font color="#000000">[name]</font></strong></a> </li>', "footer" => '</ul>');
} else {
$categories->HtmlTree = array("header" => "<ul class='nav nav-tabs nav-stacked'>", "BodyUnselected" => '<li> <a href="' . $conf['baseurl'] . '/' . $this->makeUrl(array('page' => 'torrents', 'cat' => 'categorie', 'catid' => '[id]')) . '"> [name] </a> </li>', "BodySelected" => '<li> <a href="' . $conf['baseurl'] . '/' . $this->makeUrl(array('page' => 'torrents', 'cat' => 'categorie', 'catid' => '[id]')) . '"><strong><font color="#000000">[name]</font></strong></a> </li>', "footer" => '</ul>');
}
$output = $categories->html_output($val);
break;
}
return $output;
}
示例2: delete_all
<?php
/*
Deletes the user with the userId that is passed
Should be used by admin to controll users and by users themselves to eliminate their account.
*/
// header('Content-Type: application/json');
require '../class.categories.inc';
// GET The info from POST called by Ajax method
$nameCat = $_POST['nameCat'];
$category = new categories();
$category->nameCat = $nameCat;
//Calls method to store users onto the database and Returns 1 if the the user was stored and 0 if the user could not be stored
$catDelete = $category->deleteCat($category);
$returnDelete = array('success' => false);
//Assign values to array that will be returned with success true if the user was stored and false if not (user already exists)
if ($catDelete != 0) {
$returnDelete['success'] = true;
delete_all('../../categories/' . $category->nameCat);
}
// Function used to delete folders with images inside of them
function delete_all($item)
{
if (is_dir($item)) {
array_map('delete_all', array_diff(glob("{$item}/{,.}*", GLOB_BRACE), array("{$item}/.", "{$item}/..")));
rmdir($item);
} else {
unlink($item);
}
}
//Return for jason to work with