本文整理汇总了PHP中PackageList::get方法的典型用法代码示例。如果您正苦于以下问题:PHP PackageList::get方法的具体用法?PHP PackageList::get怎么用?PHP PackageList::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PackageList
的用法示例。
在下文中一共展示了PackageList::get方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: export
public static function export($xml) {
$packages = PackageList::get()->getPackages();
$pkgs = $xml->addChild("packages");
foreach($packages as $pkg) {
$node = $pkgs->addChild('package');
$node->addAttribute('handle', $pkg->getPackageHandle());
}
}
示例2: changeLocale
static function changeLocale($locale)
{
// change core language to translate e.g. core blocks/themes
if (strlen($locale)) {
Localization::changeLocale($locale);
// site translations
$loc = Localization::getInstance();
$loc->addSiteInterfaceLanguage($locale);
// add package translations
$pl = PackageList::get();
$installed = $pl->getPackages();
foreach ($installed as $pkg) {
if ($pkg instanceof Package) {
$pkg->setupPackageLocalization($locale);
}
}
}
}
示例3: getHandle
public static function getHandle($pkgID)
{
if ($pkgID < 1) {
return false;
}
$pkgHandle = Cache::get('pkgHandle', $pkgID);
if ($pkgHandle != false) {
return $pkgHandle;
}
$pl = PackageList::get();
$handle = null;
$plitems = $pl->getPackages();
foreach ($plitems as $p) {
if ($p->getPackageID() == $pkgID) {
$handle = $p->getPackageHandle();
break;
}
}
Cache::set('pkgHandle', $pkgID, $handle);
return $handle;
}
示例4: computeView
private function computeView() {
$bFilename = $this->bFilename;
$obj = $this->obj;
// if we've passed in "templates/" as the first part, we strip that off.
if (strpos($bFilename, 'templates/') === 0) {
$bFilename = substr($bFilename, 10);
}
if ($bFilename) {
if (is_file(DIR_FILES_BLOCK_TYPES . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename)) {
$template = DIR_FILES_BLOCK_TYPES . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename;
$bv = new BlockView();
$bv->setBlockObject($obj);
$this->baseURL = $bv->getBlockURL();
$this->basePath = $bv->getBlockPath($this->render);
} else if (is_file(DIR_FILES_BLOCK_TYPES_CORE . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename)) {
$template = DIR_FILES_BLOCK_TYPES_CORE . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename;
$this->baseURL = ASSETS_URL . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle();
$this->basePath = DIR_FILES_BLOCK_TYPES_CORE . '/' . $obj->getBlockTypeHandle();
} else if (is_dir(DIR_FILES_BLOCK_TYPES . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename)) {
$template = DIR_FILES_BLOCK_TYPES . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename . '/' . $this->render;
$this->baseURL = DIR_REL . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename;
} else if (is_dir(DIR_FILES_BLOCK_TYPES_CORE . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename)) {
$template = DIR_FILES_BLOCK_TYPES_CORE . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename . '/' . $this->render;
$this->baseURL = ASSETS_URL . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename;
}
// we check all installed packages
if (!isset($template)) {
$pl = PackageList::get();
$packages = $pl->getPackages();
foreach($packages as $pkg) {
$d = '';
if (is_dir(DIR_PACKAGES . '/' . $pkg->getPackageHandle())) {
$d = DIR_PACKAGES . '/'. $pkg->getPackageHandle();
} else if (is_dir(DIR_PACKAGES_CORE . '/'. $pkg->getPackageHandle())) {
$d = DIR_PACKAGES_CORE . '/'. $pkg->getPackageHandle();
}
if ($d != '') {
$baseStub = (is_dir(DIR_PACKAGES . '/' . $pkg->getPackageHandle())) ? DIR_REL . '/' . DIRNAME_PACKAGES . '/'. $pkg->getPackageHandle() : ASSETS_URL . '/'. DIRNAME_PACKAGES . '/' . $pkg->getPackageHandle();
if (is_file($d . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle() . '/' . $bFilename)) {
$template = $d . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle() . '/' . $bFilename;
$this->baseURL = ASSETS_URL . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle();
$this->basePath = DIR_FILES_BLOCK_TYPES_CORE . '/' . $obj->getBlockTypeHandle();
} else if (is_file($d . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename)) {
$template = $d . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename;
$this->baseURL = $baseStub . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle();
$this->basePath = $d . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle();
} else if (is_dir($d . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename)) {
$template = $d . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename . '/' . $this->render;
$this->baseURL = $baseStub . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename;
}
}
if ($this->baseURL != '') {
continue;
}
}
}
} else if (file_exists(DIR_FILES_BLOCK_TYPES . '/' . $obj->getBlockTypeHandle() . '.php')) {
$template = DIR_FILES_BLOCK_TYPES . '/' . $obj->getBlockTypeHandle() . '.php';
$bv = new BlockView();
$bv->setBlockObject($obj);
$this->baseURL = $bv->getBlockURL();
$this->basePath = $bv->getBlockPath($this->render);
} else if (file_exists(DIR_FILES_BLOCK_TYPES . '/' . $obj->getBlockTypeHandle() . '/' . $this->render)) {
$template = DIR_FILES_BLOCK_TYPES . '/' . $obj->getBlockTypeHandle() . '/' . $this->render;
$this->baseURL = DIR_REL . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle();
}
if (!isset($template)) {
$bv = new BlockView();
$bv->setBlockObject($obj);
$template = $bv->getBlockPath($this->render) . '/' . $this->render;
$this->baseURL = $bv->getBlockURL();
}
if ($this->basePath == '') {
$this->basePath = dirname($template);
}
$this->template = $template;
}
示例5: get_environment_info
public function get_environment_info()
{
set_time_limit(5);
$environmentMessage = '# ' . t('concrete5 Version') . "\n" . APP_VERSION . "\n\n";
$environmentMessage .= '# ' . t('concrete5 Packages') . "\n";
$pla = PackageList::get();
$pl = $pla->getPackages();
$packages = array();
foreach ($pl as $p) {
if ($p->isPackageInstalled()) {
$packages[] = $p->getPackageName() . ' (' . $p->getPackageVersion() . ')';
}
}
if (count($packages) > 0) {
natcasesort($packages);
$environmentMessage .= implode(', ', $packages);
$environmentMessage .= ".\n";
} else {
$environmentMessage .= t('None') . "\n";
}
$environmentMessage .= "\n";
// overrides
$environmentMessage .= '# ' . t('concrete5 Overrides') . "\n";
$fh = Loader::helper('file');
$overrides = array();
$ovBlocks = $fh->getDirectoryContents(DIR_FILES_BLOCK_TYPES);
$ovControllers = $fh->getDirectoryContents(DIR_FILES_CONTROLLERS);
$ovElements = $fh->getDirectoryContents(DIR_FILES_ELEMENTS);
$ovHelpers = $fh->getDirectoryContents(DIR_HELPERS);
$ovJobs = $fh->getDirectoryContents(DIR_FILES_JOBS);
$ovCSS = $fh->getDirectoryContents(DIR_BASE . '/' . DIRNAME_CSS);
$ovJS = $fh->getDirectoryContents(DIR_BASE . '/' . DIRNAME_JAVASCRIPT);
$ovLng = $fh->getDirectoryContents(DIR_BASE . '/' . DIRNAME_LANGUAGES);
$ovLibs = $fh->getDirectoryContents(DIR_LIBRARIES);
$ovMail = $fh->getDirectoryContents(DIR_FILES_EMAIL_TEMPLATES);
$ovModels = $fh->getDirectoryContents(DIR_MODELS);
$ovSingle = $fh->getDirectoryContents(DIR_FILES_CONTENT);
$ovThemes = $fh->getDirectoryContents(DIR_FILES_THEMES);
$ovTools = $fh->getDirectoryContents(DIR_FILES_TOOLS);
foreach ($ovBlocks as $ovb) {
$overrides[] = DIRNAME_BLOCKS . '/' . $ovb;
}
foreach ($ovControllers as $ovb) {
$overrides[] = DIRNAME_CONTROLLERS . '/' . $ovb;
}
foreach ($ovElements as $ovb) {
$overrides[] = DIRNAME_ELEMENTS . '/' . $ovb;
}
foreach ($ovHelpers as $ovb) {
$overrides[] = DIRNAME_HELPERS . '/' . $ovb;
}
foreach ($ovJobs as $ovb) {
$overrides[] = DIRNAME_JOBS . '/' . $ovb;
}
foreach ($ovJS as $ovb) {
$overrides[] = DIRNAME_JAVASCRIPT . '/' . $ovb;
}
foreach ($ovCSS as $ovb) {
$overrides[] = DIRNAME_CSS . '/' . $ovb;
}
foreach ($ovLng as $ovb) {
$overrides[] = DIRNAME_LANGUAGES . '/' . $ovb;
}
foreach ($ovLibs as $ovb) {
$overrides[] = DIRNAME_LIBRARIES . '/' . $ovb;
}
foreach ($ovMail as $ovb) {
$overrides[] = DIRNAME_MAIL_TEMPLATES . '/' . $ovb;
}
foreach ($ovModels as $ovb) {
$overrides[] = DIRNAME_MODELS . '/' . $ovb;
}
foreach ($ovSingle as $ovb) {
$overrides[] = DIRNAME_PAGES . '/' . $ovb;
}
foreach ($ovThemes as $ovb) {
$overrides[] = DIRNAME_THEMES . '/' . $ovb;
}
foreach ($ovTools as $ovb) {
$overrides[] = DIRNAME_TOOLS . '/' . $ovb;
}
if (count($overrides) > 0) {
$environmentMessage .= implode(', ', $overrides);
$environmentMessage .= "\n";
} else {
$environmentMessage .= t('None') . "\n";
}
$environmentMessage .= "\n";
print $environmentMessage;
$environmentMessage = '# ' . t('Server Software') . "\n" . $_SERVER['SERVER_SOFTWARE'] . "\n\n";
$environmentMessage .= '# ' . t('Server API') . "\n" . php_sapi_name() . "\n\n";
$environmentMessage .= '# ' . t('PHP Version') . "\n" . PHP_VERSION . "\n\n";
$environmentMessage .= '# ' . t('PHP Extensions') . "\n";
if (function_exists('get_loaded_extensions')) {
$gle = @get_loaded_extensions();
natcasesort($gle);
$environmentMessage .= implode(', ', $gle);
$environmentMessage .= ".\n";
} else {
$environmentMessage .= t('Unable to determine.') . "\n";
//.........这里部分代码省略.........
示例6: defined
<?php
defined('C5_EXECUTE') or die("Access Denied.");
$pla = PackageList::get();
$pl = $pla->getPackages();
foreach ($pl as $p) {
if ($p->isPackageInstalled()) {
$pkg = Loader::package($p->getPackageHandle());
if (is_object($pkg)) {
if (method_exists($pkg, 'on_start')) {
$pkg->on_start();
}
}
}
}
示例7: getBlockTypeCustomTemplates
/**
* Gets the custom templates available for the current BlockType
* @return array an array of strings
*/
function getBlockTypeCustomTemplates() {
$btHandle = $this->getBlockTypeHandle();
$pkgHandle = $this->getPackageHandle();
$templates = array();
$fh = Loader::helper('file');
if (file_exists(DIR_FILES_BLOCK_TYPES . "/{$btHandle}/" . DIRNAME_BLOCK_TEMPLATES)) {
$templates = array_merge($templates, $fh->getDirectoryContents(DIR_FILES_BLOCK_TYPES . "/{$btHandle}/" . DIRNAME_BLOCK_TEMPLATES));
}
/*
if ($pkgHandle != null) {
if (is_dir(DIR_PACKAGES . '/' . $pkgHandle)) {
$templates = array_merge($templates, $fh->getDirectoryContents(DIR_PACKAGES . "/{$pkgHandle}/" . DIRNAME_BLOCKS . "/{$btHandle}/" . DIRNAME_BLOCK_TEMPLATES));
} else {
$templates = array_merge($templates, $fh->getDirectoryContents(DIR_PACKAGES_CORE . "/{$pkgHandle}/" . DIRNAME_BLOCKS . "/{$btHandle}/" . DIRNAME_BLOCK_TEMPLATES));
}
}
*/
// NOW, we check to see if this btHandle has any custom templates that have been installed as separate packages
$pl = PackageList::get();
$packages = $pl->getPackages();
foreach($packages as $pkg) {
$d = (is_dir(DIR_PACKAGES . '/' . $pkg->getPackageHandle())) ? DIR_PACKAGES . '/'. $pkg->getPackageHandle() : DIR_PACKAGES_CORE . '/'. $pkg->getPackageHandle();
if (is_dir($d . '/' . DIRNAME_BLOCKS . '/' . $btHandle . '/' . DIRNAME_BLOCK_TEMPLATES)) {
$templates = array_merge($templates, $fh->getDirectoryContents($d . '/' . DIRNAME_BLOCKS . '/' . $btHandle . '/' . DIRNAME_BLOCK_TEMPLATES));
}
}
if (file_exists(DIR_FILES_BLOCK_TYPES_CORE . "/{$btHandle}/" . DIRNAME_BLOCK_TEMPLATES)) {
$templates = array_merge($templates, $fh->getDirectoryContents(DIR_FILES_BLOCK_TYPES_CORE . "/{$btHandle}/" . DIRNAME_BLOCK_TEMPLATES));
}
$templates = array_unique($templates);
return $templates;
}
示例8: setLocale
/** Changes the currently active locale
* @param string $locale The locale to activate (for example: 'en_US')
* @param bool $coreOnly = false Set to true to load only the core translation files, set to false (default) to load also packages and site locale translations
*/
public function setLocale($locale, $coreOnly = false)
{
$localeNeededLoading = false;
if ($locale == 'en_US' && !ENABLE_TRANSLATE_LOCALE_EN_US) {
if (isset($this->translate)) {
unset($this->translate);
}
return;
}
if (is_dir(DIR_LANGUAGES . '/' . $locale)) {
$languageDir = DIR_LANGUAGES . '/' . $locale;
} elseif (is_dir(DIR_LANGUAGES_CORE . '/' . $locale)) {
$languageDir = DIR_LANGUAGES_CORE . '/' . $locale;
} else {
return;
}
$options = array('adapter' => 'gettext', 'content' => $languageDir, 'locale' => $locale, 'disableNotices' => true, 'ignore' => array('.', 'messages.po'));
if (defined('TRANSLATE_OPTIONS')) {
$_options = unserialize(TRANSLATE_OPTIONS);
if (is_array($_options)) {
$options = array_merge($options, $_options);
}
}
if (!isset($this->translate)) {
$this->translate = new Zend_Translate($options);
$localeNeededLoading = true;
} else {
if (!in_array($locale, $this->translate->getList())) {
$this->translate->addTranslation($options);
$localeNeededLoading = true;
}
$this->translate->setLocale($locale);
}
if (!$coreOnly) {
$this->addSiteInterfaceLanguage($locale);
global $config_check_failed;
if (!(isset($config_check_failed) && $config_check_failed)) {
foreach (PackageList::get(1)->getPackages() as $p) {
$pkg = Loader::package($p->getPackageHandle());
if (is_object($pkg)) {
$pkg->setupPackageLocalization($locale, null, $this->translate);
}
}
}
}
if ($localeNeededLoading) {
Events::fire('on_locale_load', $locale);
}
}
示例9: setupSiteInterfaceLocalization
public static function setupSiteInterfaceLocalization()
{
// don't translate dashboard pages
$c = Page::getCurrentPage();
if ($c instanceof Page && Loader::helper('section', 'multilingual')->section('dashboard')) {
return;
}
$ms = MultilingualSection::getCurrentSection();
if (is_object($ms)) {
$locale = $ms->getLocale();
} else {
$locale = DefaultLanguageHelper::getSessionDefaultLocale();
}
// change core language to translate e.g. core blocks/themes
if (strlen($locale)) {
Localization::changeLocale($locale);
}
// site translations
if (is_dir(DIR_LANGUAGES_SITE_INTERFACE)) {
if (file_exists(DIR_LANGUAGES_SITE_INTERFACE . '/' . $locale . '.mo')) {
$loc = Localization::getInstance();
$loc->addSiteInterfaceLanguage($locale);
}
}
// add package translations
if (strlen($locale)) {
$ms = MultilingualSection::getByLocale($locale);
if ($ms instanceof MultilingualSection) {
$pl = PackageList::get();
$installed = $pl->getPackages();
foreach ($installed as $pkg) {
if ($pkg instanceof Package) {
$pkg->setupPackageLocalization($ms->getLocale());
}
}
}
}
}
示例10: get_environment_info
public function get_environment_info()
{
$activeLocale = Localization::activeLocale();
if ($activeLocale != 'en_US') {
Localization::changeLocale('en_US');
}
$maxExecutionTime = ini_get('max_execution_time');
set_time_limit(5);
$environmentMessage = "# concrete5 Version\n" . APP_VERSION . "\n\n";
$environmentMessage .= "# concrete5 Packages\n";
$pla = PackageList::get();
$pl = $pla->getPackages();
$packages = array();
foreach ($pl as $p) {
if ($p->isPackageInstalled()) {
$packages[] = $p->getPackageName() . ' (' . $p->getPackageVersion() . ')';
}
}
if (count($packages) > 0) {
natcasesort($packages);
$environmentMessage .= implode(', ', $packages);
$environmentMessage .= ".\n";
} else {
$environmentMessage .= "None\n";
}
$environmentMessage .= "\n";
// overrides
$environmentMessage .= "# concrete5 Overrides\n";
$fh = Loader::helper('file');
$overrides = array();
$ovBlocks = $fh->getDirectoryContents(DIR_FILES_BLOCK_TYPES);
$ovControllers = $fh->getDirectoryContents(DIR_FILES_CONTROLLERS);
$ovElements = $fh->getDirectoryContents(DIR_FILES_ELEMENTS);
$ovHelpers = $fh->getDirectoryContents(DIR_HELPERS);
$ovJobs = $fh->getDirectoryContents(DIR_FILES_JOBS);
$ovCSS = $fh->getDirectoryContents(DIR_BASE . '/' . DIRNAME_CSS);
$ovJS = $fh->getDirectoryContents(DIR_BASE . '/' . DIRNAME_JAVASCRIPT);
$ovLng = $fh->getDirectoryContents(DIR_BASE . '/' . DIRNAME_LANGUAGES);
$ovLibs = $fh->getDirectoryContents(DIR_LIBRARIES);
$ovMail = $fh->getDirectoryContents(DIR_FILES_EMAIL_TEMPLATES);
$ovModels = $fh->getDirectoryContents(DIR_MODELS);
$ovSingle = $fh->getDirectoryContents(DIR_FILES_CONTENT);
$ovThemes = $fh->getDirectoryContents(DIR_FILES_THEMES);
$ovTools = $fh->getDirectoryContents(DIR_FILES_TOOLS);
foreach ($ovBlocks as $ovb) {
$overrides[] = DIRNAME_BLOCKS . '/' . $ovb;
}
foreach ($ovControllers as $ovb) {
$overrides[] = DIRNAME_CONTROLLERS . '/' . $ovb;
}
foreach ($ovElements as $ovb) {
$overrides[] = DIRNAME_ELEMENTS . '/' . $ovb;
}
foreach ($ovHelpers as $ovb) {
$overrides[] = DIRNAME_HELPERS . '/' . $ovb;
}
foreach ($ovJobs as $ovb) {
$overrides[] = DIRNAME_JOBS . '/' . $ovb;
}
foreach ($ovJS as $ovb) {
$overrides[] = DIRNAME_JAVASCRIPT . '/' . $ovb;
}
foreach ($ovCSS as $ovb) {
$overrides[] = DIRNAME_CSS . '/' . $ovb;
}
foreach ($ovLng as $ovb) {
$overrides[] = DIRNAME_LANGUAGES . '/' . $ovb;
}
foreach ($ovLibs as $ovb) {
$overrides[] = DIRNAME_LIBRARIES . '/' . $ovb;
}
foreach ($ovMail as $ovb) {
$overrides[] = DIRNAME_MAIL_TEMPLATES . '/' . $ovb;
}
foreach ($ovModels as $ovb) {
$overrides[] = DIRNAME_MODELS . '/' . $ovb;
}
foreach ($ovSingle as $ovb) {
$overrides[] = DIRNAME_PAGES . '/' . $ovb;
}
foreach ($ovThemes as $ovb) {
$overrides[] = DIRNAME_THEMES . '/' . $ovb;
}
foreach ($ovTools as $ovb) {
$overrides[] = DIRNAME_TOOLS . '/' . $ovb;
}
if (count($overrides) > 0) {
$environmentMessage .= implode(', ', $overrides);
$environmentMessage .= "\n";
} else {
$environmentMessage .= "None\n";
}
$environmentMessage .= "\n";
print $environmentMessage;
// cache
$environmentMessage = "# concrete5 Cache Settings\n";
$environmentMessage .= sprintf("Block Cache - %s\n", ENABLE_BLOCK_CACHE ? 'On' : 'Off');
$environmentMessage .= sprintf("Overrides Cache - %s\n", ENABLE_OVERRIDE_CACHE ? 'On' : 'Off');
$environmentMessage .= sprintf("Full Page Caching - %s\n", FULL_PAGE_CACHE_GLOBAL == 'blocks' ? 'On - If blocks on the particular page allow it.' : (FULL_PAGE_CACHE_GLOBAL == 'all' ? 'On - In all cases.' : 'Off'));
if (FULL_PAGE_CACHE_GLOBAL) {
//.........这里部分代码省略.........
示例11: getBlockTypeCustomTemplates
/**
* Gets the custom templates available for the current BlockType
* @return TemplateFile[]
*/
function getBlockTypeCustomTemplates()
{
$btHandle = $this->getBlockTypeHandle();
$fh = Loader::helper('file');
$files = array();
$dir = DIR_FILES_BLOCK_TYPES . "/{$btHandle}/" . DIRNAME_BLOCK_TEMPLATES;
if (is_dir($dir)) {
$files = array_merge($files, $fh->getDirectoryContents($dir));
}
// NOW, we check to see if this btHandle has any custom templates that have been installed as separate packages
foreach (PackageList::get()->getPackages() as $pkg) {
$dir = (is_dir(DIR_PACKAGES . '/' . $pkg->getPackageHandle()) ? DIR_PACKAGES : DIR_PACKAGES_CORE) . '/' . $pkg->getPackageHandle() . '/' . DIRNAME_BLOCKS . '/' . $btHandle . '/' . DIRNAME_BLOCK_TEMPLATES;
if (is_dir($dir)) {
$files = array_merge($files, $fh->getDirectoryContents($dir));
}
}
$dir = DIR_FILES_BLOCK_TYPES_CORE . "/{$btHandle}/" . DIRNAME_BLOCK_TEMPLATES;
if (is_dir($dir)) {
$files = array_merge($files, $fh->getDirectoryContents($dir));
}
Loader::library('template_file');
$templates = array();
foreach (array_unique($files) as $file) {
$templates[] = new TemplateFile($this, $file);
}
return TemplateFile::sortTemplateFileList($templates);
}