XpressEngine Core  1.11.2
 All Classes Namespaces Files Functions Variables Pages
document.admin.model.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 
13 {
18  function init()
19  {
20  }
21 
28  {
29  // check a list and its order
30  if(!in_array($obj->sort_index, array('list_order','delete_date','title'))) $obj->sort_index = 'list_order';
31  if(!in_array($obj->order_type, array('desc','asc'))) $obj->order_type = 'asc';
32  // get a module_srl if mid is returned instead of modul_srl
33  if($obj->mid)
34  {
35  $oModuleModel = getModel('module');
36  $obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid);
37  unset($obj->mid);
38  }
39  // check if the module_srl is an array
40  if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl);
41  else $args->module_srl = $obj->module_srl;
42  // Variable check
43  $args->sort_index = $obj->sort_index;
44  $args->order_type = $obj->order_type;
45  $args->page = $obj->page?$obj->page:1;
46  $args->list_count = $obj->list_count?$obj->list_count:20;
47  $args->page_count = $obj->page_count?$obj->page_count:10;
48  $args->member_srl = $obj->member_srl;
49  // Specify query_id
50  $query_id = 'document.getTrashList';
51  // Execute a query
52  $output = executeQueryArray($query_id, $args);
53  // Return if no result or an error occurs
54  if(!$output->toBool() || !count($output->data)) return $output;
55 
56  $idx = 0;
57  $data = $output->data;
58  unset($output->data);
59 
60  $keys = array_keys($data);
61  $virtual_number = $keys[0];
62 
63  foreach($data as $key => $attribute)
64  {
65  $oDocument = null;
66  $oDocument = new documentItem();
67  $oDocument->setAttribute($attribute, false);
68  if($is_admin) $oDocument->setGrant();
69 
70  $output->data[$virtual_number] = $oDocument;
71  $virtual_number--;
72  }
73 
74  return $output;
75  }
76 
82  function getDocumentTrash($trash_srl)
83  {
84  $args->trash_srl = $trash_srl;
85  $output = executeQuery('document.getTrash', $args);
86 
87  $node = $output->data;
88  if(!$node) return;
89 
90  return $node;
91  }
92 
100  function getDocumentCountByDate($date = '', $moduleSrlList = array(), $statusList = array())
101  {
102  $args = new stdClass();
103  if($date) $args->regDate = date('Ymd', strtotime($date));
104  if(count($moduleSrlList)>0) $args->moduleSrlList = $moduleSrlList;
105  if(count($statusList)>0) $args->statusList = $statusList;
106 
107  $output = executeQuery('document.getDocumentCountByDate', $args);
108  if(!$output->toBool()) return 0;
109 
110  return $output->data->count;
111  }
112 }
113 /* End of file document.admin.model.php */
114 /* Location: ./modules/document/document.admin.model.php */
$oModuleModel
Definition: ko.install.php:236
$obj
Definition: ko.install.php:262
$output
Definition: ko.install.php:193
getDocumentCountByDate($date= '', $moduleSrlList=array(), $statusList=array())
$args
Definition: ko.install.php:185
document the module&#39;s high class {
getModel($module_name)
Definition: func.inc.php:145
executeQueryArray($query_id, $args=NULL, $arg_columns=NULL)
Definition: func.inc.php:219
executeQuery($query_id, $args=NULL, $arg_columns=NULL)
Definition: func.inc.php:203