PluginProbe
CSS & JavaScript Toolbox / 11.6
CSS & JavaScript Toolbox v11.6
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 / fields / template-states.php

template-states.php in CSS & JavaScript Toolbox 11.6, at models/fields/template-states.php

38 lines 1.1 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 // Import dependencies.
7 cssJSToolbox::import('framework:html:list.php', 'framework:db:mysql:xtable.inc.php');
8
9 /**
10 *
11 */
12 class CJTTemplateStatesField extends CJTListField {
13
14 /**
15 * put your comment there...
16 *
17 */
18 protected function prepareItems() {
19 if (isset($this->options['result']) && ($this->options['result'] == 'fullList')) {
20 $this->items['published']['text'] = cssJSToolbox::getText('Published');
21 $this->items['draft']['text'] = cssJSToolbox::getText('Draft');
22 $this->items['trash']['text'] = cssJSToolbox::getText('Trash');
23 }
24 else {
25 CJTxTable::import('author');
26 $internalAuthorsFlag = CJTAuthorTable::FLAG_SYS_AUTHOR;
27 // Query all template state exluding Internal authors.
28 $query = "SELECT DISTINCT(state) `text`
29 FROM #__cjtoolbox_templates t
30 LEFT JOIN #__cjtoolbox_authors a
31 ON t.authorId = a.id
32 WHERE (a.attributes & {$internalAuthorsFlag}) = 0
33 ORDER BY `text`";
34 $this->items = cssJSToolbox::getInstance()->getDBDriver()->select($query);
35 }
36 }
37
38 } // End class.