GetAllFolders() public static method

Returns an array containing the directories tree for the given path.
public static GetAllFolders ( array $p_folders ) : array
$p_folders array
return array $p_folders
Example #1
0
// $articles array:
// The articles that were initially selected to perform the move or duplicate upon.
$templates = array();
for ($i = 0; $i < count($f_template_code); $i++) {
	$tmpTemplate = new Template($f_template_code[$i]);
	$templates[] = $tmpTemplate;
}

if (!Input::IsValid()) {
	camp_html_display_error(getGS('Invalid input: $1', Input::GetErrorString()));
	exit;
}

// Get all the templates
$folders = array();
$folders = Template::GetAllFolders($folders);
$i = 1;
foreach ($folders as $folder) {
	$tmpTemplateFolder = substr($folder, strlen($Campsite['TEMPLATE_DIRECTORY']));
	if ($f_current_folder != $tmpTemplateFolder) {
		$folders[$i++] = $tmpTemplateFolder;
	}
}
if ($f_current_folder != '/') {
	$folders[0] = '/';
} else {
	array_shift($folders);
}

//
// This section is executed when the user finally hits the action button.