Ignore:
Timestamp:
Apr 25, 2010, 12:33:24 AM (15 years ago)
Author:
grum
Message:

Update changes for release 3.1.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/GrumPluginClasses/classes/GPCCss.class.inc.php

    r5550 r5958  
    4141{
    4242  private $filename;
     43
     44  static public function applyGpcCss()
     45  {
     46    add_event_handler('loc_end_page_header', array('GPCCss', 'applyCSSFile'));
     47  }
     48
     49  static public function applyCSSFile($fileName="")
     50  {
     51    global $template;
     52
     53    if($fileName=="")
     54    {
     55      //if no filename given, load the gpc.css file
     56      $fileName=basename(dirname(dirname(__FILE__))).'/css/gpc.css';
     57      $template->append('head_elements', '<link rel="stylesheet" type="text/css" href="plugins/'.$fileName.'">');
     58    }
     59    elseif(file_exists($fileName))
     60    {
     61      $template->append('head_elements', '<link rel="stylesheet" type="text/css" href="plugins/'.basename(dirname($fileName))."/".basename($fileName).'">');
     62    }
     63  }
    4364
    4465  public function __construct($filename)
     
    86107    global $template;
    87108
    88     if($this->fileExists())
    89     {
    90       $template->append('head_elements', '<link rel="stylesheet" type="text/css" href="plugins/'.basename(dirname($this->filename))."/".basename($this->filename).'">');
    91     }
     109    GPCCss::applyCSSFile($this->filename);
    92110  }
     111
     112
    93113} //class
    94114
Note: See TracChangeset for help on using the changeset viewer.