Changeset 33


Ignore:
Timestamp:
Dec 11, 2005 9:53:52 PM (18 years ago)
Author:
scdev
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/CSS.inc.php

    r32 r33  
    1212
    1313    // Include these style sheets.
    14     var $_css_files = array('_default' => array());
     14    var $_css_files = array('default' => array());
    1515   
    1616    // Cache style sheets?
     
    5757     *
    5858     * @access  public
    59      *
    60      * @param   string  Full path to css file.
    61      *
     59     * @param   string  $file   Include path to css files.
     60     * @param   mixed   $apps   App name string or array of app names.
    6261     * @return  bool    True on success, false on failure.
    6362     */
    64     function setFile($file, $app='_default')
     63    function setFile($file, $apps='')
    6564    {
     65        if (!is_array($apps)) {
     66            $apps = array($apps);
     67        }
     68
    6669        if ($fp = fopen($file, 'r', true)) {
    67             $this->_css_files[$app][] = $file;
     70            foreach ($apps as $app) {
     71                $app = '' == $app ? 'default' : $app;
     72                $this->_css_files[$app][] = $file;
     73            }
    6874            fclose($fp);
    6975            return true;
     
    8187     * @return  bool    False if no files have been set.
    8288     */
    83     function headers($app='_default')
     89    function headers($app='')
    8490    {
     91        $app = '' == $app ? 'default' : $app;
     92
    8593        if (empty($this->_css_files[$app])) {
    8694            App::logMsg(sprintf('CSS::headers called without specifying any files.', null), LOG_WARNING, __FILE__, __LINE__);
     
    114122     * @return  bool    False if no files have been set.
    115123     */
    116     function output($app='_default')
     124    function output($app='')
    117125    {
     126        $app = '' == $app ? 'default' : $app;
     127
    118128        if (empty($this->_css_files[$app])) {
    119129            App::logMsg(sprintf('CSS::output called without specifying any files.', null), LOG_WARNING, __FILE__, __LINE__);
Note: See TracChangeset for help on using the changeset viewer.