Jeff PHP framework  0.99
Modular, extensible, OOP, MVC, lightweight php framework designed to ease the programmers in the development of web applications.
language.controller.php
Go to the documentation of this file.
00001 <?php
00036 class languageController extends controller {
00037         
00041         private $_class_privilege;
00042 
00046         private $_admin_privilege;
00047 
00053         function __construct() {
00054 
00055                 parent::__construct();
00056 
00057                 $this->_cpath = dirname(__FILE__);
00058                 $this->_mdl_name = "language";
00059 
00060                 // privileges
00061                 $this->_class_privilege = $this->_mdl_name;
00062                 $this->_admin_privilege = 1;
00063         }
00064         
00071         public function manage() {
00072         
00073                 access::check($this->_class_privilege, $this->_admin_privilege, array("exitOnFailure"=>true));
00074 
00075                 $s_fields = array(
00076                         "main"=>array(
00077                                 "type"=>"bool",
00078                                 "required"=>true,
00079                                 "true_label"=>__("yes"),
00080                                 "false_label"=>__("no")
00081                         ),
00082                         "active"=>array(
00083                                 "type"=>"bool",
00084                                 "required"=>true,
00085                                 "true_label"=>__("yes"),
00086                                 "false_label"=>__("no")
00087                         )
00088                 );
00089 
00090                 $at = new adminTable(TBL_LNG);
00091                 $at->setSpecialFields($s_fields);
00092                 $table = $at->manage();
00093 
00094                 $this->_view->setTpl('manage_table');
00095                 $this->_view->assign('title', __("ManageTable")." ".TBL_LNG);
00096                 $this->_view->assign('table', $table);
00097 
00098                 return $this->_view->render();
00099         }
00100 
00106         public function choose() {
00107         
00108                 $active_lngs = language::get($this->_registry, array('where'=>"active='1'"));
00109                 
00110                 $lngs = array();
00111 
00112                 foreach($active_lngs as $l) {
00113                         $href = "?lng=".$l->code;
00114                         $link = anchor($href, htmlVar($l->language));
00115                         $lngs[] = $link;
00116                 }
00117 
00118                 return implode(" | ", $lngs);
00119         }
00120 
00121 }
00122 
00123 ?>