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); }
public static function admin_caption() { if (ModuleManager::is_installed('Base_EpesiStore') >= 0 && Base_EpesiStoreCommon::admin_access()) { return null; } return array('label' => __('Modules Administration'), 'section' => __('Server Configuration')); }
public static function user_settings() { if (!Base_EpesiStoreCommon::admin_access()) { return array(); } set_time_limit(0); // get default data from user contact $my_contact = ModuleManager::is_installed('CRM_Contacts') > -1 ? CRM_ContactsCommon::get_my_record() : array(); // key = field name from contact => value = field name in settings $keys = self::get_payment_data_keys(); $values = array(); // do user setting entries from data foreach ($keys as $k => $v) { $x = array('name' => $v, 'label' => _V(ucwords(str_replace('_', ' ', $v))), 'type' => 'text', 'default' => isset($my_contact[$k]) ? $my_contact[$k] : ''); if ($k == 'country') { $x['type'] = 'select'; $x['values'] = Utils_CommonDataCommon::get_translated_array('Countries'); } $values[] = $x; } return array(__('EPESI Store') => array_merge(array(array('name' => 'payments_header', 'label' => '', 'type' => 'header', 'default' => __('Payment credentials'))), $values)); }