本文整理汇总了PHP中Links::delete_category方法的典型用法代码示例。如果您正苦于以下问题:PHP Links::delete_category方法的具体用法?PHP Links::delete_category怎么用?PHP Links::delete_category使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Links
的用法示例。
在下文中一共展示了Links::delete_category方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: catch
$Links->title = $_POST['title'];
$Links->url = Validation::validate_url($_POST['url']);
try {
$Links->save_link();
$json_string = '{ "errors" : "Link has been added successfully", "updated_category_id" : ' . $_POST['category_id'] . '}';
} catch (PAException $e) {
$json_string = '{ "is_error" : true, "errors" : "' . $e->message . '"}';
}
print $json_string;
} else {
if (!empty($_POST) && $_POST['form_action'] == 'remove_list') {
$Links = new Links();
$Links->user_id = $_SESSION['user']['id'];
$Links->category_id = $_POST['category_id'];
try {
$Links->delete_category(true);
$json_string = '{ "errors" : "List has been deleted successfully"}';
} catch (PAException $e) {
$json_string = '{ "is_error" : true, "errors" : "' . $e->message . '"}';
}
print $json_string;
/**
* Updating the list or category of links
*/
} else {
if (!empty($_POST) && $_POST['form_action'] == 'edit_list') {
if (!empty($_POST['updated_category_name'])) {
$Links = new Links();
$Links->user_id = $_SESSION['user']['id'];
$Links->category_name = $_POST['updated_category_name'];
$Links->category_id = $_POST['category_id'];
示例2: setup_module
$Links = new Links();
$param_array = array('user_id' => $_SESSION['user']['id'], 'changed' => time(), 'link_id' => $link_ids);
$Links->set_params($param_array);
try {
$Links->delete_link();
$error_array[] = "Links deleted successfully";
} catch (PAException $e) {
$error_array[] = $e->message;
}
} else {
if (!empty($_POST['form_action']) && $_POST['form_action'] == "delete_category" && !empty($_POST['link_categories'])) {
$param_array = array('user_id' => $_SESSION['user']['id'], 'category_id' => $_POST['category_id'], 'changed' => time());
$Links = new Links();
$Links->set_params($param_array);
try {
$Links->delete_category();
$error_array[] = "Category deleted successfully";
} catch (PAException $e) {
$error_array[] = $e->message;
}
}
}
}
}
//error displaying
function setup_module($column, $moduleName, $obj)
{
global $content_type, $users, $uid, $group_ids, $user;
switch ($column) {
case 'middle':
$obj->orientation = CENTER;