Updated CodeCorner3 (markdown)

leithoff
2016-07-26 15:08:32 +02:00
parent ac03c24d01
commit a8d6aa6f9d

@ -366,6 +366,7 @@ This function is added to the <em>class.test_ui.inc.php</em> file.
<dl> <dl>
<dt>Step 9</dt> <dt>Step 9</dt>
<dd>Since you want to be able to call that function from the eGroupware as function call or link or redirekt-link, you have to add the function name to the public_functions array.</dd> <dd>Since you want to be able to call that function from the eGroupware as function call or link or redirekt-link, you have to add the function name to the public_functions array.</dd>
<dd>We do not need the function testinterface anymore</dd>
</dl> </dl>
</dd> </dd>
</dl> </dl>
@ -373,7 +374,6 @@ This function is added to the <em>class.test_ui.inc.php</em> file.
<hr style="text-align: left; width: 99%;" />&nbsp; <hr style="text-align: left; width: 99%;" />&nbsp;
<pre> <pre>
var $public_functions = array( var $public_functions = array(
'testinterface' =&gt; True,
'index' =&gt; True, 'index' =&gt; True,
); );
</pre> </pre>
@ -390,21 +390,15 @@ var $public_functions = array(
<hr style="text-align: left; width: 99%;" />&nbsp; <hr style="text-align: left; width: 99%;" />&nbsp;
<pre> <pre>
// construktor /**
function test_ui() * Constructor
{ *
$GLOBALS['egw_info']['flags']['app_header']='test-Application'; */
function __construct()
$this-&gt;tmpl =&amp; CreateObject('etemplate.etemplate', 'test.index'); {
$this-&gt;bo =&amp; CreateObject('test.botest'); // you may set a fancy app-title.different from title set in setup.inc.php: $setup_info['test']['title']
$this-&gt;html =&amp; $GLOBALS['egw']-&gt;html; $GLOBALS['egw_info']['flags']['app_header']='test-Application';
}
if(!@is_object($GLOBALS['egw']-&gt;js))
{
$GLOBALS['egw']-&gt;js =&amp; CreateObject('phpgwapi.javascript');
}
}
</pre> </pre>
<hr style="text-align: left; width: 99%;" />&nbsp; <hr style="text-align: left; width: 99%;" />&nbsp;
@ -412,33 +406,20 @@ var $public_functions = array(
<dd> <dd>
<dl> <dl>
<dt>Step 11</dt> <dt>Step 11</dt>
<dd>If we add <tt>echo "&lt;a href='".$GLOBALS['egw']-&gt;link('/index.php',array('menuaction' =&gt; 'test.test_ui.index'))."'&gt; Call the eTemplate version &lt;/a&gt; &lt;br&gt;";</tt> to our <em>old</em> function <em>testinterface</em> just before the creation of the footer, we have a link to start up our new eTemplate.</dd> <dd>modify <em>test/index.php</em>
</dl> <pre>
&lt;?php
<dl> header('Location: ../index.php?menuaction=test.test_ui.index');
<dd>Sure thing, you can call your eTemplate - which is wrapped in a function from your test/index.php:</dd> </pre>
<dd><tt>header('Location: ../index.php?menuaction=test.test_ui.index');</tt></dd> </dd>
</dl> </dl>
</dd> </dd>
</dl> </dl>
&nbsp;
<dl>
<dd>
<dl>
<dt>Step 12</dt>
<dd>If you wanted to have some fancy title for your Application, different from your application name. Set the <strong>app_header</strong> (as I did) within the constructor:</dd>
</dl>
<dl>
<dd><tt>$GLOBALS['egw_info']['flags']['app_header']='My fancy application title';</tt></dd>
</dl>
</dd>
</dl>
<br /> <br />
Now we have our application converted to the eTemplate way of eGroupware. As you can see in the code of the function, I added a few fields to the eTemplate. You can see that I handle data of the <tt>$content[...]</tt> array and assign them to fields that I have not talked about.<br /> Now we have our application converted to the eTemplate way of eGroupware. As you can see in the code of the function, I added a few fields to the eTemplate. You can see that I handle data of the <tt>$content[...]</tt> array and assign them to fields that I have not talked about.<br />
<br /> <br />
The index function is called from our index.php file, from a link out of our old application or as callback for this form / dialog. In that case $content is an array with the content the user put into the fields of the dialog.<br /> The index function is called from our index.php file or as callback for this form / dialog. In that case $content is an array with the content the user put into the fields of the dialog.<br />
&nbsp; &nbsp;
<h4>Let first have a look what happend if we called the first time (or what we do to show the dialog again with the changed data)</h4> <h4>Let first have a look what happend if we called the first time (or what we do to show the dialog again with the changed data)</h4>
&nbsp; &nbsp;