mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 07:53:27 +01:00
Updated CodeCorner3 (markdown)
parent
8d0c5f80b6
commit
fee6ccc1e5
@ -337,8 +337,8 @@ This function is added to the <em>class.test_ui.inc.php</em> file.
|
||||
{
|
||||
$content['message']=print_r($content,true)."\n".'to continue please type a name ...';
|
||||
$content['datetime']=time();
|
||||
$content['test_firstname']='';
|
||||
$content['test_name']='';
|
||||
$readonlys['test_firstname']=$content['test_firstname'];
|
||||
$readonlys['test_name']=$content['test_name'];
|
||||
} elseif ($content['new'])
|
||||
{
|
||||
$content['message']='cleared form !'."\n".'to continue please type a name ...';
|
||||
@ -348,13 +348,11 @@ This function is added to the <em>class.test_ui.inc.php</em> file.
|
||||
}
|
||||
} else {
|
||||
// first call
|
||||
$content=array(
|
||||
'message'=>'... please type a name ...',
|
||||
);
|
||||
}
|
||||
$tpl=new etemplate('test.index');
|
||||
$tpl->setElementAttribute('debuginfo','disabled',!$debug);
|
||||
$tpl->exec('test.test_ui.index',$content);
|
||||
$tpl->setElementAttribute('submit','disabled',$content['submit']);
|
||||
$tpl->exec('test.test_ui.index',$content,array(),$readonlys);
|
||||
// the debug info will be displayed at the very end of the page
|
||||
//_debug_array($content);
|
||||
}
|
||||
@ -426,7 +424,7 @@ The index function is called from our index.php file or as callback for this for
|
||||
|
||||
<ul>
|
||||
<li>the $content array is set up with our internal data-array (which is empty on the first call) and the message</li>
|
||||
<li>$readonlys: if a fieldname is set in $readonlys to True, its content is displayed readonly (for regular fields like type Text) or left out for buttons (we use this later)</li>
|
||||
<li>$readonlys: if a fieldname is set in $readonlys to True, its content is displayed readonly (for regular fields like type Text) or left out for buttons (we use this later, when we hit the submit)</li>
|
||||
<li>at last we call etemplate::exec to show the template with the content from $content and set the function itself as callback for the dialog / form.</li>
|
||||
</ul>
|
||||
|
||||
@ -436,8 +434,8 @@ The index function is called from our index.php file or as callback for this for
|
||||
|
||||
<ul>
|
||||
<li>the callback (this function) is not the submit-address of the form, the form get's always submitted to the function process_exec of the etemplate class. This function changes for some field-types the content (eg. a date-field consists of 3 single fields, process_exec takes care that it is delivered back as timestamp, as we set it in content before). It can even submit the form back to the user. In this case the callback is NOT called. The same is true if an int field contains letters or is not within the minimum or maximum set. <em>For the specialist process_exec uses $_POST and ignores $_GET set as query in the url. </em></li>
|
||||
<li>if <tt>$content['submit']</tt> is set, the [Submit] button has been pressed ('submit' is the name NOT the label of the Submit button).</li>
|
||||
<li>after that the content array is filled again as described above.</li>
|
||||
<li>if <tt>$content['submit']</tt> is set, the [Submit] button has been pressed ('submit' is the name NOT the label of the Submit button). the data is displayed in the message area titled <em>debuginfo</em> and the input is displayed as readonly (if set)</li>
|
||||
<li>after that we disable the submit button</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user