[ Index ]

PHP Cross Reference of PageLines Framework

title

Body

[close]

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

   1  <?php
   2  /*
   3      Section: Nav Classic
   4      Author: PageLines
   5      Author URI: http://www.pagelines.com/
   6      Description: Creates site navigation, with optional superfish dropdowns on hover.
   7      Class Name: PageLinesNav
   8      Workswith: header
   9      Cloning: false
  10  */
  11  
  12  /**
  13   * Navigation Section
  14   *
  15   * @package PageLines Framework
  16   * @author PageLines
  17   */
  18  class PageLinesNav extends PageLinesSection {
  19  
  20      static $nav_url;
  21      static $nav_dir;
  22  
  23      /**
  24      * PHP that always loads no matter if section is added or not.
  25      */
  26  	function section_persistent(){
  27          self::$nav_dir = PL_SECTIONS.'/nav';
  28          self::$nav_url = PL_SECTION_ROOT.'/nav';
  29          register_nav_menus( array( 'primary' => __( 'Primary Website Navigation', 'pagelines' ) ) );
  30  
  31      }
  32  
  33      /**
  34      * Section template.
  35      */
  36     function section_template() {
  37  
  38          $container_class = ( ploption('hidesearch') ) ? 'nosearch' : '';
  39  
  40          printf('<div class="navigation_wrap fix"><div class="main_nav_container %s"><nav id="nav_row" class="main_nav fix">', $container_class );
  41  
  42                  if(function_exists('wp_nav_menu'))
  43                      wp_nav_menu( array('menu_class'  => 'main-nav'.pagelines_nav_classes(), 'container' => null, 'container_class' => '', 'depth' => 3, 'theme_location'=>'primary', 'fallback_cb'=>'pagelines_nav_fallback') );
  44                  else
  45                      pagelines_nav_fallback();
  46  
  47              echo '</nav></div>';
  48  
  49               if(!ploption('hidesearch'))
  50                  get_search_form();
  51  
  52          echo '</div>';
  53      }
  54  
  55  
  56      /**
  57      *
  58      * @TODO document
  59      *
  60      */
  61  	function section_styles(){
  62          if(ploption('enable_drop_down')){
  63  
  64              wp_register_style('superfish', self::$nav_url . '/style.superfish.css', array(), PL_CORE_VERSION, 'screen');
  65               wp_enqueue_style( 'superfish' );
  66  
  67              wp_enqueue_script( 'superfish', self::$nav_url . '/script.superfish.js', array('jquery'), '1.4.8', true );
  68              wp_enqueue_script( 'bgiframe', self::$nav_url . '/script.bgiframe.js', array('jquery'), '2.1', true );
  69          }
  70      }
  71  
  72  
  73      /**
  74      *
  75      * @TODO document
  76      *
  77      */
  78  	function section_head(){
  79  
  80          $arrows = (ploption('drop_down_arrows') == 'on') ? 1 : 0;
  81          $shadows = (ploption('drop_down_shadow') == 'on') ? 1 : 0;
  82  
  83          if(ploption('enable_drop_down')): ?><script type="text/javascript"> /* <![CDATA[ */ jQuery(document).ready(function() {  jQuery('div.main_nav_container ul.sf-menu').superfish({ delay: 100, speed: 'fast', autoArrows:  <?php echo $arrows;?>, dropShadows: <?php echo $shadows;?> });  }); /* ]]> */ </script>
  84  
  85  <?php
  86          endif;
  87      }
  88  
  89  }


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