public function index($module = array())
{
$this->lang->load('account_module/account_module');
$this->user->restrict('Module.AccountModule');
if (!empty($module)) {
$title = isset($module['title']) ? $module['title'] : $this->lang->line('_text_title');
$this->template->setTitle('Module: ' . $title);
$this->template->setHeading('Module: ' . $title);
$this->template->setButton($this->lang->line('button_save'), array('class' => 'btn btn-primary', 'onclick' => '$(\'#edit-form\').submit();'));
$this->template->setButton($this->lang->line('button_save_close'), array('class' => 'btn btn-default', 'onclick' => 'saveClose();'));
$this->template->setButton($this->lang->line('button_icon_back'), array('class' => 'btn btn-default', 'href' => site_url('extensions')));
if ($this->input->post('heading')) {
$data['heading'] = $this->input->post('heading');
} else {
if (!empty($module['ext_data']['heading'])) {
$data['heading'] = $module['ext_data']['heading'];
} else {
$data['heading'] = $title;
}
}
if ($this->input->post() and $this->_updateModule() === TRUE) {
if ($this->input->post('save_close') === '1') {
redirect('extensions');
}
redirect('extensions/edit/module/account_module');
}
return $this->load->view('account_module/admin_account_module', $data, TRUE);
}
}