Example #1
0
        private void bindCmd()
        {
            ContentApp  app = ctx.app.obj as ContentApp;
            ContentSkin s   = ContentSkin.findById(app.SkinId);

            set("skinPath", strUtil.Join(sys.Path.Skin, s.StylePath));

            set("skinLink", to(new SkinController().Index));
            set("addRow1Url", to(new RowController().ConfirmAddRow, 1));
            set("addRow2Url", to(new RowController().ConfirmAddRow, 2));
            set("addRow3Url", to(new RowController().ConfirmAddRow, 3));
            set("addRow4Url", to(new RowController().ConfirmAddRow, 4));
            set("addRow5Url", to(new RowController().ConfirmAddRow, 5));
            set("addRow6Url", to(new RowController().ConfirmAddRow, 6));

            set("setStyleUrl", to(new ContentController().SetStyle));
            set("layoutSaveUrl", to(new ContentController().SaveLayout));

            set("resizeLink", to(new ContentController().SaveResize));

            IBlock xblock = getBlock("export");

            if (ctx.viewer.IsAdministrator())
            {
                xblock.Set("lnkExport", to(new ExportController().Index));
                xblock.Next();
            }
        }
Example #2
0
        public virtual void Index()
        {
            ContentApp app = ctx.app.obj as ContentApp;

            DataPage <ContentSkin> list = ContentSkin.findPage("order by Id asc");
            IBlock block = getBlock("list");

            foreach (ContentSkin s in list.Results)
            {
                block.Set("s.Id", s.Id);
                block.Set("s.Name", s.Name);
                block.Set("s.ThumbUrl", strUtil.Join(sys.Path.Skin, s.ThumbUrl));
                block.Set("s.ApplyLink", to(Apply, s.Id));

                String currentClass = "";
                String applyLink    = string.Format("<a href=\"{0}\">应用</a>", to(Apply, s.Id));
                if (app.SkinId == s.Id)
                {
                    currentClass = "currentSkin";
                    applyLink    = "<span>当前皮肤</span>";
                }

                block.Set("s.CurrentClass", currentClass);
                block.Set("s.ApplyLink", applyLink);

                block.Next();
            }

            set("page", list.PageBar);
        }
Example #3
0
        public override void Layout()
        {
            ContentApp  app = ctx.app.obj as ContentApp;
            ContentSkin s   = ContentSkin.findById(app.SkinId);

            set("skinPath", strUtil.Join(sys.Path.Skin, s.StylePath));

            set("adminUrl", to(new Admin.ContentController().Index));
            set("appUrl", to(new ContentController().Index));

            set("adminCheckUrl", t2(new SecurityController().CanAppAdmin, app.Id) + "?appType=" + typeof(ContentApp).FullName);

            // 当前app/module所有页面,所属的首页
            List <String> moduleUrlList = new List <string>();

            moduleUrlList.Add(to(new ContentController().Index));
            moduleUrlList.Add(HtmlLink.ToApp(app));

            ContentSetting setting = app.GetSettingsObj();

            if (strUtil.HasText(setting.StaticPath))
            {
                // 把所有可能的路径都加到 _moduleUrl 中
                moduleUrlList.Add(setting.StaticPath);               //news/default.html
                moduleUrlList.Add(getStaticDir(setting.StaticPath)); //news/
            }

            ctx.SetItem("_moduleUrl", moduleUrlList.ToArray());

            // admin link
            set("allPostsLink", to(new Admin.Common.PostController().List, 0));
            set("trashPostsLink", to(new Admin.Common.PostController().Trash));
            set("settingLink", to(new Admin.SettingController().Index));
            set("defaultLink", to(new Admin.ContentController().Home));
            set("commentLink", to(new CommentController().List));

            IBlock htmlBlock = getBlock("html");

            if (ctx.owner.obj is Site)
            {
                htmlBlock.Set("staticLink", to(new Admin.HtmlController().Index));
                htmlBlock.Next();
            }

            if (app.GetSettingsObj().EnableSubmit == 1)
            {
                String slnk = string.Format("<li><a href=\"{0}\" class=\"frmLink\" loadTo=\"contentPage\" nolayout=3>{1}</a></li>",
                                            to(new Admin.SubmitSettingController().List),
                                            "投递员管理");
                set("submitterLink", slnk);
            }
            else
            {
                set("submitterLink", "");
            }
        }
        public override void Layout()
        {
            ContentApp  app = ctx.app.obj as ContentApp;
            ContentSkin s   = ContentSkin.findById(app.SkinId);

            set("skinPath", strUtil.Join(sys.Path.Skin, s.StylePath));


            set("adminUrl", to(new Admin.ContentController().Index));
            set("appUrl", to(new ContentController().Index));

            set("adminCheckUrl", t2(new SecurityController().CanAppAdmin, app.Id) + "?appType=" + typeof(ContentApp).FullName);
        }
Example #5
0
        private void bindCmd()
        {
            ContentApp  app = ctx.app.obj as ContentApp;
            ContentSkin s   = ContentSkin.findById(app.SkinId);

            set("skinPath", strUtil.Join(sys.Path.Skin, s.StylePath));

            set("skinLink", to(new SkinController().Index));
            set("addRow1Url", to(new RowController().ConfirmAddRow, 1));
            set("addRow2Url", to(new RowController().ConfirmAddRow, 2));
            set("addRow3Url", to(new RowController().ConfirmAddRow, 3));
            set("addRow4Url", to(new RowController().ConfirmAddRow, 4));
            set("addRow5Url", to(new RowController().ConfirmAddRow, 5));
            set("addRow6Url", to(new RowController().ConfirmAddRow, 6));

            set("setStyleUrl", to(new ContentController().SetStyle));
            set("layoutSaveUrl", to(new ContentController().SaveLayout));

            set("resizeLink", to(new ContentController().SaveResize));
        }
Example #6
0
        public void InitContentSkin()
        {
            ContentSkin s1 = new ContentSkin();
            s1.Name = "默认";
            s1.StylePath = "/apps/content/1/skin.css";
            s1.ThumbUrl = "/apps/content/1/skinThumb.jpg";
            s1.insert();

            ContentSkin s2 = new ContentSkin();
            s2.Name = "蓝色";
            s2.StylePath = "/apps/content/2/skin.css";
            s2.ThumbUrl = "/apps/content/2/skinThumb.jpg";
            s2.insert();

            ContentSkin s3 = new ContentSkin();
            s3.Name = "绿色";
            s3.StylePath = "/apps/content/3/skin.css";
            s3.ThumbUrl = "/apps/content/3/skinThumb.jpg";
            s3.insert();
        }
        private void initContentSkin()
        {
            ContentSkin s1 = new ContentSkin();

            s1.Name      = "默认";
            s1.StylePath = "/apps/content/1/skin.css";
            s1.ThumbUrl  = "/apps/content/1/skinThumb.jpg";
            s1.insert();

            ContentSkin s2 = new ContentSkin();

            s2.Name      = "蓝色";
            s2.StylePath = "/apps/content/2/skin.css";
            s2.ThumbUrl  = "/apps/content/2/skinThumb.jpg";
            s2.insert();

            ContentSkin s3 = new ContentSkin();

            s3.Name      = "绿色";
            s3.StylePath = "/apps/content/3/skin.css";
            s3.ThumbUrl  = "/apps/content/3/skinThumb.jpg";
            s3.insert();
        }