cvs: peardoc /en/package/html html-quickform.xml /en/package/html/html-quickform html-quickform-hierselect.xml
/en/package/html/html-quickform/html-quickform-hierselect html-quickform-hierselect.xml setmainoptions.xml setoptions.xml setsecoptions.xml

From: Date: Sun, 18 Jun 2006 11:16:27 +0000
Subject: cvs: peardoc /en/package/html html-quickform.xml /en/package/html/html-quickform html-quickform-hierselect.xml
/en/package/html/html-quickform/html-quickform-hierselect html-quickform-hierselect.xml setmainoptions.xml setoptions.xml setsecoptions.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-8046@lists.php.net to get a copy of this message
avb Sun Jun 18 11:16:27 2006 UTC Added files: /peardoc/en/package/html/html-quickform/html-quickform-hierselect setoptions.xml Modified files: /peardoc/en/package/html html-quickform.xml /peardoc/en/package/html/html-quickform html-quickform-hierselect.xml /peardoc/en/package/html/html-quickform/html-quickform-hierselect html-quickform-hierselect.xml setmainoptions.xml setsecoptions.xml Log: Update documentation for hierselect, document gotchas from bugs #5218 and #5718

http://cvs.php.net/viewcvs.cgi/peardoc/en/package/html/html-quickform.xml?r1=1.21&r2=1.22&diff_format=u Index: peardoc/en/package/html/html-quickform.xml diff -u peardoc/en/package/html/html-quickform.xml:1.21 peardoc/en/package/html/html-quickform.xml:1.22 --- peardoc/en/package/html/html-quickform.xml:1.21 Wed Oct 20 14:09:58 2004 +++ peardoc/en/package/html/html-quickform.xml Sun Jun 18 11:16:26 2006 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.21 $ --> +<!-- $Revision: 1.22 $ --> <sect1 id="package.html.html-quickform"> <title>HTML_QuickForm</title> <para> @@ -175,6 +175,7 @@ &package.html.html-quickform.html-quickform-hierselect; &package.html.html-quickform.html-quickform-hierselect.html-quickform-hierselect; +&package.html.html-quickform.html-quickform-hierselect.setoptions; &package.html.html-quickform.html-quickform-hierselect.setmainoptions; &package.html.html-quickform.html-quickform-hierselect.setsecoptions; http://cvs.php.net/viewcvs.cgi/peardoc/en/package/html/html-quickform/html-quickform-hierselect.xml?r1=1.4&r2=1.5&diff_format=u Index: peardoc/en/package/html/html-quickform/html-quickform-hierselect.xml diff -u peardoc/en/package/html/html-quickform/html-quickform-hierselect.xml:1.4 peardoc/en/package/html/html-quickform/html-quickform-hierselect.xml:1.5 --- peardoc/en/package/html/html-quickform/html-quickform-hierselect.xml:1.4 Wed Oct 20 14:09:59 2004 +++ peardoc/en/package/html/html-quickform/html-quickform-hierselect.xml Sun Jun 18 11:16:26 2006 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="package.html.html-quickform.html-quickform-hierselect"> <refnamediv> <refname>Class Summary <classname>HTML_QuickForm_hierselect</classname></refname> @@ -61,10 +61,13 @@ $select2[2][2] = 'Skepticism'; // Create a third select with prices for the cds +$select3[0][0][0] = '--- Choose the artist ---'; $select3[0][1][0] = '15.00$'; $select3[0][2][1] = '17.00$'; +$select3[1][0][0] = '--- Choose the artist ---'; $select3[1][1][0] = '15.00$'; $select3[1][2][1] = '17.00$'; +$select3[2][0][0] = '--- Choose the artist ---'; $select3[2][1][0] = '15.00$'; $select3[2][2][1] = '17.00$'; http://cvs.php.net/viewcvs.cgi/peardoc/en/package/html/html-quickform/html-quickform-hierselect/html-quickform-hierselect.xml?r1=1.3&r2=1.4&diff_format=u Index: peardoc/en/package/html/html-quickform/html-quickform-hierselect/html-quickform-hierselect.xml diff -u peardoc/en/package/html/html-quickform/html-quickform-hierselect/html-quickform-hierselect.xml:1.3 peardoc/en/package/html/html-quickform/html-quickform-hierselect/html-quickform-hierselect.xml:1.4 --- peardoc/en/package/html/html-quickform/html-quickform-hierselect/html-quickform-hierselect.xml:1.3 Tue Mar 16 18:10:29 2004 +++ peardoc/en/package/html/html-quickform/html-quickform-hierselect/html-quickform-hierselect.xml Sun Jun 18 11:16:26 2006 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry id="package.html.html-quickform.html-quickform-hierselect.html-quickform-hierselect"> <refnamediv> <refname>constructor HTML_QuickForm_hierselect()</refname> @@ -29,15 +29,23 @@ <variablelist> <varlistentry> <term> - - - &type.string; - <parameter>$elementName</parameter> + &type.string; + <parameter>$elementName</parameter> </term> <listitem> <para> (optional)Input field name attribute </para> + <note> + <simpara>If you are displaying several forms on one page, then + hierselects in these forms should have unique names. In the other + case the values for last hierselect with the same name will + overwrite the values for the previous one. It is extremely + difficult to cleanly fix this behaviour with current QuickForm + architecture, therefore please rely on this workaround. + See <ulink url="http://pear.php.net/bugs/5718">Request #5718</ulink>. + </simpara> + </note> </listitem> </varlistentry> </variablelist> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/html/html-quickform/html-quickform-hierselect/setmainoptions.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/package/html/html-quickform/html-quickform-hierselect/setmainoptions.xml diff -u peardoc/en/package/html/html-quickform/html-quickform-hierselect/setmainoptions.xml:1.1 peardoc/en/package/html/html-quickform/html-quickform-hierselect/setmainoptions.xml:1.2 --- peardoc/en/package/html/html-quickform/html-quickform-hierselect/setmainoptions.xml:1.1 Thu Oct 30 21:06:44 2003 +++ peardoc/en/package/html/html-quickform/html-quickform-hierselect/setmainoptions.xml Sun Jun 18 11:16:26 2006 @@ -1,8 +1,8 @@ -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="package.html.html-quickform.html-quickform-hierselect.setmainoptions"> <refnamediv> <refname>HTML_QuickForm_hierselect::setMainOptions()</refname> - <refpurpose>Sets the options for the first select</refpurpose> + <refpurpose>DEPRECATED: Sets the options for the first select</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> @@ -19,6 +19,7 @@ <refsect1 id="package.html.html-quickform.html-quickform-hierselect.setmainoptions.desc"> &title.desc; <para>Format is standard key/value pairs for select elements. Example is available in the docs for <link linkend="package.html.html-quickform.html-quickform-hierselect.setsecoptions"><function>setSecOptions</function></link>.</para> + <para>This method has been deprecated. Use <link linkend="package.html.html-quickform.html-quickform-hierselect.setoptions"><function>setOptions</function> </link> instead.</para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform-hierselect.setmainoptions.param"> &title.param; @@ -55,6 +56,10 @@ <refsect1 id="package.html.html-quickform.html-quickform-hierselect.setmainoptions.note"> &title.note; &note.notstatic; + &note.deprecated; + <para> + Deprecated in release 3.2.2 + </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewcvs.cgi/peardoc/en/package/html/html-quickform/html-quickform-hierselect/setsecoptions.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/package/html/html-quickform/html-quickform-hierselect/setsecoptions.xml diff -u peardoc/en/package/html/html-quickform/html-quickform-hierselect/setsecoptions.xml:1.1 peardoc/en/package/html/html-quickform/html-quickform-hierselect/setsecoptions.xml:1.2 --- peardoc/en/package/html/html-quickform/html-quickform-hierselect/setsecoptions.xml:1.1 Thu Oct 30 21:06:44 2003 +++ peardoc/en/package/html/html-quickform/html-quickform-hierselect/setsecoptions.xml Sun Jun 18 11:16:26 2006 @@ -1,8 +1,8 @@ -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="package.html.html-quickform.html-quickform-hierselect.setsecoptions"> <refnamediv> <refname>HTML_QuickForm_hierselect::setSecOptions()</refname> - <refpurpose>Sets the options for the secondary select</refpurpose> + <refpurpose>DEPRECATED: Sets the options for the secondary select</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> @@ -19,6 +19,7 @@ <refsect1 id="package.html.html-quickform.html-quickform-hierselect.setsecoptions.desc"> &title.desc; <para>Sets the options for the secondary select. Options are passed as a two-dimensional array, where the first key is parent id and the second key is child id, as it is needed to know the parent option to which the secondary option relates.</para> + <para>This method has been deprecated. Use <link linkend="package.html.html-quickform.html-quickform-hierselect.setoptions"><function>setOptions</function> </link> instead.</para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform-hierselect.setsecoptions.param"> &title.param; @@ -55,6 +56,10 @@ <refsect1 id="package.html.html-quickform.html-quickform-hierselect.setsecoptions.note"> &title.note; &note.notstatic; + &note.deprecated; + <para> + Deprecated in release 3.2.2 + </para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform-hierselect.setsecoptions.example"> &title.example; http://cvs.php.net/viewcvs.cgi/peardoc/en/package/html/html-quickform/html-quickform-hierselect/setoptions.xml?view=markup&rev=1.1 Index: peardoc/en/package/html/html-quickform/html-quickform-hierselect/setoptions.xml +++ peardoc/en/package/html/html-quickform/html-quickform-hierselect/setoptions.xml <!-- $Revision: 1.1 $ --> <refentry id="package.html.html-quickform.html-quickform-hierselect.setoptions"> <refnamediv> <refname>HTML_QuickForm_hierselect::setOptions()</refname> <refpurpose>Sets the options for the select elements</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once &apos;HTML/QuickForm/hierselect.php&apos;; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>HTML_QuickForm_hierselect::setOptions</function></funcdef> <paramdef>array <parameter>$options</parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.html.html-quickform.html-quickform-hierselect.setoptions.desc"> &title.desc; <para>Sets the options for the select elements within hierselect. Note that the actual number of selects that will be displayed is governed by the number of the elements in the array passed to this function.</para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform-hierselect.setoptions.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.array; <parameter>$options</parameter> </term> <listitem> <para> Array of options for the elements, having the following structure: <programlisting> <![CDATA[ array( // options for the first element array( 'key_1' => 'value 1', 'key_2' => 'value 2', ... 'key_N' => 'value N', ), // options for the second element array( 'key_1' => array( 'key_1_1' => 'value 1.1', 'key_1_2' => 'value 1.2', ... 'key_1_M1' => 'value 1.M1' ), 'key_2' => array( 'key_2_1' => 'value 2.1', 'key_2_2' => 'value 2.2', ... 'key_2_M2' => 'value 2.M2' ), ... 'key_N' => array( 'key_N_1' => 'value N.1', 'key_N_2' => 'value N.2', ... 'key_N_MN' => 'value N.MN' ) ) // options for further elements ... ) ]]> </programlisting> </para> <note> <simpara>The options for subsequent elements should have keys for all options of the previous elements. Having a select without options is invalid HTML and will break hierselect&apos;s JavaScript. See also <ulink url="http://pear.php.net/bugs/5218">Bug #5218</ulink>.</simpara> </note> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform-hierselect.setoptions.throws"> &title.throws; <para> <emphasis>throws</emphasis> no exceptions thrown </para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform-hierselect.setoptions.note"> &title.note; &note.notstatic; <para> <emphasis>since</emphasis> 3.2.2 </para> </refsect1> <refsect1 id="package.html.html-quickform.html-quickform-hierselect.setoptions.example"> &title.example; <example> <title>Setting the hierselect options</title> <programlisting role="php"> <![CDATA[ <?php $select1 = $select2 = $select3 = array(); $select1[0] = 'Pop'; $select1[1] = 'Classical'; $select1[2] = 'Funeral doom'; // second select $select2[0][0] = '--- Artist ---'; $select2[0][1] = 'Red Hot Chil Peppers'; $select2[0][2] = 'The Pixies'; $select2[1][0] = '--- Artist ---'; $select2[1][1] = 'Wagner'; $select2[1][2] = 'Strauss'; $select2[2][0] = '--- Artist ---'; $select2[2][1] = 'Pantheist'; $select2[2][2] = 'Skepticism'; // Create a third select with prices for the cds $select3[0][0][0] = '--- Choose the artist ---'; $select3[0][1][0] = '15.00$'; $select3[0][2][1] = '17.00$'; $select3[1][0][0] = '--- Choose the artist ---'; $select3[1][1][0] = '15.00$'; $select3[1][2][1] = '17.00$'; $select3[2][0][0] = '--- Choose the artist ---'; $select3[2][1][0] = '15.00$'; $select3[2][2][1] = '17.00$'; // Create the Element $sel =& $form->addElement('hierselect', 'cds', 'Choose CD:'); // And add the selection options $sel->setOptions(array($select1, $select2, $select3)); ?> ]]> </programlisting> </example> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
« previous php.pear.doc (#8046) next »