PageRenderTime 78ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/docs/api/_form_2_element_2_ui_widget_8php_source.html

http://openbiz-cubi.googlecode.com/
HTML | 129 lines | 128 code | 0 blank | 1 comment | 0 complexity | e264104d76dc580046c0330ee0ff84df MD5 | raw file
Possible License(s): GPL-2.0, LGPL-3.0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <title>openbiz: E:/E/GEAMP/www/openbiz/openbiz/others/ZendX/JQuery/Form/Element/UiWidget.php Source File</title>
  6. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  7. <link href="doxygen.css" rel="stylesheet" type="text/css"/>
  8. </head>
  9. <body>
  10. <!-- Generated by Doxygen 1.7.2 -->
  11. <div class="navigation" id="top">
  12. <div class="tabs">
  13. <ul class="tablist">
  14. <li><a href="main.html"><span>Main&#160;Page</span></a></li>
  15. <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
  16. <li><a href="namespaces.html"><span>Namespaces</span></a></li>
  17. <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
  18. <li class="current"><a href="files.html"><span>Files</span></a></li>
  19. <li><a href="examples.html"><span>Examples</span></a></li>
  20. </ul>
  21. </div>
  22. <div class="tabs2">
  23. <ul class="tablist">
  24. <li><a href="files.html"><span>File&#160;List</span></a></li>
  25. </ul>
  26. </div>
  27. <div class="header">
  28. <div class="headertitle">
  29. <h1>E:/E/GEAMP/www/openbiz/openbiz/others/ZendX/JQuery/Form/Element/UiWidget.php</h1> </div>
  30. </div>
  31. <div class="contents">
  32. <div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 &lt;?php
  33. <a name="l00023"></a>00023 require_once <span class="stringliteral">&quot;Zend/Form/Element.php&quot;</span>;
  34. <a name="l00024"></a>00024
  35. <a name="l00033"></a><a class="code" href="class_zend_x___j_query___form___element___ui_widget.html">00033</a> <span class="keyword">class </span><a class="code" href="class_zend_x___j_query___form___element___ui_widget.html">ZendX_JQuery_Form_Element_UiWidget</a> <span class="keyword">extends</span> Zend_Form_Element
  36. <a name="l00034"></a>00034 {
  37. <a name="l00040"></a>00040 <span class="keyword">public</span> $jQueryParams = array();
  38. <a name="l00041"></a>00041
  39. <a name="l00047"></a>00047 <span class="keyword">public</span> $options = array();
  40. <a name="l00048"></a>00048
  41. <a name="l00056"></a><a class="code" href="class_zend_x___j_query___form___element___ui_widget.html#aa9eed1d9fc634994a3dc95bf7dc0f1db">00056</a> <span class="keyword">public</span> function <a class="code" href="class_zend_x___j_query___form___element___ui_widget.html#aa9eed1d9fc634994a3dc95bf7dc0f1db">__construct</a>($spec, $options = null)
  42. <a name="l00057"></a>00057 {
  43. <a name="l00058"></a>00058 $this-&gt;addPrefixPath(<span class="stringliteral">&#39;ZendX_JQuery_Form_Decorator&#39;</span>, <span class="stringliteral">&#39;ZendX/JQuery/Form/Decorator&#39;</span>, <span class="stringliteral">&#39;decorator&#39;</span>);
  44. <a name="l00059"></a>00059 <a class="code" href="class_zend_x___j_query___form___element___ui_widget.html#aa9eed1d9fc634994a3dc95bf7dc0f1db">parent::__construct</a>($spec, $options);
  45. <a name="l00060"></a>00060 }
  46. <a name="l00061"></a>00061
  47. <a name="l00068"></a><a class="code" href="class_zend_x___j_query___form___element___ui_widget.html#a6c8c2b9e77ad4aac0439a450e016bf23">00068</a> <span class="keyword">public</span> function <a class="code" href="class_zend_x___j_query___form___element___ui_widget.html#a6c8c2b9e77ad4aac0439a450e016bf23">getJQueryParam</a>($key)
  48. <a name="l00069"></a>00069 {
  49. <a name="l00070"></a>00070 $key = (string) $key;
  50. <a name="l00071"></a>00071 <span class="keywordflow">return</span> $this-&gt;jQueryParams[$key];
  51. <a name="l00072"></a>00072 }
  52. <a name="l00073"></a>00073
  53. <a name="l00079"></a><a class="code" href="class_zend_x___j_query___form___element___ui_widget.html#afe712b32b46bd47ad7979df3769c8194">00079</a> <span class="keyword">public</span> function <a class="code" href="class_zend_x___j_query___form___element___ui_widget.html#afe712b32b46bd47ad7979df3769c8194">getJQueryParams</a>()
  54. <a name="l00080"></a>00080 {
  55. <a name="l00081"></a>00081 <span class="keywordflow">return</span> $this-&gt;jQueryParams;
  56. <a name="l00082"></a>00082 }
  57. <a name="l00083"></a>00083
  58. <a name="l00091"></a><a class="code" href="class_zend_x___j_query___form___element___ui_widget.html#aa510d865afede2630cdbbf7d135b362e">00091</a> <span class="keyword">public</span> function <a class="code" href="class_zend_x___j_query___form___element___ui_widget.html#aa510d865afede2630cdbbf7d135b362e">setJQueryParam</a>($key, $value)
  59. <a name="l00092"></a>00092 {
  60. <a name="l00093"></a>00093 $key = (string) $key;
  61. <a name="l00094"></a>00094 $this-&gt;jQueryParams[$key] = $value;
  62. <a name="l00095"></a>00095 <span class="keywordflow">return</span> $this;
  63. <a name="l00096"></a>00096 }
  64. <a name="l00097"></a>00097
  65. <a name="l00104"></a><a class="code" href="class_zend_x___j_query___form___element___ui_widget.html#ae4e421bf84ba77ea2d39be1624ccd316">00104</a> <span class="keyword">public</span> function <a class="code" href="class_zend_x___j_query___form___element___ui_widget.html#ae4e421bf84ba77ea2d39be1624ccd316">setJQueryParams</a>($params)
  66. <a name="l00105"></a>00105 {
  67. <a name="l00106"></a>00106 $this-&gt;jQueryParams = array_merge($this-&gt;jQueryParams, $params);
  68. <a name="l00107"></a>00107 <span class="keywordflow">return</span> $this;
  69. <a name="l00108"></a>00108 }
  70. <a name="l00109"></a>00109
  71. <a name="l00115"></a><a class="code" href="class_zend_x___j_query___form___element___ui_widget.html#aa9e0138685a7ef88f4f670e379e7cae3">00115</a> <span class="keyword">public</span> function <a class="code" href="class_zend_x___j_query___form___element___ui_widget.html#aa9e0138685a7ef88f4f670e379e7cae3">loadDefaultDecorators</a>()
  72. <a name="l00116"></a>00116 {
  73. <a name="l00117"></a>00117 <span class="keywordflow">if</span> ($this-&gt;loadDefaultDecoratorsIsDisabled()) {
  74. <a name="l00118"></a>00118 <span class="keywordflow">return</span>;
  75. <a name="l00119"></a>00119 }
  76. <a name="l00120"></a>00120
  77. <a name="l00121"></a>00121 $decorators = $this-&gt;<a class="code" href="class_zend_x___j_query___form___element___ui_widget.html#a14709784de42ac1565c64a09debb7db8">getDecorators</a>();
  78. <a name="l00122"></a>00122 <span class="keywordflow">if</span> (empty($decorators)) {
  79. <a name="l00123"></a>00123 $this-&gt;addDecorator(<span class="stringliteral">&#39;UiWidgetElement&#39;</span>)
  80. <a name="l00124"></a>00124 -&gt;addDecorator(<span class="stringliteral">&#39;Errors&#39;</span>)
  81. <a name="l00125"></a>00125 -&gt;addDecorator(<span class="stringliteral">&#39;Description&#39;</span>, array(<span class="stringliteral">&#39;tag&#39;</span> =&gt; <span class="charliteral">&#39;p&#39;</span>, <span class="stringliteral">&#39;class&#39;</span> =&gt; <span class="stringliteral">&#39;description&#39;</span>))
  82. <a name="l00126"></a>00126 -&gt;addDecorator(<span class="stringliteral">&#39;HtmlTag&#39;</span>, array(<span class="stringliteral">&#39;tag&#39;</span> =&gt; <span class="stringliteral">&#39;dd&#39;</span>))
  83. <a name="l00127"></a>00127 -&gt;addDecorator(<span class="stringliteral">&#39;Label&#39;</span>, array(<span class="stringliteral">&#39;tag&#39;</span> =&gt; <span class="stringliteral">&#39;dt&#39;</span>));
  84. <a name="l00128"></a>00128 }
  85. <a name="l00129"></a>00129 }
  86. <a name="l00130"></a>00130
  87. <a name="l00139"></a><a class="code" href="class_zend_x___j_query___form___element___ui_widget.html#a6efcef1ebce82b7e972f451c92574b78">00139</a> <span class="keyword">public</span> function <a class="code" href="class_zend_x___j_query___form___element___ui_widget.html#a6efcef1ebce82b7e972f451c92574b78">setView</a>(<a class="code" href="interface_zend___view___interface.html">Zend_View_Interface</a> $view = null)
  88. <a name="l00140"></a>00140 {
  89. <a name="l00141"></a>00141 <span class="keywordflow">if</span> (null !== $view) {
  90. <a name="l00142"></a>00142 <span class="keywordflow">if</span> (<span class="keyword">false</span> === $view-&gt;getPluginLoader(<span class="stringliteral">&#39;helper&#39;</span>)-&gt;getPaths(<span class="stringliteral">&#39;ZendX_JQuery_View_Helper&#39;</span>)) {
  91. <a name="l00143"></a>00143 $view-&gt;addHelperPath(<span class="stringliteral">&#39;ZendX/JQuery/View/Helper&#39;</span>, <span class="stringliteral">&#39;ZendX_JQuery_View_Helper&#39;</span>);
  92. <a name="l00144"></a>00144 }
  93. <a name="l00145"></a>00145 }
  94. <a name="l00146"></a>00146 <span class="keywordflow">return</span> <a class="code" href="class_zend_x___j_query___form___element___ui_widget.html#a6efcef1ebce82b7e972f451c92574b78">parent::setView</a>($view);
  95. <a name="l00147"></a>00147 }
  96. <a name="l00148"></a>00148
  97. <a name="l00155"></a><a class="code" href="class_zend_x___j_query___form___element___ui_widget.html#a14709784de42ac1565c64a09debb7db8">00155</a> <span class="keyword">public</span> function <a class="code" href="class_zend_x___j_query___form___element___ui_widget.html#a14709784de42ac1565c64a09debb7db8">getDecorators</a>()
  98. <a name="l00156"></a>00156 {
  99. <a name="l00157"></a>00157 $decorators = <a class="code" href="class_zend_x___j_query___form___element___ui_widget.html#a14709784de42ac1565c64a09debb7db8">parent::getDecorators</a>();
  100. <a name="l00158"></a>00158 <span class="keywordflow">if</span>(count($decorators) &gt; 0) {
  101. <a name="l00159"></a>00159 <span class="comment">// Only check this if there are decorators present, otherwise it could</span>
  102. <a name="l00160"></a>00160 <span class="comment">// be that the decorators have not been initialized yet.</span>
  103. <a name="l00161"></a>00161 $foundUiWidgetElementMarker = <span class="keyword">false</span>;
  104. <a name="l00162"></a>00162 <span class="keywordflow">foreach</span>($decorators AS $decorator) {
  105. <a name="l00163"></a>00163 <span class="keywordflow">if</span>($decorator instanceof <a class="code" href="interface_zend_x___j_query___form___decorator___ui_widget_element_marker.html">ZendX_JQuery_Form_Decorator_UiWidgetElementMarker</a>) {
  106. <a name="l00164"></a>00164 $foundUiWidgetElementMarker = <span class="keyword">true</span>;
  107. <a name="l00165"></a>00165 }
  108. <a name="l00166"></a>00166 }
  109. <a name="l00167"></a>00167 <span class="keywordflow">if</span>($foundUiWidgetElementMarker === <span class="keyword">false</span>) {
  110. <a name="l00168"></a>00168 require_once <span class="stringliteral">&quot;ZendX/JQuery/Form/Exception.php&quot;</span>;
  111. <a name="l00169"></a>00169 <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code" href="class_zend_x___j_query___form___exception.html">ZendX_JQuery_Form_Exception</a>(
  112. <a name="l00170"></a>00170 <span class="stringliteral">&quot;Cannot render jQuery form element without at least one decorator &quot;</span>.
  113. <a name="l00171"></a>00171 <span class="stringliteral">&quot;implementing the &#39;ZendX_JQuery_Form_Decorator_UiWidgetElementMarker&#39; interface. &quot;</span>.
  114. <a name="l00172"></a>00172 <span class="stringliteral">&quot;Default decorator for this marker interface is the &#39;ZendX_JQuery_Form_Decorator_UiWidgetElement&#39;. &quot;</span>.
  115. <a name="l00173"></a>00173 <span class="stringliteral">&quot;Hint: The ViewHelper decorator does not render jQuery elements correctly.&quot;</span>
  116. <a name="l00174"></a>00174 );
  117. <a name="l00175"></a>00175 }
  118. <a name="l00176"></a>00176 }
  119. <a name="l00177"></a>00177
  120. <a name="l00178"></a>00178 <span class="keywordflow">return</span> $decorators;
  121. <a name="l00179"></a>00179 }
  122. <a name="l00180"></a>00180 }
  123. </pre></div></div>
  124. </div>
  125. <hr class="footer"/><address class="footer"><small>Generated on Thu Apr 19 2012 17:01:19 for openbiz by&#160;
  126. <a href="http://www.doxygen.org/index.html">
  127. <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.2 </small></address>
  128. </body>
  129. </html>