Returns an array of template codes and descriptions.
@return array
166364
public static function listAllTemplates()
    {
        $fileTemplates = (array) MailManager::instance()->listRegisteredTemplates();
        $dbTemplates = (array) self::lists('code', 'code');
        $templates = $fileTemplates + $dbTemplates;
        ksort($templates);
        return $templates;
    }
1067155
public function GetDeclarationCode()
    {
        $code = "";
        
        if($this->is_const)
            $code .= "const ";
        
        $code .= $this->type;
        
        if($this->is_reference)
            $code .= "&";
        
        if($this->is_pointer)
        {
            for($i=0; $i<$this->indirection_level; $i++)
            {
                $code .= "*";
            }
        }
        
        $code .= " " . $this->name;
        
        if($this->is_array)
            $code .= "[]";
        
        if(trim($this->default_value) != "")
            $code .= " = " . $this->default_value;
    }
795098
public function getWidgetMapsForViewAndTemplates()
    {
        $widgetMaps = [];

        foreach ($this->getWidgetMaps() as $_widgetMap) {
            $widgetMaps[] = $_widgetMap;
        }

        if ($template = $this->getTemplate()) {
            $templateWidgetMaps = $template->getWidgetMapsForViewAndTemplates();
            $widgetMaps = array_merge($widgetMaps, $templateWidgetMaps);
        }

        return $widgetMaps;
    }
684778
public function findAllTemplates()
    {
        if (null !== $this->templates) {
            return $this->templates;
        }

        $templates = array();

        foreach ($this->paths as $dir) {
            $templates = array_merge($templates, $this->findTemplatesInFolder($dir));
        }

        return $this->templates = $templates;
    }
1120305
public function getCustomisationList()
    {
        $return = [];
        $items = $this->Customisations();

        if ($items && $items->exists()) {
            foreach ($items as $item) {
                $return[] = $item->Title . ': ' . $item->Value;
            }
        }

        $this->extend("updateCustomisationList", $return);

        return implode(", ", $return);
    }
1033581
public function getLanguageCodesList()
    {
        $languages = array();
        foreach ($this->getStores() as $store) {
            $languages[] = $store->getLanguageCode();
        }
        return array_unique($languages);
    }
583083
public function getAcceptEncodes(): array
    {
        $ens = [];

        if ($value = $this->getLine('Accept-Encoding')) {
            if (\strpos($value, ';')) {
                [$value,] = \explode(';', $value, 2);
            }

            $value = \str_replace(' ', '', $value);
            $ens   = \explode(',', $value);
        }

        return $ens;
    }
521257
public function getTemplateAccessors() {
		if($this->templateAccessors) return $this->templateAccessors;

		$vars = parent::getTemplateAccessors();

		return $this->templateAccessors = array_merge($vars, array (
			'To',
			'Cc',
			'Bcc',
			'From',
			'Subject',
			'Body',
			'BaseURL',
			'IsEmail'
		));
	}
68277
public function getCodeFields()
    {
        $fieldDef = $this->getTrackEngine()->getFieldsDefinition();
        $codes    = $this->tracker->getAllCodeFields();
        $results  = array_fill_keys($codes, null);

        $this->_ensureFieldData();

        foreach ($this->_fieldData as $id => $value) {
            if (!isset($codes[$id])) {
                continue;
            }

            $fieldCode           = $codes[$id];
            $results[$fieldCode] = $value;
            $field               = $fieldDef->getFieldByCode($fieldCode);
            if (!is_null($field)) {
                $results[$fieldCode] = $field->calculateFieldInfo($value, $this->_fieldData);
            }
        }

        return $results;
    }
632233
public function getTemplates()
	{
		$templates = [
			'br' => '<br/>',
			'e'  => '',
			'i'  => '',
			'p'  => '<p><xsl:apply-templates/></p>',
			's'  => ''
		];

		foreach ($this->configurator->tags as $tagName => $tag)
		{
			if (isset($tag->template))
			{
				$templates[$tagName] = (string) $tag->template;
			}
		}

		ksort($templates);

		return $templates;
	}
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;

	}
1129235
public function getMessages(): array
    {
        $templates = [
            new Message($this->message->getBody(), $this->message->getContentType()),
        ];

        // TODO: Loop through parts

        return $templates;
    }
1181376
public function getDefinitionCache(): array
    {
        return [
            $this->name,
            $this->methods,
            $this->segments,
            $this->patterns,
            $this->handler,
            $this->format,
            $this->parameterNames,
        ];
    }
1324358
protected function generateNodeTypeDefinitions()
    {
        $code = '';
        /** @var NodeType $nodeType */
        foreach ($this->nodeTypeManager->getNodeTypes(false) as $nodeType) {
            $code .= $this->generateFusionForNodeType($nodeType);
        }
        return $code;
    }
412866
protected function getTemplateRegexPattern()
    {
        $template = str_replace('.', '\.', $this->template);
        $template = str_replace('*', '[a-zA-Z0-9]*', $template);

        return sprintf('/^%s$/', $template);
    }
432913
public function getTemplateResources()
    {
        return new TemplateResources(
            $this->stylesheets,
            $this->headerScripts,
            $this->headerIncludes,
            $this->footerScripts,
            $this->footerIncludes
        );
    }
1372385
public function getFullDescription() {

        return strtr($this->template, [
            "{name}" => $this->getName(),
            "{description}" => $this->getDescription(),
            "{version}" => $this->getVersion(),
            "{ascii}" => $this->getAscii()
        ]);

    }