[ Index ]

PHP Cross Reference of PageLines Framework

title

Body

[close]

/sections/morefoot/ -> section.php (source)

   1  <?php
   2  /*
   3      Section: Morefoot Sidebars
   4      Author: PageLines
   5      Author URI: http://www.pagelines.com
   6      Description: Three widgetized sidebars above footer
   7      Class Name: PageLinesMorefoot
   8      Workswith: morefoot, footer
   9      Edition: pro
  10      Persistant: true
  11  */
  12  
  13  /**
  14   * Morefoot Sidebars Section
  15   *
  16   * @package PageLines Framework
  17   * @author PageLines
  18   */
  19  class PageLinesMorefoot extends PageLinesSection {
  20  
  21      /**
  22      * PHP that always loads no matter if section is added or not.
  23      */
  24  	function section_persistent(){
  25  
  26          // Setup master array
  27          $this->master_array();
  28  
  29          // Register Section Sidebars
  30          foreach($this->master as $key => $i){
  31  
  32              pagelines_register_sidebar(
  33                  array(
  34                      'name'            => $i['name'],
  35                      'description'    => $i['description'],
  36                      'before_widget' => '<div id="%1$s" class="%2$s widget fix"><div class="widget-pad">',
  37                      'after_widget' => '</div></div>',
  38                      'before_title' => '<h3 class="widget-title">',
  39                      'after_title' => '</h3>'
  40                  )
  41              );
  42          }
  43      }
  44  
  45      /**
  46      * Section template.
  47      */
  48     function section_template() {
  49  
  50          $grid_args = array(
  51              'data'        => 'array_callback',
  52              'callback'    => array(&$this, 'morefoot_sidebar'),
  53              'per_row'    => 3
  54  
  55          );
  56  
  57          // Call the Grid
  58              printf('<div class="morefoot fix"><div class="morefoot-pad">%s</div></div>', grid( $this->master, $grid_args ));
  59  
  60      }
  61  
  62  
  63      /**
  64      *
  65      * @TODO document
  66      *
  67      */
  68  	function morefoot_sidebar($sidebar, $args){
  69  
  70          ob_start();
  71          if(!dynamic_sidebar( $sidebar['name']))
  72              echo $sidebar['default'];
  73  
  74          return sprintf('<div class="morefoot-col"><div class="morefoot-col-pad blocks">%s</div></div>', ob_get_clean());
  75  
  76      }
  77  
  78  
  79      /**
  80      *
  81      * @TODO document
  82      *
  83      */
  84  	function master_array(){
  85  
  86              $left = sprintf(
  87                  '<div class="widget"><div class="widget-pad"><h3 class="widget-title">%s</h3><p>%s</p>%s<br class="clear"/><p>%s</p></div></div>',
  88                  __('Looking for something?','pagelines'),
  89                  __('Use the form below to search the site:','pagelines'),
  90                  pagelines_search_form(false),
  91                  __("Still not finding what you're looking for? Drop us a note so we can take care of it!",'pagelines')
  92              );
  93  
  94              $middle = sprintf(
  95                  '<div class="widget"><div class="widget-pad"><h3 class="widget-title">%s</h3><p>%s</p><ul>%s</ul></div></div>',
  96                  __('Visit our friends!','pagelines'),
  97                  __('A few highly recommended friends...','pagelines'),
  98                  wp_list_bookmarks('title_li=&categorize=0&echo=0')
  99              );
 100  
 101              $right = sprintf(
 102                  '<div class="widget"><div class="widget-pad"><h3 class="widget-title">%s</h3><p>%s</p><ul>%s</ul></div></div>',
 103                  __('Archives','pagelines'),
 104                  __('All entries, chronologically...','pagelines'),
 105                  wp_get_archives('type=monthly&limit=12&echo=0')
 106              );
 107  
 108              $this->master = array(
 109  
 110                  'left'    => array(
 111                      'name'            => 'MoreFoot Left',
 112                      'description'     => __('Left sidebar in morefoot section.', 'pagelines'),
 113                      'default'        => $left
 114                  ),
 115                  'middle'    => array(
 116                      'name'            => 'MoreFoot Middle',
 117                      'description'     => __('Middle sidebar in morefoot section.', 'pagelines'),
 118                      'default'        => $middle
 119                  ),
 120                  'right'    => array(
 121                      'name'            => 'MoreFoot Right',
 122                      'description'     => __('Right sidebar in morefoot section.', 'pagelines'),
 123                      'default'        => $right
 124                  ),
 125              );
 126      }
 127  
 128  
 129  }
 130  
 131  /*
 132      End of section class
 133  */


Generated: Thu May 23 23:52:43 2013 Cross-referenced by PHPXref 0.7.1