Exemplo n.º 1
0
            $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);
$pageRow->addColumn(6, new EaseTWBPanel(_('Skript') . ' <strong>' . $script->getName() . '</strong>', 'default', $form));
$pageRow->addColumn(4, $tools);
$oPage->container->addItem($pageRow);
$oPage->draw();
Exemplo n.º 2
0
 * @copyright  2012 Vitex@hippy.cz (G)
 */
require_once 'includes/IEInit.php';
require_once 'classes/IESearcher.php';
$oPage->onlyForLogged();
$query = $oPage->getRequestValue('search', 'string');
$found = array();
$searcher = new IESearcher($oPage->getRequestValue('table', 'string'), $oPage->getRequestValue('column', 'string'));
if (strlen($query) < 2) {
    $oPage->addStatusMessage(_('Vyheldávaný řetězec je příliš krátký'), 'warning');
} else {
    $results = $searcher->searchAll(EaseShared::db()->EaseAddslashes($query));
    foreach ($results as $rectype => $records) {
        foreach ($records as $recid => $record) {
            $found[] = array('url' => $rectype . '.php?' . $rectype . '_id=' . $recid, 'name' => current($record), 'type' => $rectype, 'what' => $record['what']);
        }
    }
    if (count($found) == 1) {
        $oPage->addStatusMessage(_('Nalezen pouze jeden výsledek', 'success'));
        header('Location: ' . $found[0]['url'] . '&search=' . $query);
        exit;
    }
}
$oPage->addItem(new IEPageTop(_('Výsledky hledání')));
$listing = new EaseHtmlUlTag(null, array('class' => 'list-group'));
foreach ($found as $foundItem) {
    $listing->addItem(new EaseHtmlLiTag(new EaseHtmlATag($foundItem['url'], $foundItem['type'] . '&nbsp;<h4>' . $foundItem['name'] . '</h4>&nbsp;' . str_replace($query, '<strong>' . $query . '</strong>', $foundItem['what'])), array('class' => 'list-group-item')));
}
$oPage->addItem(new EaseTWBContainer($listing));
$oPage->addItem(new IEPageBottom());
$oPage->draw();