示例#1
0
 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;
 }
示例#2
0
 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 . '&nbsp;' . $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>';
     }
 }
示例#3
0
 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);
 }
 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());
 }
示例#5
0
 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') . '&nbsp;' . $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>';
     }
 }
 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') . '&nbsp;' . $Qlog->valueProtected('user_name')) . '</td>' . '      <td>' . $Qlog->value('module') . ' (' . $Qlog->valueInt('total') . ')</td>' . '      <td>' . $Qlog->value('datestamp') . '</td>' . '    </tr>';
             $counter++;
         }
         $this->_data .= '  </tbody>' . '</table>';
     }
 }
示例#7
0
 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');
     }
 }
示例#8
0
 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') . '&nbsp;' . $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>';
     }
 }
示例#9
0
 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());
 }
示例#10
0
 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());
 }
示例#11
0
 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') . '&nbsp;' . 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') . '&nbsp;' . OSCOM::getDef('admin_indexmodules_errorlog_no_errors_found') . '</td>' . '    </tr>';
         }
         $this->_data .= '  </tbody>' . '</table>';
     }
 }
示例#12
0
 public static function execute(ApplicationAbstract $application)
 {
     $data = array('username' => $_POST['user_name'], 'password' => $_POST['user_password']);
     switch (Administrators::save(isset($_GET['id']) && is_numeric($_GET['id']) ? $_GET['id'] : null, $data, isset($_POST['modules']) ? $_POST['modules'] : null)) {
         case 1:
             if (isset($_GET['id']) && is_numeric($_GET['id']) && $_GET['id'] == $_SESSION[OSCOM::getSite()]['id']) {
                 $_SESSION[OSCOM::getSite()]['access'] = Access::getUserLevels($_GET['id']);
             }
             Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success');
             osc_redirect_admin(OSCOM::getLink());
             break;
         case -1:
             Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error');
             osc_redirect_admin(OSCOM::getLink());
             break;
         case -2:
             Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_username_already_exists'), 'error');
             break;
     }
 }
示例#13
0
 public static function execute(ApplicationAbstract $application)
 {
     if (!CoreUpdate::localPackageExists() || CoreUpdate::getPackageInfo('version_from') != OSCOM::getVersion()) {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_wrong_version_to_update_from'), 'error');
         OSCOM::redirect(OSCOM::getLink());
     }
     if (CoreUpdate::canApplyPackage()) {
         if (CoreUpdate::applyPackage()) {
             CoreUpdate::deletePackage();
             // Refresh access list for new/deleted Applications
             $_SESSION[OSCOM::getSite()]['access'] = Access::getUserLevels($_SESSION[OSCOM::getSite()]['id']);
             Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success');
         } else {
             Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error');
         }
     } else {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_check_target_permissions'), 'error');
         OSCOM::redirect(OSCOM::getLink(null, null, 'Apply&v=' . $_GET['v']));
     }
     OSCOM::redirect(OSCOM::getLink());
 }
示例#14
0
 public static function execute(ApplicationAbstract $application)
 {
     if (!empty($_POST['user_name']) && !empty($_POST['user_password'])) {
         $Qadmin = Registry::get('Database')->query('select id, user_name, user_password from :table_administrators where user_name = :user_name limit 1');
         $Qadmin->bindValue(':user_name', $_POST['user_name']);
         $Qadmin->execute();
         if ($Qadmin->numberOfRows() === 1) {
             if (osc_validate_password($_POST['user_password'], $Qadmin->value('user_password'))) {
                 $_SESSION[OSCOM::getSite()]['id'] = $Qadmin->valueInt('id');
                 $_SESSION[OSCOM::getSite()]['username'] = $Qadmin->value('user_name');
                 $_SESSION[OSCOM::getSite()]['access'] = Access::getUserLevels($Qadmin->valueInt('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));
             }
         }
     }
     Registry::get('MessageStack')->add('header', OSCOM::getDef('ms_error_login_invalid'), 'error');
 }
示例#15
0
 public function __construct()
 {
     Registry::get('Language')->loadIniFile('modules/Dashboard/Products.php');
     $this->_title = OSCOM::getDef('admin_indexmodules_products_title');
     $this->_title_link = OSCOM::getLink(null, 'Products');
     if (Access::hasAccess(OSCOM::getSite(), 'Products')) {
         if (!isset($osC_Currencies)) {
             if (!class_exists('osC_Currencies')) {
                 include 'includes/classes/currencies.php';
             }
             $osC_Currencies = new osC_Currencies();
         }
         $this->_data = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">' . '  <thead>' . '    <tr>' . '      <th>' . OSCOM::getDef('admin_indexmodules_products_table_heading_products') . '</th>' . '      <th>' . OSCOM::getDef('admin_indexmodules_products_table_heading_price') . '</th>' . '      <th>' . OSCOM::getDef('admin_indexmodules_products_table_heading_date') . '</th>' . '      <th>' . OSCOM::getDef('admin_indexmodules_products_table_heading_status') . '</th>' . '    </tr>' . '  </thead>' . '  <tbody>';
         $Qproducts = Registry::get('PDO')->query('select products_id, greatest(products_date_added, products_last_modified) as date_last_modified from :table_products where parent_id is null order by date_last_modified desc limit 6');
         $Qproducts->execute();
         $counter = 0;
         while ($Qproducts->fetch()) {
             $data = osC_Products_Admin::get($Qproducts->valueInt('products_id'));
             $products_icon = osc_icon('products.png');
             $products_price = $data['products_price'];
             if (!empty($data['variants'])) {
                 $products_icon = osc_icon('attach.png');
                 $products_price = null;
                 foreach ($data['variants'] as $variant) {
                     if ($products_price === null || $variant['data']['price'] < $products_price) {
                         $products_price = $variant['data']['price'];
                     }
                 }
                 if ($products_price === null) {
                     $products_price = 0;
                 }
             }
             $this->_data .= '    <tr onmouseover="$(this).addClass(\'mouseOver\');" onmouseout="$(this).removeClass(\'mouseOver\');"' . ($counter % 2 ? ' class="alt"' : '') . '>' . '      <td>' . osc_link_object(OSCOM::getLink(null, 'Products', 'id=' . (int) $data['products_id'] . '&action=save'), $products_icon . '&nbsp;' . osc_output_string_protected($data['products_name'])) . '</td>' . '      <td>' . (!empty($data['variants']) ? 'from ' : '') . $osC_Currencies->format($products_price) . '</td>' . '      <td>' . $Qproducts->value('date_last_modified') . '</td>' . '      <td align="center">' . osc_icon((int) $data['products_status'] === 1 ? 'checkbox_ticked.gif' : 'checkbox_crossed.gif', null, null) . '</td>' . '    </tr>';
             $counter++;
         }
         $this->_data .= '  </tbody>' . '</table>';
     }
 }
示例#16
0
    public function __construct() {
      $OSCOM_Language = Registry::get('Language');

      $OSCOM_Language->loadIniFile('modules/Dashboard/Products.php');

      $this->_title = OSCOM::getDef('admin_indexmodules_products_title');
      $this->_title_link = OSCOM::getLink(null, 'Products');

      if ( Access::hasAccess(OSCOM::getSite(), 'Products') ) {
        if ( !Registry::exists('Currencies') ) {
          Registry::set('Currencies', new Currencies());
        }

        $OSCOM_Currencies = Registry::get('Currencies');

        $data = array('language_id' => $OSCOM_Language->getID(),
                      'batch_pageset' => 1,
                      'batch_max_results' => 6);

        $result = OSCOM::callDB('Admin\Products\GetAll', $data);

        foreach ( $result['entries'] as &$p ) {
          if ( $p['has_children'] === 1 ) {
            $p['products_price_formatted'] = $OSCOM_Currencies->format($p['products_price_min']);

            if ( $p['products_price_min'] != $p['products_price_max'] ) {
              $p['products_price_formatted'] .= ' - ' . $OSCOM_Currencies->format($p['products_price_max']);
            }

            $p['products_quantity'] = '(' . $p['products_quantity_variants'] . ')';
          } else {
            $p['products_price_formatted'] = $OSCOM_Currencies->format($p['products_price']);
          }
        }

        $this->_data = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">' .
                       '  <thead>' .
                       '    <tr>' .
                       '      <th>' . OSCOM::getDef('admin_indexmodules_products_table_heading_products') . '</th>' .
                       '      <th>' . OSCOM::getDef('admin_indexmodules_products_table_heading_price') . '</th>' .
                       '      <th>' . OSCOM::getDef('admin_indexmodules_products_table_heading_date') . '</th>' .
                       '      <th>' . OSCOM::getDef('admin_indexmodules_products_table_heading_status') . '</th>' .
                       '    </tr>' .
                       '  </thead>' .
                       '  <tbody>';

/*
        $Qproducts = Registry::get('PDO')->query('select products_id, greatest(products_date_added, products_last_modified) as date_last_modified from :table_products where parent_id is null order by date_last_modified desc limit 6');
        $Qproducts->execute();

        $counter = 0;

        while ( $Qproducts->fetch() ) {
          $data = osC_Products_Admin::get($Qproducts->valueInt('products_id'));

          $products_icon = osc_icon('products.png');
          $products_price = $data['products_price'];

          if ( !empty($data['variants']) ) {
            $products_icon = osc_icon('attach.png');
            $products_price = null;

            foreach ( $data['variants'] as $variant ) {
              if ( ($products_price === null) || ($variant['data']['price'] < $products_price) ) {
                $products_price = $variant['data']['price'];
              }
            }

            if ( $products_price === null ) {
              $products_price = 0;
            }
          }
*/

        $counter = 0;

        foreach ( $result['entries'] as $p ) {
          if ( $p['has_children'] === 1 ) {
            $products_icon = HTML::icon('products.png');
          } else {
            $products_icon = HTML::icon('attach.png');
          }

          $this->_data .= '    <tr onmouseover="$(this).addClass(\'mouseOver\');" onmouseout="$(this).removeClass(\'mouseOver\');"' . ($counter % 2 ? ' class="alt"' : '') . '>' .
                          '      <td>' . HTML::link(OSCOM::getLink(null, 'Products', 'Save&id=' . (int)$p['products_id']), $products_icon . '&nbsp;' . HTML::outputProtected($p['products_name'])) . '</td>' .
                          '      <td>' . $p['products_price_formatted'] . '</td>' .
                          '      <td>' . $p['products_last_modified'] . '</td>' .
                          '      <td align="center">' . HTML::icon(((int)$p['products_status'] === 1) ? 'checkbox_ticked.gif' : 'checkbox_crossed.gif', null, null) . '</td>' .
                          '    </tr>';

          $counter++;
        }

        $this->_data .= '  </tbody>' .
                        '</table>';
      }
    }
示例#17
0
      $.cookie('wkn', $.toJSON(wkn));
    });
  }

  $(document).ready(function() {
    updateShortcutNotifications(typeof resetShortcutNotification != 'undefined' ? '<?php 
    echo OSCOM::getSiteApplication();
    ?>
' : null);

    setInterval('updateShortcutNotifications()', 10000);
  });

  if (window.external.msIsSiteMode()) {

<?php 
    if (Access::hasShortcut()) {
        echo '    window.external.msSiteModeClearJumplist();' . "\n" . '    window.external.msSiteModeCreateJumplist("Shortcuts");' . "\n";
        foreach (Access::getShortcuts() as $shortcut) {
            echo '    window.external.msSiteModeAddJumpListItem("' . $shortcut['title'] . '", "' . OSCOM::getLink(null, $shortcut['module']) . '", "", "self");' . "\n";
        }
        echo '    window.external.msSiteModeShowJumplist();' . "\n";
    }
    ?>

  }
</script>

<?php 
}
示例#18
0
 public static function hasAccess($application) {
   return isset($_SESSION[OSCOM::getSite()]['id']) && Access::hasAccess(OSCOM::getSite(), $application);
 }
示例#19
0
<?php 
if ($OSCOM_Template->hasPageHeader()) {
    include OSCOM::BASE_DIRECTORY . 'Core/Site/' . OSCOM::getSite() . '/templates/oscom/header.php';
}
if (isset($_SESSION[OSCOM::getSite()]['id']) && !in_array(OSCOM::getSiteApplication(), array('Index', 'Login'))) {
    ?>

<div id="appsPane">
  <h4><?php 
    echo Access::getGroupTitle(Access::getGroup(OSCOM::getSiteApplication()));
    ?>
</h4>

<?php 
    foreach (Access::getLevels(Access::getGroup(OSCOM::getSiteApplication())) as $group => $links) {
        echo '<ul>';
        foreach ($links as $link) {
            echo '<li' . ($link['module'] == OSCOM::getSiteApplication() ? ' class="selected"' : '') . '>' . $OSCOM_Template->getIcon(16, $link['icon']) . '&nbsp;<a href="' . OSCOM::getLink(null, $link['module']) . '">' . $link['title'] . '</a></li>';
        }
        echo '</ul>';
    }
    ?>

</div>

<?php 
}
?>

<div id="appContent">