本文整理汇总了PHP中HTMLPage类的典型用法代码示例。如果您正苦于以下问题:PHP HTMLPage类的具体用法?PHP HTMLPage怎么用?PHP HTMLPage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HTMLPage类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: initialize
/**
* 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);
}
开发者ID:jurajkapsz,项目名称:symphony-2,代码行数:34,代码来源:class.sortable.php
示例2: display
/**
* 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;
}
开发者ID:valery,项目名称:symphony-2,代码行数:50,代码来源:class.administration.php
示例3: __construct
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;
}
}
开发者ID:nncsang,项目名称:Kurogo,代码行数:42,代码来源:HTMLPager.php
示例4: index
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('[email protected]', '[email protected]', $subject, $message);
return url::redirect('contact/thanks');
}
HTMLPage::add_style('forms');
HTMLPage::add_style('contact');
$this->template->content = View::factory('contact/form');
}
开发者ID:hdragomir,项目名称:ProjectsLounge,代码行数:18,代码来源:contact.php
示例5: HTMLPage
<?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;
开发者ID:bauhouse,项目名称:sym-spectrum,代码行数:23,代码来源:tpl.database-error.php
示例6: build
/**
* 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();
}
开发者ID:shobhalakshminarayana,项目名称:Bugaroo,代码行数:27,代码来源:class.devkit.php
示例7: HTMLPage
<?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;
}
开发者ID:benesch,项目名称:hilton-unar,代码行数:31,代码来源:tpl.xslt-error.php
示例8: edit
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);
}
}
开发者ID:hdragomir,项目名称:ProjectsLounge,代码行数:26,代码来源:projects.php
示例9: HTMLPage
<?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;
开发者ID:bauhouse,项目名称:sym-fluidgrids,代码行数:23,代码来源:tpl.error.php
示例10: HTMLPage
<?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;
开发者ID:bauhouse,项目名称:Piano-Sonata,代码行数:26,代码来源:usererror.generic.php
示例11: HTMLPage
<?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;
开发者ID:bauhouse,项目名称:sym-calendar,代码行数:24,代码来源:tpl.error.php
示例12: HTMLPage
<?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;
开发者ID:jurajkapsz,项目名称:symphony-2,代码行数:29,代码来源:usererror.database.php
示例13: HTMLPage
<?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;
}
开发者ID:bauhouse,项目名称:sym-fluid960gs,代码行数:31,代码来源:tpl.xslt-error.php
示例14:
<!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');
?>
开发者ID:hdragomir,项目名称:ProjectsLounge,代码行数:31,代码来源:template.php
示例15: HTMLPage
<?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;
开发者ID:bauhouse,项目名称:sym-fluid960gs,代码行数:23,代码来源:tpl.error.php
示例16: HTMLPage
<?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 {
开发者ID:davjand,项目名称:codecept-symphonycms-db,代码行数:31,代码来源:usererror.xslt.php
示例17: elseif
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'));
开发者ID:valery,项目名称:symphony-2,代码行数:31,代码来源:usererror.missing_extension.php
示例18: generate
/**
* 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();
}
开发者ID:nickdunn,项目名称:elasticsearch-surfin-shakespeare,代码行数:33,代码来源:class.administrationpage.php
示例19: array
function __construct(&$parent)
{
parent::__construct();
$this->Html->setElementStyle('html');
$this->_Parent = $parent;
$this->_navigation = array();
$this->Alert = NULL;
}
开发者ID:bauhouse,项目名称:sym-form-builder,代码行数:8,代码来源:class.administrationpage.php
示例20: __construct
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();
}
开发者ID:jcorbinredtree,项目名称:framework,代码行数:11,代码来源:NotFoundPage.php
注:本文中的HTMLPage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论