Esempio n. 1
0
            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));
                $res_log['menu_name'] = $mt[$menuType];
                $res_log['path'] = substr(dirname($arUndoParams['arContent']['path']), 1);
                CEventLog::Log("content", "MENU_EDIT", "main", "", serialize($res_log));
            }
        }
        $ID = CUndo::Add($arUndoParams);
        CUndo::ShowUndoMessage($ID);
        $pathToEdit = $relativePath . ($createNewFolder ? "index.php" : "");
        if (!$USER->CanDoFileOperation("fm_edit_existent_file", array($site, $pathToEdit))) {
            $canEditNewPage = false;
        }
        //Open edit dialog
        if ($editAfterSave && $canEditNewPage) {
            ?>
<script>
	<?php 
            echo $popupWindow->jsPopup;
            ?>
.Close();


	if (null != window.structReload && BX.type.isFunction(window.structReload))
Esempio n. 2
0
                }
            }
            //check template name
            $sTemplateName = "";
            foreach ($arComponentTemplates as $templ) {
                if ($templ["NAME"] == $_POST["NEW_COMPONENT_TEMPLATE"]) {
                    $sTemplateName = $templ["NAME"];
                    break;
                }
            }
            $code = ($arComponent["DATA"]["VARIABLE"] ? $arComponent["DATA"]["VARIABLE"] . "=" : "") . "\$APPLICATION->IncludeComponent(\"" . $arComponent["DATA"]["COMPONENT_NAME"] . "\", " . "\"" . $sTemplateName . "\", " . "array(\n\t" . PHPParser::ReturnPHPStr2($aPostValues) . "\n\t)" . ",\n\t" . (strlen($arComponent["DATA"]["PARENT_COMP"]) > 0 ? $arComponent["DATA"]["PARENT_COMP"] : "false") . (!empty($arComponent["DATA"]["FUNCTION_PARAMS"]) ? ",\n\t" . "array(\n\t" . PHPParser::ReturnPHPStr2($arComponent["DATA"]["FUNCTION_PARAMS"]) . "\n\t)" : "") . "\n);";
            $filesrc_for_save = substr($filesrc, 0, $arComponent["START"]) . $code . substr($filesrc, $arComponent["END"]);
            $f = $io->GetFile($abs_path);
            $arUndoParams = array('module' => 'fileman', 'undoType' => 'edit_component_props', 'undoHandler' => 'CFileman::UndoEditFile', 'arContent' => array('absPath' => $abs_path, 'content' => $f->GetContents()));
            if ($APPLICATION->SaveFileContent($abs_path, $filesrc_for_save)) {
                CUndo::ShowUndoMessage(CUndo::Add($arUndoParams));
                $obJSPopup->Close();
            } else {
                $strWarning .= GetMessage("comp_prop_err_save") . "<br>";
            }
        }
    }
}
$componentPath = CComponentEngine::MakeComponentPath($_GET["component_name"]);
$arComponentDescription["ICON"] = ltrim($arComponentDescription["ICON"], "/");
$localPath = getLocalPath("components" . $componentPath);
if ($localPath !== false && $arComponentDescription["ICON"] != "" && $io->FileExists($io->RelativeToAbsolutePath($localPath . "/" . $arComponentDescription["ICON"]))) {
    $sIcon = $localPath . "/" . $arComponentDescription["ICON"];
} else {
    $sIcon = "/bitrix/images/fileman/htmledit2/component.gif";
}
Esempio n. 3
0
<?php

require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
if ($_SERVER["REQUEST_METHOD"] == "GET" && isset($_REQUEST['undo']) && check_bitrix_sessid()) {
    if (!CUndo::Escape($_REQUEST['undo'])) {
        echo 'ERROR';
    }
}
Esempio n. 4
0
	public function checkRestore()
	{
		$key = addEventHandler('main', 'OnAutoSaveRestore', array($this, 'Restore'));
		CUndo::Escape($this->GetID());
		removeEventHandler('main', 'OnAutoSaveRestore', $key);
	}
Esempio n. 5
0
                    __intr_process_action($action, array('IBLOCK_ID' => $GLOBALS['VISUAL_STRUCTURE_IBLOCK_ID']), $fake_res = null, $fake_mode = '', $fake_arUndo = array(), $fake_undo_text = '');
                }
            }
        }
    }
    if ($action == 'undo') {
        $GLOBALS['VISUAL_STRUCTURE_IBLOCK_ID'] = $arParams['IBLOCK_ID'];
        CUndo::Escape($_REQUEST['undo']);
        $mode = 'reload';
    } else {
        $undo_text = '';
        __intr_process_action($action, $arParams, $res, $mode, $arUndo, $undo_text);
    }
    if (is_array($arUndo) && count($arUndo) > 0) {
        $arResult['UNDO_TEXT'] = $undo_text;
        $arResult['UNDO_ID'] = CUndo::Add(array('module' => 'intranet', 'undoType' => 'intranet.structure.visual', 'undoHandler' => '__intr_process_undo', 'arContent' => $arUndo));
    }
    if (is_array($res) && $mode != 'reload') {
        $APPLICATION->RestartBuffer();
        echo CUtil::PhpToJsObject($res);
        require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/include/epilog_after.php";
        die;
    }
}
if ($mode == 'subtree') {
    $arParams['LEVEL'] = intval($_REQUEST['level']);
    $SECTION_ID = intval($_REQUEST['section']);
    $arResult['HAS_MULTIPLE_ROOTS'] = $_REQUEST['mr'] == 'Y';
    $cache_id = $mode . '|' . $SECTION_ID . '|' . $arResult['HAS_MULTIPLE_ROOTS'] . '|' . $arParams['LEVEL'];
    $dbRes = CIBlockSection::GetByID($SECTION_ID);
    $arCurrentSection = $dbRes->Fetch();