0

I'm receiving the error ' Parse error: syntax error, unexpected end of file in /var/www/html/system/expressionengine/third_party/account/mcp.account.php on line 165'

It appears to be a error around the content of 'get_header_html' class.

Can anyone help with why this is happening?

The output of mcp.account.php is a follows:

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Account_mcp {

    /**
     * Constructor
     *
     * @access  public
     */
     
    var $data = array();
    
    function Account_mcp()
    {
        
        // no notices thank you
        error_reporting(E_ALL ^ E_NOTICE);
        
        // Make a local reference to the ExpressionEngine super object
        $this->EE =& get_instance();
        $head_html = $this->get_header_html();
        $this->EE->cp->add_to_head($head_html);
        $this->EE->cp->set_variable('cp_page_title', $this->EE->lang->line('account_module_name'));
        
        $this->data['module_root'] = BASE.AMP.'C=addons_modules'.AMP.'M=show_module_cp'.AMP.'module=account'.AMP;
        $this->data['module_root_unencoded'] = str_replace("amp;",'&',BASE.'&'.'C=addons_modules'.'&'.'M=show_module_cp'.'&'.'module=account'.'&');
        
        $this->EE->load->helper('form');
        
        # load property housename / number helper as it's often needed
        $this->EE->load->helper('format_house_name_number_helper');
        
    }

    // --------------------------------------------------------------------

    /**
     * Main Page
     *
     * @access  public
     */
    function index()
    {
        return $this->EE->load->view('admin/admin_home', $this->data, TRUE);
    }
    
    /**
     * create_agent_profile()
     * method for adding/editing agent profiles
     * @access  public
     */
    function create_agent_profile() {
        
        $this->EE->load->library('admin/agent_profile_lib');
        return $this->EE->agent_profile_lib->process($this->data);
        
    }
    
    /**
     * view_agent_list()
     * method for adding/editing agent profiles
     * @access  public
     */
    function view_agent_list() {
        
        $this->EE->load->library('admin/agent_profile_lib');
        return $this->EE->agent_profile_lib->list_agents($this->data);
        
    }
    
    /**
     * delete_profile()
     * deletes an agent profile and all associated content
     * @access  public
     */
    function delete_profile() {
        
        $this->EE->load->model('agent_profile');
        $this->EE->agent_profile->delete_profile();
        $this->EE->session->set_flashdata('status_msg', 'Agent successfully deleted.');
        header("location: ".$this->data['module_root_unencoded']."method=view_agent_list");
        exit();
    }
    
    /**
     * ajax_list_agents()
     * returns html list of agents for ajax request
     * @access  public
     */
    function ajax_list_agents() {
        
        $this->EE->load->library('admin/agent_profile_lib');
        $this->EE->agent_profile_lib->ajax_list_agents($this->data);
        
    }
    
    
    /**
     * instructions()
     * method for viewing list of pending instructions etc.
     * @access  public
     */
    function instructions() {
        
        $this->EE->load->library('admin/admin_instructions_lib');
        return $this->EE->admin_instructions_lib->process($this->data);
        
    }
    
    
    
    
    /**
     * invoices()
     * method for managing and viewing invoices
     * @access  public
     */
    function invoices() {
        
        $this->EE->load->library('admin/admin_invoices_lib');
        return $this->EE->admin_invoices_lib->process($this->data);
        
    }
    
    
    
    /**
     * get_header_html()
     * returns output buffer of header for control panel i.e. CSS
     * @access  public
     */
    function get_header_html() {
        
        
        // get HTML for header
        ob_start();
        ?>
        
        <script type="text/javascript" src="<?=NSM_SITE_URL?>js/json2.js"></script>
        <script type="text/javascript" src="<?=NSM_SITE_URL?>js/admin.js"></script>
        
        <link href="<?=site_url()?>css/admin.css" media="screen" rel="stylesheet" type="text/css" />
        
        <!--[if IE]>
        <link rel="stylesheet" type="text/css" href="<?=site_url()?>css/admin_ie.css" />
        <![endif]-->
        
        <!--[if IE 6]>
        <link rel="stylesheet" type="text/css" href="<?=site_url()?>css/admin_ie6.css" />
        <![endif]-->
        
        <?
        $return = ob_get_contents();
        ob_end_clean();
        return $return;
        
    }
    

}
// END CLASS

/* End of file mcp.account.php */
/* Location: ./system/expressionengine/third_party/account/mcp.account.php */
?>
  • This type of error usually means you accidentally left one or more bracket(s) open without closing. Please find a moderm code editor (e.g. vscode, atom.io) to open this file to see which bracket doesn't have am expected matching closer then properly and close it / them. – Koala Yeung Oct 14 '20 at 17:46
  • Hi Koala many thanks for the feedback on this. I actually discovered the issue within VS Code using it's PHP error reporting (as well as the reported PHP on the loaded web page). I have actually discovered what the issue was. I needed to replace ' ' with ' – Karl Bowers Oct 14 '20 at 22:28

0 Answers0