oscss_plugins Class Reference

List of all members.

Public Member Functions

Static Public Member Functions

Protected Member Functions

Static Protected Attributes

Static Private Member Functions

  • static testCache ($path)
    Test cache de libraire.
  • static gocache ()
    Test etat cache global, si false descative ache plugins.

Detailed Description

Note:
: Gestion de l'appel des modules (rep modules, noyau them plugin ou them module)

Definition at line 13 of file page.oscss_plugins.php.


Constructor & Destructor Documentation

oscss_plugins::__construct (  )  [protected]

Definition at line 19 of file page.oscss_plugins.php.

00019                                   {
00020   }


Member Function Documentation

oscss_plugins::active_plugins (  ) 

Charge les plugin, specifique à la page et generaux /plugin/ /plugin/type/.

appel cache test

Definition at line 78 of file page.oscss_plugins.php.

00078                                   {
00079     global $template, $language, $languages_id, $page;
00080 
00082     $cache=(CacheLib::read('plugins-'.page::$keyCacheName) === false && !self::gocache() /*&& page::$CacheCalcul*/)? false : true ;
00083 
00084     if($cache && !_test_bool(OSCSS_DEBUG))require(CacheLib::getfilecache());
00085 
00086     $i_sort=5;
00087     $sort=$recache=$array_file=array();
00088 
00089     if(is_array($page->page['plugins']['present']))
00090     while ($r = each($page->page['plugins']['present'])) {
00091       $res=5;
00092       $file=$r['value'];
00093       $dir_ws_here = $page->getPathTemplate().  DIR_WS_INCLUDES. 'plugins/generic/'.$file. '/';
00094       $path= $dir_ws_here. 'includes_header.php';
00095       if (page::TestFile($path)){
00096         $array_file[]=$path;
00097         if(!self::testCache($path) && !function_exists($r['value'].'_scripts')){
00098           require_once($path);
00099           $recache[]=true;
00100         }
00101         $fct=$r['value'].'_sort';
00102         if (function_exists($fct))$res=$fct();
00103         $i=(isset($res)? $res : $i_sort);
00104         $sort[$file]=$i;
00105       }
00106     }
00107 
00108     if(isset($page->page['plugins']['type']) && is_array($page->page['plugins']['type']))
00109     while ($r = each($page->page['plugins']['type'])) {
00110       $res=5;
00111       $file=$r['value'];
00112       $dir_ws_here = $page->getPathTemplate().  DIR_WS_INCLUDES. 'plugins/'.$page->the_type().'/'.$file. '/';
00113       $path= $dir_ws_here. 'includes_header.php';
00114       if (page::TestFile($path)){
00115         $array_file[]=$path;
00116         if(!self::testCache($path) && !function_exists($r['value'].'_scripts')){
00117           require_once($path);
00118           $recache[]=true;
00119         }
00120         $fct=$r['value'].'_sort';
00121         if (function_exists($fct))$res=$fct();
00122         $i=(isset($res)? $res : $i_sort);
00123         $sort[$file]=$i;
00124       }
00125     }
00126 
00127     asort($sort);
00128     foreach($sort as $file=>$i)
00129       $page->page['plugins']['actif'][]=$file;
00130 
00131     if ($cache === false || in_array(true,$recache) ) {
00132       if(! _test_bool(OSCSS_DEBUG) )CacheLib::addfiles($array_file);
00133     }
00134   }

static oscss_plugins::getInstance (  )  [static]

Definition at line 22 of file page.oscss_plugins.php.

Referenced by resetInstance().

00022                                        {
00023     if(self::$_instance == null) self::$_instance = new self();
00024     return self::$_instance;
00025   }

static oscss_plugins::gocache (  )  [static, private]

Test etat cache global, si false descative ache plugins.

Definition at line 67 of file page.oscss_plugins.php.

Referenced by active_plugins().

00067                                    {
00068     $res=page::GetCacheVar();
00069     if(!isset($res['plugin'])) return false;
00070     return true;
00071   }

oscss_plugins::plugins_active ( type  ) 

Construit element plugins actif.

Parameters:
string type ( $this->page['type'])

Definition at line 36 of file page.oscss_plugins.php.

00036                                        {
00037     $cst='PLUGIN_'.strtoupper($type).'_INSTALLED';
00038     $class=array();
00039     if (defined($cst)) {
00040      $files_array=explode (';',constant($cst));
00041       if (is_array($files_array) && !is_numeric($files_array[0]) && count($files_array)>0 ) {
00042         reset ($files_array);
00043         while (list ($key, $file) = each ($files_array)) $class[]=substr($file,0, strlen($file)-4 );
00044        }
00045     }
00046     return $class;
00047   }

static oscss_plugins::resetInstance (  )  [static]

Definition at line 27 of file page.oscss_plugins.php.

00027                                         {
00028     self::$_instance = null;
00029     return self::getInstance();
00030   }

static oscss_plugins::testCache ( path  )  [static, private]

Test cache de libraire.

Definition at line 52 of file page.oscss_plugins.php.

00052                                           {
00053     if(_test_bool(OSCSS_DEBUG)) return false;
00054 
00055     $res=page::GetCacheVar();
00056     $key=md5($path);
00057     if(!isset($res['plugin'][$key])){
00058       page::AddCacheVar('plugin',$key,'true');
00059       return false;
00060     }
00061     return true;
00062   }


Member Data Documentation

oscss_plugins::$_instance [static, protected]

Definition at line 15 of file page.oscss_plugins.php.


The documentation for this class was generated from the following file: