[ Index ]

PHP Cross Reference of PageLines DMS

title

Body

[close]

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

   1  <?php
   2  /*
   3      Section: ShareBar
   4      Author: PageLines
   5      Author URI: http://www.pagelines.com
   6      Description: Adds ways to share content on pages/single posts
   7      Class Name: PageLinesShareBar
   8      Workswith: main
   9      Failswith: pagelines_special_pages()
  10      Cloning: true
  11      Filter: social
  12  */
  13  
  14  /**
  15   * ShareBar Section
  16   *
  17   * @package PageLines DMS
  18   * @author PageLines
  19   */
  20  class PageLinesShareBar extends PageLinesSection {
  21  
  22  	function section_opts(){
  23  
  24          $the_urls = array();
  25  
  26          $icons = array_merge( array( 'karma' ), $this->the_icons() );
  27  
  28          foreach($icons as $icon){
  29              $the_urls[] = array(
  30                  'label'    => ui_key($icon) . ' Disable?',
  31                  'key'    => $this->id.'_disable_'.$icon,
  32                  'type'    => 'check',
  33                  'scope'    => 'global',
  34              );
  35          }
  36  
  37          $opts = array(
  38  
  39              array(
  40                  'type'    => 'multi',
  41                  'key'    => 'config',
  42                  'title'    => __( 'Config', 'pagelines' ),
  43                  'col'    => 1,
  44                  'opts'    => array(
  45                      array(
  46                          'type'    => 'text',
  47                          'key'    => 'text',
  48                          'label'    => __( 'Description Text', 'pagelines' ),
  49  
  50                      ),
  51                      array(
  52                          'type'    => 'select',
  53                          'key'    => 'align',
  54                          'label'    => __( 'Alignment', 'pagelines' ),
  55                          'opts'    => array(
  56                              'right'        => array( 'name' => __( 'Social links on right', 'pagelines' ) ),
  57                              'center'    => array( 'name' => __( 'Social links in center', 'pagelines' ) ),
  58                              'left'        => array( 'name' => __( 'Social links on left', 'pagelines' ) ),
  59                          ),
  60                      ),
  61                  )
  62  
  63              ),
  64              array(
  65                  'type'    => 'multi',
  66                  'key'    => 'sl_urls',
  67                  'title'    => __( 'Share Button Disable', 'pagelines' ),
  68  
  69                  'col'    => 2,
  70                  'opts'    => $the_urls
  71  
  72              )
  73  
  74  
  75          );
  76  
  77          return $opts;
  78  
  79      }
  80  
  81  	function the_icons( ){
  82  
  83          $icons = array(
  84              'facebook',
  85              'linkedin',
  86              'twitter',
  87              'pinterest'
  88          );
  89          
  90          return $icons;
  91      }
  92      function section_template() {
  93  
  94          $align = $this->opt('align');
  95  
  96          if( $align == 'left' )
  97              $align_class = 'alignleft';
  98          elseif( $align == 'right' )
  99              $align_class = 'alignright';
 100          else
 101              $align_class = '';
 102  
 103          $txt = $this->opt('text');
 104  
 105          $txt = ( $txt ) ? sprintf('<div class="txt-wrap pla-from-bottom pl-animation subtle"><div class="txt">%s</div></div>', $txt) : '';
 106  
 107          ?>
 108  
 109          <div class="pl-sharebar">
 110              <div class="pl-sharebar-pad">
 111                  <div class="pl-social-counters pl-animation-group <?php echo $align_class;?>">
 112                      <?php
 113                          $classes = 'pl-animation pla-from-top subtle icon';
 114                          
 115                          if( ! pl_setting( $this->id.'_disable_karma' ) )
 116                              echo do_shortcode( sprintf( '[pl_karma classes="%s"]', $classes ) );
 117  
 118                          foreach( $this->the_icons() as $key => $icon ){
 119                              if( ! pl_setting( $this->id.'_disable_'.$icon ) )
 120                                  echo pl_get_social_button( array('btn' => $icon, 'classes' => $classes) );
 121                          }
 122                          do_action( 'pl_sharebar_after_icons' );
 123                      ?>
 124  
 125                  </div>
 126                  <?php echo $txt; ?>
 127                  <div class="clear"></div>
 128              </div>
 129          </div>
 130      <?php }
 131  
 132  	function get_shares(){
 133  
 134          global $post;
 135  
 136          if( ! is_object( $post ) )
 137              return;
 138          $perm = get_permalink($post->ID);
 139          $title = wp_strip_all_tags( get_the_title( $post->ID ) );
 140          $thumb = (has_post_thumbnail($post->ID)) ? pl_the_thumbnail_url( $post->ID ) : '';
 141  
 142          $desc = wp_strip_all_tags( pl_short_excerpt($post->ID, 10, '') );
 143  
 144          $out = '';
 145  
 146  
 147  
 148          return $out;
 149      }
 150  
 151  
 152  
 153  }


Generated: Sun Aug 31 19:17:14 2014 Cross-referenced by PHPXref 0.7.1