/** * show the data in an input element for editing * * @return string */ protected function getWriteDisplay() { $selectedOptionNames = explode(', ', $this->value); $output = Html::startTag('div', ['class' => $this->class]); $connectedClassName = $this->fieldinfo->getConnectedClass(); /** @var BaseConnectionObject $connObj */ $connObj = new $connectedClassName(); $class = $connObj->getOtherClass($this->fieldinfo->getClass()); $obj = Factory::createObject($class); $connectedFieldName = $this->fieldinfo->getFieldsOfConnectedClass(); $table = DB::table($obj->getTable()); $result = Finder::create($class)->find([$table->getColumn($connectedFieldName), $table->getColumn('LK')]); foreach ($result as $row) { $params = []; $params['value'] = $row['LK']; $params['type'] = 'checkbox'; $params['class'] = 'checkbox'; $params['name'] = $this->name . '[]'; if (in_array($row[$connectedFieldName], $selectedOptionNames)) { $params['checked'] = 'checked'; } $output .= Html::startTag('p') . Html::singleTag('input', $params) . " " . $row[$connectedFieldName] . Html::endTag('p'); } $output .= Html::endTag('div'); return $output; }
public function display(OutputDevice $od) { $od->addContent(Html::startTag('div', ['class' => 'leftNavigation'])); foreach ($this->getNaviStructure() as $category => $entries) { $od->addContent(Html::startTag('h3') . $category . Html::endTag('h3')); $od->addContent(Html::startTag('div')); $od->addContent(Html::startTag('ul')); foreach ($entries as $entryName => $url) { $od->addContent(Html::startTag('li') . Html::url(HTML_ROOT . "/de/acp/$url", $entryName) . Html::endTag('li')); } $od->addContent(Html::endTag('ul')); $od->addContent(Html::endTag('div')); } // $od->addContent(Html::startTag('div', ['id' => 'leftNavigation'])); // $od->addContent(Html::startTag('ul', ['id' => 'leftNavigation'])); // foreach ($this->getNaviStructure() as $category => $content) { // if (is_string($content)) { // $od->addContent(Html::startTag('li') . Html::url(HTML_ROOT . "/de/acp/$content", $category) . Html::endTag('li')); // continue; // } // $od->addContent(Html::startTag('li') . $category); // $od->addContent(Html::startTag('ul')); // foreach ($content as $name => $url) { // $od->addContent(Html::startTag('li') . Html::url(HTML_ROOT . "/de/acp/$url", $name) . Html::endTag('li')); // } // $od->addContent(Html::endTag('ul')); // $od->addContent(Html::endTag('li')); // } // $od->addContent(Html::endTag('ul')); // $od->addContent('<br style="clear:both" />'); $od->addContent(Html::endTag('div')); }
/** * display the header div * * @param OutputDevice $od */ public function display(OutputDevice $od) { $od->addContent(Html::startTag('body')); $od->addContent(Html::startTag('div', array('class' => 'pageStructure')) . "\n"); $od->addContent(Html::startTag('div', array('class' => $this->getCssClass())) . "\n"); $od->addContent($this->getContent()); $od->addContent(Html::endTag('div')); }
/** * display the footer section of the page * * @param OutputDevice $od */ public function display(OutputDevice $od) { $od->addContent(Html::startTag('div', ['style' => 'clear:both']) . Html::endTag('div')); $od->addContent(Html::startTag('div', array('class' => $this->getCssClass()))); $od->addContent($this->getContent()); $od->addContent(Html::endTag('div')); $od->addContent(Html::endTag('div')); $od->addContent(Html::endTag('body')); }
/** * Renders the widget. */ public function run() { // @todo use [[options]] instead of [[containerOptions]] and introduce [[buttonOptions]] before 2.1 release Html::addCssClass($this->containerOptions, ['widget' => 'btn-group']); $options = $this->containerOptions; $tag = ArrayHelper::remove($options, 'tag', 'div'); $this->registerPlugin('button'); return implode("\n", [Html::beginTag($tag, $options), $this->renderButton(), $this->renderDropdown(), Html::endTag($tag)]); }
function exception_handler(Exception $exception) { $div = Html::startTag('div', array('id' => 'exceptionBox')); $div .= Html::startTag('p', array('class' => 'h3')) . TMS(BaseException::HEADLINE) . Html::endTag('p'); $div .= Html::startTag('hr'); $div .= $exception->getMessage(); $div .= Html::endTag('div'); print($div); if ($exception instanceof BaseException) { $exception->debugOut(); } }
/** * create a string for output with all header information * * @param OutputDevice $od */ public function display(OutputDevice $od) { $header = $this->getDoctypeTag() . "\n"; $header .= $this->getHtmlTag() . "\n"; $header .= Html::startTag('head') . "\n"; $header .= "\t" . $this->getEncodingTag() . "\n"; $header .= "\t" . $this->getTitleTag() . "\n"; $header .= "\t" . $this->getDescriptionTag() . "\n"; $header .= "\t" . $this->getCSSLink(); $header .= "\t" . $this->getScripts(); $header .= Html::endTag('head') . "\n"; $od->addContent($header); }
/** * @param $content * @return string */ private function _shortenContent($content) { $contentParts = str_split($content, 400); $contentShow = $contentParts[0] . Html::startTag('span', ['class' => 'show']) . '... ' . Html::url('#', 'mehr', ['class' => 'show']) . Html::endTag('span'); $contentHide = Html::startTag('span', ['class' => 'hide']) . $contentParts[1] . Html::endTag('span'); $content = $contentShow . $contentHide; return $content; }
protected function getWriteDisplay() { $fi = $this->fieldinfo; $class = $fi->getConnectedClass(); $connectedField = $fi->getFieldsOfConnectedClass(); $objs = Finder::create($class)->find(); $output = Html::startTag('select', array('class' => $this->class, 'name' => $this->name)); foreach ($objs as $obj) { $params = []; $actualFieldValue = $obj[$connectedField]; if ($this->value == $actualFieldValue) { $params['selected'] = 'selected'; } $params['value'] = $obj->getLogicalKey(); $output .= Html::startTag('option', $params) . $actualFieldValue . Html::endTag('option'); } $output .= Html::endTag('select'); return $output; }
/** * show the data in n input element for editing * * @return string */ protected function getWriteDisplay() { $params['name'] = $this->getName(); if (!empty($this->id)) { $params['id'] = $this->id; } if (!empty($this->class)) { $params['class'] = $this->class; } $params['cols'] = $this->cols; $params['rows'] = $this->rows; $textArea = Html::startTag('textarea', $params); if (!empty($this->value)) { $textArea .= $this->getValue(); } $textArea .= Html::endTag('textarea'); return $textArea; }
private function _setFilterOptions() { $form = new base_html_model_Form(); $output = $form->start('#', 'post', array('id' => 'tableOperations')); $output .= Html::startTag('div', array('class' => 'tableOperations')); $output .= Html::startTag('div', array('id' => 'sort')); $output .= 'Sortieren nach: '; $output .= "<select name='sort' onChange='this.form.submit()'>"; foreach ($this->showColumns as $colName => $colLabel) { if ($colName == $this->controller->getFilterParam('sort')) { $output .= "<option value='$colName' selected>$colLabel</option>"; } else { $output .= "<option value='$colName'>$colLabel</option>"; } } $output .= '</select>'; $output .= "<select name='direction' onChange='$(\"#tableOperations\").submit()'>"; $output .= "<option value='" . base_database_Order::ASC . "'>aufsteigend</option>"; $output .= "<option value='" . base_database_Order::DESC ."'"; if ($this->controller->getFilterParam('direction') == base_database_Order::DESC) { $output .= ' selected'; } $output .= ">absteigend</option>"; $output .= "</select>"; $output .= Html::endTag('div'); $output .= Html::startTag('div', array('class' => 'numberOfData')); $output .= 'Einträge '; $output .= "<select name='limit' onChange='this.form.submit()'>"; $limit = $this->controller->getFilterParam('limit'); foreach (array(10, 25, 50, 100) as $number) { if ($number == $limit) { $output .= "<option value=$number selected='selected'>$number</option>"; } else { $output .= "<option value=$number>$number</option>"; } } $output .= "</select> "; $numPages = ceil($this->controller->countData() / $limit); $output .= "Seite: " . Html::singleTag('input', array('name' => 'page', 'id' => 'pager', 'size' => 1, 'value' => $this->controller->getFilterParam('page'))) . " / " . Html::startTag('span', array('id' => 'numPages')) . $numPages . Html::endTag('span'); $output .= Html::endTag('div'); $output .= Html::endTag('div'); return $output; }
private function _displayEntry(NavigationEntry $entry) { $string = Html::startTag('li', array('class' => 'naviEntry', 'id' => "entryLK_{$entry->getLogicalKey()}")); $string .= Html::url(HTML_ROOT . $entry['url'], $entry['name']); $string .= Html::endTag('li'); return $string; }
/** * @param string|null $label the label or null to use model label * @param array $options the tag options */ protected function renderLabelParts($label = null, $options = []) { $options = array_merge($this->labelOptions, $options); if ($label === null) { if (isset($options['label'])) { $label = $options['label']; unset($options['label']); } else { $attribute = Html::getAttributeName($this->attribute); $label = Html::encode($this->model->getAttributeLabel($attribute)); } } if (!isset($options['for'])) { $options['for'] = Html::getInputId($this->model, $this->attribute); } $this->parts['{beginLabel}'] = Html::beginTag('label', $options); $this->parts['{endLabel}'] = Html::endTag('label'); if (!isset($this->parts['{labelTitle}'])) { $this->parts['{labelTitle}'] = $label; } }
public function showSubmit() { $save = ''; if ($this->model->getDisplayMode() == DisplayClass::EDIT) { $save .= Html::startTag('div', ['id' => 'editButtons']); $action = $this->model->getAction() . '&referer=' . self::SAVE_AND_EDIT; $picture = Html::img('buttons/save.png', ['class' => 'button', 'id' => self::SAVE_AND_EDIT]); // $save .= Html::url($action, $picture, ['class' => 'submitLink', 'title' => 'Speichern und auf dieser Seite bleiben']); $save .= Html::url($action, 'Speichern', ['class' => 'submitLink', 'title' => 'Speichern und auf dieser Seite bleiben']); $action = $this->model->getAction() . '&referer=' . self::SAVE_AND_NEW; $picture = Html::img('buttons/save_add.png', ['class' => 'button', 'id' => self::SAVE_AND_NEW]); // $save .= Html::url($action, $picture, ['class' => 'submitLink', 'title' => 'Datensatz speichern und einen Neuen anlegen']); $save .= Html::url($action, 'Speichern und neu', ['class' => 'submitLink', 'title' => 'Datensatz speichern und einen Neuen anlegen']); $action = $this->model->getAction() . '&referer=' . self::SAVE_AND_SEARCH; $picture = Html::img('buttons/save_go.png', ['class' => 'button', 'id' => self::SAVE_AND_SEARCH]); // $save .= Html::url($action, $picture, ['class' => 'submitLink', 'title' => 'Speichern und zur Ergebnisliste']); $save .= Html::url($action, 'Speichern und zur Liste', ['class' => 'submitLink', 'title' => 'Speichern und zur Liste']); $save .= Html::endTag('div'); } $save .= Html::endTag('form'); return $save; }
/** * Renders the widget. */ public function run() { $this->registerPlugin('carousel'); return implode("\n", [Html::beginTag('div', $this->options), $this->renderIndicators(), $this->renderItems(), $this->renderControls(), Html::endTag('div')]) . "\n"; }
/** * Renders the closing tag of the modal body. * @return string the rendering result */ protected function renderBodyEnd() { return Html::endTag('div'); }
public function label($name, $inputName, $attributes = array()) { $id = "label_$inputName"; $attributes = Html::extendAttributeIfExists('id', $id, $attributes); $attributes = Html::extendAttributeIfExists('class', 'label', $attributes); $label = Html::startTag('span', $attributes); $label .= $name; $label .= Html::endTag('span'); return $label; }
/** * */ public function toString() { $this->attributes['class'] = $this->cssClass; if (isset($this->cssID)) { $this->attributes['id'] = $this->cssID; } $tr = Html::startTag('tr', $this->attributes); foreach ($this->getCells() as $cell) { if ($this->rowType) { $cell->setCellType($this->rowType); } $tr .= $cell->toString(); } $tr .= Html::endTag('tr'); return $tr; }
protected function displayListEntries(OutputDevice $od) { $counter = 0; $actualState = array_search(strtolower(Configuration::get()->getEntry('configStep')), $this->_getSetupSteps()); $entries = ''; foreach ($this->getNavigationEntries() as $link) { $displayName = $link->getDisplayName(); if ($counter < $actualState) { $class = self::STATE_FINISHED; } elseif ($counter == $actualState) { $class = self::STATE_EDIT; } else { $entries .= Html::startTag('li', array('class' => 'naviStep', 'id' => "naviStep_{$link->getControllerName()}")); $entries .= $displayName; $entries .= Html::endTag('li'); $counter++; continue; } $attributes = array('class' => $class); $href = $link->getHtmlTag($attributes); $entries .= Html::startTag('li', array('class' => 'naviStep', 'id' => "naviStep_{$link->getControllerName()}")); $entries .= $href; $entries .= Html::endTag('li'); $counter++; } $od->addContent($entries); }
/** * Generates a bar * @param integer $percent the percentage of the bar * @param string $label, optional, the label to display at the bar * @param array $options the HTML attributes of the bar * @return string the rendering result. */ protected function renderBar($percent, $label = '', $options = []) { $defaultOptions = ['role' => 'progressbar', 'aria-valuenow' => $percent, 'aria-valuemin' => 0, 'aria-valuemax' => 100, 'style' => "width:{$percent}%"]; $options = array_merge($defaultOptions, $options); Html::addCssClass($options, ['widget' => 'progress-bar']); $out = Html::beginTag('div', $options); $out .= $label; $out .= Html::tag('span', \Yii::t('yii', '{percent}% Complete', ['percent' => $percent]), ['class' => 'sr-only']); $out .= Html::endTag('div'); return $out; }
/** * ends the main content section of the page * * @param OutputDevice $od */ public static function endMainContent(OutputDevice $od) { $od->addContent(Html::endTag('div')); }
/** * create an script tag for an sortable, searchable, filterable, and so on table * * @return string */ public function toString() { $script = '<script language="javascript">' . PHP_EOL; $script .= "\t" . '$(function () {$("#searchTable").jqGrid({' . PHP_EOL; $script .= "\t\t" . "sortable: true," . PHP_EOL; $script .= "\t\t" . "url: '" . $this->getFormatedURL() . "'," . PHP_EOL; $script .= "\t\t" . 'contentType: "application/json",' . PHP_EOL; $script .= "\t\t" . 'datatype: "json",' . PHP_EOL; $script .= "\t\t" . 'loadonce: true,' . PHP_EOL; $script .= "\t\t" . "jsonReader: {" . PHP_EOL; $script .= "\t\t\t" . "root: 'BaseObjectReader'," . PHP_EOL; $script .= "\t\t\t" . "id: 'LK'," . PHP_EOL; $script .= "\t\t\t" . "repeatitems: false," . PHP_EOL; $script .= "\t\t" . "}," . PHP_EOL; $script .= "\t\t" . 'colNames: ' . $this->getFormatedColNames() . ',' . PHP_EOL; $script .= "\t\t" . 'colModel: [' . PHP_EOL; $script .= $this->getFormatedColModel() . PHP_EOL; $script .= "\t\t" . '],' . PHP_EOL; $script .= "\t\t" . "rowNum: {$this->rowNum}," . PHP_EOL; $script .= "\t\t" . "rowList: [" . implode(',', $this->rowList) . '],' . PHP_EOL; $script .= "\t\t" . "pager: '{$this->pager}'," . PHP_EOL; $script .= "\t\t" . "sortname: '{$this->sortname}'," . PHP_EOL; $script .= "\t\t" . "sortorder: '{$this->sortorder}'," . PHP_EOL; $script .= "\t\t" . "height: '{$this->height}'," . PHP_EOL; $script .= "\t\t" . "width: '{$this->width}'," . PHP_EOL; $script .= "\t\t" . "viewrecords: {$this->viewrecords}," . PHP_EOL; $script .= "\t\t" . "caption: '{$this->caption}'," . PHP_EOL; $script .= "\t\t" . "rownumbers: true," . PHP_EOL; $script .= "\t\t" . "gridview: true," . PHP_EOL; $script .= "\t\t" . "altRows: true," . PHP_EOL; $script .= "\t\t" . "altclass: 'odd'," . PHP_EOL; // $script .= "\t\t" . "multiSort: true," . PHP_EOL; $script .= "\t});" . PHP_EOL; $script .= "\t" . "$('#searchTable').jqGrid('navGrid', '#navGrid',{edit:false,add:false,del:false});" . PHP_EOL; $script .= "\t" . "$('#searchTable').jqGrid('filterToolbar', {stringResult: true, searchOnEnter: false, defaultSearch : 'cn', showQuery: true});" . PHP_EOL; $script .= "\t" . "$('#searchTable').jqGrid('inlineNav','#navGrid');" . PHP_EOL; $script .= "\t" . "$('#searchTable').jqGrid('navButtonAdd','#navGrid',{caption: 'Spalten', title: 'Reorder Columns', onClickButton : function (){ $('#searchTable').jqGrid('columnChooser'); }});" . PHP_EOL; $script .= "\t" . "$('#searchTable').jqGrid('gridResize', { maxWidth: $('#mainContent').width()-$('#mainContent').css('padding').replace('px','') });" . PHP_EOL; $script .= "\t});" . PHP_EOL; $script .= Html::endTag('script'); return $script; }
/** * Renders the widget. */ public function run() { echo "\n" . $this->renderBodyEnd(); echo "\n" . Html::endTag('div'); $this->registerPlugin('alert'); }
/** * show the data without input element, because editing is not possible * * @return string */ protected function getReadOnlyDisplay() { return Html::startTag('div', array('class' => $this->class. ' formWidth' . $this->displayedLength)) . $this->value . " %" . Html::endTag('div'); }
} $table->addHeadRow($row); $orderBox = Html::startTag('div', array('id' => 'order')); $orderBox .= Html::startTag('p', array('id' => 'orderHeadline')) . 'Warenkorb' . Html::endTag('p'); $orderBox .= Html::startTag('div', array('id' => 'orderNoContent')) . 'Es wurden noch keine Waren ausgewählt' . Html::endTag('div'); $orderBox .= Html::startTag('div', array('id' => 'orderContent')); $form = new base_html_model_Form(); $orderBox .= $form->start('ajax.php?controller=medexchange_ajax_save_medorder_Controller', 'post', array('class' => 'ajaxForm')); $orderBox .= $table->toString(); $orderBox .= Html::startTag('div', array('id' => 'totalAmount')) . "Gesamt:\t" . Html::startTag('span') . Html::endTag('span') . " €" . Html::endTag('div') . "<br />"; $formElement = new base_form_element_Submit(new Fieldinfo('MedOffer')); $formElement->setName('submit'); $formElement->setValue('Absenden'); $orderBox .= $formElement->display(); $orderBox .= $form->end(); $orderBox .= Html::endTag('div'); $orderBox .= Html::endTag('div'); $od->addContent( $orderBox); } } base_ui_Site::endMainContent($od); base_ui_Site::displayBottom($od); print $od->toString();
/** * Renders the widget. */ public function run() { $this->registerPlugin('collapse'); return implode("\n", [Html::beginTag('div', $this->options), $this->renderItems(), Html::endTag('div')]) . "\n"; }
/** * Renders the widget. */ public function run() { $tag = ArrayHelper::remove($this->containerOptions, 'tag', 'div'); echo Html::endTag($tag); if ($this->renderInnerContainer) { echo Html::endTag('div'); } $tag = ArrayHelper::remove($this->options, 'tag', 'nav'); echo Html::endTag($tag, $this->options); BootstrapPluginAsset::register($this->getView()); }
$od->addContent("Die Collocation Groups wurden erfolgreich importiert"); $od->addContent(Html::endTag('li')); } $importer = new tsmviewer_importer_csv_TSMObject('tsmnode', ROOT . "/modules/tsmviewer/init/tsmnode_{$obj['LK']}_data.csv", ',', false); $ret = $importer->import(); if ($ret == tsmviewer_importer_csv_TSMObject::SUCCESS) { $od->addContent(Html::startTag('li')); $od->addContent("Die Nodes wurden erfolgreich importiert"); $od->addContent(Html::endTag('li')); } $importer = new tsmviewer_importer_csv_TSMObject('tsmsummary', ROOT . "/modules/tsmviewer/init/tsmsummary_{$obj['LK']}_data.csv", ',', false); $ret = $importer->import(); if ($ret == tsmviewer_importer_csv_TSMObject::SUCCESS) { $od->addContent(Html::startTag('li')); $od->addContent("Das TSMSummary wurde erfolgreich importiert"); $od->addContent(Html::endTag('li')); } $od->addContent(Html::endTag('ul')); $od->addContent(Html::endTag('li')); $od->addContent(Html::singleTag('br')); } base_ui_Site::endMainContent($od); base_ui_Site::displayBottom($od); print $od->toString();
public function toString() { $this->attributes['class'] = $this->cssClass; if (isset($this->colSpan)) { $this->attributes['colspan'] = $this->colSpan; } if (isset($this->rowSpan)) { $this->attributes['rowspan'] = $this->rowSpan; } if (isset($this->cssID)) { $this->attributes['id'] = $this->cssID; } $td = Html::startTag($this->cellType, $this->attributes); $td .= $this->content; $td .= Html::endTag($this->cellType); return $td; }
* User: Alex * Date: 12.01.2015 * Time: 11:54 */ require_once (dirname(__DIR__) . '/config.php'); $od = new OutputDevice(); base_ui_Site::displayHead($od); base_ui_Site::displayTop($od); base_ui_Site::displayNavigation($od); base_ui_Site::startMainContent($od); $rh = new RequestHelper(); $controllerClass = $rh->getParam('controller'); /** @var Controller $controller */ $controller = new $controllerClass(); $od->addContent(Html::startTag('h3')); $od->addContent($controller->getPageTitle()); $od->addContent(Html::endTag('h3')); $controller->display($od); base_ui_Site::endMainContent($od); base_ui_Site::displayBottom($od); print $od->toString();