web/wp-content/plugins/exec-php/includes/style.php
changeset 136 bde1974c263b
equal deleted inserted replaced
135:53cff4b4a802 136:bde1974c263b
       
     1 <?php
       
     2 
       
     3 require_once(dirname(__FILE__).'/const.php');
       
     4 
       
     5 // -----------------------------------------------------------------------------
       
     6 // the ExecPhp_Style class displays the Exec-PHP style sheet if necessary
       
     7 // -----------------------------------------------------------------------------
       
     8 
       
     9 if (!class_exists('ExecPhp_Style')) :
       
    10 class ExecPhp_Style
       
    11 {
       
    12 	function ExecPhp_Style()
       
    13 	{
       
    14 		if (current_user_can(ExecPhp_CAPABILITY_EDIT_PLUGINS)
       
    15 			|| current_user_can(ExecPhp_CAPABILITY_EDIT_USERS))
       
    16 		{
       
    17 			if (function_exists('wp_enqueue_style'))
       
    18 				wp_enqueue_style(ExecPhp_ID_STYLE_ADMIN, ExecPhp_HOME_URL. '/css/admin.css');
       
    19 			else
       
    20 				// WP < 2.6
       
    21 				add_action('admin_head', array(&$this, 'action_admin_head'), 5);
       
    22 		}
       
    23 	}
       
    24 
       
    25 	// ---------------------------------------------------------------------------
       
    26 	// hooks
       
    27 	// ---------------------------------------------------------------------------
       
    28 
       
    29 	function action_admin_head()
       
    30 	{
       
    31 ?>
       
    32 <link rel='stylesheet' href='<?php echo ExecPhp_HOME_URL; ?>/css/admin.css' type='text/css' />
       
    33 <?php
       
    34 	}
       
    35 }
       
    36 endif;
       
    37 
       
    38 ?>