[Wiki] changed: PopulatingYourFirstModule

Wiki Guest <[email protected]>
Newsgroups gmane.comp.horde.cvs
Message-ID <[email protected]>
guest [129.187.43.121]  Sun, 22 Feb 2009 18:08:18 -0500

Modified page: http://wiki.horde.org/PopulatingYourFirstModule
New Revision:  1.9
Change log:  added content about layout

@@ -96,15 +96,63 @@
  All viewable pages ar located in the module's root-folder. All  
businesslogic (classes etc,) are located in separate files in  
<module>/lib.

  ++ Layout

-To move your businesslogic-variabes to a html-layout, the  
Horde_Templates-Package is usefull. You can include templates with  
code tags, and Horde will replace these tags with your  
variable-content, if the tags and the variables are associated via  
template->setVariable(...); For further information read about this  
package wiki.horde.org : /Doc/Dev/TemplatePackage
+Creating the Page-Layout consists of two main tasks:
+ 1. Creating forms for data manipulation
+ 1. and - if the page is complex enought (nearly every page is it)  
you can store the html-content in templates.
+
+If a submenu on the content page ist needed (like in turba), it can  
be generated via <div class="control nowrap"> ..menu..</div>
+
+
++++ Templates
+
+To move your businesslogic-variabes to a html-layout, the  
Horde_Templates-Package is usefull. You can include templates with  
code tags, and Horde will replace these tags with your  
variable-content, if the tags and the variables are associated via  
template->setVariable(...); For further information read about this  
package use wiki.horde.org : /Doc/Dev/TemplatePackage
+
+
++++ Horde_Forms
+
+
+<code type="php">
+// Prepare Variables
+$title = 'myFormtitle';
+$vars = Variables::getDefaultVariables();
+
+// Prepare Form
+$form = &new Horde_Form($vars, $title, 'accountstatement_Form');
+$renderer = new Horde_Form_Renderer();
+
+// Add form fields & Variables.
+$form->addHidden('', 'example_hidden', 'int', false);
+$form->addVariable(_("Title"), 'title', 'text', false);
+
+
+// ---------------------- Render Form ------------
+// Writes the HTML <form....> opening tag.
+$form->open( $renderer,  $vars,  'accountstatement.php', 'post');
+
+// Titelzeile rendern
+$renderer->beginActive($title);
+
+/* writes the via addVariable(...) and addHidden(...) added inputtypes.
+ Available types are:  
http://wiki.horde.org/Doc/Dev/FormTypes?referrer=Doc%2FDev%2FFormPackage#  
*/
+$renderer->renderFormActive($form, $vars);
+
+// writes the "submit" input button
+$renderer->submit();
+
+// writes the HTML </form> tag
+$form->close($renderer);
+
+// stop renderer
+$renderer->end();
+</code>
+

-If a submenu on the content page ist needed (likle in turba), it can  
be generated via <div class="control nowrap"> ..menu..</div>

  ++ Scripts

-If any scripts are needed for layout like striped.js für alternating  
rowcolors, add these scrippts via Horde::addScriptFile('<script.js',  
'ownerapplication_where_to_search: e.g. horde', true ). True means  
that the script should be included via relativ path.
+If any scripts are needed for layout like striped.js für alternating  
rowcolors, add these scripts via Horde::addScriptFile('<script.js',  
'ownerapplication_where_to_search: e.g. horde', true ). True means  
that the script should be included with a relativ path.


  + Services


--
To unsubscribe, mail: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.