# css-javascript-toolbox/7.2/views/blocks/new/view.php

CSS &amp; JavaScript Toolbox, version 7.2. 76 lines.

- Page: https://pluginprobe.com/plugins/css-javascript-toolbox/7.2/code/views/blocks/new/view.php
- Raw: https://pluginprobe.com/plugins/css-javascript-toolbox/7.2/raw/views/blocks/new/view.php
- Modified: 2014-05-06T16:47:26+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/7.2/code/views/blocks/new/view.php#L10-L20`.

```php
<?php
/**
* @version $ Id; view.php 21-03-2012 03:22:10 Ahmed Said $
*/

// Diallow direct access.
defined('ABSPATH') or die("Access denied");

/**
* Get Add-New-Block view markups.
* 
* The method is resposible for selecting the correct template
* and initialize template vars.
* 
* @author Ahmed Said
* @version 6
*/
class CJTBlocksNewView extends CJTView {
	
	/**
	* put your comment there...
	* 
	* @var mixed
	*/
	public $position;
	
	/**
	* Output Add New Block markups.
	* 
	* @return void
	*/
	public function display() {
		$defaultValues = array('position');
		// Get form fields default values.
		foreach ($defaultValues as $name) {
		  if (array_key_exists($name, $_GET)) {
				$this->$name = $_GET[$name];
			}
		}
		echo $this->getTemplate('default');
	}
	
	/**
	* Output Javascript files requirred to Add-New-Block view to run.
	* 
	* @return void
	*/
	public static function enququeScripts() {
		// Use related scripts.
		self::useScripts(__CLASS__,
			'jquery',
			'thickbox',
			'jquery-serialize-object',
			'framework:js:misc:{CJT-}simple-error-dialog',
			'views:blocks:new:public:js:{CJT-}add-new-block'
		);
	}
	
	/**
	* Output CSS files required to Add-New-Block view.
	* 
	* @return void
	*/
	public static function enququeStyles() {
		// Use related styles.
		self::useStyles(__CLASS__,
			'thickbox',
			'framework:css:{CJT-}error-dialog',
			'framework:css:{CJT-}forms'
		);
	}
	
} // End class.

// Hookable!!
CJTBlocksNewView::define('CJTBlocksNewView');
```
