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


PHP Paging::get方法代码示例

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


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

示例1: view_product_overview

 /**
  * Set up the shop page with products and discounts
  *
  * @param   array       $product_ids    The optional array of Product IDs.
  *                                      Overrides any URL parameters if set
  * @return  boolean                     True on success, false otherwise
  * @global  ADONewConnection  $objDatabase    Database connection object
  * @global  array       $_ARRAYLANG     Language array
  * @global  array       $_CONFIG        Core configuration array, see {@link /config/settings.php}
  * @global  string(?)   $themesPages    Themes pages(?)
  */
 static function view_product_overview($product_ids = null)
 {
     global $_ARRAYLANG;
     // activate javascript shadowbox
     \JS::activate('shadowbox');
     $flagSpecialoffer = intval(\Cx\Core\Setting\Controller\Setting::getValue('show_products_default', 'Shop'));
     if (isset($_REQUEST['cmd']) && $_REQUEST['cmd'] == 'discounts') {
         $flagSpecialoffer = Products::DEFAULT_VIEW_DISCOUNTS;
     }
     $flagLastFive = isset($_REQUEST['lastFive']);
     $product_id = isset($_REQUEST['productId']) ? intval($_REQUEST['productId']) : null;
     $cart_id = null;
     if (isset($_REQUEST['referer']) && $_REQUEST['referer'] == 'cart') {
         $cart_id = $product_id;
         $product_id = Cart::get_product_id($cart_id);
     }
     $manufacturer_id = isset($_REQUEST['manufacturerId']) ? intval($_REQUEST['manufacturerId']) : null;
     $term = isset($_REQUEST['term']) ? trim(contrexx_input2raw($_REQUEST['term'])) : null;
     $category_id = isset($_REQUEST['catId']) ? intval($_REQUEST['catId']) : null;
     if (!($product_id || $category_id || $manufacturer_id || $term || $cart_id)) {
         // NOTE: This is different from NULL
         // in that it enables listing the subcategories
         $category_id = 0;
     }
     // Validate parameters
     if ($product_id && empty($category_id)) {
         $objProduct = Product::getById($product_id);
         if ($objProduct) {
             $category_id = $objProduct->category_id();
         }
         if (isset($_SESSION['shop']['previous_category_id'])) {
             $category_id_previous = $_SESSION['shop']['previous_category_id'];
             foreach (preg_split('/\\s*,\\s*/', $category_id) as $id) {
                 if ($category_id_previous == intval($id)) {
                     $category_id = $category_id_previous;
                 }
             }
         }
     }
     // Remember visited Products
     if ($product_id) {
         self::rememberVisitedProducts($product_id);
     }
     $objCategory = null;
     if ($category_id && empty($product_id)) {
         $objCategory = ShopCategory::getById($category_id);
         if (!$objCategory) {
             $category_id = null;
         }
     }
     $shopMenu = '<form method="post" action="' . \Cx\Core\Routing\Url::fromModuleAndCmd('Shop', '') . '">' . '<input type="text" name="term" value="' . htmlentities($term, ENT_QUOTES, CONTREXX_CHARSET) . '" style="width:150px;" />&nbsp;' . '<select name="catId" style="width:150px;">' . '<option value="0">' . $_ARRAYLANG['TXT_ALL_PRODUCT_GROUPS'] . '</option>' . ShopCategories::getMenuoptions($category_id) . '</select>&nbsp;' . Manufacturer::getMenu('manufacturerId', $manufacturer_id, true) . '<input type="submit" name="bsubmit" value="' . $_ARRAYLANG['TXT_SEARCH'] . '" style="width:66px;" />' . '</form>';
     self::$objTemplate->setGlobalVariable($_ARRAYLANG + array('SHOP_MENU' => $shopMenu, 'SHOP_SEARCH_TERM' => htmlentities($term, ENT_QUOTES, CONTREXX_CHARSET), 'SHOP_CATEGORIES_MENUOPTIONS' => ShopCategories::getMenuoptions($category_id, true, 0, true), 'SHOP_MANUFACTURER_MENUOPTIONS' => Manufacturer::getMenuoptions($manufacturer_id, true)));
     // Only show the cart info when the JS cart is not active!
     global $_CONFIGURATION;
     if (empty($_CONFIGURATION['custom']['shopJsCart'])) {
         self::$objTemplate->setVariable(array('SHOP_CART_INFO' => self::cart_info()));
     }
     // Exclude Category list from search results
     if ($term == '') {
         self::showCategories($category_id);
     }
     if (self::$objTemplate->blockExists('shopNextCategoryLink')) {
         $nextCat = ShopCategory::getNextShopCategoryId($category_id);
         $objCategory = ShopCategory::getById($nextCat);
         if ($objCategory) {
             self::$objTemplate->setVariable(array('SHOP_NEXT_CATEGORY_ID' => $nextCat, 'SHOP_NEXT_CATEGORY_TITLE' => str_replace('"', '&quot;', $objCategory->name())));
         }
     }
     $pagingCmd = !empty($_REQUEST['cmd']) ? '&amp;cmd=' . contrexx_input2raw($_REQUEST['cmd']) : '';
     $pagingCatId = '';
     $pagingManId = '';
     $pagingTerm = '';
     // TODO: This probably breaks paging in search results!
     // Should only reset the flag conditionally, but add the URL parameters in
     // any case, methinks!
     if ($category_id > 0 && $term == '') {
         $flagSpecialoffer = false;
         $pagingCatId = "&amp;catId={$category_id}";
     }
     if ($manufacturer_id > 0) {
         $flagSpecialoffer = false;
         $pagingManId = "&amp;manufacturer_id={$manufacturer_id}";
     }
     if ($term != '') {
         $flagSpecialoffer = false;
         $pagingTerm = '&amp;term=' . htmlentities($term, ENT_QUOTES, CONTREXX_CHARSET);
     }
     // The Product count is passed by reference and set to the total
     // number of records, though only as many as specified by the core
//.........这里部分代码省略.........
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:101,代码来源:Shop.class.php

示例2: applyPaging

 public function applyPaging($obj = "", $url_index = false, $link = "?", $gets = "", $name = "items")
 {
     if (!isset($obj->PAGING_TOTAL) || !isset($obj->PAGING)) {
         Error::show(0, "Query:: Há um erro na classe, não será possivel renderizar a paginação corretamente.");
     }
     $html = "";
     if (!$url_index) {
         $html .= "{$link}{$obj->SETTINGS['PAGING_REF']}index=[index]?";
     } else {
         $html .= "{$link}/[index]?";
     }
     if (isset($_GET[$obj->SETTINGS['PAGING_REF'] . 'ordem'])) {
         $html .= "&{$obj->SETTINGS['PAGING_REF']}ordem=" . $obj->DATA_INT[$obj->SETTINGS['PAGING_REF'] . 'ordem'];
     }
     if (isset($_GET[$obj->SETTINGS['PAGING_REF'] . 'modo'])) {
         $html .= "&{$obj->SETTINGS['PAGING_REF']}modo=" . $obj->DATA_INT[$obj->SETTINGS['PAGING_REF'] . 'modo'];
     }
     if (isset($_GET[$obj->SETTINGS['PAGING_REF'] . 'num'])) {
         $html .= "&{$obj->SETTINGS['PAGING_REF']}num=" . $obj->DATA_INT[$obj->SETTINGS['PAGING_REF'] . 'num'];
     }
     if (isset($_GET[$obj->SETTINGS['PAGING_REF'] . 'busca'])) {
         $html .= "&{$obj->SETTINGS['PAGING_REF']}busca=" . $obj->DATA_INT[$obj->SETTINGS['PAGING_REF'] . 'busca'];
     }
     if (isset($_GET[$obj->SETTINGS['PAGING_REF'] . 'fk_template_busca'])) {
         $html .= "&{$obj->SETTINGS['PAGING_REF']}fk_template_busca=" . $obj->DATA_INT[$obj->SETTINGS['PAGING_REF'] . 'fk_template_busca'];
     }
     echo Paging::get($obj->PAGING, $html, $name);
 }
开发者ID:obscurun,项目名称:run-dev,代码行数:28,代码来源:render.php

示例3: showCrawlerResult

 /**
  * Show the last run's crawler result
  * 
  * @global array $_ARRAYLANG 
  */
 public function showCrawlerResult()
 {
     global $_ARRAYLANG;
     \JS::activate('cx');
     $objCx = \ContrexxJavascript::getInstance();
     $objCx->setVariable(array('updateSuccessMsg' => $_ARRAYLANG['TXT_CORE_MODULE_LINKMANAGER_UPDATE_SUCCESS_MSG'], 'loadingLabel' => $_ARRAYLANG['TXT_CORE_MODULE_LINKMANAGER_LABEL_LOADING']), 'LinkManager');
     if (isset($_POST['checkAgain'])) {
         $this->recheckSelectedLinks();
     }
     //show crawler results
     //get parameters
     $pos = isset($_GET['pos']) ? $_GET['pos'] : 0;
     //set the settings value from DB
     \Cx\Core\Setting\Controller\Setting::init('LinkManager', 'config');
     $pageLimit = \Cx\Core\Setting\Controller\Setting::getValue('entriesPerPage', 'LinkManager');
     $parameter = './index.php?cmd=' . $this->moduleName . '&act=crawlerResult';
     $this->template->setVariable('ENTRIES_PAGING', \Paging::get($parameter, $_ARRAYLANG['TXT_CORE_MODULE_LINKMANAGER_LINKS'], $this->linkRepository->brokenLinkCount(), $pageLimit, true, $pos, 'pos'));
     $brokenLinks = $this->linkRepository->getBrokenLinks($pos, $pageLimit);
     $i = 1;
     $objUser = new \Cx\Core_Modules\LinkManager\Controller\User();
     if ($brokenLinks && $brokenLinks->count() > 0) {
         foreach ($brokenLinks as $brokenLink) {
             $this->template->setVariable(array($this->moduleNameLang . '_BROKEN_LINK_ID' => contrexx_raw2xhtml($brokenLink->getId()), $this->moduleNameLang . '_BROKEN_LINK_IMAGE' => $brokenLink->getBrokenLinkText() == $_ARRAYLANG['TXT_CORE_MODULE_LINKMANAGER_NO_IMAGE'] ? 'brokenImage' : 'brokenLinkImage', $this->moduleNameLang . '_BROKEN_LINK_TEXT' => $brokenLink->getBrokenLinkText(), $this->moduleNameLang . '_BROKEN_LINK_URL' => contrexx_raw2xhtml($brokenLink->getRequestedPath()), $this->moduleNameLang . '_BROKEN_LINK_REFERER' => contrexx_raw2xhtml($brokenLink->getLeadPath()) . '&pos=' . $pos . '&csrf=' . \Cx\Core\Csrf\Controller\Csrf::code(), $this->moduleNameLang . '_BROKEN_LINK_MODULE_NAME' => contrexx_raw2xhtml($brokenLink->getModuleName()), $this->moduleNameLang . '_BROKEN_LINK_ENTRY_TITLE' => contrexx_raw2xhtml($brokenLink->getEntryTitle()), $this->moduleNameLang . '_BROKEN_LINK_STATUS_CODE' => $brokenLink->getLinkStatusCode() == 0 ? $_ARRAYLANG['TXT_CORE_MODULE_LINKMANAGER_NON_EXISTING_DOMAIN'] : contrexx_raw2xhtml($brokenLink->getLinkStatusCode()), $this->moduleNameLang . '_BROKEN_LINK_STATUS' => $brokenLink->getLinkStatus() ? $brokenLink->getLinkStatus() : 0, $this->moduleNameLang . '_BROKEN_LINK_STATUS_CHECKED' => $brokenLink->getLinkStatus() ? 'checked' : '', $this->moduleNameLang . '_BROKEN_LINK_DETECTED' => \Cx\Core_Modules\LinkManager\Controller\DateTime::formattedDateAndTime($brokenLink->getDetectedTime()), $this->moduleNameLang . '_BROKEN_LINK_UPDATED_BY' => $brokenLink->getUpdatedBy() ? contrexx_raw2xhtml($objUser->getUpdatedUserName($brokenLink->getUpdatedBy(), 0)) : '', $this->moduleNameLang . '_CRAWLER_BROKEN_LINK' => $brokenLink->getLinkRecheck() && $brokenLink->getLinkStatus() ? 'brokenLink' : '', $this->moduleNameLang . '_CRAWLER_RUN_ROW' => 'row' . (++$i % 2 + 1)));
             $this->template->parse($this->moduleName . 'CrawlerResultList');
         }
         $this->template->hideBlock('LinkManagerNoCrawlerResultFound');
     } else {
         $this->template->touchBlock('LinkManagerNoCrawlerResultFound');
     }
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:35,代码来源:CrawlerResultController.class.php

示例4: getSearchResults

 /**
  * Gets the search results.
  * 
  * @return  mixed  Parsed content.
  */
 public function getSearchResults()
 {
     global $_ARRAYLANG;
     $this->template->addBlockfile('ADMIN_CONTENT', 'search', 'Default.html');
     if (!empty($this->term)) {
         $pages = $this->getSearchedPages();
         $countPages = $this->countSearchedPages();
         usort($pages, array($this, 'sortPages'));
         if ($countPages > 0) {
             $parameter = '&cmd=Search' . (empty($this->term) ? '' : '&term=' . contrexx_raw2encodedUrl($this->term));
             $paging = \Paging::get($parameter, '', $countPages, 0, true, null, 'pos');
             $this->template->setVariable(array('TXT_SEARCH_RESULTS_COMMENT' => sprintf($_ARRAYLANG['TXT_SEARCH_RESULTS_COMMENT'], $this->term, $countPages), 'TXT_SEARCH_TITLE' => $_ARRAYLANG['TXT_NAVIGATION_TITLE'], 'TXT_SEARCH_CONTENT_TITLE' => $_ARRAYLANG['TXT_PAGETITLE'], 'TXT_SEARCH_SLUG' => $_ARRAYLANG['TXT_CORE_CM_SLUG'], 'TXT_SEARCH_LANG' => $_ARRAYLANG['TXT_LANGUAGE'], 'SEARCH_PAGING' => $paging));
             foreach ($pages as $page) {
                 // used for alias pages, because they have no language
                 if ($page->getLang() == "") {
                     $languages = "";
                     foreach (\FWLanguage::getIdArray('frontend') as $langId) {
                         $languages[] = \FWLanguage::getLanguageCodeById($langId);
                     }
                 } else {
                     $languages = array(\FWLanguage::getLanguageCodeById($page->getLang()));
                 }
                 $aliasLanguages = implode(', ', $languages);
                 $originalPage = $page;
                 $link = 'index.php?cmd=ContentManager&amp;page=' . $page->getId();
                 if ($page->getType() == \Cx\Core\ContentManager\Model\Entity\Page::TYPE_ALIAS) {
                     $pageRepo = \Env::get('em')->getRepository('Cx\\Core\\ContentManager\\Model\\Entity\\Page');
                     if ($originalPage->isTargetInternal()) {
                         // is internal target, get target page
                         $originalPage = $pageRepo->getTargetPage($page);
                     } else {
                         // is an external target, set the link to the external targets url
                         $originalPage = new \Cx\Core\ContentManager\Model\Entity\Page();
                         $originalPage->setTitle($page->getTarget());
                         $link = $page->getTarget();
                     }
                 }
                 $this->template->setVariable(array('SEARCH_RESULT_BACKEND_LINK' => $link, 'SEARCH_RESULT_TITLE' => $originalPage->getTitle(), 'SEARCH_RESULT_CONTENT_TITLE' => $originalPage->getContentTitle(), 'SEARCH_RESULT_SLUG' => substr($page->getPath(), 1), 'SEARCH_RESULT_LANG' => $aliasLanguages, 'SEARCH_RESULT_FRONTEND_LINK' => \Cx\Core\Routing\Url::fromPage($page)));
                 $this->template->parse('search_result_row');
             }
         } else {
             $this->template->setVariable(array('TXT_SEARCH_NO_RESULTS' => sprintf($_ARRAYLANG['TXT_SEARCH_NO_RESULTS'], $this->term)));
         }
     } else {
         $this->template->setVariable(array('TXT_SEARCH_NO_TERM' => $_ARRAYLANG['TXT_SEARCH_NO_TERM']));
     }
 }
开发者ID:Niggu,项目名称:cloudrexx,代码行数:52,代码来源:SearchManager.class.php

示例5: view_list

 /**
  * Sets up the Order list view
  *
  * Sets the $objTemplate parameter to the default backend template,
  * if empty.
  * @param   \Cx\Core\Html\Sigma $objTemplate    The Template, by reference
  * @param   array       $filter                 The optional filter
  * @return  boolean                             True on success,
  *                                              false otherwise
  */
 static function view_list(&$objTemplate = null, $filter = NULL)
 {
     global $_ARRAYLANG, $objInit;
     $backend = $objInit->mode == 'backend';
     if (!$objTemplate) {
         $objTemplate = new \Cx\Core\Html\Sigma(\Cx\Core\Core\Controller\Cx::instanciate()->getCodeBaseModulePath() . '/Shop/View/Template/Backend');
         //DBG::log("Orders::view_list(): new Template: ".$objTemplate->get());
         $objTemplate->loadTemplateFile('module_shop_orders.html');
         //DBG::log("Orders::view_list(): loaded Template: ".$objTemplate->get());
     }
     $uri = $backend ? \Html::getRelativeUri_entities() : \Cx\Core\Routing\Url::fromModuleAndCmd('Shop', 'history', NULL);
     //DBG::log("Orders::view_list(): URI: $uri");
     // TODO: Better use a redirect after doing stuff!
     \Html::stripUriParam($uri, 'act');
     \Html::stripUriParam($uri, 'searchterm');
     \Html::stripUriParam($uri, 'listletter');
     \Html::stripUriParam($uri, 'customer_type');
     \Html::stripUriParam($uri, 'status');
     \Html::stripUriParam($uri, 'show_pending_orders');
     \Html::stripUriParam($uri, 'order_id');
     \Html::stripUriParam($uri, 'changeOrderStatus');
     \Html::stripUriParam($uri, 'sendMail');
     if (!is_array($filter)) {
         $filter = array();
     }
     if (!empty($_REQUEST['searchterm'])) {
         $filter['term'] = trim(strip_tags(contrexx_input2raw($_REQUEST['searchterm'])));
         \Html::replaceUriParameter($uri, 'searchterm=' . $filter['term']);
     } elseif (!empty($_REQUEST['listletter'])) {
         $filter['letter'] = trim(strip_tags(contrexx_input2raw($_REQUEST['listletter'])));
         \Html::replaceUriParameter($uri, 'listletter=' . $filter['letter']);
     }
     $customer_type = $usergroup_id = null;
     // Ignore
     if (isset($_REQUEST['customer_type']) && $_REQUEST['customer_type'] !== '') {
         $customer_type = intval($_REQUEST['customer_type']);
         \Html::replaceUriParameter($uri, 'customer_type=' . $customer_type);
         if ($customer_type == 0) {
             $usergroup_id = \Cx\Core\Setting\Controller\Setting::getValue('usergroup_id_customer', 'Shop');
         }
         if ($customer_type == 1) {
             $usergroup_id = \Cx\Core\Setting\Controller\Setting::getValue('usergroup_id_reseller', 'Shop');
         }
         $objFWUser = \FWUser::getFWUserObject();
         $objGroup = $objFWUser->objGroup->getGroup($usergroup_id);
         if ($objGroup) {
             $filter['customer_id'] = $objGroup->getAssociatedUserIds();
             // No customers of that type, so suppress all results
             if (empty($filter['customer_id'])) {
                 $filter['customer_id'] = array(0);
             }
             //DBG::log("Orders::view_list(): Group ID $usergroup_id, Customers: ".var_export($filter['customer_id'], true));
         }
     }
     $status = null;
     // Ignore
     $arrStatus = null;
     if (isset($_REQUEST['status']) && $_REQUEST['status'] !== '') {
         $status = intval($_REQUEST['status']);
         if ($status >= Order::STATUS_PENDING && $status < Order::STATUS_MAX) {
             $arrStatus = array($status => true);
             \Html::replaceUriParameter($uri, 'status=' . $status);
             if ($status == Order::STATUS_PENDING) {
                 $_REQUEST['show_pending_orders'] = true;
             }
         }
     }
     // Let the user choose whether to see pending orders, too
     $show_pending_orders = false;
     if ($backend) {
         if (empty($_REQUEST['show_pending_orders'])) {
             if (empty($arrStatus)) {
                 $arrStatus = self::getStatusArray();
                 unset($arrStatus[Order::STATUS_PENDING]);
             }
         } else {
             if ($arrStatus) {
                 $arrStatus[Order::STATUS_PENDING] = true;
             }
             $show_pending_orders = true;
             \Html::replaceUriParameter($uri, 'show_pending_orders=1');
         }
     }
     if ($arrStatus) {
         $filter['status'] = array_keys($arrStatus);
     }
     //DBG::log("Orders::view_list(): URI for Sorting: $uri, decoded ".html_entity_decode($uri));
     $arrSorting = array('id' => $_ARRAYLANG['TXT_SHOP_ID'], 'date_time' => $_ARRAYLANG['TXT_SHOP_ORDER_DATE'], 'customer_name' => $_ARRAYLANG['TXT_SHOP_CUSTOMER'], 'sum' => $_ARRAYLANG['TXT_SHOP_ORDER_SUM'], 'status' => $_ARRAYLANG['TXT_SHOP_ORDER_STATUS']);
     $objSorting = new \Sorting($uri, $arrSorting, false, 'order_shop_orders');
     $uri_search = $uri;
//.........这里部分代码省略.........
开发者ID:Niggu,项目名称:cloudrexx,代码行数:101,代码来源:Orders.class.php

示例6: edit

 /**
  * Edit coupons
  * @param   \Cx\Core\Html\Sigma   $objTemplate    The Template
  */
 static function edit($objTemplate)
 {
     global $_ARRAYLANG;
     //DBG::activate(DBG_ADODB|DBG_LOG_FIREPHP|DBG_PHP);
     $result = true;
     if (isset($_GET['delete'])) {
         list($code, $customer_id) = explode('-', $_GET['delete']);
         $result &= self::delete(contrexx_input2raw($code), intval($customer_id));
     }
     $edit = isset($_REQUEST['edit']) ? contrexx_input2raw($_REQUEST['edit']) : null;
     //DBG::log("Edit: ".($edit ? $edit : 'NULL'));
     $code = isset($_POST['code']) ? contrexx_input2raw($_POST['code']) : null;
     $payment_id = empty($_POST['payment_id']) ? 0 : intval($_POST['payment_id']);
     $start_time = empty($_POST['start_date']) ? 0 : strtotime(contrexx_input2raw($_POST['start_date']));
     $end_time = empty($_POST['end_date_unlimited']) ? empty($_POST['end_date']) ? 0 : strtotime(contrexx_input2raw($_POST['end_date'])) : 0;
     $coupon_type = empty($_POST['coupon_type']) ? null : contrexx_input2raw($_POST['coupon_type']);
     $discount_rate = intval(empty($_POST['discount_rate']) ? 0 : floatval($_POST['discount_rate']));
     $discount_amount = Currency::formatPrice(empty($_POST['discount_amount']) ? 0 : floatval($_POST['discount_amount']));
     if ($coupon_type == 'rate') {
         $discount_amount = 0;
     }
     if ($coupon_type == 'amount') {
         $discount_rate = 0;
     }
     $minimum_amount = Currency::formatPrice(empty($_POST['minimum_amount']) ? 0 : floatval($_POST['minimum_amount']));
     $uses = empty($_POST['unlimited']) ? empty($_POST['uses']) ? 1 : intval($_POST['uses']) : self::USES_UNLIMITED;
     $customer_id = empty($_POST['customer_id']) ? 0 : intval($_POST['customer_id']);
     $product_id = empty($_POST['product_id']) ? 0 : intval($_POST['product_id']);
     $global = !empty($_POST['global_or_customer']);
     //DBG::log("code $code, start_time $start_time, end_time $end_time, minimum amount $minimum_amount, discount_rate $discount_rate, discount_amount $discount_amount, uses $uses, customer_id $customer_id");
     if (isset($code)) {
         $result &= self::storeCode($code, $payment_id, $minimum_amount, $discount_rate, $discount_amount, $start_time, $end_time, $uses, $global, $customer_id, $product_id, $edit);
         if ($result) {
             $code = $edit = null;
         } else {
             if (empty($edit)) {
                 $edit = "{$code}-{$customer_id}";
             }
         }
     }
     // Reset the end time if it's in the past
     if ($end_time < time()) {
         $end_time = 0;
     }
     $uri = \Html::getRelativeUri();
     \Html::stripUriParam($uri, 'view');
     \Html::stripUriParam($uri, 'edit');
     \Html::stripUriParam($uri, 'order_coupon');
     $arrSortingFields = array('code' => $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_CODE'], 'start_time' => $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_START_TIME'], 'end_time' => $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_END_TIME'], 'minimum_amount' => sprintf($_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_MINIMUM_AMOUNT_FORMAT'], Currency::getDefaultCurrencyCode()), 'discount_rate' => $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_RATE'], 'discount_amount' => sprintf($_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_AMOUNT_FORMAT'], Currency::getDefaultCurrencyCode()), 'uses' => $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_USES'], 'global' => $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_SCOPE'], 'customer_id' => $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_CUSTOMER'], 'product_id' => $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_PRODUCT'], 'payment_id' => $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_PAYMENT']);
     $objSorting = new \Sorting($uri, $arrSortingFields, true, 'order_coupon');
     $objTemplate->setGlobalVariable($_ARRAYLANG + array('TXT_SHOP_DISCOUNT_COUPON_MINIMUM_AMOUNT_CURRENCY' => sprintf($_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_MINIMUM_AMOUNT_FORMAT'], Currency::getDefaultCurrencyCode()), 'TXT_SHOP_DISCOUNT_COUPON_AMOUNT_CURRENCY' => sprintf($_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_AMOUNT_FORMAT'], Currency::getDefaultCurrencyCode()), 'TXT_SHOP_DISCOUNT_COUPON_ADD_OR_EDIT' => $_ARRAYLANG[$edit ? 'TXT_SHOP_DISCOUNT_COUPON_EDIT' : 'TXT_SHOP_DISCOUNT_COUPON_ADD'], 'SHOP_DISCOUNT_COUPON_VIEW_ACTIVE' => $edit ? '' : 'active', 'SHOP_DISCOUNT_COUPON_EDIT_ACTIVE' => $edit ? 'active' : '', 'SHOP_DISCOUNT_COUPON_VIEW_DISPLAY' => $edit ? 'none' : 'block', 'SHOP_DISCOUNT_COUPON_EDIT_DISPLAY' => $edit ? 'block' : 'none', 'HEADER_SHOP_DISCOUNT_COUPON_CODE' => $objSorting->getHeaderForField('code'), 'HEADER_SHOP_DISCOUNT_COUPON_START_TIME' => $objSorting->getHeaderForField('start_time'), 'HEADER_SHOP_DISCOUNT_COUPON_END_TIME' => $objSorting->getHeaderForField('end_time'), 'HEADER_SHOP_DISCOUNT_COUPON_MINIMUM_AMOUNT_CURRENCY' => $objSorting->getHeaderForField('minimum_amount'), 'HEADER_SHOP_DISCOUNT_COUPON_RATE' => $objSorting->getHeaderForField('discount_rate'), 'HEADER_SHOP_DISCOUNT_COUPON_AMOUNT_CURRENCY' => $objSorting->getHeaderForField('discount_amount'), 'HEADER_SHOP_DISCOUNT_COUPON_USES' => $objSorting->getHeaderForField('uses'), 'HEADER_SHOP_DISCOUNT_COUPON_SCOPE' => $objSorting->getHeaderForField('global'), 'HEADER_SHOP_DISCOUNT_COUPON_CUSTOMER' => $objSorting->getHeaderForField('customer_id'), 'HEADER_SHOP_DISCOUNT_COUPON_PRODUCT' => $objSorting->getHeaderForField('product_id'), 'HEADER_SHOP_DISCOUNT_COUPON_PAYMENT' => $objSorting->getHeaderForField('payment_id')));
     $count = 0;
     $limit = \Cx\Core\Setting\Controller\Setting::getValue('numof_coupon_per_page_backend', 'Shop');
     if (empty($limit)) {
         self::errorHandler();
     }
     $arrCoupons = self::getArray(\Paging::getPosition(), $limit, $count, $objSorting->getOrder());
     $arrProductName = Products::getNameArray(true, $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_PRODUCT_FORMAT']);
     $arrPaymentName = Payment::getNameArray();
     $i = 0;
     $row = 0;
     $objCouponEdit = new Coupon();
     $objCouponEdit->code($code);
     $objCouponEdit->payment_id($payment_id);
     $objCouponEdit->minimum_amount($minimum_amount);
     $objCouponEdit->discount_rate($discount_rate);
     $objCouponEdit->discount_amount($discount_amount);
     $objCouponEdit->start_time($start_time);
     $objCouponEdit->end_time($end_time);
     $objCouponEdit->uses($uses);
     $objCouponEdit->is_global($global);
     $objCouponEdit->customer_id($customer_id);
     $objCouponEdit->product_id($product_id);
     global $_CONFIG;
     foreach ($arrCoupons as $index => $objCoupon) {
         $coupon_uri_id = 'coupon_uri_' . $index;
         $objTemplate->setVariable(array('SHOP_ROWCLASS' => 'row' . (++$row % 2 + 1), 'SHOP_DISCOUNT_COUPON_CODE' => $objCoupon->code, 'SHOP_DISCOUNT_COUPON_URI_ICON' => '<div class="icon_url"' . '>&nbsp;</div>', 'SHOP_DISCOUNT_COUPON_URI_INPUT' => '<div class="layer_url" id="' . $coupon_uri_id . '">' . \Html::getInputText('dummy', 'http://' . $_CONFIG['domainUrl'] . \Cx\Core\Core\Controller\Cx::instanciate()->getWebsiteOffsetPath() . '/' . CONTREXX_DIRECTORY_INDEX . '?section=Shop' . MODULE_INDEX . '&coupon_code=' . $objCoupon->code, false, 'readonly="readonly"' . ' style="width: 200px;"' . ' onfocus="this.select();"' . ' onblur="cx.jQuery(\'#' . $coupon_uri_id . '\').hide();"') . '</div>', 'SHOP_DISCOUNT_COUPON_START_TIME' => $objCoupon->start_time ? date(ASCMS_DATE_FORMAT_DATE, $objCoupon->start_time) : $_ARRAYLANG['TXT_SHOP_DATE_NONE'], 'SHOP_DISCOUNT_COUPON_END_TIME' => $objCoupon->end_time ? date(ASCMS_DATE_FORMAT_DATE, $objCoupon->end_time) : $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_END_TIME_UNLIMITED'], 'SHOP_DISCOUNT_COUPON_MINIMUM_AMOUNT' => $objCoupon->minimum_amount > 0 ? $objCoupon->minimum_amount : $_ARRAYLANG['TXT_SHOP_AMOUNT_NONE'], 'SHOP_DISCOUNT_COUPON_RATE' => $objCoupon->discount_rate > 0 ? $objCoupon->discount_rate : $_ARRAYLANG['TXT_SHOP_RATE_NONE'], 'SHOP_DISCOUNT_COUPON_AMOUNT' => $objCoupon->discount_amount > 0 ? $objCoupon->discount_amount : $_ARRAYLANG['TXT_SHOP_AMOUNT_NONE'], 'SHOP_DISCOUNT_COUPON_USES' => sprintf($_ARRAYLANG['TXT_SHOP_COUPON_USES_FORMAT'], $objCoupon->used, $objCoupon->uses < 1000000000.0 ? $objCoupon->uses : $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_USES_UNLIMITED']), 'SHOP_DISCOUNT_COUPON_SCOPE' => $objCoupon->global ? $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_GLOBALLY'] : $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_PER_CUSTOMER'], 'SHOP_DISCOUNT_COUPON_PER_CUSTOMER' => !$objCoupon->global ? \Html::getRadio('foo_' . ++$i, '', false, true, '', \Html::ATTRIBUTE_DISABLED) : '&nbsp;', 'SHOP_DISCOUNT_COUPON_CUSTOMER' => $objCoupon->customer_id ? Customers::getNameById($objCoupon->customer_id, '%4$s (%3$u)') : $_ARRAYLANG['TXT_SHOP_CUSTOMER_ANY'], 'SHOP_DISCOUNT_COUPON_PRODUCT' => $objCoupon->product_id ? isset($arrProductName[$objCoupon->product_id]) ? $arrProductName[$objCoupon->product_id] : $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_PRODUCT_INVALID'] : $_ARRAYLANG['TXT_SHOP_PRODUCT_ANY'], 'SHOP_DISCOUNT_COUPON_PAYMENT' => $objCoupon->payment_id ? sprintf($_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_PAYMENT_FORMAT'], $objCoupon->payment_id, $arrPaymentName[$objCoupon->payment_id]) : $_ARRAYLANG['TXT_SHOP_PAYMENT_ANY'], 'SHOP_DISCOUNT_COUPON_FUNCTIONS' => \Html::getBackendFunctions(array('edit' => ADMIN_SCRIPT_PATH . '?cmd=Shop&amp;act=settings&amp;tpl=coupon&amp;edit=' . urlencode($index), 'delete' => "javascript:delete_coupon('" . urlencode($index) . "');"))));
         $objTemplate->parse('shopDiscountCouponView');
         if ($index === $edit) {
             $objCouponEdit = $objCoupon;
         }
     }
     $objTemplate->replaceBlock('shopDiscountCouponView', '', true);
     $paging = \Paging::get($uri, $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_CODES'], $count, $limit);
     //DBG::log("Paging: $paging");
     $objTemplate->setVariable('SHOP_PAGING', $paging);
     $attribute_code = 'style="width: 230px; text-align: left;" maxlength="20"';
     $attribute_time = 'style="width: 230px; text-align: left;" maxlength="10"';
     $attribute_discount_rate = 'style="width: 230px; text-align: right;" maxlength="3"';
     $attribute_discount_amount = 'style="width: 230px; text-align: right;" maxlength="9"';
     $attribute_minimum_amount = 'style="width: 230px; text-align: right;" maxlength="9"';
     $attribute_uses = 'style="width: 230px; text-align: right;" maxlength="6"';
     // Superseded by the widget, see below
     //        $attribute_customer = 'style="width: 230px;"';
     $attribute_product = 'style="width: 230px;"';
     $attribute_payment = 'style="width: 230px;"';
//.........这里部分代码省略.........
开发者ID:Niggu,项目名称:cloudrexx,代码行数:101,代码来源:Coupon.class.php

示例7: getPaging

/**
 * OBSOLETE
 * Use the {@see Paging::get()} method instead.
 *
 * Returs a string representing the complete paging HTML code for the
 * current page.
 * Note that the old $pos parameter is obsolete as well,
 * see {@see getPosition()}.
 * @copyright CLOUDREXX CMS - CLOUDREXX AG
 * @author    Cloudrexx Development Team <info@cloudrexx.com>
 * @access    public
 * @version   1.0.0
 * @global    array       $_CONFIG        Configuration
 * @global    array       $_CORELANG      Core language
 * @param     int         $numof_rows     The number of rows available
 * @param     int         $pos            The offset from the first row
 * @param     string      $uri_parameter
 * @param     string      $paging_text
 * @param     boolean     $showeverytime
 * @param     int         $results_per_page
 * @return    string      Result
 * @deprecated
 * @todo      Change the system to use the new, static class method,
 *            then remove this one.
 */
function getPaging($numof_rows, $pos, $uri_parameter, $paging_text, $showeverytime = false, $results_per_page = null)
{
    return Paging::get($uri_parameter, $paging_text, $numof_rows, $results_per_page, $showeverytime, $pos, 'pos');
}
开发者ID:Niggu,项目名称:cloudrexx,代码行数:29,代码来源:API.php

示例8: showCrawlerRuns

 /**
  * Show all the runs and last runs detail
  * 
  * @global array $_ARRAYLANG
  */
 public function showCrawlerRuns()
 {
     global $_ARRAYLANG;
     //show the last runs details
     $lastRunResult = $this->crawlerRepository->getLatestRunDetails();
     if ($lastRunResult) {
         $this->template->setVariable(array($this->moduleNameLang . '_LAST_RUN_STARTTIME' => \Cx\Core_Modules\LinkManager\Controller\DateTime::formattedDateAndTime($lastRunResult[0]->getStartTime()), $this->moduleNameLang . '_LAST_RUN_ENDTIME' => \Cx\Core_Modules\LinkManager\Controller\DateTime::formattedDateAndTime($lastRunResult[0]->getEndTime()), $this->moduleNameLang . '_LAST_RUN_DURATION' => \Cx\Core_Modules\LinkManager\Controller\DateTime::diffTime($lastRunResult[0]->getStartTime(), $lastRunResult[0]->getEndTime()), $this->moduleNameLang . '_LAST_RUN_TOTAL_LINKS' => $lastRunResult[0]->getTotalLinks(), $this->moduleNameLang . '_LAST_RUN_BROKEN_LINKS' => $lastRunResult[0]->getTotalBrokenLinks()));
     } else {
         if ($this->template->blockExists('showLastRun')) {
             $this->template->hideBlock('showLastRun');
         }
     }
     //show Crawler Runs table
     //get parameters
     $pos = isset($_GET['pos']) ? $_GET['pos'] : 0;
     $langArray = \FWLanguage::getLanguageArray();
     //set the settings value from DB
     \Cx\Core\Setting\Controller\Setting::init('LinkManager', 'config');
     $pageLimit = \Cx\Core\Setting\Controller\Setting::getValue('entriesPerPage', 'LinkManager');
     $parameter = './index.php?cmd=' . $this->moduleName;
     $this->template->setVariable('ENTRIES_PAGING', \Paging::get($parameter, $_ARRAYLANG['TXT_CORE_MODULE_LINKMANAGER_LINKS'], $this->crawlerRepository->crawlerEntryCount(), $pageLimit, true, $pos, 'pos'));
     $crawlers = $this->crawlerRepository->getCrawlerRunEntries($pos, $pageLimit);
     $i = 1;
     if ($crawlers && $crawlers->count() > 0) {
         foreach ($crawlers as $crawler) {
             $this->template->setVariable(array($this->moduleNameLang . '_CRAWLER_RUN_ID' => $crawler->getId(), $this->moduleNameLang . '_CRAWLER_RUN_LANGUAGE' => $langArray[$crawler->getLang()]['name'], $this->moduleNameLang . '_CRAWLER_RUN_STARTTIME' => \Cx\Core_Modules\LinkManager\Controller\DateTime::formattedDateAndTime($crawler->getStartTime()), $this->moduleNameLang . '_CRAWLER_RUN_ENDTIME' => \Cx\Core_Modules\LinkManager\Controller\DateTime::formattedDateAndTime($crawler->getEndTime()), $this->moduleNameLang . '_CRAWLER_RUN_DURATION' => \Cx\Core_Modules\LinkManager\Controller\DateTime::diffTime($crawler->getStartTime(), $crawler->getEndTime()), $this->moduleNameLang . '_CRAWLER_RUN_TOTAL_LINKS' => $crawler->getTotalLinks(), $this->moduleNameLang . '_CRAWLER_RUN_BROKEN_LINKS' => $crawler->getTotalBrokenLinks(), $this->moduleNameLang . '_CRAWLER_RUN_STATUS' => ucfirst($crawler->getRunStatus()), $this->moduleNameLang . '_CRAWLER_RUN_ROW' => 'row' . (++$i % 2 + 1)));
             $this->template->parse($this->moduleName . 'CrawlerRuns');
         }
         $this->template->hideBlock($this->moduleName . 'NoCrawlerRunsFound');
     } else {
         $this->template->touchBlock($this->moduleName . 'NoCrawlerRunsFound');
     }
 }
开发者ID:Niggu,项目名称:cloudrexx,代码行数:38,代码来源:DefaultController.class.php

示例9: settings

 /**
  * Sets up the Country settings page
  * @return  string          The page content
  */
 static function settings()
 {
     global $_CORELANG;
     $objTemplateCountry = new \Cx\Core\Html\Sigma(\Env::get('cx')->getCodeBaseCorePath() . '/Country/View/Template/Generic');
     $objTemplateCountry->loadTemplateFile('Overview.html');
     // Adds messages
     self::storeSettings();
     self::storeFromPost();
     $uri = \Html::getRelativeUri();
     // Let all links in this tab point here again
     \Html::replaceUriParameter($uri, 'active_tab=' . \Cx\Core\Setting\Controller\Setting::tab_index());
     // Create a copy of the URI for the Paging, as this is passed by
     // reference and modified
     $uri_paging = $uri;
     //DBG::log("URI: $uri");
     $objSorting = new Sorting($uri, array('id' => $_CORELANG['TXT_CORE_COUNTRY_ID'], 'active' => $_CORELANG['TXT_CORE_COUNTRY_ACTIVE'], 'ord' => $_CORELANG['TXT_CORE_COUNTRY_ORD'], 'name' => $_CORELANG['TXT_CORE_COUNTRY_NAME'], 'alpha2' => $_CORELANG['TXT_CORE_COUNTRY_ISO2'], 'alpha3' => $_CORELANG['TXT_CORE_COUNTRY_ISO3']), true, 'order_country');
     \Cx\Core\Setting\Controller\Setting::init('core', 'country');
     $limit = \Cx\Core\Setting\Controller\Setting::getValue('numof_countries_per_page_backend', 'core');
     $count = 0;
     $arrCountries = self::getArray($count, null, $limit, \Paging::getPosition(), $objSorting->getOrder());
     if ($arrCountries === false) {
         return \Message::error($_CORELANG['TXT_CORE_COUNTRY_ERROR_INITIALIZING']);
     }
     $objTemplateCountry->setGlobalVariable($_CORELANG + array('CORE_COUNTRY' => $_CORELANG['TXT_CORE_COUNTRY'] . ' ' . sprintf($_CORELANG['TXT_CORE_TOTAL'], $count), 'HEAD_SETTINGS_COUNTRY_ID' => $objSorting->getHeaderForField('id'), 'HEAD_SETTINGS_COUNTRY_ACTIVE' => $objSorting->getHeaderForField('active'), 'HEAD_SETTINGS_COUNTRY_ORD' => $objSorting->getHeaderForField('ord'), 'HEAD_SETTINGS_COUNTRY_NAME' => $objSorting->getHeaderForField('name'), 'HEAD_SETTINGS_COUNTRY_ISO2' => $objSorting->getHeaderForField('alpha2'), 'HEAD_SETTINGS_COUNTRY_ISO3' => $objSorting->getHeaderForField('alpha3'), 'CORE_SETTING_TAB_INDEX' => \Cx\Core\Setting\Controller\Setting::tab_index(), 'SETTINGS_COUNTRY_PAGING' => \Paging::get($uri_paging, '', $count, $limit, true)));
     // Note:  Optionally disable the block 'settings_country_submit'
     // to disable storing changes
     $i = 0;
     foreach ($arrCountries as $country_id => $arrCountry) {
         $objTemplateCountry->setVariable(array('SETTINGS_COUNTRY_ROWCLASS' => ++$i % 2 + 1, 'SETTINGS_COUNTRY_ID' => $country_id, 'SETTINGS_COUNTRY_ACTIVE' => $arrCountry['active'] ? \Html::ATTRIBUTE_CHECKED : '', 'SETTINGS_COUNTRY_ORD' => $arrCountry['ord'], 'SETTINGS_COUNTRY_NAME' => $arrCountry['name'], 'SETTINGS_COUNTRY_ISO2' => $arrCountry['alpha2'], 'SETTINGS_COUNTRY_ISO3' => $arrCountry['alpha3'], 'SETTINGS_FUNCTIONS' => \Html::getBackendFunctions(array('delete' => 'delete_country_id=' . $country_id), array('delete' => $_CORELANG['TXT_CORE_COUNTRY_CONFIRM_DELETE'] . "\\n" . $_CORELANG['TXT_ACTION_IS_IRREVERSIBLE']))));
         $objTemplateCountry->parse('settings_country_row');
     }
     $objTemplateSetting = null;
     \Cx\Core\Setting\Controller\Setting::show_external($objTemplateSetting, $_CORELANG['TXT_CORE_COUNTRY_EDIT'], $objTemplateCountry->get());
     \Cx\Core\Setting\Controller\Setting::show($objTemplateSetting, $uri, $_CORELANG['TXT_CORE_COUNTRY_SETTINGS'], $_CORELANG['TXT_CORE_COUNTRY_SETTINGS']);
     return $objTemplateSetting->get();
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:40,代码来源:Country.class.php

示例10: view_product_overview

 /**
  * Show Products
  */
 function view_product_overview()
 {
     global $_ARRAYLANG;
     if (isset($_POST['bsubmit'])) {
         $this->update_products();
     }
     if (isset($_POST['multi_action'])) {
         if ($_POST['multi_action'] == 'activate') {
             Products::set_active($_POST['selectedProductId'], true);
         } elseif ($_POST['multi_action'] == 'deactivate') {
             Products::set_active($_POST['selectedProductId'], false);
         }
     }
     self::$objTemplate->addBlockfile('SHOP_PRODUCTS_FILE', 'shop_products_block', 'module_shop_product_catalog.html');
     self::$objTemplate->setGlobalVariable($_ARRAYLANG);
     $category_id = empty($_REQUEST['category_id']) ? null : intval($_REQUEST['category_id']);
     //DBG::log("Requested Category ID: $category_id");
     $manufacturer_id = empty($_REQUEST['manufacturer_id']) ? null : intval($_REQUEST['manufacturer_id']);
     $flagSpecialoffer = isset($_REQUEST['specialoffer']);
     $searchTerm = empty($_REQUEST['searchterm']) ? null : trim(contrexx_input2raw($_REQUEST['searchterm']));
     $url = \Html::getRelativeUri();
     // TODO: Strip URL parameters: Which?
     //        \Html::stripUriParam($url, '');
     $arrSorting = array('`product`.`id`' => $_ARRAYLANG['TXT_SHOP_ID'], '`product`.`active`' => $_ARRAYLANG['TXT_SHOP_PRODUCT_ACTIVE'], '`product`.`ord`' => $_ARRAYLANG['TXT_SHOP_PRODUCT_ORDER'], 'name' => $_ARRAYLANG['TXT_SHOP_PRODUCT_NAME'], 'code' => $_ARRAYLANG['TXT_SHOP_PRODUCT_CODE'], '`product`.`discountprice`' => $_ARRAYLANG['TXT_SHOP_PRODUCT_DISCOUNTPRICE'], '`product`.`normalprice`' => $_ARRAYLANG['TXT_SHOP_PRODUCT_NORMALPRICE'], '`product`.`resellerprice`' => $_ARRAYLANG['TXT_SHOP_PRODUCT_RESELLERPRICE'], '`product`.`distribution`' => $_ARRAYLANG['TXT_SHOP_PRODUCT_DISTRIBUTION'], '`product`.`stock`' => $_ARRAYLANG['TXT_SHOP_PRODUCT_STOCK']);
     $objSorting = new \Sorting($url, $arrSorting, false, 'order_shop_product');
     $limit = \Cx\Core\Setting\Controller\Setting::getValue('numof_products_per_page_backend', 'Shop');
     $tries = 2;
     while ($tries--) {
         // have to set $count again because it will be set to 0 in Products::getByShopParams
         $count = $limit;
         // Mind that $count is handed over by reference.
         $arrProducts = Products::getByShopParams($count, \Paging::getPosition(), 0, $category_id, $manufacturer_id, $searchTerm, $flagSpecialoffer, false, $objSorting->getOrder(), null, true);
         if (count($arrProducts) > 0 || \Paging::getPosition() == 0) {
             break;
         }
         \Paging::reset();
     }
     self::$objTemplate->setVariable(array('SHOP_CATEGORY_MENU' => \Html::getSelect('category_id', array(0 => $_ARRAYLANG['TXT_ALL_PRODUCT_GROUPS']) + ShopCategories::getNameArray(), $category_id), 'SHOP_SEARCH_TERM' => $searchTerm, 'SHOP_PRODUCT_TOTAL' => $count));
     if (empty($arrProducts)) {
         self::$objTemplate->touchBlock('no_product');
         return true;
     }
     self::$objTemplate->setVariable(array('SHOP_PRODUCT_PAGING' => \Paging::get($url, '<b>' . $_ARRAYLANG['TXT_PRODUCTS'] . '</b>', $count, $limit, true), 'SHOP_HEADING_PRODUCT_ID' => $objSorting->getHeaderForField('`product`.`id`'), 'SHOP_HEADING_PRODUCT_ACTIVE' => $objSorting->getHeaderForField('`product`.`active`'), 'SHOP_HEADING_PRODUCT_ORD' => $objSorting->getHeaderForField('`product`.`ord`'), 'SHOP_HEADING_PRODUCT_NAME' => $objSorting->getHeaderForField('name'), 'SHOP_HEADING_PRODUCT_CODE' => $objSorting->getHeaderForField('code'), 'SHOP_HEADING_PRODUCT_DISCOUNTPRICE' => $objSorting->getHeaderForField('`product`.`discountprice`'), 'SHOP_HEADING_PRODUCT_NORMALPRICE' => $objSorting->getHeaderForField('`product`.`normalprice`'), 'SHOP_HEADING_PRODUCT_RESELLERPRICE' => $objSorting->getHeaderForField('`product`.`resellerprice`'), 'SHOP_HEADING_PRODUCT_DISTRIBUTION' => $objSorting->getHeaderForField('`product`.`distribution`'), 'SHOP_HEADING_PRODUCT_STOCK' => $objSorting->getHeaderForField('`product`.`stock`')));
     $arrLanguages = \FWLanguage::getActiveFrontendLanguages();
     // Intended to show an edit link for all active frontend languages.
     // However, the design doesn't like it.  Limit to the current one.
     $arrLanguages = array(FRONTEND_LANG_ID => $arrLanguages[FRONTEND_LANG_ID]);
     $i = 0;
     foreach ($arrProducts as $objProduct) {
         $productStatus = '';
         $productStatusValue = '';
         $productStatusPicture = 'status_red.gif';
         if ($objProduct->active()) {
             $productStatus = \Html::ATTRIBUTE_CHECKED;
             $productStatusValue = 1;
             $productStatusPicture = 'status_green.gif';
         }
         $discount_active = '';
         $specialOfferValue = '';
         if ($objProduct->discount_active()) {
             $discount_active = \Html::ATTRIBUTE_CHECKED;
             $specialOfferValue = 1;
         }
         self::$objTemplate->setGlobalVariable(array('SHOP_ROWCLASS' => 'row' . (++$i % 2 + 1), 'SHOP_PRODUCT_ID' => $objProduct->id(), 'SHOP_PRODUCT_CODE' => $objProduct->code(), 'SHOP_PRODUCT_NAME' => contrexx_raw2xhtml($objProduct->name()), 'SHOP_PRODUCT_PRICE1' => Currency::formatPrice($objProduct->price()), 'SHOP_PRODUCT_PRICE2' => Currency::formatPrice($objProduct->resellerprice()), 'SHOP_PRODUCT_DISCOUNT' => Currency::formatPrice($objProduct->discountprice()), 'SHOP_PRODUCT_SPECIAL_OFFER' => $discount_active, 'SHOP_SPECIAL_OFFER_VALUE_OLD' => $specialOfferValue, 'SHOP_PRODUCT_VAT_MENU' => Vat::getShortMenuString($objProduct->vat_id(), 'taxId[' . $objProduct->id() . ']'), 'SHOP_PRODUCT_VAT_ID' => $objProduct->vat_id() ? $objProduct->vat_id() : 'NULL', 'SHOP_PRODUCT_DISTRIBUTION' => $objProduct->distribution(), 'SHOP_PRODUCT_STOCK' => $objProduct->stock(), 'SHOP_PRODUCT_SHORT_DESC' => $objProduct->short(), 'SHOP_PRODUCT_STATUS' => $productStatus, 'SHOP_PRODUCT_STATUS_PICTURE' => $productStatusPicture, 'SHOP_ACTIVE_VALUE_OLD' => $productStatusValue, 'SHOP_SORT_ORDER' => $objProduct->ord(), 'SHOP_DISTRIBUTION' => $_ARRAYLANG['TXT_DISTRIBUTION_' . strtoupper($objProduct->distribution())], 'SHOP_SHOW_PRODUCT_ON_START_PAGE_CHECKED' => $objProduct->shown_on_startpage() ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_SHOW_PRODUCT_ON_START_PAGE_OLD' => $objProduct->shown_on_startpage() ? '1' : '', 'SHOP_PRODUCT_NAME' => contrexx_raw2xhtml($objProduct->name())));
         // All languages active
         foreach ($arrLanguages as $lang_id => $arrLanguage) {
             self::$objTemplate->setVariable(array('SHOP_PRODUCT_LANGUAGE_ID' => $lang_id, 'SHOP_PRODUCT_LANGUAGE_EDIT' => sprintf($_ARRAYLANG['TXT_SHOP_PRODUCT_LANGUAGE_EDIT'], $lang_id, $arrLanguage['lang'], $arrLanguage['name'])));
             self::$objTemplate->parse('product_language');
         }
         self::$objTemplate->touchBlock('productRow');
         self::$objTemplate->parse('productRow');
     }
     return true;
 }
开发者ID:Niggu,项目名称:cloudrexx,代码行数:77,代码来源:ShopManager.class.php

示例11: overview

 /**
  * Show on overview of the mail templates for the given section and group
  *
  * If empty, the $limit defaults to the
  * "numof_mailtemplate_per_page_backend" setting for the given section
  * and group.
  * @param   string    $section      The section
  * @param   string    $group        The group
  * @param   integer   $limit        The optional limit for the number
  *                                  of templates to be shown
  * @param   string   $act           The action of the mail template
  *                                  default set to mailtemplate_overview
  * @return  \Cx\Core\Html\Sigma     The template object
  */
 static function overview($section, $group, $limit = 0, $useDefaultActs = true, $act = 'mailtemplate_edit')
 {
     global $_CORELANG;
     $objTemplateLocal = new \Cx\Core\Html\Sigma(\Env::get('cx')->getCodeBaseCorePath() . '/MailTemplate/View/Template/Generic');
     $objTemplateLocal->setErrorHandling(PEAR_ERROR_DIE);
     \Cx\Core\Csrf\Controller\Csrf::add_placeholder($objTemplateLocal);
     if (!$objTemplateLocal->loadTemplateFile('Overview.html')) {
         die("Failed to load template Overview.html");
     }
     if (empty($section) || empty($group)) {
         \Message::error($_CORELANG['TXT_CORE_MAILTEMPLATE_ERROR_NO_SECTION_OR_GROUP']);
         return false;
     }
     if (empty($limit)) {
         \Cx\Core\Setting\Controller\Setting::init($section, $group);
         $limit = \Cx\Core\Setting\Controller\Setting::getValue('numof_mailtemplate_per_page_backend', $section);
         // TODO: TEMPORARY
         if (is_null($limit)) {
             $limit = 25;
             \Cx\Core\Setting\Controller\Setting::add('numof_mailtemplate_per_page_backend', $limit, 1001, 'text', '', $group);
         }
     }
     $uri = \Html::getRelativeUri_entities();
     $tab_index = \Cx\Core\Setting\Controller\Setting::tab_index();
     \Html::replaceUriParameter($uri, 'active_tab=' . $tab_index);
     \Html::replaceUriParameter($uri, 'userFrontendLangId=' . FRONTEND_LANG_ID);
     //echo("Made uri for sorting: ".htmlentities($uri)."<br />");
     \Html::stripUriParam($uri, 'key');
     \Html::stripUriParam($uri, 'delete_mailtemplate_key');
     $uri_edit = $uri_overview = $uri;
     //echo("Made uri for sorting: ".htmlentities($uri)."<br />");
     if ($useDefaultActs) {
         \Html::stripUriParam($uri, 'act');
         \Html::replaceUriParameter($uri_edit, 'act=mailtemplate_edit');
         \Html::replaceUriParameter($uri_overview, 'act=mailtemplate_overview');
     }
     $objSorting = new \Sorting($uri_overview, array('name' => $_CORELANG['TXT_CORE_MAILTEMPLATE_NAME'], 'key' => $_CORELANG['TXT_CORE_MAILTEMPLATE_KEY'], 'html' => $_CORELANG['TXT_CORE_MAILTEMPLATE_IS_HTML'], 'protected' => $_CORELANG['TXT_CORE_MAILTEMPLATE_PROTECTED']), true, 'order_mailtemplate');
     $count = 0;
     // Template titles are shown in the current language only, no need
     // (and no way either) to load them all.  Names are shown in the
     // currently active frontend language only.
     $pagingParameterName = $section . '_' . $group;
     $arrTemplates = self::getArray($section, FRONTEND_LANG_ID, $objSorting->getOrder(), \Paging::getPosition($pagingParameterName), $limit, $count);
     $arrLanguageName = \FWLanguage::getNameArray();
     $objTemplateLocal->setGlobalVariable($_CORELANG + array('CORE_MAILTEMPLATE_NAME' => $objSorting->getHeaderForField('name'), 'CORE_MAILTEMPLATE_KEY' => $objSorting->getHeaderForField('key'), 'CORE_MAILTEMPLATE_HTML' => $objSorting->getHeaderForField('html'), 'CORE_MAILTEMPLATE_PROTECTED' => $objSorting->getHeaderForField('protected'), 'PAGING' => \Paging::get($uri_overview, $_CORELANG['TXT_CORE_MAILTEMPLATE_PAGING'], $count, $limit, true, null, $pagingParameterName), 'URI_BASE' => $uri, 'URI_EDIT' => $uri_edit, 'CORE_MAILTEMPLATE_COLSPAN' => 5 + count($arrLanguageName)));
     foreach ($arrLanguageName as $language_name) {
         $objTemplateLocal->setVariable('MAILTEMPLATE_LANGUAGE_HEADER', $language_name);
         $objTemplateLocal->parse('core_mailtemplate_language_header');
     }
     if (empty($arrTemplates)) {
         \Message::information($_CORELANG['TXT_CORE_MAILTEMPLATE_WARNING_NONE']);
         $arrTemplates = array();
     }
     // Load *all* templates and languages
     self::init($section);
     $i = 0;
     foreach ($arrTemplates as $arrTemplate) {
         $key = $arrTemplate['key'];
         $objTemplateLocal->setVariable(array('MAILTEMPLATE_ROWCLASS' => ++$i % 2 + 1, 'MAILTEMPLATE_PROTECTED' => \Html::getCheckmark($arrTemplate['protected']), 'MAILTEMPLATE_HTML' => \Html::getCheckmark($arrTemplate['html']), 'MAILTEMPLATE_NAME' => '<a href="' . $uri_edit . '&amp;key=' . urlencode($key) . '">' . contrexx_raw2xhtml($arrTemplate['name']) . '</a>', 'MAILTEMPLATE_KEY' => $arrTemplate['key'], 'MAILTEMPLATE_FUNCTIONS' => \Html::getBackendFunctions(array('copy' => $uri_edit . '&amp;copy=1&amp;key=' . $arrTemplate['key'], 'edit' => $uri_edit . '&amp;key=' . $arrTemplate['key'], 'delete' => $arrTemplate['protected'] ? '' : $uri_overview . '&amp;delete_mailtemplate_key=' . $arrTemplate['key'] . '&amp;csrf=' . \Cx\Core\Csrf\Controller\Csrf::code()), array('delete' => $_CORELANG['TXT_CORE_MAILTEMPLATE_DELETE_CONFIRM']))));
         foreach (array_keys($arrLanguageName) as $lang_id) {
             $available = isset(self::$arrTemplates[$lang_id][$key]) && self::$arrTemplates[$lang_id][$key]['available'];
             $title = $available ? $_CORELANG['TXT_CORE_MAILTEMPLATE_EDIT'] : $_CORELANG['TXT_CORE_MAILTEMPLATE_NEW'];
             $icon = '<a href="' . CONTREXX_DIRECTORY_INDEX . "?cmd={$section}&amp;act=" . $act . '&amp;key=' . $key . '&amp;userFrontendLangId=' . $lang_id . '"' . ' title="' . $title . '">' . '<img src="../core/Core/View/Media/icons/' . ($available ? 'edit.gif' : 'add.png') . '"' . ' width="16" height="16" alt="' . $title . '" border="0" /></a>';
             $objTemplateLocal->setVariable('MAILTEMPLATE_LANGUAGE', $icon);
             $objTemplateLocal->parse('core_mailtemplate_language_column');
         }
         $objTemplateLocal->parse('core_mailtemplate_row');
     }
     return $objTemplateLocal;
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:84,代码来源:MailTemplate.class.php


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