public function toHtml()
 {
     if (!file_exists('site/templates/' . $this->templateName . '/template.php')) {
         return;
     }
     // Inhalte nach Regionen sortieren
     $inhalte = array();
     foreach ($this->regions as $curRegion) {
         $inhalte[$curRegion->re_name][] = $curRegion;
     }
     foreach ($this->regionsAvailable as $name) {
         $html = '';
         if (array_key_exists($name, $inhalte)) {
             $region = $inhalte[$name];
             foreach ($region as $curContent) {
                 $html .= $curContent->toDesignModeHtml()->toHtml();
             }
         }
         $div = Html::createElement('div')->addCssClass('');
         // Buttons anzeigen
         $btnGroup = new StdControls\ButtonGroupControl(null, 'btnGroup' . $this->id);
         $btnAdd = new StdControls\ButtonControl($btnGroup, 'btnAdd' . $this->id);
         $btnAdd->setCaption('Neues Element')->setIcon('plus')->addCssClass('btn-success')->addCssClass('nfs-modal')->setLink('site', 'newRegion', array('page' => $this->pageId, 'region' => $name));
         $div->addInnerHtml($btnGroup->toHtml());
         $html .= $div->render();
         $this->setVar($name, $html);
     }
     $this->skin = '
        <div class="panel panel-default" style="padding: 10px; margin-top: 20px; overflow: scroll; width: 100%; max-width: 100%;">
        ' . file_get_contents('site/templates/' . $this->templateName . '/template.php') . '
        </div>
     ';
     return $this->renderBySkin();
 }
Exemplo n.º 2
0
 /**
  * @inheritdoc
  */
 public function toDesignModeHtml()
 {
     // TODO: Das muss hier raus, damit man Polymorphie nutzen kann
     if ($this->re_module == '') {
         return new HtmlControl(null);
     }
     $module = Modules::getModule($this->re_module);
     if ($module == null) {
         return new HtmlControl(null);
     }
     $action = $module->getAction($this->re_action);
     $div = Html::createElement('div')->addCssClass('panel panel-info')->addInnerHtml("<div class=\"panel-heading\">\n                    <span class=\"label label-default\">{$module->name}</span>\n                    <em>{$action->description}</em>\n                    <small>[{$this->re_parameter}]</small>\n                </div>");
     $divInner = Html::createElement('div')->addTo($div)->addCssClass('panel-body');
     $btnGroup = new \NewFrontiers\Controls\StdControls\ButtonGroupControl(null, 'btnGroup' . $this->id);
     $divInner->addInnerHtml($btnGroup);
     $btnDelete = new ButtonControl($btnGroup, 'btnDelete' . $this->id);
     $btnDelete->setCaption(' ')->setIcon('minus')->addCssClass('confirm')->addCssClass('btn-danger')->setLink('site', 'deleteRegion', array('id' => $this->id));
     $btnEdit = new ButtonControl($btnGroup, 'btnEdit' . $this->id);
     $btnEdit->setCaption('')->setIcon('edit')->addCssClass('nfs-modal')->addCssClass('btn-primary')->setLink('site', 'editRegion', array('id' => $this->id));
     $btnUp = new ButtonControl($btnGroup, 'btnUp' . $this->id);
     $btnUp->setCaption('')->setIcon('arrow-up')->setLink('site', 'regionUp', array('id' => $this->id));
     $btnDown = new ButtonControl($btnGroup, 'btnDown' . $this->id);
     $btnDown->setCaption('')->setIcon('arrow-down')->setLink('site', 'regionDown', array('id' => $this->id));
     $result = new HtmlControl(null, 'region' . $this->id);
     $result->setInnerHtml($div->render());
     return $result;
 }
 /**
  * @inheritdoc
  */
 public function toHtml()
 {
     $modulo = $this->getSchrittweite();
     $ul = Html::create('ul')->css('pagination')->css('pagination-sm')->addCssClasses($this->cssClasses);
     $prev = Html::create('li')->addTo($ul)->text(Html::create('a')->attr('href', '#' . ($this->currentPage - 1))->attr('data-page', $this->currentPage - 1)->text('&laquo;'));
     // Links für die Seitenzahlen
     for ($i = 1; $i <= $this->pages; $i++) {
         // Die Seite wird angezeigt, wenn
         // - Es die aktuelle Seite ist
         // - Es die erste Seite ist
         // - Es die letzte Seite ist
         // - Die Seite im Bereich +-5 um die aktuelle liegt
         // - Die Seite zum Modulo passt
         $showPage = $i === $this->currentPage || $i === 1 || $i === $this->pages || $i >= $this->currentPage - 5 && $i <= $this->currentPage + 5 || $i % $modulo === 0;
         if ($showPage) {
             $li = Html::create('li')->addTo($ul);
             $current = Html::create('a')->attr('data-page', $i)->attr('href', '#' . $i)->text($i);
             $li->text($current);
             if ($i === $this->currentPage) {
                 $li->css('active');
             }
         }
     }
     $next = Html::create('li')->addTo($ul)->text(Html::create('a')->attr('href', '#' . ($this->currentPage + 1))->attr('data-page', $this->currentPage + 1)->text('&raquo;'));
     // Markierungen für aktiv / inaktiv setzen
     if ($this->currentPage === 1) {
         $prev->css('disabled');
     }
     if ($this->currentPage === $this->pages) {
         $next->css('disabled');
     }
     return $ul->render();
 }
 /**
  * In der aktuellen Implementierung werden für die Ausgabe
  * Bootstrap-Alerts verwendet. Diese werden hier aufgebaut und
  * das resultierende HTML zurückgegeben
  *
  * @return string
  */
 public function toHtml()
 {
     $div = Html::create('div')->css('alert')->css('alert-dismissable')->css('alert-' . $this->level);
     Html::create('button')->attr('type', 'button')->css('close')->attr('data-dismiss', 'alert')->attr('aria-hidden', 'true')->text('&times;')->addTo($div);
     $div->text($this->message);
     return $div->render();
 }
 /**
  * @inheritdoc
  */
 public function toHtml()
 {
     if (count(Routing::getBreadcrumbs()) === 0) {
         return '';
     }
     $ul = Html::create($this->tagToUse)->addCssClasses($this->cssClasses)->css('breadcrumb');
     $lastLi = null;
     foreach (Routing::getBreadcrumbs() as $curBreadcrumb) {
         $li = Html::create('li')->addTo($ul);
         $fulllink = $curBreadcrumb['link'];
         if (strpos($fulllink, 'http') === false) {
             $fulllink = Configuration::get('site.scriptUrl') . $fulllink;
         }
         $text = $curBreadcrumb['text'];
         if (mb_strlen($curBreadcrumb['text']) > 20) {
             $text = mb_substr($curBreadcrumb['text'], 0, 20) . '...';
         }
         if ($curBreadcrumb['link'] !== '') {
             Html::create('a')->addTo($li)->attr('href', $fulllink)->attr('title', $curBreadcrumb['text'])->text($text);
         } else {
             Html::create('span')->addTo($li)->attr('title', $curBreadcrumb['text'])->text($text);
         }
         $lastLi = $li;
     }
     $lastLi->css('active');
     return $ul->render();
 }
 public function toHtml()
 {
     $div = Html::createElement('div')->addCssClass('flowelement temp')->addAttribute('id', $this->id);
     $span = Html::createElement('span')->addCssClass('box')->addInnerHtml($this->text);
     $div->addInnerHtml($span);
     return $div->render();
 }
Exemplo n.º 7
0
 /**
  * @inheritdoc
  */
 public function toDesignModeHtml()
 {
     $row = Html::create('div')->css('row')->css('design-mode');
     $column1 = Html::create('div')->css('col-md-12')->addTo($row)->text('<h4 class="page-header">Spalte 1</h4>')->text($this->columns['column1']->toDesignModeHtml());
     $btn1 = AddRegionControl::create(null)->setRegion($this->region)->setCollectionName('column1');
     $column1->text($btn1->toHtml());
     return $row;
 }
 /**
  * Gibt einen formatierten String zurück. Wird von den Controls genutzt
  * und setzt beispielsweise einen Boolean-Wert in "ja" / "nein" um
  */
 public function toString()
 {
     $parts = explode(':', $this->value);
     if (count($parts) > 1) {
         return Html::create('span')->css('label')->css('label-' . $parts[0])->text($parts[1])->render();
     }
     return '';
 }
 public function toHtml()
 {
     // TODO: Close-Button wird nicht angezeigt
     $div = Html::create('div')->css('alert')->css('alert-dismissable')->css($this->alertClass);
     $button = Html::create('button')->data('dismiss', 'alert')->css('close')->attr('type', 'button')->render();
     $div->text($button . ' ' . $this->text);
     return $div->render();
 }
 public function toHtml()
 {
     $div = Html::createElement('div')->setId('da-slider')->addCssClass('da-slider');
     foreach ($this->artikel as $current) {
         $slide = Html::createElement('div')->addCssClass('da-slide')->addInnerHtml($current->getText())->addTo($div);
     }
     $arrows = Html::createElement('div')->addCssClass('da-arrows')->addInnerHtml('<span class="da-arrows-prev"></span>')->addInnerHtml('<span class="da-arrows-next"></span>')->addTo($div);
     return $div->render();
 }
 /**
  * Generiert den HTML Code für das Control und gibt diesen zurück. Das
  * Control muss selbst entscheiden, wie die HTML-Ausgabe entsteht. Es stehen
  * die Hilfsmethoden @see renderBySkin() und @see renderChildren() bereit.
  *
  * @return string|HtmlOutputInterface
  */
 public function toHtml()
 {
     $this->options->requirePlugins();
     if (trim($this->name) === '') {
         $this->name = $this->id;
     }
     $html = Html::create('textarea')->attr('name', $this->name)->attr('id', $this->id)->attr('style', 'height: 280px')->text($this->value);
     return $html->render();
 }
 private function createTotal($label, $value)
 {
     $row = Html::create('div')->css('row');
     $label = Html::create('div')->css('col-md-2')->text($label)->addTo($row);
     $col = Html::create('div')->css('col-md-10')->addTo($row);
     $progress = Html::create('div')->css('progress')->addTo($col);
     Html::create('div')->addTo($progress)->css('progress-bar')->css('progress-bar-primary')->attr('style', 'width: 100%')->text($value . ' ms');
     return $row;
 }
 public function toHtml()
 {
     $div = Html::createElement('div')->addCssClass('flowelement ende')->addAttribute('id', $this->id);
     $span = Html::createElement('span')->addCssClass('box')->addInnerHtml('ENDE');
     if ($this->aktivitaet->wa_status >= 100) {
         $span->addCssClass('complete');
     }
     $div->addInnerHtml($span);
     return $div->render();
 }
 /**
  * @inheritdoc
  */
 public function toHtml()
 {
     if ($this->value === '') {
         $this->value = ' ';
     }
     if ($this->name === '') {
         $this->name = $this->id;
     }
     $html = Html::create('textarea')->attr('name', $this->id)->attr('id', $this->id)->attr('style', 'height: 280px')->text($this->value);
     return $html->render();
 }
 public function toHtml()
 {
     if ($this->name == '') {
         $this->name = $this->id;
     }
     $html = Html::createElement('input')->attr('type', 'text')->attr('id', $this->id)->attr('name', $this->name)->attr('value', $this->value)->attr('min', $this->min)->attr('max', $this->max)->attr('step', $this->step)->data('size', $this->size)->addCssClass('rating')->addCssClasses($this->cssClasses);
     if ($this->readOnly) {
         $html->attr('disabled', 'disabled');
     }
     return $html->render();
 }
Exemplo n.º 16
0
 /**
  * Gibt den HTML Code für ein ERgebnis-Label aus
  * @param $ergebnis
  * @return string
  */
 public static function ergebnisLabel($ergebnis)
 {
     $label = Html::createElement('span')->addCssClass('label');
     if ($ergebnis == self::ERGEBNIS_FEHLER) {
         $label->addCssClass('label-danger')->addInnerHtml('fehlgeschlagen');
     } elseif ($ergebnis == self::ERGEBNIS_OK) {
         $label->addCssClass('label-success')->addInnerHtml('erfolgreich');
     } else {
         return '';
     }
     return $label->render();
 }
 public function toHtml()
 {
     $html = Html::createElement('input');
     $html->addAttribute('type', 'password')->addAttribute('id', $this->id)->addAttribute('name', $this->id)->addAttribute('value', $this->value)->addCssClass('form-control')->addCssClasses($this->cssClasses);
     if ($this->maxlength > 0) {
         $html->addAttribute('maxlength', $this->maxlength);
     }
     if ($this->readOnly) {
         $html->addAttribute('disabled', 'disabled');
     }
     return $html->render();
 }
 public function toHtml()
 {
     $panel = new Html('div');
     $panel->addAttribute('id', 'actionLookup');
     $select = new Html('select');
     $select->addCssClass('lookup')->addCssClass('form-control');
     $select->addAttribute('name', $this->id);
     $select->addTo($panel);
     $actions = array();
     if (isset($this->module)) {
         $actions = Modules::getModule($this->module)->getAllMenuActions();
     }
     foreach ($actions as $action) {
         $option = new Html('option');
         $option->addAttribute('value', $action->name)->addInnerHtml($action->description);
         if ($action->name == $this->selectedItem) {
             $option->addAttribute('selected', 'selected');
         }
         $select->addInnerHtml($option);
     }
     return $panel->render();
 }
 public function toHtml()
 {
     $html = Html::createElement('input');
     $html->addAttribute('type', 'file')->addAttribute('id', $this->id)->addAttribute('name', $this->id)->addCssClasses($this->cssClasses);
     if ($this->readOnly) {
         $html->addAttribute('disabled', 'disabled');
     }
     if ($this->oldMedium) {
         return "<a href='" . $this->oldMedium->getUrl() . "'>" . $this->oldMedium->me_dateiname . "</a><br><br>" . $html->render();
     } else {
         return $html->render();
     }
 }
 public function toHtml()
 {
     $temp = "";
     // Prototypen der Edit-Controls ausgeben
     if ($this->editMode) {
         $add = Html::createElement('a')->addCssClass('add')->addAttribute('id', 'templateAdd')->addAttribute('href', Application::link('workflow', 'newWorkflowaktivitaet'))->addAttribute('style', 'display: block;')->addAttribute('title', 'Aktivität einfügen')->addInnerHtml(Template::img('icons/add.png', true));
         $del = Html::createElement('a')->addCssClass('add')->addAttribute('href', Application::link('workflow', 'deleteWorkflowaktivitaet'))->addAttribute('id', 'templateDel')->addAttribute('title', 'Löschen')->addInnerHtml(Template::img('icons/delete.png', true));
         $edit = Html::createElement('a')->addCssClass('add')->addAttribute('href', Application::link('workflow', 'editWorkflowaktivitaet'))->addAttribute('id', 'templateEdit')->addAttribute('title', 'Bearbeiten')->addInnerHtml(Template::img('icons/page_white_edit.png', true));
         $container = Html::createElement('div')->addAttribute('style', 'display:none;')->addInnerHtml($add)->addInnerHtml($del)->addInnerHtml($edit);
         $temp = $container->render();
     }
     $div = Html::createElement('div')->addCssClass('flowchart')->addAttribute('id', $this->id)->addInnerHtml($this->workflow->getStart()->render());
     return $temp . $div->render();
 }
 public function toHtml()
 {
     $select = new HTML('select');
     if ($this->readOnly) {
         $select->attr('disabled', 'disabled');
     }
     if ($this->multiple) {
         $select->attr('multiple', 'multiple');
     }
     if ($this->name === null) {
         $this->name = $this->id;
     }
     $select->addCssClasses($this->cssClasses)->css('form-control')->attr('name', $this->name)->attr('id', $this->id);
     foreach ($this->options as $option) {
         $optionHtml = new Html('option');
         $optionHtml->attr('value', $option['value'])->text($option['text']);
         if ($this->isSelected($option['value'])) {
             $optionHtml->attr('selected', 'selected');
         }
         $select->text($optionHtml);
     }
     return $select->render();
 }
 public function toHtml()
 {
     $div = Html::createElement('div')->addCssClass('flowelement')->addAttribute('id', $this->id);
     $span = Html::createElement('span')->addCssClass('box')->addInnerHtml($this->text . ' ')->addTo($div);
     if ($this->aktivitaet->wa_status >= 100) {
         $img = Html::createElement('img')->addTo($span)->addAttribute('src', Template::img('icons/tick.png'))->addAttribute('title', 'Abgeschlossen am ' . $this->aktivitaet->wa_abschlussdatum . ' von ' . $this->aktivitaet->abschlussbenutzer_vorname . ' ' . $this->aktivitaet->abschlussbenutzer_name);
         $span->addCssClass('complete');
     } elseif ($this->aktivitaet->wa_status >= 0) {
         $span->addInnerHtml('<a href="' . Configuration::get('site.scriptUrl') . '/workflow/finishActivity/id/' . $this->aktivitaet->id . '" class="tick">&nbsp;</a>');
         $span->addCssClass('active');
     } else {
         $span->addCssClass('not_yet');
     }
     return $div->render();
 }
 /**
  * @inheritdoc
  */
 public function toHtml()
 {
     $outer = Html::create('div');
     foreach ($this->boxen as $box) {
         $div = Html::create('div')->css('checkbox')->addTo($outer);
         $label = Html::create('label')->addTo($div);
         $input = Html::create('input')->attr('type', 'checkbox')->attr('id', $box['id'])->attr('name', $box['id'])->attr('value', $box['value'])->addTo($label);
         // Muss nach dem Input eingefügt werden
         $label->text($box['text']);
         if ($box['checked']) {
             $input->attr('checked', 'checked');
         }
     }
     return $outer->render();
 }
 /**
  * @inheritdoc
  */
 public function toHtml()
 {
     $this->templates = new InnerTemplateList($this->outerTemplate->name);
     $div = Html::create('div')->css('chooseTemplateDiv')->css('row');
     Html::create('input')->attr('type', 'hidden')->attr('name', $this->id)->attr('id', $this->id)->attr('value', $this->chosenTemplate)->addTo($div);
     foreach ($this->templates->getTemplates() as $template) {
         $innerDiv = Html::create('div')->css('col-md-1')->addTo($div);
         $a = Html::create('a')->css('chooseTemplate')->attr('href', '#')->attr('title', $template->getName())->addTo($innerDiv);
         if ($this->chosenTemplate === $template->getName()) {
             $a->css('chosen');
         }
         Html::create('img')->attr('src', $template->getThumbnailUrl())->addTo($a);
     }
     return $div->render();
 }
 public function toHtml()
 {
     $html = Html::createElement('textarea');
     $html->addAttribute('id', $this->id)->addCssClass('form-control')->addAttribute('name', $this->name)->addInnerHtml($this->value)->addCssClasses($this->cssClasses);
     if ($this->readOnly) {
         $html->addAttribute('disabled', 'disabled');
     }
     if ($this->maxlength) {
         $html->addAttribute('maxlength', $this->maxlength);
     }
     if ($this->placeholder != '') {
         $html->addAttribute('placeholder', $this->placeholder);
     }
     return $html->render();
 }
 /**
  * @inheritdoc
  */
 public function toHtml()
 {
     $div = Html::create('div')->css('checkbox')->css($this->cssClasses);
     $label = Html::create('label')->addTo($div);
     $html = Html::create('input')->addTo($label)->attr('type', 'checkbox')->attr('id', $this->id)->attr('name', $this->id . '_box')->attr('value', $this->value)->css('checkbox')->css($this->cssClasses);
     if ($this->readOnly) {
         $html->attr('disabled', 'disabled');
     }
     $valueStr = 0;
     if ($this->checked) {
         $html->attr('checked', 'checked');
         $valueStr = 1;
     }
     $hidden = Html::create('input')->attr('type', 'hidden')->attr('name', $this->id)->attr('id', $this->id . '_hidden')->attr('value', $valueStr);
     return $div->render() . $hidden->render();
 }
 public function getData($row)
 {
     $this->checkbox = Html::create('input')->css('select-column')->attr('type', 'checkbox')->attr('name', 'selected[' . $this->entity->id . ']')->attr('value', 1);
     // Hack, damit die IDE hier nicht meckert, obwohl alles richtig ist
     if ($this->callable != 'none') {
         $callable = $this->callable;
         $this->checked = $callable($this->entity);
     }
     if ($this->checked) {
         $this->checkbox->attr('checked', 'checked');
     }
     if ($this->checked && $this->disabledWhenChecked) {
         $this->checkbox->attr('disabled', 'disabled');
     }
     return $this->checkbox->render();
 }
Exemplo n.º 28
0
 public function toHtml()
 {
     $div = Html::createElement('div')->addCssClass('flowelement')->addAttribute('id', $this->id);
     $span = Html::createElement('span')->addCssClass('box')->addInnerHtml('IF')->addTo($div);
     $table = Html::createElement('table')->addCssClass('if')->addTo($div);
     // HEADER
     $tr = Html::createElement('tr')->addCssClass('if_top')->addTo($table);
     $td = Html::createElement('td')->addCssClass('if_links')->addInnerHtml('&nbsp;')->addTo($tr);
     $td = Html::createElement('td')->addCssClass('if_Rechts')->addInnerHtml('&nbsp;')->addTo($tr);
     // DATEN
     $tr = Html::createElement('tr')->addTo($table);
     $td = Html::createElement('td')->addInnerHtml(new WAPlatzhalterControl(null))->addTo($tr);
     $td = Html::createElement('td')->addInnerHtml(new WAPlatzhalterControl(null))->addTo($tr);
     // FOOTER
     $tr = Html::createElement('tr')->addTo($table);
     $td = Html::createElement('td')->addCssClass('if_links')->addInnerHtml('&nbsp;')->addTo($tr);
     $td = Html::createElement('td')->addCssClass('if_Rechts')->addInnerHtml('&nbsp;')->addTo($tr);
     return $div->render();
 }
 public function toHtml()
 {
     $group = Html::create('fieldset');
     if ($this->caption != null) {
         $legend = Html::create('legend')->addInnerHtml($this->caption)->addTo($group);
     }
     foreach ($this->boxen as $box) {
         $input = Html::create('input')->attr('type', 'radio')->attr('id', $this->id . '_' . $box['id'])->attr('name', $this->id)->attr('value', $box['value']);
         $label = Html::create('label')->text($input)->text($box['text'])->addTo($group);
         if ($box['checked']) {
             $input->addAttribute('checked', 'checked');
         }
     }
     if (count($this->boxen) > 5) {
         $outer = Html::createElement('div')->addAttribute('style', 'height: 300px; overflow: auto; margin-bottom: 10px;')->addInnerHtml($group);
         return $outer->render();
     } else {
         return $group->render();
     }
 }
 public function toHtml()
 {
     if ($this->name == '') {
         $this->name = $this->id;
     }
     $group = Html::create('div')->css('input-group');
     $html = Html::create('input')->addTo($group)->attr('type', 'text')->attr('id', $this->id)->attr('name', $this->name)->attr('value', $this->value)->css('form-control')->css('url')->css($this->cssClasses);
     if ($this->maxlength) {
         $html->attr('maxlength', $this->maxlength);
     }
     if ($this->readOnly) {
         $html->attr('disabled', 'disabled');
     }
     if ($this->placeholder != '') {
         $html->attr('placeholder', $this->placeholder);
     }
     $span = Html::create('span')->addTo($group)->css('input-group-btn');
     $button = Html::create('a')->addTo($span)->css('btn btn-default')->text('Aufrufen')->attr('href', $this->value)->attr('target', '_blank');
     return $group->render();
 }