[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: etemplate/inc class.uietemplate.inc.php, 1.62.2.
From: |
Ralf Becker <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: etemplate/inc class.uietemplate.inc.php, 1.62.2.2, 1.62.2.3 |
Date: |
Fri, 22 Aug 2003 08:51:12 -0400 |
Update of /cvsroot/phpgroupware/etemplate/inc
In directory subversions:/tmp/cvs-serv15451
Modified Files:
Tag: Version-0_9_16-branch
class.uietemplate.inc.php
Log Message:
several fixes and improvments:
- sub-arrays/namespaces in the readonlys param of exec are working now
- callback methode is passed in menuaction var now, to be shown in the
accesslog (and not etemplate/process_exec.php), etemplate_exe_app is not longer
used (was a hidden var in the form)
- replaced HTTP_{GET|POST}_VARS
- got hooked calls working again (only if calling app sets its content in var
'phpgw_body' in $GLOBALS['phpgw']->template !!!)
- redirect to the callback method if session-content got lost
- select-cells: value given in options is only translated if no_trans is
checked (else it gets translated twice
Index: class.uietemplate.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.uietemplate.inc.php,v
retrieving revision 1.62.2.2
retrieving revision 1.62.2.3
diff -C2 -r1.62.2.2 -r1.62.2.3
*** class.uietemplate.inc.php 20 Aug 2003 00:35:24 -0000 1.62.2.2
--- class.uietemplate.inc.php 22 Aug 2003 12:51:10 -0000 1.62.2.3
***************
*** 78,83 ****
@discussion Generates a webpage with a form from the template
and puts process_exec in the
@discussion form as submit-url to call process_show for the
template before it
! @discussion ExecuteMethod's the given $methode of the caller.
! @param $methode Methode (e.g. 'etemplate.editor.edit') to be
called if form is submitted
@param $content Array with content to fill the input-fields of
template, eg. the text-field
@param with name 'name' gets its content from
$content['name']
--- 78,83 ----
@discussion Generates a webpage with a form from the template
and puts process_exec in the
@discussion form as submit-url to call process_show for the
template before it
! @discussion ExecuteMethod's the given $method of the caller.
! @param $method Methode (e.g. 'etemplate.editor.edit') to be
called if form is submitted
@param $content Array with content to fill the input-fields of
template, eg. the text-field
@param with name 'name' gets its content from
$content['name']
***************
*** 87,92 ****
@param $readonlys Array with field-names as keys for fields
with should be readonly
@param (eg. to implement ACL grants on field-level
or to remove buttons not applicable)
! @param $preserv Array with vars which should be transported to
the $method-call (eg. an id) array('id' => $id)
! sets $HTTP_POST_VARS['id'] for the $method-call
@param $return_html if true, dont show the page, just return
the html
@result nothing
--- 87,92 ----
@param $readonlys Array with field-names as keys for fields
with should be readonly
@param (eg. to implement ACL grants on field-level
or to remove buttons not applicable)
! @param $preserv Array with vars which should be transported to
the $method-call (eg. an id) array('id' => $id)
! sets $_POST['id'] for the $method-call
@param $return_html if true, dont show the page, just return
the html
@result nothing
***************
*** 126,132 ****
$this->html->form($this->include_java_script(1).
$this->show($this->complete_array_merge($content,$changes),$sel_options,$readonlys,'exec'),array(
! 'etemplate_exec_id' => $id,
! 'etemplate_exec_app' =>
$GLOBALS['phpgw_info']['flags']['currentapp']
!
),'/etemplate/process_exec.php','','eTemplate',$GLOBALS['phpgw_info']['etemplate']['form_options']);
//_debug_array($GLOBALS['phpgw_info']['etemplate']['to_process']);
if ($this->stable)
--- 126,131 ----
$this->html->form($this->include_java_script(1).
$this->show($this->complete_array_merge($content,$changes),$sel_options,$readonlys,'exec'),array(
! 'etemplate_exec_id' => $id
!
),'/etemplate/process_exec.php?menuaction='.$method,'','eTemplate',$GLOBALS['phpgw_info']['etemplate']['form_options']);
//_debug_array($GLOBALS['phpgw_info']['etemplate']['to_process']);
if ($this->stable)
***************
*** 164,169 ****
'java_script' =>
$GLOBALS['phpgw_info']['etemplate']['java_script'],
'dom_enabled' =>
$GLOBALS['phpgw_info']['etemplate']['dom_enabled'],
! 'method' => $method,
! 'hooked' => $hooked
),$id);
--- 163,167 ----
'java_script' =>
$GLOBALS['phpgw_info']['etemplate']['java_script'],
'dom_enabled' =>
$GLOBALS['phpgw_info']['etemplate']['dom_enabled'],
! 'hooked' => $hooked != '' ? $hooked :
$GLOBALS['phpgw_info']['etemplate']['hook_content']
),$id);
***************
*** 178,182 ****
echo parse_navbar();
}
! echo $html;
if
(address@hidden'phpgw_info']['etemplate']['hooked'] &&
!isset($_GET['menuaction']))
--- 176,180 ----
echo parse_navbar();
}
! echo
$GLOBALS['phpgw_info']['etemplate']['hook_content'].$html;
if
(address@hidden'phpgw_info']['etemplate']['hooked'] &&
!isset($_GET['menuaction']))
***************
*** 193,210 ****
/*!
@function process_exec
! @abstract Makes the necessary adjustments to HTTP_POST_VARS
before it calls the app's method
@discussion This function is only to submit forms to, create
with exec.
@discussion All eTemplates / forms executed with exec are
submited to this function
@discussion (via the global index.php and menuaction). It then
calls process_show
! @discussion for the eTemplate (to adjust the content of the
HTTP_POST_VARS) and
@discussion ExecMethod's the given callback from the app with
the content of the form as first argument.
*/
function process_exec()
{
! //echo "process_exec: HTTP_POST_VARS =";
_debug_array($GLOBALS['HTTP_POST_VARS']);
! $session_data =
$this->get_appsession($GLOBALS['HTTP_POST_VARS']['etemplate_exec_id']);
//echo "<p>process_exec: session_data =";
_debug_array($session_data);
! $content = $GLOBALS['HTTP_POST_VARS']['exec'];
if (!is_array($content))
{
--- 191,213 ----
/*!
@function process_exec
! @abstract Makes the necessary adjustments to _POST before it
calls the app's method
@discussion This function is only to submit forms to, create
with exec.
@discussion All eTemplates / forms executed with exec are
submited to this function
@discussion (via the global index.php and menuaction). It then
calls process_show
! @discussion for the eTemplate (to adjust the content of the
_POST) and
@discussion ExecMethod's the given callback from the app with
the content of the form as first argument.
*/
function process_exec()
{
! //echo "process_exec: _POST ="; _debug_array($_POST);
! $session_data =
$this->get_appsession($_POST['etemplate_exec_id']);
//echo "<p>process_exec: session_data =";
_debug_array($session_data);
! if (!$_POST['etemplate_exec_id'] ||
!is_array($session_data) || count($session_data) < 10)
! {
! // this prevents an empty screen, if the
sessiondata gets lost somehow
! $this->location(array('menuaction' =>
$_GET['menuaction']));
! }
! $content = $_POST['exec'];
if (!is_array($content))
{
***************
*** 213,219 ****
$this->init($session_data);
$GLOBALS['phpgw_info']['etemplate']['extension_data'] =
$session_data['extension_data'];
! $GLOBALS['phpgw_info']['etemplate']['java_script'] =
$session_data['java_script'] || $GLOBALS['HTTP_POST_VARS']['java_script'];
! $GLOBALS['phpgw_info']['etemplate']['dom_enabled'] =
$session_data['dom_enabled'] || $GLOBALS['HTTP_POST_VARS']['dom_enabled'];
! //echo "globals[java_script] =
'".$GLOBALS['phpgw_info']['etemplate']['java_script']."',
session_data[java_script] = '".$session_data['java_script']."',
HTTP_POST_VARS[java_script] =
'".$GLOBALS['HTTP_POST_VARS']['java_script']."'\n";
//echo "process_exec($this->name) content =";
_debug_array($content);
$this->process_show($content,$session_data['to_process'],'exec');
--- 216,222 ----
$this->init($session_data);
$GLOBALS['phpgw_info']['etemplate']['extension_data'] =
$session_data['extension_data'];
! $GLOBALS['phpgw_info']['etemplate']['java_script'] =
$session_data['java_script'] || $_POST['java_script'];
! $GLOBALS['phpgw_info']['etemplate']['dom_enabled'] =
$session_data['dom_enabled'] || $_POST['dom_enabled'];
! //echo "globals[java_script] =
'".$GLOBALS['phpgw_info']['etemplate']['java_script']."',
session_data[java_script] = '".$session_data['java_script']."',
_POST[java_script] = '".$_POST['java_script']."'\n";
//echo "process_exec($this->name) content =";
_debug_array($content);
$this->process_show($content,$session_data['to_process'],'exec');
***************
*** 230,234 ****
if ($this->stable)
{
!
$GLOBALS['phpgw']->template->set_var('phpgw_body',$session_data['hooked']);
}
else
--- 233,238 ----
if ($this->stable)
{
! //echo "<p>process_exec:
hook_content set</p>\n";
!
$GLOBALS['phpgw_info']['etemplate']['hook_content'] = $session_data['hooked'];
}
else
***************
*** 238,247 ****
}
//echo "<p>process_exec($this->name): <font
color=red>loop is set</font>, content=</p>\n"; _debug_array($content);
!
$this->exec($session_data['method'],$session_data['content'],$session_data['sel_options'],
$session_data['readonlys'],$session_data['preserv'],$content);
}
else
{
!
ExecMethod($session_data['method'],$this->complete_array_merge($session_data['preserv'],$content));
}
}
--- 242,251 ----
}
//echo "<p>process_exec($this->name): <font
color=red>loop is set</font>, content=</p>\n"; _debug_array($content);
!
$this->exec($_GET['menuaction'],$session_data['content'],$session_data['sel_options'],
$session_data['readonlys'],$session_data['preserv'],$content);
}
else
{
!
ExecMethod($_GET['menuaction'],$this->complete_array_merge($session_data['preserv'],$content));
}
}
***************
*** 282,287 ****
@param $readonlys array with names of cells/form-elements to be
not allowed to change
@param This is to facilitate complex ACL's which
denies access on field-level !!!
! @param $cname basename of names for form-elements, means index
in $HTTP_POST_VARS
! @param eg. $cname='cont', element-name = 'name' returned
content in $HTTP_POST_VARS['cont']['name']
@param $show_xxx row,col name/index for name expansion
@result the generated HTML
--- 286,291 ----
@param $readonlys array with names of cells/form-elements to be
not allowed to change
@param This is to facilitate complex ACL's which
denies access on field-level !!!
! @param $cname basename of names for form-elements, means index
in $_POST
! @param eg. $cname='cont', element-name = 'name' returned
content in $_POST['cont']['name']
@param $show_xxx row,col name/index for name expansion
@result the generated HTML
***************
*** 486,490 ****
$value = $this->get_array($content,$name);
! if ($readonly = $cell['readonly'] || @$readonlys[$name]
|| $readonlys['__ALL__'])
{
$options .= ' READONLY';
--- 490,494 ----
$value = $this->get_array($content,$name);
! if ($readonly = $cell['readonly'] ||
(@$readonlys[$name] && !is_array($readonlys[$name])) || $readonlys['__ALL__'])
{
$options .= ' READONLY';
***************
*** 737,741 ****
if (!empty($multiple) && 0+$multiple <=
0)
{
! $sels[''] = $multiple < 0 ?
lang('all') : lang($multiple);
$multiple = 0;
}
--- 741,749 ----
if (!empty($multiple) && 0+$multiple <=
0)
{
! $sels[''] = $multiple < 0 ?
'all' : $multiple;
! if ($cell['no_lang'])
! {
! $sels[''] =
lang($sels['']);
! }
$multiple = 0;
}
***************
*** 934,942 ****
/*!
@function process_show
! @abstract makes necessary adjustments on HTTP_POST_VARS after a
eTemplate / form gots submitted
@discussion This is only an internal function, dont call it
direct use only exec
@discussion Process_show uses a list of input-fields/widgets
generated by show.
@syntax process_show(&$content,$to_process,$cname='')
! @param $content HTTP_POST_VARS[$cname]
@param $to_process list of widgets/form-fields to process
@param $cname basename of our returnt content (same as in call
to show)
--- 942,950 ----
/*!
@function process_show
! @abstract makes necessary adjustments on _POST after a
eTemplate / form gots submitted
@discussion This is only an internal function, dont call it
direct use only exec
@discussion Process_show uses a list of input-fields/widgets
generated by show.
@syntax process_show(&$content,$to_process,$cname='')
! @param $content _POST[$cname]
@param $to_process list of widgets/form-fields to process
@param $cname basename of our returnt content (same as in call
to show)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: etemplate/inc class.uietemplate.inc.php, 1.62.2.2, 1.62.2.3,
Ralf Becker <address@hidden> <=