/** * This method initializes the `$result`, `$sort` and `$order` variables by using the * `$_REQUEST` array. The `$result` is passed by reference, and is return of calling the * `$object->sort()` method. It is this method that actually invokes the sorting inside * the `$object`. * * @param HTMLPage $object * The object responsible for sorting the items. It must implement a `sort()` method. * @param array $result * This variable stores an array sorted objects. Once set, its value is available * to the client class of Sortable. * @param string $sort * This variable stores the field (or axis) the objects are sorted by. Once set, * its value is available to the client class of `Sortable`. * @param string $order * This variable stores the sort order (i.e. 'asc' or 'desc'). Once set, its value * is available to the client class of Sortable. * @param array $params (optional) * An array of parameters that can be passed to the context-based method. */ public static function initialize(HTMLPage $object, &$result, &$sort, &$order, array $params = array()) { if (isset($_REQUEST['sort'])) { $sort = $_REQUEST['sort']; } else { $sort = null; } if (isset($_REQUEST['order'])) { $order = $_REQUEST['order'] == 'desc' ? 'desc' : 'asc'; } else { $order = null; } $result = $object->sort($sort, $order, $params); }
/** * Called by index.php, this function is responsible for rendering the current * page on the Frontend. Two delegates are fired, AdminPagePreGenerate and * AdminPagePostGenerate. This function runs the Profiler for the page build * process. * * @uses AdminPagePreGenerate * @uses AdminPagePostGenerate * @see core.Symphony#__buildPage() * @see boot.getCurrentPage() * @param string $page * The result of getCurrentPage, which returns the $_GET['symphony-page'] * variable. * @throws Exception * @throws SymphonyErrorPage * @return string * The HTML of the page to return */ public function display($page) { Symphony::Profiler()->sample('Page build process started'); $this->__buildPage($page); // Add XSRF token to form's in the backend if (self::isXSRFEnabled() && isset($this->Page->Form)) { $this->Page->Form->prependChild(XSRF::formToken()); } /** * Immediately before generating the admin page. Provided with the page object * @delegate AdminPagePreGenerate * @param string $context * '/backend/' * @param HTMLPage $oPage * An instance of the current page to be rendered, this will usually be a class that * extends HTMLPage. The Symphony backend uses a convention of contentPageName * as the class that extends the HTMLPage */ Symphony::ExtensionManager()->notifyMembers('AdminPagePreGenerate', '/backend/', array('oPage' => &$this->Page)); $output = $this->Page->generate(); /** * Immediately after generating the admin page. Provided with string containing page source * @delegate AdminPagePostGenerate * @param string $context * '/backend/' * @param string $output * The resulting backend page HTML as a string, passed by reference */ Symphony::ExtensionManager()->notifyMembers('AdminPagePostGenerate', '/backend/', array('output' => &$output)); Symphony::Profiler()->sample('Page built'); return $output; }
function __construct(&$parent) { parent::__construct(); $this->Html->setElementStyle('html'); $this->_Parent = $parent; $this->_navigation = array(); $this->Alert = NULL; }
public function __construct($html, $encoding, $pageNumber, $paragraphsPerPage = HTMLPager::PARAGRAPH_LIMIT) { $dom = new DOMDocument(); libxml_use_internal_errors(true); libxml_clear_errors(); // clean up any errors belonging to other operations $dom->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', $encoding)); foreach (libxml_get_errors() as $error) { Kurogo::log(LOG_WARNING, "HTMLPager got loadHTML warning (line {$error->line}; column {$error->column}) {$error->message}", 'data'); } libxml_clear_errors(); // free up memory associated with the errors libxml_use_internal_errors(false); $body = $dom->getElementsByTagName("body")->item(0); $currentPage = NULL; $pages = array(); $currentParagraphCount = 0; foreach ($body->childNodes as $node) { if ($currentPage == NULL) { // need to start a new page if ($node->nodeName == "#text" && trim($node->nodeValue) == "") { continue; // this node is blank so do not start a new page yet } $currentPage = new HTMLPage(); $pages[] = $currentPage; } $currentPage->addNode($node); if ($node->nodeName == "p") { $currentParagraphCount++; } if ($currentParagraphCount == $paragraphsPerPage) { $currentPage = NULL; $currentParagraphCount = 0; } } $this->pages = $pages; $this->pageCount = count($pages); if ($pageNumber >= 0 && $pageNumber < $this->pageCount) { $this->pageNumber = $pageNumber; } }
public function __construct(Site $site, $url = null) { if (!isset($url)) { $url = $site->requestUrl; } $template = $site->modules->getModulePrefix('PageSystem') . '/page/nopage'; parent::__construct($site, null, $template, array('status' => '404 Not Found', 'requestUrl' => $url)); $this->headers->setContentTypeCharset('utf-8'); $this->headers->setStatus(404, 'Not Found'); $this->title = $this->headers->getStatus(); }
public function __construct(&$parent) { parent::__construct($parent); $this->addHeaderToPage('Content-Type', 'text/html; charset=UTF-8'); $this->Html->setElementStyle('html'); $this->Html->setDTD('<!DOCTYPE html>'); //PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd" $this->Html->setAttribute('lang', Lang::get()); $this->addElementToHead(new XMLElement('meta', NULL, array('http-equiv' => 'Content-Type', 'content' => 'text/html; charset=UTF-8')), 0); $this->addStylesheetToHead(SYMPHONY_URL . '/assets/basic.css', 'screen', 40); $this->addStylesheetToHead(SYMPHONY_URL . '/assets/login.css', 'screen', 40); $this->setTitle(__('%1$s – %2$s', array(__('Symphony'), __('Login')))); Administration::instance()->Profiler->sample('Page template created', PROFILE_LAP); }
public function __construct() { parent::__construct(); $this->addHeaderToPage('Content-Type', 'text/html; charset=UTF-8'); $this->Html->setElementStyle('html'); $this->Html->setDTD('<!DOCTYPE html>'); $this->Html->setAttribute('lang', Lang::get()); $this->addElementToHead(new XMLElement('meta', null, array('charset' => 'UTF-8')), 0); $this->addElementToHead(new XMLElement('meta', null, array('http-equiv' => 'X-UA-Compatible', 'content' => 'IE=edge,chrome=1')), 1); $this->addElementToHead(new XMLElement('meta', null, array('name' => 'viewport', 'content' => 'width=device-width, initial-scale=1')), 2); $this->addStylesheetToHead(APPLICATION_URL . '/assets/css/symphony.min.css', 'screen', null, false); $this->setTitle(__('%1$s – %2$s', array(__('Login'), Symphony::Configuration()->get('sitename', 'general')))); $this->Body->setAttribute('id', 'login'); Symphony::Profiler()->sample('Page template created', PROFILE_LAP); }
function __construct(&$parent) { parent::__construct(); $this->_Parent = $parent; $this->_invalidPassword = false; $this->addHeaderToPage('Content-Type', 'text/html; charset=UTF-8'); $this->Html->setElementStyle('html'); $this->Html->setDTD('<!DOCTYPE html>'); //PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd" $this->Html->setAttribute('lang', __LANG__); $this->addElementToHead(new XMLElement('meta', NULL, array('http-equiv' => 'Content-Type', 'content' => 'text/html; charset=UTF-8')), 0); $this->addStylesheetToHead(URL . '/symphony/assets/login.css', 'screen', 40); $this->setTitle(__('%1$s – %2$s', array(__('Symphony'), __('Login')))); $this->_Parent->Profiler->sample('Page template created', PROFILE_LAP); }
function __construct(&$parent) { parent::__construct(); $this->_Parent = $parent; $this->_invalidPassword = false; $this->addHeaderToPage('Content-Type', 'text/html; charset=UTF-8'); $this->Html->setElementStyle('html'); $this->Html->setDTD('<!DOCTYPE html>'); //PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd" $this->Html->setAttribute('lang', __LANG__); $this->addElementToHead(new XMLElement('meta', NULL, array('http-equiv' => 'Content-Type', 'content' => 'text/html; charset=UTF-8')), 0); $this->addElementToHead(new XMLElement('link', NULL, array('rel' => 'icon', 'href' => URL . '/symphony/assets/images/bookmark.png', 'type' => 'image/png')), 20); $this->addStylesheetToHead(URL . '/symphony/assets/login.css', 'screen', 40); $this->addElementToHead(new XMLElement('!--[if IE]><link rel="stylesheet" href="' . URL . '/symphony/assets/legacy.css" type="text/css"><![endif]--'), 50); $this->addScriptToHead(URL . '/symphony/assets/admin.js', 60); $this->setTitle(__('%1$s – %2$s', array(__('Symphony'), __('Login')))); $this->_Parent->Profiler->sample('Page template created', PROFILE_LAP); }
public function index() { if ($post = $this->input->post('contact')) { $validation = new Validation($post); $validation->pre_filter('trim')->add_rules('email', 'email', 'required')->add_rules('subject', 'required')->add_rules('body', 'required'); if (!$validation->validate()) { return $this->template->content = Kohana::debug($validation->errors()); } $post = $validation->as_array(); $message = sprintf("%s used the contact form to say: \n\n %s", $post['email'], $post['body']); $subject = sprintf('[ProjectsLounge Contact] %s', $post['subject']); email::send('*****@*****.**', '*****@*****.**', $subject, $message); return url::redirect('contact/thanks'); } HTMLPage::add_style('forms'); HTMLPage::add_style('contact'); $this->template->content = View::factory('contact/form'); }
protected function __build($version = VERSION, XMLElement $extra = null) { parent::__build(); $this->Form = Widget::Form(INSTALL_URL . '/index.php', 'post'); $title = new XMLElement('h1', $this->_page_title); $version = new XMLElement('em', __('Version %s', array($version))); $title->appendChild($version); if (!is_null($extra)) { $title->appendChild($extra); } $this->Form->appendChild($title); if (isset($this->_params['show-languages']) && $this->_params['show-languages']) { $languages = new XMLElement('ul'); foreach (Lang::getAvailableLanguages(false) as $code => $lang) { $languages->appendChild(new XMLElement('li', Widget::Anchor($lang, '?lang=' . $code), $_REQUEST['lang'] == $code || $_REQUEST['lang'] == null && $code == 'en' ? array('class' => 'selected') : array())); } $languages->appendChild(new XMLElement('li', Widget::Anchor(__('Symphony is also available in other languages'), 'http://getsymphony.com/download/extensions/translations/'), array('class' => 'more'))); $this->Form->appendChild($languages); } $this->Body->appendChild($this->Form); $function = 'view' . str_replace('-', '', ucfirst($this->_template)); $this->{$function}(); }
<?php include_once TOOLKIT . '/class.htmlpage.php'; $Page = new HTMLPage(); $Page->Html->setElementStyle('html'); $Page->Html->setDTD('<!DOCTYPE html>'); $Page->Html->setAttribute('xml:lang', 'en'); $Page->addElementToHead(new XMLElement('meta', NULL, array('http-equiv' => 'Content-Type', 'content' => 'text/html; charset=UTF-8')), 0); $Page->addStylesheetToHead(URL . '/symphony/assets/error.css', 'screen', 30); $Page->addHeaderToPage('HTTP/1.0 500 Server Error'); $Page->addHeaderToPage('Content-Type', 'text/html; charset=UTF-8'); $Page->addHeaderToPage('Symphony-Error-Type', 'database'); $Page->setTitle(__('%1$s – %2$s', array(__('Symphony'), __('Database Error')))); $div = new XMLElement('div', NULL, array('id' => 'description')); $div->appendChild(new XMLElement('h1', __('Symphony Database Error'))); $div->appendChild(new XMLElement('p', $additional['message'])); $div->appendChild(new XMLElement('p', '<code>' . $additional['error']['num'] . ': ' . $additional['error']['msg'] . '</code>')); if (!empty($error['query'])) { $div->appendChild(new XMLElement('p', '<code>' . $additional['error']['query'] . '</code>')); } $Page->Body->appendChild($div); print $Page->generate(); exit;
function generate($page, $xml, $xsl, $output, $parameters) { $this->addHeaderToPage('Content-Type', 'text/html; charset=UTF-8'); $this->Html->setElementStyle('html'); $this->Html->setDTD('<!DOCTYPE html>'); //PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd" $this->Html->setAttribute('lang', __LANG__); $this->addElementToHead(new XMLElement('meta', NULL, array('http-equiv' => 'Content-Type', 'content' => 'text/html; charset=UTF-8')), 0); $this->addElementToHead(new XMLElement('link', NULL, array('rel' => 'icon', 'href' => URL . '/symphony/assets/images/bookmark.png', 'type' => 'image/png')), 20); $this->addStylesheetToHead(URL . '/symphony/assets/debug.css', 'screen', 40); $this->addElementToHead(new XMLElement('!--[if IE]><link rel="stylesheet" href="' . URL . '/symphony/assets/legacy.css" type="text/css"><![endif]--'), 50); $this->addScriptToHead(URL . '/symphony/assets/admin.js', 60); $this->setTitle(__('%1$s – %2$s – %3$s', array(__('Symphony'), __('Debug'), $page['title']))); $h1 = new XMLElement('h1'); $h1->appendChild(Widget::Anchor($page['title'], $this->_query_string ? '?' . trim($this->_query_string, '&') : '.')); $this->Body->appendChild($h1); $this->Body->appendChild($this->__buildNavigation($page)); $utilities = $this->__findUtilitiesInXSL($xsl); $this->Body->appendChild($this->__buildJump($page, $xsl, $_GET['debug'], $utilities)); if ($_GET['debug'] == 'params') { $this->Body->appendChild($this->__buildParams($parameters)); } elseif ($_GET['debug'] == 'xml' || strlen(trim($_GET['debug'])) <= 0) { $this->Body->appendChildArray($this->__buildCodeBlock($xml, 'xml')); } elseif ($_GET['debug'] == 'result') { $this->Body->appendChildArray($this->__buildCodeBlock($output, 'result')); } else { if ($_GET['debug'] == basename($page['filelocation'])) { $this->Body->appendChildArray($this->__buildCodeBlock($xsl, basename($page['filelocation']))); } elseif ($_GET['debug'][0] == 'u') { if (is_array($this->_full_utility_list) && !empty($this->_full_utility_list)) { foreach ($this->_full_utility_list as $u) { if ($_GET['debug'] != 'u-' . basename($u)) { continue; } $this->Body->appendChildArray($this->__buildCodeBlock(@file_get_contents(UTILITIES . '/' . basename($u)), 'u-' . basename($u))); break; } } } } return parent::generate(); }
/** * Called when page is generated, this function calls each of the other * other functions in this page to build the Header, the Navigation, * the Jump menu and finally the content. This function calls it's parent * generate function * * @see toolkit.HTMLPage#generate() * @return string */ public function build() { $this->buildIncludes(); $header = new XMLElement('div'); $header->setAttribute('id', 'header'); $jump = new XMLElement('div'); $jump->setAttribute('id', 'jump'); $content = new XMLElement('div'); $content->setAttribute('id', 'content'); $this->buildHeader($header); $this->buildNavigation($header); $this->buildJump($jump); $header->appendChild($jump); $this->Body->appendChild($header); $this->buildContent($content); $this->Body->appendChild($content); return parent::generate(); }
/** * Appends the `$this->Header`, `$this->Contents` and `$this->Footer` * to `$this->Wrapper` before adding the ID and class attributes for * the `<body>` element. After this has completed the parent's generate * function is called which will convert the `XMLElement`'s into strings * ready for output * * @return string */ public function generate() { $this->Wrapper->appendChild($this->Header); $this->Wrapper->appendChild($this->Contents); $this->Wrapper->appendChild($this->Footer); $this->Body->appendChild($this->Wrapper); $this->__appendBodyId(); $this->__appendBodyClass($this->_context); return parent::generate(); }
function __construct(&$parent) { parent::__construct(); $this->_Parent = $parent; }
<?php include_once TOOLKIT . '/class.htmlpage.php'; $Page = new HTMLPage(); $Page->Html->setElementStyle('html'); $Page->Html->setDTD('<!DOCTYPE html>'); $Page->Html->setAttribute('xml:lang', 'en'); $Page->addElementToHead(new XMLElement('meta', NULL, array('http-equiv' => 'Content-Type', 'content' => 'text/html; charset=UTF-8')), 0); $Page->addStylesheetToHead(SYMPHONY_URL . '/assets/basic.css', 'screen', 30); $Page->addStylesheetToHead(SYMPHONY_URL . '/assets/error.css', 'screen', 30); $Page->addHeaderToPage('HTTP/1.0 500 Server Error'); $Page->addHeaderToPage('Content-Type', 'text/html; charset=UTF-8'); $Page->addHeaderToPage('Symphony-Error-Type', 'xslt'); $Page->setTitle(__('%1$s – %2$s', array(__('Symphony'), __('XSLT Processing Error')))); $div = new XMLElement('div', NULL, array('id' => 'description')); $div->appendChild(new XMLElement('h1', __('XSLT Processing Error'))); $div->appendChild(new XMLElement('p', __('This page could not be rendered due to the following XSLT processing errors.'))); $Page->Body->appendChild($div); $ul = new XMLElement('ul', NULL, array('id' => 'details')); $errors_grouped = array(); list($key, $val) = $e->getAdditional()->proc->getError(false, true); do { if (preg_match('/^loadXML\\(\\)/i', $val['message']) && preg_match_all('/line:\\s+(\\d+)/i', $val['message'], $matches)) { $errors_grouped['xml'][] = array('line' => $matches[1][0], 'raw' => $val); } elseif (preg_match_all('/pages\\/([^.\\/]+\\.xsl)\\s+line\\s+(\\d+)/i', $val['message'], $matches)) { $errors_grouped['page'][$matches[1][0]][] = array('line' => $matches[2][0], 'raw' => $val); } elseif (preg_match_all('/utilities\\/([^.\\/]+\\.xsl)\\s+line\\s+(\\d+)/i', $val['message'], $matches)) { $errors_grouped['utility'][$matches[1][0]][] = array('line' => $matches[2][0], 'raw' => $val); } else { $errors_grouped['general'][] = $val; }
public function edit($id) { $user = User_Model::current(); $project = ORM::factory('project', $id); if (!$user->loaded && $project->user_can($user, 'edit')) { return $this->template->content = 'oh, come on!'; } if ($post = $this->input->post('project')) { $validation = Projects_utils::projects_edit_validation($post); if (!$project->validate($validation, true)) { return $this->template->content = Kohana::debug($validation->errors()); } if ($additional_user_emails = $this->input->post('additional_user_emails')) { $additional_user_roles = $this->input->post('additional_user_roles'); foreach ($additional_user_emails as $email) { Profiles_utils::reserve_email_if_available($email); } $additional_users = array_combine($additional_user_emails, $additional_user_roles); $project->add_user_roles($additional_users); } url::redirect($project->local_url); } else { HTMLPage::add_style('forms'); $this->template->content = View::factory('projects/edit')->bind('project_types', Projects_utils::get_project_types_dropdown_array())->bind('project', $project)->bind('user', $user); } }
<?php include_once TOOLKIT . '/class.htmlpage.php'; $Page = new HTMLPage(); $Page->Html->setElementStyle('html'); $Page->Html->setDTD('<!DOCTYPE html>'); $Page->Html->setAttribute('xml:lang', 'en'); $Page->addElementToHead(new XMLElement('meta', NULL, array('http-equiv' => 'Content-Type', 'content' => 'text/html; charset=UTF-8')), 0); $Page->addElementToHead(new XMLElement('link', NULL, array('rel' => 'icon', 'href' => URL . '/symphony/assets/images/bookmark.png', 'type' => 'image/png')), 20); $Page->addStylesheetToHead(URL . '/symphony/assets/error.css', 'screen', 30); $Page->addHeaderToPage('HTTP/1.0 500 Server Error'); $Page->addHeaderToPage('Content-Type', 'text/html; charset=UTF-8'); $Page->addHeaderToPage('Symphony-Error-Type', 'generic'); if (isset($additional['header'])) { $Page->addHeaderToPage($additional['header']); } $Page->setTitle(__('%1$s – %2$s', array(__('Symphony'), $heading))); $div = new XMLElement('div', NULL, array('id' => 'description')); $div->appendChild(new XMLElement('h1', $heading)); $div->appendChild(is_object($errstr) ? $errstr : new XMLElement('p', trim($errstr))); $Page->Body->appendChild($div); print $Page->generate(); exit;
<?php include_once TOOLKIT . '/class.htmlpage.php'; $Page = new HTMLPage(); $Page->Html->setElementStyle('html'); $Page->Html->setDTD('<!DOCTYPE html>'); $Page->Html->setAttribute('xml:lang', 'en'); $Page->addElementToHead(new XMLElement('meta', NULL, array('http-equiv' => 'Content-Type', 'content' => 'text/html; charset=UTF-8')), 0); $Page->addStylesheetToHead(SYMPHONY_URL . '/assets/css/symphony.css', 'screen', 30); $Page->addStylesheetToHead(SYMPHONY_URL . '/assets/css/symphony.frames.css', 'screen', 31); $Page->addHeaderToPage('Status', '500 Internal Server Error', 500); $Page->addHeaderToPage('Content-Type', 'text/html; charset=UTF-8'); $Page->addHeaderToPage('Symphony-Error-Type', 'generic'); if (isset($e->getAdditional()->header)) { $Page->addHeaderToPage($e->getAdditional()->header); } $Page->setTitle(__('%1$s – %2$s', array(__('Symphony'), $e->getHeading()))); $Page->Body->setAttribute('id', 'error'); $div = new XMLElement('div', NULL, array('class' => 'frame')); $div->appendChild(new XMLElement('h1', $e->getHeading())); $div->appendChild($e->getMessageObject() instanceof XMLElement ? $e->getMessageObject() : new XMLElement('p', trim($e->getMessage()))); $Page->Body->appendChild($div); $output = $Page->generate(); header(sprintf('Content-Length: %d', strlen($output))); echo $output; exit;
<?php include_once TOOLKIT . '/class.htmlpage.php'; $Page = new HTMLPage(); $Page->Html->setElementStyle('html'); $Page->Html->setDTD('<!DOCTYPE html>'); $Page->Html->setAttribute('xml:lang', 'en'); $Page->addElementToHead(new XMLElement('meta', NULL, array('http-equiv' => 'Content-Type', 'content' => 'text/html; charset=UTF-8')), 0); $Page->addStylesheetToHead(URL . '/symphony/assets/error.css', 'screen', 30); $Page->addHeaderToPage('HTTP/1.0 500 Server Error'); $Page->addHeaderToPage('Content-Type', 'text/html; charset=UTF-8'); $Page->addHeaderToPage('Symphony-Error-Type', 'generic'); if (isset($e->getAdditional()->header)) { $Page->addHeaderToPage($e->getAdditional()->header); } $Page->setTitle(__('%1$s – %2$s', array(__('Symphony'), $e->getHeading()))); $div = new XMLElement('div', NULL, array('id' => 'description')); $div->appendChild(new XMLElement('h1', $e->getHeading())); $div->appendChild($e->getMessageObject() instanceof XMLElement ? $e->getMessageObject() : new XMLElement('p', trim($e->getMessage()))); $Page->Body->appendChild($div); $output = $Page->generate(); header(sprintf('Content-Length: %d', strlen($output))); echo $output; exit;
<?php include_once TOOLKIT . '/class.htmlpage.php'; $Page = new HTMLPage(); $Page->Html->setElementStyle('html'); $Page->Html->setDTD('<!DOCTYPE html>'); $Page->Html->setAttribute('xml:lang', 'en'); $Page->addElementToHead(new XMLElement('meta', null, array('http-equiv' => 'Content-Type', 'content' => 'text/html; charset=UTF-8')), 0); $Page->addStylesheetToHead(ASSETS_URL . '/css/symphony.min.css', 'screen', null, false); $Page->setHttpStatus($e->getHttpStatusCode()); $Page->addHeaderToPage('Content-Type', 'text/html; charset=UTF-8'); $Page->addHeaderToPage('Symphony-Error-Type', 'database'); if (isset($e->getAdditional()->header)) { $Page->addHeaderToPage($e->getAdditional()->header); } $Page->setTitle(__('%1$s – %2$s', array(__('Symphony'), __('Database Error')))); $Page->Body->setAttribute('id', 'error'); $div = new XMLElement('div', null, array('class' => 'frame')); $div->appendChild(new XMLElement('h1', __('Symphony Database Error'))); $div->appendChild(new XMLElement('p', $e->getAdditional()->message)); $div->appendChild(new XMLElement('p', '<code>' . $e->getAdditional()->error->getDatabaseErrorCode() . ': ' . $e->getAdditional()->error->getDatabaseErrorMessage() . '</code>')); $query = $e->getAdditional()->error->getQuery(); if (isset($query)) { $div->appendChild(new XMLElement('p', '<code>' . $e->getAdditional()->error->getQuery() . '</code>')); } $Page->Body->appendChild($div); $output = $Page->generate(); echo $output; exit;
public function getOutput() { //cria a barra superior $this->barraSuperior(); //cria a DIV que armazenar� todo o conte�do; $this->container(); //cria a DIV do conte�do esquerdo $this->leftContent(); //cria o menu do topo da p�gina $this->topHeader(); // cria a DIV de conte�do principal $this->content(); return parent::getOutput(); }
public function __construct(&$parent) { parent::__construct($parent); }
<?php include_once TOOLKIT . '/class.htmlpage.php'; $Page = new HTMLPage(); $Page->Html->setElementStyle('html'); $Page->Html->setDTD('<!DOCTYPE html>'); $Page->Html->setAttribute('xml:lang', 'en'); $Page->addElementToHead(new XMLElement('meta', NULL, array('http-equiv' => 'Content-Type', 'content' => 'text/html; charset=UTF-8')), 0); $Page->addElementToHead(new XMLElement('link', NULL, array('rel' => 'icon', 'href' => URL . '/symphony/assets/images/bookmark.png', 'type' => 'image/png')), 20); $Page->addStylesheetToHead(URL . '/symphony/assets/error.css', 'screen', 30); $Page->addElementToHead(new XMLElement('!--[if IE]><link rel="stylesheet" href="' . URL . '/symphony/assets/legacy.css" type="text/css"><![endif]--'), 40); $Page->addHeaderToPage('Content-Type', 'text/html; charset=UTF-8'); $Page->addHeaderToPage('Symphony-Error-Type', 'xslt'); $Page->setTitle(__('%1$s – %2$s', array(__('Symphony'), __('XSLT Processing Error')))); $div = new XMLElement('div', NULL, array('id' => 'description')); $div->appendChild(new XMLElement('h1', __('XSLT Processing Error'))); $div->appendChild(new XMLElement('p', __('This page could not be rendered due to the following XSLT processing errors.'))); $Page->Body->appendChild($div); $ul = new XMLElement('ul', NULL, array('id' => 'details')); $errors_grouped = array(); list($key, $val) = $additional['proc']->getError(false, true); do { if (preg_match('/^loadXML\\(\\)/i', $val['message']) && preg_match_all('/line:\\s+(\\d+)/i', $val['message'], $matches)) { $errors_grouped['xml'][] = array('line' => $matches[1][0], 'raw' => $val); } elseif (preg_match_all('/pages\\/([^.\\/]+\\.xsl)\\s+line\\s+(\\d+)/i', $val['message'], $matches)) { $errors_grouped['page'][$matches[1][0]][] = array('line' => $matches[2][0], 'raw' => $val); } elseif (preg_match_all('/utilities\\/([^.\\/]+\\.xsl)\\s+line\\s+(\\d+)/i', $val['message'], $matches)) { $errors_grouped['utility'][$matches[1][0]][] = array('line' => $matches[2][0], 'raw' => $val); } else { $errors_grouped['general'][] = $val; }
<!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <title>Projects Lounge</title> <?php echo html::stylesheet('media/css/style.css'); echo html::stylesheet(HTMLPage::$styles); ?> </head> <body class="<?php echo HTMLPage::body_class(); ?> "> <div id="wrapper"> <div id="header"> <a id="branding" href="<?php echo url::base(); ?> " title="Projects Lounge"><img src="<?php echo url::site('media/images/projectslounge.png'); ?> " alt="Projects Lounge" /></a> <form id="search" action="<?php echo url::site('search'); ?>
<?php include_once TOOLKIT . '/class.htmlpage.php'; $Page = new HTMLPage(); $Page->Html->setElementStyle('html'); $Page->Html->setDTD('<!DOCTYPE html>'); $Page->Html->setAttribute('xml:lang', 'en'); $Page->addElementToHead(new XMLElement('meta', NULL, array('http-equiv' => 'Content-Type', 'content' => 'text/html; charset=UTF-8')), 0); $Page->addElementToHead(new XMLElement('link', NULL, array('rel' => 'icon', 'href' => URL . '/symphony/assets/images/bookmark.png', 'type' => 'image/png')), 20); $Page->addStylesheetToHead(URL . '/symphony/assets/error.css', 'screen', 30); $Page->addElementToHead(new XMLElement('!--[if IE]><link rel="stylesheet" href="' . URL . '/symphony/assets/legacy.css" type="text/css"><![endif]--'), 40); $Page->addHeaderToPage('Content-Type', 'text/html; charset=UTF-8'); $Page->addHeaderToPage('Symphony-Error-Type', 'generic'); if (isset($additional['header'])) { $Page->addHeaderToPage($additional['header']); } $Page->setTitle(__('%1$s – %2$s', array(__('Symphony'), $heading))); $div = new XMLElement('div', NULL, array('id' => 'description')); $div->appendChild(new XMLElement('h1', $heading)); $div->appendChild(is_object($errstr) ? $errstr : new XMLElement('p', trim($errstr))); $Page->Body->appendChild($div); print $Page->generate(); exit;
<?php include_once TOOLKIT . '/class.htmlpage.php'; $Page = new HTMLPage(); $Page->Html->setElementStyle('html'); $Page->Html->setDTD('<!DOCTYPE html>'); $Page->Html->setAttribute('xml:lang', 'en'); $Page->addElementToHead(new XMLElement('meta', NULL, array('http-equiv' => 'Content-Type', 'content' => 'text/html; charset=UTF-8')), 0); $Page->addStylesheetToHead(APPLICATION_URL . '/assets/css/symphony.css', 'screen', 30); $Page->addStylesheetToHead(APPLICATION_URL . '/assets/css/symphony.frames.css', 'screen', 31); $Page->setHttpStatus($e->getHttpStatusCode()); $Page->addHeaderToPage('Content-Type', 'text/html; charset=UTF-8'); $Page->addHeaderToPage('Symphony-Error-Type', 'xslt'); $Page->setTitle(__('%1$s – %2$s', array(__('Symphony'), __('XSLT Processing Error')))); $Page->Body->setAttribute('id', 'fatalerror'); $div = new XMLElement('div', NULL, array('class' => 'frame')); $ul = new XMLElement('ul'); $li = new XMLElement('li'); $li->appendChild(new XMLElement('h1', __('XSLT Processing Error'))); $li->appendChild(new XMLElement('p', __('This page could not be rendered due to the following XSLT processing errors:'))); $ul->appendChild($li); $errors_grouped = array(); list($key, $val) = $e->getAdditional()->proc->getError(false, true); do { if (preg_match('/^loadXML\\(\\)/i', $val['message']) && preg_match_all('/line:\\s+(\\d+)/i', $val['message'], $matches)) { $errors_grouped['xml'][] = array('line' => $matches[1][0], 'raw' => $val); } elseif (preg_match_all('/pages\\/([^.\\/]+\\.xsl)\\s+line\\s+(\\d+)/i', $val['message'], $matches) || preg_match_all('/pages\\/([^.\\/]+\\.xsl):(\\d+):/i', $val['message'], $matches)) { $errors_grouped['page'][$matches[1][0]][] = array('line' => $matches[2][0], 'raw' => $val); } elseif (preg_match_all('/utilities\\/([^.\\/]+\\.xsl)\\s+line\\s+(\\d+)/i', $val['message'], $matches)) { $errors_grouped['utility'][$matches[1][0]][] = array('line' => $matches[2][0], 'raw' => $val); } else {
include_once TOOLKIT . '/class.htmlpage.php'; // The extension cannot be found, show an error message and // let the user remove or rename the extension folder. if (isset($_POST['extension-missing'])) { $name = $_POST['existing-folder']; if (isset($_POST['action']['delete'])) { Symphony::ExtensionManager()->cleanupDatabase(); } elseif (isset($_POST['action']['rename'])) { $path = ExtensionManager::__getDriverPath($name); if (!@rename(EXTENSIONS . '/' . $_POST['existing-folder'], EXTENSIONS . '/' . $_POST['new-folder'])) { Symphony::Engine()->throwCustomError(__('Could not find extension %s at location %s.', array('<code>' . $name . '</code>', '<code>' . $path . '</code>')), __('Symphony Extension Missing Error'), Page::HTTP_STATUS_ERROR, 'missing_extension', array('name' => $name, 'path' => $path, 'rename_failed' => true)); } } redirect(SYMPHONY_URL . '/system/extensions/'); } $Page = new HTMLPage(); $Page->Html->setElementStyle('html'); $Page->Html->setDTD('<!DOCTYPE html>'); $Page->Html->setAttribute('xml:lang', 'en'); $Page->addElementToHead(new XMLElement('meta', null, array('http-equiv' => 'Content-Type', 'content' => 'text/html; charset=UTF-8')), 0); $Page->addStylesheetToHead(APPLICATION_URL . '/assets/css/symphony.min.css', 'screen', null, false); $Page->setHttpStatus($e->getHttpStatusCode()); $Page->addHeaderToPage('Content-Type', 'text/html; charset=UTF-8'); $Page->addHeaderToPage('Symphony-Error-Type', 'missing-extension'); $Page->setTitle(__('%1$s – %2$s', array(__('Symphony'), $e->getHeading()))); $Page->Body->setAttribute('id', 'error'); $div = new XMLElement('div', null, array('class' => 'frame')); $div->appendChild(new XMLElement('h1', $e->getHeading())); $div->appendChild(new XMLElement('p', trim($e->getMessage()))); // Build the form, what it can do is yet to be determined $form = new XMLElement('form', null, array('action' => SYMPHONY_URL . '/system/extensions/', 'method' => 'post'));
/** * Appends the `$this->Header`, `$this->Context` and `$this->Contents` * to `$this->Wrapper` before adding the ID and class attributes for * the `<body>` element. This function will also place any Drawer elements * in their relevant positions in the page. After this has completed the * parent `generate()` is called which will convert the `XMLElement`'s * into strings ready for output. * * @see core.HTMLPage#generate() * @return string */ public function generate() { $this->Wrapper->appendChild($this->Header); // Add horizontal drawers (inside #context) if (isset($this->Drawer['horizontal'])) { $this->Context->appendChildArray($this->Drawer['horizontal']); } $this->Wrapper->appendChild($this->Context); // Add vertical-left drawers (between #context and #contents) if (isset($this->Drawer['vertical-left'])) { $this->Wrapper->appendChildArray($this->Drawer['vertical-left']); } // Add vertical-right drawers (after #contents) if (isset($this->Drawer['vertical-right'])) { $this->Wrapper->appendChildArray($this->Drawer['vertical-right']); } $this->Wrapper->appendChild($this->Contents); $this->Body->appendChild($this->Wrapper); $this->__appendBodyId(); $this->__appendBodyClass($this->_context); return parent::generate(); }