コード例 #1
0
ファイル: HtmlController.cs プロジェクト: china99ljs/wojilu
        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"));
        }
コード例 #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"));
        }
コード例 #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");
            }
        }
コード例 #4
0
ファイル: RowService.cs プロジェクト: 2014AmethystCat/wojilu
        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" );
            }
        }
コード例 #5
0
ファイル: ContentController.cs プロジェクト: shiyibin/wojilu
        public void SaveStyle()
        {
            ContentApp app = ctx.app.obj as ContentApp;

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

            echoToParentPrivate();
        }
コード例 #6
0
ファイル: SkinController.cs プロジェクト: zuhuizou/wojilu
        public virtual void Apply(long id)
        {
            ContentApp app = ctx.app.obj as ContentApp;

            app.SkinId = id;

            app.update("SkinId");

            echoAjaxOk();
        }
コード例 #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"));
        }
コード例 #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();
        }
コード例 #9
0
ファイル: HtmlInstallerHelper.cs プロジェクト: naroate/wojilu
        // 静态配置
        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();
        }
コード例 #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"));
        }
コード例 #11
0
ファイル: RowService.cs プロジェクト: robin88/wojilu
        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 );
        }
コード例 #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"));
        }
コード例 #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);
        }
コード例 #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"));
        }
コード例 #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"));
        }