예제 #1
0
파일: DataSrc.php 프로젝트: JeCat/framework
 public function has($sName)
 {
     // disable data
     if ($this->arrDisables and array_key_exists($sName, $this->arrDisables)) {
         return false;
     }
     if (parent::has($sName)) {
         return true;
     }
     // 在 exclude中的数据,不向 childs中寻找
     if (in_array($sName, $this->arrExclude)) {
         return false;
     }
     // 从 Childs 中找数据
     foreach ($this->arrChildren as $aChild) {
         if ($aChild->has($sName)) {
             return true;
         }
     }
     return false;
 }
예제 #2
0
 public function object($sName)
 {
     return parent::get($sName);
 }
예제 #3
0
 public function add(Result $aResult)
 {
     parent::add($aResult);
 }
예제 #4
0
파일: Widget.php 프로젝트: JeCat/framework
 public function display(UI $aUI, IHashTable $aVariables = null, IOutputStream $aDevice = null)
 {
     $sTemplateName = $this->templateName();
     $sSubTemplateName = $this->subTemplateName();
     if (!$sTemplateName and !$sSubTemplateName) {
         throw new Exception("显示UI控件时遇到错误,UI控件尚未设置模板文件", $this->id());
     }
     if (!$aVariables) {
         $aVariables = new HashTable();
     }
     $oldWidget = $aVariables->get('theWidget');
     $aVariables->set('theWidget', $this);
     $aVariables->set('theUI', $aUI);
     if ($sTemplateName) {
         $aUI->display($sTemplateName, $aVariables, $aDevice);
     } else {
         if (!function_exists($sSubTemplateName)) {
             throw new Exception("正在调用无效的子模板:%s %s", array($sSubTemplateName, $this->id()));
         }
         call_user_func_array($sSubTemplateName, array($aVariables, $aDevice));
     }
     $aVariables->set('theWidget', $oldWidget);
 }