Beispiel #1
0
 public function manage()
 {
     if (!Base_EpesiStoreCommon::admin_access()) {
         return;
     }
     $button_label = Base_EssClientCommon::has_license_key() ? __('License Key') : __('Register EPESI!');
     Base_ActionBarCommon::add(Base_ThemeCommon::get_template_file('Base_EpesiStore', 'icon.png'), $button_label, $this->create_callback_href(array($this, 'display_registration_form')));
     Base_ActionBarCommon::add('view', __('Invoices'), $this->create_callback_href(array($this, 'display_invoices')));
     $setup = $this->init_module('Base_Setup');
     $setup->set_inline_display();
     if (Base_SetupCommon::is_simple_setup()) {
         if (!$this->isset_module_variable('filter_set')) {
             eval_js('base_setup__last_filter="' . (!Base_EssClientCommon::has_license_key() ? '' : (Base_EpesiStoreCommon::is_update_available() ? 'updates' : 'store')) . '";');
             $this->set_module_variable('filter_set', true);
         }
         $this->display_module($setup, array(true), 'admin');
         return;
     }
     Base_ActionBarCommon::add('settings', __('Simple view'), $this->create_callback_href(array($this, 'switch_simple'), true));
     $tb = $this->init_module('Utils_TabbedBrowser');
     $tb->set_tab('Modules Setup', array($this, 'setup_admin'), array($setup));
     $tb->set_tab('Epesi Store', array($this, 'form_main_store'), array());
     $tb->tag();
     $this->display_module($tb);
 }
Beispiel #2
0
 public function body($store = false)
 {
     if ($this->is_back() && $this->parent) {
         $this->parent->reset();
         return;
     }
     $post_install =& $this->get_module_variable('post-install');
     if (is_array($post_install)) {
         foreach ($post_install as $i => $v) {
             ModuleManager::include_install($i);
             $f = array($i . 'Install', 'post_install');
             $fs = array($i . 'Install', 'post_install_process');
             if (!is_callable($f) || !is_callable($fs)) {
                 unset($post_install[$i]);
                 continue;
             }
             $ret = call_user_func($f);
             $form = $this->init_module('Libs/QuickForm', null, $i);
             $form->addElement('header', null, 'Post installation of ' . str_replace('_', '/', $i));
             $form->add_array($ret);
             $form->addElement('submit', null, 'OK');
             if ($form->validate()) {
                 $form->process($fs);
                 unset($post_install[$i]);
             } else {
                 $form->display();
                 break;
             }
         }
         if (empty($post_install)) {
             $this->unset_module_variable('post-install');
         }
     }
     $post_install =& $this->get_module_variable('post-install');
     if (is_array($post_install)) {
         return;
     }
     $simple = Base_SetupCommon::is_simple_setup();
     Base_ActionBarCommon::add('scan', __('Rebuild modules database'), $this->create_confirm_callback_href(__('Parsing for additional modules may take up to several minutes, do you wish to continue?'), array('Base_Setup', 'parse_modules_folder_refresh')));
     if (!$store) {
         Base_ActionBarCommon::add('back', __('Back'), $this->create_back_href());
     }
     if ($simple) {
         $this->simple_setup();
     } else {
         $this->advanced_setup($store);
     }
 }