Apache Zeta Components Manual :: File Source for visitor_xhtml.php

Source for file visitor_xhtml.php

Documentation is available at visitor_xhtml.php

  1. <?php
  2. /**
  3.  * File containing the ezcTreeVisitorXHTMLOptions class.
  4.  *
  5.  * Licensed to the Apache Software Foundation (ASF) under one
  6.  * or more contributor license agreements.  See the NOTICE file
  7.  * distributed with this work for additional information
  8.  * regarding copyright ownership.  The ASF licenses this file
  9.  * to you under the Apache License, Version 2.0 (the
  10.  * "License"); you may not use this file except in compliance
  11.  * with the License.  You may obtain a copy of the License at
  12.  * 
  13.  *   http://www.apache.org/licenses/LICENSE-2.0
  14.  * 
  15.  * Unless required by applicable law or agreed to in writing,
  16.  * software distributed under the License is distributed on an
  17.  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  18.  * KIND, either express or implied.  See the License for the
  19.  * specific language governing permissions and limitations
  20.  * under the License.
  21.  *
  22.  * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
  23.  * @version //autogentag//
  24.  * @filesource
  25.  * @package Tree
  26.  */
  27.  
  28. /**
  29.  * Class containing the options for the ezcTreeVisitorXHTMLOptions class.
  30.  *
  31.  * @property string $basePath 
  32.  *            Which string to prefix the href-targets with.
  33.  * @property bool $addLinks 
  34.  *            Whether links should be generated or not.
  35.  * @property bool $displayRootNode 
  36.  *            Whether the root node should be displayed. The root node will
  37.  *            still be disabled from the links that the visitor creates when
  38.  *            $selectedNodeLink is set to true.
  39.  * @property string $xmlId 
  40.  *            The ID that should be set on the top level 'ul' XHTML tag.
  41.  * @property array(string) $highlightNodeIds 
  42.  *            Which IDs should have the 'highlight' CSS class added.
  43.  * @property array(string) $subtreeHighlightNodeIds 
  44.  *            Which subtree IDs should have the 'highlight' CSS class added.
  45.  * @property bool $selectedNodeLink 
  46.  *            If enabled, only the requested node is shown in links, and not the full path.
  47.  *
  48.  * @package Tree
  49.  * @version //autogentag//
  50.  */
  51. {
  52.     /**
  53.      * Constructs an object with the specified values.
  54.      *
  55.      * @throws ezcBasePropertyNotFoundException
  56.      *          if $options contains a property not defined
  57.      * @throws ezcBaseValueException
  58.      *          if $options contains a property with a value not allowed
  59.      * @param array(string=>mixed) $options 
  60.      */
  61.     public function __constructarray $options array() )
  62.     {
  63.         $this->basePath '';
  64.         $this->addLinks true;
  65.         $this->displayRootNode false;
  66.         $this->xmlId null;
  67.         $this->highlightNodeIds array();
  68.         $this->subtreeHighlightNodeIds array();
  69.         $this->selectedNodeLink false;
  70.  
  71.         parent::__construct$options );
  72.     }
  73.  
  74.     /**
  75.      * Sets the option $name to $value.
  76.      *
  77.      * @throws ezcBasePropertyNotFoundException
  78.      *          if the property $name is not defined
  79.      * @throws ezcBaseValueException
  80.      *          if $value is not correct for the property $name
  81.      * @param string $name 
  82.      * @param mixed $value 
  83.      * @ignore
  84.      */
  85.     public function __set$name$value )
  86.     {
  87.         switch $name )
  88.         {
  89.             case 'basePath':
  90.                 if !is_string$value ) )
  91.                 {
  92.                     throw new ezcBaseValueException$name$value'string' );
  93.                 }
  94.                 $this->properties[$name$value;
  95.                 break;
  96.  
  97.             case 'addLinks':
  98.             case 'displayRootNode':
  99.             case 'selectedNodeLink':
  100.                 if !is_bool$value ) )
  101.                 {
  102.                     throw new ezcBaseValueException$name$value'bool' );
  103.                 }
  104.                 $this->properties[$name$value;
  105.                 break;
  106.  
  107.             case 'highlightNodeIds':
  108.             case 'subtreeHighlightNodeIds':
  109.                 if !is_array$value ) )
  110.                 {
  111.                     throw new ezcBaseValueException$name$value'array(string)' );
  112.                 }
  113.                 $this->properties[$name$value;
  114.                 break;
  115.  
  116.             case 'xmlId':
  117.                 if !is_null$value && !is_string$value ) )
  118.                 {
  119.                     throw new ezcBaseValueException$name$value'null or string' );
  120.                 }
  121.                 $this->properties[$name$value;
  122.                 break;
  123.  
  124.             default:
  125.                 throw new ezcBasePropertyNotFoundException$name );
  126.         }
  127.     }
  128. }
  129. ?>
Documentation generated by phpDocumentor 1.4.3