english/components/com_aicontactsafe/models/message.php
// function to read the contact informations
function to read the contact informations
function to read the contact informations
function readContactInformations( $profile_id = 0, $r_id = 0 ) {
		if(!$this->contactinformations) {
			$this->contactinformations = array();
			$this->contactinformations['contact_info'] = '';
			$this->contactinformations['meta_description'] = '';
			$this->contactinformations['meta_keywords'] = '';
			$this->contactinformations['meta_robots'] = '';
			$this->contactinformations['thank_you_message'] = '';
			$this->contactinformations['required_field_notification'] = JText::_('COM_AICONTACTSAFE_FIELDS_MARKED_WITH').' %mark% '.JText::_('COM_AICONTACTSAFE_ARE_REQUIRED').'.';
			$db = &JFactory::getDBO();
			$query = 'SELECT * FROM #__aicontactsafe_contactinformations WHERE profile_id = '.$profile_id;
			$db->setQuery( $query );
			$contactinformations = $db->loadObjectList();
			if(is_array($contactinformations) && count($contactinformations) > 0) {
				foreach($contactinformations as $info) {
					$this->contactinformations[$info->info_key] = $this->revert_specialchars($info->info_value);
				}
			}
		}
		$this->_app->_session->set( 'confirmationMessage:' . $this->_sTask . '_' . $r_id, array_key_exists('thank_you_message',$this->contactinformations)?$this->contactinformations['thank_you_message']:'' );
		return $this->contactinformations;
	}
function readContactInformations ( $ profile_id = 0 , $ r_id = 0 ) { if ( ! $ this -> contactinformations ) { $ this -> contactinformations = array ( ) ; $ this -> contactinformations [ 'contact_info' ] = '' ; $ this -> contactinformations [ 'meta_description' ] = '' ; $ this -> contactinformations [ 'meta_keywords' ] = '' ; $ this -> contactinformations [ 'meta_robots' ] = '' ; $ this -> contactinformations [ 'thank_you_message' ] = '' ; $ this -> contactinformations [ 'required_field_notification' ] = JText :: _ ( 'COM_AICONTACTSAFE_FIELDS_MARKED_WITH' ) . ' %mark% ' . JText :: _ ( 'COM_AICONTACTSAFE_ARE_REQUIRED' ) . '.' ; $ db = & JFactory :: getDBO ( ) ; $ query = 'SELECT * FROM #__aicontactsafe_contactinformations WHERE profile_id = ' . $ profile_id ; $ db -> setQuery ( $ query ) ; $ contactinformations = $ db -> loadObjectList ( ) ; if ( is_array ( $ contactinformations ) && count ( $ contactinformations ) > 0 ) { foreach ( $ contactinformations as $ info ) { $ this -> contactinformations [ $ info -> info_key ] = $ this -> revert_specialchars ( $ info -> info_value ) ; } } } $ this -> _app -> _session -> set ( 'confirmationMessage:' . $ this -> _sTask . '_' . $ r_id , array_key_exists ( 'thank_you_message' , $ this -> contactinformations ) ? $ this -> contactinformations [ 'thank_you_message' ] : '' ) ; return $ this -> contactinformations ; }
function to read the contact informations
function to read the contact informations
// initialize the database // get the fields to display // set the thank you message