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


PHP CForumNew::CanUserUpdateForum方法代码示例

本文整理汇总了PHP中CForumNew::CanUserUpdateForum方法的典型用法代码示例。如果您正苦于以下问题:PHP CForumNew::CanUserUpdateForum方法的具体用法?PHP CForumNew::CanUserUpdateForum怎么用?PHP CForumNew::CanUserUpdateForum使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CForumNew的用法示例。


在下文中一共展示了CForumNew::CanUserUpdateForum方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: BXClearCache

                if (!empty($path)) {
                    BXClearCache(true, $path);
                }
            }
        }
    }
}
$dbResultList = CForumNew::GetListEx(array($by => $order), $arFilter);
$dbResultList = new CAdminResult($dbResultList, $sTableID);
$dbResultList->NavStart();
$lAdmin->NavText($dbResultList->GetNavPrint(GetMessage("NAV")));
$lAdmin->AddHeaders(array(array("id" => "ID", "content" => "ID", "sort" => "ID", "default" => false), array("id" => "FORUM_GROUP_ID", "content" => GetMessage("FORUM_GROUP_ID"), "sort" => "FORUM_GROUP_LEFT_MARGIN", "default" => true), array("id" => "NAME", "content" => GetMessage("NAME"), "sort" => "NAME", "default" => true), array("id" => "ACTIVE", "content" => GetMessage("ACTIVE"), "sort" => "ACTIVE", "default" => true), array("id" => "LAND", "content" => GetMessage('LAND'), "default" => true), array("id" => "SORT", "content" => GetMessage("SORT"), "sort" => "SORT", "align" => "right"), array("id" => "MODERATION", "content" => GetMessage("MODERATION"), "sort" => "MODERATION"), array("id" => "INDEXATION", "content" => GetMessage("INDEXATION"), "sort" => "INDEXATION"), array("id" => "ORDER_BY", "content" => GetMessage("ORDER_BY"), "sort" => "ORDER_BY"), array("id" => "ORDER_DIRECTION", "content" => GetMessage("ORDER_DIRECTION"), "sort" => "ORDER_DIRECTION")));
$arVisibleColumns = $lAdmin->GetVisibleHeaderColumns();
while ($arForum = $dbResultList->NavNext(true, "f_")) {
    $row =& $lAdmin->AddRow($f_ID, $arForum);
    $bCanUpdateForum = CForumNew::CanUserUpdateForum($f_ID, $USER->GetUserGroupArray(), $USER->GetID());
    $bCanDeleteForum = CForumNew::CanUserDeleteForum($f_ID, $USER->GetUserGroupArray(), $USER->GetID());
    $row->bReadOnly = $bCanUpdateForum ? false : true;
    $row->AddField("ID", $f_ID);
    $row->AddViewField("NAME", '<a title="' . GetMessage("FORUM_EDIT") . '" href="forum_edit.php?ID=' . $f_ID . '&amp;lang=' . LANG . GetFilterParams("filter_") . '">' . $f_NAME . '</a>');
    $row->AddInputField("NAME", $bCanUpdateForum ? array("size" => "30") : false);
    $row->AddCheckField("ACTIVE", $bCanUpdateForum ? array() : false);
    $res = array();
    $res2 = array();
    if (in_array("LAND", $arVisibleColumns)) {
        $arForumSite = CForumNew::GetSites($f_ID);
        foreach ($arSites as $lid => $site) {
            if (array_key_exists($lid, $arForumSite)) {
                $res[] = $site["NAME"] . " [" . $lid . "]";
            }
            $class = empty($arForumSite[$lid]) ? "empty-path" : "";
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:forum_admin.php

示例2: GetMessage

$bInitVars = false;
/********************************************************************
				/Input params
********************************************************************/
$APPLICATION->SetTitle($ID > 0 ? GetMessage("FORUM_EDIT_RECORD", array("#ID#" => $ID)) : GetMessage("FORUM_NEW_RECORD"));
/********************************************************************
				Action
********************************************************************/
$fileName = '';
if ($REQUEST_METHOD == "POST" && $forumPermissions >= "W" && (strlen($save) > 0 || strlen($apply) > 0)) {
    if (isset($_FILES["IMAGE"]["name"])) {
        $fileName = RemoveScriptExtension($_FILES["IMAGE"]["name"]);
    }
    if (!check_bitrix_sessid()) {
        $arError[] = array("id" => "bad_sessid", "text" => GetMessage("ERROR_BAD_SESSID"));
    } elseif ($ID > 0 && !CForumNew::CanUserUpdateForum($ID, $USER->GetUserGroupArray(), $USER->GetID())) {
        $arError[] = array("id" => "not_right_for_edit", "text" => GetMessage("FE_NO_PERMS2UPDATE"));
    } elseif ($ID <= 0 && !CForumNew::CanUserAddForum($USER->GetUserGroupArray(), $USER->GetID())) {
        $arError[] = array("id" => "not_right_for_add", "text" => GetMessage("FE_NO_PERMS2ADD"));
    } elseif (!empty($_FILES["IMAGE"]["tmp_name"])) {
        $sUploadDir = $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/images/forum/" . ($_REQUEST["TYPE"] == "I" ? "icon" : "smile") . "/";
        CheckDirPath($sUploadDir);
        $arSmile = $ID > 0 ? CForumSmile::GetByID($ID) : $arSmile;
        $res = CFile::CheckImageFile($_FILES["IMAGE"], COption::GetOptionString("forum", "file_max_size", 50000), 0, 0);
        if (strLen($res) > 0) {
            $arError[] = array("id" => "IMAGE", "text" => $res);
        } elseif (file_exists($sUploadDir . $fileName) && !(isset($arSmile["IMAGE"]) && $arSmile["IMAGE"] != $fileName)) {
            $arError[] = array("id" => "IMAGE", "text" => GetMessage("ERROR_EXISTS_IMAGE", array("#FILE#" => str_replace("//", "/", "/" . BX_ROOT . "/images/forum/" . ($_REQUEST["TYPE"] == "I" ? "icon" : "smile") . "/" . $fileName))));
        } elseif (!@copy($_FILES["IMAGE"]["tmp_name"], $sUploadDir . $fileName)) {
            $arError[] = array("id" => "IMAGE", "text" => GetMessage("ERROR_COPY_IMAGE"));
        } else {
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:smile_edit.php

示例3: ShowPanel

 function ShowPanel($FID, $TID = 0, $bGetIcons = false)
 {
     global $APPLICATION, $REQUEST_URI, $USER;
     if (!(($USER->IsAuthorized() || $APPLICATION->ShowPanel === true) && $APPLICATION->ShowPanel !== false)) {
         return;
     }
     if (!CModule::IncludeModule("forum")) {
         return;
     }
     $arButtons = array();
     $module_permission = $APPLICATION->GetGroupRight("forum");
     if ($module_permission > "D") {
         $arButtons[] = array("TEXT" => GetMessage("F_FORUMS_LIST"), "IMAGE" => "/bitrix/images/forum/toolbar_button1.gif", "ACTION" => "jsUtils.Redirect(arguments, '/bitrix/admin/forum_admin.php')");
         if ($module_permission >= "W" && intVal($FID) > 0 && CForumNew::CanUserUpdateForum($FID, $USER->GetUserGroupArray(), $USER->GetID())) {
             $arButtons[] = array("TEXT" => GetMessage("F_FORUM_EDIT"), "IMAGE" => "/bitrix/images/forum/toolbar_button2.gif", "ACTION" => "jsUtils.Redirect(arguments, '/bitrix/admin/forum_edit.php?ID=" . intVal($FID) . "')");
         }
     }
     if (!empty($arButtons)) {
         $arButton = array("SRC" => "/bitrix/images/forum/toolbar_button1.gif", "ALT" => GetMessage("F_FORUM_TITLE"), "TEXT" => GetMessage("F_FORUM"), "MAIN_SORT" => 300, "MENU" => $arButtons, "MODE" => 'configure');
         $APPLICATION->AddPanelButton($arButton);
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:22,代码来源:forum_new.php


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