Jeff PHP framework
0.99
Modular, extensible, OOP, MVC, lightweight php framework designed to ease the programmers in the development of web applications.
|
00001 <?php 00026 class layout extends model { 00027 00034 function __construct($id) { 00035 00036 $this->_tbl_data = TBL_THEMES; 00037 parent::__construct($id); 00038 00039 } 00040 00047 public static function getThemes($opts=null) { 00048 00049 $registry = registry::instance(); 00050 $objs = array(); 00051 $rows = $registry->db->autoSelect("id", TBL_THEMES, '', 'active DESC,name'); 00052 foreach($rows as $row) $objs[] = new layout($row['id']); 00053 00054 return $objs; 00055 00056 } 00057 00064 public static function activateTheme($id) { 00065 00066 $registry = registry::instance(); 00067 00068 foreach(self::getThemes($registry) as $theme) { 00069 if($theme->id == $id && !$theme->active) { 00070 $theme->active = 1; 00071 $theme->saveData(); 00072 } 00073 if($theme->id != $id && $theme->active) { 00074 $theme->active = 0; 00075 $theme->saveData(); 00076 } 00077 } 00078 } 00079 00080 } 00081 00082 ?>