Ignore:
Timestamp:
Oct 12, 2012, 9:56:12 PM (12 years ago)
Author:
rvelices
Message:
  • remove unsed code; shorten existing code and improve readability ...
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/themes.class.php

    r16179 r18628  
    7979        {
    8080          array_push(
    81             $errors, 
     81            $errors,
    8282            sprintf(
    8383              l10n('Impossible to activate this theme, the parent theme is missing: %s'),
     
    8585              )
    8686            );
    87          
     87
    8888          break;
    8989        }
     
    212212          break;
    213213        }
    214        
     214
    215215        if (!$this->deltree(PHPWG_THEMES_PATH.$theme_id))
    216216        {
     
    221221      case 'set_default':
    222222        // first we need to know which users are using the current default theme
    223         $this->set_default_theme($theme_id);       
     223        $this->set_default_theme($theme_id);
    224224        break;
    225225    }
     
    233233      return null;
    234234    }
    235    
     235
    236236    $parent = $this->fs_themes[$theme_id]['parent'];
    237      
     237
    238238    if ('default' == $parent)
    239239    {
    240240      return null;
    241241    }
    242      
     242
    243243    if (!isset($this->fs_themes[$parent]))
    244244    {
     
    252252  {
    253253    $children = array();
    254    
     254
    255255    foreach ($this->fs_themes as $test_child)
    256256    {
     
    262262
    263263    return $children;
    264   } 
     264  }
    265265
    266266  function set_default_theme($theme_id)
    267267  {
    268268    global $conf;
    269    
     269
    270270    // first we need to know which users are using the current default theme
    271271    $default_theme = get_default_theme();
    272    
     272
    273273    $query = '
    274274SELECT
     
    301301    *
    302302  FROM '.THEMES_TABLE;
    303    
     303
    304304    $clauses = array();
    305305    if (!empty($id))
     
    322322  }
    323323
    324  
     324
    325325  /**
    326326  *  Get themes defined in the theme directory
    327   */ 
     327  */
    328328  function get_fs_themes()
    329329  {
    330330    $dir = opendir(PHPWG_THEMES_PATH);
    331    
     331
    332332    while ($file = readdir($dir))
    333333    {
     
    532532    return false;
    533533  }
    534  
     534
    535535  /**
    536536   * Sort $server_themes
     
    654654    return $status;
    655655  }
    656  
     656
    657657  /**
    658658   * delete $path directory
     
    775775  }
    776776
    777   // themes specific methods
    778   function get_fs_themes_with_ini()
    779   {
    780     $themes_dir = PHPWG_ROOT_PATH.'themes';
    781 
    782     $fs_themes = array();
    783 
    784     foreach (get_dirs($themes_dir) as $theme)
    785     {
    786       $conf_file = $themes_dir.'/'.$theme.'/themeconf.inc.php';
    787       if (file_exists($conf_file))
    788       {
    789         $theme_data = array(
    790           'name' => $theme,
    791           );
    792        
    793         $ini_file = $themes_dir.'/'.$theme.'/theme.ini';
    794         if (file_exists($ini_file))
    795         {
    796           $theme_ini = parse_ini_file($ini_file);
    797           if (isset($theme_ini['extension_id']))
    798           {
    799             $theme_data['extension_id'] = $theme_ini['extension_id'];
    800           }
    801         }
    802 
    803         array_push($fs_themes, $theme_data);
    804       }
    805     }
    806 
    807     echo '<pre>'; print_r($fs_themes); echo '</pre>';
    808   }
    809 
    810  
    811777}
    812778?>
Note: See TracChangeset for help on using the changeset viewer.