# css-javascript-toolbox/12/models/fields/template-owners.php

CSS &amp; JavaScript Toolbox, version 12. 28 lines.

- Page: https://pluginprobe.com/plugins/css-javascript-toolbox/12/code/models/fields/template-owners.php
- Raw: https://pluginprobe.com/plugins/css-javascript-toolbox/12/raw/models/fields/template-owners.php
- Modified: 2024-08-07T14:30:52+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/12/code/models/fields/template-owners.php#L10-L20`.

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

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

/**
* 
*/
class CJTTemplateOwnersField extends CJTListField {
	
	/**
	* put your comment there...
	* 
	*/
	protected function prepareItems() {
		// Query CJT Authors + Wordpress build-in local users.
		$query = ' SELECT o.ID id, o.user_login `text`
													FROM #__wordpress_users o
													RIGHT JOIN #__cjtoolbox_templates t
													ON o.ID = t.ownerId ORDER BY `text`';
		// Get all exists authors
		$this->items = cssJSToolbox::getInstance()->getDBDriver()->select($query);
	}
	
} // End class.
```
