more to the template
authorSteve Sutton <steve@gaslightmedia.com>
Mon, 8 Feb 2010 18:04:46 +0000 (18:04 +0000)
committerSteve Sutton <steve@gaslightmedia.com>
Mon, 8 Feb 2010 18:04:46 +0000 (18:04 +0000)
Toolkit/Page.php
templates/template.html

index 9b0ed48..5f9529c 100755 (executable)
@@ -158,13 +158,19 @@ class Toolkit_Page
                $GLOBALS['styleSheets'][] = $this->baseURL . 'styles.css';
                $GLOBALS['scripts'][]
                        = $this->glmAppBaseURL . 'libjs/jquery-1.3.2.min.js';
-               $GLOBALS['scripts'][] = $this->baseURL . 'libjs/newsletterSignup.js';
+        // needed for home page
+        if ($toolbox->catid == HOME_ID) {
+                   $GLOBALS['scripts'][] = 
+                $this->glmAppBaseURL . 'libjs/jquery.innerfade.js';
+                   $GLOBALS['scripts'][] = 
+                $this->baseURL . 'libjs/slideshow.js';
+        }
 
         // bread crumb navigation
         //$this->breadCrumbs = $toolbox->get_bread_crumbs($toolbox->catid);
 
         // main nav
-        $this->mainNav = $toolbox->get_main_nav();
+        $this->mainNav = $toolbox->get_main_nav($topParent);
 
         // sideNav
         if ($toolbox->catid != HOME_ID) {
@@ -478,8 +484,29 @@ class Toolkit_Page
      */
     public function headlines($toolbox)
     {
+               $dbh = Toolkit_Database::getInstance();
         // get headlines aka 'Quick Links'
-        $this->headlines = $toolbox->get_headlines();
+               $this->headlines = array();
+               $sql = "
+          SELECT id,intro,feature_intro,description,image
+            FROM bus_category
+           WHERE featured = 't'
+        ORDER BY parent,pos;";
+        $res = $dbh->query($sql);
+        $rowNumber = $colNumber = 1;
+        while ($row = $res->fetch(PDO::FETCH_ASSOC)) { // $data as $row ){
+            $this->headlines[$rowNumber][$colNumber] = array(
+                'col'    => ($colNumber == 1) ? 'one': 'two',
+                'href'   => $this->toolbox->get_seo_url($row['id']),
+                'img'    => ($row['image']) ? MIDSIZED . $row['image']: '',
+                'header' => $row['feature_intro'],
+                'descr'  => GLM_TOOLBOX::make_teaser($row['description'], 50, true));
+            ++$colNumber;
+            if ($colNumber > 2) {
+                $colNumber = 1;
+                ++$rowNumber;
+            }
+        }
         // boolean for if toolbox has headlines
         $this->hasHeadlines = !empty($this->headlines);
     }
index c1126be..cf21c78 100755 (executable)
@@ -9,19 +9,6 @@
 <link rel="shortcut icon" href="baseurl/favicon.ico">
 {styles:h}
 {scripts:h}
-<script type="text/javascript" src="http://app.gaslightmedia.com/libjs/jquery-1.3.2.min.js"></script>
-<script type="text/javascript" src="http://app.gaslightmedia.com/libjs/jquery.innerfade.js"></script>
-<script type="text/javascript"> $(document).ready(
-       function(){
-               $('ul#slideshow').innerfade({
-                       speed: 6000,
-                       timeout: 8000,
-                       type: 'sequence',
-                       containerheight: '250px'
-               });
-       }
-);
-</script>
 </head>
 <body>
        <div id="headerwrap">
                </div><!-- /#header -->
                <div id="mainnav">
                        <div id="centeredmenu">
-                               <ul>
-                                       <li><a href="#"  class="active">Home</a></li>
-                                       <li><a href="#">Accommodations</a></li>
-                                       <li><a href="#">Things To Do &amp; See</a></li>
-                                       <li><a href="#">Area Information</a></li>
-                                       <li><a href="#">Specials &amp; Packages</a></li>
-                                       <li><a href="#">Resort Information</a></li>
-                                       <li><a href="#">Guest Information</a></li>
-                                       <li><a href="#">Contact Us</a></li>
-                               </ul>
+            {mainNav:h}
                        </div><!-- /#centeredmenu -->
                </div><!-- /#mainnav -->
        </div><!-- /#headerwrap -->
                                </ul>
                        </div><!-- /#rotating -->
                                {toolboxContent:h}
-                       <div id="whatsnew">
-                               <div class="row">
-                                       <div class="one">
-                                               <h3>Headline flagged from Toolbox</h3>
-                                               <img src="baseurl/assets/temp_newsphoto.jpg" alt="#" width="150" height="97">
-                                               Whether you spend the day boating on the Inland Waterway or Little Traverse Bay, it will be a day to remember.
-                                               <a href="#" class="readmore">Read More</a>
+                       <div id="whatsnew" flexy:if="hasHeadlines">
+                               <div class="row" flexy:foreach="headlines,row">
+                                       <div class="{row[1][col]}" flexy:if="row[1][col]">
+                                               <h3>{row[1][header]}</h3>
+                                               <img src="{row[1][img]}" alt="#" width="150" height="97" flexy:if="row[1][img]" />
+                                               {row[1][descr]}
+                                               <a href="{row[1][href]}" class="readmore">Read More</a>
                                        </div><!-- /.one -->
-                                       <div class="two">
-                                               <h3>Headline flagged from Toolbox</h3>
-                                               <img src="baseurl/assets/temp_newsphoto.jpg" alt="#" width="150" height="97">
-                                               Whether you spend the day boating on the Inland Waterway or Little Traverse Bay, it will be a day to remember.
-                                               <a href="#" class="readmore">Read More</a>
+                                       <div class="{row[2][col]}" flexy:if="row[2][col]">
+                                               <h3>{row[2][header]}</h3>
+                                               <img src="{row[2][img]}" alt="#" width="150" height="97" flexy:if="row[2][img]" />
+                                               {row[2][descr]}
+                                               <a href="{row[2][href]}" class="readmore">Read More</a>
                                        </div><!-- /.two -->
                                </div><!-- /.row -->
-                               <div class="row">
-                                       <div class="one">
-                                               <h3>Headline flagged from Toolbox</h3>
-                                               <img src="baseurl/assets/temp_newsphoto.jpg" alt="#" width="150" height="97">
-                                               Whether you spend the day boating on the Inland Waterway or Little Traverse Bay, it will be a day to remember.
-                                               <a href="#" class="readmore">Read More</a>
-                                       </div><!-- /.one -->
-                                       <div class="two">
-                                               <h3>Headline flagged from Toolbox</h3>
-                                               <img src="baseurl/assets/temp_newsphoto.jpg" alt="#" width="150" height="97">
-                                               Whether you spend the day boating on the Inland Waterway or Little Traverse Bay, it will be a day to remember.
-                                               <a href="#" class="readmore">Read More</a>
-                                       </div><!-- /.two -->
-                               </div><!-- /#row -->
                        </div><!-- #/whatsnew -->
                </div><!-- /#content-home -->
 <!-- rightcol on inside only pages -->
-               <div id="rightcol" flexy:if="!isHomePage">
+               <div id="rightcol" flexy:if="isHomePage">
                        <img src="baseurl/assets/shadowtop-h.jpg" alt="feature items" width="220" height="20">
                        <div id="specials">
                                <a href="#.html" title="Specials and Packages">Specials and Packages</a>
                <!-- leftcol on inside only pages -->
                <div id="leftcol" flexy:if="!isHomePage">
                <!-- sublevel block -->
-                       <div id="subnavwrapper">
+                       <div id="subnavwrapper" flexy:if="sideNav">
                                <div id="pagetitle">
                                        <a href="#.html">Page Title</a>
                                        <div id="pagetitlebot"></div><!-- /#pagetitlebot -->
                                </div><!-- /#pagetitle -->
-                               <div id="sublevelwrap">
-                                       <ul id="sublevel">
-                                               <li><a href="#">Item one</a>
-                                                       <ul>
-                                                               <li><a href="#">Subitem one</a></li>
-                                                               <li><a href="#">Subitem two</a></li>
-                                                               <li><a href="#">Subitem three</a></li>
-                                                               <li><a href="#">Subitem four</a></li>
-                                                       </ul>
-                                               </li>
-                                               <li><a href="#">Item two</a></li>
-                                               <li><a href="#">Item three</a></li>
-                                               <li><a href="#">Item four</a></li>
-                                       </ul>
+                               <div id="sublevelwrap" flexy:if="sideNav">
+                    {sideNav:h}
                                </div><!-- /#sublevel -->
                        </div><!-- /#sublevelwrap -->
 <!-- END sublevel block -->
                <!-- content on inside only pages -->
                <div id="content" flexy:if="!isHomePage">
                        <div id="toolbox">
-                               <div id="breadcrumb">
-                                       <a href="#.html">Home</a> &nbsp;>&nbsp; <a href="#.html">Main Nav Item</a> &nbsp;>&nbsp; <span class="current">Sublevel Item</span>
-                               </div>
                                {toolboxContent:h}
                        </div><!-- /#toolbox -->
                </div><!-- /#content -->