english/libraries/joomla/installer/adapters/template.php
/**
	 * Discover existing but uninstalled templates
	 *
	 * @return  array  JExtensionTable list
	 */
Discover existing but uninstalled templates
@return  array  JExtensionTable list
Discover existing but uninstalled templates @return array JExtensionTable list
function discover()
	{
		$results = Array();
		$site_list = JFolder::folders(JPATH_SITE . '/templates');
		$admin_list = JFolder::folders(JPATH_ADMINISTRATOR . '/templates');
		$site_info = JApplicationHelper::getClientInfo('site', true);
		$admin_info = JApplicationHelper::getClientInfo('administrator', true);
		foreach ($site_list as $template)
		{
			if ($template == 'system') {
				continue;
			}
			$manifest_details = JApplicationHelper::parseXMLInstallFile(JPATH_SITE."/templates/$template/templateDetails.xml");
			$extension = JTable::getInstance('extension');
			$extension->set('type', 'template');
			$extension->set('client_id', $site_info->id);
			$extension->set('element', $template);
			$extension->set('name', $template);
			$extension->set('state', -1);
			$extension->set('manifest_cache', json_encode($manifest_details));
			$results[] = $extension;
		}
		foreach ($admin_list as $template)
		{
			if ($template == 'system') {
				continue;
			}
			$manifest_details = JApplicationHelper::parseXMLInstallFile(JPATH_ADMINISTRATOR."/templates/$template/templateDetails.xml");
			$extension = JTable::getInstance('extension');
			$extension->set('type', 'template');
			$extension->set('client_id', $admin_info->id);
			$extension->set('element', $template);
			$extension->set('name', $template);
			$extension->set('state', -1);
			$extension->set('manifest_cache', json_encode($manifest_details));
			$results[] = $extension;
		}
		return $results;
	}
function discover ( ) { $ results = Array ( ) ; $ site_list = JFolder :: folders ( JPATH_SITE . '/templates' ) ; $ admin_list = JFolder :: folders ( JPATH_ADMINISTRATOR . '/templates' ) ; $ site_info = JApplicationHelper :: getClientInfo ( 'site' , true ) ; $ admin_info = JApplicationHelper :: getClientInfo ( 'administrator' , true ) ; foreach ( $ site_list as $ template ) { if ( $ template == 'system' ) { continue ; } $ manifest_details = JApplicationHelper :: parseXMLInstallFile ( JPATH_SITE . " /templates/ $ template /templateDetails.xml " ) ; $ extension = JTable :: getInstance ( 'extension' ) ; $ extension -> set ( 'type' , 'template' ) ; $ extension -> set ( 'client_id' , $ site_info -> id ) ; $ extension -> set ( 'element' , $ template ) ; $ extension -> set ( 'name' , $ template ) ; $ extension -> set ( 'state' , - 1 ) ; $ extension -> set ( 'manifest_cache' , json_encode ( $ manifest_details ) ) ; $ results [ ] = $ extension ; } foreach ( $ admin_list as $ template ) { if ( $ template == 'system' ) { continue ; } $ manifest_details = JApplicationHelper :: parseXMLInstallFile ( JPATH_ADMINISTRATOR . " /templates/ $ template /templateDetails.xml " ) ; $ extension = JTable :: getInstance ( 'extension' ) ; $ extension -> set ( 'type' , 'template' ) ; $ extension -> set ( 'client_id' , $ admin_info -> id ) ; $ extension -> set ( 'element' , $ template ) ; $ extension -> set ( 'name' , $ template ) ; $ extension -> set ( 'state' , - 1 ) ; $ extension -> set ( 'manifest_cache' , json_encode ( $ manifest_details ) ) ; $ results [ ] = $ extension ; } return $ results ; }
Discover existing but uninstalled templates
 @return  array  JExtensionTable list
Discover existing but uninstalled templates @return array JExtensionTable list
// Ignore special system template // Ignore special system template