本文整理汇总了PHP中Discount::deleteArticleGroup方法的典型用法代码示例。如果您正苦于以下问题:PHP Discount::deleteArticleGroup方法的具体用法?PHP Discount::deleteArticleGroup怎么用?PHP Discount::deleteArticleGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Discount
的用法示例。
在下文中一共展示了Discount::deleteArticleGroup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: view_article_groups
/**
* Show the article groups for editing
* @return boolean True on success, false otherwise
* @author Reto Kohli <reto.kohli@comvation.com>
*/
function view_article_groups()
{
global $_ARRAYLANG;
if (isset($_GET['delete'])) {
Discount::deleteArticleGroup($_GET['id']);
}
if (isset($_POST['store'])) {
Discount::storeArticleGroup($_POST['groupName'], $_POST['id']);
}
// Force discounts to be reinitialised
Discount::flush();
self::$objTemplate->addBlockfile('SHOP_PRODUCTS_FILE', 'shop_products_block', 'module_shop_discount_groups_article.html');
// Group overview
$arrGroups = Discount::getArticleGroupArray();
self::$objTemplate->setCurrentBlock('shopGroup');
$i = 0;
foreach ($arrGroups as $id => $arrGroup) {
self::$objTemplate->setVariable(array('SHOP_GROUP_ID' => $id, 'SHOP_GROUP_NAME' => $arrGroup['name'], 'SHOP_ROW_STYLE' => 'row' . (++$i % 2 + 1)));
self::$objTemplate->parseCurrentBlock();
}
// Add/edit Group
$id = 0;
if (!empty($_GET['edit'])) {
$id = intval($_GET['id']);
self::$objTemplate->setGlobalVariable(array('SHOP_GROUP_EDIT_CLASS' => 'active', 'SHOP_GROUP_EDIT_DISPLAY' => 'block', 'SHOP_GROUP_LIST_CLASS' => '', 'SHOP_GROUP_LIST_DISPLAY' => 'none', 'TXT_ADD_OR_EDIT' => $_ARRAYLANG['TXT_EDIT']));
} else {
self::$objTemplate->setGlobalVariable(array('SHOP_GROUP_EDIT_CLASS' => '', 'SHOP_GROUP_EDIT_DISPLAY' => 'none', 'SHOP_GROUP_LIST_CLASS' => 'active', 'SHOP_GROUP_LIST_DISPLAY' => 'block', 'TXT_ADD_OR_EDIT' => $_ARRAYLANG['TXT_ADD']));
}
self::$objTemplate->setCurrentBlock('shopGroupName');
self::$objTemplate->setVariable(array('SHOP_GROUP_ID_EDIT' => $id, 'SHOP_ROW_STYLE' => 'row' . (++$i % 2 + 1)));
if (isset($arrGroups[$id])) {
self::$objTemplate->setVariable('SHOP_GROUP_NAME', $arrGroups[$id]['name']);
}
self::$objTemplate->parseCurrentBlock();
return true;
}