コード例 #1
0
ファイル: script.php プロジェクト: stpq/icinga_configurator
        $form = new EaseTWBForm('Script', 'script.php', 'POST', $scriptEditor, array('class' => 'form-horizontal'));
        if (!$script->getId()) {
            $form->addItem(new EaseTWSubmitButton(_('Založit'), 'success'));
        } else {
            $form->addItem(new EaseTWSubmitButton(_('Uložit'), 'success'));
        }
        break;
}
$oPage->addItem(new IEPageBottom());
$infopanel = new IEInfoBox($script);
$tools = new EaseTWBPanel(_('Nástroje'), 'warning');
if ($script->getId()) {
    $tools->addItem($script->deleteButton());
    $tools->addItem(new EaseTWBPanel(_('Transfer'), 'warning', $script->transferForm()));
    $command = new IECommand();
    $usages = $command->getColumnsFromMySQL(array($command->getMyKeyColumn(), $command->nameColumn), array('script_id' => $command->getId()), $command->nameColumn, $command->getMyKeyColumn());
    if (count($usages)) {
        $usedBy = new EaseTWBPanel(_('Používající příkazy'));
        $listing = new EaseHtmlUlTag(null, array('class' => 'list-group'));
        foreach ($usages as $usage) {
            if (!isset($usage[$command->nameColumn])) {
                $usage[$command->nameColumn] = 'n/a';
            }
            $listing->addItem(new EaseHtmlLiTag(new EaseHtmlATag('command.php?command_id=' . $usage['command_id'], $usage[$command->nameColumn]), array('class' => 'list-group-item')));
        }
        EaseContainer::addItemCustom($listing, $usedBy);
        $infopanel->addItem($usedBy);
    }
}
$pageRow = new EaseTWBRow();
$pageRow->addColumn(2, $infopanel);
コード例 #2
0
ファイル: command.php プロジェクト: stpq/icinga_configurator
if ($delete == 'true') {
    $command->delete();
}
$oPage->addItem(new IEPageTop(_('Editace příkazu') . ' ' . $command->getName()));
switch ($oPage->getRequestValue('action')) {
    case 'delete':
        $form = new EaseContainer();
        $form->addItem(new EaseHtmlH2Tag($command->getName()));
        $confirmator = $form->addItem(new EaseTWBPanel(_('Opravdu smazat ?')), 'danger');
        $confirmator->addItem(new EaseTWBLinkButton('?' . $command->myKeyColumn . '=' . $command->getID(), _('Ne') . ' ' . EaseTWBPart::glyphIcon('ok'), 'success'));
        $confirmator->addItem(new EaseTWBLinkButton('?delete=true&' . $command->myKeyColumn . '=' . $command->getID(), _('Ano') . ' ' . EaseTWBPart::glyphIcon('remove'), 'danger'));
        break;
    default:
        $commandEditor = new IECfgEditor($command);
        $form = new EaseTWBForm('Command', 'command.php', 'POST', $commandEditor, array('class' => 'form-horizontal'));
        if (!$command->getId()) {
            $form->addItem(new EaseTWSubmitButton(_('Založit'), 'success'));
        } else {
            $form->addItem(new EaseTWSubmitButton(_('Uložit'), 'success'));
        }
        break;
}
$oPage->addItem(new IEPageBottom());
$infopanel = new IEInfoBox($command);
$tools = new EaseTWBPanel(_('Nástroje'), 'warning');
if ($command->getId()) {
    $tools->addItem($command->deleteButton());
    $tools->addItem(new EaseTWBPanel(_('Transfer'), 'warning', $command->transferForm()));
    $service = new IEService();
    $usages = $service->getColumnsFromMySQL(array($service->getMyKeyColumn(), $service->nameColumn), array('check_command' => $command->getName()), $service->nameColumn, $service->getMyKeyColumn());
    if (count($usages)) {