本文整理汇总了PHP中CFileMan::GetMenuArray方法的典型用法代码示例。如果您正苦于以下问题:PHP CFileMan::GetMenuArray方法的具体用法?PHP CFileMan::GetMenuArray怎么用?PHP CFileMan::GetMenuArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileMan
的用法示例。
在下文中一共展示了CFileMan::GetMenuArray方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DEMO_Sale_AddMenuItem
function DEMO_Sale_AddMenuItem($menuFile, $menuItem)
{
if (CModule::IncludeModule('fileman')) {
$arResult = CFileMan::GetMenuArray($_SERVER["DOCUMENT_ROOT"] . $menuFile);
$arMenuItems = $arResult["aMenuLinks"];
$menuTemplate = $arResult["sMenuTemplate"];
$bFound = false;
foreach ($arMenuItems as $item) {
if ($item[1] == $menuItem[1]) {
$bFound = true;
}
}
if (!$bFound) {
$arMenuItems[] = $menuItem;
CFileMan::SaveMenu(array($arParams["site_id"], $menuFile), $arMenuItems, $menuTemplate);
}
}
}
示例2: array
$arGroups = $arEditGroups;
}
//write permissions
if ($arGroups !== false) {
$arPermission = array("*" => "D");
foreach ($arGroups as $group) {
$arPermission[$group] = 'X';
}
$APPLICATION->SetFileAccessPermission(array($site, rtrim($path, "/") . "/" . $fileName), $arPermission);
}
}
$relativePath = rtrim($path, "/") . "/" . $fileName . ($createNewFolder ? "/" : "");
//Save menu
if ($addToMenu && array_key_exists($menuType, $arMenu) && CModule::IncludeModule("fileman")) {
$menuFile = $arMenu[$menuType]["ACTUAL_FILE"];
$arResult = CFileMan::GetMenuArray($documentRoot . $menuFile);
$arMenuItems = $arResult["aMenuLinks"];
$menuTemplate = $arResult["sMenuTemplate"];
if ($menuItemPosition > count($arMenuItems)) {
$menuItemPosition = 0;
}
//move to the right all items greater current item
for ($i = count($arMenuItems) - 1; $i >= $menuItemPosition; $i--) {
$arMenuItems[$i + 1] = $arMenuItems[$i];
}
$arMenuItems[$menuItemPosition] = array($menuName, $relativePath, array(), array(), "");
CFileMan::SaveMenu(array($site, $menuFile), $arMenuItems, $menuTemplate);
$arUndoParams['arContent']['menu'] = array('menuFile' => $menuFile, 'menuName' => $menuName, 'menuPath' => $relativePath);
if (COption::GetOptionString($module_id, "log_page", "Y") == "Y") {
$mt = COption::GetOptionString("fileman", "menutypes", $default_value, $site);
$mt = unserialize(str_replace("\\", "", $mt));
示例3: bitrix_sessid_post
echo bitrix_sessid_post();
?>
<?php
$aTabs = array(array("DIV" => "edit1", "TAB" => GetMessage("FILEMAN_TAB1"), "ICON" => "fileman", "TITLE" => GetMessage("FILEMAN_TAB1_ALT")));
$tabControl = new CAdminTabControl("tabControl", $aTabs);
$tabControl->Begin();
?>
<?php
$tabControl->BeginNextTab();
?>
<?php
if ($bEdit && strlen($strWarning) <= 0) {
$res = CFileMan::GetMenuArray($abs_path);
$aMenuLinksTmp = $res["aMenuLinks"];
$sMenuTemplateTmp = $res["sMenuTemplate"];
}
if (!is_array($aMenuLinksTmp)) {
$aMenuLinksTmp = array();
}
?>
<tr>
<td><?php
echo GetMessage("FILEMAN_MENU_EDIT_TYPE");
?>
</td>
<td>
<script>
示例4: GetMenuTypes
function GetMenuTypes($site, $path, $bEchoResult = false)
{
global $USER, $APPLICATION;
if (!CModule::IncludeModule("fileman")) {
return $APPLICATION->ThrowException(GetMessage("BX_FD_NO_FILEMAN"));
}
$path = Rel2Abs("/", $APPLICATION->UnJSEscape($path));
$path = CFileMan::SecurePathVar($path);
$path = rtrim($path, " /\\");
$armt = GetMenuTypes($site);
$arAllItems = array();
$arMenuTypes = array();
$strSelected = "";
$DOC_ROOT = CSite::GetSiteDocRoot($site);
foreach ($armt as $key => $title) {
$menuname = $path . "/." . $key . ".menu.php";
if (!$USER->CanDoFileOperation('fm_view_file', array($site, $menuname))) {
continue;
}
$arItems = array();
$res = CFileMan::GetMenuArray($DOC_ROOT . $menuname);
$aMenuLinksTmp = $res["aMenuLinks"];
$itemcnt = 0;
for ($j = 0; $j < count($aMenuLinksTmp); $j++) {
$aMenuLinksItem = $aMenuLinksTmp[$j];
$arItems[] = htmlspecialcharsbx($aMenuLinksItem[0]);
}
$arAllItems[$key] = $arItems;
if ($strSelected == "") {
$strSelected = $key;
}
$arMenuTypes[] = array('key' => $key, 'title' => $title . " [" . $key . "]");
}
$arTypes = array_keys($arAllItems);
$strTypes = "";
$strItems = "";
for ($i = 0; $i < count($arTypes); $i++) {
if ($i > 0) {
$strTypes .= ",";
$strItems .= ",";
}
$strTypes .= "'" . CUtil::JSEscape($arTypes[$i]) . "'";
$arItems = $arAllItems[$arTypes[$i]];
$strItems .= "[";
for ($j = 0; $j < count($arItems); $j++) {
if ($j > 0) {
$strItems .= ",";
}
$strItems .= "'" . CUtil::JSEscape($arItems[$j]) . "'";
}
$strItems .= "]";
}
$scriptRes = "\n" . 'arFDMenuTypes["' . CUtil::JSEscape($path) . '"] = {types: [' . $strTypes . '], items: [' . $strItems . ']};' . "\n";
if ($bEchoResult) {
echo $scriptRes;
} else {
return array($arMenuTypes, $scriptRes, $arAllItems[$strSelected]);
}
}
示例5: AddMenuItem
private function AddMenuItem()
{
//Add menu Item
$MenuFolderPath = $this->IO->CombinePath("/", '/services/');
$MenuFilePath = $this->IO->CombinePath($MenuFolderPath, ".left.menu.php");
$AbsMenuFilePath = $this->IO->CombinePath($this->DOCUMENT_ROOT, $MenuFilePath);
if ($this->IO->FileExists($AbsMenuFilePath)) {
$MenuResource = CFileMan::GetMenuArray($AbsMenuFilePath);
$arMenuItems = $MenuResource["aMenuLinks"];
$bAddMenuItem = true;
foreach ($arMenuItems as $MenuItem) {
if (in_array($MenuItem[1], array($this->PublicDir, $this->PublicDir . "index.php"))) {
$bAddMenuItem = false;
break;
}
}
if ($bAddMenuItem) {
$arMenuItems[] = array(GetMessage("IDEA_PUBLIC_FILE_MENU_TITLE"), $this->PublicDir, array(), array(), "CBXFeatures::IsFeatureEnabled('Idea')");
CFileMan::SaveMenu(array($this->SITE_ID, $MenuFilePath), $arMenuItems, "");
}
}
}
示例6: array
$arXMLID = array("meeting_rooms_" . $site => '#RESERVE_MEETING_IBLOCK_ID#', "video-meeting_" . $site => '#RESERVE_VMEETING_IBLOCK_ID#');
$rsIBlock = CIBlock::GetList(array(), array("XML_ID" => array_keys($arXMLID), "TYPE" => "events"));
while ($arIBlock = $rsIBlock->Fetch()) {
$arReplace[$arXMLID[$arIBlock['XML_ID']]] = $arIBlock['ID'];
}
}
if ($io->CreateDirectory($absPath)) {
$c = str_replace(array_keys($arReplace), array_values($arReplace), file_get_contents(dirname(__FILE__) . "/public/index.php"));
if ($f = $io->GetFile($absFile)) {
$f->PutContents($c);
CUrlRewriter::Add(array('CONDITION' => '#^' . $meeting_folder . '/#', 'RULE' => '', 'ID' => 'bitrix:meetings', 'PATH' => $meeting_folder . '/' . $fileName));
}
if (CModule::IncludeModule('fileman')) {
$absMenuFile = $absMenuPath . '/.left.menu.php';
$menuFile = $menuFolder . '/.left.menu.php';
$arResult = CFileMan::GetMenuArray($absMenuFile);
$arMenuItems = $arResult["aMenuLinks"];
$menuTemplate = $arResult["sMenuTemplate"];
$menuItemPosition = 1;
foreach ($arMenuItems as $item) {
if ($item[0] == GetMessage('MEETING_MODULE_NAME') || $item[1] == $meeting_folder . '/') {
$menuItemPosition = -1;
break;
}
}
if ($menuItemPosition > 0) {
if ($menuItemPosition > count($arMenuItems)) {
$menuItemPosition = 0;
}
for ($i = count($arMenuItems) - 1; $i >= $menuItemPosition; $i--) {
$arMenuItems[$i + 1] = $arMenuItems[$i];
示例7: AddMenuItem
function AddMenuItem($menuFile, $menuItem, $siteID, $pos = -1)
{
if (CModule::IncludeModule('fileman')) {
$arResult = CFileMan::GetMenuArray($_SERVER["DOCUMENT_ROOT"] . $menuFile);
$arMenuItems = $arResult["aMenuLinks"];
$menuTemplate = $arResult["sMenuTemplate"];
$bFound = false;
foreach ($arMenuItems as $item) {
if ($item[1] == $menuItem[1]) {
$bFound = true;
}
}
if (!$bFound) {
if ($pos < 0 || $pos >= count($arMenuItems)) {
$arMenuItems[] = $menuItem;
} else {
for ($i = count($arMenuItems); $i > $pos; $i--) {
$arMenuItems[$i] = $arMenuItems[$i - 1];
}
$arMenuItems[$pos] = $menuItem;
}
CFileMan::SaveMenu(array($siteID, $menuFile), $arMenuItems, $menuTemplate);
}
}
}
示例8: GetMessage
if (strlen($foldername) <= 0) {
$strWarning = GetMessage("FILEMAN_NEWFOLDER_ENTER_NAME");
} elseif (($mess = CFileMan::CheckFileName($foldername)) !== true) {
$strWarning = $mess;
} else {
$pathto = $io->CombinePath("/", $path, $foldername);
if ($io->FileExists($DOC_ROOT . $pathto) || $io->DirectoryExists($DOC_ROOT . $pathto)) {
$strWarning = GetMessage("FILEMAN_NEWFOLDER_EXISTS");
} else {
$strWarning = CFileMan::CreateDir(array($site, $pathto));
if (strlen($strWarning) <= 0) {
if ($USER->CanDoFileOperation('fm_add_to_menu', $arPath) && $USER->CanDoOperation('fileman_add_element_to_menu') && $mkmenu == "Y" && $bMenuTypeExists) {
$arParsedPathTmp = CFileMan::ParsePath(array($site, $pathto), true, false, "", $logical == "Y");
$menu_path = $arParsedPathTmp["PREV"] . "/." . $menutype . ".menu.php";
if ($USER->CanDoFileOperation('fm_view_file', array($site, $menu_path))) {
$res = CFileMan::GetMenuArray($DOC_ROOT . $menu_path);
$aMenuLinksTmp = $res["aMenuLinks"];
$sMenuTemplateTmp = $res["sMenuTemplate"];
$aMenuLinksTmp[] = array($menuname, $arParsedPathTmp["PREV"] . "/" . $arParsedPathTmp["LAST"] . "/", array(), array(), "");
CFileMan::SaveMenu(array($site, $menu_path), $aMenuLinksTmp, $sMenuTemplateTmp);
if (COption::GetOptionString($module_id, "log_menu", "Y") == "Y") {
$mt = COption::GetOptionString("fileman", "menutypes", $default_value, $site);
$mt = unserialize(str_replace("\\", "", $mt));
$res_log['menu_name'] = $mt[$menutype];
$res_log['path'] = substr($path, 1);
CEventLog::Log("content", "MENU_EDIT", "fileman", "", serialize($res_log));
}
}
}
if (strlen($sectionname) > 0) {
if (COption::GetOptionString($module_id, "log_page", "Y") == "Y") {