Exemplo n.º 1
0
        public void SaveHtmlDir()
        {
            String htmlDir = strUtil.SubString(ctx.Post("htmlDir"), 30);

            if (strUtil.IsNullOrEmpty(htmlDir))
            {
                echoError("请填写内容");
                return;
            }

            if (HtmlHelper.IsHtmlDirError(htmlDir, ctx.errors))
            {
                echoError();
                return;
            }

            ContentApp     app = ctx.app.obj as ContentApp;
            ContentSetting s   = app.GetSettingsObj();

            s.StaticDir = htmlDir;

            app.Settings = Json.ToString(s);
            app.update();

            echoToParentPart(lang("opok"));
        }
Exemplo n.º 2
0
        public virtual void SaveHtmlPath()
        {
            String htmlPath = strUtil.SubString(ctx.Post("htmlPath"), 30);

            if (strUtil.IsNullOrEmpty(htmlPath))
            {
                echoError("请填写内容");
                return;
            }

            ContentApp     app = ctx.app.obj as ContentApp;
            ContentSetting s   = app.GetSettingsObj();

            if (htmlPath == s.StaticPath)
            {
                echoError("您没有修改目录名称");
                return;
            }

            if (HtmlHelper.IsHtmlDirError(htmlPath, ctx.errors))
            {
                echoError();
                return;
            }

            s.StaticPath = htmlPath;

            app.Settings = Json.ToString(s);
            app.update();

            echoToParentPart(lang("opok"));
        }
Exemplo n.º 3
0
        private static void deleteRowPrivate(ContentApp app, int rowId)
        {
            if (rowId <= 0)
            {
                return;
            }

            int           appId = app.Id;
            List <string> list  = new List <string>();

            string[] rowList = app.RowList;

            if (rowId <= rowList.Length)
            {
                if (rowId < rowList.Length)
                {
                    ContentSection.updateBatch("RowId=RowId-1", "RowId>" + rowId + " and AppId=" + appId);
                }
                for (int i = 1; i <= rowList.Length; i++)
                {
                    if (rowId != i)
                    {
                        list.Add(rowList[i - 1]);
                    }
                }
                String strLayout = string.Empty;
                foreach (String str in list)
                {
                    strLayout = strLayout + str + "/";
                }
                strLayout  = strLayout.TrimEnd('/');
                app.Layout = strLayout;
                app.update("Layout");
            }
        }
Exemplo n.º 4
0
        private static void deleteRowPrivate( ContentApp app, int rowId ) {

            if (rowId <= 0) return;

            long appId = app.Id;
            List<string> list = new List<string>();
            string[] rowList = app.RowList;

            if (rowId <= rowList.Length) {

                if (rowId < rowList.Length) {
                    ContentSection.updateBatch( "RowId=RowId-1", "RowId>" + rowId + " and AppId=" + appId );
                }
                for (int i = 1; i <= rowList.Length; i++) {
                    if (rowId != i) {
                        list.Add( rowList[i - 1] );
                    }
                }
                String strLayout = string.Empty;
                foreach (String str in list) {
                    strLayout = strLayout + str + "/";
                }
                strLayout = strLayout.TrimEnd( '/' );
                app.Layout = strLayout;
                app.update( "Layout" );
            }
        }
Exemplo n.º 5
0
        public void SaveStyle()
        {
            ContentApp app = ctx.app.obj as ContentApp;

            app.SkinStyle = ctx.Post("Style");
            app.update("SkinStyle");

            echoToParentPrivate();
        }
Exemplo n.º 6
0
        public virtual void Apply(long id)
        {
            ContentApp app = ctx.app.obj as ContentApp;

            app.SkinId = id;

            app.update("SkinId");

            echoAjaxOk();
        }
Exemplo n.º 7
0
        public virtual void SaveRole()
        {
            ContentApp           app   = ctx.app.obj as ContentApp;
            ContentSubmitterRole roles = ctx.PostValue(app.GetSubmitterRoleObj()) as ContentSubmitterRole;

            app.SubmitterRole = Json.ToString(roles);

            app.update("SubmitterRole");

            echoRedirect(lang("opok"));
        }
Exemplo n.º 8
0
        // 静态配置
        private void setStaticPath(ContentApp app, string staticPath)
        {
            ContentSetting setting = app.GetSettingsObj();

            setting.IsAutoHtml      = 1;
            setting.StaticPath      = staticPath;
            setting.ArticleListMode = 1; // 摘要列表

            app.Settings = Json.ToString(setting);

            app.update();
        }
Exemplo n.º 9
0
        // 静态配置
        private void setStaticPath( ContentApp app, string staticPath )
        {
            ContentSetting setting = app.GetSettingsObj();

            setting.IsAutoHtml = 1;
            setting.StaticPath = staticPath;
            setting.ArticleListMode = 1; // 摘要列表

            app.Settings = Json.ToString( setting );

            app.update();
        }
Exemplo n.º 10
0
        public virtual void SaveAutoHtml()
        {
            ContentApp     app = ctx.app.obj as ContentApp;
            ContentSetting s   = app.GetSettingsObj();

            s.IsAutoHtml = ctx.PostIsCheck("IsAutoHtml");

            app.Settings = Json.ToString(s);
            app.update();

            echoToParentPart(lang("opok"));
        }
Exemplo n.º 11
0
        public void UpdateRow( ContentApp app, MoveRowInfo mr )
        {
            app.Layout = mr.RowString;
            app.Style = updateStyle( app.Style, mr );
            app.SkinStyle = updateStyle( app.SkinStyle, mr );
            app.update();

            int tempId = 9999;
            ContentSection.updateBatch( "RowId=" + tempId, "AppId=" + app.Id + " and RowId=" + mr.Row1 );
            ContentSection.updateBatch( "RowId=" + mr.Row1, "AppId=" + app.Id + " and RowId=" + mr.Row2 );
            ContentSection.updateBatch( "RowId=" + mr.Row2, "AppId=" + app.Id + " and RowId=" + tempId );

            List<ContentSection> list = new ContentSectionService().GetByApp( app.Id );
        }
Exemplo n.º 12
0
        public void Save()
        {
            ContentSetting s = ctx.PostValue <ContentSetting>();

            s.AllowComment          = ctx.PostIsCheck("contentSetting.AllowComment");
            s.AllowAnonymousComment = ctx.PostIsCheck("contentSetting.AllowAnonymousComment");
            s.EnableSubmit          = ctx.PostIsCheck("contentSetting.EnableSubmit");

            ContentApp app = ctx.app.obj as ContentApp;

            app.Settings = JsonString.ConvertObject(s);
            app.update();

            echoRedirect(lang("opok"));
        }
Exemplo n.º 13
0
        public void UpdateRow(ContentApp app, MoveRowInfo mr)
        {
            app.Layout    = mr.RowString;
            app.Style     = updateStyle(app.Style, mr);
            app.SkinStyle = updateStyle(app.SkinStyle, mr);
            app.update();

            int tempId = 9999;

            ContentSection.updateBatch("RowId=" + tempId, "AppId=" + app.Id + " and RowId=" + mr.Row1);
            ContentSection.updateBatch("RowId=" + mr.Row1, "AppId=" + app.Id + " and RowId=" + mr.Row2);
            ContentSection.updateBatch("RowId=" + mr.Row2, "AppId=" + app.Id + " and RowId=" + tempId);

            List <ContentSection> list = new ContentSectionService().GetByApp(app.Id);
        }
Exemplo n.º 14
0
        public void Save()
        {
            ContentApp app = ctx.app.obj as ContentApp;

            ContentSetting s = ctx.PostValue(app.GetSettingsObj()) as ContentSetting;

            s.AllowComment          = ctx.PostIsCheck("contentSetting.AllowComment");
            s.AllowAnonymousComment = ctx.PostIsCheck("contentSetting.AllowAnonymousComment");
            s.EnableSubmit          = ctx.PostIsCheck("contentSetting.EnableSubmit");

            s.MetaDescription = strUtil.CutString(s.MetaDescription, 500);

            app.Settings = Json.ToString(s);
            app.update();

            echoRedirect(lang("opok"));
        }
Exemplo n.º 15
0
        public void Save()
        {
            ContentSetting s = ctx.PostValue <ContentSetting>();

            s.AllowComment          = ctx.PostIsCheck("contentSetting.AllowComment");
            s.AllowAnonymousComment = ctx.PostIsCheck("contentSetting.AllowAnonymousComment");
            s.EnableSubmit          = ctx.PostIsCheck("contentSetting.EnableSubmit");

            s.MetaDescription = strUtil.CutString(s.MetaDescription, 500);

            if (HtmlHelper.IsHtmlDirError(s.StaticDir, ctx.errors))
            {
                echoError();
                return;
            }

            ContentApp app = ctx.app.obj as ContentApp;

            app.Settings = Json.ToString(s);
            app.update();

            echoRedirect(lang("opok"));
        }