english/administrator/components/com_aicontactsafe/models/profiles.php
// function to write the CSS file
function to write the CSS file
function to write the CSS file
function writeCSS( $postData = array(), $id = 0 ) {
		if (count($postData) == 0) {
			$postData = $this->readPostDataFromSession();
			$id = $postData['id'];
		}
		$id = (int)$id;
		$db = &JFactory::getDBO();
		$query = 'UPDATE `#__aicontactsafe_profiles` set use_message_css = '.$postData['use_message_css'].' WHERE id = ' . $id;
		$db->setQuery( $query );
		$db->query();
		jimport('joomla.filesystem.file');
		$css_file = JPath::clean(JPATH_ROOT.DS.'media'.DS.'aicontactsafe'.DS.'cssprofiles'.DS.'profile_css_'.$id.'.css');
		JFile::write($css_file, $this->revert_specialchars($postData['profile_css_code']));
		return true;
	}
function writeCSS ( $ postData = array ( ) , $ id = 0 ) { if ( count ( $ postData ) == 0 ) { $ postData = $ this -> readPostDataFromSession ( ) ; $ id = $ postData [ 'id' ] ; } $ id = ( int ) $ id ; $ db = & JFactory :: getDBO ( ) ; $ query = 'UPDATE `#__aicontactsafe_profiles` set use_message_css = ' . $ postData [ 'use_message_css' ] . ' WHERE id = ' . $ id ; $ db -> setQuery ( $ query ) ; $ db -> query ( ) ; jimport ( 'joomla.filesystem.file' ) ; $ css_file = JPath :: clean ( JPATH_ROOT . DS . 'media' . DS . 'aicontactsafe' . DS . 'cssprofiles' . DS . 'profile_css_' . $ id . '.css' ) ; JFile :: write ( $ css_file , $ this -> revert_specialchars ( $ postData [ 'profile_css_code' ] ) ) ; return true ; }
function to write the CSS file
function to write the CSS file
// check to see if any postdata was sent // get the information in the form // initialize the database // save profile field use_message_css // import joomla clases to manage file system // write the css code of the profile