Esempio n. 1
0
 private function renderComponent($componentName, $section)
 {
     if (is_readable($filePath = $this->getComponentPath($componentName))) {
         $plugin = null;
         if (($pluginName = dirname($componentName)) !== '.') {
             $pluginsMediator = $this->app['plugins'];
             $plugin = $pluginsMediator->getPlugin(getPluginClassname($pluginName));
         }
         return $this->render($filePath, $this->getUri('../' . $componentName . '/'), $section, $plugin);
     }
 }
Esempio n. 2
0
function getPluginList(array $except = [])
{
    $plugins = [];
    if (is_dir(_PLUGINS_) && ($handle = opendir(_PLUGINS_))) {
        while (false !== ($entry = readdir($handle))) {
            if (strlen($entry) > 1 && $entry[0] !== '.' && $entry[0] !== '_' && is_dir(_PLUGINS_ . $entry) && !in_array($entry, $except)) {
                $plugins[] = getPluginClassname($entry);
            }
        }
        closedir($handle);
    }
    return $plugins;
}