本文整理汇总了PHP中t3lib_div::get_dirs方法的典型用法代码示例。如果您正苦于以下问题:PHP t3lib_div::get_dirs方法的具体用法?PHP t3lib_div::get_dirs怎么用?PHP t3lib_div::get_dirs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类t3lib_div
的用法示例。
在下文中一共展示了t3lib_div::get_dirs方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSkins
/**
* Get defined Skin for drupdown
* @return array
*/
function getSkins($config, $item)
{
$confArr = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['imagecarousel']);
if (!is_dir(t3lib_div::getFileAbsFileName($confArr['skinFolder']))) {
// if the defined folder does not exist, define the default folder
$confArr['skinFolder'] = "EXT:imagecarousel/res/skins/";
}
$items = t3lib_div::get_dirs(t3lib_div::getFileAbsFileName($confArr['skinFolder']));
if (count($items) > 0) {
$optionList = array();
foreach ($items as $key => $item) {
$item = trim($item);
if (!preg_match('/^\\./', $item)) {
$optionList[] = array($item, $item);
}
}
$config['items'] = array_merge($config['items'], $optionList);
}
return $config;
}
示例2: getFlatInstExtList
/**
* Gathers all extensions in $path
*
* @param string Absolute path to local, global or system extensions
* @param array Array with information for each extension key found. Notice: passed by reference
* @param array Categories index: Contains extension titles grouped by various criteria.
* @param string Path-type: L, G or S
* @return void "Returns" content by reference
* @access private
* @see getInstalledExtensions()
*/
function getFlatInstExtList($path, &$list, $type)
{
if (@is_dir($path)) {
$extList = t3lib_div::get_dirs($path);
if (is_array($extList)) {
foreach ($extList as $extKey) {
$this->singleExtInfo($extKey, $path, $list, $type);
}
}
}
}
示例3: makeCheckboxesForLocalExtensions
/**
* Generates checkboxes with the extension keys locally available for this install.
*
* @return string list of checkboxes for selecting the local extension to work on (or error message)
*/
function makeCheckboxesForLocalExtensions($localExtensionDir)
{
$path = PATH_site.$localExtensionDir;
if (@is_dir($path)) {
$dirs = $this->extensionList = t3lib_div::get_dirs($path);
if (is_array($dirs)) {
sort($dirs);
$c = 0;
$opt = array();
foreach ($dirs as $dirName) {
// only display loaded extensions
if (t3lib_extMgm::isLoaded($dirName)) {
foreach (array('/t3jquery.txt', '/Configuration/t3jquery.txt') as $file_location) {
if (@file_exists($path.$dirName.$file_location)) {
// Get extension info from ext_emconf.php
$extInfo = $this->includeEMCONF($path.$dirName.'/ext_emconf.php', $dirName);
if (is_array($_POST['ext'])) {
$selVal = in_array($path.$dirName.$file_location, $_POST['ext']) ? ' checked="checked"' : '';
}
$c++;
$opt[] = '
<tr class="bgColor4" valign="top">
<td><input name="ext[]" type="checkbox" id="ext'.$c.'" class="extkey" value="'.htmlspecialchars($path.$dirName.$file_location).'"'.$selVal.' /></td>
<td title="'.htmlspecialchars($extInfo['description']).'" nowrap><label for="ext'.$c.'">'.htmlspecialchars($extInfo['title']).'</label></td>
<td nowrap>'.htmlspecialchars($dirName).'</td>
<td nowrap>'.htmlspecialchars($extInfo['version']).'</td>
</tr>';
}
}
}
}
return implode(' ',$opt);
}
} else {
return '
<tr><td>ERROR: Extensions path: "'.$path.'" not found!</td></tr>';
}
}
示例4: getAllFilesAndFoldersInPath
/**
* Recursively gather all files and folders of extension path.
*
* @param array Array of files to which new files are added
* @param string Path to look up files in
* @param string List of file extensions to include. Blank = all
* @param boolean If set, directories are included as well.
* @return array $fileArr with new entries added.
*/
function getAllFilesAndFoldersInPath($fileArr, $extPath, $extList = '', $regDirs = 0)
{
if ($regDirs) {
$fileArr[] = $extPath;
}
$fileArr = array_merge($fileArr, t3lib_div::getFilesInDir($extPath, $extList, 1, 1));
$dirs = t3lib_div::get_dirs($extPath);
if (is_array($dirs)) {
foreach ($dirs as $subdirs) {
if ($subdirs && (strcmp($subdirs, 'CVS') || !$this->noCVS)) {
$fileArr = $this->getAllFilesAndFoldersInPath($fileArr, $extPath . $subdirs . '/', $extList, $regDirs);
}
}
}
return $fileArr;
}
示例5: getExtensionListForScope
/**
* Get the list of extensions in the given scope
*
* @param string $scope
* @return boolean
*/
protected function getExtensionListForScope($scope)
{
$path = $this->getPathForScope($scope);
$extensionInfo = array();
if (@is_dir($path)) {
$extensionFolders = t3lib_div::get_dirs($path);
if (is_array($extensionFolders)) {
foreach ($extensionFolders as $extKey) {
$extensionInfo[$extKey]['ext_key'] = $extKey;
$extensionInfo[$extKey]['installed'] = (bool) t3lib_extMgm::isLoaded($extKey);
if (@is_file($path . $extKey . '/ext_emconf.php')) {
$_EXTKEY = $extKey;
@(include $path . $extKey . '/ext_emconf.php');
$extensionVersion = $EM_CONF[$extKey]['version'];
} else {
$extensionVersion = FALSE;
}
if ($extensionVersion) {
$extensionInfo[$extKey]['version'] = $extensionVersion;
$extensionInfo[$extKey]['scope'][$scope] = $extensionVersion;
}
}
}
}
return $extensionInfo;
}
开发者ID:IchHabRecht,项目名称:caretaker_instance,代码行数:32,代码来源:class.tx_caretakerinstance_Operation_GetExtensionList.php
示例6: getFolderTree
/**
* Fetches the data for the tree
*
* @param string Abs file path
* @param integer Max depth (recursivity limit)
* @return integer The count of items on the level
* @see getBrowsableTree()
*/
function getFolderTree($files_path, $depth = 999, $type = '')
{
// This generates the directory tree
$dirs = t3lib_div::get_dirs($files_path);
if (!is_array($dirs)) {
return 0;
}
sort($dirs);
$c = count($dirs);
$depth = intval($depth);
$HTML = '';
$a = 0;
foreach ($dirs as $key => $val) {
$a++;
$this->tree[] = array();
// Reserve space.
end($this->tree);
$treeKey = key($this->tree);
// Get the key for this space
$val = preg_replace('/^\\.\\//', '', $val);
$title = $val;
$path = $files_path . $val . '/';
$specUID = t3lib_div::md5int($path);
$this->specUIDmap[$specUID] = $path;
$row = array();
$row['path'] = $path;
$row['uid'] = $specUID;
$row['title'] = $title;
// Make a recursive call to the next level
if ($depth > 1 && $this->expandNext($specUID)) {
$nextCount = $this->getFolderTree($path, $depth - 1, $this->makeHTML ? '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/ol/' . ($a == $c ? 'blank' : 'line') . '.gif', 'width="18" height="16"') . ' alt="" />' : '', $type);
$exp = 1;
// Set "did expand" flag
} else {
$nextCount = $this->getCount($path);
$exp = 0;
// Clear "did expand" flag
}
// Set HTML-icons, if any:
if ($this->makeHTML) {
$HTML = $this->PMicon($row, $a, $c, $nextCount, $exp);
$webpath = t3lib_BEfunc::getPathType_web_nonweb($path);
if (is_writable($path)) {
$type = '';
$overlays = array();
} else {
$type = 'readonly';
$overlays = array('status-overlay-locked' => array());
}
if ($webpath == 'web') {
$icon = 'apps-filetree-folder-default';
} else {
$icon = 'apps-filetree-folder-default';
}
if ($val == '_temp_') {
$icon = 'apps-filetree-folder-temp';
$row['title'] = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:temp', true);
$row['_title'] = '<strong>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:temp', true) . '</strong>';
}
if ($val == '_recycler_') {
$icon = 'apps-filetree-folder-recycler';
$row['title'] = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:recycler', true);
$row['_title'] = '<strong>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:recycler', true) . '</strong>';
}
$HTML .= $this->wrapIcon(t3lib_iconWorks::getSpriteIcon($icon, array('title' => $row['title']), $overlays), $row);
}
// Finally, add the row/HTML content to the ->tree array in the reserved key.
$this->tree[$treeKey] = array('row' => $row, 'HTML' => $HTML, 'hasSub' => $nextCount && $this->expandNext($specUID), 'isFirst' => $a == 1, 'isLast' => false, 'invertedDepth' => $depth, 'bank' => $this->bank);
}
if ($a) {
$this->tree[$treeKey]['isLast'] = true;
}
return $c;
}
示例7: getFolderTree
/**
* Fetches the data for the tree
*
* @param string Abs file path
* @param integer Max depth (recursivity limit)
* @param string HTML-code prefix for recursive calls.
* @return integer The count of items on the level
* @see getBrowsableTree()
*/
function getFolderTree($files_path, $depth = 999, $depthData = '')
{
// This generates the directory tree
$dirs = t3lib_div::get_dirs($files_path);
$c = 0;
if (is_array($dirs)) {
$depth = intval($depth);
$HTML = '';
$a = 0;
$c = count($dirs);
natcasesort($dirs);
foreach ($dirs as $key => $val) {
$a++;
$this->tree[] = array();
// Reserve space.
end($this->tree);
$treeKey = key($this->tree);
// Get the key for this space
$LN = $a == $c ? 'blank' : 'line';
$val = preg_replace('/^\\.\\//', '', $val);
$title = $val;
$path = $files_path . $val . '/';
$md5_uid = md5($path);
$specUID = hexdec(substr($md5_uid, 0, 6));
$this->specUIDmap[$specUID] = $path;
$row = array();
$row['path'] = $path;
$row['uid'] = $specUID;
$row['title'] = $title;
if ($depth > 1 && $this->expandNext($specUID)) {
$nextCount = $this->getFolderTree($path, $depth - 1, $this->makeHTML ? $depthData . '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/ol/' . $LN . '.gif', 'width="18" height="16"') . ' alt="" />' : '');
$exp = 1;
// Set "did expand" flag
} else {
$nextCount = $this->getCount($path);
$exp = 0;
// Clear "did expand" flag
}
// Set HTML-icons, if any:
if ($this->makeHTML) {
$HTML = $depthData . $this->PMicon($row, $a, $c, $nextCount, $exp);
$pathInfo = tx_dam::path_compileInfo($path);
$HTML .= $this->wrapIcon(tx_dam::icon_getFileTypeImgTag($pathInfo), $row);
}
// Finally, add the row/HTML content to the ->tree array in the reserved key.
$this->tree[$treeKey] = array('row' => $row, 'HTML' => $HTML, 'bank' => $this->bank);
}
}
return $c;
}
示例8: getAllFilesAndFoldersInPath
/**
* Recursively gather all files and folders of a path.
* Usage: 5
*
* @param array $fileArr: Empty input array (will have files added to it)
* @param string $path: The path to read recursively from (absolute) (include trailing slash!)
* @param string $extList: Comma list of file extensions: Only files with extensions in this list (if applicable) will be selected.
* @param boolean $regDirs: If set, directories are also included in output.
* @param integer $recursivityLevels: The number of levels to dig down...
* @return array An array with the found files/directories.
*/
function getAllFilesAndFoldersInPath($fileArr, $path, $extList = '', $regDirs = 0, $recursivityLevels = 99)
{
if ($regDirs) {
$fileArr[] = $path;
}
$fileArr = array_merge($fileArr, t3lib_div::getFilesInDir($path, $extList, 1, 1));
$dirs = t3lib_div::get_dirs($path);
if (is_array($dirs) && $recursivityLevels > 0) {
foreach ($dirs as $subdirs) {
if ((string) $subdirs != '') {
$fileArr = t3lib_div::getAllFilesAndFoldersInPath($fileArr, $path . $subdirs . '/', $extList, $regDirs, $recursivityLevels - 1);
}
}
}
return $fileArr;
}
示例9: sorting4folders
function sorting4folders($curpath, $sort = 'ASC', $limit = 0)
{
// config
$folderArray = t3lib_div::get_dirs($curpath);
// get all directories in current path
$sortFileName = '_sorting.txt';
// default filename for sorting file
// Let's go
if (is_array($folderArray)) {
// 1. Automatic sorting
switch ($sort) {
// sortmode
case 'random':
// shuffle array
shuffle($folderArray);
break;
case 'DESC':
// alphabetical descendening
arsort($folderArray);
break;
default:
// default
// default
case 'ASC':
// or ASC
asort($folderArray);
break;
}
// 2. Manual sorting (if _sorting.txt exists)
if (file_exists($curpath . $sortFileName)) {
// if txt file to main folder exists
$content = t3lib_div::getURL($curpath . $sortFileName);
// read txtfile
$content = str_replace(array(',', ';', '|'), "\n", $content);
// rewrite , ; | to linebreaks
$contentarray = t3lib_div::trimExplode("\n", $content, 1);
// split every line
$manArray = array();
// init new tmp array
for ($i = 0; $i < count($contentarray); $i++) {
// one loop for every line in _sorting.txt
if (in_array($contentarray[$i], $folderArray)) {
// if current foldername really exists in folder array
$manArray[] = $contentarray[$i];
}
}
if (count($manArray) > 0) {
// if there are folders in the manArray
$folderArray = array_merge($manArray, $folderArray);
// add folderArray to manualArray
$folderArray = array_unique($folderArray);
// clean douplicated entries in the array
}
}
// 3. Cut array im limit is set
if ($limit) {
$tmp_array = array_chunk($folderArray, $limit);
// split array in same parts
$folderArray = $tmp_array[0];
// take first part of array
}
}
return $folderArray;
// always return folderArray
}
示例10: makeDetailedExtensionAnalysis
//.........这里部分代码省略.........
$knownModuleList = t3lib_div::trimExplode(',', $extInfo['EM_CONF']['module'], 1);
foreach ($knownModuleList as $mod) {
if (@is_dir($absPath . $mod)) {
if (@is_file($absPath . $mod . '/conf.php')) {
$confFileInfo = $this->modConfFileAnalysis($absPath . $mod . '/conf.php');
if (is_array($confFileInfo['TYPO3_MOD_PATH'])) {
$shouldBePath = $this->typeRelPaths[$extInfo['type']] . $extKey . '/' . $mod . '/';
if (strcmp($confFileInfo['TYPO3_MOD_PATH'][1][1], $shouldBePath)) {
$infoArray['errors'][] = sprintf($GLOBALS['LANG']->getLL('detailedExtAnalysis_wrong_mod_path'), $confFileInfo['TYPO3_MOD_PATH'][1][1], $shouldBePath);
}
} else {
// It seems like TYPO3_MOD_PATH and therefore also this warning is no longer needed.
// $infoArray['errors'][] = 'No definition of TYPO3_MOD_PATH constant found inside!';
}
if (is_array($confFileInfo['MCONF_name'])) {
$mName = $confFileInfo['MCONF_name'][1][1];
$mNameParts = explode('_', $mName);
$infoArray['moduleNames'][] = $mName;
if (!t3lib_div::isFirstPartOfStr($mNameParts[0], $module_prefix) && (!$mNameParts[1] || !t3lib_div::isFirstPartOfStr($mNameParts[1], $module_prefix))) {
$infoArray['NSerrors']['modname'][] = $mName;
} else {
$infoArray['NSok']['modname'][] = $mName;
}
} else {
$infoArray['errors'][] = $GLOBALS['LANG']->getLL('detailedExtAnalysis_mconf_missing');
}
} else {
$infoArray['errors'][] = sprintf($GLOBALS['LANG']->getLL('detailedExtAnalysis_be_module_conf_missing'), $mod . '/conf.php');
}
} else {
$infoArray['errors'][] = sprintf($GLOBALS['LANG']->getLL('detailedExtAnalysis_module_folder_missing'), $mod . '/');
}
}
$dirs = t3lib_div::get_dirs($absPath);
if (is_array($dirs)) {
reset($dirs);
while (list(, $mod) = each($dirs)) {
if (!in_array($mod, $knownModuleList) && @is_file($absPath . $mod . '/conf.php')) {
$confFileInfo = $this->modConfFileAnalysis($absPath . $mod . '/conf.php');
if (is_array($confFileInfo)) {
$infoArray['errors'][] = sprintf($GLOBALS['LANG']->getLL('detailedExtAnalysis_unconfigured_module'), $mod . '/conf.php');
}
}
}
}
// ext_tables.php:
if (@is_file($absPath . 'ext_tables.php')) {
$content = t3lib_div::getUrl($absPath . 'ext_tables.php');
if (stristr($content, 't3lib_extMgm::addModule')) {
$infoArray['flags'][] = $GLOBALS['LANG']->getLL('detailedExtAnalysis_module');
}
if (stristr($content, 't3lib_extMgm::insertModuleFunction')) {
$infoArray['flags'][] = $GLOBALS['LANG']->getLL('detailedExtAnalysis_module_and_more');
}
if (stristr($content, 't3lib_div::loadTCA')) {
$infoArray['flags'][] = $GLOBALS['LANG']->getLL('detailedExtAnalysis_loadTCA');
}
if (stristr($content, '$TCA[')) {
$infoArray['flags'][] = $GLOBALS['LANG']->getLL('detailedExtAnalysis_TCA');
}
if (stristr($content, 't3lib_extMgm::addPlugin')) {
$infoArray['flags'][] = $GLOBALS['LANG']->getLL('detailedExtAnalysis_plugin');
}
}
// ext_localconf.php:
if (@is_file($absPath . 'ext_localconf.php')) {
示例11: expandFolder
/**
* For RTE: This displays all files from folder. No thumbnails shown
*
* @param string The folder path to expand
* @param string List of fileextensions to show
* @return string HTML output
*/
function expandFolder($expandFolder = 0, $extensionList = '')
{
global $BACK_PATH;
$expandFolder = $expandFolder ? $expandFolder : $this->expandFolder;
$out = '<table cellspacing="0" cellpadding="0" border="0" style="margin: 0pt; width: 100%;">';
if ($expandFolder && $this->checkFolder($expandFolder)) {
// Prepare current path value for comparison (showing red arrow)
if (!$this->curUrlInfo['value']) {
$cmpPath = '';
} else {
$cmpPath = PATH_site . $this->curUrlInfo['info'];
}
// Create header element; The folder from which files are listed.
$titleLen = 35;
$picon = '<td style="width: 20px;"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/i/_icon_webfolders.gif', 'width="18" height="16"') . ' alt="" /></td>';
$piconLink = htmlspecialchars(t3lib_div::fixed_lgd_cs(basename($expandFolder), $titleLen));
$picon .= '<td colspan="2"><a href="#" onclick="return link_insert(\'' . t3lib_div::rawUrlEncodeFP(substr($expandFolder, strlen(PATH_site))) . '\');">' . $piconLink . '</a></td>';
if ($this->curUrlInfo['act'] == 'folder' && $cmpPath == $expandFolder) {
$out .= '<tr style="background: #b7bac0;">';
//$out.= '<img'.t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/blinkarrow_left.gif', 'width="5" height="9"') . ' class="c-blinkArrowL" alt="" />';
} else {
$out .= '<tr>';
}
$out .= $picon . '</tr>';
// Get files from the folder:
if ($this->mode == 'wizard' && $this->act == 'folder') {
$files = t3lib_div::get_dirs($expandFolder);
} else {
$files = t3lib_div::getFilesInDir($expandFolder, $extensionList, 1, 1);
// $extensionList='', $prependPath=0, $order='')
}
$c = 0;
$cc = count($files);
if (is_array($files)) {
foreach ($files as $filepath) {
$c++;
$fI = pathinfo($filepath);
if ($this->mode == 'wizard' && $this->act == 'folder') {
$filepath = $expandFolder . $filepath . '/';
$icon = '<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/i/_icon_webfolders.gif', 'width="18" height="16"') . ' alt="" />';
} else {
// File icon:
$icon = t3lib_BEfunc::getFileIcon(strtolower($fI['extension']));
// Get size and icon:
$size = ' (' . t3lib_div::formatSize(filesize($filepath)) . 'bytes)';
$icon = '<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/fileicons/' . $icon . '', 'width="18" height="16"') . ' title="' . htmlspecialchars($fI['basename'] . $size) . '" alt="" />';
}
// If the listed file turns out to be the CURRENT file, then show blinking arrow:
if (($this->curUrlInfo['act'] == 'file' || $this->curUrlInfo['act'] == 'folder') && $cmpPath == $filepath) {
$current = 'style="background: #b7bac0;"';
//$arrCol='<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/blinkarrow_left.gif','width="5" height="9"').' class="c-blinkArrowL" alt="" />';
} else {
$current = '';
//$arrCol='';
}
// Put it all together for the file element:
$out .= '<tr ' . $current . '>' . '<td><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/ol/join' . ($c == $cc ? 'bottom' : '') . '.gif', 'width="18" height="16"') . ' alt="" /></td>' . '<td style="width: 18px;">' . $icon . '</td>' . '<td><a href="#" onclick="return link_insert(\'' . t3lib_div::rawUrlEncodeFP(substr($filepath, strlen(PATH_site))) . '\');">' . htmlspecialchars(t3lib_div::fixed_lgd_cs(basename($filepath), $titleLen)) . '</a></td></tr>';
}
}
}
$out .= '</table>';
return $out;
}
示例12: getFolder
/**
* Function getFolder traverses the target directory,
* locates all iconFiles and collects them into an array
*
* @param string path to an folder which contains images
* @return array returns an array with all files key: iconname, value: fileName
*/
protected function getFolder($directoryPath)
{
$subFolders = t3lib_div::get_dirs(PATH_site . $directoryPath);
if (!$this->ommitSpriteNameInIconName) {
$subFolders[] = '';
}
$resultArray = array();
foreach ($subFolders as $folder) {
if ($folder !== '.svn') {
$icons = t3lib_div::getFilesInDir(PATH_site . $directoryPath . $folder . '/', 'gif,png,jpg');
if (!in_array($folder, $this->spriteBases) && count($icons) && $folder !== '') {
$this->spriteBases[] = $folder;
}
foreach ($icons as $icon) {
$fileInfo = pathinfo($icon);
$iconName = ($folder ? $folder . '-' : '') . $fileInfo['filename'];
if (!$this->ommitSpriteNameInIconName) {
$iconName = $this->spriteName . '-' . $iconName;
}
$resultArray[$iconName] = $directoryPath . $folder . '/' . $icon;
}
}
}
return $resultArray;
}
示例13: getStaticTemplatesInPath
/**
* Gets the items array for a given configuration type (base or site) and path.
*
* @param integer $configurationType
* @param string $relativeConfigurationPath
* @return array
*/
protected static function getStaticTemplatesInPath($configurationType, $relativeConfigurationPath)
{
$params = array();
$params['items'] = array();
$name = basename(PATH_site . $relativeConfigurationPath);
$prefix = self::getStaticTemplatePrefix();
// Default TS
$pathToTS = trim($relativeConfigurationPath, '/') . '/Default/Configuration/TypoScript/';
if (@is_dir(PATH_site . $pathToTS)) {
switch ($configurationType) {
case self::PATH_TYPE_BASE:
$configurationName = $configurationKey . ' (Base)';
break;
case self::PATH_TYPE_SITE:
$configurationName = $configurationKey . ' (' . $name . ')';
}
$params['items'][] = array($prefix . ': ' . $configurationName, $pathToTS);
}
// Extension TS
$configurations = t3lib_div::get_dirs(PATH_site . rtrim($relativeConfigurationPath, '/') . '/Extensions/');
foreach ((array) $configurations as $configurationKey) {
$pathToTS = trim($relativeConfigurationPath, '/') . '/Extensions/' . $configurationKey . '/Configuration/TypoScript/';
if (@is_dir(PATH_site . $pathToTS)) {
switch ($configurationType) {
case self::PATH_TYPE_BASE:
$configurationName = $configurationKey . ' (Base)';
break;
case self::PATH_TYPE_SITE:
$configurationName = $configurationKey . ' (' . $name . ')';
}
$params['items'][] = array($prefix . ': EXT:' . $configurationName, $pathToTS);
}
}
// addStaticTemplates TS
$configurations = t3lib_div::get_dirs(PATH_site . rtrim($relativeConfigurationPath, '/') . '/StaticTemplates/');
foreach ((array) $configurations as $configurationKey) {
$pathToTS = trim($relativeConfigurationPath, '/') . '/StaticTemplates/' . $configurationKey . '/Configuration/TypoScript/';
if (@is_dir(PATH_site . $pathToTS)) {
switch ($configurationType) {
case self::PATH_TYPE_BASE:
$configurationName = $configurationKey . ' (Base)';
break;
case self::PATH_TYPE_SITE:
$configurationName = $configurationKey . ' (' . $name . ')';
}
$params['items'][] = array($prefix . ': ' . $configurationName, $pathToTS);
}
}
return $params;
}
示例14: getEasyaccordionSkin
/**
* Get all skins for easyAccordion
* @return array
*/
public function getEasyaccordionSkin($config, $item)
{
$confArr = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['jfmulticontent']);
if (!is_dir(t3lib_div::getFileAbsFileName($confArr['easyAccordionSkinFolder']))) {
// if the defined folder does not exist, define the default folder
$confArr['easyAccordionSkinFolder'] = "EXT:jfmulticontent/res/easyaccordion/skins/";
}
$items = t3lib_div::get_dirs(t3lib_div::getFileAbsFileName($confArr['easyAccordionSkinFolder']));
if (count($items) > 0) {
$optionList = array();
foreach ($items as $key => $item) {
$item = trim($item);
if (!preg_match('/^\\./', $item)) {
$optionList[] = array(ucfirst($item), $item);
}
}
$config['items'] = array_merge($config['items'], $optionList);
}
return $config;
}
示例15: findFile
/**
* Searching for filename pattern recursively in the specified dir.
*
* @param string Base directory
* @param string Match pattern
* @param array Array of matching files, passed by reference
* @param integer Depth to recurse
* @return array Array with various information about the search result
* @see func_filesearch()
*/
function findFile($basedir, $pattern, &$matching_files, $depth)
{
$files_searched = 0;
$dirs_searched = 0;
$dirs_error = 0;
// Traverse files:
$files = t3lib_div::getFilesInDir($basedir, '', 1);
if (is_array($files)) {
$files_searched += count($files);
foreach ($files as $value) {
if (preg_match('/' . $pattern . '/i', basename($value))) {
$matching_files[] = substr($value, strlen(PATH_site));
}
}
}
// Traverse subdirs
if ($depth > 0) {
$dirs = t3lib_div::get_dirs($basedir);
if (is_array($dirs)) {
$dirs_searched += count($dirs);
foreach ($dirs as $value) {
$inf = $this->findFile($basedir . $value . '/', $pattern, $matching_files, $depth - 1);
$dirs_searched += $inf[0];
$files_searched += $inf[1];
$dirs_error = $inf[2];
}
}
} else {
$dirs = t3lib_div::get_dirs($basedir);
if (is_array($dirs) && count($dirs)) {
$dirs_error = 1;
// Means error - there were further subdirs!
}
}
return array($dirs_searched, $files_searched, $dirs_error);
}