PageRenderTime 42ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/src/administrator/templates/isis/login.php

https://bitbucket.org/ke2083/transfans.co.uk-website
PHP | 139 lines | 99 code | 19 blank | 21 comment | 6 complexity | 713979367bbb9a3d2fe69dc79c2fabb8 MD5 | raw file
  1. <?php
  2. /**
  3. * @package Joomla.Administrator
  4. * @subpackage Templates.isis
  5. *
  6. * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
  7. * @license GNU General Public License version 2 or later; see LICENSE.txt
  8. */
  9. defined('_JEXEC') or die;
  10. /** @var JDocumentHtml $this */
  11. $app = JFactory::getApplication();
  12. $lang = JFactory::getLanguage();
  13. // Output as HTML5
  14. $this->setHtml5(true);
  15. // Gets the FrontEnd Main page Uri
  16. $frontEndUri = JUri::getInstance(JUri::root());
  17. $frontEndUri->setScheme(((int) $app->get('force_ssl', 0) === 2) ? 'https' : 'http');
  18. // Color Params
  19. $background_color = $this->params->get('loginBackgroundColor') ?: '';
  20. $color_is_light = $background_color && colorIsLight($background_color);
  21. // Add JavaScript Frameworks
  22. JHtml::_('bootstrap.framework');
  23. JHtml::_('bootstrap.tooltip');
  24. // Add html5 shiv
  25. JHtml::_('script', 'jui/html5.js', array('version' => 'auto', 'relative' => true, 'conditional' => 'lt IE 9'));
  26. // Add Stylesheets
  27. JHtml::_('stylesheet', 'template' . ($this->direction === 'rtl' ? '-rtl' : '') . '.css', array('version' => 'auto', 'relative' => true));
  28. // Load optional RTL Bootstrap CSS
  29. JHtml::_('bootstrap.loadCss', false, $this->direction);
  30. // Load specific language related CSS
  31. JHtml::_('stylesheet', 'administrator/language/' . $lang->getTag() . '/' . $lang->getTag() . '.css', array('version' => 'auto'));
  32. // Load custom.css
  33. JHtml::_('stylesheet', 'custom.css', array('version' => 'auto', 'relative' => true));
  34. // Detecting Active Variables
  35. $option = $app->input->getCmd('option', '');
  36. $view = $app->input->getCmd('view', '');
  37. $layout = $app->input->getCmd('layout', '');
  38. $task = $app->input->getCmd('task', '');
  39. $itemid = $app->input->getCmd('Itemid', '');
  40. $sitename = htmlspecialchars($app->get('sitename', ''), ENT_QUOTES, 'UTF-8');
  41. function colorIsLight($color)
  42. {
  43. $r = hexdec(substr($color, 1, 2));
  44. $g = hexdec(substr($color, 3, 2));
  45. $b = hexdec(substr($color, 5, 2));
  46. $yiq = (($r * 299) + ($g * 587) + ($b * 114)) / 1000;
  47. return $yiq >= 200;
  48. }
  49. // Background color
  50. if ($background_color)
  51. {
  52. $this->addStyleDeclaration('
  53. .view-login {
  54. background-color: ' . $background_color . ';
  55. }');
  56. }
  57. // Responsive Styles
  58. $this->addStyleDeclaration('
  59. @media (max-width: 480px) {
  60. .view-login .container {
  61. margin-top: -170px;
  62. }
  63. .btn {
  64. font-size: 13px;
  65. padding: 4px 10px 4px;
  66. }
  67. }');
  68. // Check if debug is on
  69. if (JPluginHelper::isEnabled('system', 'debug') && ($app->get('debug_lang', 0) || $app->get('debug', 0)))
  70. {
  71. $this->addStyleDeclaration('
  72. .view-login .container {
  73. position: static;
  74. margin-top: 20px;
  75. margin-left: auto;
  76. margin-right: auto;
  77. }
  78. .view-login .navbar-fixed-bottom {
  79. position: relative;
  80. }');
  81. }
  82. ?>
  83. <!DOCTYPE html>
  84. <html lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
  85. <head>
  86. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  87. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  88. <jdoc:include type="head" />
  89. </head>
  90. <body class="site <?php echo $option . ' view-' . $view . ' layout-' . $layout . ' task-' . $task . ' itemid-' . $itemid . ' '; ?>">
  91. <!-- Container -->
  92. <div class="container">
  93. <div id="content">
  94. <!-- Begin Content -->
  95. <div id="element-box" class="login well">
  96. <?php if ($loginLogoFile = $this->params->get('loginLogoFile')) : ?>
  97. <img src="<?php echo JUri::root() . $loginLogoFile; ?>" alt="<?php echo $sitename; ?>" />
  98. <?php else: ?>
  99. <img src="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/images/joomla.png" alt="<?php echo $sitename; ?>" />
  100. <?php endif; ?>
  101. <hr />
  102. <jdoc:include type="message" />
  103. <jdoc:include type="component" />
  104. </div>
  105. <noscript>
  106. <?php echo JText::_('JGLOBAL_WARNJAVASCRIPT'); ?>
  107. </noscript>
  108. <!-- End Content -->
  109. </div>
  110. </div>
  111. <div class="navbar<?php echo $color_is_light ? ' navbar-inverse' : ''; ?> navbar-fixed-bottom hidden-phone">
  112. <p class="pull-right">
  113. &copy; <?php echo date('Y'); ?> <?php echo $sitename; ?>
  114. </p>
  115. <a class="login-joomla hasTooltip" href="https://www.joomla.org" target="_blank" rel="noopener noreferrer" title="<?php echo JHtml::_('tooltipText', 'TPL_ISIS_ISFREESOFTWARE'); ?>"><span class="icon-joomla"></span></a>
  116. <a href="<?php echo $frontEndUri->toString(); ?>" target="_blank" class="pull-left"><span class="icon-out-2"></span><?php echo JText::_('COM_LOGIN_RETURN_TO_SITE_HOME_PAGE'); ?></a>
  117. </div>
  118. <jdoc:include type="modules" name="debug" style="none" />
  119. </body>
  120. </html>