Skip to content
Browse files

splitt index.php into single files and remove params back from backen…

…d to code
  • Loading branch information...
1 parent 02d5539 commit 6fcf0b431e00d290d0b320f8f4de937274c88d36 @Helrunar committed Feb 27, 2012
Showing with 192 additions and 218 deletions.
  1. +10 −186 index.php
  2. +23 −0 template/body.php
  3. +41 −0 template/footer.php
  4. +18 −0 template/head.php
  5. +58 −0 template/header.php
  6. +0 −32 templateDetails.xml
  7. +42 −0 themeconfig.php
View
196 index.php
@@ -1,193 +1,17 @@
<?php
/**
* @package Joomla.Site
- * @subpackage Templates.ninesixtyj
+ * @subpackage Templates.ninesixtyj
* @copyright Copyright (C) 2011 Projekt Waterkant
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// no direct access
-defined( '_JEXEC' ) or die;
-
-// build the full path to the template files
-$templatePath = $this->baseurl.'/templates/'.$this->template; // template path
-
-// get the site name
-$config = JFactory::getConfig();
-$siteName = $config->get('config.sitename');
-
-// determine which positions we want to show
-$showLeftPosition = $this->countModules('left');
-$showRightPosition = $this->countModules('right');
-$showTopPosition = $this->countModules('top');
-$showTopmenuPosition = $this->countModules('topmenu');
-$showUser1User2User3Positions = $this->countModules('user1 or user2 or user3');
-$showUser1Position = $this->countModules('user1');
-$showUser2Position = $this->countModules('user2');
-$showUser3Position = $this->countModules('user3');
-$showUser4User5User6Positions = $this->countModules('user4 or user5 or user6');
-$showUser4Position = $this->countModules('user4');
-$showUser5Position = $this->countModules('user5');
-$showUser6Position = $this->countModules('user6');
-$showFooterPosition = $this->countModules('footer');
-
-// Set Container and Grid to grid-12 or grid-16
-$GridContainer = $this->params->get('grid');
-
-// defaults
-$leftPositionWidth = $rightPositionWidth = 0;
-// calculate column widths of positions left, component and right
-if ($showLeftPosition) {
- // Set the Grid to show left Position if countModules = TRUE
- $leftPositionWidth = $this->params->get('gridfirst');
-}
-
-if ($showRightPosition) {
- // Set the Grid to show right Position if countModules = TRUE
- $rightPositionWidth = $this->params->get('gridsecond');
-}
-
-$componentWidth = $GridContainer - $leftPositionWidth - $rightPositionWidth;
-
-?>
-<!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" >
-<head>
- <jdoc:include type="head" />
- <link rel="stylesheet" href="<?php echo $templatePath; ?>/css/reset.css" type="text/css" />
- <link rel="stylesheet" href="<?php echo $templatePath; ?>/css/text.css" type="text/css" />
- <link rel="stylesheet" href="<?php echo $templatePath; ?>/css/default.css" type="text/css" />
- <link rel="stylesheet" href="<?php echo $templatePath; ?>/css/grid/default/narrow/default-narrow-12.css" type="text/css" />
- <link rel="stylesheet" href="<?php echo $templatePath; ?>/css/grid/default/normal/default-normal-12.css" type="text/css" />
- <link rel="stylesheet" href="<?php echo $templatePath; ?>/css/clearfix.css" type="text/css" />
- <link rel="stylesheet" href="<?php echo $templatePath; ?>/css/template_css.css" type="text/css" />
- <!--[if lt IE 9]>
- <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
- <![endif]-->
-</head>
-
-<body>
-<div id="page-wrapper" class="page">
-
- <!-- ***************** top *************** -->
- <?php if ($showTopPosition) : ?>
- <div id="top-wrapper">
- <div class="top-wrapper-inner container-<?php echo $GridContainer; ?> region clearfix">
- <jdoc:include type="modules" name="top" style="box" />
- </div>
- </div>
- <?php endif; ?>
-
- <!-- ***************** header *************** -->
- <div id="header-wrapper">
- <div class="header-wrapper-inner container-<?php echo $GridContainer; ?> region header clearfix">
- <h1>
- <?php echo $siteName; ?>
- </h1>
- </div>
- </div>
-
- <!-- ***************** topmenu *************** -->
- <?php if ($showTopmenuPosition) : ?>
- <div id="topmenu-wrapper">
- <div class="topmenu-wrapper-inner container-<?php echo $GridContainer; ?> region clearfix">
- <jdoc:include type="modules" name="topmenu" style="container" />
- </div>
- </div>
- <?php endif; ?>
-
- <!-- ***************** user 1,2,3 *************** -->
- <?php if ($showUser1User2User3Positions) : ?>
- <div id="usertop-wrapper">
- <div class="usertop-wrapper-inner container-<?php echo $GridContainer; ?> region clearfix">
- <div class="grid-4 user-1">
- <?php if ($showUser1Position) : ?>
- <jdoc:include type="modules" name="user1" style="box" />
- <?php else : ?>
- &nbsp;
- <?php endif; ?>
- </div>
- <div class="grid-4 user-2">
- <?php if ($showUser2Position) : ?>
- <jdoc:include type="modules" name="user2" style="box" />
- <?php else : ?>
- &nbsp;
- <?php endif; ?>
- </div>
- <div class="grid-4 user-3">
- <?php if ($showUser3Position) : ?>
- <jdoc:include type="modules" name="user3" style="box" />
- <?php else : ?>
- &nbsp;
- <?php endif; ?>
- </div>
- </div>
- </div>
- <?php endif; ?>
-
- <!-- ***************** main *************** -->
- <div id="main-wrapper">
- <div class="main-wrapper-inner container-<?php echo $GridContainer; ?> region clearfix">
-
- <!-- ***************** left *************** -->
- <div class="grid-<?php echo $leftPositionWidth; ?> left">
- <jdoc:include type="modules" name="left" style="sidebar" />
- </div>
-
-
- <!-- ***************** content *************** -->
- <div class="grid-<?php echo $componentWidth; ?> content">
- <jdoc:include type="message" />
- <jdoc:include type="component" />
- </div>
-
- <!-- ***************** right *************** -->
- <?php if ($showRightPosition) : ?>
- <div class="grid-<?php echo $rightPositionWidth; ?> right">
- <jdoc:include type="modules" name="right" style="sidebar" />
- </div>
- <?php endif; ?>
- </div>
- </div>
-
- <!-- ***************** user 4,5,6 *************** -->
- <?php if ($showUser4User5User6Positions) : ?>
- <div id="userbottom-wrapper">
- <div class="userbottom-wrapper-inner container-<?php echo $GridContainer; ?> region clearfix">
- <div class="grid-4 user-4">
- <?php if ($showUser4Position) : ?>
- <jdoc:include type="modules" name="user4" style="box" />
- <?php else : ?>
- &nbsp;
- <?php endif; ?>
- </div>
- <div class="grid-4 user-5">
- <?php if ($showUser5Position) : ?>
- <jdoc:include type="modules" name="user5" style="box" />
- <?php else : ?>
- &nbsp;
- <?php endif; ?>
- </div>
- <div class="grid-4 user-6">
- <?php if ($showUser6Position) : ?>
- <jdoc:include type="modules" name="user6" style="box" />
- <?php else : ?>
- &nbsp;
- <?php endif; ?>
- </div>
- </div>
- </div>
- <?php endif; ?>
-
- <!-- ***************** footer *************** -->
- <?php if ($showFooterPosition) : ?>
- <div id="footer-wrapper">
- <div class="footer-wrapper-inner container-<?php echo $GridContainer; ?> region clearfix">
- <div class="grid-12 footer">
- <jdoc:include type="modules" name="footer" style="box" />
- </div>
- </div>
- </div>
- <?php endif; ?>
-</div>
-</body>
-</html>
+defined('_JEXEC') or die;
+
+// including all files we need
+require("themeconfig.php");
+require("template/head.php");
+require("template/header.php");
+require("template/body.php");
+require("template/footer.php");
+?>
View
23 template/body.php
@@ -0,0 +1,23 @@
+<div id="main-wrapper">
+ <div class="main-wrapper-inner container-<?php echo $GridContainer; ?> region clearfix">
+
+ <!-- ***************** left *************** -->
+ <div class="grid-<?php echo $leftPositionWidth; ?> left">
+ <jdoc:include type="modules" name="left" style="sidebar"/>
+ </div>
+
+
+ <!-- ***************** content *************** -->
+ <div class="grid-<?php echo $componentWidth; ?> content">
+ <jdoc:include type="message"/>
+ <jdoc:include type="component"/>
+ </div>
+
+ <!-- ***************** right *************** -->
+ <?php if ($showRightPosition) : ?>
+ <div class="grid-<?php echo $rightPositionWidth; ?> right">
+ <jdoc:include type="modules" name="right" style="sidebar"/>
+ </div>
+ <?php endif; ?>
+ </div>
+</div>
View
41 template/footer.php
@@ -0,0 +1,41 @@
+<?php if ($showUser4User5User6Positions) : ?>
+<div id="userbottom-wrapper">
+ <div class="userbottom-wrapper-inner container-<?php echo $GridContainer; ?> region clearfix">
+ <div class="grid-4 user-4">
+ <?php if ($showUser4Position) : ?>
+ <jdoc:include type="modules" name="user4" style="box"/>
+ <?php else : ?>
+ &nbsp;
+ <?php endif; ?>
+ </div>
+ <div class="grid-4 user-5">
+ <?php if ($showUser5Position) : ?>
+ <jdoc:include type="modules" name="user5" style="box"/>
+ <?php else : ?>
+ &nbsp;
+ <?php endif; ?>
+ </div>
+ <div class="grid-4 user-6">
+ <?php if ($showUser6Position) : ?>
+ <jdoc:include type="modules" name="user6" style="box"/>
+ <?php else : ?>
+ &nbsp;
+ <?php endif; ?>
+ </div>
+ </div>
+</div>
+<?php endif; ?>
+
+<!-- ***************** footer *************** -->
+<?php if ($showFooterPosition) : ?>
+<div id="footer-wrapper">
+ <div class="footer-wrapper-inner container-<?php echo $GridContainer; ?> region clearfix">
+ <div class="grid-12 footer">
+ <jdoc:include type="modules" name="footer" style="box"/>
+ </div>
+ </div>
+</div>
+<?php endif; ?>
+</div>
+</body>
+</html>
View
18 template/head.php
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>"
+ lang="<?php echo $this->language; ?>">
+<head>
+ <jdoc:include type="head"/>
+ <link rel="stylesheet" href="<?php echo $templatePath; ?>/css/reset.css" type="text/css"/>
+ <link rel="stylesheet" href="<?php echo $templatePath; ?>/css/text.css" type="text/css"/>
+ <link rel="stylesheet" href="<?php echo $templatePath; ?>/css/default.css" type="text/css"/>
+ <link rel="stylesheet" href="<?php echo $templatePath; ?>/css/grid/default/narrow/default-narrow-12.css"
+ type="text/css"/>
+ <link rel="stylesheet" href="<?php echo $templatePath; ?>/css/grid/default/normal/default-normal-12.css"
+ type="text/css"/>
+ <link rel="stylesheet" href="<?php echo $templatePath; ?>/css/clearfix.css" type="text/css"/>
+ <link rel="stylesheet" href="<?php echo $templatePath; ?>/css/template_css.css" type="text/css"/>
+ <!--[if lt IE 9]>
+ <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+</head>
View
58 template/header.php
@@ -0,0 +1,58 @@
+<body>
+<div id="page-wrapper" class="page">
+
+ <!-- ***************** top *************** -->
+<?php if ($showTopPosition) : ?>
+ <div id="top-wrapper">
+ <div class="top-wrapper-inner container-<?php echo $GridContainer; ?> region clearfix">
+ <jdoc:include type="modules" name="top" style="box"/>
+ </div>
+ </div>
+ <?php endif; ?>
+
+ <!-- ***************** header *************** -->
+ <div id="header-wrapper">
+ <div class="header-wrapper-inner container-<?php echo $GridContainer; ?> region header clearfix">
+ <h1>
+ <?php echo $siteName; ?>
+ </h1>
+ </div>
+ </div>
+
+ <!-- ***************** topmenu *************** -->
+<?php if ($showTopmenuPosition) : ?>
+ <div id="topmenu-wrapper">
+ <div class="topmenu-wrapper-inner container-<?php echo $GridContainer; ?> region clearfix">
+ <jdoc:include type="modules" name="topmenu" style="container"/>
+ </div>
+ </div>
+ <?php endif; ?>
+
+ <!-- ***************** user 1,2,3 *************** -->
+<?php if ($showUser1User2User3Positions) : ?>
+ <div id="usertop-wrapper">
+ <div class="usertop-wrapper-inner container-<?php echo $GridContainer; ?> region clearfix">
+ <div class="grid-4 user-1">
+ <?php if ($showUser1Position) : ?>
+ <jdoc:include type="modules" name="user1" style="box"/>
+ <?php else : ?>
+ &nbsp;
+ <?php endif; ?>
+ </div>
+ <div class="grid-4 user-2">
+ <?php if ($showUser2Position) : ?>
+ <jdoc:include type="modules" name="user2" style="box"/>
+ <?php else : ?>
+ &nbsp;
+ <?php endif; ?>
+ </div>
+ <div class="grid-4 user-3">
+ <?php if ($showUser3Position) : ?>
+ <jdoc:include type="modules" name="user3" style="box"/>
+ <?php else : ?>
+ &nbsp;
+ <?php endif; ?>
+ </div>
+ </div>
+ </div>
+<?php endif; ?>
View
32 templateDetails.xml
@@ -41,36 +41,4 @@
<language tag="en-GB">en-GB/en-GB.tpl_ninesixtyj.ini</language>
<language tag="en-GB">en-GB/en-GB.tpl_ninesixtyj.sys.ini</language>
</languages>
- <config>
- <fields name="params">
- <fieldset name="advanced">
- <field name="grid" type="list" default="12"
- label="TPL_NINESIXTYJ_FIELD_CONTAINER_LABEL"
- description="TPL_NINESIXTYJ_FIELD_CONTAINER_DESC"
- filter="integer"
- >
- <option value="12">12</option>
- <option value="16">16</option>
- </field>
- <field name="gridfirst" type="list" default="3"
- label="TPL_NINESIXTYJ_FIELD_GRIDFIRST_LABEL"
- description="TPL_NINESIXTYJ_FIELD_GRIDFIRST_DESC"
- filter="integer"
- >
- <option value="2">Grid-2</option>
- <option value="3">Grid-3</option>
- <option value="4">Grid-4</option>
- </field>
- <field name="gridsecond" type="list" default="3"
- label="TPL_NINESIXTYJ_FIELD_GRIDSECOND_LABEL"
- description="TPL_NINESIXTYJ_FIELD_GRIDSECOND_DESC"
- filter="integer"
- >
- <option value="2">Grid-2</option>
- <option value="3">Grid-3</option>
- <option value="4">Grid-4</option>
- </field>
- </fieldset>
- </fields>
- </config>
</extension>
View
42 themeconfig.php
@@ -0,0 +1,42 @@
+<?php
+// build the full path to the template files
+$templatePath = $this->baseurl . '/templates/' . $this->template; // template path
+
+// get the site name
+$config = JFactory::getConfig();
+$siteName = $config->get('config.sitename');
+
+// determine which positions we want to show
+$showLeftPosition = $this->countModules('left');
+$showRightPosition = $this->countModules('right');
+$showTopPosition = $this->countModules('top');
+$showTopmenuPosition = $this->countModules('topmenu');
+$showUser1User2User3Positions = $this->countModules('user1 or user2 or user3');
+$showUser1Position = $this->countModules('user1');
+$showUser2Position = $this->countModules('user2');
+$showUser3Position = $this->countModules('user3');
+$showUser4User5User6Positions = $this->countModules('user4 or user5 or user6');
+$showUser4Position = $this->countModules('user4');
+$showUser5Position = $this->countModules('user5');
+$showUser6Position = $this->countModules('user6');
+$showFooterPosition = $this->countModules('footer');
+
+// Set Container and Grid to grid-12 or grid-16
+$GridContainer = $this->params->get('grid');
+
+// defaults
+$leftPositionWidth = $rightPositionWidth = 0;
+// calculate column widths of positions left, component and right
+if ($showLeftPosition) {
+ // Set the Grid to show left Position if countModules = TRUE
+ $leftPositionWidth = $this->params->get('gridfirst');
+}
+
+if ($showRightPosition) {
+ // Set the Grid to show right Position if countModules = TRUE
+ $rightPositionWidth = $this->params->get('gridsecond');
+}
+
+$componentWidth = $GridContainer - $leftPositionWidth - $rightPositionWidth;
+
+?>

0 comments on commit 6fcf0b4

Please sign in to comment.
Something went wrong with that request. Please try again.