26 global $adminPage, $adminSidePanelHelper;
28 $selfFolderUrl = $adminPage->getSelfFolderUrl();
31 AccessController::getCurrent()->check(ActionDictionary::ACTION_CATALOG_READ)
32 || AccessController::getCurrent()->check(ActionDictionary::ACTION_PRICE_GROUP_EDIT)
38 $priceTypeLinkTitle = Main\Text\HtmlFilter::encode(
39 AccessController::getCurrent()->check(ActionDictionary::ACTION_PRICE_GROUP_EDIT)
40 ?
Loc::getMessage(
'CATALOG_HELPERS_ADMIN_TOOLS_MESS_PRICE_TYPE_EDIT_TITLE')
41 :
Loc::getMessage(
'CATALOG_HELPERS_ADMIN_TOOLS_MESS_PRICE_TYPE_VIEW_TITLE')
44 $priceTypeList = Catalog\GroupTable::getTypeList();
45 if (empty($priceTypeList))
50 foreach ($priceTypeList as $priceType)
52 $id = $priceType[
'ID'];
53 $title = $priceType[
'NAME_LANG'];
54 $fullTitle =
'['. $id .
'] [' . $priceType[
'NAME'] .
']' . ($title !==
null ?
' ' . $title :
'');
55 $editUrl = $selfFolderUrl .
'cat_group_edit.php?ID=' . $id .
'&lang=' . LANGUAGE_ID;
56 $editUrl = $adminSidePanelHelper->editUrlToPublicPage($editUrl);
58 '<a href="' . $editUrl .
'"'
59 .
' title="' . Main\Text\HtmlFilter::encode($priceTypeLinkTitle) .
'">'
60 . Main\Text\HtmlFilter::encode($fullTitle)
64 unset($fullTitle, $title, $id);
66 unset($priceType, $priceTypeList, $priceTypeLinkTitle);
80 $codeIndex = ($codeIndex ===
true);
82 foreach (Catalog\GroupTable::getTypeList() as $priceType)
84 $id = $priceType[
'ID'];
85 $title = $priceType[
'NAME_LANG'];
86 $index = ($codeIndex ? $priceType[
'NAME'] : $id);
87 $result[$index] =
'['. $id .
'] [' . $priceType[
'NAME'] .
']' . ($title !==
null ?
' ' . $title :
'');
88 unset($index, $title, $id);