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)); }
private function included_modules_text($module) { $text = ''; if ($module['needed_modules']) { $text .= __('With this module you also need some other modules.') . '<br>' . __('Here is the list of what you will buy:'); $arr = array($module['name'] => $module['price']); if (!is_array($module['required_modules'])) { $module['required_modules'] = explode(', ', $module['required_modules']); } foreach ($module['needed_modules'] as $rm_id) { $mod = Base_EpesiStoreCommon::get_module_info_cached($rm_id); $arr[$mod['name']] = $mod['price']; } $text .= "<table class=\"price_summary\">"; foreach ($arr as $name => $price) { $text .= "<tr><td>{$name}</td><td>{$price}</td></tr>"; } $text .= "</table>"; } return $text; }
private function _module_is_active($module_id) { $mi = Base_EpesiStoreCommon::get_module_info($module_id); return $mi['active']; }
* @subpackage tooltip */ if (!isset($_POST['cid'])) { die('Invalid request' . print_r($_POST, true)); } define('JS_OUTPUT', 1); define('CID', $_POST['cid']); define('READ_ONLY_SESSION', 1); require_once '../../../include.php'; ModuleManager::load_modules(); $registered = Base_EssClientCommon::is_registered(); $ver = __('version %s', array(EPESI_VERSION)); if (!$registered) { print $ver; return; } $updates = Base_EpesiStoreCommon::is_update_available(); if (!$updates) { print $ver; return; } if (Base_AclCommon::i_am_sa()) { $tooltip = __('There are updates available for download, click to go to EPESI store.'); } else { $tooltip = __('There are updates available for download. Please contact your administrator.'); } $message = Utils_TooltipCommon::create(__('version %s', array(EPESI_VERSION)) . '<br/><b>(' . __('Updates Available!') . ')</b>', $tooltip, false); if (Base_AclCommon::i_am_sa()) { $message = '<a ' . Module::create_href(array('go_to_epesi_store_for_updates' => true)) . 'class="version">' . $message . '</a>'; } print $message;