function sitetemplate_get_apps() { $dir = new Dir('inc/app'); $apps = array(); foreach ($dir->readAll() as $file) { if ($file != 'CVS' && strpos($file, '.') !== 0) { if (@file_exists('inc/app/' . $file . '/conf/config.ini.php')) { $apps[] = $file; } } } return $apps; }
$cgi->format = 'html'; } // get the path root from the boxchooser-path session variable, // and if not then default to /inc/data. $data = array('location' => '/inc/app', 'boxes' => array(), 'name' => $parameters['name']); $path = session_get('boxchooser_path'); if (!$path) { $path = $root; $data['base_nice_url'] = "Standard Boxes"; } else { $data['base_nice_url'] = $path; } $applications = parse_ini_file('inc/conf/auth/applications/index.php'); // get all the data $dir = new Dir($path); foreach ($dir->readAll() as $file) { if ($file != 'CVS' && strpos($file, '.') !== 0) { if (file_exists($path . '/' . $file . '/conf/config.ini.php')) { $config_file = parse_ini_file($path . '/' . $file . '/conf/config.ini.php'); if (!$config_file['boxchooser']) { continue; } if (isset($applications[$file]) && !$applications[$file]) { continue; } if ($config_file['app_name']) { //add data to the boxes array $temp = $config_file['description']; $desc = $file; if ($temp != '') { $desc = $temp;
/** * List all the apps that contain workflow services. Return value is * a hash of the app names (keys) and the app display names (values). * * @access public * @return array * */ function getApps() { $apps = array(); loader_import('saf.File.Directory'); $d = new Dir('inc/app'); foreach ($d->readAll() as $file) { if (strpos($file, '.') === 0 || !file_exists('inc/app/' . $file . '/conf/config.ini.php')) { continue; } $c = ini_parse('inc/app/' . $file . '/conf/config.ini.php', false); if ($c['workflow']) { $apps[$file] = $c['app_name']; } } return $apps; }
/** * Returns a list of collection names for use in looping * through multiple collections at a time. Called as a * static method, ie. Rex::getCollections (). * * @return array */ function getCollections() { loader_import('saf.File.Directory'); $dir = new Dir('inc/app/cms/conf/collections'); $list = array(); foreach ($dir->readAll() as $file) { if (strpos($file, '.') === 0 || !strstr($file, '.php')) { continue; } $list[] = str_replace('.php', '', $file); } $dir->close(); return $list; }
loader_import('saf.File.Directory'); if (empty($cgi->format)) { $cgi->format = 'html'; } $data = array('location' => 'inc/html', 'base_nice_url' => 'Standard Templates', 'template_sets' => array()); page_title(intl_get('Choose a Template')); $path = session_get('sitetemplate_path'); if (!$path) { $path = $root; } else { $data['base_nice_url'] = $path; } //page_title (intl_get ('Folder') . ': ' . $data['location']); $template_sets = new Dir($path); $config_file; foreach ($template_sets->readAll() as $file) { if ($file == 'CVS' || strpos($file, '.') === 0 || !@is_dir('inc/html/' . $file)) { continue; } if (file_exists($path . '/' . $file . '/config.ini.php')) { $config_file = parse_ini_file($path . '/' . $file . '/config.ini.php'); } else { $config_file = array(); } $desc = $config_file['description']; $set_name = $config_file['set_name']; if ($set_name == '') { $set_name = str_replace('inc/html/', '', $file); } if ($desc == '') { $desc = $set_name;
/** * Fetches all the files in a directory in a single command, * ie. $files = Dir::fetch ('foo/bar'); * * @access public * @param string $path * @return array files * */ function fetch($path, $skipDots = false) { $d = new Dir($path); if (!$d) { return array(); } $files = $d->readAll(); if ($skipDots) { foreach ($files as $k => $v) { if (strpos($v, '.') === 0) { unset($files[$k]); } } } //$d->close (); return $files; }