示例#1
0
 private void SetDashboardCommands(NoticeBoard.Domain.ModuleNoticeboard permissions, Int32 idCommunity, Boolean isForPortal, liteHistoryItem message)
 {
     if (permissions.Administration)
     {
         View.SetNewMessageUrls(RootObject.AddMessageWithAdvancedEditor(idCommunity, isForPortal, false), RootObject.AddMessageWithSimpleEditor(idCommunity, isForPortal, false), true);
     }
     if (message != null)
     {
         View.AllowVirtualUndelete(message.isDeleted && (permissions.Administration || permissions.RetrieveOldMessage));
         View.AllowVirtualDelete(!message.isDeleted && (permissions.Administration || permissions.DeleteMessage));
         if (!message.isDeleted && permissions.Administration)
         {
             View.SetEditingUrls(RootObject.EditMessageWithAdvancedEditor(message.Id, idCommunity, isForPortal, false), RootObject.EditMessageWithSimpleEditor(message.Id, idCommunity, isForPortal, false));
         }
         else
         {
             View.SetEditingUrls("", "");
         }
         View.AllowVirtualUndeleteAndSetActive(message.isDeleted && (permissions.Administration || permissions.RetrieveOldMessage));
         View.AllowSetActive(!message.isDeleted && message.Status != Status.Active);
     }
     else
     {
         View.AllowVirtualDelete(false);
         View.AllowVirtualUndelete(false);
         View.HideEditingCommands();
     }
 }