PluginProbe
CSS & JavaScript Toolbox / 8.0.3
CSS & JavaScript Toolbox v8.0.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 / postpinned.php

postpinned.php in CSS & JavaScript Toolbox 8.0.3, at models/block/assignmentpanel/postpinned.php

69 lines 1.3 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_Postpinned
10 extends CJT_Models_Block_Assignmentpanel_Postbase {
11
12 /**
13 * put your comment there...
14 *
15 */
16 public function getTotalCount() {
17 return count($this->getPinsMap());
18 }
19
20 /**
21 * put your comment there...
22 *
23 */
24 protected function isHierarchical() {
25 return false;
26 }
27
28 /**
29 * put your comment there...
30 *
31 * @param mixed $key
32 * @param mixed $item
33 */
34 protected function prepareItem($key, & $item) {
35 // Prepare item.
36 parent::prepareItem($key, $item);
37 // No parents used in assignedOnly items.
38 $item['parent'] = 0;
39 }
40
41 /**
42 * put your comment there...
43 *
44 *
45 */
46 protected function queryItems() {
47 // All assigned items is fetched in the first request
48 // Multiple requestes is now allowed.
49 if ($this->getOffset()) {
50 return array();
51 }
52 // Initialize.
53 $params = $this->getTypeParams();
54 // Get all assigned IDs.
55 $ids = array_keys($this->getPinsMap());
56 // Query all available Ids.
57 $args = $this->args;
58 $args['post_type'] = $params['type'];
59 $args['post__in'] = $ids;
60 $args['offset'] = $this->getOffset();
61 $args['numberposts'] = -1;
62 // Return empty list if nothing assigned
63 // or the queried items otherwise.
64 $items = empty($ids) ? array() : get_posts($args);
65 // Returns.
66 return $items;
67 }
68
69 } // End class.