src/SmartFactory/MessageManager.php
protected function extractMessagesForDisplay(&$messages)
    {
        $output = [];
        
        if (empty($messages) || count($messages) == 0) {
            return $output;
        }
        
        foreach ($messages as $current) {
            $message_entry["message"] = $current["message"];
            
            if (!empty($current["code"])) {
                $message_entry["code"] = $current["code"];
            }
            
            if (!empty($current["auto_hide"])) {
                $message_entry["auto_hide"] = $this->getAutoHideTime();
            }
            
            if (!empty($current["details"]) && config_settings()->getParameter("show_message_details", false, 1)) {
                $message_entry["details"] = $current["details"];
            }
            
            $output[] = $message_entry;
        } // foreach
        
        // unset messages because they has been shown
        $messages = null;
        
        return $output;
    }
protected function extractMessagesForDisplay(&$messages)
    {
        $output = [];
        
        if (empty($messages) || count($messages) == 0) {
            return $output;
        }
        
        foreach ($messages as $current) {
            $message_entry["message"] = $current["message"];
            
            if (!empty($current["code"])) {
                $message_entry["code"] = $current["code"];
            }
            
            if (!empty($current["auto_hide"])) {
                $message_entry["auto_hide"] = $this->getAutoHideTime();
            }
            
            if (!empty($current["details"]) && config_settings()->getParameter("show_message_details", false, 1)) {
                $message_entry["details"] = $current["details"];
            }
            
            $output[] = $message_entry;
        } // foreach
        
        // unset messages because they has been shown
        $messages = null;
        
        return $output;
    }
protected function extractMessagesForDisplay ( & $ messages ) { $ output = [ ] ; if ( empty ( $ messages ) || count ( $ messages ) == 0 ) { return $ output ; } foreach ( $ messages as $ current ) { $ message_entry [ "message" ] = $ current [ "message" ] ; if ( ! empty ( $ current [ "code" ] ) ) { $ message_entry [ "code" ] = $ current [ "code" ] ; } if ( ! empty ( $ current [ "auto_hide" ] ) ) { $ message_entry [ "auto_hide" ] = $ this -> getAutoHideTime ( ) ; } if ( ! empty ( $ current [ "details" ] ) && config_settings ( ) -> getParameter ( "show_message_details" , false , 1 ) ) { $ message_entry [ "details" ] = $ current [ "details" ] ; } $ output [ ] = $ message_entry ; } // foreach // unset messages because they has been shown $ messages = null ; return $ output ; }
This is internal auxiliary function for preparing messags for displaying.

When the messages are requested, it is assumed they will be displayed. Thus,
the message array is cleared to avoid displaying of the same messages twice.

The message details are removed if the flag show_message_details is false.

@param array $messages
The source array of messages.

@return array
Returns the array of messages for displaying.

@author Oleg Schildt
This is internal auxiliary function for preparing messags for displaying .