/** Add a button for each multi value property except those in whose names
* are in ::getExcludedMultiValuePropButtonKeys.
* Each button will hold a javascript from ::getMultiValuePropertyButtonScript,
* whose default implementation is to retrieve an (MtoN)PropertyPage for the property.
* @param array $buttons to add the butons to.
*/
function (&$buttons) {
$excludedPropKeys = $this->();
$obj = $this->();
$ghost = !$obj || !$obj->('id');
$sm = $this->controller->();
$formTexts = $this->();
$clsDes = PntClassDescriptor::getInstance($this->());
$multiProps = $clsDes->();
forEach(array_keys($multiProps) as $key)
if (!isSet($excludedPropKeys[$key]) && $multiProps[$key]->() ) {
$edit = isSet($formTexts[$key]);
if ($edit) $edit = !$sm->($obj, $multiProps[$key]);
if (!$sm->($obj, $multiProps[$key]))
$buttons[]=$this->(
ucfirst($multiProps[$key]->()),
$this->($key, $edit),
$ghost
);
}
}
|