src/Gelembjuk/Mail/EmailFormat.php
protected function getTemplateDataForLocale($template,$locale) {
		// path to document with subjects
		$metafile = $this->templatespath.'/'.$locale.'/subjects.xml';
		
		if (!file_exists($metafile)) {
			// file with subjects not found
			return null;
		}
		
		// load and parse document with subjects
		$xml = @file_get_contents($metafile);
		
		if (!$xml || $xml == '') {
			return null;
		}
		
		$array = \LSS\XML2Array::createArray($xml);
		
		// our template is not found in this document so it is not there
		if (!isset($array['templates'][$template])) {
			return null;
		}
		
		$templatefile = $this->templatespath.'/'.$locale.'/'.$template.'.htm';
		
		// check if template file exists for this locale
		if (!file_exists($templatefile)) {
			return null;
		}
		
		$tmpl = ($locale != '') ? $locale.'/':'';
		
		$tmpl .= $template;
		
		// all was fine. return found template
		return array('subject'=>$array['templates'][$template]['subject'],
			'file'=>$tmpl);
	}
protected function getTemplateDataForLocale($template,$locale) {
		// path to document with subjects
		$metafile = $this->templatespath.'/'.$locale.'/subjects.xml';
		
		if (!file_exists($metafile)) {
			// file with subjects not found
			return null;
		}
		
		// load and parse document with subjects
		$xml = @file_get_contents($metafile);
		
		if (!$xml || $xml == '') {
			return null;
		}
		
		$array = \LSS\XML2Array::createArray($xml);
		
		// our template is not found in this document so it is not there
		if (!isset($array['templates'][$template])) {
			return null;
		}
		
		$templatefile = $this->templatespath.'/'.$locale.'/'.$template.'.htm';
		
		// check if template file exists for this locale
		if (!file_exists($templatefile)) {
			return null;
		}
		
		$tmpl = ($locale != '') ? $locale.'/':'';
		
		$tmpl .= $template;
		
		// all was fine. return found template
		return array('subject'=>$array['templates'][$template]['subject'],
			'file'=>$tmpl);
	}
protected function getTemplateDataForLocale ( $ template , $ locale ) { // path to document with subjects $ metafile = $ this -> templatespath . '/' . $ locale . '/subjects.xml' ; if ( ! file_exists ( $ metafile ) ) { // file with subjects not found return null ; } // load and parse document with subjects $ xml = @ file_get_contents ( $ metafile ) ; if ( ! $ xml || $ xml == '' ) { return null ; } $ array = \ LSS \ XML2Array :: createArray ( $ xml ) ; // our template is not found in this document so it is not there if ( ! isset ( $ array [ 'templates' ] [ $ template ] ) ) { return null ; } $ templatefile = $ this -> templatespath . '/' . $ locale . '/' . $ template . '.htm' ; // check if template file exists for this locale if ( ! file_exists ( $ templatefile ) ) { return null ; } $ tmpl = ( $ locale != '' ) ? $ locale . '/' : '' ; $ tmpl .= $ template ; // all was fine. return found template return array ( 'subject' => $ array [ 'templates' ] [ $ template ] [ 'subject' ] , 'file' => $ tmpl ) ; }
Get template information for specified locale

@param string $template Template file
@param string $locale Locale or empty string

@return array Template subject and file path
Get template information for specified locale