Esempio n. 1
0
	public static function ShowPanel($IBLOCK_ID=0, $ELEMENT_ID=0, $SECTION_ID="", $type="news", $bGetIcons=false, $componentName="", $arLabels=array())
	{
		/** @global CMain $APPLICATION */
		global $APPLICATION;
		/** @global CUser $USER */
		global $USER;

		if (($USER->IsAuthorized() || $APPLICATION->ShowPanel===true) && $APPLICATION->ShowPanel!==false)
		{
			if (CModule::IncludeModule("iblock") && strlen($type) > 0)
			{
				$arButtons = CIBlock::GetPanelButtons($IBLOCK_ID, $ELEMENT_ID, $SECTION_ID, array(
					"LABELS" => $arLabels,
				));

				$mode = $APPLICATION->GetPublicShowMode();

				if($bGetIcons)
				{
					return CIBlock::GetComponentMenu($mode, $arButtons);
				}
				else
				{
					CIBlock::AddPanelButtons($mode, $componentName, $arButtons);
				}
			}
		}
		return null;
	}
Esempio n. 2
0
 function ShowPanel($IBLOCK_ID = 0, $ELEMENT_ID = 0, $SECTION_ID = "", $type = "news", $bGetIcons = false, $componentName = "", $arLabels = array())
 {
     global $APPLICATION, $USER;
     if (!(($USER->IsAuthorized() || $APPLICATION->ShowPanel === true) && $APPLICATION->ShowPanel !== false)) {
         return;
     }
     if (!CModule::IncludeModule("iblock") || !strlen($type)) {
         return;
     }
     $arButtons = CIBlock::GetPanelButtons($IBLOCK_ID, $ELEMENT_ID, $SECTION_ID, array("LABELS" => $arLabels));
     $mode = $APPLICATION->GetPublicShowMode();
     if ($bGetIcons) {
         return CIBlock::GetComponentMenu($mode, $arButtons);
     } else {
         CIBlock::AddPanelButtons($mode, $componentName, $arButtons);
     }
 }
Esempio n. 3
0
			//detail url
			$arResult['SECTIONS'][$arRes['ID']]['SECTION_PAGE_URL'] = htmlspecialcharsbx(str_replace(
				array("#SERVER_NAME#", "#SITE_DIR#", "#IBLOCK_ID#", "#SECTION_ID#", "#ELEMENT_ID#"),
				array(SITE_SERVER_NAME, SITE_DIR, $arParams["IBLOCK_ID"], $arRes["ID"], ""),
				(strlen($arParams["SECTION_URL"])>0?$arParams["SECTION_URL"]:$arRes["SECTION_PAGE_URL"])
			));
		}

		//no sections to display
		if(count($arResult['SECTIONS'])<=0)
		{
			$this->AbortResultCache();
			@define("ERROR_404", "Y");
			return false;
		}

	$this->SetResultCacheKeys(array(
	));
	//include template
	$this->IncludeComponentTemplate();
}

//add buttons common
if($USER->IsAuthorized())
{
	$arButtons = CIBlock::GetPanelButtons($arParams['IBLOCK_ID'], 0, $arParams['SECTION_ID']);
	if($APPLICATION->GetShowIncludeAreas())
		$this->AddIncludeAreaIcons(CIBlock::GetComponentMenu("configure", $arButtons));
	CIBlock::AddPanelButtons($APPLICATION->GetPublicShowMode(), $this->GetName(), array("intranet"=>$arButtons["intranet"]));
}
?>