The module Templates manager.

@return string
194364
public function template()
    {
        if (class_exists($file = $this->getQualifiedClassNameOfType('Templates'))) {
            return $file;
        }

        if (list(/*$flag*/, $value) = $this->hasCommentFlag('template')) {
            return $value;
        }

        return $this->template;
    }
853710
private function getTemplates()
	{
		if (is_null($this->templates))
		{
			useLib('templates');
			$this->templates = new Templates();
		}

		return $this->templates;
	}
906452
public function getTemplatesArray()
    {
        $templates = $this->getTemplates();

        foreach ($templates as $template) {
            $templates_array[$template->name] = $this->crud->makeLabel($template->name);
        }

        return $templates_array;
    }
375240
public function getModulesPath()
    {
        $paths = $this->locator->getModulesPath();
        foreach (array_keys($paths) as $module) {
            $paths[$module] .= DIRECTORY_SEPARATOR . TemplateReference::MODULE_VIEWS_DIRECTORY;
        }

        return $paths;
    }
892692
protected function template()
    {
        $template = $this->template ?: $this->config->get('datatables-html.script', 'datatables::script');

        return $this->view->make($template, ['editors' => $this->editors])->render();
    }
539031
private function getModuleFileMigrationManager()
    {
        if (!$this->moduleFileMigrationManager) {
            $this->moduleFileMigrationManager = new MigrationManager(array(
                new ModuleFile10To20Migration(),
            ), $this->getJsonVersioner());
        }

        return $this->moduleFileMigrationManager;
    }
953673
protected function template()
    {
        $reflector = new \ReflectionClass(get_class($this));
        $classname = $reflector->getName();

        $template = preg_replace('/(Application|Synapse)\\\View\\\/', '', $classname);
        $template = str_replace('\\', '/', $template);

        return $template;
    }
4240
public function getModuleName()
    {
        $module = $this->argument('module') ?: app('modules')->getUsedNow();

        $module = app('modules')->findOrFail($module);

        return $module->getStudlyName();
    }
993873
protected function getTemplate()
    {
        if ($this->template === null) {
            $this->template = \Tx_Oelib_TemplateRegistry::get(
                $this->templateFileName
            );
        }

        return $this->template;
    }
1295799
public function metaBoxModules()
    {
	$available = \Modularity\ModuleManager::$available;

	uasort($available, function ($a, $b) {
	    return strcmp($a['labels']['name'], $b['labels']['name']);
	});

	global $modularityOptions;
	$enabled = isset($modularityOptions['enabled-modules']) && is_array($modularityOptions['enabled-modules']) ? $modularityOptions['enabled-modules'] : array();

	$templatePath = \Modularity\Helper\Wp::getTemplate('modules', 'options/partials');
	include $templatePath;
    }
131817
public function getModuleName()
        {
            if (null === $this->_module) {
                $this->_module = $this->getParam($this->getModuleKey());
            }

            return $this->_module;
        }
550511
private function getTemplateDirectory()
    {
        $templateDirectory = realpath($this->templateDirectory . '/_template');

        if ($this->files->exists($templateDirectory) && $this->files->isDirectory($templateDirectory)) {
            $this->generator->setInsideTemplateDirectory(true);

            return $templateDirectory;
        }

        return $this->templateDirectory;
    }
709918
protected function getTemplates()
    {
        if (empty($this->templates)) {
            $this->templates[] = $this->environment->loadTemplate($this::DEFAULT_TEMPLATE);
        }

        return $this->templates;
    }
1210968
public function getTemplatePath()
    {
        if ($templateData = $this->component->getData('_template')) {
            return $templateData;
        }

        return $this->variation->getConfiguration(
            'components',
            $this->component->getComponentType()->getName(),
            'path',
            $this->component->getComponentType()->getTemplatePath()
        );
    }
381421
public function getDefaultTemplate() {
        if ($this->_defaultTemplate) return $this->_defaultTemplate;
 
		if ($this->template) {
			$path_parts = pathinfo($this->template);
			if ($path_parts['extension'] == 'php') {
				$app = Application::getInstance();
				if (file_exists( $app->getTemplatePath($this->template))) {
					$this->_defaultTemplate = $this->template;
				}
				else {
					$this->_defaultTemplate = $this->parent->getDefaultTemplate();
				}
			}
			else {
				$this->_defaultTemplate = $this->template;
			}
		}
		else {
			$this->_defaultTemplate = $this->parent->getDefaultTemplate();
		}

        return $this->_defaultTemplate;
    }
535583
public static function get_top_level_templates()
	{

		$ss_templates_array = array();
		$current_theme_path = THEMES_PATH.'/'.Config::inst()->get('SSViewer', 'theme');

		//theme directories to search
		$search_dir_array = array(
			MAINTENANCE_MODE_PATH.'/templates',
			$current_theme_path.'/templates'
		);

		foreach ($search_dir_array as $directory) {

			//Get all the SS templates in the directory
			foreach (glob("{$directory}/*.ss") as $template_path) {

				//get the template name from the path excluding the ".ss" extension
				$template = basename($template_path, '.ss');

				//Add the key=>value pair to the ss_template_array
				$ss_templates_array[$template] = $template;
			}

		}

		return $ss_templates_array;

	}
337768
public function template()
    {
        return $this->entity->template === 'custom' ? $this->entity->custom_template : $this->entity->template;
    }