MkFramework
 All Data Structures Functions
abstract_moduleembedded.php
1 <?php
2 /*
3 This file is part of Mkframework.
4 
5 Mkframework is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License.
8 
9 Mkframework is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
13 
14 You should have received a copy of the GNU Lesser General Public License
15 along with Mkframework. If not, see <http://www.gnu.org/licenses/>.
16 
17 */
23 abstract class abstract_moduleembedded{
24 
25  protected $_tVar;
26 
27  public function before(){
28 
29  }
30  public function after(){
31 
32  }
36  public function __set($sVar,$sVal){
37  $this->_tVar[$sVar]=$sVal;
38  }
42  public function __get($sVar){
43  if(!isset($this->_tVar[$sVar])){
44  throw new Exception('Propriete '.$sVar.' _module inexistant');
45  }
46  return $this->_tVar[$sVar];
47  }
48 
49 
50  public static function _getLink($sRootModule,$tRootParams,$sModuleName,$sAction,$tParam=null){
51 
52  $sPrefix=$sModuleName;
53 
54  $tNewParam=array();
55  if($tRootParams){
56  $tNewParam=$tRootParams;
57  }
58 
59  $tNewParam[$sPrefix.'Action']=$sAction;
60  if($tParam){
61  foreach($tParam as $sKey => $sVal){
62  $tNewParam[ $sPrefix.$sKey ]=$sVal;
63  }
64  }
65 
66  return _root::getLink($sRootModule,$tNewParam);
67  }
68  public static function _getParam($sModuleName,$sVar,$uDefault=null){
69  $sPrefix=$sModuleName;
70  return _root::getParam($sPrefix.$sVar,$uDefault);
71  }
72 
73 
74  public static function _redirect($sRootModule,$tRootParams,$sModuleName,$sModuleAction,$tModuleParam=null){
75 
76  $sPrefix=$sModuleName;
77 
78  $tParam=array();
79  if($tRootParams){
80  $tParam=$tRootParams;
81  }
82 
83  $tParam[ $sPrefix.'Action' ]=$sModuleAction;
84  if($tModuleParam){
85  foreach($tModuleParam as $sKey => $sVal){
86  $tParam[ $sPrefix.$sKey ]=$sVal;
87  }
88  }
89 
90  return _root::redirect($sRootModule,$tParam);
91  }
92 
93 }
static getLink($uNav, $tParam=null, $bAmp=true)
Definition: class_root.php:756
static getParam($sVar, $uElse=null)
Definition: class_root.php:465
static redirect($uNav, $tParam=null)
Definition: class_root.php:727