function __construct() { foreach (OSCOM::callDB('GetLanguages', null, 'Core') as $lang) { $this->_languages[$lang['code']] = array('id' => (int) $lang['languages_id'], 'code' => $lang['code'], 'name' => $lang['name'], 'locale' => $lang['locale'], 'charset' => $lang['charset'], 'date_format_short' => $lang['date_format_short'], 'date_format_long' => $lang['date_format_long'], 'time_format' => $lang['time_format'], 'text_direction' => $lang['text_direction'], 'currencies_id' => (int) $lang['currencies_id'], 'numeric_separator_decimal' => $lang['numeric_separator_decimal'], 'numeric_separator_thousands' => $lang['numeric_separator_thousands'], 'parent_id' => (int) $lang['parent_id']); } $this->set(); }
/** * Return the Administration Tool Application modules the administrator has access to * * @param int $id The ID of the administrator * @access public * @return array */ public static function getUserLevels($id, $site = null) { if (empty($site)) { $site = OSCOM::getSite(); } $data = array('id' => $id); $applications = array(); foreach (OSCOM::callDB('GetAccessUserLevels', $data, 'Core') as $am) { $applications[] = $am['module']; } if (in_array('*', $applications)) { $applications = array(); $DLapps = new DirectoryListing(OSCOM::BASE_DIRECTORY . 'Core/Site/' . $site . '/Application'); $DLapps->setIncludeFiles(false); foreach ($DLapps->getFiles() as $file) { if (preg_match('/[A-Z]/', substr($file['name'], 0, 1)) && !in_array($file['name'], call_user_func(array('osCommerce\\OM\\Core\\Site\\' . $site . '\\Controller', 'getGuestApplications'))) && file_exists($DLapps->getDirectory() . '/' . $file['name'] . '/Controller.php')) { // HPDL remove preg_match $applications[] = $file['name']; } } $DLcapps = new DirectoryListing(OSCOM::BASE_DIRECTORY . 'Custom/Site/' . $site . '/Application'); $DLcapps->setIncludeFiles(false); foreach ($DLcapps->getFiles() as $file) { if (!in_array($file['name'], $applications) && !in_array($file['name'], call_user_func(array('osCommerce\\OM\\Core\\Site\\' . $site . '\\Controller', 'getGuestApplications'))) && file_exists($DLcapps->getDirectory() . '/' . $file['name'] . '/Controller.php')) { $applications[] = $file['name']; } } } $shortcuts = array(); foreach (OSCOM::callDB('GetAccessUserShortcuts', $data, 'Core') as $as) { $shortcuts[] = $as['module']; } $levels = array(); foreach ($applications as $app) { $application_class = 'osCommerce\\OM\\Core\\Site\\' . $site . '\\Application\\' . $app . '\\Controller'; if (class_exists($application_class)) { if (Registry::exists('Application') && $app == OSCOM::getSiteApplication()) { $OSCOM_Application = Registry::get('Application'); } else { Registry::get('Language')->loadIniFile($app . '.php'); $OSCOM_Application = new $application_class(false); } $levels[$app] = array('module' => $app, 'icon' => $OSCOM_Application->getIcon(), 'title' => $OSCOM_Application->getTitle(), 'group' => $OSCOM_Application->getGroup(), 'linkable' => $OSCOM_Application->canLinkTo(), 'shortcut' => in_array($app, $shortcuts), 'sort_order' => $OSCOM_Application->getSortOrder()); } } return $levels; }
/** * Return all templates in an array * * @access public * @return array */ public static function getTemplates() { return OSCOM::callDB('GetTemplates', null, 'Core'); }