Jeff PHP framework  0.99
Modular, extensible, OOP, MVC, lightweight php framework designed to ease the programmers in the development of web applications.
layout.controller.php
Go to the documentation of this file.
00001 <?php
00019 require_once('layout.php');
00020 
00030 class layoutController extends controller {
00031         
00035         private $_class_privilege;
00036 
00040         private $_admin_privilege;
00041 
00047         function __construct() {
00048 
00049                 parent::__construct();
00050 
00051                 $this->_cpath = dirname(__FILE__);
00052                 $this->_mdl_name = "layout";
00053 
00054                 // privileges
00055                 $this->_class_privilege = $this->_mdl_name;
00056                 $this->_admin_privilege = 1;
00057         }
00058         
00065         public function manage() {
00066         
00067                 access::check($this->_class_privilege, $this->_admin_privilege, array("exitOnFailure"=>true));
00068 
00069                 $items = array();
00070                 foreach(layout::getThemes($this->_registry) as $theme) {
00071                         require_once(ABS_THEMES.DS.$theme->name.DS.$theme->name.'.php');
00072                         $themeClassName = $theme->name."Theme";
00073                         $themeObj = new $themeClassName($this->_registry);
00074                         $items[] = array(
00075                                 'link_activate'=>$this->_router->linkHref($this->_mdl_name, 'activateTheme', array("id"=>$theme->id)), 
00076                                 'image'=>htmlVar($themeObj->getImage()), 
00077                                 'name'=>htmlVar($themeObj->getName()), 
00078                                 'description'=>htmlVar($themeObj->getDescription()), 
00079                                 'active'=>$theme->active ? true : false
00080                         );
00081                 }
00082 
00083                 $this->_view->setTpl('layout_list');
00084                 $this->_view->assign('title', __("ManageLayout"));
00085                 $this->_view->assign('text', __("ManageLayoutExp"));
00086                 $this->_view->assign('items', $items);
00087 
00088                 return $this->_view->render();
00089 
00090         }
00091 
00099         public function activateTheme() {
00100 
00101                 access::check($this->_class_privilege, $this->_admin_privilege, array("exitOnFailure"=>true));
00102 
00103                 $id = cleanInput('get', 'id', 'int');
00104                 layout::activateTheme($id);
00105 
00106                 header("Location: ".$this->_router->linkHref($this->_mdl_name, 'manage'));
00107 
00108         }
00109 
00110 }
00111 
00112 ?>