Location: PHPKode > projects > interface preprocessor for php > ippfp-0.2.10/doc/ippfp_doc_en.xml
<!DOCTYPE BOOK PUBLIC "-//Davenport//DTD DocBook V3.0//EN" []>

<book id="ippfp" lang="en">

<bookinfo>

    <Date>11/19/2004</Date>
    <title>ippfp Documentation</title>
    <authorgroup>
     <author>
	<firstname>Thomas</firstname>
          <surname>M&ouml;nicke</surname>
          <affiliation>
            <address><email>tm at ippfp dot org</email></address>
          </affiliation>
     </author>

    </authorgroup>

    <pubdate>November 19th 2004</pubdate>
    <copyright>
        <year>2004</year>
	<holder>Thomas M&ouml;nicke</holder>
    </copyright>

  <legalnotice>
   <title></title>
   <simpara>
   This Document is available at <ulink url="http://www.ippfp.org/doc/en/">http://www.ippfp.org/doc/en/</>.
   </simpara>
  </legalnotice>


  <legalnotice id="copyright">
   <title>Copyright</title>
   <simpara>
    Copyright &copy; 2004 Thomas M&ouml;nicke. This material 
    may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later.
    The latest version is presently available at <ulink url="http://www.opencontent.org/openpub/">http://www.opencontent.org/openpub/</>.
   </simpara>
   </legalnotice>


</bookinfo>


<Chapter id="gettingstarted">
    <Title>Getting started</Title>
    <sect1>
	<title>Introduction</title>
	<sect2>
	    <title>What is ippfp</title>
	    <para>ippfp is an object-oriented environment aimed at building user interfaces in different output formats quickly and simply. It supports the most importand 
	    input-/output elements and provides those as objects. That means that characteristics of every single element are available in a data structure. This data structure
	    is defined by the class "elements". All elements derive from this class and extend it if necessary by specific characteristics.</para>
	    <para>The library is pointed at beeing able to construct interfaces quickly and efficiently. If one wants to realize for instance a special eleborated website or GTK-program 
	    interface, it is surely the best way to use this technique directly. Whereas ippfp is qualified for automatic generation of user interfaces by software, for rapid
	    prototyping, for input masks of databases, program interfaces, etc. Because of its orientation by objects and its clear seperation of the actual code and 
	    output technology it qualifies also for bigger projects.</para>
	</sect2>

	<sect2>
	    <Title>How it works</Title>
	    <para>The library puts the elements together in a frame. For HTML a HTML page will be created which contains the elements, GTK and ncurses have appropriate windows.
	    The data of elements will be stored in session variables. One does not need to care for details of formats like HTML-tags or GTK-classes. For navigating within 
	    a program the button element should be used. To arrange elements the elements "grid" or rather "table" are the right choices.</para>
	    <para>Elements are created with the "create"-functions which are members of the ippfp main instance and returns objects respective to the goal. To make them visible
	    they will be grouped in a "view" which will be given to the ippfp main instance for processing. This is a flexible way because an existing element can be used in 
	    several views. Thus, elements will be included by reference, not by copy. The advantages are: if an element is in a state, it is independent from the current view 
	    and related informations are available globally.
	    </para>
	    <para>
	    For example: create a text element:

	    <programlisting>
	    $myText = $ippfp->createText("default", 20, "my_text");
	    ...
	    echo $myText->getValue();
	    </programlisting>

	    </para>

	    <para>Your code should be organised into php functions. For example if a button is used, it calls the function given as attribute. It is expedient to integrate 
	    your views into this functions.
	    </para>
	</sect2>
    </sect1>
    <sect1>
	<title>An example</title>
	<sect2>
	    <title>hello world</title>
	    <para>
	    the code:
	    <programlisting>
	    < php
		require_once('ippfp/ippfp.php');
		
		$myView = $ippfp->createView("my view");

		$myLabel = $ippfp->createLabel("hello world");
		
		$myView->insert($myLabel);
		
		$ippfp->process($myView);
	    ?>
	    </programlisting>
	    include the library:
	    <programlisting>
		require_once('ippfp/ippfp.php');
	    </programlisting>
	    create a view:
	    <programlisting>
		$myView = $ippfp->createView("my view");
	    </programlisting>
	    create a label:
	    <programlisting>
	    $myLabel = $ippfp->createLabel("hello world");
	    </programlisting>
	    insert this label into the view:
	    <programlisting>
		$myView->insert($myLabel);
	    </programlisting>
	    process:
	    <programlisting>
		$ippfp->process($myView);
	    </programlisting>
	    </para>
	</sect2>
    </sect1>
    <sect1>
	<title>More examples</title>
	<sect2>
	    <title>Button, status</title>
	    <para>
	    This example shows nicely how you can make different views and navigate with them. Every view is embedded in a function which can be called with a click 
	    event on the button. We also have a choice element an we will see how we can use it in several views.
	    </para>
	    <para>
	    the code:
	    <programlisting>
	    < php
		require_once('ippfp/ippfp.php');
		$ippfp->run();
		
		$myChoice = $ippfp->createChoice("",
		    array(1 => "Dresden", 2 => "Prague", 3 => "San Jose"),"myChoice");
		
		function start($value = null){

		    global $ippfp;
		    global $myChoice;

		    $myView = $ippfp->createView("my view");
		
		    $myView->insert($myChoice);
		    $myView->insert($ippfp->createButton("finish","","","myButton");

		    $ippfp->process($myView);

		}

		function finish($value = null){

		    global $ippfp;
		    global $myChoice;

		    $myView = $ippfp->createView("my second view");

		    $myView->insert($myChoice->getValue());

		    $ippfp->process($myView);
		
		}		
		
	    ?>
	    </programlisting>
	    include the library:
	    <programlisting>
		require_once('ippfp/ippfp.php');
	    </programlisting>
	    call this function to start:
	    <programlisting>
		$ippfp->run();
	    </programlisting>
	    create a choice element:
	    <programlisting>
		$myChoice = $ippfp->createChoice("",array(1 => "Dresden", 2 => "Prague", 3 => "San Jose"),"myChoice");
	    </programlisting>
	    start(), create a view:
	    <programlisting>
	    	function start($value = null){

		    global $ippfp;
		    global $myChoice;

		    $myView = $ippfp->createView("my view");
	    </programlisting>
	    
	    insert the choice element:
	    <programlisting>
	    	$myView->insert($myChoice);
	    </programlisting>

	    create and insert a button:
	    <programlisting>
		    $myView->insert($ippfp->createButton("finish","","","myButton");
	    </programlisting>

	    process:
	    <programlisting>
		    $ippfp->process($myView);
	    </programlisting>

	    finish():
	    <programlisting>
	    	function finish($value = null){

		    global $ippfp;
		    global $myChoice;
		    
		    $myView = $ippfp->createView("my second view");
	    </programlisting>

	    Insert the currently value into the view (it will be converted automatically into a label element):
	    <programlisting>
		    $myView->insert($myChoice->getValue());
	    </programlisting>
	    
	    process:
	    <programlisting>
		    $ippfp->process($myView);
	    </programlisting>
	</sect2>
	<sect2>
	    <title>Several buttons, case differentiation</title>
	    <para>
	    In this example we will see how we can use several buttons to call the same view with different values.
	    </para>
	    <para>
	    the code:
	    <programlisting>
	    < php
		require_once('ippfp/ippfp.php');
		$ippfp->run();

		function start($value){

		    global $ippfp;

		    $myView = $ippfp->createView("my view");

		    $myView->insert($ippfp->createButton("start", "1", "", "button_1_name");
		    $myView->insert($ippfp->createButton("start", "2", "", "button_2_name");

		    $myView->insert($ippfp->createLabel($value);

		    $ippfp->process($myView);
		    
		}
	
	    ?>
	    </programlisting>
	    create two buttons, the second attribute could be an additional value which can be accessed in the called view:
	    <programlisting>
		    $myView->insert($ippfp->createButton("start", "1", "", "button_1");
		    $myView->insert($ippfp->createButton("start", "2", "", "button_2");
	    </programlisting>

	    Readout the values. If we press button 1 the value will be 1, similar to button 2 and 2. Values will be given as function value.
	    <programlisting>
		function start($value){
		    ...
	    	    $myView->insert($value);
		    ...
		}
	    </programlisting>

	    </para>
	</sect2>
    </sect1>

</Chapter>



<Chapter id="installation">
    <title>Installation</title>
    <para>ippfp runs everywhere where php is running. I have tested GTK and NCURSES with linux only.
    Its recommended to use the <ulink url="http://pear.php.net">pear</> installer to install ippfp: <command>pear install ippfp_x.x.x.tgz</command>
    Otherwise you can copy the directory named 'ippfp' into your project.
    </para>
    <para>If you make a <command>require_once('ippfp/ippfp.php');</command> an instance of ippfp with the name 'ippfp' is already applied, you can use it instantly. 
    It is neccessary to call your currently function with <command>$ippfp->run();</command> to get the right view. At the beginning $status is set to 'start'.
    </para>
    <sect1>
	<title>HTML</title>
	<para>No problems, you need a webserver with php support like apache. (php since version 4).
	You can get more informations at <ulink url="http://www.php.net/manual/en/install.php">php documentation</>.</para>
    </sect1>
    <sect1>
	<title>GTK</title>
	<para>extern: install <ulink url="http://gtk.php.net/manual/en/getting-started.php">PHP-GTK</>
	</para>
    </sect1>
    <sect1>
	<title>NCURSES</title>
	    <para>To get these functions to work, you have to compile the CGI or CLI version of PHP with --with-ncurses[=DIR]. For more informations please read the <ulink url="http://www.php.net/manual/en/ref.ncurses.php">php documentation</>.
	    </para>
    </sect1>
    <sect1>
	<title>PDF</title>
	    <para>
	    A modified version of the fpdf library is embedded. There is nothing to do.
	    Please make sure that fonts are available in the pdf subdirectory.
	    </para>
	    <para>
	    characteristics: there are no default values available, they will be ignored. Think about a (paper) form, would you like to have 
	    fields initialised with default values? 
	    The choice element is an empty line. Please remove your debugging output before creating pdf files with fpdf. To generate a pdf you can clone an 
	    existing view with the copy() function into a pdf view.
	    </para>
    </sect1>
</Chapter>



<Chapter id="reference">
    <Title>Reference</Title>

	<sect1>
	    <title>ippfp</title>
	    <para>$ippfp is an instance of class ippfp_application. It will be created automatically and includes methods to create elements. (see related sections).
	    There are the following additional methods:</para>

	    <para>function process, processing a view if you have defined it.
		<funcsynopsis>
		    <funcdef> 
			<function>process</function>
		    </funcdef>
		    <paramdef>view <parameter>$view</parameter></paramdef>
		</funcsynopsis>	
	    </para>
	    <para>
		parameter:
	    </para>
	    <itemizedlist>
		<listitem><para><command>$view</command> - View.</para>
		</listitem>
	    </itemizedlist>
	    <para>
		example:
		<programlisting>
		$ippfp->process($myView);
		</programlisting>
	    </para>

	    <para>function run, calls your function.
		<funcsynopsis>
		    <funcdef>
			<function>run</function>
		    </funcdef>
		    <paramdef><parameter></parameter></paramdef>
		</funcsynopsis>	
	    </para>
	    <para>
		example:
		<programlisting>
		$ippfp->run();
		</programlisting>
	    </para>


	    <para>function copy, create a copy of View.
		<funcsynopsis>
		    <funcdef>view 
			<function>copy</function>
		    </funcdef>
		    <paramdef>view <parameter>$view</parameter></paramdef>
		    <paramdef>string <parameter>$title</parameter></paramdef>
		    <paramdef>string <parameter>$type</parameter></paramdef>
		</funcsynopsis>	
	    </para>
	    <para>
		parameter:
	    </para>
	    <itemizedlist>
		<listitem><para><command>$view</command> - View, which should be copied.</para>
		</listitem>
		<listitem><para><command>$title</command> - title of view.</para>
		</listitem>
		<listitem><para><command>$type</command> - output format.</para>
		</listitem>
	    </itemizedlist>
	    <para>
		example:
		<programlisting>
		$secondView = $ippfp->copy($firstView, "my pdf", "PDF");
		</programlisting>
	    </para>


	    <para>function info, returns number of version.
		<funcsynopsis>
		    <funcdef>string 
			<function>info</function>
		    </funcdef>
		    <paramdef><parameter></parameter></paramdef>
		</funcsynopsis>	
	    </para>
	    <para>
		example:
		<programlisting>
		echo $ippfp->info();
		</programlisting>
	    </para>


	    <para>funktion addError, inserts an error message. All messages will be shown in a related subwindow.
	    returns true on success.
		<funcsynopsis>
		    <funcdef>bool 
			<function>addError</function>
		    </funcdef>
		    <paramdef>string <parameter>$msg</parameter></paramdef>
		</funcsynopsis>	
	    </para>
	    <para>
		parameter:
	    </para>
	    <itemizedlist>
		<listitem><para><command>$msg</command> - error message.</para>
		</listitem>
	    </itemizedlist>
	    <para>
		example:
		<programlisting>
		$ippfp->addError("value could not be saved.");
		</programlisting>
	    </para>


	</sect1>

	<sect1>
	    <title>button</title>
	    <para>
	    button element, navigation within your program.
	    </para>
	    <para>the following function creates a button element:
		<funcsynopsis>
		    <funcdef>element 
			<function>createButton</function>
		    </funcdef>
		    <paramdef>string <parameter>status</parameter></paramdef>
		    <paramdef>string <parameter>value</parameter></paramdef>
		    <paramdef>[string <parameter>src</parameter></paramdef>
		    <paramdef>[string <parameter>name</parameter>]]</paramdef>
		</funcsynopsis>	
	    </para>
	    <para>parameter:</para>
	    <itemizedlist>
		<listitem>
		    <para><command>status</command> - name of function which should be called on click.</para>
		</listitem>
		<listitem>
		    <para><command>value</command> - value, this value could be accessed later with view->emitter.</para>
		</listitem>
		<listitem>
		    <para><command>src</command> - optional. source of image file (graphical button).</para>
		</listitem>
		<listitem>
		    <para><command>name</command> - optional. identifier. Its highly recommended to use unique identifiers to avoid side effects.</para>
		</listitem>
	    </itemizedlist>
	    <para>
		example:
		<programlisting>
		$myButton = $ippfp->createButton("start","10","img/next.png","mybutton");
		</programlisting>
	    </para>
	    <para>
	    Hint: if no image source is given, the name of the button will displayed.
	    	<programlisting>
		$myButton = $ippfp->createButton("start","10","","mybutton");
		</programlisting>
	    </para>
	</sect1>

	<sect1>
	    <title>checkbox</title>
	    <para>
	    checkbox element.
	    </para>
	    <para>creates a checkbox element:
		<funcsynopsis>
		    <funcdef>element 
			<function>createCheckbox</function>
		    </funcdef>
		    <paramdef>string <parameter>text</parameter></paramdef>
		    <paramdef>bool <parameter>checked</parameter></paramdef>
		    <paramdef>[string <parameter>name</parameter>]</paramdef>
		</funcsynopsis>	
	    </para>
	    <para>
		parameter:
	    </para>
	    <itemizedlist>
		<listitem><para><command>text</command> - text which labeled the element.</para>
		</listitem>
		<listitem><para><command>checked</command> - if true, element will be pre-checked.</para>
		</listitem>
		<listitem><para><command>name</command> - optional. identifier. Its highly recommended to use unique identifiers to avoid side effects.</para>

		</listitem>
	    </itemizedlist>
	    <para>
		example:
		<programlisting>
		$myCheckbox = $ippfp->createCheckbox("public",true,"mycheckbox");
		</programlisting>
	    </para>
	</sect1>

	<sect1>
	    <title>choice</title>
	    <para>
	    Choice element, explicit choice (pull down menu).
	    </para>
	    <para>create a choice element:
		<funcsynopsis>
		    <funcdef>element 
			<function>createChoice</function>
		    </funcdef>
		    <paramdef>string <parameter>value</parameter></paramdef>
		    <paramdef>array <parameter>array</parameter></paramdef>
		    <paramdef>[string <parameter>name</parameter>]</paramdef>
		    <paramdef>[string <parameter>status</parameter>]]</paramdef>
		</funcsynopsis>	
	    </para>
	    <para>
		parameter:
	    </para>
	    <itemizedlist>
		<listitem><para><command>value</command> - default value.</para>
		</listitem>
		<listitem><para><command>array</command> - array with pairs value => identifier.</para>
		</listitem>
		<listitem><para><command>name</command> - optional. identifier. Its highly recommended to use unique identifiers to avoid side effects.</para>

		</listitem>
		<listitem><para><command>status</command> - optional. function called after auto reload. 
		If status is enabled, ippfp sets the choice->reload flag true automatically.</para>
		</listitem>
	    </itemizedlist>
	    <para>
		example:
		<programlisting>
		$myChoice = $ippfp->createChoice("",array(1 => "value 1", 2 => "value 2", 3 => "value 3"),"mychoice");
		</programlisting>
	    </para>
	    <para>
	    Note: getValue() will give you the key, not the item. getValueAsString() will give you the item.
	    </para>
	</sect1>

	<sect1>
	    <title>fopen</title>
	    <para>
	    Fileopen element, can be used to open a file or directory.
	    </para>
	    <para>create a fileopen element:
		<funcsynopsis>
		    <funcdef>element 
			<function>createFopen</function>
		    </funcdef>
		    <paramdef>string <parameter>status</parameter></paramdef>
		    <paramdef>string <parameter>value</parameter></paramdef>
		    <paramdef>[string <parameter>name</parameter>]</paramdef>
		</funcsynopsis>	
	    </para>
	    <para>
		parameter:
	    </para>
	    <itemizedlist>
		<listitem><para><command>status</command> - function, called after fileopen.</para>
		</listitem>
		<listitem><para><command>value</command> - out of order.</para>
		</listitem>
		<listitem><para><command>name</command> - optional. Its highly recommended to use unique identifiers to avoid side effects.</para>

		</listitem>
	    </itemizedlist>
	    <para>
		example:
		<programlisting>
		$myFopen = $ippfp->createFopen("","","myfopen");
		</programlisting>
	    </para>
	</sect1>

	<sect1>
	    <title>grid</title>
	    <para>
	    Grid element, element adjustment, you do not need a table.
	    </para>
	    <para>create a grid:
		<funcsynopsis>
		    <funcdef>element 
			<function>createGrid</function>
		    </funcdef>
		    <paramdef>string <parameter>text</parameter></paramdef>
		    <paramdef>array <parameter>array</parameter></paramdef>
		    <paramdef>[string <parameter>name</parameter>]</paramdef>
		</funcsynopsis>	
	    </para>
	    <para>
		parameter:
	    </para>
	    <itemizedlist>
		<listitem><para><command>text</command> - headline, (can be empty, no head background will be created).</para>
		</listitem>
		<listitem><para><command>array</command> - array with elements. If cell is a string, it will be converted into label element automatically. 
		A 1 will be converted into "true".</para>
		</listitem>
		<listitem><para><command>name</command> - optional. Its highly recommended to use unique identifiers to avoid side effects.</para>
		</listitem>
	    </itemizedlist>
	    <para>
		<command>wrapdiv</command> - specifies the class of a div which will be wrapped around the table. If it is empty no div will be created. HTML only.
		Usage: $myTable->wrapdiv = "myclass";
	    </para>
	    <para>
		example:
		<programlisting>
		$myArray = array(
		    array("City:",$ippfp->createText("",20,"city")),
		    array("Phone:",$ippfp->createText("",20,"phone")),
		    array("Description:",$ippfp->createTextarea("",20,"description")),
		);
		$myGrid = $ippfp->createGrid("",$myArray,"mygrid");
		</programlisting>
		Hint: [todo wrapdiv]
		[todo colspan]
	    </para>
	</sect1>

	<sect1>
	    <title>image</title>
	    <para>
	    Image element, shows an image. The png format is recommended.
	    </para>
	    <para>creates an image element:
		<funcsynopsis>
		    <funcdef>element 
			<function>createImage</function>
		    </funcdef>
		    <paramdef>string <parameter>text</parameter></paramdef>
		    <paramdef>string <parameter>src</parameter></paramdef>
		    <paramdef>[string <parameter>name</parameter>]</paramdef>
		</funcsynopsis>	
	    </para>
	    <para>
		parameter:
	    </para>
	    <itemizedlist>
		<listitem><para><command>text</command> - description, can be empty. In html it will be the alt tag.</para>
		</listitem>
		<listitem><para><command>src</command> - relative or absolute image path.</para>
		</listitem>
		<listitem><para><command>name</command> - optional. Its highly recommended to use unique identifiers to avoid side effects.</para>
		</listitem>
	    </itemizedlist>
	    <para>
		example:
		<programlisting>
		$myImage = $ippfp->createImage("my computer","pictures/mycomputer.png","myimage");
		</programlisting>
	    </para>
	</sect1>

	<sect1>
	    <title>label</title>
	    <para>
	    Label element, shows a text.
	    </para>
	    <para>crate a label element:
		<funcsynopsis>
		    <funcdef>element 
			<function>createLabel</function>
		    </funcdef>
		    <paramdef>string <parameter>text</parameter></paramdef>
		    <paramdef>[int <parameter>cols</parameter></paramdef>
		    <paramdef>[string <parameter>name</parameter></paramdef>
		    <paramdef>[string <parameter>FORMATTING</parameter>]]]</paramdef>
		</funcsynopsis>	
	    </para>
	    <para>
		parameter:
	    </para>
	    <itemizedlist>
		<listitem><para><command>text</command> - the text.</para>
		</listitem>
		<listitem><para><command>cols</command> - optional. This value will be used in tables or grids. $cols-number of cells will be merged.</para>
		</listitem>
		<listitem><para><command>name</command> - optional.</para>
		</listitem>
		<listitem><para><command>formatting</command> - optional. You can use one of IPPFP_HEADLINE, IPPFP_BOLD, IPPFP_ITALIC, IPPFP_UNDERLINED for simple text formatting.</para>
		</listitem>
	    </itemizedlist>
	    <para>
		example:
		<programlisting>
		$myLabel = $ippfp->createLabel("example text",1,"mylabel",IPPFP_BOLD);
		</programlisting>
		Hint:
	    </para>
	    <para>HTML: if this function is called with the name attribute a span tag with this name will be created. You can use it for your css stylesheets.</para>
	</sect1>

	<sect1>
	    <title>link</title>
	    <para>
	    Link element. To navigate your program you should use the button element.
	    </para>
	    <para>create a link element:
		<funcsynopsis>
		    <funcdef>element 
			<function>createLink</function>
		    </funcdef>
		    <paramdef>string <parameter>text</parameter></paramdef>
		    <paramdef>string <parameter>target</parameter></paramdef>
		    <paramdef>[string <parameter>src</parameter>]</paramdef>
		    <paramdef>[string <parameter>name</parameter>]]</paramdef>
		</funcsynopsis>	
	    </para>
	    <para>
		parameter:
	    </para>
	    <itemizedlist>
		<listitem><para><command>text</command> - identifier.</para>
		</listitem>
		<listitem><para><command>target</command> - target.</para>
		</listitem>
		<listitem><para><command>src</command> - optional. Specify an image source for graphical buttons.</para>
		</listitem>
		<listitem><para><command>name</command> - optional. Its highly recommended to use unique identifiers to avoid side effects.</para>
		</listitem>
	    </itemizedlist>
	    <para>
		example:
		<programlisting>
		$myLink = $ippfp->createLink("www.ippfp.org","http://www.ippfp.org","","mylink");
		</programlisting>
		Hint: in html package there are 4 additional attributes: bool newWindow; String newTitle, newWidth, newHeight that
		allows you to open an popup window.
	    </para>
	</sect1>

	<sect1>
	    <title>multiplechoice</title>
	    <para>
	    MultipleChoice element
	    </para>
	    <para>create a multiplechoice element:
		<funcsynopsis>
		    <funcdef>element 
			<function>createMultipleChoice</function>
		    </funcdef>
		    <paramdef>array <parameter>value</parameter></paramdef>
		    <paramdef>array <parameter>array</parameter></paramdef>
		    <paramdef>[string <parameter>name</parameter>]</paramdef>
		    <paramdef>[string <parameter>status</parameter>]]</paramdef>
		</funcsynopsis>	
	    </para>
	    <para>
		parameter:
	    </para>
	    <itemizedlist>
		<listitem><para><command>value</command> - default value as array with pairs value => identifier.</para>
		</listitem>
		<listitem><para><command>array</command> - array with pairs value => identifier.</para>
		</listitem>
		<listitem><para><command>name</command> - optional. identifier. Its highly recommended to use unique identifiers to avoid side effects.</para>
		</listitem>
		<listitem><para><command>status</command> - optional. function called after auto reload. 
		If status is enabled, ippfp sets the choice->reload flag true automatically.</para>
		</listitem>
	    </itemizedlist>
	    <para>
		example:
		<programlisting>
		$myChoice = $ippfp->createMultipleChoice(array(1 => "value 1"),array(1 => "value 1", 2 => "value 2", 3 => "value 3"),"mymultiplechoice");
		</programlisting>
	    </para>
	    <para>
	    Note: getValue() will give you the key, not the item. getValueAsString() will give you the item.
	    </para>
	</sect1>

	<sect1>
	    <title>password</title>
	    <para>
	    Passwort element.
	    </para>
	    <para>create a passord element:
		<funcsynopsis>
		    <funcdef>element 
			<function>createPassword</function>
		    </funcdef>
		    <paramdef>string <parameter>text</parameter></paramdef>
		    <paramdef>int <parameter>size</parameter></paramdef>
		    <paramdef>[string <parameter>name</parameter>]</paramdef>
		</funcsynopsis>	
	    </para>
	    <para>
		parameter:
	    </para>
	    <itemizedlist>
		<listitem><para><command>text</command> - to initialize with default value.</para>
		</listitem>
		<listitem><para><command>size</command> - size.</para>
		</listitem>
		<listitem><para><command>name</command> - optional. Its highly recommended to use unique identifiers to avoid side effects.</para>
		</listitem>
	    </itemizedlist>
	    <para>
		example:
		<programlisting>
		$myPassword = $ippfp->createPassword("",20,"mypassword");
		</programlisting>
	    </para>
	</sect1>

	<sect1>
	    <title>radio</title>
	    <para>
	    Radio element.
	    </para>
	    <para>create a radio element:
		<funcsynopsis>
		    <funcdef>element 
			<function>createRadio</function>
		    </funcdef>
		    <paramdef>string <parameter>text</parameter></paramdef>
		    <paramdef>bool <parameter>checked</parameter></paramdef>
		    <paramdef>[string <parameter>name</parameter>]</paramdef>
		</funcsynopsis>	
	    </para>
	    <para>
		parameter:
	    </para>
	    <itemizedlist>
		<listitem><para><command>text</command> - identifier.</para>
		</listitem>
		<listitem><para><command>checked</command> - if true element will be marked.</para>
		</listitem>
		<listitem><para><command>name</command> - optional. Its highly recommended to use unique identifiers to avoid side effects.</para>
		</listitem>
	    </itemizedlist>
	    <para>
		example:
		<programlisting>
		$myRadio = $ippfp->createRadio("checkme",false,"","myradio");
		</programlisting>
	</sect1>

	<sect1>
	    <title>table</title>
	    <para>
	    Table element.
	    </para>
	    <para>create a table:
		<funcsynopsis>
		    <funcdef>element 
			<function>createTable</function>
		    </funcdef>
		    <paramdef>array <parameter>head</parameter></paramdef>
		    <paramdef>array <parameter>array</parameter></paramdef>
		    <paramdef>[string <parameter>name</parameter>]</paramdef>
		</funcsynopsis>	
	    </para>
	    <para>
		parameter:
	    </para>
	    <itemizedlist>
		<listitem><para><command>head</command> - array with table header.</para>
		</listitem>
		<listitem><para><command>array</command> - array with elements. If cell is a string, it will be converted into label element automatically. 
		A 1 will be converted into "true".</para>
		</listitem>
		<listitem><para><command>name</command> - optional. Its highly recommended to use unique identifiers to avoid side effects.</para>
		</listitem>
	    </itemizedlist>
	    <para>
		<command>wrapdiv</command> - specifies the class of a div which will be wrapped around the table. If it is empty no div will be created. HTML only.
		Usage: $myTable->wrapdiv = "myclass";
	    </para>
	    <para>
		example:
		<programlisting>
		$myArray = array(
		    array("Dresden","a city with the flair of the former Saxon residence","Germany"),
		    array("Prague","one of the nine cities awarded by the European Community the title of European City of Culture for the year 2000.","Czech"),
		    array("San Jose", "San Jose has a world-renowned quality of life.","United States"),
		);
		$myTable = $ippfp->createTable(array("city","description","country"),$myArray,"mytable");
		</programlisting>
		Hint: HTML: Every second row is in "mark" class, usefull for inking.
	    </para>
	    
	</sect1>

	<sect1>
	    <title>text</title>
	    <para>
	    Text element, single line.
	    </para>
	    <para>create a text element:
		<funcsynopsis>
		    <funcdef>element 
			<function>createText</function>
		    </funcdef>
		    <paramdef>string <parameter>text</parameter></paramdef>
		    <paramdef>int <parameter>size</parameter></paramdef>
		    <paramdef>[string <parameter>name</parameter>]</paramdef>
		</funcsynopsis>	
	    </para>
	    <para>
		parameter:
	    </para>
	    <itemizedlist>
		<listitem><para><command>text</command> - to initialize with default value.</para>
		</listitem>
		<listitem><para><command>size</command> - size.</para>
		</listitem>
		<listitem><para><command>name</command> - optional. Its highly recommended to use unique identifiers to avoid side effects.</para>
		</listitem>
	    </itemizedlist>
	    <para>
		Flags: <command>maxlength</command> - maximum length of text, default is <command>size</command>
	    </para>
	    <para>
		example:
		<programlisting>
		$myText = $ippfp->createText("",20,"mytext");
		</programlisting>
	</sect1>

	<sect1>
	    <title>textarea</title>
	    <para>
	    Textarea element, multiple lines.
	    </para>
	    <para>create a textarea element:
		<funcsynopsis>
		    <funcdef>element 
			<function>createTextarea</function>
		    </funcdef>
		    <paramdef>string <parameter>text</parameter></paramdef>
		    <paramdef>int <parameter>cols</parameter></paramdef>
		    <paramdef>[string <parameter>name</parameter>]</paramdef>
		</funcsynopsis>	
	    </para>
	    <para>
		parameter:
	    </para>
	    <itemizedlist>
		<listitem><para><command>text</command> - to initialize with default value.</para>
		</listitem>
		<listitem><para><command>cols</command> - width. To set the height value you can use the textarea->rows flag.</para>
		</listitem>
		<listitem><para><command>name</command> - optional. Its highly recommended to use unique identifiers to avoid side effects.</para>
		</listitem>
	    </itemizedlist>
	    <para>
		example:
		<programlisting>
		$myTextarea = $ippfp->createTextarea("",20,"mytextarea");
		</programlisting>
	</sect1>

	<sect1>
	    <title>view</title>
	    <para>
	    View element, groups all elements to show them.
	    </para>
	    <para>create a view element:
		<funcsynopsis>
		    <funcdef>element 
			<function>createView</function>
		    </funcdef>
		    <paramdef>string <parameter>title</parameter></paramdef>
		</funcsynopsis>	
	    </para>
	    <para>
		parameter:
	    </para>
	    <itemizedlist>
		<listitem><para><command>title</command> - title of view.</para>
		</listitem>
	    </itemizedlist>
	    <para>
		example:
		<programlisting>
		$myView = $ippfp->createView("myview");
		</programlisting>
	</sect1>

</Chapter>

</book>
Return current item: interface preprocessor for php