/** * Retrieve templates and returns the template information as array. * * This method is called for the template listing table to list available templates. So this method generates the template information dynamically. * This method does not deal with saved options. * * @return array */ public function getUploadedTemplates() { if (!empty(self::$_aUploadedTemplates)) { return self::$_aUploadedTemplates; } // Construct a template array. $_aTemplates = array(); $_iIndex = 0; foreach ($this->_getTemplateDirs() as $_sDirPath) { $_aTemplate = $this->getTemplateArrayByDirPath($_sDirPath); if (!$_aTemplate) { continue; } // Uploaded templates are supposed to be only called in the admin template listing page. // So by default, these are not active. $_aTemplate['is_active'] = false; $_aTemplate['index'] = ++$_iIndex; $_aTemplates[$_aTemplate['id']] = $_aTemplate; } self::$_aUploadedTemplates = $_aTemplates; return $_aTemplates; }