cvs: peardoc /en/package/html/html-quickform-advmultiselect/html-quickform-advmultiselect getelementcss.xml html_quickform_advmultiselect.xml
setbuttonattributes.xml setelementtemplate.xml setjselement.xml tohtml.xml

From: Date: Fri, 05 Aug 2005 14:53:23 +0000
Subject: cvs: peardoc /en/package/html/html-quickform-advmultiselect/html-quickform-advmultiselect getelementcss.xml html_quickform_advmultiselect.xml
setbuttonattributes.xml setelementtemplate.xml setjselement.xml tohtml.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-6594@lists.php.net to get a copy of this message
farell Fri Aug 5 10:53:23 2005 EDT Added files: /peardoc/en/package/html/html-quickform-advmultiselect/html-quickform-advmultiselect getelementcss.xml html_quickform_advmultiselect.xml setbuttonattributes.xml setelementtemplate.xml setjselement.xml tohtml.xml Log: first attempt to build a docbook version of HTML_QuickForm_advmultiselect package

http://cvs.php.net/co.php/peardoc/en/package/html/html-quickform-advmultiselect/html-quickform-advmultiselect/getelementcss.xml?r=1.1&p=1 Index: peardoc/en/package/html/html-quickform-advmultiselect/html-quickform-advmultiselect/getelementcss.xml +++ peardoc/en/package/html/html-quickform-advmultiselect/html-quickform-advmultiselect/getelementcss.xml <!-- $Revision: 1.1 $ --> <refentry id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.getelementcss"> <refnamediv> <refname><function>HTML_QuickForm_advmultiselect::getElementCss</function></refname> <refpurpose>Gets default element stylesheet for a basic render</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once &apos;advmultiselect.php&apos;; </funcsynopsisinfo> <funcprototype> <funcdef>string <function>HTML_QuickForm_advmultiselect::getElementCss</function></funcdef> <paramdef>boolean <parameter> <optional>$raw = &true;</optional></parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.getelementcss.desc"> &title.desc; <para> If your browser does not support javascript, or for any reasons you have choosen to disable it, then your only possibility is to use the single checkboxes multi-select shape of HTML_QuickForm_advmultiselect element. </para> <para> You get a more or less decent result with just the basic settings, but it is also highly configurable, so you can almost get what you want. </para> <para> The basic settings can be applied with just the placeholder {stylesheet} into your template element. It can also be applied with <function>getElementCss</function> method. If you does not have existing style tags in your html page, you must call the method with &false; argument. Default behaviour returns only the raw css data without style tags. Useful when using with template engine. </para> </refsect1> <refsect1 id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.getelementcss.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.bool; <parameter>$raw</parameter> </term> <listitem> <para> (optional) html output with script tags or just raw data </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.getelementcss.throws"> &title.throws; <para> <emphasis>throws</emphasis> no exceptions thrown </para> </refsect1> <refsect1 id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.getelementcss.note"> &title.note; <para> <emphasis>since</emphasis> 0.4.0 </para> &note.notstatic; </refsect1> <refsect1 id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.getelementcss.example"> &title.example; <para> <programlisting role="php"> <![CDATA[ <?php require_once 'HTML/QuickForm.php'; require_once 'HTML/QuickForm/advmultiselect.php'; $form = new HTML_QuickForm('ams'); $form->removeAttribute('name'); // XHTML compliance $fruit_array = array( 'apple' => 'Apple', 'orange' => 'Orange', 'pear' => 'Pear', 'banana' => 'Banana', 'cherry' => 'Cherry', 'kiwi' => 'Kiwi', 'lemon' => 'Lemon', 'lime' => 'Lime', 'tangerine' => 'Tangerine' ); // rendering with QF renderer engine and template system $form->addElement('header', null, 'Advanced Multiple Select: custom layout '); $ams =& $form->addElement('advmultiselect', 'fruit', null, $fruit_array); $ams->setLabel(array('Fruit:', 'Available', 'Selected')); // template for a single checkboxes multi-select element shape $template = ' <table{class}> <!-- BEGIN label_3 --><tr><th>{label_3}</th></tr><!-- END label_3 --> <tr> <td>{selected}</td> </tr> </table> '; $ams->setElementTemplate($template); if ($_SERVER['REQUEST_METHOD'] == 'GET') { // fruit default values already selected without any end-user actions $form->setDefaults(array('fruit' => array('kiwi','lime'))); } elseif (isset($_POST['fruit'])) { // fruit end-user selection $form->setDefaults(array('fruit' => $_POST['fruit'])); } $buttons[] =& $form->createElement('submit', null, 'Submit'); $buttons[] =& $form->createElement('reset', null, 'Reset'); $form->addGroup($buttons); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>HTML_QuickForm::advMultiSelect custom example 4b</title> <style type="text/css"> <!-- body { background-color: #FFF; font-family: Verdana, Arial, helvetica; font-size: 10pt; } <?php echo $ams->getElementCss(); ?> // --> </style> </head> <body> <?php if ($form->validate()) { $clean = $form->getSubmitValues(); echo '<pre>'; print_r($clean); echo '</pre>'; } $form->display(); ?> </body> </html> ]]> </programlisting> </para> </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 --> http://cvs.php.net/co.php/peardoc/en/package/html/html-quickform-advmultiselect/html-quickform-advmultiselect/html_quickform_advmultiselect.xml?r=1.1&p=1 Index: peardoc/en/package/html/html-quickform-advmultiselect/html-quickform-advmultiselect/html_quickform_advmultiselect.xml +++ peardoc/en/package/html/html-quickform-advmultiselect/html-quickform-advmultiselect/html_quickform_advmultiselect.xml <!-- $Revision: 1.1 $ --> <refentry id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.html-quickform-advmultiselect"> <refnamediv> <refname>constructor <function>HTML_QuickForm_advmultiselect::HTML_QuickForm_advmultiselect</function></refname> <refpurpose>Class constructor</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once &apos;advmultiselect.php&apos;; </funcsynopsisinfo> <funcprototype> <funcdef>void constructor <function>HTML_QuickForm_advmultiselect::HTML_QuickForm_advmultiselect</function></funcdef> <paramdef>string <parameter> <optional>$elementName = &null;</optional></parameter></paramdef> <paramdef>mixed <parameter> <optional>$elementLabel = &null;</optional></parameter></paramdef> <paramdef>mixed <parameter> <optional>$options = &null;</optional></parameter></paramdef> <paramdef>mixed <parameter> <optional>$attributes = &null;</optional></parameter></paramdef> <paramdef>integer <parameter> <optional>$sortOptions = &null;</optional></parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.html-quickform-advmultiselect.desc"> &title.desc; &notdocumented; </refsect1> <refsect1 id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.html-quickform-advmultiselect.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$elementName</parameter> </term> <listitem> <para> Dual Select name attribute </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.mixed; <parameter>$elementLabel</parameter> </term> <listitem> <para> Label(s) for the select boxes </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.mixed; <parameter>$options</parameter> </term> <listitem> <para> Data to be used to populate options </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.mixed; <parameter>$attributes</parameter> </term> <listitem> <para> Either a typical HTML attribute string or an associative array </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.int; <parameter>$sortOptions</parameter> </term> <listitem> <para> Either SORT_ASC for auto ascending arrange, SORT_DESC for auto descending arrange, or NULL for no sort (append at end: default) </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.html-quickform-advmultiselect.throws"> &title.throws; <para> <emphasis>throws</emphasis> no exceptions thrown </para> </refsect1> <refsect1 id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.html-quickform-advmultiselect.note"> &title.note; &note.notstatic; </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 --> http://cvs.php.net/co.php/peardoc/en/package/html/html-quickform-advmultiselect/html-quickform-advmultiselect/setbuttonattributes.xml?r=1.1&p=1 Index: peardoc/en/package/html/html-quickform-advmultiselect/html-quickform-advmultiselect/setbuttonattributes.xml +++ peardoc/en/package/html/html-quickform-advmultiselect/html-quickform-advmultiselect/setbuttonattributes.xml <!-- $Revision: 1.1 $ --> <refentry id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.setbuttonattributes"> <refnamediv> <refname><function>HTML_QuickForm_advmultiselect::setButtonAttributes</function></refname> <refpurpose>Sets the button attributes</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once &apos;advmultiselect.php&apos;; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>HTML_QuickForm_advmultiselect::setButtonAttributes</function></funcdef> <paramdef>string <parameter>$button</parameter></paramdef> <paramdef>mixed <parameter> <optional>$attributes = &null;</optional></parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.setbuttonattributes.desc"> &title.desc; <para> The basic settings gave standard form input buttons. You may change the look with some CSS if you set the <emphasis>class</emphasis> attribute in the <parameter>$attributes</parameter> hash (second parameter). See example section. </para> <para> Only five attibutes may be set, they are: <variablelist> <varlistentry> <term> <parameter>name</parameter> </term> <listitem> <para> The form input button name. Default are: 'add', or 'remove', or 'up', or 'down'. </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> <parameter>value</parameter> </term> <listitem> <para> The form input button text. Default are ' &gt;&gt; ', or ' &lt;&lt; ', or ' Up ', or ' Down '. </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> <parameter>type</parameter> </term> <listitem> <para> The form input button kind. Default is 'button' (Can be either 'button' or 'image'). </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> <parameter>class</parameter> </term> <listitem> <para> A CSS class identifier in one of your stylesheets. </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> <parameter>src</parameter> </term> <listitem> <para> URL of the image file used. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.setbuttonattributes.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$button</parameter> </term> <listitem> <para> Button identifier, either &apos;add&apos;, &apos;remove&apos;, &apos;moveup&apos; or &apos;movedown&apos; </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.mixed; <parameter>$attributes</parameter> </term> <listitem> <para> (optional) Either a typical HTML attribute string or an associative array </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.setbuttonattributes.throws"> &title.throws; <para> <emphasis>throws</emphasis> no exceptions thrown </para> </refsect1> <refsect1 id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.setbuttonattributes.note"> &title.note; <para> <emphasis>since</emphasis> 0.4.0 </para> &note.notstatic; </refsect1> <refsect1 id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.setbuttonattributes.example"> &title.example; <para> In this example, the 'add' and 'remove' buttons have look set by the css class 'inputCommand'. <programlisting role="php"> <![CDATA[ <?php require_once 'HTML/QuickForm.php'; require_once 'HTML/QuickForm/advmultiselect.php'; $form = new HTML_QuickForm('ams'); $form->removeAttribute('name'); // XHTML compliance $fruit_array = array( 'apple' => 'Apple', 'orange' => 'Orange', 'pear' => 'Pear', 'banana' => 'Banana', 'cherry' => 'Cherry', 'kiwi' => 'Kiwi', 'lemon' => 'Lemon', 'lime' => 'Lime', 'tangerine' => 'Tangerine', ); // rendering with QF renderer engine and template system $form->addElement('header', null, 'Advanced Multiple Select: custom layout '); $ams =& $form->addElement('advmultiselect', 'fruit', null, $fruit_array); $ams->setLabel(array('Fruit:', 'Available', 'Selected')); $ams->setButtonAttributes('add', array('value' => 'Add >>', 'class' => 'inputCommand' )); $ams->setButtonAttributes('remove', array('value' => '<< Remove', 'class' => 'inputCommand' )); $template = ' <table{class}> <!-- BEGIN label_2 --><tr><th align="center">{label_2}</th><!-- END label_2 --> <!-- BEGIN label_3 --><th align="center">{label_3}</th></tr><!-- END label_3 --> <tr> <td>{unselected}</td> <td>{selected}</td> </tr> <tr> <td>{add}</td> <td>{remove}</td> </tr> </table>'; $ams->setElementTemplate($template); if (isset($_POST['fruit'])) { $form->setDefaults(array('fruit' => $_POST['fruit'])); } $form->addElement('submit', 'send', 'Send'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>HTML_QuickForm::advMultiSelect example </title> <style type="text/css"> <!-- body { background-color: #FFF; font-family: Verdana, Arial, helvetica; font-size: 10pt; } ..inputCommand { background-color: #d0d0d0; border: 1px solid #7B7B88; width: 7em; margin-bottom: 2px; } // --> </style> <?php echo $ams->getElementJs(false); ?> </head> <body> <?php if ($form->validate()) { $clean = $form->getSubmitValues(); echo '<pre>'; print_r($clean); echo '</pre>'; } $form->display(); ?> </body> </html> ]]> </programlisting> </para> <para> You may also use images rather than standard form input button. Replaces lines : <programlisting role="php"> <![CDATA[ $ams->setButtonAttributes('add', array('value' => 'Add >>', 'class' => 'inputCommand' )); $ams->setButtonAttributes('remove', array('value' => '<< Remove', 'class' => 'inputCommand' )); ]]> </programlisting> by lines that should like : <programlisting role="php"> <![CDATA[ $ams->setButtonAttributes('add', array('type' => 'image', 'src' => '/img/add.png' )); $ams->setButtonAttributes('remove', array('type' => 'image', 'src' => '/img/remove.png' )); ]]> </programlisting> </para> </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 --> http://cvs.php.net/co.php/peardoc/en/package/html/html-quickform-advmultiselect/html-quickform-advmultiselect/setelementtemplate.xml?r=1.1&p=1 Index: peardoc/en/package/html/html-quickform-advmultiselect/html-quickform-advmultiselect/setelementtemplate.xml +++ peardoc/en/package/html/html-quickform-advmultiselect/html-quickform-advmultiselect/setelementtemplate.xml <!-- $Revision: 1.1 $ --> <refentry id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.setelementtemplate"> <refnamediv> <refname><function>HTML_QuickForm_advmultiselect::setElementTemplate</function></refname> <refpurpose>Sets element template</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once &apos;advmultiselect.php&apos;; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>HTML_QuickForm_advmultiselect::setElementTemplate</function></funcdef> <paramdef>string <parameter>$html</parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.setelementtemplate.desc"> &title.desc; <para> It is so easy to re-arrange select boxes, headers and buttons position. The template is a bit of html code with reserved placeholders words. They are: </para> <para> <variablelist> <varlistentry> <term> <parameter>stylesheet</parameter> </term> <listitem> <para> The CSS delimited by the style tags required only for the single multi-select with checkboxes shape. Not included in the default template. You can use instead, the <function>getElementCss</function> method. </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> <parameter>javascript</parameter> </term> <listitem> <para> The JavaScript delimited by the script tags required to manage item of both multi-select boxes. If it is not included, you can use instead, the <function>getElementJs</function> method. </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> <parameter>class</parameter> </term> <listitem> <para> A CSS class identifier in one of your stylesheets that is the default table layout. Default values are: <programlisting> <![CDATA[ <table border="0" cellpadding="10" cellspacing="0"> ]]> </programlisting> </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> <parameter>label_2</parameter> </term> <listitem> <para> The unselected list header </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> <parameter>label_3</parameter> </term> <listitem> <para> The selected list header </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> <parameter>unselected</parameter> </term> <listitem> <para> The unselected list. </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> <parameter>selected</parameter> </term> <listitem> <para> The selected list. </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> <parameter>add</parameter> </term> <listitem> <para> The add button to swap one (or more) item from the unselected to the selected list. </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> <parameter>remove</parameter> </term> <listitem> <para> The remove button to swap one (or more) item back from the selected to the unselected list. </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> <parameter>moveup</parameter> </term> <listitem> <para> The button to move one item of the selected list to the top. </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> <parameter>movedown</parameter> </term> <listitem> <para> The button to move one item of the selected list to the bottom. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.setelementtemplate.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$html</parameter> </term> <listitem> <para> The HTML surrounding select boxes and buttons </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.setelementtemplate.throws"> &title.throws; <para> <emphasis>throws</emphasis> no exceptions thrown </para> </refsect1> <refsect1 id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.setelementtemplate.note"> &title.note; <para> <emphasis>since</emphasis> 0.4.0 </para> &note.notstatic; </refsect1> <refsect1 id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.setelementtemplate.example"> &title.example; <para> In this partial example, the fruit list select boxes are set to vertical alignement with images for the 'add' and 'remove' buttons. Default presentation are horizontal alignment with input text buttons in the middle side. <programlisting role="php"> <![CDATA[ <?php require_once 'HTML/QuickForm.php'; require_once 'HTML/QuickForm/advmultiselect.php'; $form = new HTML_QuickForm('ams'); $form->removeAttribute('name'); // XHTML compliance $fruit_array = array( 'apple' => 'Apple', 'orange' => 'Orange', 'pear' => 'Pear', 'banana' => 'Banana', 'cherry' => 'Cherry', 'kiwi' => 'Kiwi', 'lemon' => 'Lemon', 'lime' => 'Lime', 'tangerine' => 'Tangerine', ); $ams =& $form->addElement('advmultiselect', 'fruit', null, $fruit_array); $ams->setLabel(array('Fruit:', 'Available', 'Selected')); $ams->setButtonAttributes('add', array('type' => 'image', 'src' => '/img/down.png')); $ams->setButtonAttributes('remove', array('type' => 'image', 'src' => '/img/up.png')); // vertical select box with image buttons as selector $template = ' <table{class}> <!-- BEGIN label_2 --><tr><th align="center">{label_2}</th></tr><!-- END label_2 --> <tr> <td>{unselected}</td> </tr> <tr> <td align="center">{add}{remove}</td> </tr> <tr> <td>{selected}</td> </tr> <!-- BEGIN label_3 --><tr><th align="center">{label_3}</th></tr><!-- END label_3 --> </table>'; $ams->setElementTemplate($template); // .... ?> ]]> </programlisting> </para> </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 --> http://cvs.php.net/co.php/peardoc/en/package/html/html-quickform-advmultiselect/html-quickform-advmultiselect/setjselement.xml?r=1.1&p=1 Index: peardoc/en/package/html/html-quickform-advmultiselect/html-quickform-advmultiselect/setjselement.xml +++ peardoc/en/package/html/html-quickform-advmultiselect/html-quickform-advmultiselect/setjselement.xml <!-- $Revision: 1.1 $ --> <refentry id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.setjselement"> <refnamediv> <refname><function>HTML_QuickForm_advmultiselect::setJsElement</function></refname> <refpurpose>Sets JavaScript function name parts. Maybe usefull to avoid conflict names</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once &apos;advmultiselect.php&apos;; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>HTML_QuickForm_advmultiselect::setJsElement</function></funcdef> <paramdef>string <parameter> <optional>$pref = &null;</optional></parameter></paramdef> <paramdef>string <parameter> <optional>$post = 'moveSelections'</optional></parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.setjselement.desc"> &title.desc; <para> If you want to change the name of the JavaScript functions that manage items from one list to the other one, for any reason (follow project coding, avoid conflict name, ...), you can do it. The main default function name is <emphasis>moveSelections</emphasis>, without prefix. </para> </refsect1> <refsect1 id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.setjselement.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$pref</parameter> </term> <listitem> <para> (optional) Prefix name </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.string; <parameter>$post</parameter> </term> <listitem> <para> (optional) Postfix name </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.setjselement.throws"> &title.throws; <para> <emphasis>throws</emphasis> no exceptions thrown </para> </refsect1> <refsect1 id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.setjselement.note"> &title.note; <para> <emphasis>since</emphasis> 0.4.0 </para> &note.notstatic; </refsect1> <refsect1 id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.setjselement.see"> &title.see; <para> <link linkend="package.html.html-table.html-table.addcol"> <function>HTML_QuickForm_advmultiselect::getElementJs</function> </link> </para> </refsect1> <refsect1 id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.setjselement.example"> &title.example; <para> While default JavaScript function names are : <simplelist type='inline'> <member>moveSelections</member> <member>updateHidden</member> <member>moveUp</member> <member>moveDown</member> <member>moveSwap</member> </simplelist> , in this example, the prefix is set to 'fruit' and the main function is called 'Selection', and others ones are: <simplelist type='inline'> <member>fruitupdateHidden</member> <member>fruitmoveUp</member> <member>fruitmoveDown</member> <member>fruitmoveSwap</member> </simplelist> <programlisting role="php"> <![CDATA[ <?php require_once 'HTML/QuickForm.php'; require_once 'HTML/QuickForm/advmultiselect.php'; $form = new HTML_QuickForm('ams'); $form->removeAttribute('name'); // XHTML compliance $fruit_array = array( 'apple' => 'Apple', 'orange' => 'Orange', 'pear' => 'Pear', 'banana' => 'Banana', 'cherry' => 'Cherry', 'kiwi' => 'Kiwi', 'lemon' => 'Lemon', 'lime' => 'Lime', 'tangerine' => 'Tangerine', ); $ams =& $form->addElement('advmultiselect', 'fruit', null, $fruit_array); $ams->setLabel(array('Fruit:', 'Available', 'Selected')); $ams->setJsElement('fruit', 'Selection'); // .... ?> ]]> </programlisting> </para> </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 --> http://cvs.php.net/co.php/peardoc/en/package/html/html-quickform-advmultiselect/html-quickform-advmultiselect/tohtml.xml?r=1.1&p=1 Index: peardoc/en/package/html/html-quickform-advmultiselect/html-quickform-advmultiselect/tohtml.xml +++ peardoc/en/package/html/html-quickform-advmultiselect/html-quickform-advmultiselect/tohtml.xml <!-- $Revision: 1.1 $ --> <refentry id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.tohtml"> <refnamediv> <refname><function>HTML_QuickForm_advmultiselect::toHtml</function></refname> <refpurpose>Returns the HTML generated for the advanced mutliple select component</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once &apos;advmultiselect.php&apos;; </funcsynopsisinfo> <funcprototype> <funcdef>string <function>HTML_QuickForm_advmultiselect::toHtml</function></funcdef> <paramdef></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.tohtml.desc"> &title.desc; Returns the advmultiselect element structure as HTML. </refsect1> <refsect1 id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.tohtml.throws"> &title.throws; <para> <emphasis>throws</emphasis> no exceptions thrown </para> </refsect1> <refsect1 id="package.html.html-quickform-advmultiselect.html-quickform-advmultiselect.tohtml.note"> &title.note; <para> <emphasis>since</emphasis> 0.4.0 </para> &note.notstatic; </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 (#6594) next »