public function admin() { if ($this->is_back()) { if ($this->parent->get_type() == 'Base_Admin') { $this->parent->reset(); } else { location(array()); } return; } $form = $this->init_module(Libs_QuickForm::module_name(), 'Changing template'); $themes = Base_Theme::list_themes(); $form->addElement('header', 'install_module_header', __('Themes Administration')); $form->addElement('select', 'theme', __('Choose template'), $themes); $form->addElement('static', null, '', '<br /><br />'); $form->addElement('header', 'upload_theme_header', __('Upload template')); $form->setDefaults(array('theme' => Variable::get('default_theme'))); if ($form->validate()) { $form->process(array(&$this, 'submit_admin')); } else { $form->display(); if (class_exists('ZipArchive')) { $this->pack_module(Utils_FileUpload::module_name(), array(array($this, 'upload_template'), __('Upload template'))); // Base_ActionBarCommon::add('edit',__('Manage templates'),$this->create_callback_href(array($this,'download_template'))); } } Base_ActionBarCommon::add('back', __('Back'), $this->create_back_href()); Base_ActionBarCommon::add('save', __('Save'), $form->get_submit_form_href()); }
public function admin() { if ($this->is_back()) { $this->parent->reset(); } $form = $this->init_module(Libs_QuickForm::module_name()); $form->addElement('header', 'settings', __('Title')); $form->setDefaults(array('title' => Variable::get('base_page_title'), 'show_caption_in_title' => Variable::get('show_caption_in_title'), 'show_module_indicator' => Variable::get('show_module_indicator'))); $form->addElement('text', 'title', __('Base page title')); $form->addElement('checkbox', 'show_caption_in_title', __('Display module captions inside page title')); $form->addElement('checkbox', 'show_module_indicator', __('Display module captions inside module')); $form->addElement('submit', 'button', __('Save'), $form->get_submit_form_href()); $form->addElement('static', '', '<div style="width:200px"></div>', '<div style="width:600px"></div>'); if ($form->validate()) { $form->process(array($this, 'submit_config')); } else { $this->display_module($form); } $form = $this->init_module(Utils_FileUpload::module_name(), array(false)); $form->addElement('header', 'upload', __('Small Logo')); $form->addElement('static', 'logo_size', '', __('Logo image should be 193px by 83px in JPG/JPEG, GIF, PNG or BMP format')); $logo = Variable::get('logo_file'); if ($logo && file_exists($logo)) { $form->addElement('static', 'logo', '', '<img src="' . $logo . '?' . filemtime($logo) . '" />'); } $form->addElement('hidden', 'type', ''); $form->add_upload_element(); $form->addElement('static', '', '<div style="width:200px"></div>', '<div style="width:600px"></div>'); //$form->addElement('submit', 'button', __('Upload'), $form->get_submit_form_href()); $this->display_module($form, array(array($this, 'submit_logo'))); $form = $this->init_module(Utils_FileUpload::module_name(), array(false)); $form->addElement('header', 'upload', __('Login Logo')); $form->addElement('static', 'logo_size', '', __('Logo image should be 550px by 200px in JPG/JPEG, GIF, PNG or BMP format')); $logo = Variable::get('login_logo_file'); if ($logo && file_exists($logo)) { $form->addElement('static', 'logo', '', '<img src="' . $logo . '?' . filemtime($logo) . '" />'); } $form->addElement('hidden', 'type', 'login_'); $form->add_upload_element(); $form->addElement('static', '', '<div style="width:200px"></div>', '<div style="width:600px"></div>'); //$form->addElement('submit', 'button', __('Upload'), $form->get_submit_form_href()); $this->display_module($form, array(array($this, 'submit_logo'))); Base_ActionBarCommon::add('delete', __('Delete logo'), $this->create_callback_href(array($this, 'delete_logo'))); Base_ActionBarCommon::add('back', __('Back'), $this->create_back_href()); }
public function body($record) { $form = $this->init_module(Utils_FileUpload::module_name(), array(false)); $form->addElement('header', 'upload', __('Upload new photo') . ': ' . $record['last_name'] . ' ' . $record['first_name']); $form->set_upload_button_caption(__('Save')); $form->add_upload_element(); Base_ActionBarCommon::add('save', __('Save'), $form->get_submit_form_href()); Base_ActionBarCommon::add('back', __('Back'), $this->create_back_href()); if (CRM_Contacts_PhotoCommon::get_photo($record['id'])) { Base_ActionBarCommon::add('delete', __('Clear'), $this->create_confirm_callback_href(__('Are you sure?'), array($this, 'clear_photo'), array($record['id']))); } $this->display_module($form, array(array($this, 'submit_attach'), $record)); if ($this->is_back() || $this->submitted) { $x = ModuleManager::get_instance('/Base_Box|0'); if (!$x) { trigger_error('There is no base box module instance', E_USER_ERROR); } return $x->pop_main(); } }
public function send_file_tab() { if ($this->is_back()) { return false; } $form = $this->init_module(Utils_FileUpload::module_name(), array(false)); $form->addElement('header', 'upload', __('Select file')); $form->add_upload_element(); $s = HTML_QuickForm::createElement('button', null, __('Send fax'), $form->get_submit_form_href()); $c = HTML_QuickForm::createElement('button', null, __('Cancel'), $this->create_back_href()); $form->addGroup(array($s, $c)); $this->display_module($form, array(array($this, 'submit_fax_file'))); if ($this->back_from_send_file) { return false; } return true; }
public function admin() { if ($this->is_back()) { $this->parent->reset(); return; } $form = $this->init_module(Utils_FileUpload::module_name(), array(false)); $form->addElement('header', 'upload', __('Upload company logo', array(), false)); $form->add_upload_element(); $form->addElement('button', null, __('Upload'), $form->get_submit_form_href()); $this->display_module($form, array(array($this, 'upload_logo'))); Base_ActionBarCommon::add('back', __('Back'), $this->create_back_href()); }