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

/joomla/administrator/templates/isis/index.php

https://gitlab.com/ricardosanchez/prueba
PHP | 344 lines | 289 code | 36 blank | 19 comment | 44 complexity | ddf262a51c7117862d1f90db243b26e9 MD5 | raw file
  1. <?php
  2. /**
  3. * @package Joomla.Administrator
  4. * @subpackage Templates.isis
  5. * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
  6. * @license GNU General Public License version 2 or later; see LICENSE.txt
  7. * @since 3.0
  8. */
  9. defined('_JEXEC') or die;
  10. $app = JFactory::getApplication();
  11. $doc = JFactory::getDocument();
  12. $lang = JFactory::getLanguage();
  13. $this->language = $doc->language;
  14. $this->direction = $doc->direction;
  15. $input = $app->input;
  16. $user = JFactory::getUser();
  17. // Add JavaScript Frameworks
  18. JHtml::_('bootstrap.framework');
  19. $doc->addScriptVersion($this->baseurl . '/templates/' . $this->template . '/js/template.js');
  20. // Add Stylesheets
  21. $doc->addStyleSheetVersion($this->baseurl . '/templates/' . $this->template . '/css/template' . ($this->direction == 'rtl' ? '-rtl' : '') . '.css');
  22. // Load custom.css
  23. $file = 'templates/' . $this->template . '/css/custom.css';
  24. if (is_file($file))
  25. {
  26. $doc->addStyleSheetVersion($file);
  27. }
  28. // Load specific language related CSS
  29. $file = 'language/' . $lang->getTag() . '/' . $lang->getTag() . '.css';
  30. if (is_file($file))
  31. {
  32. $doc->addStyleSheetVersion($file);
  33. }
  34. // Detecting Active Variables
  35. $option = $input->get('option', '');
  36. $view = $input->get('view', '');
  37. $layout = $input->get('layout', '');
  38. $task = $input->get('task', '');
  39. $itemid = $input->get('Itemid', '');
  40. $sitename = htmlspecialchars($app->get('sitename', ''), ENT_QUOTES, 'UTF-8');
  41. $cpanel = ($option === 'com_cpanel');
  42. $hidden = JFactory::getApplication()->input->get('hidemainmenu');
  43. $showSubmenu = false;
  44. $this->submenumodules = JModuleHelper::getModules('submenu');
  45. foreach ($this->submenumodules as $submenumodule)
  46. {
  47. $output = JModuleHelper::renderModule($submenumodule);
  48. if (strlen($output))
  49. {
  50. $showSubmenu = true;
  51. break;
  52. }
  53. }
  54. // Template Parameters
  55. $displayHeader = $this->params->get('displayHeader', '1');
  56. $statusFixed = $this->params->get('statusFixed', '1');
  57. $stickyToolbar = $this->params->get('stickyToolbar', '1');
  58. // Header classes
  59. $template_is_light = ($this->params->get('templateColor') && colorIsLight($this->params->get('templateColor')));
  60. $header_is_light = ($displayHeader && $this->params->get('headerColor') && colorIsLight($this->params->get('headerColor')));
  61. if ($displayHeader)
  62. {
  63. // Logo file
  64. if ($this->params->get('logoFile'))
  65. {
  66. $logo = JUri::root() . $this->params->get('logoFile');
  67. }
  68. else
  69. {
  70. $logo = $this->baseurl . '/templates/' . $this->template . '/images/logo' . ($header_is_light ? '-inverse' : '') . '.png';
  71. }
  72. }
  73. function colorIsLight($color)
  74. {
  75. $r = hexdec(substr($color, 1, 2));
  76. $g = hexdec(substr($color, 3, 2));
  77. $b = hexdec(substr($color, 5, 2));
  78. $yiq = (($r * 299) + ($g * 587) + ($b * 114)) / 1000;
  79. return $yiq >= 200;
  80. }
  81. ?>
  82. <!DOCTYPE html>
  83. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
  84. <head>
  85. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  86. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  87. <jdoc:include type="head" />
  88. <!-- Template color -->
  89. <?php if ($this->params->get('templateColor')) : ?>
  90. <style type="text/css">
  91. .navbar-inner, .navbar-inverse .navbar-inner, .dropdown-menu li > a:hover, .dropdown-menu .active > a, .dropdown-menu .active > a:hover, .navbar-inverse .nav li.dropdown.open > .dropdown-toggle, .navbar-inverse .nav li.dropdown.active > .dropdown-toggle, .navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle, #status.status-top {
  92. background: <?php echo $this->params->get('templateColor'); ?>;
  93. }
  94. </style>
  95. <?php endif; ?>
  96. <!-- Template header color -->
  97. <?php if ($displayHeader && $this->params->get('headerColor')) : ?>
  98. <style type="text/css">
  99. .header {
  100. background: <?php echo $this->params->get('headerColor'); ?>;
  101. }
  102. </style>
  103. <?php endif; ?>
  104. <!-- Sidebar background color -->
  105. <?php if ($this->params->get('sidebarColor')) : ?>
  106. <style type="text/css">
  107. .nav-list > .active > a, .nav-list > .active > a:hover {
  108. background: <?php echo $this->params->get('sidebarColor'); ?>;
  109. }
  110. </style>
  111. <?php endif; ?>
  112. <!-- Link color -->
  113. <?php if ($this->params->get('linkColor')) : ?>
  114. <style type="text/css">
  115. a, .j-toggle-sidebar-button
  116. {
  117. color: <?php echo $this->params->get('linkColor'); ?>;
  118. }
  119. </style>
  120. <?php endif; ?>
  121. <!--[if lt IE 9]>
  122. <script src="<?php echo JUri::root(true); ?>/media/jui/js/html5.js"></script>
  123. <![endif]-->
  124. </head>
  125. <body class="admin <?php echo $option . ' view-' . $view . ' layout-' . $layout . ' task-' . $task . ' itemid-' . $itemid; ?>">
  126. <!-- Top Navigation -->
  127. <nav class="navbar<?php echo $template_is_light ? '' : ' navbar-inverse'; ?> navbar-fixed-top">
  128. <div class="navbar-inner">
  129. <div class="container-fluid">
  130. <?php if ($this->params->get('admin_menus') != '0') : ?>
  131. <a href="#" class="btn btn-navbar collapsed" data-toggle="collapse" data-target=".nav-collapse">
  132. <span class="icon-bar"></span>
  133. <span class="icon-bar"></span>
  134. <span class="icon-bar"></span>
  135. </a>
  136. <?php endif; ?>
  137. <a class="admin-logo <?php echo ($hidden ? 'disabled' : ''); ?>" <?php echo ($hidden ? '' : 'href="' . $this->baseurl . '"'); ?>><span class="icon-joomla"></span></a>
  138. <a class="brand hidden-desktop hidden-tablet" href="<?php echo JUri::root(); ?>" title="<?php echo JText::sprintf('TPL_ISIS_PREVIEW', $sitename); ?>" target="_blank"><?php echo JHtml::_('string.truncate', $sitename, 14, false, false); ?>
  139. <span class="icon-out-2 small"></span></a>
  140. <div<?php echo ($this->params->get('admin_menus') != '0') ? ' class="nav-collapse collapse"' : ''; ?>>
  141. <jdoc:include type="modules" name="menu" style="none" />
  142. <ul class="nav nav-user<?php echo ($this->direction == 'rtl') ? ' pull-left' : ' pull-right'; ?>">
  143. <li class="dropdown">
  144. <a class="<?php echo ($hidden ? ' disabled' : 'dropdown-toggle'); ?>" data-toggle="<?php echo ($hidden ? '' : 'dropdown'); ?>" <?php echo ($hidden ? '' : 'href="#"'); ?>><span class="icon-cog"></span>
  145. <span class="caret"></span></a>
  146. <ul class="dropdown-menu">
  147. <?php if (!$hidden) : ?>
  148. <li>
  149. <span>
  150. <span class="icon-user"></span>
  151. <strong><?php echo $user->name; ?></strong>
  152. </span>
  153. </li>
  154. <li class="divider"></li>
  155. <li>
  156. <a href="index.php?option=com_admin&amp;task=profile.edit&amp;id=<?php echo $user->id; ?>"><?php echo JText::_('TPL_ISIS_EDIT_ACCOUNT'); ?></a>
  157. </li>
  158. <li class="divider"></li>
  159. <li class="">
  160. <a href="<?php echo JRoute::_('index.php?option=com_login&task=logout&' . JSession::getFormToken() . '=1'); ?>"><?php echo JText::_('TPL_ISIS_LOGOUT'); ?></a>
  161. </li>
  162. <?php endif; ?>
  163. </ul>
  164. </li>
  165. </ul>
  166. <a class="brand visible-desktop visible-tablet" href="<?php echo JUri::root(); ?>" title="<?php echo JText::sprintf('TPL_ISIS_PREVIEW', $sitename); ?>" target="_blank"><?php echo JHtml::_('string.truncate', $sitename, 14, false, false); ?>
  167. <span class="icon-out-2 small"></span></a>
  168. </div>
  169. <!--/.nav-collapse -->
  170. </div>
  171. </div>
  172. </nav>
  173. <!-- Header -->
  174. <?php if ($displayHeader) : ?>
  175. <header class="header<?php echo $header_is_light ? ' header-inverse' : ''; ?>">
  176. <div class="container-logo">
  177. <img src="<?php echo $logo; ?>" class="logo" alt="<?php echo $sitename;?>" />
  178. </div>
  179. <div class="container-title">
  180. <jdoc:include type="modules" name="title" />
  181. </div>
  182. </header>
  183. <?php endif; ?>
  184. <?php if ((!$statusFixed) && ($this->countModules('status'))) : ?>
  185. <!-- Begin Status Module -->
  186. <div id="status" class="navbar status-top hidden-phone">
  187. <div class="btn-toolbar">
  188. <jdoc:include type="modules" name="status" style="no" />
  189. </div>
  190. <div class="clearfix"></div>
  191. </div>
  192. <!-- End Status Module -->
  193. <?php endif; ?>
  194. <?php if (!$cpanel) : ?>
  195. <!-- Subheader -->
  196. <a class="btn btn-subhead" data-toggle="collapse" data-target=".subhead-collapse"><?php echo JText::_('TPL_ISIS_TOOLBAR'); ?>
  197. <span class="icon-wrench"></span></a>
  198. <div class="subhead-collapse collapse">
  199. <div class="subhead">
  200. <div class="container-fluid">
  201. <div id="container-collapse" class="container-collapse"></div>
  202. <div class="row-fluid">
  203. <div class="span12">
  204. <jdoc:include type="modules" name="toolbar" style="no" />
  205. </div>
  206. </div>
  207. </div>
  208. </div>
  209. </div>
  210. <?php else : ?>
  211. <div style="margin-bottom: 20px"></div>
  212. <?php endif; ?>
  213. <!-- container-fluid -->
  214. <div class="container-fluid container-main">
  215. <section id="content">
  216. <!-- Begin Content -->
  217. <jdoc:include type="modules" name="top" style="xhtml" />
  218. <div class="row-fluid">
  219. <?php if ($showSubmenu) : ?>
  220. <div class="span2">
  221. <jdoc:include type="modules" name="submenu" style="none" />
  222. </div>
  223. <div class="span10">
  224. <?php else : ?>
  225. <div class="span12">
  226. <?php endif; ?>
  227. <jdoc:include type="message" />
  228. <?php
  229. // Show the page title here if the header is hidden
  230. if (!$displayHeader) : ?>
  231. <h1 class="content-title"><?php echo JHtml::_('string.truncate', $app->JComponentTitle, 0, false, false); ?></h1>
  232. <?php endif; ?>
  233. <jdoc:include type="component" />
  234. </div>
  235. </div>
  236. <?php if ($this->countModules('bottom')) : ?>
  237. <jdoc:include type="modules" name="bottom" style="xhtml" />
  238. <?php endif; ?>
  239. <!-- End Content -->
  240. </section>
  241. <?php if (!$this->countModules('status') || (!$statusFixed && $this->countModules('status'))) : ?>
  242. <footer class="footer">
  243. <p align="center">
  244. <jdoc:include type="modules" name="footer" style="no" />
  245. &copy; <?php echo $sitename; ?> <?php echo date('Y'); ?></p>
  246. </footer>
  247. <?php endif; ?>
  248. </div>
  249. <?php if (($statusFixed) && ($this->countModules('status'))) : ?>
  250. <!-- Begin Status Module -->
  251. <div id="status" class="navbar navbar-fixed-bottom hidden-phone">
  252. <div class="btn-toolbar">
  253. <div class="btn-group pull-right">
  254. <p>
  255. <jdoc:include type="modules" name="footer" style="no" />
  256. &copy; <?php echo date('Y'); ?> <?php echo $sitename; ?>
  257. </p>
  258. </div>
  259. <jdoc:include type="modules" name="status" style="no" />
  260. </div>
  261. </div>
  262. <!-- End Status Module -->
  263. <?php endif; ?>
  264. <jdoc:include type="modules" name="debug" style="none" />
  265. <?php if ($stickyToolbar) : ?>
  266. <script>
  267. jQuery(function($)
  268. {
  269. var navTop;
  270. var isFixed = false;
  271. processScrollInit();
  272. processScroll();
  273. $(window).on('resize', processScrollInit);
  274. $(window).on('scroll', processScroll);
  275. function processScrollInit()
  276. {
  277. if ($('.subhead').length) {
  278. navTop = $('.subhead').length && $('.subhead').offset().top - <?php echo ($displayHeader || !$statusFixed) ? 30 : 20;?>;
  279. // Fix the container top
  280. $(".container-main").css("top", $('.subhead').height() + $('nav.navbar').height());
  281. // Only apply the scrollspy when the toolbar is not collapsed
  282. if (document.body.clientWidth > 480)
  283. {
  284. $('.subhead-collapse').height($('.subhead').height());
  285. $('.subhead').scrollspy({offset: {top: $('.subhead').offset().top - $('nav.navbar').height()}});
  286. }
  287. }
  288. }
  289. function processScroll()
  290. {
  291. if ($('.subhead').length) {
  292. var scrollTop = $(window).scrollTop();
  293. if (scrollTop >= navTop && !isFixed) {
  294. isFixed = true;
  295. $('.subhead').addClass('subhead-fixed');
  296. // Fix the container top
  297. $(".container-main").css("top", $('.subhead').height() + $('nav.navbar').height());
  298. } else if (scrollTop <= navTop && isFixed) {
  299. isFixed = false;
  300. $('.subhead').removeClass('subhead-fixed');
  301. }
  302. }
  303. }
  304. });
  305. </script>
  306. <?php endif; ?>
  307. </body>
  308. </html>