Beispiel #1
0
 function execute(&$data, &$parent)
 {
     $s = $this->executeChain($this->chain, $data, $parent);
     //		echo '<hr>',$s;
     $ns = new One_Script();
     $ss = $ns->executeString($s, $data);
     //		echo '<hr>',$ss;
     return $ss;
 }
Beispiel #2
0
 /**
  * Render the output of the widget and add it to the DOM
  *
  * @param One_Model $model
  * @param One_Dom $d
  */
 protected function _render($model, One_Dom $dom)
 {
     $src = $this->getCfg('code');
     $ns = new One_Script();
     if ($this->getID()) {
         $ns->set('id', $this->getID());
     }
     if ($this->getName()) {
         $ns->set('name', $this->getName());
     }
     if ($this->getLabel()) {
         $ns->set('label', $this->getLabel());
     }
     if ($this->getValue($model)) {
         $ns->set('value', $this->getValue($model));
     }
     $ns->set('model', $model);
     $s = $ns->executeString($src);
     $dom->add($s);
     $dom->add($this->value);
     One_Script_Factory::restoreSearchPath();
 }
Beispiel #3
0
 public function parseModelScript(One_Model $model, $script)
 {
     $ns = new One_Script();
     $output = $ns->executeString($script, array('model' => $model));
     if ($ns->isError()) {
         $output = $ns->error;
     }
     return $output;
 }
Beispiel #4
0
 public function addSection($sectionName, $sectionString)
 {
     $proxy = new One_Script();
     $proxy->executeString("{section " . $sectionName . "}" . $sectionString . "{endsection}", $this->oCode);
     $sectionNodes = $proxy->rootNode->chain;
     if (count($sectionNodes)) {
         foreach ($sectionNodes as $sn) {
             $this->rootNode->chain[] = $sn;
         }
     }
 }