当前位置: 首页>>代码示例>>PHP>>正文


PHP Links::delete_category方法代码示例

本文整理汇总了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'];
开发者ID:Cyberspace-Networks,项目名称:PeopleAggregator,代码行数:31,代码来源:ajax_links.php

示例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;
开发者ID:CivicCommons,项目名称:oldBellCaPA,代码行数:31,代码来源:links_management.php


注:本文中的Links::delete_category方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。