| 1 |
<?php |
| 2 |
/** |
| 3 |
* @version $ Id; ?FILE_NAME ?DATE ?TIME ?AUTHOR $ |
| 4 |
*/ |
| 5 |
|
| 6 |
// Disallow direct access. |
| 7 |
defined('ABSPATH') or die("Access denied"); |
| 8 |
|
| 9 |
/** |
| 10 |
* |
| 11 |
* DESCRIPTION |
| 12 |
* |
| 13 |
* @author ?? |
| 14 |
* @version ?? |
| 15 |
*/ |
| 16 |
class CJTTemplateTable extends CJTxTable { |
| 17 |
|
| 18 |
/** |
| 19 |
* |
| 20 |
*/ |
| 21 |
const ATTRIBUTES_SYSTEM_FLAG = 0x01; |
| 22 |
|
| 23 |
/** |
| 24 |
* put your comment there... |
| 25 |
* |
| 26 |
* @var mixed |
| 27 |
*/ |
| 28 |
public static $states; |
| 29 |
|
| 30 |
/** |
| 31 |
* put your comment there... |
| 32 |
* |
| 33 |
* @param mixed $dbDriver |
| 34 |
* @param bool Is to enable Build In Queue name Generator. |
| 35 |
* @return CJTTemplatesTable |
| 36 |
*/ |
| 37 |
public function __construct($dbDriver) { |
| 38 |
parent::__construct($dbDriver, 'templates'); |
| 39 |
} |
| 40 |
|
| 41 |
/** |
| 42 |
* put your comment there... |
| 43 |
* |
| 44 |
*/ |
| 45 |
public function setQueueName() { |
| 46 |
$type = $this->get('type'); |
| 47 |
// Santiize the template name! |
| 48 |
$sanitizedName = strtolower(sanitize_file_name($this->get('name'))); |
| 49 |
// Prefix all user templates so it woule be unique when added |
| 50 |
// to Wordpress queue! |
| 51 |
$queueName = "cjt-{$type}-template-{$sanitizedName}"; |
| 52 |
$this->set('queueName', $queueName); |
| 53 |
return $this; |
| 54 |
} |
| 55 |
|
| 56 |
} // End class. |
| 57 |
|
| 58 |
// Initialize static's! |
| 59 |
CJTTemplateTable::$states = array( |
| 60 |
'draft' => cssJSToolbox::getText('draft'), |
| 61 |
'published' => cssJSToolbox::getText('published'), |
| 62 |
'trash' => cssJSToolbox::getText('trash'), |
| 63 |
); |