PluginProbe
CSS & JavaScript Toolbox / 8.0.2
CSS & JavaScript Toolbox v8.0.2
trunk 0.3 0.8 10 10.1 11 11.2 11.3 11.4 11.5 11.6 11.7 11.8 11.9 11.9.1 12 12.0 12.0.1 12.0.3 12.0.4 12.0.5 12.0.6 12.0.7 6.0 6.0.11 All 60 releases
css-javascript-toolbox / models / block / assignmentpanel / taxonomy.php

taxonomy.php in CSS & JavaScript Toolbox 8.0.2, at models/block/assignmentpanel/taxonomy.php

61 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 *
4 */
5
6 /**
7 *
8 */
9 class CJT_Models_Block_Assignmentpanel_Taxonomy
10 extends CJT_Models_Block_Assignmentpanel_Taxonomybase {
11
12 /**
13 * put your comment there...
14 *
15 */
16 public function getTotalCount() {
17 // Initialize.
18 $args = $this->args;
19 $params =& $this->getTypeParams();
20 // Set args.
21 $args['fields'] = 'ids';
22 // Query posts.
23 return count(get_terms($params['type'], $args));
24 }
25
26 /**
27 * put your comment there...
28 *
29 */
30 protected function isHierarchical() {
31 // Initialize.
32 $typeParams =& $this->getTypeParams();
33 // Check if post_type hierarchical.
34 return is_taxonomy_hierarchical($typeParams['type']);
35 }
36
37 /**
38 * put your comment there...
39 *
40 *
41 */
42 protected function queryItems() {
43 // Initialize.
44 $args = $this->args;
45 $params =& $this->getTypeParams();
46 // Set User passed parameters used to query 'taxonomies'
47 if ($this->isHierarchical()) {
48 // Return them all for taxonomy doesn't
49 // require the end-offset ($args['number']) to be set.
50 $args['offset'] = 0;
51 }
52 else {
53 $args['offset'] = $this->getOffset();
54 $args['number'] = $this->getIPerPage();
55 }
56 // Query posts.
57 return get_terms($params['type'], $args);
58 }
59
60 } // End class.
61