Show
Ignore:
Timestamp:
08/19/10 13:02:15 (21 months ago)
Author:
ort
Message:

Refactoring engine by 1d1ot

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/engine/include/function.php

    r980 r985  
    428428} 
    429429 
     430 
     431function func_list_plugins($bAll = false){ 
     432        $sPluginsDir = Config::Get('path.root.server').'/plugins'; 
     433        $sPluginsListFile = $sPluginsDir.'/plugins.dat'; 
     434        $aPlugin = array(); 
     435        if($bAll){ 
     436                $aPluginRaw = array(); 
     437                $aPaths = glob("$aPluginRaw/*", GLOB_ONLYDIR); 
     438                if($aPaths) 
     439                foreach($aPaths as $sPath){ 
     440                        $aPluginRaw[] = basename($sPath); 
     441                } 
     442        }else{ 
     443                $aPluginRaw = @array_map('trim', file($sPluginsListFile)); 
     444        } 
     445        if($aPluginRaw) 
     446        foreach($aPluginRaw as $sPlugin){ 
     447                $sPluginXML = "$sPluginsDir/$sPlugin/plugin.xml"; 
     448                if(is_file($sPluginXML)){ 
     449                        $aPlugin[] = $sPlugin; 
     450                } 
     451        } 
     452        return $aPlugin; 
     453} 
     454 
    430455?>