本文整理汇总了PHP中osCommerce\OM\Core\OSCOM::getSite方法的典型用法代码示例。如果您正苦于以下问题:PHP OSCOM::getSite方法的具体用法?PHP OSCOM::getSite怎么用?PHP OSCOM::getSite使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osCommerce\OM\Core\OSCOM
的用法示例。
在下文中一共展示了OSCOM::getSite方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
public static function execute() {
$site = OSCOM::getSite();
$result = array('entries' => array());
if ( isset($_SESSION[$site]['id']) ) {
if ( isset($_GET['reset']) && !empty($_GET['reset']) && OSCOM::siteApplicationExists($_GET['reset']) ) {
Dashboard::updateAppDateOpened($_SESSION[$site]['id'], $_GET['reset']);
}
$shortcuts = array();
foreach ( Dashboard::getShortcuts($_SESSION[$site]['id']) as $app ) {
$shortcuts[$app['module']] = $app['last_viewed'];
}
foreach ( $_SESSION[$site]['access'] as $module => $data ) {
if ( $data['shortcut'] === true ) {
if ( method_exists('osCommerce\\OM\\Core\\Site\\Admin\\Application\\' . $data['module'] . '\\' . $data['module'], 'getShortcutNotification') || class_exists('osCommerce\\OM\\Core\\Site\\Admin\\Application\\' . $data['module'] . '\\Model\\getShortcutNotification') ) {
$result['entries'][$data['module']] = call_user_func(array('osCommerce\\OM\\Core\\Site\\Admin\\Application\\' . $data['module'] . '\\' . $data['module'], 'getShortcutNotification'), $shortcuts[$data['module']]);
}
}
}
}
$result['rpcStatus'] = RPC::STATUS_SUCCESS;
echo json_encode($result);
}
示例2: execute
public static function execute()
{
$OSCOM_Language = Registry::get('Language');
$module_files = array();
$DLapps = new DirectoryListing(OSCOM::BASE_DIRECTORY . 'Core/Site/' . OSCOM::getSite() . '/Application');
$DLapps->setIncludeFiles(false);
foreach ($DLapps->getFiles() as $file) {
if (!in_array($file['name'], call_user_func(array('osCommerce\\OM\\Core\\Site\\' . OSCOM::getSite() . '\\Controller', 'getGuestApplications'))) && file_exists($DLapps->getDirectory() . '/' . $file['name'] . '/Controller.php')) {
$module_files[] = $file['name'];
}
}
$modules = array();
foreach ($module_files as $module) {
$application_class = 'osCommerce\\OM\\Core\\Site\\' . OSCOM::getSite() . '\\Application\\' . $module . '\\Controller';
if (class_exists($application_class)) {
if ($module == OSCOM::getSiteApplication()) {
$OSCOM_Application = Registry::get('Application');
} else {
Registry::get('Language')->loadIniFile($module . '.php');
$OSCOM_Application = new $application_class(false);
}
$modules[Access::getGroupTitle($OSCOM_Application->getGroup())][] = array('id' => $module, 'text' => $OSCOM_Application->getTitle(), 'icon' => $OSCOM_Application->getIcon());
}
}
ksort($modules);
return $modules;
}
示例3: __construct
public function __construct()
{
Registry::get('Language')->loadIniFile('modules/Dashboard/Customers.php');
$this->_title = OSCOM::getDef('admin_indexmodules_customers_title');
$this->_title_link = OSCOM::getLink(null, 'Customers');
if (Access::hasAccess(OSCOM::getSite(), 'Customers')) {
$this->_data = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">' . ' <thead>' . ' <tr>' . ' <th>' . OSCOM::getDef('admin_indexmodules_customers_table_heading_customers') . '</th>' . ' <th>' . OSCOM::getDef('admin_indexmodules_customers_table_heading_date') . '</th>' . ' <th>' . OSCOM::getDef('admin_indexmodules_customers_table_heading_status') . '</th>' . ' </tr>' . ' </thead>' . ' <tbody>';
$Qcustomers = Registry::get('Database')->query('select customers_id, customers_gender, customers_lastname, customers_firstname, customers_status, date_account_created from :table_customers order by date_account_created desc limit 6');
$Qcustomers->execute();
$counter = 0;
while ($Qcustomers->next()) {
$customer_icon = osc_icon('people.png');
if (ACCOUNT_GENDER > -1) {
switch ($Qcustomers->value('customers_gender')) {
case 'm':
$customer_icon = osc_icon('user_male.png');
break;
case 'f':
$customer_icon = osc_icon('user_female.png');
break;
}
}
$this->_data .= ' <tr onmouseover="$(this).addClass(\'mouseOver\');" onmouseout="$(this).removeClass(\'mouseOver\');"' . ($counter % 2 ? ' class="alt"' : '') . '>' . ' <td>' . osc_link_object(OSCOM::getLink(null, 'Customers', 'cID=' . $Qcustomers->valueInt('customers_id') . '&action=save'), $customer_icon . ' ' . $Qcustomers->valueProtected('customers_firstname') . ' ' . $Qcustomers->valueProtected('customers_lastname')) . '</td>' . ' <td>' . $Qcustomers->value('date_account_created') . '</td>' . ' <td align="center">' . osc_icon($Qcustomers->valueInt('customers_status') === 1 ? 'checkbox_ticked.gif' : 'checkbox_crossed.gif', null, null) . '</td>' . ' </tr>';
$counter++;
}
$this->_data .= ' </tbody>' . '</table>';
}
}
示例4: __construct
public function __construct()
{
$this->initialize();
if (isset($_GET['action']) && !empty($_GET['action'])) {
$action = HTML::sanitize(basename($_GET['action']));
if (class_exists('osCommerce\\OM\\Core\\Site\\' . OSCOM::getSite() . '\\Application\\' . OSCOM::getSiteApplication() . '\\Action\\' . $action)) {
call_user_func(array('osCommerce\\OM\\Core\\Site\\' . OSCOM::getSite() . '\\Application\\' . OSCOM::getSiteApplication() . '\\Action\\' . $action, 'execute'), $this);
}
}
}
示例5: set
public function set($code = null)
{
if (!isset($_SESSION[OSCOM::getSite()]['template'])) {
$data = array();
foreach ($this->getTemplates() as $template) {
$data = array('id' => $template['id'], 'code' => $template['code']);
}
$_SESSION[OSCOM::getSite()]['template'] = $data;
}
$this->_template_id = $_SESSION[OSCOM::getSite()]['template']['id'];
$this->_template = $_SESSION[OSCOM::getSite()]['template']['code'];
}
示例6: hasAccess
public static function hasAccess($application)
{
if (!isset($_SESSION[OSCOM::getSite()]['id'])) {
$redirect = false;
if ($application != 'Login') {
$_SESSION[OSCOM::getSite()]['redirect_origin'] = $application;
$redirect = true;
}
if ($redirect === true) {
osc_redirect_admin(OSCOM::getLink(null, 'Login'));
}
}
return Access::hasAccess(OSCOM::getSite(), $application);
}
示例7: execute
public static function execute(ApplicationAbstract $application)
{
if (!empty($_GET['shortcut'])) {
$application = HTML::sanitize($_GET['shortcut']);
if (OSCOM::siteApplicationExists($application)) {
if (Dashboard::deleteShortcut($_SESSION[OSCOM::getSite()]['id'], $application)) {
$_SESSION[OSCOM::getSite()]['access'] = Access::getUserLevels($_SESSION[OSCOM::getSite()]['id']);
Registry::get('MessageStack')->add('header', OSCOM::getDef('ms_success_shortcut_removed'), 'success');
OSCOM::redirect(OSCOM::getLink(null, $application));
}
}
}
OSCOM::redirect(OSCOM::getLink());
}
示例8: loadIniFile
public function loadIniFile($filename = null, $comment = '#', $language_code = null)
{
if (is_null($language_code)) {
$language_code = $this->_code;
}
if ($this->_languages[$language_code]['parent_id'] > 0) {
$this->loadIniFile($filename, $comment, $this->getCodeFromID($this->_languages[$language_code]['parent_id']));
}
if (is_null($filename)) {
if (file_exists(OSCOM::BASE_DIRECTORY . 'Custom/Site/' . OSCOM::getSite() . '/languages/' . $language_code . '.php')) {
$contents = file(OSCOM::BASE_DIRECTORY . 'Custom/Site/' . OSCOM::getSite() . '/languages/' . $language_code . '.php');
} elseif (file_exists(OSCOM::BASE_DIRECTORY . 'Core/Site/' . OSCOM::getSite() . '/languages/' . $language_code . '.php')) {
$contents = file(OSCOM::BASE_DIRECTORY . 'Core/Site/' . OSCOM::getSite() . '/languages/' . $language_code . '.php');
} else {
return array();
}
} else {
if (substr(realpath(OSCOM::BASE_DIRECTORY . 'Custom/Site/' . OSCOM::getSite() . '/languages/' . $language_code . '/' . $filename), 0, strlen(realpath(OSCOM::BASE_DIRECTORY . 'Custom/Site/' . OSCOM::getSiteApplication() . '/languages/' . $language_code))) != realpath(OSCOM::BASE_DIRECTORY . 'Custom/Site/' . OSCOM::getSiteApplication() . '/languages/' . $language_code)) {
return array();
}
if (substr(realpath(OSCOM::BASE_DIRECTORY . 'Core/Site/' . OSCOM::getSite() . '/languages/' . $language_code . '/' . $filename), 0, strlen(realpath(OSCOM::BASE_DIRECTORY . 'Core/Site/' . OSCOM::getSiteApplication() . '/languages/' . $language_code))) != realpath(OSCOM::BASE_DIRECTORY . 'Core/Site/' . OSCOM::getSiteApplication() . '/languages/' . $language_code)) {
return array();
}
if (file_exists(OSCOM::BASE_DIRECTORY . 'Custom/Site/' . OSCOM::getSite() . '/languages/' . $language_code . '/' . $filename)) {
$contents = file(OSCOM::BASE_DIRECTORY . 'Custom/Site/' . OSCOM::getSite() . '/languages/' . $language_code . '/' . $filename);
} elseif (file_exists(OSCOM::BASE_DIRECTORY . 'Core/Site/' . OSCOM::getSite() . '/languages/' . $language_code . '/' . $filename)) {
$contents = file(OSCOM::BASE_DIRECTORY . 'Core/Site/' . OSCOM::getSite() . '/languages/' . $language_code . '/' . $filename);
} else {
return array();
}
}
$ini_array = array();
foreach ($contents as $line) {
$line = trim($line);
$firstchar = substr($line, 0, 1);
if (!empty($line) && $firstchar != $comment) {
$delimiter = strpos($line, '=');
if ($delimiter !== false && substr_count(substr($line, 0, $delimiter), ' ') == 1) {
$key = trim(substr($line, 0, $delimiter));
$value = trim(substr($line, $delimiter + 1));
$ini_array[$key] = $value;
} elseif (isset($key)) {
$ini_array[$key] .= "\n" . trim($line);
}
}
}
unset($contents);
$this->_definitions = array_merge($this->_definitions, $ini_array);
}
示例9: __construct
public function __construct()
{
Registry::get('Language')->loadIniFile('modules/Dashboard/Reviews.php');
$this->_title = OSCOM::getDef('admin_indexmodules_reviews_title');
$this->_title_link = OSCOM::getLink(null, 'Reviews');
if (Access::hasAccess(OSCOM::getSite(), 'Reviews')) {
$this->_data = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">' . ' <thead>' . ' <tr>' . ' <th>' . OSCOM::getDef('admin_indexmodules_reviews_table_heading_products') . '</th>' . ' <th>' . OSCOM::getDef('admin_indexmodules_reviews_table_heading_language') . '</th>' . ' <th>' . OSCOM::getDef('admin_indexmodules_reviews_table_heading_rating') . '</th>' . ' <th>' . OSCOM::getDef('admin_indexmodules_reviews_table_heading_date') . '</th>' . ' </tr>' . ' </thead>' . ' <tbody>';
$Qreviews = Registry::get('Database')->query('select r.reviews_id, r.products_id, greatest(r.date_added, greatest(r.date_added, r.last_modified)) as date_last_modified, r.reviews_rating, pd.products_name, l.name as languages_name, l.code as languages_code from :table_reviews r left join :table_products_description pd on (r.products_id = pd.products_id and r.languages_id = pd.language_id), :table_languages l where r.languages_id = l.languages_id order by date_last_modified desc limit 6');
$Qreviews->execute();
$counter = 0;
while ($Qreviews->next()) {
$this->_data .= ' <tr onmouseover="$(this).addClass(\'mouseOver\');" onmouseout="$(this).removeClass(\'mouseOver\');"' . ($counter % 2 ? ' class="alt"' : '') . '>' . ' <td>' . osc_link_object(OSCOM::getLink(null, 'Reviews', 'rID=' . $Qreviews->valueInt('reviews_id') . '&action=save'), osc_icon('reviews.png') . ' ' . $Qreviews->value('products_name')) . '</td>' . ' <td align="center">' . Registry::get('Language')->showImage($Qreviews->value('languages_code')) . '</td>' . ' <td align="center">' . osc_image('../images/stars_' . $Qreviews->valueInt('reviews_rating') . '.png', $Qreviews->valueInt('reviews_rating') . '/5') . '</td>' . ' <td>' . $Qreviews->value('date_last_modified') . '</td>' . ' </tr>';
$counter++;
}
$this->_data .= ' </tbody>' . '</table>';
}
}
示例10: __construct
public function __construct()
{
Registry::get('Language')->loadIniFile('modules/IndexModules/AdministratorsLog.php');
$this->_title = OSCOM::getDef('admin_indexmodules_administratorslog_title');
$this->_title_link = OSCOM::getLink(null, 'AdministratorsLog');
if (Access::hasAccess(OSCOM::getSite(), 'AdministratorsLog')) {
$this->_data = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">' . ' <thead>' . ' <tr>' . ' <th>' . OSCOM::getDef('admin_indexmodules_administratorslog_table_heading_users') . '</th>' . ' <th>' . OSCOM::getDef('admin_indexmodules_administratorslog_table_heading_module') . '</th>' . ' <th>' . OSCOM::getDef('admin_indexmodules_administratorslog_table_heading_date') . '</th>' . ' </tr>' . ' </thead>' . ' <tbody>';
$Qlog = Registry::get('Database')->query('select count(al.id) as total, al.id, al.module, a.user_name, al.datestamp from :table_administrators_log al, :table_administrators a where al.module in (":modules") and al.administrators_id = a.id group by al.id order by al.id desc limit 6');
$Qlog->bindRaw(':modules', implode('", "', array_keys($_SESSION[OSCOM::getSite()]['access'])));
$Qlog->execute();
$counter = 0;
while ($Qlog->next()) {
$this->_data .= ' <tr onmouseover="$(this).addClass(\'mouseOver\');" onmouseout="$(this).removeClass(\'mouseOver\');"' . ($counter % 2 ? ' class="alt"' : '') . '>' . ' <td>' . osc_link_object(OSCOM::getLink(null, 'AdministratorsLog&lID=' . $Qlog->valueInt('id') . '&action=info'), osc_icon('log.png') . ' ' . $Qlog->valueProtected('user_name')) . '</td>' . ' <td>' . $Qlog->value('module') . ' (' . $Qlog->valueInt('total') . ')</td>' . ' <td>' . $Qlog->value('datestamp') . '</td>' . ' </tr>';
$counter++;
}
$this->_data .= ' </tbody>' . '</table>';
}
}
示例11: execute
public static function execute(ApplicationAbstract $application)
{
$data = array('username' => $_POST['user_name'], 'password' => $_POST['user_password']);
if (Login::isValidCredentials($data)) {
$admin = Login::getAdmin($data['username']);
$_SESSION[OSCOM::getSite()]['id'] = (int) $admin['id'];
$_SESSION[OSCOM::getSite()]['username'] = $admin['user_name'];
$_SESSION[OSCOM::getSite()]['access'] = Access::getUserLevels($admin['id']);
$to_application = OSCOM::getDefaultSiteApplication();
if (isset($_SESSION[OSCOM::getSite()]['redirect_origin'])) {
$to_application = $_SESSION[OSCOM::getSite()]['redirect_origin'];
unset($_SESSION[OSCOM::getSite()]['redirect_origin']);
}
osc_redirect_admin(OSCOM::getLink(null, $to_application));
} else {
Registry::get('MessageStack')->add('header', OSCOM::getDef('ms_error_login_invalid'), 'error');
}
}
示例12: __construct
public function __construct()
{
Registry::get('Language')->loadIniFile('modules/Dashboard/Orders.php');
$this->_title = OSCOM::getDef('admin_indexmodules_orders_title');
$this->_title_link = OSCOM::getLink(null, 'Orders');
if (Access::hasAccess(OSCOM::getSite(), 'Orders')) {
$this->_data = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">' . ' <thead>' . ' <tr>' . ' <th>' . OSCOM::getDef('admin_indexmodules_orders_table_heading_orders') . '</th>' . ' <th>' . OSCOM::getDef('admin_indexmodules_orders_table_heading_total') . '</th>' . ' <th>' . OSCOM::getDef('admin_indexmodules_orders_table_heading_date') . '</th>' . ' <th>' . OSCOM::getDef('admin_indexmodules_orders_table_heading_status') . '</th>' . ' </tr>' . ' </thead>' . ' <tbody>';
$Qorders = Registry::get('Database')->query('select o.orders_id, o.customers_name, greatest(o.date_purchased, ifnull(o.last_modified, "1970-01-01")) as date_last_modified, s.orders_status_name, ot.text as order_total from :table_orders o, :table_orders_total ot, :table_orders_status s where o.orders_id = ot.orders_id and ot.class = "total" and o.orders_status = s.orders_status_id and s.language_id = :language_id order by date_last_modified desc limit 6');
$Qorders->bindInt(':language_id', Registry::get('Language')->getID());
$Qorders->execute();
$counter = 0;
while ($Qorders->next()) {
$this->_data .= ' <tr onmouseover="$(this).addClass(\'mouseOver\');" onmouseout="$(this).removeClass(\'mouseOver\');"' . ($counter % 2 ? ' class="alt"' : '') . '>' . ' <td>' . osc_link_object(OSCOM::getLink(null, 'Orders', 'oID=' . $Qorders->valueInt('orders_id') . '&action=save'), osc_icon('orders.png') . ' ' . $Qorders->valueProtected('customers_name')) . '</td>' . ' <td>' . strip_tags($Qorders->value('order_total')) . '</td>' . ' <td>' . $Qorders->value('date_last_modified') . '</td>' . ' <td>' . $Qorders->value('orders_status_name') . '</td>' . ' </tr>';
$counter++;
}
$this->_data .= ' </tbody>' . '</table>';
}
}
示例13: __construct
public function __construct()
{
Registry::get('Language')->loadIniFile('modules/IndexModules/ErrorLog.php');
$this->_title = OSCOM::getDef('admin_indexmodules_errorlog_title');
$this->_title_link = OSCOM::getLink(null, 'ErrorLog');
if (Access::hasAccess(OSCOM::getSite(), 'ErrorLog')) {
$this->_data = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">' . ' <thead>' . ' <tr>' . ' <th>' . OSCOM::getDef('admin_indexmodules_errorlog_table_heading_date') . '</th>' . ' <th>' . OSCOM::getDef('admin_indexmodules_errorlog_table_heading_message') . '</th>' . ' </tr>' . ' </thead>' . ' <tbody>';
if (ErrorHandler::getTotalEntries() > 0) {
$counter = 0;
foreach (ErrorHandler::getAll(6) as $row) {
$this->_data .= ' <tr onmouseover="$(this).addClass(\'mouseOver\');" onmouseout="$(this).removeClass(\'mouseOver\');"' . ($counter % 2 ? ' class="alt"' : '') . '>' . ' <td style="white-space: nowrap;">' . Registry::get('Template')->getIcon(16, 'errorlog.png') . ' ' . DateTime::getShort(DateTime::fromUnixTimestamp($row['timestamp']), true) . '</td>' . ' <td>' . osc_output_string_protected(substr($row['message'], 0, 60)) . '..</td>' . ' </tr>';
$counter++;
}
} else {
$this->_data .= ' <tr onmouseover="$(this).addClass(\'mouseOver\');" onmouseout="$(this).removeClass(\'mouseOver\');">' . ' <td colspan="2">' . osc_icon('tick.png') . ' ' . OSCOM::getDef('admin_indexmodules_errorlog_no_errors_found') . '</td>' . ' </tr>';
}
$this->_data .= ' </tbody>' . '</table>';
}
}
示例14: execute
public static function execute(ApplicationAbstract $application)
{
$OSCOM_Database = Registry::get('Database');
if (!empty($_GET['shortcut'])) {
$application = osc_sanitize_string($_GET['shortcut']);
if (OSCOM::siteApplicationExists($application)) {
$Qsc = $OSCOM_Database->query('delete from :table_administrator_shortcuts where administrators_id = :administrators_id and module = :module');
$Qsc->bindInt(':administrators_id', $_SESSION[OSCOM::getSite()]['id']);
$Qsc->bindValue(':module', $application);
$Qsc->execute();
if (!$OSCOM_Database->isError()) {
$_SESSION[OSCOM::getSite()]['access'] = Access::getUserLevels($_SESSION[OSCOM::getSite()]['id']);
Registry::get('MessageStack')->add('header', OSCOM::getDef('ms_success_shortcut_removed'), 'success');
osc_redirect_admin(OSCOM::getLink(null, $application));
}
}
}
osc_redirect_admin(OSCOM::getLink());
}
示例15: execute
public static function execute(ApplicationAbstract $application)
{
$error = false;
foreach ($_POST['batch'] as $id) {
if (!Administrators::setAccessLevels($id, $_POST['modules'], $_POST['mode'])) {
$error = true;
break;
}
}
if ($error === false) {
Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success');
if (in_array($_SESSION[OSCOM::getSite()]['id'], $_POST['batch'])) {
$_SESSION[OSCOM::getSite()]['access'] = Access::getUserLevels($_SESSION[OSCOM::getSite()]['id']);
}
} else {
Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error');
}
OSCOM::redirect(OSCOM::getLink());
}