コード例 #1
0
ファイル: groups.aspx.cs プロジェクト: jaytem/minGit
    protected void PopulateData(CommunityGroupData cGrp, List<UserData> groupAdmins, DirectoryData[] aCategories)
    {
        int groupAdminCount = 0;
        this.GroupName_TB.Text = cGrp.GroupName;
        this.ShortDescription_TB.Text = cGrp.GroupShortDescription;
        this.Description_TB.Text = cGrp.GroupLongDescription;
        if (cGrp.GroupHidden)
        {
            this.PublicJoinHidden_RB.Checked = true;
        }
        else
        {
            this.PublicJoinYes_RB.Checked = cGrp.GroupEnroll;
            this.PublicJoinNo_RB.Checked = !(cGrp.GroupEnroll);
        }
        this.Location_TB.Text = cGrp.GroupLocation;
        if (groupAdmins.Count == 0)
        {
            ltr_admin_name.Text = cGrp.GroupAdmin.DisplayName.ToString();
        }
        else
        {
            int order = 0;
            for (groupAdminCount = 0; groupAdminCount < groupAdmins.Count; groupAdminCount++)
            {
                if (order != 0)
                    this.ltr_admin_name.Text += ", ";
                if (groupAdmins[groupAdminCount].DisplayName != "")
                    this.ltr_admin_name.Text += groupAdmins[groupAdminCount].DisplayName;
                else
                    this.ltr_admin_name.Text += groupAdmins[groupAdminCount].FirstName;
                order += 1;
            }
        }

        //this.ltr_admin_name.Text=        this.ltr_admin_name.Text.ToString().Remove(this.ltr_admin_name.Text.ToString().LastIndexOf(","), 1);
        this.GroupAvatar_TB.Text = cGrp.GroupImage;
        this.cmd_browse.Attributes.Add("onclick", "javascript:return false;");
        this.cmd_browse.Visible = false;
        this.EnableDistributeToSite_CB.Checked = cGrp.GroupEnableDistributeToSite;
        this.AllowMembersToManageFolders_CB.Checked = cGrp.AllowMembersToManageFolders;

        this.chkEnableDocumentNotifications.Checked = cGrp.EnableDocumentsInNotifications;
        this.chkEnableEmail.Checked = cGrp.EnableGroupEmail;
        this.lblEmailAccountValue.Text = cGrp.EmailAccountName;
        this.lblEmailAddressValue.Text = cGrp.EmailAddress;
        MailServerData mailServer = GetNotificationEmailServer();
        this.lblEmailServerPortValue.Text = mailServer.POPPort.ToString();
        this.lblEmailServerValue.Text = mailServer.POPServer;
        this.chkUseSsl.Checked = mailServer.POPSSL;
        ucEktronGroupEmailSetting.Visible = cGrp.EnableGroupEmail;

        this.ltr_avatarpath.Text = "";
        List<string> cat_list = new List<string>();
        string TaxonomyList = string.Empty;
        if ((aCategories != null) && aCategories.Length > 0)
        {
            for (int i = 0; i <= (aCategories.Length - 1); i++)
            {
                cat_list.Add(("<li>" + aCategories[i].DirectoryPath.Remove(0, 1).Replace("\\", " > ") + "</li>"));
            }
            TaxonomyList = string.Join(string.Empty, cat_list.ToArray());
        }
        else
        {
            TaxonomyList = GetMessage("lbl cgroup no cat");
        }
        ltr_cat.Text += TaxonomyList;
        calendardata = _CalendarApi.GetPublicCalendar(Ektron.Cms.Common.EkEnumeration.WorkSpace.Group, cGrp.GroupId);
        if (calendardata != null)
        {
            this.FeaturesCalendar_CB.Checked = true;
        }
        _doesForumExists = m_refCommunityGroupApi.DoesCommunityGroupForumExists(Ektron.Cms.Common.EkEnumeration.WorkSpace.Group, cGrp.GroupId);
        if (_doesForumExists != 0)
        {
            this.FeaturesForum_CB.Checked = true;
        }

        var todoList = GetGroupTodoList();
        if (todoList != null)
        {
            FeaturesTodo_CB.Enabled = false;
            FeaturesTodo_CB.Checked = true;
        }

        if (this.m_sPageAction == "viewgroup")
        {
            this.GroupName_TB.Enabled = false;
            this.ShortDescription_TB.Enabled = false;
            this.Description_TB.Enabled = false;
            this.PublicJoinYes_RB.Enabled = false;
            this.PublicJoinNo_RB.Enabled = false;
            this.PublicJoinHidden_RB.Enabled  = false;
            this.Location_TB.Enabled = false;
            this.GroupAvatar_TB.Enabled = false;
            this.EnableDistributeToSite_CB.Enabled = false;
            this.AllowMembersToManageFolders_CB.Enabled = false;
            this.FeaturesCalendar_CB.Enabled = false;
            this.FeaturesForum_CB.Enabled = false;
            this.FeaturesTodo_CB.Enabled = false;
        }
        else if (this.m_sPageAction == "addeditgroup")
        {
            if (this.m_refContentApi.IsAdmin() == false)
            {
                this.AllowMembersToManageFolders_CB.Enabled = false;
            }
        }
    }
コード例 #2
0
    protected void PopulateData(CommunityGroupData cGrp, List<UserData> groupAdmins)
    {
        int i = 0;
        StringBuilder sBuilder = new StringBuilder();

        this.GroupName_TB.Text = cGrp.GroupName;
        this.ShortDescription_TB.Text = cGrp.GroupShortDescription;
        this.Description_TB.Text = cGrp.GroupLongDescription;
        this.PublicJoinYes_RB.Checked = cGrp.GroupEnroll;
        this.PublicJoinNo_RB.Checked = !(cGrp.GroupEnroll);
        this.PublicJoinHidden_RB.Checked = cGrp.GroupHidden;
        this.Location_TB.Text = cGrp.GroupLocation;
        this.GroupAvatar_TB.Text = cGrp.GroupImage;
        this.EnableDistributeToSite_CB.Checked = cGrp.GroupEnableDistributeToSite;
        this.AllowMembersToManageFolders_CB.Checked = cGrp.AllowMembersToManageFolders;
        this.ltr_avatarpath.Text = "";
        // Me.tb_admin_name.Text = cGrp.GroupAdmin.DisplayName
        groupMessageBoardModerate = _MessageBoardApi.IsModerated(this.m_iID, Ektron.Cms.Common.EkEnumeration.MessageBoardObjectType.CommunityGroup);
        this.chkMsgBoardModeration.Checked = groupMessageBoardModerate;

        //ekpmsgto__Page.Value = cGrp.GroupAdmin.DisplayName;
        if (groupAdmins.Count > 0)
        {
            sBuilder.Append("arGroupAdmins = new Array(");
            int order = 0;
            for (i = 0; i < groupAdmins.Count; i++)
            {
                if(order!=0)
                    sBuilder.Append(",");
                if (groupAdmins[i].DisplayName != "")
                sBuilder.Append("new groupAdmin('" + groupAdmins[i].DisplayName + "','" + groupAdmins[i].Id + "')");
                else
                    sBuilder.Append("new groupAdmin('" + groupAdmins[i].FirstName  + "','" + groupAdmins[i].Id + "')");

                order += 1;
            }
            sBuilder.AppendLine(")");
            sBuilder.AppendLine("renderGroupAdmins(" + cGrp.GroupId + ");");
        }
        Page.ClientScript.RegisterStartupScript(this.GetType(), "renderGroupAdmins", sBuilder.ToString(), true);

        ektouserid__Page.Value = cGrp.GroupAdmin.Id.ToString();

        this.chkEnableDocumentNotifications.Checked = cGrp.EnableDocumentsInNotifications;
        this.chkEnableEmail.Checked = cGrp.EnableGroupEmail;
        this.chkEnableEmail.Enabled = _activityApi.IsActivityEmailReplyEnabled;
        this.txtEmailAccount.Text = EkFunctions.HtmlDecode(cGrp.EmailAccountName);
        this.txtEmailAddressValue.Text = EkFunctions.HtmlDecode(cGrp.EmailAddress);

        if (!string.IsNullOrEmpty(cGrp.EmailPassword))
        {
            this.txtEmailPassword.Text = "*****";
            this.txtEmailPassword.Attributes.Add("value", "*****");
        }
        ucEktronGroupEmailSetting.Attributes.Add("style", "display:none;");
        if (cGrp.EnableGroupEmail)
        {
            ucEktronGroupEmailSetting.Attributes.Add("style", "display:block;");
            ucEktronGroupEmailSetting.Visible = cGrp.EnableGroupEmail;
        }

        txtEmailReplyServer.Value = mailServer.POPServer;
        txtEmailReplyServerPort.Value = mailServer.POPPort.ToString();
        this.lblEmailServerPortValue.Text = mailServer.POPPort.ToString();
        this.lblEmailServerValue.Text = mailServer.POPServer;
        this.chkUseSsl.Checked = mailServer.POPSSL;
        chkUseSsl.Checked = mailServer.POPSSL;

        calendardata = _CalendarApi.GetPublicCalendar(Ektron.Cms.Common.EkEnumeration.WorkSpace.Group, this.m_iID);
        if (calendardata != null)
        {
            FeaturesCalendar_CB.Enabled = false;
            FeaturesCalendar_CB.Checked = true;
        }
        _doesForumExists = m_refCommunityGroupApi.DoesCommunityGroupForumExists(Ektron.Cms.Common.EkEnumeration.WorkSpace.Group, this.m_iID);
        if (_doesForumExists > 0)
        {
            FeaturesForum_CB.Enabled = false;
            FeaturesForum_CB.Checked = true;
        }

        var todoList = GetGroupTodoList();
        if (todoList != null)
        {
            FeaturesTodo_CB.Enabled = false;
            FeaturesTodo_CB.Checked = true;
        }

        if (this.m_sPageAction == "viewgroup")
        {
            this.GroupName_TB.Enabled = false;
            this.ShortDescription_TB.Enabled = false;
            this.Description_TB.Enabled = false;
            this.PublicJoinYes_RB.Enabled = false;
            this.PublicJoinNo_RB.Enabled = false;
            this.PublicJoinHidden_RB.Enabled = false;
            this.Location_TB.Enabled = false;
            this.EnableDistributeToSite_CB.Enabled = false;
            this.AllowMembersToManageFolders_CB.Enabled = false;
        }
    }