示例#1
0
 if ($docwatch_watch->get_id() != 0 && $docwatch_watch->check_rights() || $docwatch_watch->get_id() == 0 && in_array(SESSuserid, $allowed_users)) {
     $docwatch_watch->set_title(stripslashes($title));
     $docwatch_watch->set_ttl(stripslashes($ttl));
     $docwatch_watch->set_logo_url(stripslashes($logo_url));
     $docwatch_watch->set_desc(stripslashes($desc));
     $docwatch_watch->set_owner(stripslashes($owner));
     if (!$allowed_users) {
         $allowed_users = array();
     }
     $docwatch_watch->set_allowed_users($allowed_users);
     $docwatch_watch->set_num_category(stripslashes($parent));
     $docwatch_watch->set_record_default_status(stripslashes($record_status));
     $docwatch_watch->set_record_default_type(stripslashes($record_types));
     $docwatch_watch->set_article_default_content_type(stripslashes($article_type));
     $docwatch_watch->set_article_default_parent(stripslashes($article_parent));
     $docwatch_watch->set_article_default_publication_status(stripslashes($article_status));
     $docwatch_watch->set_section_default_content_type(stripslashes($section_type));
     $docwatch_watch->set_section_default_parent(stripslashes($section_parent));
     $docwatch_watch->set_section_default_publication_status(stripslashes($section_status));
     $result = $docwatch_watch->save();
     $response = "";
     if ($docwatch_watch->get_id()) {
         $response = $docwatch_watch->get_informations();
     }
     $response = array('result' => $result, 'elementId' => $docwatch_watch->get_id(), 'response' => $response);
     print encoding_normalize::json_encode($response);
 } else {
     $response = array('result' => false, 'elementId' => $docwatch_watch->get_id(), 'response' => "");
     print encoding_normalize::json_encode($response);
 }
 break;