cvs: peardoc /en/package/structures structures-datagrid.xml /en/package/structures/structures-datagrid example-advanced.xml
/en/package/structures/structures-datagrid/structures-datagrid attachrenderer.xml setrenderer.xml
/en/package/structures/structures-datagrid/structures-datagrid-column setformatter.xml structures-datagrid-column.xml
/en/package/structures/structures-datagrid/structures-datagrid-datasource dataobject.xml
/en/package/structures/structures-datagrid/structures-datagrid-renderer checkablehtmltable.xml htmleditform.xml smarty.xml
| From: | Olivier Guilyardi | Date: | Fri, 15 Jun 2007 10:17:27 +0000 |
| Subject: | cvs: peardoc /en/package/structures structures-datagrid.xml /en/package/structures/structures-datagrid example-advanced.xml /en/package/structures/structures-datagrid/structures-datagrid attachrenderer.xml setrenderer.xml /en/package/structures/structures-datagrid/structures-datagrid-column setformatter.xml structures-datagrid-column.xml /en/package/structures/structures-datagrid/structures-datagrid-datasource dataobject.xml /en/package/structures/structures-datagrid/structures-datagrid-renderer checkablehtmltable.xml htmleditform.xml smarty.xml |
||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-9773@lists.php.net to get a copy of this message | ||
olivierg Fri Jun 15 10:17:27 2007 UTC
Added files:
/peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer
checkablehtmltable.xml
Modified files:
/peardoc/en/package/structures structures-datagrid.xml
/peardoc/en/package/structures/structures-datagrid
example-advanced.xml
/peardoc/en/package/structures/structures-datagrid/structures-datagrid
attachrenderer.xml
setrenderer.xml
/peardoc/en/package/structures/structures-datagrid/structures-datagrid-column
setformatter.xml
structures-datagrid-column.xml
/peardoc/en/package/structures/structures-datagrid/structures-datagrid-datasource
dataobject.xml
/peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer
htmleditform.xml
smarty.xml
Log:
- update DataObject datasource page for version 0.2.0
- add "CVS only" availability section in HTMLEditForm renderer
- add CheckableHTMLTable renderer page
- fix Smarty renderer variables display
- remove obsolete CVS only warning from advanced example
- fix some "See" sections in DataGrid
- minor changes in Column
http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid.xml?r1=1.42&r2=1.43&diff_format=u Index: peardoc/en/package/structures/structures-datagrid.xml diff -u peardoc/en/package/structures/structures-datagrid.xml:1.42 peardoc/en/package/structures/structures-datagrid.xml:1.43 --- peardoc/en/package/structures/structures-datagrid.xml:1.42 Sun Mar 11 15:45:45 2007 +++ peardoc/en/package/structures/structures-datagrid.xml Fri Jun 15 10:17:26 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.42 $ --> +<!-- $Revision: 1.43 $ --> <sect1 id="package.structures.structures-datagrid"> <title>Structures_DataGrid</title> <!-- @@ -145,6 +145,7 @@ <sect2 id="package.structures.structures-datagrid.structures-datagrid-renderer"> <title>Renderer drivers</title> +&package.structures.structures-datagrid.structures-datagrid-renderer.checkablehtmltable; &package.structures.structures-datagrid.structures-datagrid-renderer.console; &package.structures.structures-datagrid.structures-datagrid-renderer.csv; &package.structures.structures-datagrid.structures-datagrid-renderer.flexy; http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid/example-advanced.xml?r1=1.21&r2=1.22&diff_format=u Index: peardoc/en/package/structures/structures-datagrid/example-advanced.xml diff -u peardoc/en/package/structures/structures-datagrid/example-advanced.xml:1.21 peardoc/en/package/structures/structures-datagrid/example-advanced.xml:1.22 --- peardoc/en/package/structures/structures-datagrid/example-advanced.xml:1.21 Fri Jul 7 20:08:46 2006 +++ peardoc/en/package/structures/structures-datagrid/example-advanced.xml Fri Jun 15 10:17:27 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.21 $ --> +<!-- $Revision: 1.22 $ --> <refentry id="package.structures.structures-datagrid.example-advanced"> <refnamediv> @@ -17,9 +17,6 @@ System using the DB_DataObject package to handle the database aspects of this example. </para> - <para><emphasis>Warning:</emphasis> this example makes use of new features that will - be available in the upcoming Structures_DataGrid 0.7 release. In the - meantime, please use the CVS version.</para> <example> <title>User Management System Example</title> http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid/structures-datagrid/attachrenderer.xml?r1=1.10&r2=1.11&diff_format=u Index: peardoc/en/package/structures/structures-datagrid/structures-datagrid/attachrenderer.xml diff -u peardoc/en/package/structures/structures-datagrid/structures-datagrid/attachrenderer.xml:1.10 peardoc/en/package/structures/structures-datagrid/structures-datagrid/attachrenderer.xml:1.11 --- peardoc/en/package/structures/structures-datagrid/structures-datagrid/attachrenderer.xml:1.10 Tue Dec 26 10:03:04 2006 +++ peardoc/en/package/structures/structures-datagrid/structures-datagrid/attachrenderer.xml Fri Jun 15 10:17:27 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.10 $ --> +<!-- $Revision: 1.11 $ --> <refentry id="package.structures.structures-datagrid.structures-datagrid.attachrenderer"> <refnamediv> <refname> @@ -66,6 +66,15 @@ Renderer instance or a PEAR_Error object </para> </refsect1> + <refsect1 id="package.structures.structures-datagrid.structures-datagrid.attachrenderer.see"> + &title.see; + <para> + <emphasis>see</emphasis> + <link linkend="package.structures.structures-datagrid.structures-datagrid.setrenderer"> + <function>Structures_DataGrid::setRenderer</function> + </link> + </para> + </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid.attachrenderer.throws"> &title.throws; <para> @@ -73,13 +82,6 @@ no exceptions thrown </para> </refsect1> - <refsect1 id="package.structures.structures-datagrid.structures-datagrid.attachrenderer.see"> - &title.see; - <para> - <emphasis>see</emphasis> - Structures_DataGrid::setRenderer - </para> - </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid.attachrenderer.note"> &title.note; ¬e.notstatic; http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid/structures-datagrid/setrenderer.xml?r1=1.11&r2=1.12&diff_format=u Index: peardoc/en/package/structures/structures-datagrid/structures-datagrid/setrenderer.xml diff -u peardoc/en/package/structures/structures-datagrid/structures-datagrid/setrenderer.xml:1.11 peardoc/en/package/structures/structures-datagrid/structures-datagrid/setrenderer.xml:1.12 --- peardoc/en/package/structures/structures-datagrid/structures-datagrid/setrenderer.xml:1.11 Tue Dec 26 10:03:04 2006 +++ peardoc/en/package/structures/structures-datagrid/structures-datagrid/setrenderer.xml Fri Jun 15 10:17:27 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.11 $ --> +<!-- $Revision: 1.12 $ --> <refentry id="package.structures.structures-datagrid.structures-datagrid.setrenderer"> <refnamediv> <refname> @@ -66,6 +66,15 @@ Renderer instance or PEAR_Error </para> </refsect1> + <refsect1 id="package.structures.structures-datagrid.structures-datagrid.setrenderer.see"> + &title.see; + <para> + <emphasis>see</emphasis> + <link linkend="package.structures.structures-datagrid.structures-datagrid.attachrenderer"> + <function>Structures_DataGrid::attachRenderer</function> + </link> + </para> + </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid.setrenderer.throws"> &title.throws; <para> @@ -73,13 +82,6 @@ no exceptions thrown </para> </refsect1> - <refsect1 id="package.structures.structures-datagrid.structures-datagrid.setrenderer.see"> - &title.see; - <para> - <emphasis>see</emphasis> - Structures_DataGrid::attachRenderer - </para> - </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid.setrenderer.note"> &title.note; ¬e.notstatic; http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid/structures-datagrid-column/setformatter.xml?r1=1.13&r2=1.14&diff_format=u Index: peardoc/en/package/structures/structures-datagrid/structures-datagrid-column/setformatter.xml diff -u peardoc/en/package/structures/structures-datagrid/structures-datagrid-column/setformatter.xml:1.13 peardoc/en/package/structures/structures-datagrid/structures-datagrid-column/setformatter.xml:1.14 --- peardoc/en/package/structures/structures-datagrid/structures-datagrid-column/setformatter.xml:1.13 Tue Dec 26 10:03:04 2006 +++ peardoc/en/package/structures/structures-datagrid/structures-datagrid-column/setformatter.xml Fri Jun 15 10:17:27 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.13 $ --> +<!-- $Revision: 1.14 $ --> <refentry id="package.structures.structures-datagrid.structures-datagrid-column.setformatter"> <refnamediv> <refname> @@ -69,13 +69,6 @@ PEAR_Error on failure </para> </refsect1> - <refsect1 id="package.structures.structures-datagrid.structures-datagrid-column.setformatter.throws"> - &title.throws; - <para> - <emphasis>throws</emphasis> - no exceptions thrown - </para> - </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-column.setformatter.see"> &title.see; <para> @@ -83,6 +76,13 @@ <ulink url="http://www.php.net/manual/en/language.pseudo-types.php">http://www.php.net/manual/en/language.pseudo-types.php</ulink> </para> </refsect1> + <refsect1 id="package.structures.structures-datagrid.structures-datagrid-column.setformatter.throws"> + &title.throws; + <para> + <emphasis>throws</emphasis> + no exceptions thrown + </para> + </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-column.setformatter.note"> &title.note; ¬e.notstatic; http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid/structures-datagrid-column/structures-datagrid-column.xml?r1=1.19&r2=1.20&diff_format=u Index: peardoc/en/package/structures/structures-datagrid/structures-datagrid-column/structures-datagrid-column.xml diff -u peardoc/en/package/structures/structures-datagrid/structures-datagrid-column/structures-datagrid-column.xml:1.19 peardoc/en/package/structures/structures-datagrid/structures-datagrid-column/structures-datagrid-column.xml:1.20 --- peardoc/en/package/structures/structures-datagrid/structures-datagrid-column/structures-datagrid-column.xml:1.19 Tue Dec 26 10:03:04 2006 +++ peardoc/en/package/structures/structures-datagrid/structures-datagrid-column/structures-datagrid-column.xml Fri Jun 15 10:17:27 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.19 $ --> +<!-- $Revision: 1.20 $ --> <refentry id="package.structures.structures-datagrid.structures-datagrid-column.structures-datagrid-column"> <refnamediv> <refname> @@ -158,17 +158,14 @@ </variablelist> </para> </refsect1> - <refsect1 id="package.structures.structures-datagrid.structures-datagrid-column.structures-datagrid-column.throws"> - &title.throws; - <para> - <emphasis>throws</emphasis> - no exceptions thrown - </para> - </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-column.structures-datagrid-column.see"> &title.see; <para> <emphasis>see</emphasis> + <ulink url="http://www.php.net/manual/en/language.pseudo-types.php">http://www.php.net/manual/en/language.pseudo-types.php</ulink> + </para> + <para> + <emphasis>see</emphasis> <link linkend="package.structures.structures-datagrid.structures-datagrid-column.setformatter"> <function>Structures_DataGrid_Column::setFormatter</function> </link> @@ -179,9 +176,12 @@ <function>Structures_DataGrid::addColumn</function> </link> </para> + </refsect1> + <refsect1 id="package.structures.structures-datagrid.structures-datagrid-column.structures-datagrid-column.throws"> + &title.throws; <para> - <emphasis>see</emphasis> - <ulink url="http://www.php.net/manual/en/language.pseudo-types.php">http://www.php.net/manual/en/language.pseudo-types.php</ulink> + <emphasis>throws</emphasis> + no exceptions thrown </para> </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-column.structures-datagrid-column.note"> http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid/structures-datagrid-datasource/dataobject.xml?r1=1.8&r2=1.9&diff_format=u Index: peardoc/en/package/structures/structures-datagrid/structures-datagrid-datasource/dataobject.xml diff -u peardoc/en/package/structures/structures-datagrid/structures-datagrid-datasource/dataobject.xml:1.8 peardoc/en/package/structures/structures-datagrid/structures-datagrid-datasource/dataobject.xml:1.9 --- peardoc/en/package/structures/structures-datagrid/structures-datagrid-datasource/dataobject.xml:1.8 Tue May 15 09:08:12 2007 +++ peardoc/en/package/structures/structures-datagrid/structures-datagrid-datasource/dataobject.xml Fri Jun 15 10:17:27 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.8 $ --> +<!-- $Revision: 1.9 $ --> <refentry id="package.structures.structures-datagrid.structures-datagrid-datasource.dataobject"> <refnamediv> <refname>Structures_DataGrid_DataSource_DataObject</refname> @@ -63,6 +63,15 @@ <entry>array()</entry> </row> <row> + <entry>fields_order_property</entry> + <entry>string</entry> + <entry>The name of a property that you can set within your DataObject. It + will be used to set the order in which fields are displayed, as long as + you're not configuring this by adding/generating columns. Also requires + the fields_property to be set.</entry> + <entry>null</entry> + </row> + <row> <entry>fields_property</entry> <entry>string</entry> <entry>The name of a property that you can set within your DataObject. @@ -72,6 +81,14 @@ <entry>'fb_fieldsToRender'</entry> </row> <row> + <entry>formbuilder_integration</entry> + <entry>bool</entry> + <entry>DEPRECATED: use link_level and fields_order_property instead. For + BC, Setting this to true is equivalent to setting link_level to 3 and + fields_order_property to 'fb_preDefOrder'.</entry> + <entry>false</entry> + </row> + <row> <entry>generate_columns</entry> <entry>bool</entry> <entry>Generate Structures_DataGrid_Column objects with labels. See the @@ -91,12 +108,40 @@ <entry>labels_property</entry> <entry>string</entry> <entry>The name of a property that you can set within your DataObject. - This property is expected to contain the same kind of information as the - 'labels' option. If the 'labels' option is set, this one will not be - used.</entry> + This property should contain the same kind of information as the 'labels' + option. If the 'labels' option is set, this one will not be used.</entry> <entry>'fb_fieldLabels'</entry> </row> <row> + <entry>link_keep_key</entry> + <entry>bool</entry> + <entry>Set this to true when you want to keep the original values + (usually foreign keys) of fields which are being replaced by their linked + values. The record will then contain additional keys with + "__key" prepended. This option only makes sense with link_level + higher than 0. Example: if the country_code original value is 'FR' and + this is replaced by "France" from the linked country table, + then setting link_keep_key to true will keep the "FR" value in + country_code__key.</entry> + <entry>false</entry> + </row> + <row> + <entry>link_level</entry> + <entry>int</entry> + <entry>The maximum link display level. If equal to 0 the links will not + be followed.</entry> + <entry>0</entry> + </row> + <row> + <entry>link_property</entry> + <entry>string</entry> + <entry>The name of a property you can set within a linked DataObject. + This property should contain a array of field names that will be used to + display a string out of this linked DataObject. Has no effect when + link_level is 0.</entry> + <entry>'fb_linkDisplayFields'</entry> + </row> + <row> <entry>primary_key</entry> <entry>array</entry> <entry>Name(s), or numerical index(es) of the field(s) which contain a @@ -113,10 +158,39 @@ DB_DataObject::count().</entry> <entry>false</entry> </row> + <row> + <entry>sort_property</entry> + <entry>string</entry> + <entry>The name of a property that you can set within your DataObject. + This property should contain an array of the form: + array("field1", "field1 DESC", ...) If the data is + already being sorted then this this property's content will be appended + to the current ordering.</entry> + <entry>'fb_linkOrderFields'</entry> + </row> </tbody> </tgroup> </table> </refsect1> + <refsect1 id="package.structures.structures-datagrid.structures-datagrid-datasource.dataobject.examples"> + <title>Examples</title> + <example> + <title>Bind a DB_DataObject to Structures_DataGrid</title> + <programlisting role="php"> +<![CDATA[ +<?php +$person = new DataObjects_Person; + +$person->hair = 'red'; +$person->has_glasses = 1; + +$datagrid->bind($person); +?> + +]]> + </programlisting> + </example> + </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/htmleditform.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/htmleditform.xml diff -u peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/htmleditform.xml:1.2 peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/htmleditform.xml:1.3 --- peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/htmleditform.xml:1.2 Sat Dec 16 14:16:44 2006 +++ peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/htmleditform.xml Fri Jun 15 10:17:27 2007 @@ -1,10 +1,18 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="package.structures.structures-datagrid.structures-datagrid-renderer.htmleditform"> <refnamediv> <refname>Structures_DataGrid_Renderer_HTMLEditForm</refname> <refpurpose>HTML form to edit a record</refpurpose> </refnamediv> + <refsect1 id="package.structures.structures-datagrid.structures-datagrid-renderer.htmleditform.release"> + <title>Availability</title> + <para> + This driver is <emphasis>experimental</emphasis> + and has not been officially released yet. + It is <emphasis>only available from CVS</emphasis>. + </para> + </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-renderer.htmleditform.modes"> <title>Supported operations modes</title> <para> http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/smarty.xml?r1=1.8&r2=1.9&diff_format=u Index: peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/smarty.xml diff -u peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/smarty.xml:1.8 peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/smarty.xml:1.9 --- peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/smarty.xml:1.8 Sat Dec 9 17:15:11 2006 +++ peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/smarty.xml Fri Jun 15 10:17:27 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.8 $ --> +<!-- $Revision: 1.9 $ --> <refentry id="package.structures.structures-datagrid.structures-datagrid-renderer.smarty"> <refnamediv> <refname>Structures_DataGrid_Renderer_Smarty</refname> @@ -166,27 +166,29 @@ </para> <para> This driver assigns the following Smarty variables: - - $columnSet: array of columns specifications - structure: - array ( - 0 => array ( - 'name' => field name, - 'label' => column label, - 'link' => sorting link, - 'attributes' => attributes string, - ), - ... - ) - - $recordSet: array of records values - - $currentPage: current page (starting from 1) - - $recordLimit: number of rows per page - - $pagesNum: number of pages - - $columnsNum: number of columns - - $recordsNum: number of records in the current page - - $totalRecordsNum: total number of records - - $firstRecord: first record number (starting from 1) - - $lastRecord: last record number (starting from 1) - - $currentSort: array with column names and the directions used for sorting + <programlisting> +- $columnSet: array of columns specifications + structure: + array ( + 0 => array ( + 'name' => field name, + 'label' => column label, + 'link' => sorting link, + 'attributes' => attributes string, + ), + ... + ) +- $recordSet: array of records values +- $currentPage: current page (starting from 1) +- $recordLimit: number of rows per page +- $pagesNum: number of pages +- $columnsNum: number of columns +- $recordsNum: number of records in the current page +- $totalRecordsNum: total number of records +- $firstRecord: first record number (starting from 1) +- $lastRecord: last record number (starting from 1) +- $currentSort: array with column names and the directions used for sorting + </programlisting> </para> <para> This driver also registers a Smarty custom function named getPaging http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/checkablehtmltable.xml?view=markup&rev=1.1 Index: peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/checkablehtmltable.xml +++ peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/checkablehtmltable.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.structures.structures-datagrid.structures-datagrid-renderer.checkablehtmltable"> <refnamediv> <refname>Structures_DataGrid_Renderer_CheckableHTMLTable</refname> <refpurpose>HTML table rendering driver with a checkbox for each row of the grid</refpurpose> </refnamediv> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-renderer.checkablehtmltable.release"> <title>Availability</title> <para> This driver is <emphasis>experimental</emphasis> and has not been officially released yet. It is <emphasis>only available from CVS</emphasis>. </para> </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-renderer.checkablehtmltable.desc"> <title>Description</title> <para> Driver for rendering the DataGrid as an HTML table with a checkbox for each row </para> </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-renderer.checkablehtmltable.modes"> <title>Supported operations modes</title> <para> This driver supports the following operation modes: </para> <table> <title>Supported operations modes of this driver</title> <tgroup cols="2"> <thead> <row> <entry>Mode</entry> <entry>Supported?</entry> </row> </thead> <tbody> <row> <entry>Container Support</entry> <entry>yes</entry> </row> <row> <entry>Output Buffering</entry> <entry>yes</entry> </row> <row> <entry>Direct Rendering</entry> <entry>no</entry> </row> <row> <entry>Streaming</entry> <entry>no</entry> </row> </tbody> </tgroup> </table> </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-renderer.checkablehtmltable.options"> <title>Options</title> <para> This driver accepts the following options: </para> <table> <title>Options for this driver</title> <tgroup cols="4"> <thead> <row> <entry>Option</entry> <entry>Type</entry> <entry>Description</entry> <entry>Default Value</entry> </row> </thead> <tbody> <row> <entry>buildFooter</entry> <entry>bool</entry> <entry>Whether to build the footer.</entry> <entry>true</entry> </row> <row> <entry>buildHeader</entry> <entry>bool</entry> <entry>Whether to build the header.</entry> <entry>true</entry> </row> <row> <entry>columnAttributes</entry> <entry>array</entry> <entry>Column cells attributes. This is an array of the form: array(fieldName => array(attribute => value, ...) ...) This option is only used by XML/HTML based drivers.</entry> <entry>array()</entry> </row> <row> <entry>convertEntities</entry> <entry>bool</entry> <entry>Whether or not to convert html entities. This calls htmlspecialchars().</entry> <entry>true</entry> </row> <row> <entry>defaultCellValue</entry> <entry>string</entry> <entry>What value to put by default into empty cells.</entry> <entry>null</entry> </row> <row> <entry>defaultColumnValues</entry> <entry>array</entry> <entry>Per-column default cell value. This is an array of the form: array(fieldName => value, ...).</entry> <entry>array()</entry> </row> <row> <entry>emptyRowAttributes</entry> <entry>array</entry> <entry>An associative array containing the attributes for empty rows.</entry> <entry>array()</entry> </row> <row> <entry>encoding</entry> <entry>string</entry> <entry>The content encoding. If the mbstring extension is present the default value is set from mb_internal_encoding(), otherwise it is ISO-8859-1.</entry> <entry>'ISO-8859-1'</entry> </row> <row> <entry>evenRowAttributes</entry> <entry>array</entry> <entry>An associative array containing each attribute of the even rows.</entry> <entry>array()</entry> </row> <row> <entry>excludeVars</entry> <entry>array</entry> <entry>Variables to be removed from the generated HTTP queries.</entry> <entry>array()</entry> </row> <row> <entry>extraVars</entry> <entry>array</entry> <entry>Variables to be added to the generated HTTP queries.</entry> <entry>array()</entry> </row> <row> <entry>fillWithEmptyRows</entry> <entry>bool</entry> <entry>Ensures that all pages have the same number of rows.</entry> <entry>false</entry> </row> <row> <entry>form</entry> <entry>object</entry> <entry>Instance of a HTML_QuickForm object.</entry> <entry>null</entry> </row> <row> <entry>formRenderer</entry> <entry>object</entry> <entry>Instance of a HTML_QuickForm_Renderer_QuickHtml object.</entry> <entry>null</entry> </row> <row> <entry>headerAttributes</entry> <entry>array</entry> <entry>Attributes for the header row. This is an array of the form: array(attribute => value, ...)</entry> <entry>array()</entry> </row> <row> <entry>hideColumnLinks</entry> <entry>array</entry> <entry>By default sorting links are enabled on all columns. With this option it is possible to disable sorting links on specific columns. This is an array of the form: array(fieldName, ...). This option only affects drivers that support sorting.</entry> <entry>array()</entry> </row> <row> <entry>inputName</entry> <entry>string</entry> <entry>The HTML_QuickForm element name for the checkboxes.</entry> <entry>'checkedItems'</entry> </row> <row> <entry>numberAlign</entry> <entry>bool</entry> <entry>Whether to right-align numeric values.</entry> <entry>true</entry> </row> <row> <entry>oddRowAttributes</entry> <entry>array</entry> <entry>An associative array containing each attribute of the odd rows.</entry> <entry>array()</entry> </row> <row> <entry>primaryKey</entry> <entry>string</entry> <entry>The name of the primary key. This value is used for the checkboxes.</entry> <entry>'id'</entry> </row> <row> <entry>selfPath</entry> <entry>string</entry> <entry>The complete path for sorting and paging links.</entry> <entry>$_SERVER['PHP_SELF']</entry> </row> <row> <entry>sortIconASC</entry> <entry>string</entry> <entry>The icon to define that sorting is currently ascending. Can be text or HTML to define an image.</entry> <entry>''</entry> </row> <row> <entry>sortIconDESC</entry> <entry>string</entry> <entry>The icon to define that sorting is currently descending. Can be text or HTML to define an image.</entry> <entry>''</entry> </row> <row> <entry>sortingResetsPaging</entry> <entry>bool</entry> <entry>Whether sorting HTTP queries reset paging.</entry> <entry>true</entry> </row> </tbody> </tgroup> </table> </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-renderer.checkablehtmltable.notes"> <title>General notes</title> <para> This driver puts a checkbox for each row of the table into the first column. By default, a new column with the value of the 'inputName' option is added for the checkboxes. If you want to customize this column, you can add a column yourself as it is shown in the example. </para> <para> </para> </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-renderer.checkablehtmltable.examples"> <title>Examples</title> <example> <title>Basic usage</title> <programlisting role="php"> <![CDATA[ <?php require_once 'HTML/QuickForm.php'; require_once 'HTML/QuickForm/Renderer/QuickHtml.php'; require_once 'Structures/DataGrid.php'; // prepare the form and the QuickHtml renderer $form =& new HTML_QuickForm(); $renderer =& new HTML_QuickForm_Renderer_QuickHtml(); // add action selectbox and submit button to the form $form->addElement('select', 'action', 'choose', array('delete' => 'Delete', 'move' => 'Move to archive')); $form->addElement('submit', 'submit', 'Save'); // prepare the DataGrid $dg =& new Structures_DataGrid(); if (PEAR::isError($dg)) { die($dg->getMessage() . '<br />' . $dg->getDebugInfo()); } // bind some data (e.g. via a SQL query and MDB2) $error = $dg->bind('SELECT * FROM news', array('dsn' => 'mysql://user:password@server/database')); if (PEAR::isError($error)) { die($error->getMessage() . '<br />' . $error->getDebugInfo()); } // the renderer adds an auto-generated column for the checkbox by default; // it is also possible to add a column yourself, for example like in the // following four lines: $column = new Structures_DataGrid_Column('checkboxes', 'idList', null, array('width' => '10')); $dg->addColumn($column); $dg->generateColumns(); $rendererOptions = array('form' => $form, 'formRenderer' => $renderer, 'inputName' => 'idList', 'primaryKey' => 'id' ); // use a template string for the form $tpl = ''; // generate the HTML table and add it to the template string $tpl .= $dg->getOutput('CheckableHTMLTable', $rendererOptions); if (PEAR::isError($tpl)) { die($tpl->getMessage() . '<br />' . $tpl->getDebugInfo()); } // add the HTML code of the action selectbox and the submit button to the // template string $tpl .= $renderer->elementToHtml('action'); $tpl .= $renderer->elementToHtml('submit'); // we're now ready to output the form (toHtml() adds the <form> / </form> // pair to the template) echo $renderer->toHtml($tpl); // if the form was submitted and the data is valid, show the submitted data if ($form->isSubmitted() && $form->validate()) { var_dump($form->getSubmitValues()); } ?> ]]> </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 -->
http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid.xml?r1=1.42&r2=1.43&diff_format=u Index: peardoc/en/package/structures/structures-datagrid.xml diff -u peardoc/en/package/structures/structures-datagrid.xml:1.42 peardoc/en/package/structures/structures-datagrid.xml:1.43 --- peardoc/en/package/structures/structures-datagrid.xml:1.42 Sun Mar 11 15:45:45 2007 +++ peardoc/en/package/structures/structures-datagrid.xml Fri Jun 15 10:17:26 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.42 $ --> +<!-- $Revision: 1.43 $ --> <sect1 id="package.structures.structures-datagrid"> <title>Structures_DataGrid</title> <!-- @@ -145,6 +145,7 @@ <sect2 id="package.structures.structures-datagrid.structures-datagrid-renderer"> <title>Renderer drivers</title> +&package.structures.structures-datagrid.structures-datagrid-renderer.checkablehtmltable; &package.structures.structures-datagrid.structures-datagrid-renderer.console; &package.structures.structures-datagrid.structures-datagrid-renderer.csv; &package.structures.structures-datagrid.structures-datagrid-renderer.flexy; http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid/example-advanced.xml?r1=1.21&r2=1.22&diff_format=u Index: peardoc/en/package/structures/structures-datagrid/example-advanced.xml diff -u peardoc/en/package/structures/structures-datagrid/example-advanced.xml:1.21 peardoc/en/package/structures/structures-datagrid/example-advanced.xml:1.22 --- peardoc/en/package/structures/structures-datagrid/example-advanced.xml:1.21 Fri Jul 7 20:08:46 2006 +++ peardoc/en/package/structures/structures-datagrid/example-advanced.xml Fri Jun 15 10:17:27 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.21 $ --> +<!-- $Revision: 1.22 $ --> <refentry id="package.structures.structures-datagrid.example-advanced"> <refnamediv> @@ -17,9 +17,6 @@ System using the DB_DataObject package to handle the database aspects of this example. </para> - <para><emphasis>Warning:</emphasis> this example makes use of new features that will - be available in the upcoming Structures_DataGrid 0.7 release. In the - meantime, please use the CVS version.</para> <example> <title>User Management System Example</title> http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid/structures-datagrid/attachrenderer.xml?r1=1.10&r2=1.11&diff_format=u Index: peardoc/en/package/structures/structures-datagrid/structures-datagrid/attachrenderer.xml diff -u peardoc/en/package/structures/structures-datagrid/structures-datagrid/attachrenderer.xml:1.10 peardoc/en/package/structures/structures-datagrid/structures-datagrid/attachrenderer.xml:1.11 --- peardoc/en/package/structures/structures-datagrid/structures-datagrid/attachrenderer.xml:1.10 Tue Dec 26 10:03:04 2006 +++ peardoc/en/package/structures/structures-datagrid/structures-datagrid/attachrenderer.xml Fri Jun 15 10:17:27 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.10 $ --> +<!-- $Revision: 1.11 $ --> <refentry id="package.structures.structures-datagrid.structures-datagrid.attachrenderer"> <refnamediv> <refname> @@ -66,6 +66,15 @@ Renderer instance or a PEAR_Error object </para> </refsect1> + <refsect1 id="package.structures.structures-datagrid.structures-datagrid.attachrenderer.see"> + &title.see; + <para> + <emphasis>see</emphasis> + <link linkend="package.structures.structures-datagrid.structures-datagrid.setrenderer"> + <function>Structures_DataGrid::setRenderer</function> + </link> + </para> + </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid.attachrenderer.throws"> &title.throws; <para> @@ -73,13 +82,6 @@ no exceptions thrown </para> </refsect1> - <refsect1 id="package.structures.structures-datagrid.structures-datagrid.attachrenderer.see"> - &title.see; - <para> - <emphasis>see</emphasis> - Structures_DataGrid::setRenderer - </para> - </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid.attachrenderer.note"> &title.note; ¬e.notstatic; http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid/structures-datagrid/setrenderer.xml?r1=1.11&r2=1.12&diff_format=u Index: peardoc/en/package/structures/structures-datagrid/structures-datagrid/setrenderer.xml diff -u peardoc/en/package/structures/structures-datagrid/structures-datagrid/setrenderer.xml:1.11 peardoc/en/package/structures/structures-datagrid/structures-datagrid/setrenderer.xml:1.12 --- peardoc/en/package/structures/structures-datagrid/structures-datagrid/setrenderer.xml:1.11 Tue Dec 26 10:03:04 2006 +++ peardoc/en/package/structures/structures-datagrid/structures-datagrid/setrenderer.xml Fri Jun 15 10:17:27 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.11 $ --> +<!-- $Revision: 1.12 $ --> <refentry id="package.structures.structures-datagrid.structures-datagrid.setrenderer"> <refnamediv> <refname> @@ -66,6 +66,15 @@ Renderer instance or PEAR_Error </para> </refsect1> + <refsect1 id="package.structures.structures-datagrid.structures-datagrid.setrenderer.see"> + &title.see; + <para> + <emphasis>see</emphasis> + <link linkend="package.structures.structures-datagrid.structures-datagrid.attachrenderer"> + <function>Structures_DataGrid::attachRenderer</function> + </link> + </para> + </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid.setrenderer.throws"> &title.throws; <para> @@ -73,13 +82,6 @@ no exceptions thrown </para> </refsect1> - <refsect1 id="package.structures.structures-datagrid.structures-datagrid.setrenderer.see"> - &title.see; - <para> - <emphasis>see</emphasis> - Structures_DataGrid::attachRenderer - </para> - </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid.setrenderer.note"> &title.note; ¬e.notstatic; http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid/structures-datagrid-column/setformatter.xml?r1=1.13&r2=1.14&diff_format=u Index: peardoc/en/package/structures/structures-datagrid/structures-datagrid-column/setformatter.xml diff -u peardoc/en/package/structures/structures-datagrid/structures-datagrid-column/setformatter.xml:1.13 peardoc/en/package/structures/structures-datagrid/structures-datagrid-column/setformatter.xml:1.14 --- peardoc/en/package/structures/structures-datagrid/structures-datagrid-column/setformatter.xml:1.13 Tue Dec 26 10:03:04 2006 +++ peardoc/en/package/structures/structures-datagrid/structures-datagrid-column/setformatter.xml Fri Jun 15 10:17:27 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.13 $ --> +<!-- $Revision: 1.14 $ --> <refentry id="package.structures.structures-datagrid.structures-datagrid-column.setformatter"> <refnamediv> <refname> @@ -69,13 +69,6 @@ PEAR_Error on failure </para> </refsect1> - <refsect1 id="package.structures.structures-datagrid.structures-datagrid-column.setformatter.throws"> - &title.throws; - <para> - <emphasis>throws</emphasis> - no exceptions thrown - </para> - </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-column.setformatter.see"> &title.see; <para> @@ -83,6 +76,13 @@ <ulink url="http://www.php.net/manual/en/language.pseudo-types.php">http://www.php.net/manual/en/language.pseudo-types.php</ulink> </para> </refsect1> + <refsect1 id="package.structures.structures-datagrid.structures-datagrid-column.setformatter.throws"> + &title.throws; + <para> + <emphasis>throws</emphasis> + no exceptions thrown + </para> + </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-column.setformatter.note"> &title.note; ¬e.notstatic; http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid/structures-datagrid-column/structures-datagrid-column.xml?r1=1.19&r2=1.20&diff_format=u Index: peardoc/en/package/structures/structures-datagrid/structures-datagrid-column/structures-datagrid-column.xml diff -u peardoc/en/package/structures/structures-datagrid/structures-datagrid-column/structures-datagrid-column.xml:1.19 peardoc/en/package/structures/structures-datagrid/structures-datagrid-column/structures-datagrid-column.xml:1.20 --- peardoc/en/package/structures/structures-datagrid/structures-datagrid-column/structures-datagrid-column.xml:1.19 Tue Dec 26 10:03:04 2006 +++ peardoc/en/package/structures/structures-datagrid/structures-datagrid-column/structures-datagrid-column.xml Fri Jun 15 10:17:27 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.19 $ --> +<!-- $Revision: 1.20 $ --> <refentry id="package.structures.structures-datagrid.structures-datagrid-column.structures-datagrid-column"> <refnamediv> <refname> @@ -158,17 +158,14 @@ </variablelist> </para> </refsect1> - <refsect1 id="package.structures.structures-datagrid.structures-datagrid-column.structures-datagrid-column.throws"> - &title.throws; - <para> - <emphasis>throws</emphasis> - no exceptions thrown - </para> - </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-column.structures-datagrid-column.see"> &title.see; <para> <emphasis>see</emphasis> + <ulink url="http://www.php.net/manual/en/language.pseudo-types.php">http://www.php.net/manual/en/language.pseudo-types.php</ulink> + </para> + <para> + <emphasis>see</emphasis> <link linkend="package.structures.structures-datagrid.structures-datagrid-column.setformatter"> <function>Structures_DataGrid_Column::setFormatter</function> </link> @@ -179,9 +176,12 @@ <function>Structures_DataGrid::addColumn</function> </link> </para> + </refsect1> + <refsect1 id="package.structures.structures-datagrid.structures-datagrid-column.structures-datagrid-column.throws"> + &title.throws; <para> - <emphasis>see</emphasis> - <ulink url="http://www.php.net/manual/en/language.pseudo-types.php">http://www.php.net/manual/en/language.pseudo-types.php</ulink> + <emphasis>throws</emphasis> + no exceptions thrown </para> </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-column.structures-datagrid-column.note"> http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid/structures-datagrid-datasource/dataobject.xml?r1=1.8&r2=1.9&diff_format=u Index: peardoc/en/package/structures/structures-datagrid/structures-datagrid-datasource/dataobject.xml diff -u peardoc/en/package/structures/structures-datagrid/structures-datagrid-datasource/dataobject.xml:1.8 peardoc/en/package/structures/structures-datagrid/structures-datagrid-datasource/dataobject.xml:1.9 --- peardoc/en/package/structures/structures-datagrid/structures-datagrid-datasource/dataobject.xml:1.8 Tue May 15 09:08:12 2007 +++ peardoc/en/package/structures/structures-datagrid/structures-datagrid-datasource/dataobject.xml Fri Jun 15 10:17:27 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.8 $ --> +<!-- $Revision: 1.9 $ --> <refentry id="package.structures.structures-datagrid.structures-datagrid-datasource.dataobject"> <refnamediv> <refname>Structures_DataGrid_DataSource_DataObject</refname> @@ -63,6 +63,15 @@ <entry>array()</entry> </row> <row> + <entry>fields_order_property</entry> + <entry>string</entry> + <entry>The name of a property that you can set within your DataObject. It + will be used to set the order in which fields are displayed, as long as + you're not configuring this by adding/generating columns. Also requires + the fields_property to be set.</entry> + <entry>null</entry> + </row> + <row> <entry>fields_property</entry> <entry>string</entry> <entry>The name of a property that you can set within your DataObject. @@ -72,6 +81,14 @@ <entry>'fb_fieldsToRender'</entry> </row> <row> + <entry>formbuilder_integration</entry> + <entry>bool</entry> + <entry>DEPRECATED: use link_level and fields_order_property instead. For + BC, Setting this to true is equivalent to setting link_level to 3 and + fields_order_property to 'fb_preDefOrder'.</entry> + <entry>false</entry> + </row> + <row> <entry>generate_columns</entry> <entry>bool</entry> <entry>Generate Structures_DataGrid_Column objects with labels. See the @@ -91,12 +108,40 @@ <entry>labels_property</entry> <entry>string</entry> <entry>The name of a property that you can set within your DataObject. - This property is expected to contain the same kind of information as the - 'labels' option. If the 'labels' option is set, this one will not be - used.</entry> + This property should contain the same kind of information as the 'labels' + option. If the 'labels' option is set, this one will not be used.</entry> <entry>'fb_fieldLabels'</entry> </row> <row> + <entry>link_keep_key</entry> + <entry>bool</entry> + <entry>Set this to true when you want to keep the original values + (usually foreign keys) of fields which are being replaced by their linked + values. The record will then contain additional keys with + "__key" prepended. This option only makes sense with link_level + higher than 0. Example: if the country_code original value is 'FR' and + this is replaced by "France" from the linked country table, + then setting link_keep_key to true will keep the "FR" value in + country_code__key.</entry> + <entry>false</entry> + </row> + <row> + <entry>link_level</entry> + <entry>int</entry> + <entry>The maximum link display level. If equal to 0 the links will not + be followed.</entry> + <entry>0</entry> + </row> + <row> + <entry>link_property</entry> + <entry>string</entry> + <entry>The name of a property you can set within a linked DataObject. + This property should contain a array of field names that will be used to + display a string out of this linked DataObject. Has no effect when + link_level is 0.</entry> + <entry>'fb_linkDisplayFields'</entry> + </row> + <row> <entry>primary_key</entry> <entry>array</entry> <entry>Name(s), or numerical index(es) of the field(s) which contain a @@ -113,10 +158,39 @@ DB_DataObject::count().</entry> <entry>false</entry> </row> + <row> + <entry>sort_property</entry> + <entry>string</entry> + <entry>The name of a property that you can set within your DataObject. + This property should contain an array of the form: + array("field1", "field1 DESC", ...) If the data is + already being sorted then this this property's content will be appended + to the current ordering.</entry> + <entry>'fb_linkOrderFields'</entry> + </row> </tbody> </tgroup> </table> </refsect1> + <refsect1 id="package.structures.structures-datagrid.structures-datagrid-datasource.dataobject.examples"> + <title>Examples</title> + <example> + <title>Bind a DB_DataObject to Structures_DataGrid</title> + <programlisting role="php"> +<![CDATA[ +<?php +$person = new DataObjects_Person; + +$person->hair = 'red'; +$person->has_glasses = 1; + +$datagrid->bind($person); +?> + +]]> + </programlisting> + </example> + </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/htmleditform.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/htmleditform.xml diff -u peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/htmleditform.xml:1.2 peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/htmleditform.xml:1.3 --- peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/htmleditform.xml:1.2 Sat Dec 16 14:16:44 2006 +++ peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/htmleditform.xml Fri Jun 15 10:17:27 2007 @@ -1,10 +1,18 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="package.structures.structures-datagrid.structures-datagrid-renderer.htmleditform"> <refnamediv> <refname>Structures_DataGrid_Renderer_HTMLEditForm</refname> <refpurpose>HTML form to edit a record</refpurpose> </refnamediv> + <refsect1 id="package.structures.structures-datagrid.structures-datagrid-renderer.htmleditform.release"> + <title>Availability</title> + <para> + This driver is <emphasis>experimental</emphasis> + and has not been officially released yet. + It is <emphasis>only available from CVS</emphasis>. + </para> + </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-renderer.htmleditform.modes"> <title>Supported operations modes</title> <para> http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/smarty.xml?r1=1.8&r2=1.9&diff_format=u Index: peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/smarty.xml diff -u peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/smarty.xml:1.8 peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/smarty.xml:1.9 --- peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/smarty.xml:1.8 Sat Dec 9 17:15:11 2006 +++ peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/smarty.xml Fri Jun 15 10:17:27 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.8 $ --> +<!-- $Revision: 1.9 $ --> <refentry id="package.structures.structures-datagrid.structures-datagrid-renderer.smarty"> <refnamediv> <refname>Structures_DataGrid_Renderer_Smarty</refname> @@ -166,27 +166,29 @@ </para> <para> This driver assigns the following Smarty variables: - - $columnSet: array of columns specifications - structure: - array ( - 0 => array ( - 'name' => field name, - 'label' => column label, - 'link' => sorting link, - 'attributes' => attributes string, - ), - ... - ) - - $recordSet: array of records values - - $currentPage: current page (starting from 1) - - $recordLimit: number of rows per page - - $pagesNum: number of pages - - $columnsNum: number of columns - - $recordsNum: number of records in the current page - - $totalRecordsNum: total number of records - - $firstRecord: first record number (starting from 1) - - $lastRecord: last record number (starting from 1) - - $currentSort: array with column names and the directions used for sorting + <programlisting> +- $columnSet: array of columns specifications + structure: + array ( + 0 => array ( + 'name' => field name, + 'label' => column label, + 'link' => sorting link, + 'attributes' => attributes string, + ), + ... + ) +- $recordSet: array of records values +- $currentPage: current page (starting from 1) +- $recordLimit: number of rows per page +- $pagesNum: number of pages +- $columnsNum: number of columns +- $recordsNum: number of records in the current page +- $totalRecordsNum: total number of records +- $firstRecord: first record number (starting from 1) +- $lastRecord: last record number (starting from 1) +- $currentSort: array with column names and the directions used for sorting + </programlisting> </para> <para> This driver also registers a Smarty custom function named getPaging http://cvs.php.net/viewvc.cgi/peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/checkablehtmltable.xml?view=markup&rev=1.1 Index: peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/checkablehtmltable.xml +++ peardoc/en/package/structures/structures-datagrid/structures-datagrid-renderer/checkablehtmltable.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.structures.structures-datagrid.structures-datagrid-renderer.checkablehtmltable"> <refnamediv> <refname>Structures_DataGrid_Renderer_CheckableHTMLTable</refname> <refpurpose>HTML table rendering driver with a checkbox for each row of the grid</refpurpose> </refnamediv> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-renderer.checkablehtmltable.release"> <title>Availability</title> <para> This driver is <emphasis>experimental</emphasis> and has not been officially released yet. It is <emphasis>only available from CVS</emphasis>. </para> </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-renderer.checkablehtmltable.desc"> <title>Description</title> <para> Driver for rendering the DataGrid as an HTML table with a checkbox for each row </para> </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-renderer.checkablehtmltable.modes"> <title>Supported operations modes</title> <para> This driver supports the following operation modes: </para> <table> <title>Supported operations modes of this driver</title> <tgroup cols="2"> <thead> <row> <entry>Mode</entry> <entry>Supported?</entry> </row> </thead> <tbody> <row> <entry>Container Support</entry> <entry>yes</entry> </row> <row> <entry>Output Buffering</entry> <entry>yes</entry> </row> <row> <entry>Direct Rendering</entry> <entry>no</entry> </row> <row> <entry>Streaming</entry> <entry>no</entry> </row> </tbody> </tgroup> </table> </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-renderer.checkablehtmltable.options"> <title>Options</title> <para> This driver accepts the following options: </para> <table> <title>Options for this driver</title> <tgroup cols="4"> <thead> <row> <entry>Option</entry> <entry>Type</entry> <entry>Description</entry> <entry>Default Value</entry> </row> </thead> <tbody> <row> <entry>buildFooter</entry> <entry>bool</entry> <entry>Whether to build the footer.</entry> <entry>true</entry> </row> <row> <entry>buildHeader</entry> <entry>bool</entry> <entry>Whether to build the header.</entry> <entry>true</entry> </row> <row> <entry>columnAttributes</entry> <entry>array</entry> <entry>Column cells attributes. This is an array of the form: array(fieldName => array(attribute => value, ...) ...) This option is only used by XML/HTML based drivers.</entry> <entry>array()</entry> </row> <row> <entry>convertEntities</entry> <entry>bool</entry> <entry>Whether or not to convert html entities. This calls htmlspecialchars().</entry> <entry>true</entry> </row> <row> <entry>defaultCellValue</entry> <entry>string</entry> <entry>What value to put by default into empty cells.</entry> <entry>null</entry> </row> <row> <entry>defaultColumnValues</entry> <entry>array</entry> <entry>Per-column default cell value. This is an array of the form: array(fieldName => value, ...).</entry> <entry>array()</entry> </row> <row> <entry>emptyRowAttributes</entry> <entry>array</entry> <entry>An associative array containing the attributes for empty rows.</entry> <entry>array()</entry> </row> <row> <entry>encoding</entry> <entry>string</entry> <entry>The content encoding. If the mbstring extension is present the default value is set from mb_internal_encoding(), otherwise it is ISO-8859-1.</entry> <entry>'ISO-8859-1'</entry> </row> <row> <entry>evenRowAttributes</entry> <entry>array</entry> <entry>An associative array containing each attribute of the even rows.</entry> <entry>array()</entry> </row> <row> <entry>excludeVars</entry> <entry>array</entry> <entry>Variables to be removed from the generated HTTP queries.</entry> <entry>array()</entry> </row> <row> <entry>extraVars</entry> <entry>array</entry> <entry>Variables to be added to the generated HTTP queries.</entry> <entry>array()</entry> </row> <row> <entry>fillWithEmptyRows</entry> <entry>bool</entry> <entry>Ensures that all pages have the same number of rows.</entry> <entry>false</entry> </row> <row> <entry>form</entry> <entry>object</entry> <entry>Instance of a HTML_QuickForm object.</entry> <entry>null</entry> </row> <row> <entry>formRenderer</entry> <entry>object</entry> <entry>Instance of a HTML_QuickForm_Renderer_QuickHtml object.</entry> <entry>null</entry> </row> <row> <entry>headerAttributes</entry> <entry>array</entry> <entry>Attributes for the header row. This is an array of the form: array(attribute => value, ...)</entry> <entry>array()</entry> </row> <row> <entry>hideColumnLinks</entry> <entry>array</entry> <entry>By default sorting links are enabled on all columns. With this option it is possible to disable sorting links on specific columns. This is an array of the form: array(fieldName, ...). This option only affects drivers that support sorting.</entry> <entry>array()</entry> </row> <row> <entry>inputName</entry> <entry>string</entry> <entry>The HTML_QuickForm element name for the checkboxes.</entry> <entry>'checkedItems'</entry> </row> <row> <entry>numberAlign</entry> <entry>bool</entry> <entry>Whether to right-align numeric values.</entry> <entry>true</entry> </row> <row> <entry>oddRowAttributes</entry> <entry>array</entry> <entry>An associative array containing each attribute of the odd rows.</entry> <entry>array()</entry> </row> <row> <entry>primaryKey</entry> <entry>string</entry> <entry>The name of the primary key. This value is used for the checkboxes.</entry> <entry>'id'</entry> </row> <row> <entry>selfPath</entry> <entry>string</entry> <entry>The complete path for sorting and paging links.</entry> <entry>$_SERVER['PHP_SELF']</entry> </row> <row> <entry>sortIconASC</entry> <entry>string</entry> <entry>The icon to define that sorting is currently ascending. Can be text or HTML to define an image.</entry> <entry>''</entry> </row> <row> <entry>sortIconDESC</entry> <entry>string</entry> <entry>The icon to define that sorting is currently descending. Can be text or HTML to define an image.</entry> <entry>''</entry> </row> <row> <entry>sortingResetsPaging</entry> <entry>bool</entry> <entry>Whether sorting HTTP queries reset paging.</entry> <entry>true</entry> </row> </tbody> </tgroup> </table> </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-renderer.checkablehtmltable.notes"> <title>General notes</title> <para> This driver puts a checkbox for each row of the table into the first column. By default, a new column with the value of the 'inputName' option is added for the checkboxes. If you want to customize this column, you can add a column yourself as it is shown in the example. </para> <para> </para> </refsect1> <refsect1 id="package.structures.structures-datagrid.structures-datagrid-renderer.checkablehtmltable.examples"> <title>Examples</title> <example> <title>Basic usage</title> <programlisting role="php"> <![CDATA[ <?php require_once 'HTML/QuickForm.php'; require_once 'HTML/QuickForm/Renderer/QuickHtml.php'; require_once 'Structures/DataGrid.php'; // prepare the form and the QuickHtml renderer $form =& new HTML_QuickForm(); $renderer =& new HTML_QuickForm_Renderer_QuickHtml(); // add action selectbox and submit button to the form $form->addElement('select', 'action', 'choose', array('delete' => 'Delete', 'move' => 'Move to archive')); $form->addElement('submit', 'submit', 'Save'); // prepare the DataGrid $dg =& new Structures_DataGrid(); if (PEAR::isError($dg)) { die($dg->getMessage() . '<br />' . $dg->getDebugInfo()); } // bind some data (e.g. via a SQL query and MDB2) $error = $dg->bind('SELECT * FROM news', array('dsn' => 'mysql://user:password@server/database')); if (PEAR::isError($error)) { die($error->getMessage() . '<br />' . $error->getDebugInfo()); } // the renderer adds an auto-generated column for the checkbox by default; // it is also possible to add a column yourself, for example like in the // following four lines: $column = new Structures_DataGrid_Column('checkboxes', 'idList', null, array('width' => '10')); $dg->addColumn($column); $dg->generateColumns(); $rendererOptions = array('form' => $form, 'formRenderer' => $renderer, 'inputName' => 'idList', 'primaryKey' => 'id' ); // use a template string for the form $tpl = ''; // generate the HTML table and add it to the template string $tpl .= $dg->getOutput('CheckableHTMLTable', $rendererOptions); if (PEAR::isError($tpl)) { die($tpl->getMessage() . '<br />' . $tpl->getDebugInfo()); } // add the HTML code of the action selectbox and the submit button to the // template string $tpl .= $renderer->elementToHtml('action'); $tpl .= $renderer->elementToHtml('submit'); // we're now ready to output the form (toHtml() adds the <form> / </form> // pair to the template) echo $renderer->toHtml($tpl); // if the form was submitted and the data is valid, show the submitted data if ($form->isSubmitted() && $form->validate()) { var_dump($form->getSubmitValues()); } ?> ]]> </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 -->