Created
March 25, 2012 11:59
-
-
Save trustmaster/2193137 to your computer and use it in GitHub Desktop.
CotView class interface proto, first take
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
defined('COT_CODE') or die('Wrong URL.'); | |
(function_exists('version_compare') && version_compare(PHP_VERSION, '5.3.0', '>=')) or die('PHP version 5.3 or higher is required.'); | |
require_once cot_incfile('forms'); | |
require_once cot_incfile('orm'); | |
/** | |
* View class for Cotonti. Defines how objects should be displayed. | |
* | |
* View classes should extend CotView to inherit its methods | |
* and must specify $model_class and $columns | |
* | |
* @package Cotonti | |
* @version 1.3 | |
* @author Gert Hengeveld, Vladimir Sibirov | |
* @copyright (c) Cotonti Team 2012 | |
* @license BSD | |
*/ | |
abstract class CotView | |
{ | |
/** | |
* Name of the associated Model class | |
* @var string | |
*/ | |
protected static $model_class = ''; | |
/** | |
* Custom display properties for columns | |
* @var array | |
*/ | |
protected static $columns = array(); | |
/** | |
* Model object containing data | |
* @var CotORM | |
*/ | |
protected $model = null; | |
/** | |
* Template object | |
* @var XTemplate | |
*/ | |
protected $tpl = null; | |
/** | |
* Item permissions, such as R/W/A | |
* @var type | |
*/ | |
protected $rights = array(); | |
public function __construct($model, $tpl, $rights = array()) | |
{ | |
$this->model = $model; | |
$this->tpl = $tpl; | |
$this->rights = $rights; | |
} | |
public function display($tag_prefix = '', $block = '') | |
{ | |
} | |
public function displayForm($tag_prefix = '', $block = '', $url = '') | |
{ | |
} | |
public function displayFormAuto($tag_prefix = '', $block = '', $url = '') | |
{ | |
} | |
public static function displayList($items, $tag_prefix = '', $block = '') | |
{ | |
} | |
public static function displayListForm($items, $tag_prefix = '', $block = '', $url = '') | |
{ | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment