コード例 #1
0
ファイル: sitemapforum.php プロジェクト: ASDAFF/open_bx
 protected static function checkParams($arMessage = array(), &$arTopic, &$arForum)
 {
     if (\Freetrix\Main\Loader::includeModule('forum')) {
         $arTopic = !empty($arTopic) ? $arTopic : \CForumTopic::GetByID($arMessage["TOPIC_ID"]);
         if (empty($arTopic)) {
             return false;
         }
         $arSitemaps = SitemapForumTable::getSitemapsByEntityId($arTopic["FORUM_ID"]);
         if (!empty($arSitemaps) && ($arForum = \CForumNew::GetByIDEx($arTopic["FORUM_ID"])) && $arForum) {
             $arForum["PATH2FORUM_MESSAGE"] = \CForumNew::GetSites($arTopic["FORUM_ID"]);
             $date = MakeTimeStamp($arTopic['LAST_POST_DATE']);
             $result = array();
             foreach ($arSitemaps as $arSitemap) {
                 $path = $arForum["PATH2FORUM_MESSAGE"][$arSitemap["SITE_ID"]];
                 if (!empty($path)) {
                     $arSitemap["fileName"] = str_replace("#FORUM_ID#", $arForum["ID"], $arSitemap['SITEMAP_FILE_FORUM']);
                     $arSitemap["url"] = \CForumNew::PreparePath2Message($path, array("FORUM_ID" => $arForum["ID"], "TOPIC_ID" => $arTopic["ID"], "TITLE_SEO" => $arTopic["TITLE_SEO"], "MESSAGE_ID" => "s", "SOCNET_GROUP_ID" => $arTopic["SOCNET_GROUP_ID"], "OWNER_ID" => $arTopic["OWNER_ID"], "PARAM1" => $arTopic["PARAM1"], "PARAM2" => $arTopic["PARAM2"]));
                     $arSitemap["date"] = $date;
                     $result[] = $arSitemap;
                 }
             }
             return empty($result) ? false : $result;
         }
     }
     return false;
 }
コード例 #2
0
ファイル: catalogstore.php プロジェクト: ASDAFF/open_bx
 public function resolve($entity)
 {
     if (intval($entity) > 0) {
         if (\Freetrix\Main\Loader::includeModule('catalog')) {
             return new CatalogStore(intval($entity));
         }
     }
     return parent::resolve($entity);
 }
コード例 #3
0
ファイル: iblock.php プロジェクト: ASDAFF/open_bx
 public function resolve($entity)
 {
     if ($entity === "catalog") {
         if (!$this->catalog && $this->loadFromDatabase()) {
             if (\Freetrix\Main\Loader::includeModule('catalog')) {
                 $this->catalog = new ElementCatalog(0);
             }
         }
         if ($this->catalog) {
             return $this->catalog;
         }
     }
     return parent::resolve($entity);
 }
コード例 #4
0
ファイル: authentication.php プロジェクト: ASDAFF/open_bx
 public static function checkSessionSecurity(CurrentUser $user)
 {
     $context = \Freetrix\Main\Application::getInstance()->getContext();
     if (!$context instanceof \Freetrix\Main\HttpContext) {
         throw new \Freetrix\Main\NotSupportedException();
     }
     $policy = $user->getPolicy();
     $currentTime = time();
     /** @var $request \Freetrix\Main\HttpRequest */
     $request = $context->getRequest();
     $remoteAddress = $request->getRemoteAddress();
     // IP address changed
     $destroySession = $_SESSION['SESS_IP'] && strlen($policy["SESSION_IP_MASK"]) > 0 && (ip2long($policy["SESSION_IP_MASK"]) & ip2long($_SESSION['SESS_IP'])) != (ip2long($policy["SESSION_IP_MASK"]) & ip2long($remoteAddress));
     // session timeout
     if (!$destroySession) {
         $destroySession = $policy["SESSION_TIMEOUT"] > 0 && $_SESSION['SESS_TIME'] > 0 && $currentTime - $policy["SESSION_TIMEOUT"] * 60 > $_SESSION['SESS_TIME'];
     }
     // session expander control
     if (!$destroySession) {
         $destroySession = $_SESSION["FX_SESSION_TERMINATE_TIME"] > 0 && $currentTime > $_SESSION["FX_SESSION_TERMINATE_TIME"];
     }
     if ($destroySession) {
         $_SESSION = array();
         @session_destroy();
         //session_destroy cleans user session handles in some PHP versions
         //see http://bugs.php.net/bug.php?id=32330 discussion
         if (Config\Option::get("security", "session", "N") === "Y" && Main\Loader::includeModule("security")) {
             \CSecuritySession::init();
         }
         session_id(md5(uniqid(rand(), true)));
         session_start();
     }
     $_SESSION['SESS_IP'] = $remoteAddress;
     $_SESSION['SESS_TIME'] = time();
     //session control from security module
     if (Config\Option::get("main", "use_session_id_ttl", "N") == "Y" && intval(Config\Option::get("main", "session_id_ttl", 0)) > 0 && !defined("FX_SESSION_ID_CHANGE")) {
         if (!array_key_exists('SESS_ID_TIME', $_SESSION)) {
             $_SESSION['SESS_ID_TIME'] = $_SESSION['SESS_TIME'];
         } elseif ($_SESSION['SESS_ID_TIME'] + intval(Config\Option::get("main", "session_id_ttl")) < $_SESSION['SESS_TIME']) {
             if (Config\Option::get("security", "session", "N") === "Y" && \Freetrix\Main\Loader::includeModule("security")) {
                 \CSecuritySession::updateSessID();
             } else {
                 session_regenerate_id();
             }
             $_SESSION['SESS_ID_TIME'] = $_SESSION['SESS_TIME'];
         }
     }
     return !$destroySession;
 }
コード例 #5
0
ファイル: element.php プロジェクト: ASDAFF/open_bx
		"DETAIL_PICTURE_MODE" => (isset($arParams['DETAIL_DETAIL_PICTURE_MODE']) ? $arParams['DETAIL_DETAIL_PICTURE_MODE'] : '')
	),
	$component
);?><?
if (0 < $ElementID)
{
	$arRecomData = array();
	$recomCacheID = array('IBLOCK_ID' => $arParams['IBLOCK_ID']);
	$obCache = new CPHPCache();
	if ($obCache->InitCache(36000, serialize($recomCacheID), "/catalog/recommended"))
	{
		$arRecomData = $obCache->GetVars();
	}
	elseif ($obCache->StartDataCache())
	{
		if (\Freetrix\Main\Loader::includeModule("catalog"))
		{
			$arSKU = CCatalogSKU::GetInfoByProductIBlock($arParams['IBLOCK_ID']);
			$arRecomData['OFFER_IBLOCK_ID'] = (!empty($arSKU) ? $arSKU['IBLOCK_ID'] : 0);
			$arRecomData['IBLOCK_LINK'] = '';
			$arRecomData['ALL_LINK'] = '';
			$rsProps = CIBlockProperty::GetList(
				array('SORT' => 'ASC', 'ID' => 'ASC'),
				array('IBLOCK_ID' => $arParams['IBLOCK_ID'], 'PROPERTY_TYPE' => 'E', 'ACTIVE' => 'Y')
			);
			$found = false;
			while ($arProp = $rsProps->Fetch())
			{
				if ($found)
				{
					break;
コード例 #6
0
ファイル: seo_sitemap.php プロジェクト: ASDAFF/open_bx
use Freetrix\Main;
use Freetrix\Main\Text\Converter;
use Freetrix\Main\Localization\Loc;
use Freetrix\Seo\SitemapTable;
use Freetrix\Seo\SitemapRuntime;
use Freetrix\Seo\SitemapRuntimeTable;

Loc::loadMessages(dirname(__FILE__).'/seo_sitemap.php');

if (!$USER->CanDoOperation('seo_tools'))
{
	$APPLICATION->AuthForm(Loc::getMessage("ACCESS_DENIED"));
}

if(!Main\Loader::includeModule('seo'))
{
	require($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/prolog_admin_after.php");
	ShowError(Loc::getMessage("SEO_ERROR_NO_MODULE"));
	require($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/epilog_admin.php");
}

$tableID = "tbl_sitemap";

$oSort = new CAdminSorting($tableID, "ID", "desc");
$adminList = new CAdminList($tableID, $oSort);

if(($arID = $adminList->GroupAction()))
{
	if($_REQUEST['action_target']=='selected')
	{
コード例 #7
0
ファイル: eventmanager.php プロジェクト: ASDAFF/open_bx
 protected function sendToEventHandler(array $handler, Event $event)
 {
     try {
         $result = true;
         $event->addDebugInfo($handler);
         if (isset($handler["TO_MODULE_ID"]) && !empty($handler["TO_MODULE_ID"]) && $handler["TO_MODULE_ID"] != 'main') {
             $result = Loader::includeModule($handler["TO_MODULE_ID"]);
         } elseif (isset($handler["TO_PATH"]) && !empty($handler["TO_PATH"])) {
             $path = ltrim($handler["TO_PATH"], "/");
             if (($path = Loader::getLocal($path)) !== false) {
                 $result = (include_once $path);
             }
         } elseif (isset($handler["FULL_PATH"]) && !empty($handler["FULL_PATH"]) && IO\File::isFileExists($handler["FULL_PATH"])) {
             $result = (include_once $handler["FULL_PATH"]);
         }
         $event->addDebugInfo($result);
         if (isset($handler["TO_METHOD_ARG"]) && is_array($handler["TO_METHOD_ARG"]) && !empty($handler["TO_METHOD_ARG"])) {
             $args = $handler["TO_METHOD_ARG"];
         } else {
             $args = array();
         }
         if ($handler["VERSION"] > 1) {
             $args[] = $event;
         } else {
             $args = array_merge($args, array_values($event->getParameters()));
         }
         $callback = null;
         if (isset($handler["CALLBACK"])) {
             $callback = $handler["CALLBACK"];
         } elseif (!empty($handler["TO_CLASS"]) && !empty($handler["TO_METHOD"]) && class_exists($handler["TO_CLASS"])) {
             $callback = array($handler["TO_CLASS"], $handler["TO_METHOD"]);
         }
         if ($callback != null) {
             $result = call_user_func_array($callback, $args);
         }
         if ($result != null && !$result instanceof EventResult) {
             $result = new EventResult(EventResult::UNDEFINED, $result, $handler["TO_MODULE_ID"]);
         }
         $event->addDebugInfo($result);
         if ($result != null) {
             $event->addResult($result);
         }
     } catch (\Exception $ex) {
         if ($event->isDebugOn()) {
             $event->addException($ex);
         } else {
             throw $ex;
         }
     }
 }
コード例 #8
0
ファイル: class.php プロジェクト: ASDAFF/open_bx
	function makeFilter($FILTER_NAME)
	{
		$bOffersIBlockExist = false;
		$arCatalog = false;
		$bCatalog = \Freetrix\Main\Loader::includeModule('catalog');
		if ($bCatalog)
		{
			$arCatalog = CCatalogSKU::GetInfoByIBlock($this->IBLOCK_ID);
			if (!empty($arCatalog) && is_array($arCatalog))
			{
				$bOffersIBlockExist = (
					$arCatalog['CATALOG_TYPE'] == CCatalogSKU::TYPE_PRODUCT
					|| $arCatalog['CATALOG_TYPE'] == CCatalogSKU::TYPE_FULL
				);
			}
		}

		$gFilter = $GLOBALS[$FILTER_NAME];

		$arFilter = array(
			"IBLOCK_ID" => $this->IBLOCK_ID,
			"IBLOCK_LID" => SITE_ID,
			"IBLOCK_ACTIVE" => "Y",
			"ACTIVE_DATE" => "Y",
			"ACTIVE" => "Y",
			"CHECK_PERMISSIONS" => "Y",
			"MIN_PERMISSION" => "R",
			"INCLUDE_SUBSECTIONS" => "Y", //($arParams["INCLUDE_SUBSECTIONS"] != 'N' ? 'Y' : 'N'),
			"SECTION_ID" => $this->SECTION_ID,
		);

		if ('Y' == $this->arParams['HIDE_NOT_AVAILABLE'])
			$arFilter['CATALOG_AVAILABLE'] = 'Y';

		if($bCatalog && $bOffersIBlockExist)
		{
			$arPriceFilter = array();
			foreach($gFilter as $key => $value)
			{
				if(preg_match('/^(>=|<=|><)CATALOG_PRICE_/', $key))
				{
					$arPriceFilter[$key] = $value;
					unset($gFilter[$key]);
				}
			}

			if(!empty($gFilter["OFFERS"]) && !empty($arPriceFilter))
			{
				$arSubFilter = array_merge($gFilter["OFFERS"], $arPriceFilter);
				$arSubFilter["IBLOCK_ID"] = $this->SKU_IBLOCK_ID;
				$arSubFilter["ACTIVE_DATE"] = "Y";
				$arSubFilter["ACTIVE"] = "Y";
				if ('Y' == $this->arParams['HIDE_NOT_AVAILABLE'])
					$arSubFilter['CATALOG_AVAILABLE'] = 'Y';
				$arFilter[] = array(
					"LOGIC" => "OR",
					array($arPriceFilter),
					"=ID" => CIBlockElement::SubQuery("PROPERTY_".$this->SKU_PROPERTY_ID, $arSubFilter),
				);
			}
			elseif(!empty($gFilter["OFFERS"]))
			{
				$arSubFilter = $gFilter["OFFERS"];
				$arSubFilter["IBLOCK_ID"] = $this->SKU_IBLOCK_ID;
				$arSubFilter["ACTIVE_DATE"] = "Y";
				$arSubFilter["ACTIVE"] = "Y";
				if ('Y' == $this->arParams['HIDE_NOT_AVAILABLE'])
					$arSubFilter['CATALOG_AVAILABLE'] = 'Y';
				$arFilter["=ID"] = CIBlockElement::SubQuery("PROPERTY_".$this->SKU_PROPERTY_ID, $arSubFilter);
			}
			elseif(!empty($arPriceFilter))
			{
				$arSubFilter = $arPriceFilter;
				$arSubFilter["IBLOCK_ID"] = $this->SKU_IBLOCK_ID;
				$arSubFilter["ACTIVE_DATE"] = "Y";
				$arSubFilter["ACTIVE"] = "Y";
				$arFilter[] = array(
					"LOGIC" => "OR",
					array($arPriceFilter),
					"=ID" => CIBlockElement::SubQuery("PROPERTY_".$this->SKU_PROPERTY_ID, $arSubFilter),
				);
			}

			unset($gFilter["OFFERS"]);
		}

		return array_merge($gFilter, $arFilter);
	}
コード例 #9
0
ファイル: comp_parameters.php プロジェクト: ASDAFF/open_bx
	public static function GetInheritedPropertyTemplateElementMenuItems($iblock_id, $action_function, $menuID, $inputID = "")
	{
		$result = array();
		$result["this"] = array(
			"TEXT" => GetMessage("IB_COMPLIB_POPUP_ELEMENT"),
			"MENU" => array(
				array(
					"TEXT" => GetMessage("IB_COMPLIB_POPUP_ELEMENT_NAME"),
					"ONCLICK" => "$action_function('{=this.Name}', '$menuID', '$inputID')",
				),
				array(
					"TEXT" => GetMessage("IB_COMPLIB_POPUP_ELEMENT_LOWER_NAME"),
					"ONCLICK" => "$action_function('{=lower this.Name}', '$menuID', '$inputID')",
				),
				array(
					"TEXT" => GetMessage("IB_COMPLIB_POPUP_ELEMENT_CODE"),
					"ONCLICK" => "$action_function('{=this.Code}', '$menuID', '$inputID')",
				),
				array(
					"TEXT" => GetMessage("IB_COMPLIB_POPUP_ELEMENT_PREVIEW_TEXT"),
					"ONCLICK" => "$action_function('{=this.PreviewText}', '$menuID', '$inputID')",
				),
				array(
					"TEXT" => GetMessage("IB_COMPLIB_POPUP_ELEMENT_DETAIL_TEXT"),
					"ONCLICK" => "$action_function('{=this.DetailText}', '$menuID', '$inputID')",
				),
			),
		);
		if ($iblock_id > 0)
		{
			$result["properties"] = array(
				"TEXT" => GetMessage("IB_COMPLIB_POPUP_PROPERTIES"),
				"MENU" => array(
				),
			);
			$rsProperty = CIBlockProperty::GetList(array(), array("IBLOCK_ID" => $iblock_id));
			while($property = $rsProperty->fetch())
			{
				if ($property["PROPERTY_TYPE"] != "F")
				{
					$result["properties"]["MENU"][] = array(
						"TEXT" => $property["NAME"],
						"ONCLICK" => "$action_function('{=this.property.".($property["CODE"]!=""? $property["CODE"]: $property["ID"])."}', '$menuID', '$inputID')",
					);
				}
			}
		}
		$result["parent"] = array(
			"TEXT" => GetMessage("IB_COMPLIB_POPUP_PARENT"),
			"MENU" => array(
				array(
					"TEXT" => GetMessage("IB_COMPLIB_POPUP_PARENT_NAME"),
					"ONCLICK" => "$action_function('{=parent.Name}', '$menuID', '$inputID')",
				),
				array(
					"TEXT" => GetMessage("IB_COMPLIB_POPUP_PARENT_CODE"),
					"ONCLICK" => "$action_function('{=parent.Code}', '$menuID', '$inputID')",
				),
				array(
					"TEXT" => GetMessage("IB_COMPLIB_POPUP_PARENT_TEXT"),
					"ONCLICK" => "$action_function('{=parent.PreviewText}', '$menuID', '$inputID')",
				),
			),
		);
		$result["iblock"] = array(
			"TEXT" => GetMessage("IB_COMPLIB_POPUP_IBLOCK"),
			"MENU" => array(
				array(
					"TEXT" => GetMessage("IB_COMPLIB_POPUP_IBLOCK_NAME"),
					"ONCLICK" => "$action_function('{=iblock.Name}', '$menuID', '$inputID')",
				),
				array(
					"TEXT" => GetMessage("IB_COMPLIB_POPUP_IBLOCK_CODE"),
					"ONCLICK" => "$action_function('{=iblock.Code}', '$menuID', '$inputID')",
				),
				array(
					"TEXT" => GetMessage("IB_COMPLIB_POPUP_IBLOCK_TEXT"),
					"ONCLICK" => "$action_function('{=iblock.PreviewText}', '$menuID', '$inputID')",
				),
			),
		);
		if (\Freetrix\Main\Loader::includeModule('catalog'))
		{
			$arCatalog = \CCatalogSKU::GetInfoByProductIBlock($iblock_id);
			if (is_array($arCatalog))
			{
				$result["sku_properties"] = array(
					"TEXT" => GetMessage("IB_COMPLIB_POPUP_SKU_PROPERTIES"),
					"MENU" => array(
					),
				);
				$rsProperty = CIBlockProperty::GetList(array(), array("IBLOCK_ID" => $arCatalog["IBLOCK_ID"]));
				while($property = $rsProperty->fetch())
				{
					if ($property["PROPERTY_TYPE"] != "F")
					{
						$result["sku_properties"]["MENU"][] = array(
							"TEXT" => $property["NAME"],
							"ONCLICK" => "$action_function('{=concat {=distinct this.catalog.sku.property.".($property["CODE"]!=""? $property["CODE"]: $property["ID"])." \", \"}}', '$menuID', '$inputID')",
						);
					}
				}
				$result["sku_price"] = array(
					"TEXT" => GetMessage("IB_COMPLIB_POPUP_SKU_PRICE"),
					"MENU" => array(),
				);
				$rsPrice = CCatalogGroup::GetListEx(array("SORT"=>"ASC"), array(), false, false, array("ID", "NAME"));
				while ($price = $rsPrice->Fetch())
				{
					if (preg_match("/^[a-zA-Z0-9]+\$/", $price["NAME"]))
					{
						$result["sku_price"]["MENU"][] = array(
							"TEXT" => GetMessage("IB_COMPLIB_POPUP_MIN_PRICE")." ".$price["NAME"],
							"ONCLICK" => "$action_function('{=min this.catalog.sku.price.".$price["NAME"]."}', '$menuID', '$inputID')",
						);
						$result["sku_price"]["MENU"][] = array(
							"TEXT" => GetMessage("IB_COMPLIB_POPUP_MAX_PRICE")." ".$price["NAME"],
							"ONCLICK" => "$action_function('{=max this.catalog.sku.price.".$price["NAME"]."}', '$menuID', '$inputID')",
						);
					}
					else
					{
						$result["sku_price"]["MENU"][] = array(
							"TEXT" => GetMessage("IB_COMPLIB_POPUP_MIN_PRICE")." ".$price["NAME"],
							"ONCLICK" => "$action_function('{=min this.catalog.sku.price.".$price["ID"]."}', '$menuID', '$inputID')",
						);
						$result["sku_price"]["MENU"][] = array(
							"TEXT" => GetMessage("IB_COMPLIB_POPUP_MAX_PRICE")." ".$price["NAME"],
							"ONCLICK" => "$action_function('{=max this.catalog.sku.price.".$price["ID"]."}', '$menuID', '$inputID')",
						);
					}
				}
			}

			$result["catalog"] = array(
				"TEXT" => GetMessage("IB_COMPLIB_POPUP_CATALOG"),
				"MENU" => array(
					array(
						"TEXT" => GetMessage("IB_COMPLIB_POPUP_CATALOG_WEIGHT"),
						"ONCLICK" => "$action_function('{=this.catalog.weight}', '$menuID', '$inputID')",
					),
					array(
						"TEXT" => GetMessage("IB_COMPLIB_POPUP_CATALOG_MEASURE"),
						"ONCLICK" => "$action_function('{=this.catalog.measure}', '$menuID', '$inputID')",
					),
				),
			);
			$result["price"] = array(
				"TEXT" => GetMessage("IB_COMPLIB_POPUP_PRICE"),
				"MENU" => array(),
			);
			$rsPrice = CCatalogGroup::GetListEx(array("SORT"=>"ASC"), array(), false, false, array("ID", "NAME"));
			while ($price = $rsPrice->Fetch())
			{
				if (preg_match("/^[a-zA-Z0-9]+\$/", $price["NAME"]))
					$result["price"]["MENU"][] = array(
						"TEXT" => $price["NAME"],
						"ONCLICK" => "$action_function('{=this.catalog.price.".$price["NAME"]."}', '$menuID', '$inputID')",
					);
				else
					$result["price"]["MENU"][] = array(
						"TEXT" => $price["NAME"],
						"ONCLICK" => "$action_function('{=this.catalog.price.".$price["ID"]."}', '$menuID', '$inputID')",
					);
			}
			$result["store"] = array(
				"TEXT" => GetMessage("IB_COMPLIB_POPUP_STORE"),
				"MENU" => array(),
			);
			$rsStore = CCatalogStore::GetList();
			while ($store = $rsStore->Fetch())
			{
				$result["store"]["MENU"][] = array(
					"TEXT" => $store["TITLE"],
					"ONCLICK" => "$action_function('{=catalog.store.".$store["ID"].".name}', '$menuID', '$inputID')",
				);
			}
		}
		$result["misc"] = array(
			"TEXT" => GetMessage("IB_COMPLIB_POPUP_MISC"),
			"MENU" => array(),
		);
		$result["misc"]["MENU"][] =  array(
			"TEXT" => GetMessage("IB_COMPLIB_POPUP_SECTIONS_PATH"),
			"ONCLICK" => "$action_function('{=concat this.sections.name \" / \"}', '$menuID', '$inputID')",
		);
		if (\Freetrix\Main\Loader::includeModule('catalog'))
		{
			$result["misc"]["MENU"][] =  array(
				"TEXT" => GetMessage("IB_COMPLIB_POPUP_STORE_LIST"),
				"ONCLICK" => "$action_function('{=concat catalog.store \", \"}', '$menuID', '$inputID')",
			);
		}
		$r = array();
		foreach($result as $category)
		{
			if (!empty($category) && !empty($category["MENU"]))
			{
				$r[] = $category;
			}
		}
		return $r;
	}
コード例 #10
0
ファイル: .parameters.php プロジェクト: ASDAFF/open_bx
<?
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();

if (!\Freetrix\Main\Loader::includeModule('iblock'))
	return;
$boolCatalog = \Freetrix\Main\Loader::includeModule('catalog');

$arSKU = false;
$boolSKU = false;
if ($boolCatalog && (isset($arCurrentValues['IBLOCK_ID']) && 0 < intval($arCurrentValues['IBLOCK_ID'])))
{
	$arSKU = CCatalogSKU::GetInfoByProductIBlock($arCurrentValues['IBLOCK_ID']);
	$boolSKU = !empty($arSKU) && is_array($arSKU);
}

$arThemes = array();
if (\Freetrix\Main\ModuleManager::isModuleInstalled('freetrix.eshop'))
{
	$arThemes['site'] = GetMessage('CPT_BC_TPL_THEME_SITE');
}

$arThemes['blue'] = GetMessage('CPT_BC_TPL_THEME_BLUE');
$arThemes['green'] = GetMessage('CPT_BC_TPL_THEME_GREEN');
$arThemes['red'] = GetMessage('CPT_BC_TPL_THEME_RED');
$arThemes['wood'] = GetMessage('CPT_BC_TPL_THEME_WOOD');
$arThemes['yellow'] = GetMessage('CPT_BC_TPL_THEME_YELLOW');
$arThemes['black'] = GetMessage('CP_BC_TPL_THEME_BLACK');

$arViewModeList = array(
	'LIST' => GetMessage('CPT_BC_SECTIONS_VIEW_MODE_LIST'),
	'LINE' => GetMessage('CPT_BC_SECTIONS_VIEW_MODE_LINE'),
コード例 #11
0
ファイル: component.php プロジェクト: ASDAFF/open_bx
<?
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();

/* Blog comments*/
if(!\Freetrix\Main\Loader::includeModule("iblock"))
{
	ShowError(GetMessage("IBLOCK_CSC_MODULE_NOT_INSTALLED"));
	return false;
}

if(!\Freetrix\Main\Loader::includeModule("blog"))
{
	ShowError(GetMessage("IBLOCK_CSC_MODULE_BLOG_NOT_INSTALLED"));
	return false;
}

$arResult["ELEMENT"] = array();
$arResult["ERRORS"] = array();

if(!isset($arParams["CACHE_TIME"]))
	$arParams["CACHE_TIME"] = 0;

$arParams["IBLOCK_ID"] = intval($arParams["IBLOCK_ID"]);
$arParams["ELEMENT_ID"] = intval($arParams["~ELEMENT_ID"]);

//Handle case when ELEMENT_CODE used
if($arParams["ELEMENT_ID"] <= 0)
	$arParams["ELEMENT_ID"] = CIBlockFindTools::GetElementID(
		$arParams["ELEMENT_ID"],
		$arParams["ELEMENT_CODE"],
		false,
コード例 #12
0
ファイル: component.php プロジェクト: ASDAFF/open_bx
$arDefaultVariableAliases = array();

$arComponentVariables = array(
	"SECTION_ID",
	"SECTION_CODE",
	"ELEMENT_ID",
	"ELEMENT_CODE",
	"action",
);

if($arParams["SEF_MODE"] == "Y")
{
	$arVariables = array();

	$engine = new CComponentEngine($this);
	if (\Freetrix\Main\Loader::includeModule('iblock'))
	{
		$engine->addGreedyPart("#SECTION_CODE_PATH#");
		$engine->setResolveCallback(array("CIBlockFindTools", "resolveComponentEngine"));
	}
	$arUrlTemplates = CComponentEngine::MakeComponentUrlTemplates($arDefaultUrlTemplates404, $arParams["SEF_URL_TEMPLATES"]);
	$arVariableAliases = CComponentEngine::MakeComponentVariableAliases($arDefaultVariableAliases404, $arParams["VARIABLE_ALIASES"]);

	$componentPage = $engine->guessComponentPath(
		$arParams["SEF_FOLDER"],
		$arUrlTemplates,
		$arVariables
	);

	if(!$componentPage && isset($_REQUEST["q"]))
		$componentPage = "search";
コード例 #13
0
ファイル: element.php プロジェクト: ASDAFF/open_bx
 public function setFields(array $fields)
 {
     parent::setFields($fields);
     if (is_array($this->fields) && $this->fields["IBLOCK_ID"] > 0) {
         if (isset($fields["PROPERTY_VALUES"]) && is_array($fields["PROPERTY_VALUES"])) {
             $this->property = new ElementProperty($this->id);
             $this->property->setIblockId($this->fields["IBLOCK_ID"]);
             $this->property->setFields($fields["PROPERTY_VALUES"]);
         }
         $this->iblock = new Iblock($fields["IBLOCK_ID"]);
         if (isset($fields["IBLOCK_SECTION_ID"]) && $fields["IBLOCK_SECTION_ID"] > 0) {
             $this->parent = new Section($fields["IBLOCK_SECTION_ID"]);
             $this->sections = new SectionPath($fields["IBLOCK_SECTION_ID"]);
         }
         if (\Freetrix\Main\Loader::includeModule('catalog')) {
             $this->catalog = new ElementCatalog($this->id);
         }
     }
 }
コード例 #14
0
ファイル: module.php プロジェクト: ASDAFF/open_bx
 /**
  * Makes module classes and function available. Returns true on success.
  *
  * @param string $module_name
  * @return bool
  */
 public static function IncludeModule($module_name)
 {
     return \Freetrix\Main\Loader::includeModule($module_name);
 }
コード例 #15
0
ファイル: .parameters.php プロジェクト: ASDAFF/open_bx
			"ADDITIONAL_VALUES" => "Y",
		);
	}
}



if(!IsModuleInstalled("forum"))
{
	unset($arComponentParameters["PARAMETERS"]["USE_REVIEW"]);
	unset($arComponentParameters["GROUPS"]["REVIEW_SETTINGS"]);
}
elseif($arCurrentValues["USE_REVIEW"]=="Y")
{
	$arForumList = array();
	if(\Freetrix\Main\Loader::includeModule("forum"))
	{
		$rsForum = CForumNew::GetList();
		while($arForum=$rsForum->Fetch())
			$arForumList[$arForum["ID"]]=$arForum["NAME"];
	}
	$arComponentParameters["PARAMETERS"]["MESSAGES_PER_PAGE"] = array(
		"PARENT" => "REVIEW_SETTINGS",
		"NAME" => GetMessage("F_MESSAGES_PER_PAGE"),
		"TYPE" => "STRING",
		"DEFAULT" => intVal(COption::GetOptionString("forum", "MESSAGES_PER_PAGE", "10"))
	);
	$arComponentParameters["PARAMETERS"]["USE_CAPTCHA"] = array(
		"PARENT" => "REVIEW_SETTINGS",
		"NAME" => GetMessage("F_USE_CAPTCHA"),
		"TYPE" => "CHECKBOX",
コード例 #16
0
ファイル: seo_google.php プロジェクト: ASDAFF/open_bx
<?
require($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/prolog_admin_before.php");
require_once($_SERVER["DOCUMENT_ROOT"].FX_ROOT."/modules/main/prolog.php");

if (!$USER->CanDoOperation('seo_tools'))
	die(GetMessage("ACCESS_DENIED"));

use Freetrix\Seo\Engine;
use Freetrix\Main\IO\Path;

IncludeModuleLangFile(__FILE__);
\Freetrix\Main\Loader::includeModule('seo');
\Freetrix\Main\Loader::includeModule('socialservices');

CUtil::JSPostUnescape();

$engine = new Engine\Google();

if(isset($_REQUEST['action']) && check_freetrix_sessid())
{
	$res = array();

	$arDomain = null;
	if(isset($_REQUEST['domain']) && strlen($_REQUEST['domain']) > 0)
	{
		$bFound = false;
		$arDomains = \CSeoUtils::getDomainsList();
		foreach($arDomains as $arDomain)
		{
			if($arDomain['DOMAIN'] == $_REQUEST['domain'] && rtrim($arDomain['SITE_DIR'], '/') == rtrim($_REQUEST['dir'], '/'))
			{
コード例 #17
0
ファイル: comp_pricetools.php プロジェクト: ASDAFF/open_bx
	public static function getTreePropertyValues(&$propList, &$propNeedValues)
	{
		$result = array();
		if (!empty($propList) && is_array($propList))
		{
			foreach ($propList as $oneProperty)
			{
				$values = array();
				$valuesExist = false;
				$pictMode = ('PICT' == $oneProperty['SHOW_MODE']);
				$needValuesExist = isset($propNeedValues[$oneProperty['ID']]) && !empty($propNeedValues[$oneProperty['ID']]);
				$filterValuesExist = ($needValuesExist && count($propNeedValues[$oneProperty['ID']]) <= 100);
				if ('L' == $oneProperty['PROPERTY_TYPE'])
				{
					$propEnums = CIBlockProperty::GetPropertyEnum(
						$oneProperty['ID'],
						array('SORT' => 'ASC', 'VALUE' => 'ASC')
					);
					while ($oneEnum = $propEnums->Fetch())
					{
						$oneEnum['ID'] = intval($oneEnum['ID']);
						if ($needValuesExist && !isset($propNeedValues[$oneProperty['ID']][$oneEnum['ID']]))
							continue;
						$values[$oneEnum['ID']] = array(
							'ID' => $oneEnum['ID'],
							'NAME' => $oneEnum['VALUE'],
							'SORT' => intval($oneEnum['SORT']),
							'PICT' => false
						);
						$valuesExist = true;
					}
					$values[0] = array(
						'ID' => 0,
						'SORT' => PHP_INT_MAX,
						'NA' => true,
						'NAME' => $oneProperty['DEFAULT_VALUES']['NAME'],
						'PICT' => $oneProperty['DEFAULT_VALUES']['PICT']
					);
				}
				elseif ('E' == $oneProperty['PROPERTY_TYPE'])
				{
					$selectFields = array('ID', 'NAME');
					if ($pictMode)
						$selectFields[] = 'PREVIEW_PICTURE';
					$filterValues = (
						$filterValuesExist
						? array('ID' => $propNeedValues[$oneProperty['ID']], 'IBLOCK_ID' => $oneProperty['LINK_IBLOCK_ID'], 'ACTIVE' => 'Y')
						: array('IBLOCK_ID' => $oneProperty['LINK_IBLOCK_ID'], 'ACTIVE' => 'Y')
					);
					$propEnums = CIBlockElement::GetList(
						array('SORT' => 'ASC', 'NAME' => 'ASC'),
						$filterValues,
						false,
						false,
						$selectFields
					);
					while ($oneEnum = $propEnums->Fetch())
					{
						if ($needValuesExist && !$filterValuesExist)
						{
							if (!isset($propNeedValues[$oneProperty['ID']][$oneEnum['ID']]))
								continue;
						}
						if ($pictMode)
						{
							$oneEnum['PICT'] = false;
							if (!empty($oneEnum['PREVIEW_PICTURE']))
							{
								$previewPict = CFile::GetFileArray($oneEnum['PREVIEW_PICTURE']);
								if (!empty($previewPict))
								{
									$oneEnum['PICT'] = array(
										'SRC' => $previewPict['SRC'],
										'WIDTH' => intval($previewPict['WIDTH']),
										'HEIGHT' => intval($previewPict['HEIGHT'])
									);
								}
							}
							if (empty($oneEnum['PICT']))
							{
								$oneEnum['PICT'] = $oneProperty['DEFAULT_VALUES']['PICT'];
							}
						}
						$oneEnum['ID'] = intval($oneEnum['ID']);
						$values[$oneEnum['ID']] = array(
							'ID' => $oneEnum['ID'],
							'NAME' => $oneEnum['NAME'],
							'SORT' => intval($oneEnum['SORT']),
							'PICT' => ($pictMode ? $oneEnum['PICT'] : false)
						);
						$valuesExist = true;
					}
					$values[0] = array(
						'ID' => 0,
						'SORT' => PHP_INT_MAX,
						'NA' => true,
						'NAME' => $oneProperty['DEFAULT_VALUES']['NAME'],
						'PICT' => ($pictMode ? $oneProperty['DEFAULT_VALUES']['PICT'] : false)
					);
				}
				else
				{
					if (null === self::$highLoadInclude)
						self::$highLoadInclude = \Freetrix\Main\Loader::includeModule('highloadblock');
					if (!self::$highLoadInclude)
						continue;
					$xmlMap = array();
					$sortExist = isset($oneProperty['USER_TYPE_SETTINGS']['FIELDS_MAP']['UF_SORT']);

					$directorySelect = array('ID', 'UF_NAME', 'UF_XML_ID');
					$directoryOrder = array();
					if ($pictMode)
					{
						$directorySelect[] = 'UF_FILE';
					}
					if ($sortExist)
					{
						$directorySelect[] = 'UF_SORT';
						$directoryOrder['UF_SORT'] = 'ASC';
					}
					$directoryOrder['UF_NAME'] = 'ASC';
					$sortValue = 100;

					$entityDataClass = $oneProperty['USER_TYPE_SETTINGS']['ENTITY']->getDataClass();
					$entityGetList = array(
						'select' => $directorySelect,
						'order' => $directoryOrder
					);
					if ($filterValuesExist)
						$entityGetList['filter'] = array('=UF_XML_ID' => $propNeedValues[$oneProperty['ID']]);
					$propEnums = $entityDataClass::getList($entityGetList);
					while ($oneEnum = $propEnums->fetch())
					{
						$oneEnum['ID'] = intval($oneEnum['ID']);
						$oneEnum['UF_SORT'] = ($sortExist ? intval($oneEnum['UF_SORT']) : $sortValue);
						$sortValue += 100;

						if ($pictMode)
						{
							if (!empty($oneEnum['UF_FILE']))
							{
								$arFile = CFile::GetFileArray($oneEnum['UF_FILE']);
								if (!empty($arFile))
								{
									$oneEnum['PICT'] = array(
										'SRC' => $arFile['SRC'],
										'WIDTH' => intval($arFile['WIDTH']),
										'HEIGHT' => intval($arFile['HEIGHT'])
									);
								}
							}
							if (empty($oneEnum['PICT']))
								$oneEnum['PICT'] = $oneProperty['DEFAULT_VALUES']['PICT'];
						}
						$values[$oneEnum['ID']] = array(
							'ID' => $oneEnum['ID'],
							'NAME' => $oneEnum['UF_NAME'],
							'SORT' => intval($oneEnum['UF_SORT']),
							'XML_ID' => $oneEnum['UF_XML_ID'],
							'PICT' => ($pictMode ? $oneEnum['PICT'] : false)
						);
						$valuesExist = true;
						$xmlMap[$oneEnum['UF_XML_ID']] = $oneEnum['ID'];
					}
					$values[0] = array(
						'ID' => 0,
						'SORT' => PHP_INT_MAX,
						'NA' => true,
						'NAME' => $oneProperty['DEFAULT_VALUES']['NAME'],
						'XML_ID' => '',
						'PICT' => ($pictMode ? $oneProperty['DEFAULT_VALUES']['PICT'] : false)
					);
					if ($valuesExist)
						$oneProperty['XML_MAP'] = $xmlMap;
				}
				if (!$valuesExist)
					continue;
				$oneProperty['VALUES'] = $values;
				$oneProperty['VALUES_COUNT'] = count($values);

				$result[$oneProperty['CODE']] = $oneProperty;
			}
		}
		$propList = $result;
		unset($arFilterProp);
	}
コード例 #18
0
ファイル: seo_sitemap_run.php プロジェクト: ASDAFF/open_bx
	elseif($v < $arValueSteps['forum_index'])
	{
		$NS['time_start'] = microtime(true);

		$arForumList = array();
		if(!empty($arSitemap['SETTINGS']['FORUM_ACTIVE']))
		{
			foreach ($arSitemap['SETTINGS']['FORUM_ACTIVE'] as $forumId => $active)
			{
				if ($active == "Y")
				{
					$arForumList[$forumId] = "Y";
				}
			}
		}
		if(count($arForumList) > 0 && Main\Loader::includeModule('forum'))
		{
			$arForums = array();
			$db_res = CForumNew::GetListEx(
				array(),
				array(
					'@ID' => array_keys($arForumList),
					"ACTIVE" => "Y",
					"SITE_ID" => $arSitemap['SITE_ID'],
					"!TOPICS" => 0
				)
			);
			while ($res = $db_res->Fetch())
			{
				$arForums[$res['ID']] = $res;
			}
コード例 #19
0
ファイル: component.php プロジェクト: ASDAFF/open_bx
	$arResult["SECTIONS_COUNT"] = count($arResult["SECTIONS"]);

	$this->SetResultCacheKeys(array(
		"SECTIONS_COUNT",
		"SECTION",
	));

	$this->IncludeComponentTemplate();
}

if($arResult["SECTIONS_COUNT"] > 0 || isset($arResult["SECTION"]))
{
	if(
		$USER->IsAuthorized()
		&& $APPLICATION->GetShowIncludeAreas()
		&& \Freetrix\Main\Loader::includeModule("iblock")
	)
	{
		$UrlDeleteSectionButton = "";
		if(isset($arResult["SECTION"]) && $arResult["SECTION"]['IBLOCK_SECTION_ID'] > 0)
		{
			$rsSection = CIBlockSection::GetList(
				array(),
				array("=ID" => $arResult["SECTION"]['IBLOCK_SECTION_ID']),
				false,
				array("SECTION_PAGE_URL")
			);
			$rsSection->SetUrlTemplates("", $arParams["SECTION_URL"]);
			$arSection = $rsSection->GetNext();
			$UrlDeleteSectionButton = $arSection["SECTION_PAGE_URL"];
		}
コード例 #20
0
ファイル: seo_sitemap_edit.php プロジェクト: ASDAFF/open_bx
Loc::loadMessages(dirname(__FILE__).'/seo_sitemap.php');

if (!$USER->CanDoOperation('seo_tools'))
{
	$APPLICATION->AuthForm(Loc::getMessage("ACCESS_DENIED"));
}

if(!Main\Loader::includeModule('seo'))
{
	require($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/prolog_admin_after.php");
	ShowError(Loc::getMessage("SEO_ERROR_NO_MODULE"));
	require($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/epilog_admin.php");
}

$bIBlock = Main\Loader::includeModule('iblock');
$bForum = Main\Loader::includeModule('forum');

$ID = intval($_REQUEST['ID']);
$SITE_ID = trim($_REQUEST['site_id']);

$bDefaultHttps = false;

if($ID > 0)
{
	$dbSitemap = SitemapTable::getById($ID);
	$arSitemap = $dbSitemap->fetch();

	if(!is_array($arSitemap))
	{
		require($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/prolog_admin_after.php");
		ShowError(Loc::getMessage("SEO_ERROR_SITEMAP_NOT_FOUND"));
コード例 #21
0
ファイル: .parameters.php プロジェクト: ASDAFF/open_bx
<?if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();

if(!\Freetrix\Main\Loader::includeModule("iblock"))
	return;

if(!\Freetrix\Main\Loader::includeModule("highloadblock"))
	return;

$arIBlockType = CIBlockParameters::GetIBlockTypes();

$arIBlock = array();
$rsIBlock = CIBlock::GetList(array("sort" => "asc"), array("TYPE" => $arCurrentValues["IBLOCK_TYPE"], "ACTIVE"=>"Y"));

while($arr = $rsIBlock->Fetch())
	$arIBlock[$arr["ID"]] = "[".$arr["ID"]."] ".$arr["NAME"];

$arProps = array();

$rsProps = CIBlockProperty::GetList(
	array("SORT" => "ASC", "ID" => "ASC"),
	array(
		"IBLOCK_ID" => $arCurrentValues["IBLOCK_ID"],
		"ACTIVE" => "Y",
		"PROPERTY_TYPE" => "S"
	)
);

while ($arProp = $rsProps->Fetch())
{
	if ($arProp['USER_TYPE'] !== 'directory')
		continue;
コード例 #22
0
ファイル: seo_utils.php プロジェクト: ASDAFF/open_bx
	public static function getDirStructure($bLogical, $site, $path)
	{
		global $USER;

		$arDirContent = array();
		if($USER->CanDoFileOperation('fm_view_listing', array($site, $path)))
		{
			\Freetrix\Main\Loader::includeModule('fileman');

			$arDirs = array();
			$arFiles = array();

			\CFileMan::GetDirList(array($site, $path), $arDirs, $arFiles, array(), array("NAME" => "asc"), "DF", $bLogical, true);

			$arDirContent_t = array_merge($arDirs, $arFiles);
			for($i=0,$l = count($arDirContent_t);$i<$l;$i++)
			{
				$file = $arDirContent_t[$i];
				$arPath = array($site, $file['ABS_PATH']);
				if(
					($file["TYPE"]=="F" && !$USER->CanDoFileOperation('fm_view_file',$arPath))
					|| ($file["TYPE"]=="D" && !$USER->CanDoFileOperation('fm_view_listing',$arPath))
					|| ($file["TYPE"]=="F" && $file["NAME"]==".section.php")
				)
				{
					continue;
				}

				$f = $file['TYPE'] == 'F'
					? new \Freetrix\Main\IO\File($file['PATH'], $site)
					: new \Freetrix\Main\IO\Directory($file['PATH'], $site);

				$p = $f->getName();

				if($f->isSystem()
					|| $file['TYPE'] == 'F' && in_array($p, array("urlrewrite.php"))
					|| $file['TYPE'] == 'D' && preg_match("/\/(freetrix|".\COption::getOptionString("main", "upload_dir", "upload").")\//", "/".$p."/")
				)
				{
					continue;
				}

				$arFileData = array(
					'NAME' => $bLogical ? $file['LOGIC_NAME'] : $p,
					'FILE' => $p,
					'TYPE' => $file['TYPE'],
					'DATA' => $file,
				);

				if(strlen($arFileData['NAME']) <= 0)
					$arFileData['NAME'] = GetMessage('SEO_DIR_LOGICAL_NO_NAME');

				$arDirContent[] = $arFileData;
			}
			unset($arDirContent_t);
		}

		return $arDirContent;
	}
コード例 #23
0
Loc::loadMessages(dirname(__FILE__).'/../../main/Helpers.php');
Loc::loadMessages(dirname(__FILE__).'/seo_search.php');

if (!$USER->CanDoOperation('seo_tools'))
{
	$APPLICATION->AuthForm(Loc::getMessage("ACCESS_DENIED"));
}

if(!Main\Loader::includeModule('seo'))
{
	require($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/prolog_admin_after.php");
	ShowError(Loc::getMessage("SEO_ERROR_NO_MODULE"));
	require($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/epilog_admin.php");
}

if(!Main\Loader::includeModule('socialservices'))
{
	require($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/prolog_admin_after.php");
	ShowError(Loc::getMessage("SEO_ERROR_NO_MODULE_SOCSERV"));
	require($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/epilog_admin.php");
}

$domain = $_REQUEST['domain'];

if($domain)
{
	$bFound = false;
	$arDomains = \CSeoUtils::getDomainsList();
	foreach ($arDomains as $arDomain)
	{
		if($domain == $arDomain['DOMAIN'])
コード例 #24
0
ファイル: section.php プロジェクト: ASDAFF/open_bx
 public function setFields(array $fields)
 {
     parent::setFields($fields);
     if (is_array($this->fields) && $this->fields["IBLOCK_ID"] > 0) {
         $properties = array();
         foreach ($this->fields as $id => $value) {
             if (substr($id, 0, 3) === "UF_") {
                 $properties[$id] = $value;
             }
         }
         $this->property = new SectionProperty($this->id);
         $this->property->setIblockId($this->fields["IBLOCK_ID"]);
         $this->property->setFields($properties);
         $this->iblock = new Iblock($fields["IBLOCK_ID"]);
         if (isset($fields["IBLOCK_SECTION_ID"]) && $fields["IBLOCK_SECTION_ID"] > 0) {
             $this->parent = new Section($fields["IBLOCK_SECTION_ID"]);
             $this->sections = new SectionPath($fields["IBLOCK_SECTION_ID"]);
         }
         if (\Freetrix\Main\Loader::includeModule('catalog')) {
             $this->catalog = new ElementCatalog($this->id);
         }
     }
 }