# css-javascript-toolbox/8.0.2/models/fields/template-development-states.php

CSS &amp; JavaScript Toolbox, version 8.0.2. 44 lines.

- Page: https://pluginprobe.com/plugins/css-javascript-toolbox/8.0.2/code/models/fields/template-development-states.php
- Raw: https://pluginprobe.com/plugins/css-javascript-toolbox/8.0.2/raw/models/fields/template-development-states.php
- Modified: 2014-05-06T16:47:26+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/css-javascript-toolbox/8.0.2/code/models/fields/template-development-states.php#L10-L20`.

```php
<?php
/**
* 
*/

// Import dependencies.
cssJSToolbox::import('framework:html:list.php', 'framework:db:mysql:xtable.inc.php');

/**
* 
*/
class CJTTemplateDevelopmentStatesField extends CJTListField {
	
	/**
	* put your comment there...
	* 
	*/
	protected function prepareItems() {
		if ((isset($this->options['result'])) && ($this->options['result'] == 'fullList')) {
			$this->items['release']['text'] = cssJSToolbox::getText('release');
			$this->items['beta']['text'] = cssJSToolbox::getText('beta');
			$this->items['alpha']['text'] = cssJSToolbox::getText('alpha');
			$this->items['release-candidate']['text'] = cssJSToolbox::getText('release-candidate');
			$this->items['revision']['text'] = cssJSToolbox::getText('revision');
		}
		else {
			// Import dependencies.
			CJTxTable::import('template-revision');
			CJTxTable::import('author');
			$lastVersionFlag = CJTTemplateRevisionTable::FLAG_LAST_REVISION;
			$internalAuthorsFlag = CJTAuthorTable::FLAG_SYS_AUTHOR;
			$query = "SELECT DISTINCT(r.state) `text` 
														FROM #__cjtoolbox_template_revisions r
														LEFT JOIN #__cjtoolbox_templates t
														ON  r.templateId = t.id
														LEFT JOIN #__cjtoolbox_authors a
														ON  t.authorId = a.id
														WHERE (r.attributes & {$lastVersionFlag}) AND (a.attributes & {$internalAuthorsFlag}) = 0
														ORDER BY `text`";
			$this->items = cssJSToolbox::getInstance()->getDBDriver()->select($query);			
		}
	}
	
} // End class.
```
