[ Index ]

PHP Cross Reference of PageLines DMS

title

Body

[close]

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

   1  <?php
   2  /*
   3      Section: Highlight
   4      Author: PageLines
   5      Author URI: http://www.pagelines.com
   6      Description: Adds a highlight sections with a splash image and 2-big lines of text.
   7      Class Name: PageLinesHighlight
   8      Workswith: templates, main, header, morefoot, sidebar1, sidebar2, sidebar_wrap
   9      Cloning: true
  10      Filter: component
  11      Loading: active
  12  */
  13  
  14  /**
  15   * Highlight Section
  16   *
  17   * @package PageLines DMS
  18   * @author PageLines
  19   */
  20  class PageLinesHighlight extends PageLinesSection {
  21  
  22      var $tabID = 'highlight_meta';
  23  
  24  
  25  	function section_opts(){
  26          $opts = array(
  27              array(
  28                  'type'             => 'select',
  29                  'title'         => __( 'Select Format', 'pagelines' ),
  30                  'key'            => '_highlight_splash_position',
  31                  'label'         => __( 'Highlight Format', 'pagelines' ),
  32                  'opts'=> array(
  33                      'top'            => array( 'name' => __( 'Image on top of text', 'pagelines' ) ),
  34                      'bottom'         => array( 'name' => __( 'Image on bottom of text' , 'pagelines' )),
  35                      'notext'         => array( 'name' => __( 'No text, just the image', 'pagelines' ) )
  36                  ),
  37              ),
  38              'hl_text' => array(
  39                  'type'             => 'multi',
  40                  'col'            => 2,
  41                  'title'         => __( 'Highlight Text', 'pagelines' ),
  42                  'opts'    => array(
  43                      array(
  44                          'key'            => '_highlight_head',
  45                          'version'         => 'pro',
  46                          'type'             => 'text',
  47                          'size'            => 'big',
  48                          'label'         => __( 'Highlight Header Text (Optional)', 'pagelines' ),
  49                      ),
  50                      array(
  51                          'key'            => '_highlight_subhead',
  52                          'version'         => 'pro',
  53                          'type'             => 'textarea',
  54                          'label'         => __( 'Highlight Subheader Text (Optional)', 'pagelines' ),
  55                      )
  56  
  57                  )
  58              ),
  59              'hl_image' => array(
  60                  'type'             => 'multi',
  61                  'col'            => 3,
  62                  'title'         => __( 'Highlight Image and Format', 'pagelines' ),
  63                  'opts'    => array(
  64  
  65                       array(
  66                          'key'            => '_highlight_splash',
  67                          'type'             => 'image_upload',
  68                          'label'            => __( 'Upload Splash Image', 'pagelines' )
  69                      ),
  70                      array(
  71                          'key'                => '_highlight_image_frame',
  72                          'type'                 => 'check',
  73                          'label'             => __( 'Add frame to image?', 'pagelines' )
  74                      ),
  75                  )
  76              )
  77  
  78          );
  79  
  80          return $opts;
  81  
  82      }
  83      /**
  84      *
  85      * @TODO document
  86      *
  87      */
  88  	function section_optionator( $settings ){
  89  
  90          $settings = wp_parse_args($settings, $this->optionator_default);
  91  
  92          $metatab_array = array(
  93  
  94              'hl_options' => array(
  95                  'version'         => 'pro',
  96                  'type'             => 'multi_option',
  97                  'title'         => __( 'Highlight Header Text (Optional)', 'pagelines' ),
  98                  'shortexp'         => __( 'Add the main header text for the highlight section.', 'pagelines' ),
  99                  'selectvalues'    => array(
 100                      '_highlight_head' => array(
 101                          'version'         => 'pro',
 102                          'type'             => 'text',
 103                          'size'            => 'big',
 104                          'inputlabel'     => __( 'Highlight Header Text (Optional)', 'pagelines' ),
 105                      ),
 106                      '_highlight_subhead' => array(
 107                          'version'         => 'pro',
 108                          'type'             => 'text',
 109                          'size'            => 'big',
 110                          'inputlabel'     => __( 'Highlight Subheader Text (Optional)', 'pagelines' ),
 111                      ),
 112  
 113                      '_highlight_splash' => array(
 114                          'version'         => 'pro',
 115                          'type'             => 'image_upload',
 116                          'inputlabel'    => __( 'Upload Splash Image', 'pagelines' )
 117                      ),
 118                      '_highlight_splash_position' => array(
 119                          'version'         => 'pro',
 120                          'type'             => 'select',
 121                          'inputlabel'         => __( 'Highlight Image Style', 'pagelines' ),
 122                          'selectvalues'=> array(
 123                              'top'            => array( 'name' => __( 'Image on top of text', 'pagelines' ) ),
 124                              'bottom'         => array( 'name' => __( 'Image on bottom of text', 'pagelines' ) ),
 125                              'notext'         => array( 'name' => __( 'No text, just the image', 'pagelines' ) )
 126                          ),
 127                      ),
 128                      '_highlight_image_frame' => array(
 129                          'type'                 => 'check',
 130                          'inputlabel'         => __( 'Add frame to image?', 'pagelines' )
 131                      ),
 132                  )
 133              )
 134  
 135          );
 136  
 137          $metatab_settings = array(
 138                  'id'         => $this->tabID,
 139                  'name'         => 'Highlight',
 140                  'icon'         => $this->icon,
 141                  'clone_id'    => $settings['clone_id'],
 142                  'active'    => $settings['active']
 143              );
 144  
 145          register_metatab($metatab_settings, $metatab_array);
 146      }
 147  
 148      /**
 149      *
 150      * @TODO document
 151      *
 152      */
 153  	function section_template() {
 154  
 155          $h_head = $this->opt('_highlight_head', $this->tset);
 156  
 157  
 158  
 159          $h_subhead = $this->opt('_highlight_subhead', $this->tset);
 160  
 161          $h_splash = $this->opt('_highlight_splash', $this->tset);
 162          $h_splash_position = $this->opt('_highlight_splash_position', $this->oset);
 163  
 164          $frame_class = ($this->opt('_highlight_image_frame', $this->oset)) ? 'pl-imageframe' : '';
 165  
 166          if(!$h_head && !$h_subhead && !$h_splash){
 167              $h_head = __("Here's to the crazy ones...", 'pagelines');
 168              $h_subhead = __("This is your Highlight section. Set up the options to configure.", 'pagelines');
 169          }
 170  
 171          ?>
 172          <div class="highlight-area">
 173              <?php
 174  
 175                  if( $h_splash_position == 'top' && $h_splash)
 176                      printf('<div class="highlight-splash hl-image-top %s"><img data-sync="_highlight_splash" src="%s" alt="" /></div>', $frame_class, $h_splash);
 177  
 178                  if( $h_splash_position != 'notext' ){
 179  
 180                      if($h_head)
 181                          printf('<h2 class="highlight-head" data-sync="_highlight_head">%s</h2>', __( $h_head, 'pagelines' ) );
 182  
 183                      if($h_subhead)
 184                          printf('<div class="highlight-subhead" data-sync="_highlight_subhead">%s</div>', __( $h_subhead, 'pagelines' ) );
 185  
 186                  }
 187  
 188                  if( $h_splash_position != 'top' && $h_splash)
 189                      printf('<div class="highlight-splash hl-image-bottom %s"><img data-sync="_highlight_splash" src="%s" alt="" /></div>', $frame_class, apply_filters( 'pl_highlight_splash', $h_splash ) );
 190              ?>
 191          </div>
 192      <?php
 193  
 194      }
 195  }


Generated: Sun Dec 1 19:43:16 2013 Cross-referenced by PHPXref 0.7.1