Esempio n. 1
0
 function OnPanelCreate()
 {
     global $APPLICATION, $REQUEST_URI;
     if ($APPLICATION->GetGroupRight("fileman") <= "D") {
         return;
     }
     $cur_page = $APPLICATION->GetCurPage(true);
     $cur_dir = $APPLICATION->GetCurDir();
     //access to curent page
     $page_permission = $APPLICATION->GetFileAccessPermission($cur_page);
     // access to current directory
     $sect_permission = $APPLICATION->GetFileAccessPermission($cur_dir);
     $main_sort = 100;
     $full_src = "";
     $default_edit = COption::GetOptionString("fileman", "default_edit", "html");
     if ($default_edit == "php") {
         $editor_type = "file";
         $full_src = "&full_src=Y";
     } elseif ($default_edit == "text") {
         $editor_type = "file";
     } else {
         $editor_type = "html";
     }
     $aMenuItems = array('create' => array(), 'create_section' => array(), 'edit' => array(), 'edit_section' => array());
     if ($sect_permission >= "W") {
         // New page
         $href = "/bitrix/admin/fileman_" . $editor_type . "_edit.php?lang=" . LANGUAGE_ID . "&site=" . SITE_ID . "&path=" . UrlEncode($APPLICATION->GetCurDir()) . "&new=Y&templateID=" . urlencode(SITE_TEMPLATE_ID) . "&back_url=" . UrlEncode($REQUEST_URI);
         $APPLICATION->AddPanelButtonMenu('create', array("SEPARATOR" => true, "SORT" => 99));
         $APPLICATION->AddPanelButtonMenu('create', array("TEXT" => GetMessage("fileman_panel_admin"), "TITLE" => GetMessage("fileman_panel_new_page_title"), "ACTION" => "jsUtils.Redirect([], '" . CUtil::JSEscape($href) . "')", "SORT" => 100));
         //New folder
         $href = "/bitrix/admin/fileman_newfolder.php?lang=" . LANGUAGE_ID . "&site=" . SITE_ID . "&path=" . UrlEncode($APPLICATION->GetCurDir()) . "&back_url=" . UrlEncode($REQUEST_URI);
         $APPLICATION->AddPanelButtonMenu('create_section', array("SEPARATOR" => true, "SORT" => 99));
         $APPLICATION->AddPanelButtonMenu('create_section', array("TEXT" => GetMessage("fileman_panel_admin"), "TITLE" => GetMessage("fileman_panel_new_folder_title"), "ACTION" => "jsUtils.Redirect([], '" . CUtil::JSEscape($href) . "')"));
     }
     // Edit page
     if ($page_permission >= "W") {
         $href = "/bitrix/admin/fileman_" . $editor_type . "_edit.php?lang=" . LANGUAGE_ID . "&site=" . SITE_ID . "&templateID=" . urlencode(SITE_TEMPLATE_ID) . $full_src . "&path=" . UrlEncode(isset($_SERVER["REAL_FILE_PATH"]) && $_SERVER["REAL_FILE_PATH"] != "" ? $_SERVER["REAL_FILE_PATH"] : $cur_page) . "&back_url=" . UrlEncode($REQUEST_URI);
         $APPLICATION->AddPanelButtonMenu('edit', array("SEPARATOR" => true, "SORT" => 99));
         $APPLICATION->AddPanelButtonMenu('edit', array("TEXT" => GetMessage("fileman_panel_admin"), "TITLE" => GetMessage("fileman_panel_edit_title"), "ACTION" => "jsUtils.Redirect([], '" . CUtil::JSEscape($href) . "')", "SORT" => 100));
     }
     // Folder properties
     $alt = GetMessage("FILEMAN_FOLDER_PROPS");
     if ($sect_permission >= "W") {
         $href = "/bitrix/admin/fileman_folder.php?lang=" . LANGUAGE_ID . "&site=" . SITE_ID . "&path=" . UrlEncode($APPLICATION->GetCurDir()) . "&back_url=" . UrlEncode($REQUEST_URI);
         $APPLICATION->AddPanelButtonMenu('edit_section', array("SEPARATOR" => true, "SORT" => 99));
         $APPLICATION->AddPanelButtonMenu('edit_section', array("TEXT" => GetMessage("fileman_panel_admin"), "TITLE" => GetMessage("fileman_panel_folder_prop_title"), "ACTION" => "jsUtils.Redirect([], '" . CUtil::JSEscape($href) . "')", "SORT" => 100));
     }
     //Sticker buttons
     require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/fileman/classes/general/sticker.php";
     if (CSticker::CanDoOperation('sticker_view')) {
         $useHotKeys = COption::GetOptionString('fileman', "stickers_use_hotkeys", "Y") == "Y";
         $arMenu = array();
         if (CSticker::CanDoOperation('sticker_new')) {
             $arMenu[] = array("TEXT" => '<div style="float: left; margin: 0 50px 0 0;">' . GetMessage("FMST_PANEL_STICKER_ADD") . '</div>' . ($useHotKeys ? '<div style="float: right;"><nobr>Ctrl+Shift+S</nobr></div>' : ''), "TITLE" => GetMessage("FMST_PANEL_STICKER_ADD_TITLE"), "ICON" => "", "ACTION" => CSticker::GetScriptStr('add'), "DEFAULT" => true, "HK_ID" => "FMST_PANEL_STICKER_ADD");
             $arMenu[] = array("SEPARATOR" => true);
         }
         $curPageCount = CSticker::GetCurPageCount();
         $arMenu[] = array("ID" => "bxst-show-sticker-icon", "TEXT" => '<div style="float: left; margin: 0 50px 0 0;">' . GetMessage("FMST_PANEL_STICKERS_SHOW", array("#COUNT#" => $curPageCount)) . '</div>' . ($useHotKeys ? '<div style="float:right;"><nobr>Ctrl+Shift+X</nobr></div>' : ''), "TITLE" => GetMessage("FMST_PANEL_STICKERS_SHOW_TITLE"), "ICON" => CSticker::GetBShowStickers() ? " checked" : "", "ACTION" => CSticker::GetScriptStr('show'), "HK_ID" => "FMST_PANEL_STICKERS_SHOW");
         $arMenu[] = array("TEXT" => '<div style="float: left; margin: 0 50px 0 0;">' . GetMessage("FMST_PANEL_CUR_STICKER_LIST") . '</div>' . ($useHotKeys ? '<div style="float: right;"><nobr>Ctrl+Shift+L</nobr></div>' : ''), "TITLE" => GetMessage("FMST_PANEL_CUR_STICKER_LIST_TITLE"), "ICON" => "", "ACTION" => CSticker::GetScriptStr('list_cur'), "HK_ID" => "FMST_PANEL_CUR_STICKER_LIST");
         $arMenu[] = array("TEXT" => GetMessage("FMST_PANEL_ALL_STICKER_LIST"), "TITLE" => GetMessage("FMST_PANEL_ALL_STICKER_LIST_TITLE"), "ICON" => "", "ACTION" => CSticker::GetScriptStr('list_all'), "HK_ID" => "FMST_PANEL_ALL_STICKER_LIST");
         $APPLICATION->AddPanelButton(array("HREF" => 'javascript:' . (CSticker::CanDoOperation('sticker_edit') ? CSticker::GetScriptStr('add') : CSticker::GetScriptStr('show')), "TYPE" => "SMALL", "ICON" => "bx-panel-small-stickers-icon", "TEXT" => GetMessage("FMST_PANEL_STICKERS_TOOLTIP_TITLE"), "MAIN_SORT" => "1000", "SORT" => 100, "MENU" => $arMenu, "HK_ID" => "FMST_PANEL_STICKERS", "HINT" => array("TITLE" => CSticker::CanDoOperation('sticker_edit') ? GetMessage("FMST_PANEL_STICKERS_TOOLTIP_TITLE") : GetMessage("FMST_PANEL_STICKERS_SHOW_1"), "TEXT" => CSticker::CanDoOperation('sticker_edit') ? GetMessage("FMST_PANEL_STICKERS_TOOLTIP") . ($useHotKeys ? " (Ctrl+Shift+S)" : "") : GetMessage("FMST_PANEL_STICKERS_ALT") . ($useHotKeys ? " (Ctrl+Shift+X)" : ""))));
         CSticker::Init(array('curPageCount' => $curPageCount));
     }
 }
Esempio n. 2
0
            echo $url;
            ?>
"><?php 
            echo intVal($arRes['ID']);
            ?>
</a></td>
				<td><?php 
            echo $html;
            ?>
</td>
				<td><?php 
            echo htmlspecialcharsex($date);
            ?>
</td>
				<td><nobr><?php 
            echo htmlspecialcharsex(CSticker::GetUserName($arRes['CREATED_BY']));
            ?>
</nobr></td>
				<td class="bxst-list-it-link<?php 
            if ($bCompleted) {
                echo ' bxstl-completed';
            }
            ?>
">
					<?php 
            if (strlen($arRes['PAGE_TITLE']) > 0) {
                ?>
					<a href="<?php 
                echo $url;
                ?>
" title="<?php 
Esempio n. 3
0
 function GetStickerInfo($createdBy, $dateCreate, $modBy, $dateMod)
 {
     $str = GetMessage("FMST_CREATED") . ": <b>" . htmlspecialcharsEx(CSticker::GetUserName($createdBy)) . "</b> " . CSticker::GetUsableDate($dateCreate) . "<br/>" . GetMessage("FMST_UPDATED") . ": <b>" . htmlspecialcharsEx(CSticker::GetUserName($modBy)) . "</b> " . CSticker::GetUsableDate($dateMod);
     return $str;
 }
Esempio n. 4
0
            if (isset($_REQUEST['admin_mnu_menu_id'])) {
                if ($_REQUEST['admin_mnu_menu_id'] == "menu_fileman_file_" . $site_id . "_") {
                    $sShowOnly = "";
                } elseif (substr($_REQUEST['admin_mnu_menu_id'], 0, strlen("menu_fileman_file_" . $site_id . "_")) == "menu_fileman_file_" . $site_id . "_") {
                    $sShowOnly = substr($_REQUEST['admin_mnu_menu_id'], strlen("menu_fileman_file_" . $site_id . "_"));
                }
            } elseif (isset($_REQUEST['path'])) {
                $sShowOnly = rtrim($_REQUEST['path'], "/");
                $bFullList = true;
            }
            $aMenu["items"][] = array("text" => GetMessage("FILEMAN_MNU_F_AND_F"), "url" => "fileman_admin.php?lang=" . LANG . '&' . $addUrl, "dynamic" => true, "items_id" => "menu_fileman_file_" . $site_id . "_", "module_id" => "fileman", "more_url" => array("fileman_admin.php?lang=" . LANG, "fileman_admin.php?lang=" . LANG . "&" . $addUrl, "fileman_access.php?" . $addUrl, "fileman_admin.php?" . $addUrl, "fileman_file_download.php?" . $addUrl, "fileman_file_edit.php?" . $addUrl, "fileman_html_edit.php?" . $addUrl, "fileman_file_upload.php?" . $addUrl, "fileman_file_view.php?" . $addUrl, "fileman_folder.php?" . $addUrl, "fileman_menu_edit.php?" . $addUrl, "fileman_newfolder.php?" . $addUrl), "title" => GetMessage("FILEMAN_MNU_F_AND_F_TITLE"), "items" => $sShowOnly !== false ? __fileman_mnu_gen(false, $bFullList, $site_id, "", $sShowOnly, array(), false, $arSitesDR_) : array());
        }
    }
}
if (COption::GetOptionString('fileman', "use_medialib", "Y") != "N" && CModule::IncludeModule("fileman") && CMedialib::CanDoOperation('medialib_view_collection', 0, false, true)) {
    if (!is_array($aMenu)) {
        $aMenu = array("parent_menu" => "global_menu_content", "section" => "fileman", "sort" => 100, "text" => GetMessage("FM_MENU_TITLE"), "title" => GetMessage("FM_MENU_DESC"), "url" => "", "icon" => "fileman_menu_icon", "page_icon" => "fileman_page_icon", "items_id" => "menu_fileman", "more_url" => array("fileman_admin.php", "fileman_file_edit.php", "fileman_file_view.php", "fileman_folder.php", "fileman_html_edit.php", "fileman_menu_edit.php", "fileman_newfolder.php", "fileman_rename.php"), "items" => array());
    }
    $arMLTypes = CMedialib::GetTypes();
    $arItemTypes = array();
    for ($i = 0, $l = count($arMLTypes); $i < $l; $i++) {
        $arItemTypes[] = array("text" => htmlspecialcharsex($arMLTypes[$i]["name"]), "url" => "fileman_medialib_admin.php?lang=" . LANGUAGE_ID . "&type=" . $arMLTypes[$i]["id"], "dynamic" => false, "items_id" => "menu_medialib_" . $arMLTypes[$i]["code"], "module_id" => "fileman", "more_url" => array("fileman_medialib_upload.php?lang=" . LANGUAGE_ID . "&type=" . $arMLTypes[$i]["id"], "fileman_medialib_access.php?lang=" . LANGUAGE_ID . "&type=" . $arMLTypes[$i]["id"]));
    }
    $aMenu["items"][] = array("text" => GetMessage("FM_MENU_MEDIALIB"), "title" => GetMessage("FM_MENU_MEDIALIB_TITLE"), "url" => "fileman_medialib_admin.php?lang=" . LANGUAGE_ID, "dynamic" => false, "items_id" => "menu_medialib", "module_id" => "fileman", "more_url" => array("fileman_medialib_upload.php", "fileman_medialib_access.php"), "items" => $arItemTypes);
}
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/fileman/classes/general/sticker.php";
if (CSticker::CanDoOperation('sticker_view')) {
    $aMenuStickers = array("parent_menu" => "global_menu_services", "section" => "stickers", "sort" => 100, "text" => GetMessage("FMST_STICKERS"), "title" => GetMessage("FMST_STICKERS_TITLE"), "url" => "fileman_stickers_admin.php?lang=" . LANG, "icon" => "fileman_sticker_icon", "page_icon" => "fileman_sticker_icon_sections", "items_id" => "menu_stickers", "more_url" => array("fileman_stickers_admin.php"), "items" => array());
    $aMenu = array($aMenu, $aMenuStickers);
}
return $aMenu;
    COption::SetOptionString("fileman", "stickers_hide_bottom", $_REQUEST['set_hide_bottom'] == "Y" ? "Y" : "N");
    COption::SetOptionString("fileman", "stickers_start_sizes", $_REQUEST['set_sizes']);
    COption::SetOptionString("fileman", "stickers_use_hotkeys", $_REQUEST['use_hotkeys'] == "Y" ? "Y" : "N");
    // Access
    $arTaskPerm = array();
    foreach ($arGroups as $group) {
        $tid = ${"TASKS_" . $group["ID"]};
        if ($tid) {
            $arTaskPerm[$group["ID"]] = intVal($tid);
        }
    }
    CSticker::SaveAccessPermissions($arTaskPerm);
    COption::SetOptionString('fileman', 'stickers_default_access', intVal($_REQUEST['st_default_access']));
    $defaultAccess = intVal($_REQUEST['st_default_access']);
}
$arTaskPerm = CSticker::GetAccessPermissions();
$strTaskOpt = "";
foreach ($arTasks as $id => $task) {
    $strTaskOpt .= '<option value="' . $id . '">' . (strlen($task['letter']) > 0 ? '[' . $task['letter'] . '] ' : '') . $task['title'] . '</option>';
}
$strGroupsOpt = '<option value="">(' . GetMessage('FM_ST_SELECT_GROUP') . ')</option>';
$arGroupIndex = array();
foreach ($arGroups as $group) {
    $arGroupIndex[$group['ID']] = $group['NAME'];
    $strGroupsOpt .= '<option value="' . $group['ID'] . '">' . htmlspecialcharsex($group['NAME']) . ' [' . intVal($group['ID']) . ']</option>';
}
?>

<form method="POST" action="<?php 
echo $APPLICATION->GetCurPage();
?>