From 655a932e45d2c738e1a5a53f1271cffe3a35cdcb Mon Sep 17 00:00:00 2001 From: andrepereiradasilva Date: Thu, 26 May 2016 20:05:39 +0100 Subject: [PATCH 1/2] site system to html5 --- templates/system/component.php | 14 +++++++++++--- templates/system/error.php | 21 ++++++++++++++------- templates/system/offline.php | 24 +++++++++++++++++------- 3 files changed, 42 insertions(+), 17 deletions(-) diff --git a/templates/system/component.php b/templates/system/component.php index 7a8c78835b5a1..4f0d5ebfe5d4a 100644 --- a/templates/system/component.php +++ b/templates/system/component.php @@ -8,12 +8,20 @@ */ defined('_JEXEC') or die; + +$doc = JFactory::getDocument(); + +// Output as HTML5 +$doc->setHtml5(true); + +// Styles +$doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/general.css'); ?> - - + + - + diff --git a/templates/system/error.php b/templates/system/error.php index 1ff6de05206c4..8ce61fadb2f39 100644 --- a/templates/system/error.php +++ b/templates/system/error.php @@ -20,19 +20,26 @@ $app = JFactory::getApplication(); $this->language = $doc->language; $this->direction = $doc->direction; + +// Output document as HTML5. +if (is_callable(array($doc, 'setHtml5'))) +{ + $doc->setHtml5(true); +} ?> - - + + - + <?php echo $this->error->getCode(); ?> - <?php echo htmlspecialchars($this->error->getMessage(), ENT_QUOTES, 'UTF-8'); ?> - + direction == 'rtl') : ?> - + get('debug_lang', '0') == '1' || $app->get('debug', '0') == '1') : ?> - + +
@@ -51,7 +58,7 @@

    -
  • +

diff --git a/templates/system/offline.php b/templates/system/offline.php index ca7ef5bfd5317..56e4980cf5eb1 100644 --- a/templates/system/offline.php +++ b/templates/system/offline.php @@ -10,6 +10,20 @@ defined('_JEXEC') or die; $app = JFactory::getApplication(); +$doc = JFactory::getDocument(); + +// Output as HTML5 +$doc->setHtml5(true); + +// Styles +$doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/offline.css'); + +if ($this->direction == 'rtl') +{ + $doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/offline_rtl.css'); +} + +$doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/general.css'); // Add JavaScript Frameworks JHtml::_('bootstrap.framework'); @@ -19,18 +33,14 @@ $twofactormethods = UsersHelper::getTwoFactorMethods(); ?> - + - - direction == 'rtl') : ?> - - - + - +
get('offline_image') && file_exists($app->get('offline_image'))) : ?> <?php echo htmlspecialchars($app->get('sitename'), ENT_COMPAT, 'UTF-8'); ?> From e4834ef163c6192258c0de6cbb504ce20981b755 Mon Sep 17 00:00:00 2001 From: andrepereiradasilva Date: Fri, 17 Jun 2016 12:02:47 +0100 Subject: [PATCH 2/2] use $this instead of $doc --- templates/system/component.php | 6 ++---- templates/system/error.php | 11 +---------- templates/system/offline.php | 9 ++++----- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/templates/system/component.php b/templates/system/component.php index 4f0d5ebfe5d4a..a6105d844f6a7 100644 --- a/templates/system/component.php +++ b/templates/system/component.php @@ -9,13 +9,11 @@ defined('_JEXEC') or die; -$doc = JFactory::getDocument(); - // Output as HTML5 -$doc->setHtml5(true); +$this->setHtml5(true); // Styles -$doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/general.css'); +$this->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/general.css'); ?> diff --git a/templates/system/error.php b/templates/system/error.php index 8ce61fadb2f39..a6fbb4ee84db9 100644 --- a/templates/system/error.php +++ b/templates/system/error.php @@ -16,16 +16,7 @@ } // Get language and direction -$doc = JFactory::getDocument(); -$app = JFactory::getApplication(); -$this->language = $doc->language; -$this->direction = $doc->direction; - -// Output document as HTML5. -if (is_callable(array($doc, 'setHtml5'))) -{ - $doc->setHtml5(true); -} +$app = JFactory::getApplication(); ?> diff --git a/templates/system/offline.php b/templates/system/offline.php index 56e4980cf5eb1..ef101894af069 100644 --- a/templates/system/offline.php +++ b/templates/system/offline.php @@ -10,20 +10,19 @@ defined('_JEXEC') or die; $app = JFactory::getApplication(); -$doc = JFactory::getDocument(); // Output as HTML5 -$doc->setHtml5(true); +$this->setHtml5(true); // Styles -$doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/offline.css'); +$this->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/offline.css'); if ($this->direction == 'rtl') { - $doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/offline_rtl.css'); + $this->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/offline_rtl.css'); } -$doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/general.css'); +$this->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/general.css'); // Add JavaScript Frameworks JHtml::_('bootstrap.framework');