mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-08-08 07:55:01 +02:00
Updated CodeCorner3 (markdown)
@ -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%;" />
|
<hr style="text-align: left; width: 99%;" />
|
||||||
<pre>
|
<pre>
|
||||||
var $public_functions = array(
|
var $public_functions = array(
|
||||||
'testinterface' => True,
|
|
||||||
'index' => True,
|
'index' => True,
|
||||||
);
|
);
|
||||||
</pre>
|
</pre>
|
||||||
@ -390,21 +390,15 @@ var $public_functions = array(
|
|||||||
|
|
||||||
<hr style="text-align: left; width: 99%;" />
|
<hr style="text-align: left; width: 99%;" />
|
||||||
<pre>
|
<pre>
|
||||||
// construktor
|
/**
|
||||||
function test_ui()
|
* Constructor
|
||||||
{
|
*
|
||||||
$GLOBALS['egw_info']['flags']['app_header']='test-Application';
|
*/
|
||||||
|
function __construct()
|
||||||
$this->tmpl =& CreateObject('etemplate.etemplate', 'test.index');
|
{
|
||||||
$this->bo =& CreateObject('test.botest');
|
// you may set a fancy app-title.different from title set in setup.inc.php: $setup_info['test']['title']
|
||||||
$this->html =& $GLOBALS['egw']->html;
|
$GLOBALS['egw_info']['flags']['app_header']='test-Application';
|
||||||
|
}
|
||||||
if(!@is_object($GLOBALS['egw']->js))
|
|
||||||
{
|
|
||||||
$GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript');
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<hr style="text-align: left; width: 99%;" />
|
<hr style="text-align: left; width: 99%;" />
|
||||||
@ -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 "<a href='".$GLOBALS['egw']->link('/index.php',array('menuaction' => 'test.test_ui.index'))."'> Call the eTemplate version </a> <br>";</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>
|
||||||
|
<?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>
|
||||||
|
|
||||||
|
|
||||||
<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 />
|
||||||
|
|
||||||
<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>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user