| 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 CJTTemplateAuthorsField extends CJTListField { |
| 13 |
|
| 14 |
/** |
| 15 |
* put your comment there... |
| 16 |
* |
| 17 |
*/ |
| 18 |
protected function prepareItems() { |
| 19 |
CJTxTable::import('author'); |
| 20 |
$internalAuthorsFlag = CJTAuthorTable::FLAG_SYS_AUTHOR; |
| 21 |
// Query CJT Authors + Wordpress build-in local users. |
| 22 |
$query = " SELECT a.id, a.name `text` |
| 23 |
FROM #__cjtoolbox_authors a |
| 24 |
RIGHT JOIN #__cjtoolbox_templates t |
| 25 |
ON a.id = t.authorId |
| 26 |
WHERE (a.attributes & {$internalAuthorsFlag}) = 0 |
| 27 |
ORDER BY `text`"; |
| 28 |
// Get all exists authors |
| 29 |
$this->items = cssJSToolbox::getInstance()->getDBDriver()->select($query); |
| 30 |
} |
| 31 |
|
| 32 |
} // End class. |