本文整理汇总了PHP中FWUser::getValidityMenuOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP FWUser::getValidityMenuOptions方法的具体用法?PHP FWUser::getValidityMenuOptions怎么用?PHP FWUser::getValidityMenuOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FWUser
的用法示例。
在下文中一共展示了FWUser::getValidityMenuOptions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getValidityMenu
protected function getValidityMenu($validity, $expirationDate)
{
//TODO:Use own methods instead of \FWUser::getValidityString() and \FWUser::getValidityMenuOptions()
$menu = '<select name="downloads_download_validity" ' . ($validity && $expirationDate < time() ? 'onchange="this.style.color = this.value == \'current\' ? \'#f00\' : \'#000\'"' : null) . ' style="width:300px;' . ($validity && $expirationDate < time() ? 'color:#f00;font-weight:normal;' : 'color:#000;') . '">';
if ($validity) {
$menu .= '<option value="current" selected="selected" style="border-bottom:1px solid #000;' . ($expirationDate < time() ? 'color:#f00;font-weight:normal;' : null) . '">' . \FWUser::getValidityString($validity) . ' (' . date(ASCMS_DATE_FORMAT_DATE, $expirationDate) . ')</option>';
}
$menu .= \FWUser::getValidityMenuOptions(null, 'style="color:#000; font-weight:normal;"');
$menu .= '</select>';
return $menu;
}
示例2: view_product_edit
/**
* Manage products
*
* Add and edit products
* @access public
* @return string
* @author Reto Kohli <reto.kohli@comvation.com> (parts)
*/
function view_product_edit()
{
global $_ARRAYLANG;
self::store_product();
$product_id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0;
$objProduct = null;
self::$objTemplate->addBlockfile('SHOP_PRODUCTS_FILE', 'shop_products_block', 'module_shop_product_manage.html');
self::$objTemplate->setGlobalVariable($_ARRAYLANG);
$cx = \Cx\Core\Core\Controller\Cx::instanciate();
self::$objTemplate->setVariable(array('SHOP_DELETE_ICON' => $cx->getCodeBaseCoreWebPath() . '/Core/View/Media/icons/delete.gif', 'SHOP_NO_PICTURE_ICON' => self::$defaultImage));
if ($product_id > 0) {
$objProduct = Product::getById($product_id);
}
if (!$objProduct) {
$objProduct = new Product('', 0, '', '', 0, 1, 0, 0);
}
$this->viewpart_product_attributes($product_id);
$arrImages = Products::get_image_array_from_base64($objProduct->pictures());
// Virtual Categories are disabled FTTB
// $flagsSelection =
// ShopCategories::getVirtualCategoriesSelectionForFlags(
// $objProduct->flags()
// );
// if ($flagsSelection) {
// self::$objTemplate->setVariable(
// 'SHOP_FLAGS_SELECTION', $flagsSelection);
// }
//
// media browser
$mediaBrowserOptions = array('type' => 'button', 'data-cx-mb-startmediatype' => 'shop', 'data-cx-mb-views' => 'filebrowser', 'id' => 'media_browser_shop', 'style' => 'display:none');
self::$objTemplate->setVariable(array('MEDIABROWSER_BUTTON' => self::getMediaBrowserButton($mediaBrowserOptions, 'setSelectedImage')));
$distribution = $objProduct->distribution();
// Available active frontend groups, and those assigned to the product
$objGroup = \FWUser::getFWUserObject()->objGroup->getGroups(array('type' => 'frontend', 'is_active' => true), array('group_id' => 'asc'));
$usergroup_ids = $objProduct->usergroup_ids();
$arrAssignedFrontendGroupId = explode(',', $usergroup_ids);
$strActiveFrontendGroupOptions = '';
$strAssignedFrontendGroupOptions = '';
while ($objGroup && !$objGroup->EOF) {
$strOption = '<option value="' . $objGroup->getId() . '">' . htmlentities($objGroup->getName(), ENT_QUOTES, CONTREXX_CHARSET) . '</option>';
if (in_array($objGroup->getId(), $arrAssignedFrontendGroupId)) {
$strAssignedFrontendGroupOptions .= $strOption;
} else {
$strActiveFrontendGroupOptions .= $strOption;
}
$objGroup->next();
}
$discount_group_count_id = $objProduct->group_id();
$discount_group_article_id = $objProduct->article_id();
$keywords = $objProduct->keywords();
//die($objProduct->category_id());
// Product assigned to multiple Categories
$arrAssignedCategories = ShopCategories::getAssignedShopCategoriesMenuoptions($objProduct->category_id());
// Date format for Datepicker:
// Clear the date if none is set; there's no point in displaying
// "01/01/1970" instead
$start_date = $end_date = '';
$start_time = strtotime($objProduct->date_start());
// Note that the check for ">0" is necessary, as some systems return
// crazy values for empty dates (it may even fail like this)!
if ($start_time > 0) {
$start_date = date(ASCMS_DATE_FORMAT_DATE, $start_time);
}
$end_time = strtotime($objProduct->date_end());
if ($end_time > 0) {
$end_date = date(ASCMS_DATE_FORMAT_DATE, $end_time);
}
//DBG::log("Dates from ".$objProduct->date_start()." ($start_time, $start_date) to ".$objProduct->date_start()." ($end_time, $end_date)");
$websiteImagesShopPath = $cx->getWebsiteImagesShopPath() . '/';
$websiteImagesShopWebPath = $cx->getWebsiteImagesShopWebPath() . '/';
self::$objTemplate->setVariable(array('SHOP_PRODUCT_ID' => isset($_REQUEST['new']) ? 0 : $objProduct->id(), 'SHOP_PRODUCT_CODE' => contrexx_raw2xhtml($objProduct->code()), 'SHOP_PRODUCT_NAME' => contrexx_raw2xhtml($objProduct->name()), 'SHOP_CATEGORIES_ASSIGNED' => $arrAssignedCategories['assigned'], 'SHOP_CATEGORIES_AVAILABLE' => $arrAssignedCategories['available'], 'SHOP_CUSTOMER_PRICE' => contrexx_raw2xhtml(Currency::formatPrice($objProduct->price())), 'SHOP_RESELLER_PRICE' => contrexx_raw2xhtml(Currency::formatPrice($objProduct->resellerprice())), 'SHOP_DISCOUNT' => contrexx_raw2xhtml(Currency::formatPrice($objProduct->discountprice())), 'SHOP_SPECIAL_OFFER' => $objProduct->discount_active() ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_VAT_MENUOPTIONS' => Vat::getMenuoptions($objProduct->vat_id(), true), 'SHOP_SHORT_DESCRIPTION' => new \Cx\Core\Wysiwyg\Wysiwyg('short', $objProduct->short()), 'SHOP_DESCRIPTION' => new \Cx\Core\Wysiwyg\Wysiwyg('long', $objProduct->long(), 'full'), 'SHOP_STOCK' => $objProduct->stock(), 'SHOP_MIN_ORDER_QUANTITY' => $objProduct->minimum_order_quantity(), 'SHOP_MANUFACTURER_URL' => contrexx_raw2xhtml($objProduct->uri()), 'SHOP_DATE_START' => \Html::getDatepicker('date_start', array('defaultDate' => $start_date), ''), 'SHOP_DATE_END' => \Html::getDatepicker('date_end', array('defaultDate' => $end_date), ''), 'SHOP_ARTICLE_ACTIVE' => $objProduct->active() ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_B2B' => $objProduct->b2b() ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_B2C' => $objProduct->b2c() ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_STOCK_VISIBILITY' => $objProduct->stock_visible() ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_MANUFACTURER_MENUOPTIONS' => Manufacturer::getMenuoptions($objProduct->manufacturer_id()), 'SHOP_PICTURE1_IMG_SRC' => !empty($arrImages[1]['img']) && is_file(\ImageManager::getThumbnailFilename($websiteImagesShopPath . $arrImages[1]['img'])) ? contrexx_raw2encodedUrl(\ImageManager::getThumbnailFilename($websiteImagesShopWebPath . $arrImages[1]['img'])) : self::$defaultImage, 'SHOP_PICTURE2_IMG_SRC' => !empty($arrImages[2]['img']) && is_file(\ImageManager::getThumbnailFilename($websiteImagesShopPath . $arrImages[2]['img'])) ? contrexx_raw2encodedUrl(\ImageManager::getThumbnailFilename($websiteImagesShopWebPath . $arrImages[2]['img'])) : self::$defaultImage, 'SHOP_PICTURE3_IMG_SRC' => !empty($arrImages[3]['img']) && is_file(\ImageManager::getThumbnailFilename($websiteImagesShopPath . $arrImages[3]['img'])) ? contrexx_raw2encodedUrl(\ImageManager::getThumbnailFilename($websiteImagesShopWebPath . $arrImages[3]['img'])) : self::$defaultImage, 'SHOP_PICTURE1_IMG_SRC_NO_THUMB' => !empty($arrImages[1]['img']) && is_file($websiteImagesShopPath . $arrImages[1]['img']) ? $websiteImagesShopWebPath . $arrImages[1]['img'] : self::$defaultImage, 'SHOP_PICTURE2_IMG_SRC_NO_THUMB' => !empty($arrImages[2]['img']) && is_file($websiteImagesShopPath . $arrImages[2]['img']) ? $websiteImagesShopWebPath . $arrImages[2]['img'] : self::$defaultImage, 'SHOP_PICTURE3_IMG_SRC_NO_THUMB' => !empty($arrImages[3]['img']) && is_file($websiteImagesShopPath . $arrImages[3]['img']) ? $websiteImagesShopWebPath . $arrImages[3]['img'] : self::$defaultImage, 'SHOP_PICTURE1_IMG_WIDTH' => $arrImages[1]['width'], 'SHOP_PICTURE1_IMG_HEIGHT' => $arrImages[1]['height'], 'SHOP_PICTURE2_IMG_WIDTH' => $arrImages[2]['width'], 'SHOP_PICTURE2_IMG_HEIGHT' => $arrImages[2]['height'], 'SHOP_PICTURE3_IMG_WIDTH' => $arrImages[3]['width'], 'SHOP_PICTURE3_IMG_HEIGHT' => $arrImages[3]['height'], 'SHOP_DISTRIBUTION_MENU' => Distribution::getDistributionMenu($objProduct->distribution(), 'distribution', 'distributionChanged();', 'style="width: 220px"'), 'SHOP_WEIGHT' => $distribution == 'delivery' ? Weight::getWeightString($objProduct->weight()) : '0 g', 'SHOP_GROUPS_AVAILABLE' => $strActiveFrontendGroupOptions, 'SHOP_GROUPS_ASSIGNED' => $strAssignedFrontendGroupOptions, 'SHOP_ACCOUNT_VALIDITY_OPTIONS' => \FWUser::getValidityMenuOptions($distribution == 'download' ? $objProduct->weight() : 0), 'SHOP_CREATE_ACCOUNT_YES_CHECKED' => empty($usergroup_ids) ? '' : \Html::ATTRIBUTE_CHECKED, 'SHOP_CREATE_ACCOUNT_NO_CHECKED' => empty($usergroup_ids) ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_DISCOUNT_GROUP_COUNT_MENU_OPTIONS' => Discount::getMenuOptionsGroupCount($discount_group_count_id), 'SHOP_DISCOUNT_GROUP_ARTICLE_MENU_OPTIONS' => Discount::getMenuOptionsGroupArticle($discount_group_article_id), 'SHOP_KEYWORDS' => contrexx_raw2xhtml($keywords), 'SHOP_WEIGHT_ENABLED' => \Cx\Core\Setting\Controller\Setting::getValue('weight_enable', 'Shop') ? 1 : 0));
return true;
}