mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-25 01:13:25 +01:00
Updated CodeCorner3 (markdown)
parent
ac03c24d01
commit
a8d6aa6f9d
@ -366,6 +366,7 @@ This function is added to the <em>class.test_ui.inc.php</em> file.
|
||||
<dl>
|
||||
<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>We do not need the function testinterface anymore</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</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%;" />
|
||||
<pre>
|
||||
var $public_functions = array(
|
||||
'testinterface' => True,
|
||||
'index' => True,
|
||||
);
|
||||
</pre>
|
||||
@ -390,21 +390,15 @@ var $public_functions = array(
|
||||
|
||||
<hr style="text-align: left; width: 99%;" />
|
||||
<pre>
|
||||
// construktor
|
||||
function test_ui()
|
||||
{
|
||||
$GLOBALS['egw_info']['flags']['app_header']='test-Application';
|
||||
|
||||
$this->tmpl =& CreateObject('etemplate.etemplate', 'test.index');
|
||||
$this->bo =& CreateObject('test.botest');
|
||||
$this->html =& $GLOBALS['egw']->html;
|
||||
|
||||
if(!@is_object($GLOBALS['egw']->js))
|
||||
{
|
||||
$GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript');
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
// you may set a fancy app-title.different from title set in setup.inc.php: $setup_info['test']['title']
|
||||
$GLOBALS['egw_info']['flags']['app_header']='test-Application';
|
||||
}
|
||||
</pre>
|
||||
|
||||
<hr style="text-align: left; width: 99%;" />
|
||||
@ -412,33 +406,20 @@ var $public_functions = array(
|
||||
<dd>
|
||||
<dl>
|
||||
<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>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dd>Sure thing, you can call your eTemplate - which is wrapped in a function from your test/index.php:</dd>
|
||||
<dd><tt>header('Location: ../index.php?menuaction=test.test_ui.index');</tt></dd>
|
||||
<dd>modify <em>test/index.php</em>
|
||||
<pre>
|
||||
<?php
|
||||
header('Location: ../index.php?menuaction=test.test_ui.index');
|
||||
</pre>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</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 />
|
||||
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 />
|
||||
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>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user