23 $res = \Bitrix\Sale\TradingPlatformTable::getList(array(
24 'select' => array(
"ID",
"CODE",
"CATALOG_SECTION_TAB_CLASS_NAME"),
25 'filter' => array(
'=ACTIVE' =>
'Y'),
28 while($arRes = $res->fetch())
30 if($arRes[
"CATALOG_SECTION_TAB_CLASS_NAME"] <>
'' && class_exists($arRes[
"CATALOG_SECTION_TAB_CLASS_NAME"]))
32 $tabHandler =
new $arRes[
"CATALOG_SECTION_TAB_CLASS_NAME"];
35 throw new SystemException(
"TabHandler (".$arRes[
"CODE"].
") has wrong instance. (".__CLASS__.
"::".__METHOD__.
")");
37 self::$tabHandlers[$arRes[
"CODE"]] = $tabHandler;
41 if(!empty(self::$tabHandlers))
45 "TABSET" =>
"SALE_TRADING_PLATFORM",
46 "GetTabs" => array(
"\\Bitrix\\Sale\\TradingPlatform\\CatalogSectionTab",
"GetTabs"),
47 "ShowTab" => array(
"\\Bitrix\\Sale\\TradingPlatform\\CatalogSectionTab",
"ShowTab"),
48 "Action" => array(
"\\Bitrix\\Sale\\TradingPlatform\\CatalogSectionTab",
"Action"),
49 "Check" => array(
"\\Bitrix\\Sale\\TradingPlatform\\CatalogSectionTab",
"Check"),
56 public static function Action($arArgs)
62 foreach(self::$tabHandlers as $handler)
67 $result = $handler->action($arArgs);
71 $APPLICATION->ThrowException($e->getMessage());
80 public static function Check($arArgs)
86 foreach(self::$tabHandlers as $handler)
91 $result = $handler->check($arArgs);
93 catch(SystemException $e)
95 $APPLICATION->ThrowException($e->getMessage());
108 "DIV" =>
"edit_trading_platforms",
118 public static function ShowTab($divName, $arArgs, $bVarsFromForm)
120 if ($divName ==
"edit_trading_platforms")
124 foreach(self::$tabHandlers as $tradingPlatformCode => $handler)
127 $header =
'<tr class="heading" id="tr_'.$tradingPlatformCode.
'"><td colspan="2">'.$handler->name.
'</td></tr>';
128 $body = $handler->showTabSection($divName, $arArgs, $bVarsFromForm);
131 $body =
'<tr><td colspan="2">'.Loc::getMessage(
'SALE_TRADING_PLATFORMS_NOT_ACTIVE').
' ('.$siteId = $arArgs[
"IBLOCK"][
"LID"].
')</td></tr>';
133 $result .= $header.$body;
static loadMessages($file)
static getMessage($code, $replace=null, $language=null)