| 1 |
<?php |
| 2 |
/** |
| 3 |
* @version $ Id; view.php 21-03-2012 03:22:10 Ahmed Said $ |
| 4 |
*/ |
| 5 |
|
| 6 |
// Diallow direct access. |
| 7 |
defined('ABSPATH') or die("Access denied"); |
| 8 |
|
| 9 |
/** |
| 10 |
* Get Add-New-Block view markups. |
| 11 |
* |
| 12 |
* The method is resposible for selecting the correct template |
| 13 |
* and initialize template vars. |
| 14 |
* |
| 15 |
* @author Ahmed Said |
| 16 |
* @version 6 |
| 17 |
*/ |
| 18 |
class CJTBlocksNewView extends CJTView { |
| 19 |
|
| 20 |
/** |
| 21 |
* put your comment there... |
| 22 |
* |
| 23 |
* @var mixed |
| 24 |
*/ |
| 25 |
public $position; |
| 26 |
|
| 27 |
/** |
| 28 |
* Output Add New Block markups. |
| 29 |
* |
| 30 |
* @return void |
| 31 |
*/ |
| 32 |
public function display() { |
| 33 |
$defaultValues = array('position'); |
| 34 |
// Get form fields default values. |
| 35 |
foreach ($defaultValues as $name) { |
| 36 |
if (array_key_exists($name, $_GET)) { |
| 37 |
$this->$name = $_GET[$name]; |
| 38 |
} |
| 39 |
} |
| 40 |
echo $this->getTemplate('default'); |
| 41 |
} |
| 42 |
|
| 43 |
/** |
| 44 |
* Output JavaScript files requirred to Add-New-Block view to run. |
| 45 |
* |
| 46 |
* @return void |
| 47 |
*/ |
| 48 |
public static function enququeScripts() { |
| 49 |
// Use related scripts. |
| 50 |
self::useScripts(__CLASS__, |
| 51 |
'jquery', |
| 52 |
'thickbox', |
| 53 |
'jquery-serialize-object', |
| 54 |
'framework:js:misc:{CJT-}simple-error-dialog', |
| 55 |
'views:blocks:new:public:js:{CJT-}add-new-block' |
| 56 |
); |
| 57 |
} |
| 58 |
|
| 59 |
/** |
| 60 |
* Output CSS files required to Add-New-Block view. |
| 61 |
* |
| 62 |
* @return void |
| 63 |
*/ |
| 64 |
public static function enququeStyles() { |
| 65 |
// Use related styles. |
| 66 |
self::useStyles(__CLASS__, |
| 67 |
'thickbox', |
| 68 |
'framework:css:{CJT-}error-dialog', |
| 69 |
'framework:css:{CJT-}forms' |
| 70 |
); |
| 71 |
} |
| 72 |
|
| 73 |
} // End class. |
| 74 |
|
| 75 |
// Hookable!! |
| 76 |
CJTBlocksNewView::define('CJTBlocksNewView'); |