/** * @inheritdoc */ public function toHtml() { $this->setVar('value', $this->entity->felder[$this->textfield]->toString()); $this->setVar('link', Routing::targetLink($this->target)); $this->defaultSkinFile = __DIR__ . '/LookupLinkControl.template.html'; return $this->renderBySkin(); }
protected function generateTemplate() { // Sobald das Entity feststeht, steht auch der Edit-Link fest. Dann können wir auch das Template erzeugen $class = explode('\\', get_class($this->entity)); $class = $class[count($class) - 1]; $link = Routing::appLink($this->entity->getModuleName(), 'edit' . $class, array('id' => '{' . $this->entity->primaryKey . '}')); $cssClass = ''; if ($this->showModal) { $cssClass = 'nfs-modal'; } $btnTextBearbeiten = 'Bearbeiten'; if ($this->small) { $btnTextBearbeiten = ''; } $btnTextLoeschen = 'Löschen'; if ($this->small) { $btnTextLoeschen = ''; } $this->template = ' <a href="' . $link . '" class="btn btn-default btn-xs ' . $cssClass . '" title="Bearbeiten"> <span class="glyphicon glyphicon-pencil"></span> ' . $btnTextBearbeiten . ' </a> <a href="#" class="btn btn-danger btn-xs delete" title="Löschen"> <span class="glyphicon glyphicon-trash"></span> ' . $btnTextLoeschen . ' </a> '; }
/** * @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 setButtonLink($text, $module, $action, $param = array(), $icon = '', $btnClass = 'btn-primary', $linkClass = '') { $this->href = Routing::appLink($module, $action, $param); $this->text = $text; $this->class .= ' ' . $btnClass . ' ' . $linkClass; if ($icon != '') { $this->text = '<span class="glyphicon glyphicon-' . $icon . '"></span> ' . $text; } $this->generateTemplate(); return $this; }
/** * Führt einen 301 Redirect auf ein Ziel im Framework durch * @param $module * @param $action * @param array $param * @param bool $admin Falls true, wird ein Redirect auf die Admin-Seite erzwungen * @param string $hash */ public static function redirectTo($module, $action, array $param = array(), $admin = false, $hash = '') { if ($admin) { $url = Configuration::get('site.siteUrl') . "/admin.php/{$module}/{$action}"; foreach ($param as $key => $value) { $url .= "/{$key}/{$value}"; } if ($hash !== '') { $url .= '#' . $hash; } self::redirect($url); return; } $url = Routing::appLink($module, $action, $param); if ($hash !== '') { $url .= '#' . $hash; } self::redirect($url); }
/** * @return string */ public function toHtml() { if ($this->renderChildren) { $this->loadSubItems(); } if ($this->page->pa_link === '') { $href = Routing::appLink($this->page->pa_module, $this->page->pa_action); } else { $href = Routing::appLink($this->page->pa_link); } $fulllink = Html::create('a')->attr('href', $href)->text($this->page->getDisplayText()); // Aktiv-Klasse setzen (oder eben nicht) if ($this->page->isActive()) { $this->addCssClass('active'); $this->setVar('active', 'active'); } else { $this->addCssClass('not_active'); $this->setVar('active', ''); } // Dropdown einfügen, falls es Kind-Knoten gibt und diese // angezeigt werden if ($this->renderChildren && $this->page->hasChildren()) { $this->setVar('chevron', '<span class="fa arrow"></span>'); $fulllink->css('dropdown-toggle')->attr('data-toggle', 'dropdown'); if ($this->getParent() instanceof SiteMenuControl) { $this->addCssClass('dropdown'); $fulllink->text(' <b class="caret"></b>'); } else { $this->addCssClass('dropdown-submenu'); } } $this->setVar('text', $this->page->getDisplayText()); if ($this->page->pa_icon !== '') { $this->setVar('icon', '<i class="fa fa-' . $this->page->pa_icon . '"></i>'); } $this->setVar('bezeichnung', $this->page->getCssBezeichnung($this->page->pa_bezeichnung)); $this->setVar('cssClass', 'class="' . $this->getCssString() . '"'); $this->setVar('sub', $this->getSubHtml()); $this->setVar('link', $fulllink->render()); $this->setVar('href', $fulllink->getAttribute('href')); return $this->renderBySkin(); }
/** * @deprecated * @param $module * @param $action * @param $param * @return string */ public static function link($module, $action, array $param = []) { return Routing::appLink($module, $action, $param); }
/** * Setzt die Metadaten für den Response * * @param Response $response */ private function setMetadata(Response $response) { $response->getMetadata()->setHeading((string) $this->resource); Routing::resetBreadcrumbs(); Routing::addBreadcrumb($this->resource->__toPluralString(), EntityLinks::index($this->resource)); if ($this->resource->id > 0) { Routing::addBreadcrumb((string) $this->resource, EntityLinks::edit($this->resource)); } else { Routing::addBreadcrumb('Neuen Datensatz anlegen'); } }
public function indexImportprotokoll() { $this->import = new Import($this->request->import); Application::getCurrentResponse()->heading = 'Protokoll für ' . $this->import; Routing::resetBreadcrumbs(); Routing::addBreadcrumb('Importe', EntityLinks::index($this->import)); Routing::addBreadcrumb($this->import); }
/** * Diese Methode setzt die Seitenüberschrift und die Breadcrumbs für den * Aufruf eines Entities * * @param BaseEntity $entity */ public function handleResourceCall(BaseEntity $entity) { $this->response->getMetadata()->setHeading((string) $entity); Routing::resetBreadcrumbs(); Routing::addBreadcrumb($entity->__toPluralString(), EntityLinks::index($entity)); if ($entity->id > 0) { Routing::addBreadcrumb((string) $entity, EntityLinks::edit($entity)); } else { Routing::addBreadcrumb('Neuen Datensatz anlegen'); } }
/** * @param BaseEntity $entity * @return string */ public static function init(BaseEntity $entity) { return Routing::appLink($entity->getModuleName(), 'new' . $entity->getShortClassName(), array()); }
public function berechtigungen() { $this->current = Modules::getModule($this->request->id); $this->aktionen = []; Routing::resetBreadcrumbs(); Routing::addBreadcrumb('Module', '/ModView/showModules'); Routing::addBreadcrumb($this->current->namespace); foreach ($this->current->getAllActions() as $action) { if ($action->securityLevel === Action::LEVEL_CONFIG) { $linkEdit = new HTML('a'); $linkEdit->addAttribute('href', Routing::appLink('modView', 'berechtigung', array('current' => $this->current->qualifiedName, 'id' => $action->name))); $linkEdit->text('Berechtigungen »'); $linkEdit->css('nfs-modal'); $temp = array('name' => $action->name, 'description' => $action->description, 'berechtigung' => $linkEdit->render()); if ($action->addToMenu) { $temp['menu'] = 'Ja'; } else { $temp['menu'] = 'Nein'; } $this->aktionen[] = $temp; } } }
public function username() { Routing::addBreadcrumb('Bentuzername vergessen', ''); Application::getInstance()->setTemplate('unify_login'); }
public function aktivierungslinkSenden() { $this->user = new User($this->request->id); if ($this->user->val('us_aktiv')) { FlashMessage::warning('Der Benutzer ist bereits aktiv. Es wurde keine Mail versendet'); return; } $activationLink = Routing::appLink('User', 'activateUser', ['hash' => $this->user->generateHash()]); UserMailer::activate($this->user, 'Ihr Benutzerkonto', $activationLink); FlashMessage::success('Aktivierungslink wurde versendet'); }
public function setAppLink($module, $action, $parameter = array(), $class = null, $title = null) { $temp = Routing::appLink($module, $action, $parameter); $this->setLink($temp, $class, $title); }
public function toJavascript() { $url = Routing::appLink($this->module, $this->action); $siteurl = Configuration::get('site.url'); if ($this->showThumbnail) { $dir = 'thumbs'; } else { $dir = 'resized'; } $formFieldText = ''; foreach ($this->formFields as $field) { $formFieldText .= ", {$field['name']}: {$field['function']}"; } return "\n // Define the url to send the image data to\n var url = '{$url}';\n\n // Call the fileupload widget and set some parameters\n \$('#fileupload{$this->id}').fileupload({\n url: url,\n dataType: 'json',\n\n submit: function(e, data) {\n data.formData = {\n kollektion: {$this->kollektionId},\n info: {$this->info},\n target: '{$this->targetFilename}',\n token: '{$this->token}' {$formFieldText}\n };\n\n \$('#progress-outer{$this->id}').css('display', 'block');\n \$('#progress{$this->id}').addClass('active');\n \$('#files{$this->id}').empty();\n\n\n },\n\n progressall: function (e, data) {\n // Update the progress bar while files are being uploaded\n var progress = parseInt(data.loaded / data.total * 100, 10);\n \$('#progress{$this->id} .bar').css(\n 'width',\n progress + '%'\n );\n },\n\n done: function (e, data) {\n \$.each(data.result.files, function (index, file) {\n if (file.error){\n var html = '<b>'+file.name+'</b>: '+ file.error;\n \$('<div/>').addClass('alert alert-danger').html(html).appendTo('#files');\n } else {\n var html = '<b>'+file.name+'</b>';\n \$('<div/>').addClass('alert alert-success').html(html).appendTo('#files');\n \$('#{$this->id}').val(file.name);\n\n if (\$('#image{$this->id}') != null) {\n \$('#image{$this->id}').attr('src', file.url);\n }\n\n }\n });\n \$('#progress{$this->id}').removeClass('active');\n \$('#progress-outer{$this->id}').css('display', 'none');\n \$('#files-outer{$this->id}').css('display', 'block');\n\n if ('{$this->notify}' != '')\n \$('#{$this->notify}').data('control').update();\n\n\n }\n });\n "; }
/** * @param $text * @param $module * @param $action * @param array $param * @param string $css * @return DropdownControl */ public function addAppLink($text, $module, $action, $param = [], $css = '') { $link = Routing::appLink($module, $action, $param); return $this->addLink($text, $link, $css); }
public function editPage() { $this->page = new Page($this->request->id); $this->site = new Site($this->page->pa_site); // TODO Routing::resetBreadcrumbs(); Routing::addBreadcrumb('Struktur', '/site/showSite'); Routing::addBreadcrumb($this->site->si_bezeichnung, '/site/showPage/site/' . $this->site->id); Routing::addBreadcrumb($this->page->pa_bezeichnung); }
public function toHtml() { $caption = $this->caption; $link = ''; if ($this->icon !== '' && $this->iconPosition === self::ICON_LEFT) { $caption = '<span class="glyphicon glyphicon-' . $this->icon . '"></span> ' . $caption; } if ($this->icon !== '' && $this->iconPosition === self::ICON_RIGHT) { $caption = $caption . ' <span class="glyphicon glyphicon-' . $this->icon . '"></span>'; } if (!$this->isSubmit && !isset($this->onClick)) { $link = Routing::appLink($this->module, $this->action, $this->parameter); } // Link if ($this->useAnchor) { $html = Html::create('a')->attr('role', 'button')->attr('href', $link)->text($caption); if ($this->target != null) { $html->addAttribute('target', $this->target); } if ($this->disabled) { $html->addCssclass('disabled'); } // Submit } elseif ($this->isSubmit) { $html = Html::createElement('button'); $html->addAttribute('type', 'submit')->addInnerHtml($caption); if ($this->disabled) { $html->addAttribute('disabled', 'disabled'); } // Button als Link } elseif (!isset($this->onClick)) { $html = Html::createElement('button'); $html->addAttribute('type', 'button')->addAttribute('onClick', "location.href='{$link}'")->addInnerHtml($caption); if ($this->disabled) { $html->addAttribute('disabled', 'disabled'); } } else { $html = Html::createElement('button'); $html->addAttribute('type', 'button')->addAttribute('onClick', $this->onClick)->addInnerHtml($caption); if ($this->disabled) { $html->addAttribute('disabled', 'disabled'); } } if (isset($this->dataTarget)) { $html->data('target', $this->dataTarget); } $html->attr('id', $this->id)->attr('title', $this->title)->css($this->cssClasses)->css('btn')->css('btn-' . $this->buttonClass); if ($this->size !== self::SIZE_DEFAULT) { $html->css('btn-' . $this->size); } return $html->render() . ' '; }