當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Annotation::export_data方法代碼示例

本文整理匯總了PHP中Annotation::export_data方法的典型用法代碼示例。如果您正苦於以下問題:PHP Annotation::export_data方法的具體用法?PHP Annotation::export_data怎麽用?PHP Annotation::export_data使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Annotation的用法示例。


在下文中一共展示了Annotation::export_data方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: get_annotation

 public function get_annotation($json, $callback)
 {
     $data = json_to_array($json);
     $annotation_id = $data["annotation_id"];
     //test_msg($annotation_id);
     $annotation = new Annotation($annotation_id);
     $data = array('annotation' => $annotation->export_data());
     $this->_display_jsonp($data, $callback);
 }
開發者ID:119155012,項目名稱:kals,代碼行數:9,代碼來源:kals_model.php

示例2: Annotation

 function list_annotation($json, $callback = NULL)
 {
     $enable_profiler = FALSE;
     if ($enable_profiler === TRUE) {
         $this->output->enable_profiler(TRUE);
     }
     if (is_string($json)) {
         $data = json_to_object($json);
     } else {
         $data = $json;
     }
     $user = get_context_user();
     $url = $this->url;
     $search = new Search_annotation_collection();
     $search_id = null;
     if (isset($data->limit)) {
         $search_id = new Search_annotation_id_collection();
     }
     // 1 [ topic id ]
     if (isset($data->topic_id) && isset($data->target_topic) && $data->target_topic === TRUE) {
         $annotation = new Annotation($data->topic_id);
         $output_data = array('annotation_collection' => array($annotation->export_data()), 'totally_loaded' => true);
         return $this->_display_jsonp($output_data, $callback);
     } else {
         if (isset($data->topic_id) && isset($data->target_topic) && $data->target_topic === FALSE) {
             $search->set_target_topic_id($data->topic_id);
             if (isset($search_id)) {
                 $search_id->set_target_topic_id($data->topic_id);
             }
         }
     }
     // 2 [ scope ]
     //test_msg('2 [ scope ]', is_null($data->scope));
     //如果沒有設定範圍,則直接回傳空值
     //if (is_null($data->scope))
     //{
     //    //return $this->_create_null_list($callback);
     //}
     if (isset($data->scope)) {
         $scope_coll_data = $data->scope;
         //test_msg('2 [ scope ] 2', is_null($data->scope));
         $scope_coll = $this->annotation_scope_collection->import_webpage_search_data($url, $scope_coll_data);
         //test_msg($scope_coll->export_json());
         $search->set_overlap_scope($scope_coll);
         if (isset($search_id)) {
             $search_id->set_overlap_scope($scope_coll);
         }
         //test_msg('2 [ scope ] 3', is_null($data->scope));
     }
     // 3 [ target like ]
     // 4 [ target my ]
     //test_msg('3 [ target like ] 4 [ target my ]');
     if ((isset($data->target_like) or isset($data->target_my)) && is_null($user)) {
         return $this->_create_null_list($callback);
     }
     if (isset($data->target_like)) {
         $search->set_target_like($data->target_like, $user);
         if (isset($search_id)) {
             $search_id->set_target_like($data->target_like, $user);
         }
     }
     if (isset($data->target_my)) {
         if ($data->target_my === TRUE) {
             $search->set_target_user($user);
             if (isset($search_id)) {
                 $search_id->set_target_user($user);
             }
         } else {
             $search->set_exclude_user($user);
             if (isset($search_id)) {
                 $search_id->set_exclude_user($user);
             }
         }
     }
     // 5 [ target_topic ]
     if (isset($data->target_topic)) {
         $search->set_target_topic($data->target_topic);
         if (isset($search_id)) {
             $search_id->set_target_topic($data->target_topic);
         }
     }
     // 6 [ order by ]
     // 6 [ is_desc]
     //test_msg('6 [ order by ]', isset($data->order_by));
     //test_msg('6 [ order by ] direction', $data->direction);
     $order_id = 1;
     $default_direction = TRUE;
     if (isset($data->order_by)) {
         if ($data->order_by == 'update') {
             $order_id = 6;
             $default_direction = TRUE;
         } else {
             if ($data->order_by == 'create') {
                 $order_id = 7;
                 $default_direction = TRUE;
             } else {
                 // 依照分數排序
                 $order_id = 1;
                 $default_direction = TRUE;
             }
//.........這裏部分代碼省略.........
開發者ID:119155012,項目名稱:kals,代碼行數:101,代碼來源:annotation_getter.php


注:本文中的Annotation::export_data方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。