PluginProbe
CSS & JavaScript Toolbox / 11.3
CSS & JavaScript Toolbox v11.3
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 / post.php

post.php in CSS & JavaScript Toolbox 11.3, at models/block/assignmentpanel/post.php

63 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_Post
10 extends CJT_Models_Block_Assignmentpanel_Postbase {
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['offset'] = 0;
22 $args['numberposts'] = -1;
23 $args['post_type'] = $params['type'];
24 // Query posts.
25 return count(get_posts($args));
26 }
27
28 /**
29 * put your comment there...
30 *
31 */
32 protected function isHierarchical() {
33 // Initialize.
34 $typeParams =& $this->getTypeParams();
35 // Check if post_type hierarchical.
36 return is_post_type_hierarchical($typeParams['type']);
37 }
38
39 /**
40 * put your comment there...
41 *
42 *
43 */
44 protected function queryItems() {
45 // Initialize.
46 $args = $this->args;
47 $params =& $this->getTypeParams();
48 // Set User passed parameters used to query 'posts'
49 if ($this->isHierarchical()) {
50 // Fetch all for Hierarchical posts.
51 $args['offset'] = 0;
52 $args['numberposts'] = -1;
53 }
54 else {
55 $args['offset'] = $this->getOffset();
56 $args['numberposts'] = $this->getIPerPage();
57 }
58 $args['post_type'] = $params['type'];
59 // Query posts.
60 return get_posts($args);
61 }
62
63 } // End class.