controllers/i18n/actions.php
protected function addMessage( $instance )
	{
		$message 			= \Sifo\FilterPost::getInstance()->getString( 'msgid' );
		$translator_model 	= new I18nTranslatorModel();

		// Check if this message exists in the instances parents.
		// Get selected instance inheritance.
		$instance_domains 		= $this->getConfig( 'domains', $instance );

		$instance_inheritance = array();
		if ( isset( $instance_domains['instance_inheritance'] ) )
		{
			$instance_inheritance 	=  $instance_domains['instance_inheritance'];
		}

		if ( $translator_model->getMessageInInhertitance( $message, $instance_inheritance ) > 0 )
		{
			return array( 'status' => 'KO', 'msg' => 'This message already exists in parent instance. Please, customize it.' );
		}
		elseif ( $translator_model->addMessage( $message, $instance ) )
		{
			return array( 'status' => 'OK', 'msg' => 'Message successfully saved.' );
		}

		return array( 'status' => 'KO', 'msg' => 'Failed adding message.' );
	}
protected function addMessage( $instance )
	{
		$message 			= \Sifo\FilterPost::getInstance()->getString( 'msgid' );
		$translator_model 	= new I18nTranslatorModel();

		// Check if this message exists in the instances parents.
		// Get selected instance inheritance.
		$instance_domains 		= $this->getConfig( 'domains', $instance );

		$instance_inheritance = array();
		if ( isset( $instance_domains['instance_inheritance'] ) )
		{
			$instance_inheritance 	=  $instance_domains['instance_inheritance'];
		}

		if ( $translator_model->getMessageInInhertitance( $message, $instance_inheritance ) > 0 )
		{
			return array( 'status' => 'KO', 'msg' => 'This message already exists in parent instance. Please, customize it.' );
		}
		elseif ( $translator_model->addMessage( $message, $instance ) )
		{
			return array( 'status' => 'OK', 'msg' => 'Message successfully saved.' );
		}

		return array( 'status' => 'KO', 'msg' => 'Failed adding message.' );
	}
protected function addMessage ( $ instance ) { $ message = \ Sifo \ FilterPost :: getInstance ( ) -> getString ( 'msgid' ) ; $ translator_model = new I18nTranslatorModel ( ) ; // Check if this message exists in the instances parents. // Get selected instance inheritance. $ instance_domains = $ this -> getConfig ( 'domains' , $ instance ) ; $ instance_inheritance = array ( ) ; if ( isset ( $ instance_domains [ 'instance_inheritance' ] ) ) { $ instance_inheritance = $ instance_domains [ 'instance_inheritance' ] ; } if ( $ translator_model -> getMessageInInhertitance ( $ message , $ instance_inheritance ) > 0 ) { return array ( 'status' => 'KO' , 'msg' => 'This message already exists in parent instance. Please, customize it.' ) ; } elseif ( $ translator_model -> addMessage ( $ message , $ instance ) ) { return array ( 'status' => 'OK' , 'msg' => 'Message successfully saved.' ) ; } return array ( 'status' => 'KO' , 'msg' => 'Failed adding message.' ) ; }
Add message.
@return mixed
Add message .