english/administrator/components/com_aicontactsafe/models/profiles.php
// function to read the mail template file of a profile
function to read the mail template file of a profile
function to read the mail template file of a profile
function readMailTemplate( $id = 0 ) {
		$mail_code = '';
		jimport('joomla.filesystem.file');
		$mail_file = JPath::clean(JPATH_ROOT.DS.'media'.DS.'aicontactsafe'.DS.'mailtemplates'.DS.'mail_'.$id.'.php');
		if (!is_file($mail_file)) {
			$src_file = JPath::clean(JPATH_ROOT.DS.'components'.DS.'com_aicontactsafe'.DS.'views'.DS.'mail'.DS.'tmpl'.DS.'mail.php');
			JFile::copy($src_file, $mail_file);
		}
		$mail_code = JFile::read($mail_file);
		return $mail_code;
	}
function readMailTemplate ( $ id = 0 ) { $ mail_code = '' ; jimport ( 'joomla.filesystem.file' ) ; $ mail_file = JPath :: clean ( JPATH_ROOT . DS . 'media' . DS . 'aicontactsafe' . DS . 'mailtemplates' . DS . 'mail_' . $ id . '.php' ) ; if ( ! is_file ( $ mail_file ) ) { $ src_file = JPath :: clean ( JPATH_ROOT . DS . 'components' . DS . 'com_aicontactsafe' . DS . 'views' . DS . 'mail' . DS . 'tmpl' . DS . 'mail.php' ) ; JFile :: copy ( $ src_file , $ mail_file ) ; } $ mail_code = JFile :: read ( $ mail_file ) ; return $ mail_code ; }
function to read the mail template file of a profile
function to read the mail template file of a profile
// if id = 0 then a new profile is edited and the default template should be read // import joomla clases to manage file system