XpressEngine Core  1.11.2
 All Classes Namespaces Files Functions Variables Pages
NavigationTag.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 
12 {
13 
18  var $order;
19 
25 
31 
36  var $page;
37 
42  var $limit;
43 
49  function __construct($xml_navigation)
50  {
51  $this->order = array();
52  if($xml_navigation)
53  {
54  $order = $xml_navigation->index;
55  if($order)
56  {
57  if(!is_array($order))
58  {
59  $order = array($order);
60  }
61  foreach($order as $order_info)
62  {
63  $this->order[] = new IndexTag($order_info);
64  }
65 
66  if($xml_navigation->page && $xml_navigation->page->attrs || $xml_navigation->list_count && $xml_navigation->list_count->attrs)
67  {
68  $this->limit = new LimitTag($xml_navigation);
69  }
70 
71  if($xml_navigation->list_count)
72  {
73  $this->list_count = $xml_navigation->list_count->attrs;
74  }
75 
76  if($xml_navigation->page_count)
77  {
78  $this->page_count = $xml_navigation->page_count->attrs;
79  }
80 
81  if($xml_navigation->page)
82  {
83  $this->page = $xml_navigation->page->attrs;
84  }
85  }
86  }
87  }
88 
93  function getOrderByString()
94  {
95  $output = 'array(' . PHP_EOL;
96  foreach($this->order as $order)
97  {
98  $output .= $order->toString() . PHP_EOL . ',';
99  }
100  $output = substr($output, 0, -1);
101  $output .= ')';
102  return $output;
103  }
104 
109  function getLimitString()
110  {
111  if($this->limit)
112  {
113  return $this->limit->toString();
114  }
115  else
116  {
117  return "";
118  }
119  }
120 
121  function getArguments()
122  {
123  $arguments = array();
124  foreach($this->order as $order)
125  {
126  $arguments = array_merge($order->getArguments(), $arguments);
127  }
128  if($this->limit)
129  {
130  $arguments = array_merge($this->limit->getArguments(), $arguments);
131  }
132  return $arguments;
133  }
134 
135 }
136 /* End of file NavigationTag.class.php */
137 /* Location: ./classes/xml/xmlquery/tags/navigation/NavigationTag.class.php */
$output
Definition: ko.install.php:193
high class of the module page
Definition: page.class.php:8
__construct($xml_navigation)