当前位置: 首页>>代码示例>>PHP>>正文


PHP CFileMan::GetMenuArray方法代码示例

本文整理汇总了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);
         }
     }
 }
开发者ID:Satariall,项目名称:izurit,代码行数:18,代码来源:step2.php

示例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));
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:file_new.php

示例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>
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:fileman_menu_edit.php

示例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]);
     }
 }
开发者ID:spas-viktor,项目名称:books,代码行数:59,代码来源:file_dialog.php

示例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, "");
         }
     }
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:22,代码来源:step1.php

示例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];
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:index_public.php

示例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);
         }
     }
 }
开发者ID:Satariall,项目名称:izurit,代码行数:25,代码来源:utils.php

示例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") {
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:fileman_newfolder.php


注:本文中的CFileMan::GetMenuArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。