mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 00:54:50 +01:00
disable tabs independent of using short or full name, eg. $readonlys["tabs"]["test"] = true works as well as $readonlys["tabs"]["app.something.test"] = true
This commit is contained in:
parent
ae04210b66
commit
f62028444d
@ -60,7 +60,7 @@
|
||||
* @param array &$cell array with the widget, can be modified for ui-independent widgets
|
||||
* @param array &$readonlys names of widgets as key, to be made readonly
|
||||
* @param mixed &$extension_data data the extension can store persisten between pre- and post-process
|
||||
* @param object &$tmpl reference to the template we belong too
|
||||
* @param etemplate &$tmpl reference to the template we belong too
|
||||
* @return boolean true if extra label is allowed, false otherwise
|
||||
*/
|
||||
function pre_process($form_name,&$value,&$cell,&$readonlys,&$extension_data,&$tmpl)
|
||||
@ -98,7 +98,18 @@
|
||||
// disable tab mentioned in readonlys
|
||||
foreach(is_array($readonlys) ? $readonlys : array($readonlys => true) as $name => $disable)
|
||||
{
|
||||
if($name && $disable && ($key = array_search($name,$names)) !== false)
|
||||
// check full name AND last component name
|
||||
if (strpos($name, '.') === false)
|
||||
{
|
||||
$name2 = $tmpl->name.'.'.$name;
|
||||
}
|
||||
else
|
||||
{
|
||||
$nparts = explode('.', $name);
|
||||
$name2 = array_pop($nparts);
|
||||
}
|
||||
if ($name && $disable && (($key = array_search($name, $names)) !== false ||
|
||||
($key = array_search($name2, $names)) !== false))
|
||||
{
|
||||
unset($names[$key]);
|
||||
$names = array_values($names);
|
||||
|
Loading…
Reference in New Issue
Block a user