/** * Return the list of all available template tag modules. * Caches the result for faster access. * * @static * @return array */ public static function getTemplatetagsModules() { if (!self::$templatetags_modules) { $_templatetags_modules = array(); // Populate list once per thread. $app_modules = array(rtrim(DJA_ROOT, DIRECTORY_SEPARATOR)); $app_modules = array_merge($app_modules, Dja::getSetting('INSTALLED_APPS')); foreach ($app_modules as $app_module) { try { $templatetag_module = $app_module . '.templatetags'; import_module($templatetag_module); $_templatetags_modules[] = $templatetag_module; } catch (ImportError $e) { continue; } } self::$templatetags_modules = $_templatetags_modules; } return self::$templatetags_modules; }