Пример #1
0
        public static SideNavigator GetEmployeeNavigation()
        {
            var navigator = new SideNavigator();

            navigator.Controls.Add(new NavigationItem()
            {
                Name = CustomNamingPeople.Substitute <Resources.Resource>("ActiveEmployeesTitle"),
                URL  = CommonLinkUtility.GetEmployees(CommonLinkUtility.GetProductID())
            });

            navigator.Controls.Add(new NavigationItem()
            {
                Name = CustomNamingPeople.Substitute <Resources.Resource>("DisableEmployeesTitle"),
                URL  = CommonLinkUtility.GetEmployees(CommonLinkUtility.GetProductID(), EmployeeStatus.Terminated)
            });

            navigator.Controls.Add(new NavigationItem()
            {
                Name = CustomNamingPeople.Substitute <Resources.Resource>("PendingEmployeesTitle"),
                URL  = CommonLinkUtility.GetEmployees(CommonLinkUtility.GetProductID(), EmployeeActivationStatus.Pending)
            });



            return(navigator);
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var currentModule = UserOnlineManager.Instance.GetCurrentModule() as Module;

            if (currentModule == null)
            {
                return;
            }
            if (currentModule.Actions.Any() || ActionsPlaceHolder.Controls.Count > 0)
            {
                var actionsControl = new SideActions();
                foreach (var shortcut in currentModule.Actions)
                {
                    actionsControl.Controls.Add(new NavigationItem()
                    {
                        Name        = shortcut.Name,
                        Description = shortcut.Description,
                        URL         = shortcut.StartURL,
                        IsPromo     = (SetupInfo.WorkMode == WorkMode.Promo)
                    });
                }
                _actionHolder.Controls.Add(actionsControl);

                if (ActionsPlaceHolder.Controls.Count > 0)
                {
                    actionsControl.Controls.Add(ActionsPlaceHolder);
                }
            }

            if (currentModule.Navigations.Any())
            {
                var navigationControl = new SideNavigator();
                foreach (var shortcut in currentModule.Navigations)
                {
                    navigationControl.Controls.Add(new NavigationItem()
                    {
                        Name        = shortcut.Name,
                        Description = shortcut.Description,
                        URL         = shortcut.StartURL,
                    });
                }

                _actionHolder.Controls.Add(navigationControl);
            }
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ProductID = GetProductID();

            if (ProductID.Equals(Guid.Empty))
            {
                Response.Redirect(CommonLinkUtility.GetDefault());
            }

            var master = Master as IStudioMaster;

            if (master == null)
            {
                return;
            }

            var container = new Container()
            {
                Body = new PlaceHolder(), Header = new PlaceHolder()
            };

            master.ContentHolder.Controls.Add(container);

            container.BreadCrumbs.Add(new BreadCrumb()
            {
                Caption = Resources.Resource.MainTitle, NavigationUrl = VirtualPathUtility.ToAbsolute(ProductManager.Instance[ProductID].StartURL)
            });
            container.BreadCrumbs.Add(new BreadCrumb()
            {
                Caption = Resources.Resource.RecentActivity
            });

            Title = HeaderStringHelper.GetPageTitle(Resources.Resource.RecentActivity, container.BreadCrumbs);

            InitBody(container.Body);

            var navigate = new SideNavigator();

            navigate.Controls.Add(new NavigationItem(Resources.Resource.MainTitle, VirtualPathUtility.ToAbsolute(ProductManager.Instance[ProductID].StartURL)));
            master.SideHolder.Controls.Add(navigate);
        }
Пример #4
0
        public static SideNavigator GetBookmarkingNavigation()
        {
            SideNavigator navigator = new SideNavigator();

            navigator.Controls.Add(new NavigationItem()
            {
                Name = BookmarkingResource.BookmarksNavigationItem,
                URL  = BookmarkingPathConstants.BookmarkingPageUrl
            });

            navigator.Controls.Add(new NavigationItem()
            {
                Name = BookmarkingResource.TagsNavigationItem,
                URL  = BookmarkingPathConstants.TagsPageUrl
            });

            navigator.Controls.Add(new NavigationItem()
            {
                Name = BookmarkingResource.FavouritesNavigationItem,
                URL  = BookmarkingPathConstants.FavouriteBookmarksPageUrl
            });

            return(navigator);
        }
Пример #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(typeof(ActionContainer), this.Page);

            _storage       = StorageFactory.GetStorage();
            _requestHelper = new RequestHelper(Request, _storage);

            var currentModule = UserOnlineManager.Instance.GetCurrentModule() as Module;

            if (currentModule == null)
            {
                return;
            }

            var actionsControl = new SideActions();

            if (CommunitySecurity.CheckPermissions(ASC.PhotoManager.PhotoConst.Action_AddPhoto) && !MobileDetector.IsRequestMatchesMobile(Context))
            {
                actionsControl.Controls.Add(new NavigationItem()
                {
                    Name        = PhotoManagerResource.UploadPhotosLink,
                    Description = PhotoManagerResource.UploadPhotosLinkDescription,
                    URL         = ASC.PhotoManager.PhotoConst.AddPhotoPageUrl
                                  + (_requestHelper.EventId != 0 ? "?" + ASC.PhotoManager.PhotoConst.PARAM_EVENT + "=" + _requestHelper.EventId : ""),
                    IsPromo = (SetupInfo.WorkMode == WorkMode.Promo)
                });
            }

            if (IAmAsRecipient != null)
            {
                actionsControl.Controls.Add(new HtmlMenuItem(RenderSubscriptionOnUploadsLink()));
            }
            if (IAmAsRecipient != null && _requestHelper.EventId != 0)
            {
                actionsControl.Controls.Add(new HtmlMenuItem(RenderSubscriptionOnEventLink(_requestHelper.EventId)));
            }
            if (actionsControl.Controls.Count > 0)
            {
                _actionHolder.Controls.Add(actionsControl);
            }
            if (ActionsPlaceHolder.Controls.Count > 0)
            {
                actionsControl.Controls.Add(ActionsPlaceHolder);
            }
            if (currentModule.Navigations.Any())
            {
                var navigationControl = new SideNavigator();
                foreach (var shortcut in currentModule.Navigations)
                {
                    if (shortcut.ID == new Guid("4367C1B3-9F22-41a9-9CF1-DDCC612AFEE0") && !SecurityContext.IsAuthenticated)
                    {
                        // skip My Photos for guest
                        continue;
                    }
                    navigationControl.Controls.Add(new NavigationItem()
                    {
                        Name        = shortcut.Name,
                        Description = shortcut.Description,
                        URL         = shortcut.StartURL
                    });
                }
                _actionHolder.Controls.Add(navigationControl);
            }
        }
Пример #6
0
        protected void SetNavigation()
        {
            var currentModule = UserOnlineManager.Instance.GetCurrentModule() as Module;

            if (currentModule == null)
            {
                return;
            }

            var actionsControl = new SideActions();

            if (ForumManager.Instance.ValidateAccessSecurityAction(ForumAction.GetAccessForumEditor, null))
            {
                _forumMakerHolder.Controls.Add(LoadControl(ForumMaker.Location));
                string actionURL = "";
                if (this.Page is ASC.Web.Community.Forum.Default)
                {
                    actionURL = "javascript:ForumMakerProvider.ShowForumMakerDialog(false,'window.location.reload(true)');";
                }

                else if (this.Page is ManagementCenter)
                {
                    if (String.IsNullOrEmpty(Request["type"]) || Request["type"] == "0")
                    {
                        actionURL = "javascript:ForumMakerProvider.ShowForumMakerDialog(true);";
                    }

                    else
                    {
                        actionURL = "javascript:ForumMakerProvider.ShowForumMakerDialog();";
                    }
                }

                else
                {
                    actionURL = "javascript:ForumMakerProvider.ShowForumMakerDialog();";
                }


                actionsControl.Controls.Add(new NavigationItem()
                {
                    Name        = Resources.ForumResource.AddThreadCategoryButton,
                    Description = "",
                    URL         = actionURL,
                    IsPromo     = (SetupInfo.WorkMode == WorkMode.Promo)
                });
            }

            if (currentModule.Actions.Any() || ActionsPlaceHolder.Controls.Count > 0)
            {
                foreach (var shortcut in currentModule.Actions)
                {
                    actionsControl.Controls.Add(new NavigationItem()
                    {
                        Name        = shortcut.Name,
                        Description = shortcut.Description,
                        URL         = shortcut.StartURL,
                        IsPromo     = (SetupInfo.WorkMode == WorkMode.Promo)
                    });
                }
            }

            Utility.RegisterTypeForAjax(typeof(Subscriber));
            var subscriber          = new Subscriber();
            var isNewTopicSubscribe = subscriber.IsNewTopicSubscribe();

            this.ActionsPlaceHolder.Controls.AddAt(0, new HtmlMenuItem(subscriber.RenderNewTopicSubscription(!isNewTopicSubscribe)));

            if (ActionsPlaceHolder.Controls.Count > 0)
            {
                actionsControl.Controls.Add(ActionsPlaceHolder);
            }

            if (actionsControl.Controls.Count > 0)
            {
                _actionHolder.Controls.Add(actionsControl);
            }

            if (currentModule.Navigations.Any())
            {
                var navigationControl = new SideNavigator();
                foreach (var shortcut in currentModule.Navigations)
                {
                    navigationControl.Controls.Add(new NavigationItem()
                    {
                        Name        = shortcut.Name,
                        Description = shortcut.Description,
                        URL         = shortcut.StartURL
                    });
                }

                _actionHolder.Controls.Add(navigationControl);
            }
        }