[ Index ]

MailPress 7.2

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/mp-includes/class/ -> MP_WP_Dashboard_widget_.class.php (source)

   1  <?php
   2  abstract class MP_WP_Dashboard_widget_
   3  {
   4      var $url = 'http://chart.apis.google.com/chart';
   5  
   6  	function __construct( $name )
   7      {
   8          wp_add_dashboard_widget( $this->id, $name, array( $this, 'widget' ), ( method_exists( $this, 'control' ) ) ? array( $this, 'control' ) : null );
   9      }
  10  
  11  	function widget_size( $size ) 
  12      {
  13          $screen_layout_columns = $this->get_screen_layout_columns();
  14          if ( $screen_layout_columns <= 2 ) return $size;
  15  
  16          $x = ( $screen_layout_columns == 3 ) ? 0.65 : 0.45;
  17          $wh = explode( 'x', $size );
  18          return intval( $wh[0] * $x ) . 'x' . intval( $wh[1] * $x );
  19      }
  20  
  21  	function bar_size( $size ) 
  22      {
  23          $screen_layout_columns = $this->get_screen_layout_columns();
  24          if ( $screen_layout_columns <= 2 ) return $size;
  25  
  26          $x = ( $screen_layout_columns == 3 ) ? 0.65 : 0.45;
  27          return intval( $size * $x );
  28      }
  29  
  30  	function get_screen_layout_columns() 
  31      {
  32          $screen_layout_columns = get_user_option( 'screen_layout_dashboard' );
  33          if ( !$screen_layout_columns ) $screen_layout_columns = 2;
  34          return $screen_layout_columns;
  35      }
  36  }


Generated: Tue May 19 15:55:14 2020 Cross-referenced by PHPXref 0.7.1