コード例 #1
0
 function OnInit($args)
 {
     $result = array();
     $res = \Bitrix\Sale\TradingPlatformTable::getList(array('select' => array("ID", "CODE", "CATALOG_SECTION_TAB_CLASS_NAME"), 'filter' => array('=ACTIVE' => 'Y')));
     while ($arRes = $res->fetch()) {
         if (strlen($arRes["CATALOG_SECTION_TAB_CLASS_NAME"]) > 0 && class_exists($arRes["CATALOG_SECTION_TAB_CLASS_NAME"])) {
             $tabHandler = new $arRes["CATALOG_SECTION_TAB_CLASS_NAME"]();
             if (!$tabHandler instanceof TabHandler) {
                 throw new SystemException("TabHandler (" . $arRes["CODE"] . ") has wrong instance. (" . __CLASS__ . "::" . __METHOD__ . ")");
             }
             self::$tabHandlers[$arRes["CODE"]] = $tabHandler;
         }
     }
     if (!empty(self::$tabHandlers)) {
         //todo: iblock filter
         $result = array("TABSET" => "SALE_TRADING_PLATFORM", "GetTabs" => array("\\Bitrix\\Sale\\TradingPlatform\\CatalogSectionTab", "GetTabs"), "ShowTab" => array("\\Bitrix\\Sale\\TradingPlatform\\CatalogSectionTab", "ShowTab"), "Action" => array("\\Bitrix\\Sale\\TradingPlatform\\CatalogSectionTab", "Action"), "Check" => array("\\Bitrix\\Sale\\TradingPlatform\\CatalogSectionTab", "Check"));
     }
     return $result;
 }
コード例 #2
0
ファイル: platform.php プロジェクト: Satariall/izurit
 /**
  * Shows is another platforms using the iblock section edit page, "trading platforms" tab.
  * @return bool
  */
 protected function isSomebodyUseCatalogSectionsTab()
 {
     $result = false;
     $res = TradingPlatformTable::getList(array('select' => array("ID", "CATALOG_SECTION_TAB_CLASS_NAME"), 'filter' => array('!=CODE' => $this->code, '=ACTIVE' => 'Y')));
     while ($arRes = $res->fetch()) {
         if (strlen($arRes["CATALOG_SECTIONS_TAB_CLASS_NAME"]) > 0) {
             $result = true;
             break;
         }
     }
     return $result;
 }