本文整理汇总了PHP中CommonDBTM::showFormButtons方法的典型用法代码示例。如果您正苦于以下问题:PHP CommonDBTM::showFormButtons方法的具体用法?PHP CommonDBTM::showFormButtons怎么用?PHP CommonDBTM::showFormButtons使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommonDBTM
的用法示例。
在下文中一共展示了CommonDBTM::showFormButtons方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showFormButtons
/**
* @since version 0.90
*
* @see CommonDBTM::showFormButtons()
**/
function showFormButtons($options = array())
{
global $CFG_GLPI;
if (isset($_SESSION["glpiactiveprofile"]) && $_SESSION["glpiactiveprofile"]["interface"] != "central") {
return parent::showFormButtons($options);
}
// for single object like config
$ID = 1;
if (isset($this->fields['id'])) {
$ID = $this->fields['id'];
}
$params['colspan'] = 2;
$params['candel'] = true;
$params['canedit'] = true;
if (is_array($options) && count($options)) {
foreach ($options as $key => $val) {
$params[$key] = $val;
}
}
if (!$this->isNewID($ID)) {
echo "<input type='hidden' name='id' value='{$ID}'>";
}
echo "<tr class='tab_bg_2'>";
echo "<td class='center' colspan='" . $params['colspan'] * 2 . "'>";
if ($this->isNewID($ID)) {
echo Ticket::getSplittedSubmitButtonHtml($this->fields['tickets_id'], 'add');
// echo "<input type='hidden' name='id' value='$ID'>";
} else {
if ($params['candel'] && !$this->can($ID, DELETE) && !$this->can($ID, PURGE)) {
$params['candel'] = false;
}
if ($params['canedit'] && $this->can($ID, UPDATE)) {
echo Ticket::getSplittedSubmitButtonHtml($this->fields['tickets_id'], 'update');
echo "</td></tr><tr class='tab_bg_2'>\n";
}
if ($params['candel']) {
echo "<td class='right' colspan='" . $params['colspan'] * 2 . "' >\n";
if ($this->can($ID, PURGE)) {
echo Html::submit(_x('button', 'Delete permanently'), array('name' => 'purge', 'confirm' => __('Confirm the final deletion?')));
}
}
if ($this->isField('date_mod')) {
echo "<input type='hidden' name='_read_date_mod' value='" . $this->getField('date_mod') . "'>";
}
}
echo "</td></tr></table></div>";
Html::closeForm();
}