示例#1
0
 function getComponentRefCode()
 {
     if ($this->mirror && ($mirrored_pager = $this->parent->findUpChild($this->mirror))) {
         return $mirrored_pager->getComponentRefCode();
     } else {
         return parent::getComponentRefCode();
     }
 }
示例#2
0
 function preParse()
 {
     if (!$this->hasAttribute('target') && !$this->hasAttribute('to')) {
         $this->raiseCompilerError('Required attribute not found', array('attribute' => 'target or to'));
     }
     if ($this->hasAttribute('target') && $this->hasAttribute('to')) {
         $this->raiseCompilerError('Both target and buffer attribute are not supported');
     }
     $this->_fillToAttributeFromTargetAttribute();
     return parent::preParse();
 }
示例#3
0
 /**
  * Writes the compiled template constructor from the runtime component,
  * assigning the attributes found at compile time to the runtime component
  * via a serialized string
  */
 function generateConstructor($code_writer)
 {
     parent::generateConstructor($code_writer);
     // Determine which attributes should not propigate to runtime
     $CompileTimeAttributes = $this->tag_info->getSuppressAttributes();
     // Add the runat attribute to the list of attributes to filter out
     $CompileTimeAttributes[] = 'runat';
     $CompileTimeAttributes[] = 'wact:id';
     $code_writer->writePHP($this->getComponentRefCode() . '->setAttributes(unserialize(');
     $code_writer->writePHPLiteral(serialize($this->getAttributesAsArray($CompileTimeAttributes)));
     $code_writer->writePHP('));' . "\n");
 }
示例#4
0
 function generateTagContent($code_writer)
 {
     if ($this->hasAttribute('from')) {
         $code_writer->writePHP($this->getComponentRefCode() . '->registerDataset(');
         $this->attributeNodes['from']->generateExpression($code_writer);
         $code_writer->writePHP(');' . "\n");
     }
     $code_writer->writePHP($this->getComponentRefCode() . '->rewind();' . "\n");
     $code_writer->writePHP('if (' . $this->getComponentRefCode() . '->valid()) {' . "\n");
     parent::generateTagContent($code_writer);
     $code_writer->writePHP('}' . "\n");
     $emptyChild = $this->findImmediateChildByClass('WactListDefaultTag');
     if ($emptyChild) {
         $code_writer->writePHP(' else { ' . "\n");
         $emptyChild->generateNow($code_writer);
         $code_writer->writePHP('}' . "\n");
     }
 }
示例#5
0
 function generateTagContent($code)
 {
     $step_var = $code->getTempVarRef();
     $code->writePHP($step_var . ' = ');
     $this->generateStepAttributeValue($code);
     $code->writePhp(";\n");
     $code->writePhp($this->getComponentRefCode($code) . '->setStep(' . $step_var . ");\n");
     $ListList = $this->findParentByClass('WactListListTag');
     $code->writePhp($this->getComponentRefCode($code) . '->next();' . "\n");
     $code->writePhp('if ( ' . $this->getComponentRefCode($code) . '->shouldDisplay()){' . "\n");
     $code->writePhp($this->getComponentRefCode($code) . '->reset();' . "\n");
     $separators = $this->parent->findChildrenByClass('WactListSeparatorTag');
     if (array($separators) && count($separators)) {
         foreach ($separators as $separator) {
             $code->writePhp('if (');
             $separator->generateStepAttributeValue($code);
             $code->writePhp(' < ' . $step_var . ') ');
             $code->writePhp($separator->getComponentRefCode($code) . "->skipNext();\n");
         }
     }
     parent::generateTagContent($code);
     $code->writePhp('}' . "\n");
 }
示例#6
0
 function generateTagContent($code_writer)
 {
     $code_writer->writePHP('if (' . $this->getComponentRefCode() . '->isVisible()) {');
     parent::generateTagContent($code_writer);
     $code_writer->writePHP('}');
 }