当前位置: 首页>>代码示例>>PHP>>正文


PHP OSCOM::getDef方法代码示例

本文整理汇总了PHP中osCommerce\OM\Core\OSCOM::getDef方法的典型用法代码示例。如果您正苦于以下问题:PHP OSCOM::getDef方法的具体用法?PHP OSCOM::getDef怎么用?PHP OSCOM::getDef使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在osCommerce\OM\Core\OSCOM的用法示例。


在下文中一共展示了OSCOM::getDef方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct()
 {
     $OSCOM_Language = Registry::get('Language');
     $OSCOM_Language->loadIniFile('modules/services/language.php');
     $this->title = OSCOM::getDef('services_language_title');
     $this->description = OSCOM::getDef('services_language_description');
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:7,代码来源:Language.php

示例2: start

 public static function start()
 {
     $OSCOM_Language = Registry::get('Language');
     $OSCOM_MessageStack = Registry::get('MessageStack');
     if (SERVICE_DEBUG_CHECK_LOCALE == '1') {
         $setlocale = setlocale(LC_TIME, explode(',', $OSCOM_Language->getLocale()));
         if ($setlocale === false || $setlocale === null) {
             $OSCOM_MessageStack->add('debug', 'Error: Locale does not exist: ' . $OSCOM_Language->getLocale(), 'error');
         }
     }
     if (SERVICE_DEBUG_CHECK_INSTALLATION_MODULE == '1' && file_exists(OSCOM::BASE_DIRECTORY . 'Core/Site/Setup')) {
         $OSCOM_MessageStack->add('debug', sprintf(OSCOM::getDef('warning_install_directory_exists'), OSCOM::BASE_DIRECTORY . 'Core/Site/Setup'), 'warning');
     }
     if (SERVICE_DEBUG_CHECK_CONFIGURATION == '1' && is_writeable(OSCOM::BASE_DIRECTORY . 'Config/settings.ini')) {
         $OSCOM_MessageStack->add('debug', sprintf(OSCOM::getDef('warning_config_file_writeable'), OSCOM::BASE_DIRECTORY . 'Config//settings.ini'), 'warning');
     }
     if (SERVICE_DEBUG_CHECK_SESSION_DIRECTORY == '1' && OSCOM::getConfig('store_sessions') == '') {
         if (!is_dir(OSCOM_Registry::get('Session')->getSavePath())) {
             $OSCOM_MessageStack->add('debug', sprintf(OSCOM::getDef('warning_session_directory_non_existent'), OSCOM_Registry::get('Session')->getSavePath()), 'warning');
         } elseif (!is_writeable(OSCOM_Registry::get('Session')->getSavePath())) {
             $OSCOM_MessageStack->add('debug', sprintf(OSCOM::getDef('warning_session_directory_not_writeable'), OSCOM_Registry::get('Session')->getSavePath()), 'warning');
         }
     }
     if (SERVICE_DEBUG_CHECK_SESSION_AUTOSTART == '1' && (bool) ini_get('session.auto_start')) {
         $OSCOM_MessageStack->add('debug', OSCOM::getDef('warning_session_auto_start'), 'warning');
     }
     if (SERVICE_DEBUG_CHECK_DOWNLOAD_DIRECTORY == '1' && DOWNLOAD_ENABLED == '1') {
         if (!is_dir(DIR_FS_DOWNLOAD)) {
             $OSCOM_MessageStack->add('debug', sprintf(OSCOM::getDef('warning_download_directory_non_existent'), DIR_FS_DOWNLOAD), 'warning');
         }
     }
     return true;
 }
开发者ID:digitaldevelopers,项目名称:oscommerce,代码行数:33,代码来源:Debug.php

示例3: execute

 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Customer = Registry::get('Customer');
     $OSCOM_NavigationHistory = Registry::get('NavigationHistory');
     $OSCOM_Language = Registry::get('Language');
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     if ($OSCOM_Customer->isLoggedOn() === false) {
         $OSCOM_NavigationHistory->setSnapshot();
         osc_redirect(OSCOM::getLink(null, null, 'LogIn', 'SSL'));
     }
     $application->setPageTitle(OSCOM::getDef('orders_heading'));
     $application->setPageContent('orders.php');
     $OSCOM_Language->load('order');
     if ($OSCOM_Service->isStarted('Breadcrumb')) {
         $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_my_orders'), OSCOM::getLink(null, null, 'Orders', 'SSL'));
         if (is_numeric($_GET['Orders'])) {
             $OSCOM_Breadcrumb->add(sprintf(OSCOM::getDef('breadcrumb_order_information'), $_GET['Orders']), OSCOM::getLink(null, null, 'Orders=' . $_GET['Orders'], 'SSL'));
         }
     }
     if (is_numeric($_GET['Orders'])) {
         if (Order::getCustomerID($_GET['Orders']) !== $OSCOM_Customer->getID()) {
             osc_redirect(OSCOM::getLink(null, null, null, 'SSL'));
         }
         $application->setPageTitle(sprintf(OSCOM::getDef('order_information_heading'), $_GET['Orders']));
         $application->setPageContent('orders_info.php');
     }
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:28,代码来源:Orders.php

示例4: execute

 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     $application->setPageTitle(sprintf(OSCOM::getDef('index_heading'), STORE_NAME));
     $application->setPageContent('product_listing.php');
     if (is_numeric($_GET['Manufacturers'])) {
         Registry::set('Manufacturer', new Manufacturer($_GET['Manufacturers']));
         $OSCOM_Manufacturer = Registry::get('Manufacturer');
         $application->setPageTitle($OSCOM_Manufacturer->getTitle());
         // HPDL        $application->setPageImage('manufacturers/' . $OSCOM_Manufacturer->getImage());
         if ($OSCOM_Service->isStarted('Breadcrumb')) {
             $OSCOM_Breadcrumb->add($OSCOM_Manufacturer->getTitle(), OSCOM::getLink());
         }
         Registry::set('Products', new Products());
         $OSCOM_Products = Registry::get('Products');
         $OSCOM_Products->setManufacturer($OSCOM_Manufacturer->getID());
         if (isset($_GET['filter']) && is_numeric($_GET['filter']) && $_GET['filter'] > 0) {
             $OSCOM_Products->setCategory($_GET['filter']);
         }
         if (isset($_GET['sort']) && !empty($_GET['sort'])) {
             if (strpos($_GET['sort'], '|d') !== false) {
                 $OSCOM_Products->setSortBy(substr($_GET['sort'], 0, -2), '-');
             } else {
                 $OSCOM_Products->setSortBy($_GET['sort']);
             }
         }
     } else {
         osc_redirect(OSCOM::getLink(OSCOM::getDefaultSite(), OSCOM::getDefaultSiteApplication()));
     }
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:31,代码来源:Manufacturers.php

示例5: initialize

 /**
  * Initialize module
  *
  * @access protected
  */
 protected function initialize()
 {
     $this->_title = OSCOM::getDef('payment_cod_title');
     $this->_description = OSCOM::getDef('payment_cod_description');
     $this->_status = defined('MODULE_PAYMENT_COD_STATUS') && MODULE_PAYMENT_COD_STATUS == '1' ? true : false;
     $this->_sort_order = defined('MODULE_PAYMENT_COD_SORT_ORDER') ? MODULE_PAYMENT_COD_SORT_ORDER : 0;
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:12,代码来源:COD.php

示例6: getTaxRateDescription

    public function getTaxRateDescription($class_id, $country_id, $zone_id) {
      $OSCOM_PDO = Registry::get('PDO');

      if ( !isset($this->tax_rates[$class_id][$country_id][$zone_id]['description']) ) {
        $Qtax = $OSCOM_PDO->prepare('select tax_description from :table_tax_rates tr left join :table_zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join :table_geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = 0 or za.zone_country_id = :zone_country_id) and (za.zone_id is null or za.zone_id = 0 or za.zone_id = :zone_id) and tr.tax_class_id = :tax_class_id group by tr.tax_priority');
        $Qtax->bindInt(':zone_country_id', $country_id);
        $Qtax->bindInt(':zone_id', $zone_id);
        $Qtax->bindInt(':tax_class_id', $class_id);
        $Qtax->execute();

        $tax_rates = $Qtax->fetchAll();

        if ( count($tax_rates) > 0 ) {
          $tax_description = '';

          foreach ( $tax_rates as $tr ) {
            $tax_description .= $tr['tax_description'] . ' + ';
          }

          $this->tax_rates[$class_id][$country_id][$zone_id]['description'] = substr($tax_description, 0, -3);
        } else {
          $this->tax_rates[$class_id][$country_id][$zone_id]['description'] = OSCOM::getDef('tax_rate_unknown');
        }
      }

      return $this->tax_rates[$class_id][$country_id][$zone_id]['description'];
    }
开发者ID:haraldpdl,项目名称:oscommerce,代码行数:27,代码来源:Tax.php

示例7: initialize

 protected function initialize()
 {
     $OSCOM_PDO = Registry::get('PDO');
     $OSCOM_ShoppingCart = Registry::get('ShoppingCart');
     $this->_api_version = '60.0';
     $this->_title = OSCOM::getDef('paypal_express_checkout_title');
     $this->_method_title = OSCOM::getDef('paypal_express_checkout_method_title');
     $this->_status = MODULE_PAYMENT_PAYPAL_EXPRESS_CHECKOUT_STATUS == '1' ? true : false;
     $this->_sort_order = MODULE_PAYMENT_PAYPAL_EXPRESS_CHECKOUT_SORT_ORDER;
     if ($this->_status === true) {
         if ((int) MODULE_PAYMENT_PAYPAL_EXPRESS_CHECKOUT_ORDER_STATUS_ID > 0) {
             $this->order_status = MODULE_PAYMENT_PAYPAL_EXPRESS_CHECKOUT_ORDER_STATUS_ID;
         }
         if ((int) MODULE_PAYMENT_PAYPAL_EXPRESS_CHECKOUT_ZONE > 0) {
             $check_flag = false;
             $Qcheck = $OSCOM_PDO->prepare('select zone_id from :table_zones_to_geo_zones where geo_zone_id = :geo_zone_id and zone_country_id = :zone_country_id order by zone_id');
             $Qcheck->bindInt(':geo_zone_id', MODULE_PAYMENT_PAYPAL_EXPRESS_CHECKOUT_ZONE);
             $Qcheck->bindInt(':zone_country_id', $OSCOM_ShoppingCart->getBillingAddress('country_id'));
             $Qcheck->execute();
             while ($Qcheck->fetch()) {
                 if ($Qcheck->valueInt('zone_id') < 1) {
                     $check_flag = true;
                     break;
                 } elseif ($Qcheck->valueInt('zone_id') == $OSCOM_ShoppingCart->getBillingAddress('zone_id')) {
                     $check_flag = true;
                     break;
                 }
             }
             if ($check_flag === false) {
                 $this->_status = false;
             }
         }
     }
 }
开发者ID:digitaldevelopers,项目名称:oscommerce,代码行数:34,代码来源:PayPalExpressCheckout.php

示例8: initialize

 public function initialize()
 {
     $OSCOM_Product = Registry::exists('Product') ? Registry::get('Product') : null;
     $OSCOM_PDO = Registry::get('PDO');
     $OSCOM_Language = Registry::get('Language');
     if (isset($OSCOM_Product) && $OSCOM_Product instanceof \osCommerce\OM\Site\Shop\Product && $OSCOM_Product->isValid()) {
         $Qmanufacturer = $OSCOM_PDO->query('select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url from :table_manufacturers m left join :table_manufacturers_info mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id = :languages_id), :table_products p  where p.products_id = :products_id and p.manufacturers_id = m.manufacturers_id');
         $Qmanufacturer->bindInt(':languages_id', $OSCOM_Language->getID());
         $Qmanufacturer->bindInt(':products_id', $OSCOM_Product->getID());
         $Qmanufacturer->execute();
         $result = $Qmanufacturer->fetch();
         if (!empty($result)) {
             $this->_content = '';
             if (strlen($result['manufacturers_image']) > 0) {
                 $this->_content .= '<div style="text-align: center;">' . HTML::link(OSCOM::getLink(null, 'Index', 'Manufacturers=' . $result['manufacturers_id']), HTML::image('public/manufacturers/' . $result['manufacturers_image'], $result['manufacturers_name'])) . '</div>';
             }
             $this->_content .= '<ol style="list-style: none; margin: 0; padding: 0;">';
             if (strlen($result['manufacturers_url']) > 0) {
                 $this->_content .= '<li>' . HTML::link(OSCOM::getLink(null, 'Redirct', 'Manufacturer=' . $result['manufacturers_id']), sprintf(OSCOM::getDef('box_manufacturer_info_website'), $result['manufacturers_name']), 'target="_blank"') . '</li>';
             }
             $this->_content .= '<li>' . HTML::link(OSCOM::getLink(null, 'Index', 'Manufacturers=' . $result['manufacturers_id']), OSCOM::getDef('box_manufacturer_info_products')) . '</li>';
             $this->_content .= '</ol>';
         }
     }
 }
开发者ID:digitaldevelopers,项目名称:oscommerce,代码行数:25,代码来源:Controller.php

示例9: osc_cfg_set_boolean_value

function osc_cfg_set_boolean_value($select_array, $default, $key = null)
{
    $string = '';
    $select_array = explode(',', substr($select_array, 6, -1));
    $name = !empty($key) ? 'configuration[' . $key . ']' : 'configuration_value';
    for ($i = 0, $n = count($select_array); $i < $n; $i++) {
        $value = trim($select_array[$i]);
        if (strpos($value, '\'') !== false) {
            $value = substr($value, 1, -1);
        } else {
            $value = (int) $value;
        }
        $select_array[$i] = $value;
        if ($value === -1) {
            $value = OSCOM::getDef('parameter_false');
        } elseif ($value === 0) {
            $value = OSCOM::getDef('parameter_optional');
        } elseif ($value === 1) {
            $value = OSCOM::getDef('parameter_true');
        }
        $string .= '<input type="radio" name="' . $name . '" value="' . $select_array[$i] . '"';
        if ($default == $select_array[$i]) {
            $string .= ' checked="checked"';
        }
        $string .= '> ' . $value . '<br />';
    }
    if (!empty($string)) {
        $string = substr($string, 0, -6);
    }
    return $string;
}
开发者ID:digitaldevelopers,项目名称:oscommerce,代码行数:31,代码来源:osc_cfg_set_boolean_value.php

示例10: __construct

    public function __construct() {
      $OSCOM_Language = Registry::get('Language');

      $OSCOM_Language->loadIniFile('modules/ProductAttribute/' . $this->getCode() . '.php');

      $this->_title = OSCOM::getDef('product_attribute_' . $this->getCode() . '_title');
    }
开发者ID:haraldpdl,项目名称:oscommerce,代码行数:7,代码来源:ProductAttributeModuleAbstract.php

示例11: execute

 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Database = Registry::get('Database');
     $OSCOM_Customer = Registry::get('Customer');
     $OSCOM_MessageStack = Registry::get('MessageStack');
     if (isset($_POST['newsletter_general']) && is_numeric($_POST['newsletter_general'])) {
         $newsletter_general = (int) $_POST['newsletter_general'];
     } else {
         $newsletter_general = 0;
     }
     // HPDL Should be moved to the customers class!
     $Qnewsletter = $OSCOM_Database->query('select customers_newsletter from :table_customers where customers_id = :customers_id');
     $Qnewsletter->bindInt(':customers_id', $OSCOM_Customer->getID());
     $Qnewsletter->execute();
     if ($newsletter_general !== $Qnewsletter->valueInt('customers_newsletter')) {
         $newsletter_general = $Qnewsletter->value('customers_newsletter') == '1' ? '0' : '1';
         $Qupdate = $OSCOM_Database->query('update :table_customers set customers_newsletter = :customers_newsletter where customers_id = :customers_id');
         $Qupdate->bindInt(':customers_newsletter', $newsletter_general);
         $Qupdate->bindInt(':customers_id', $OSCOM_Customer->getID());
         $Qupdate->execute();
         if ($Qupdate->affectedRows() === 1) {
             $OSCOM_MessageStack->add('Account', OSCOM::getDef('success_newsletter_updated'), 'success');
         }
     }
     osc_redirect(OSCOM::getLink(null, null, null, 'SSL'));
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:26,代码来源:Process.php

示例12: execute

 public static function execute($country, $form, $field)
 {
     $OSCOM_PDO = Registry::get('PDO');
     $num_country = 1;
     $output_string = '';
     $Qcountries = $OSCOM_PDO->query('select distinct zone_country_id from :table_zones order by zone_country_id');
     $Qcountries->execute();
     while ($Qcountries->fetch()) {
         if ($num_country == 1) {
             $output_string .= '  if (' . $country . ' == "' . $Qcountries->valueInt('zone_country_id') . '") {' . "\n";
         } else {
             $output_string .= '  } else if (' . $country . ' == "' . $Qcountries->valueInt('zone_country_id') . '") {' . "\n";
         }
         $num_state = 1;
         $Qzones = $OSCOM_PDO->prepare('select zone_name, zone_id from :table_zones where zone_country_id = :zone_country_id order by zone_name');
         $Qzones->bindInt(':zone_country_id', $Qcountries->valueInt('zone_country_id'));
         $Qzones->execute();
         while ($Qzones->fetch()) {
             if ($num_state == '1') {
                 $output_string .= '    ' . $form . '.' . $field . '.options[0] = new Option("' . OSCOM::getDef('all_zones') . '", "");' . "\n";
             }
             $output_string .= '    ' . $form . '.' . $field . '.options[' . $num_state . '] = new Option("' . $Qzones->value('zone_name') . '", "' . $Qzones->valueInt('zone_id') . '");' . "\n";
             $num_state++;
         }
         $num_country++;
     }
     $output_string .= '  } else {' . "\n" . '    ' . $form . '.' . $field . '.options[0] = new Option("' . OSCOM::getDef('all_zones') . '", "");' . "\n" . '  }' . "\n";
     return $output_string;
 }
开发者ID:digitaldevelopers,项目名称:oscommerce,代码行数:29,代码来源:getJSList.php

示例13: __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 . '&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>';
     }
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:28,代码来源:Customers.php

示例14: execute

 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_PDO = Registry::get('PDO');
     $OSCOM_MessageStack = Registry::get('MessageStack');
     $Qcheck = $OSCOM_PDO->prepare('select customers_id, customers_firstname, customers_lastname, customers_gender, customers_email_address, customers_password from :table_customers where customers_email_address = :customers_email_address limit 1');
     $Qcheck->bindValue(':customers_email_address', $_POST['email_address']);
     $Qcheck->execute();
     if ($Qcheck->fetch() !== false) {
         $password = Hash::getRandomString(ACCOUNT_PASSWORD);
         if (Account::savePassword($password, $Qcheck->valueInt('customers_id'))) {
             if (ACCOUNT_GENDER > -1) {
                 if ($Qcheck->value('customers_gender') == 'm') {
                     $email_text = sprintf(OSCOM::getDef('email_addressing_gender_male'), $Qcheck->valueProtected('customers_lastname')) . "\n\n";
                 } else {
                     $email_text = sprintf(OSCOM::getDef('email_addressing_gender_female'), $Qcheck->valueProtected('customers_lastname')) . "\n\n";
                 }
             } else {
                 $email_text = sprintf(OSCOM::getDef('email_addressing_gender_unknown'), $Qcheck->valueProtected('customers_firstname') . ' ' . $Qcheck->valueProtected('customers_lastname')) . "\n\n";
             }
             $email_text .= sprintf(OSCOM::getDef('email_password_reminder_body'), OSCOM::getIPAddress(), STORE_NAME, $password, STORE_OWNER_EMAIL_ADDRESS);
             $pEmail = new Mail($Qcheck->valueProtected('customers_firstname') . ' ' . $Qcheck->valueProtected('customers_lastname'), $Qcheck->valueProtected('customers_email_address'), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, sprintf(OSCOM::getDef('email_password_reminder_subject'), STORE_NAME));
             $pEmail->setBodyPlain($email_text);
             $pEmail->send();
             $OSCOM_MessageStack->add('LogIn', OSCOM::getDef('success_password_forgotten_sent'), 'success');
         }
         OSCOM::redirect(OSCOM::getLink(null, null, 'LogIn', 'SSL'));
     } else {
         $OSCOM_MessageStack->add('PasswordForgotten', OSCOM::getDef('error_password_forgotten_no_email_address_found'));
     }
 }
开发者ID:digitaldevelopers,项目名称:oscommerce,代码行数:30,代码来源:Process.php

示例15: initialize

 public function initialize()
 {
     $OSCOM_Product = Registry::exists('Product') ? Registry::get('Product') : null;
     $OSCOM_Customer = Registry::get('Customer');
     $OSCOM_Database = Registry::get('Database');
     $OSCOM_Language = Registry::get('Language');
     $this->_title_link = OSCOM::getLink(null, 'Account', 'Notifications', 'SSL');
     if (isset($OSCOM_Product) && $OSCOM_Product instanceof \osCommerce\OM\Site\Shop\Product && $OSCOM_Product->isValid()) {
         if ($OSCOM_Customer->isLoggedOn()) {
             $Qcheck = $OSCOM_Database->query('select global_product_notifications from :table_customers where customers_id = :customers_id');
             $Qcheck->bindInt(':customers_id', $OSCOM_Customer->getID());
             $Qcheck->execute();
             if ($Qcheck->valueInt('global_product_notifications') === 0) {
                 $Qcheck = $OSCOM_Database->query('select products_id from :table_products_notifications where products_id = :products_id and customers_id = :customers_id limit 1');
                 $Qcheck->bindInt(':products_id', $OSCOM_Product->getID());
                 $Qcheck->bindInt(':customers_id', $OSCOM_Customer->getID());
                 $Qcheck->execute();
                 if ($Qcheck->numberOfRows() > 0) {
                     $this->_content = '<div style="float: left; width: 55px;">' . osc_link_object(OSCOM::getLink(null, null, osc_get_all_get_params(array('action')) . '&action=notify_remove', 'AUTO'), osc_image(DIR_WS_IMAGES . 'box_products_notifications_remove.gif', sprintf(OSCOM::getDef('box_product_notifications_remove'), $OSCOM_Product->getTitle()))) . '</div>' . osc_link_object(OSCOM::getLink(null, null, osc_get_all_get_params(array('action')) . '&action=notify_remove', 'AUTO'), sprintf(OSCOM::getDef('box_product_notifications_remove'), $OSCOM_Product->getTitle()));
                 } else {
                     $this->_content = '<div style="float: left; width: 55px;">' . osc_link_object(OSCOM::getLink(null, null, osc_get_all_get_params(array('action')) . '&action=notify_add', 'AUTO'), osc_image(DIR_WS_IMAGES . 'box_products_notifications.gif', sprintf(OSCOM::getDef('box_product_notifications_add'), $OSCOM_Product->getTitle()))) . '</div>' . osc_link_object(OSCOM::getLink(null, null, osc_get_all_get_params(array('action')) . '&action=notify_add', 'AUTO'), sprintf(OSCOM::getDef('box_product_notifications_add'), $OSCOM_Product->getTitle()));
                 }
                 $this->_content .= '<div style="clear: both;"></div>';
             }
         }
     }
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:27,代码来源:Controller.php


注:本文中的osCommerce\OM\Core\OSCOM::getDef方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。