## 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. */
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. class ezcTreeVisitorXHTMLOptions extends ezcBaseOptions
52. {
53. /**
54. * Constructs an object with the specified values.
55. *
56. * @throws ezcBasePropertyNotFoundException
57. * if $options contains a property not defined
58. * @throws ezcBaseValueException
59. * if $options contains a property with a value not allowed
60. * @param array(string=>mixed) $options
61. */
62. public function __construct ( array $options = array() )
63. {
64. $this->basePath = '';
65. $this->addLinks = true;
66. $this->displayRootNode = false;
67. $this->xmlId = null;
68. $this->highlightNodeIds = array();
69. $this->subtreeHighlightNodeIds = array();
70. $this->selectedNodeLink = false;
72. parent:: __construct ( $options );
73. }
75. /**
76. * Sets the option $name to $value.
77. *
78. * @throws ezcBasePropertyNotFoundException
79. * if the property $name is not defined
80. * @throws ezcBaseValueException
81. * if $value is not correct for the property $name
82. * @param string $name
83. * @param mixed $value
84. * @ignore
85. */
86. public function __set( $name, $value )
87. {
88. switch ( $name )
89. {
90. case 'basePath':
91. if ( ! is_string ( $value ) )
92. {
93. throw new ezcBaseValueException ( $name, $value, 'string' );
94. }
95. $this-> properties [$name] = $value;
96. break;
98. case 'addLinks':
99. case 'displayRootNode':
100. case 'selectedNodeLink':
101. if ( ! is_bool ( $value ) )
102. {
103. throw new ezcBaseValueException ( $name, $value, 'bool' );
104. }
105. $this-> properties [$name] = $value;
106. break;
108. case 'highlightNodeIds':
109. case 'subtreeHighlightNodeIds':
110. if ( ! is_array ( $value ) )
111. {
112. throw new ezcBaseValueException ( $name, $value, 'array(string)' );
113. }
114. $this-> properties [$name] = $value;
115. break;
117. case 'xmlId':
118. if ( ! is_null ( $value ) && ! is_string ( $value ) )
119. {
120. throw new ezcBaseValueException ( $name, $value, 'null or string' );
121. }
122. $this-> properties [$name] = $value;
123. break;
125. default:
126. throw new ezcBasePropertyNotFoundException ( $name );
127. }
128. }
129. }
130. ?>

Documentation generated by phpDocumentor 1.4.3