need to compare short names, as long name generated by prefixing with template-name is not found, because different template name

This commit is contained in:
Ralf Becker 2013-10-25 11:38:50 +00:00
parent 3c5c33dba8
commit d687a30e6f

View File

@ -72,21 +72,17 @@
$cell['name'] = $cell_name;
}
$names = explode('|',$tab_names);
$short_names = array();
foreach($names as $name)
{
$nparts = explode('.', $name);
$short_names[] = array_pop($nparts);
}
// disable tab mentioned in readonlys
foreach(is_array($readonlys) ? $readonlys : array($readonlys => true) as $name => $disable)
{
// 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))
($key = array_search($name, $short_names) !== false)))
{
unset($names[$key]);
$names = array_values($names);