/** * Retrieves code for embedding widget in current view. * * @return string code embeddable in view */ public function getCode() { return strval($this->isListing() ? $this->getBrowser()->getCode() . markup::block(implode(' ', array_filter($this->panelControls)), 'panel') : $this->getForm()->getCode()); }
/** * Retrieves code for embedding widget in current view. * * @throws http_exception on trying to access missing page * @return string code embeddable in view */ public function getCode() { if ($this->mayEdit && $this->wantEdit) { return markup::h2(\de\toxa\txf\_L('Edit Page')) . $this->getEditor()->render(); } else { $page = $this->getPage(); if (!$page) { if ($this->mayEdit) { return markup::block(markup::emphasize(\de\toxa\txf\_L('Selected page does not exist, yet!')), 'missing-page-content') . ($this->editorUrl ? $this->getLinkToEditor() : ''); } throw new http_exception(404); } $content = markup::block($page->content, 'page-content'); if ($this->editorUrl && $this->mayEdit) { $content .= $this->getLinkToEditor(); } return $content; } }
public function getCode() { $code = markup::block($this->processInput()->code, 'view'); if (count($this->panel)) { if (is_array($this->panelSorting)) { data::rearrangeArray($this->panel, $this->panelSorting, true); } $code .= markup::block(implode("\n", $this->panel), 'panel'); } return $code; }