| 1 |
<?php |
| 2 |
/** |
| 3 |
* |
| 4 |
*/ |
| 5 |
|
| 6 |
// No direct access. |
| 7 |
defined('ABSPATH') or die('Access denied'); |
| 8 |
|
| 9 |
/** |
| 10 |
* |
| 11 |
*/ |
| 12 |
class CJTTinymceBlocksModel_DEPRECATED { |
| 13 |
|
| 14 |
/** |
| 15 |
* put your comment there... |
| 16 |
* |
| 17 |
*/ |
| 18 |
public function getItems() { |
| 19 |
// Initializing! |
| 20 |
$driver = cssJSToolbox::getInstance()->getDBDriver(); |
| 21 |
// Get common quiery parts!@ |
| 22 |
$query = $this->getItemsQuery(); |
| 23 |
// Add fields list! |
| 24 |
$query['select'] = 'b.id, b.name title, b.owner, f.name formTitle'; |
| 25 |
$query = "SELECT {$query['select']} FROM {$query['from']} WHERE {$query['where']};"; |
| 26 |
// Retrieve blocks! |
| 27 |
return $driver->select($query); |
| 28 |
} |
| 29 |
|
| 30 |
/** |
| 31 |
* put your comment there... |
| 32 |
* |
| 33 |
*/ |
| 34 |
public function getItemsQuery() { |
| 35 |
// Build query parts! |
| 36 |
$query['from'] = '#__cjtoolbox_blocks b LEFT JOIN #__cjtoolbox_forms f ON b.id = f.blockId'; |
| 37 |
$query['where'] = 'type = "block" and backupId IS null'; |
| 38 |
return $query; |
| 39 |
} |
| 40 |
|
| 41 |
} // End class. |
| 42 |
|