mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-26 08:39:07 +01:00
Api - automatically find labels for int or floats too
This commit is contained in:
parent
48157ac809
commit
e7b06de719
@ -1344,6 +1344,18 @@ abstract class admin_cmd
|
||||
}
|
||||
}
|
||||
}
|
||||
if (preg_match_all('/<(int|float).*(label|id)="([^"]+)".*(label|id)="([^"]+)"/', $tpl, $matches, PREG_PATTERN_ORDER))
|
||||
{
|
||||
foreach($matches[2] as $key => $name)
|
||||
{
|
||||
$id = $name === 'id' ? $matches[3][$key] : $matches[5][$key];
|
||||
$label= $name === 'id' ? $matches[5][$key] : $matches[3][$key];
|
||||
if (!empty($id) && !empty($label))
|
||||
{
|
||||
$labels[$id] = $label;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
error_log(__METHOD__."($name) path=$path returning ".json_encode($labels));
|
||||
return $labels;
|
||||
|
@ -58,6 +58,13 @@ class admin_cmd_account_app extends admin_cmd
|
||||
|
||||
$apps = admin_cmd::parse_apps($this->apps);
|
||||
|
||||
$old_rights = (array)$GLOBALS['egw']->acl->get_app_list_for_id('run', Egroupware\Api\Acl::READ, $account_id);
|
||||
$new_rights = $this->allow ?
|
||||
$old_rights + array($apps) :
|
||||
array_diff($old_rights, $apps);
|
||||
|
||||
$this->set = $new_rights;
|
||||
$this->old = $old_rights;
|
||||
if ($check_only) return true;
|
||||
|
||||
//echo "account=$this->account, account_id=$account_id, apps: ".implode(', ',$apps)."\n";
|
||||
|
Loading…
Reference in New Issue
Block a user