public function find_installed_apps($CurrentUser) { $this->apps = array(); if (!$CurrentUser->logged_in()) { return; } $a = array(); foreach ($this->core_apps as $core_app) { $a[] = array('filename' => $core_app, 'path' => PerchUtil::file_path(PERCH_CORE . '/apps/' . $core_app)); } if (is_dir(PerchUtil::file_path(PERCH_PATH . '/addons/apps'))) { if ($dh = opendir(PerchUtil::file_path(PERCH_PATH . '/addons/apps'))) { while (($file = readdir($dh)) !== false) { if (substr($file, 0, 1) != '.' && !preg_match($this->ignore_pattern, $file) && substr($file, 0, 1) != '_') { if (is_dir(PerchUtil::file_path(PERCH_PATH . '/addons/apps/' . $file))) { $a[] = array('filename' => $file, 'path' => PerchUtil::file_path(PERCH_PATH . '/addons/apps/' . $file)); } } } closedir($dh); } } if (is_array($a)) { foreach ($a as &$app) { $file = PerchUtil::file_path($app['path'] . '/admin.php'); if (file_exists($file)) { include $file; } } } if (PERCH_RUNWAY) { $Runway = PerchRunway::fetch(); $Runway->find_collections_for_app_menu($CurrentUser); } $this->apps = PerchUtil::super_sort($this->apps, 'priority', 'label'); }