get_session();
$request = http_request::getInstance();
$parm = $request->get_parms("srt", "ord",
"act",
"p0", // base_id
"bit",
"nam", // name
"searchable", // name
"printable", // name
"dic0", // ccoch delete icon 0
"dic1", // ccoch delete icon 1
"labelon", // ccoch delete icon 1
"labeloff" // ccoch delete icon 1
);
if (is_null($parm['p0']))
phrasea::headers(400);
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
if (!$user->ACL()->has_right_on_sbas($parm['p0'], 'bas_modify_struct'))
{
phrasea::headers(403);
}
$sbas_id = (int)$parm['p0'];
$databox = databox::get_instance($sbas_id);
phrasea::headers();
?>
$searchable,
'printable' => $printable,
'name' => $parm["nam"],
'labelon' => $parm["labelon"],
'labeloff' => $parm["labeloff"]
);
databox_status::updateStatus($parm['p0'], $parm["bit"], $properties);
if ($parm["dic0"])
{
databox_status::deleteIcon($parm['p0'], $parm['bit'], 'off');
}
if (isset($_FILES['ic0']) && $_FILES['ic0']['name'])
{
try
{
databox_status::updateIcon($parm['p0'], $parm['bit'], 'off', $_FILES['ic0']);
}
catch(Exception_Forbidden $e)
{
$errors[] = _('You do not enough rights to update status');
}
catch(Exception_InvalidArgument $e)
{
$errors[] = _('Something wrong happend');
}
catch(Exception_Upload_FileTooBig $e)
{
$errors[] = _('File is too big : 64k max');
}
catch(Exception_Upload_Error $e)
{
$errors[] = _('Status icon upload failed : upload error');
}
catch(Exception_Upload_CannotWriteFile $e)
{
$errors[] = _('Status icon upload failed : can not write on disk');
}
catch(Exception $e)
{
$errors[] = _('An error occured');
}
}
if ($parm["dic1"])
{
databox_status::deleteIcon($parm['p0'], $parm['bit'], 'on');
}
if (isset($_FILES['ic1']) && $_FILES['ic1']['name'])
{
try
{
databox_status::updateIcon($parm['p0'], $parm['bit'], 'on', $_FILES['ic1']);
}
catch(Exception_Forbidden $e)
{
$errors[] = _('You do not enough rights to update status');
}
catch(Exception_InvalidArgument $e)
{
$errors[] = _('Something wrong happend');
}
catch(Exception_Upload_FileTooBig $e)
{
$errors[] = _('File is too big : 64k max');
}
catch(Exception_Upload_Error $e)
{
$errors[] = _('Status icon upload failed : upload error');
}
catch(Exception_Upload_CannotWriteFile $e)
{
$errors[] = _('Status icon upload failed : can not write on disk');
}
catch(Exception $e)
{
$errors[] = _('An error occured');
}
}
}
if ($parm["act"] == "ADD" || $parm["act"] == "EDIT")
{
$status = $databox->get_statusbits();
$status = isset($status[$parm['bit']]) ? $status[$parm['bit']] : array('name' => '', 'labelon' => '', 'labeloff' => '', 'img_on' => '', 'img_off' => '', 'searchable' => '0', 'printable' => '0')
?>
".$error."";
}
$status = $databox->get_statusbits();
?>