[ Index ]

PHP Cross Reference of Web Application Component Toolkit

title

Body

[close]

/framework/template/tags/core/ -> set.tag.php (source)

   1  <?php
   2  //--------------------------------------------------------------------------------
   3  // Copyright 2003 Procata, Inc.
   4  // Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html)
   5  //--------------------------------------------------------------------------------
   6  
   7  /**
   8  * @package WACT_TAG
   9  * @version $Id: set.tag.php,v 1.15 2004/11/18 04:22:47 jeffmoore Exp $
  10  */
  11  
  12  require_once WACT_ROOT . 'template/compiler/property/attribute.inc.php';
  13  
  14  /**
  15  * Register the tag
  16  */
  17  $taginfo =& new TagInfo('core:SET', 'CoreSetTag');
  18  $taginfo->setEndTag(ENDTAG_FORBIDDEN);
  19  TagDictionary::registerTag($taginfo, __FILE__);
  20  
  21  /**
  22  * Sets a property in the runtime DataSource, according the attributes of this
  23  * tag at compile time.
  24  * @see http://wact.sourceforge.net/index.php/CoreSetTag
  25  * @access protected
  26  * @package WACT_TAG
  27  */
  28  class CoreSetTag extends SilentCompilerDirectiveTag {
  29      /**
  30      * @return void
  31      * @access protected
  32      */
  33  	function CheckNestingLevel() {
  34          if ($this->findParentByClass('CoreSetTag')) {
  35              RaiseError('compiler', 'BADSELFNESTING', array(
  36                  'tag' => $this->tag,
  37                  'file' => $this->SourceFile,
  38                  'line' => $this->StartingLineNo));
  39          }
  40      }
  41  
  42      /**
  43      * @return int PARSER_FORBID_PARSING
  44      * @access protected
  45      */
  46  	function preParse() {
  47          $DataSource =& $this->getDataSource();
  48  
  49          foreach(array_keys($this->attributeNodes) as $key) {
  50              $name = $this->attributeNodes[$key]->name;
  51              $property =& new AttributeProperty($this->attributeNodes[$key]);
  52              $DataSource->registerProperty($name, $property);
  53          }
  54  
  55          return PARSER_FORBID_PARSING;
  56      }
  57  }
  58  ?>


Generated: Sun Nov 28 19:36:09 2004 Cross-referenced by PHPXref 0.5