示例#1
0
 public void LoadHeader(ref Scaffold scaffold)
 {
     if (User.userId > 0)
     {
         scaffold.Child("header").Data["user"] = "******";
     }
     else
     {
         scaffold.Child("header").Data["no-user"] = "******";
     }
 }
示例#2
0
文件: Page.cs 项目: Datasilk/Frames
 public void LoadHeader(ref Scaffold scaffold)
 {
     if (S.User.userId > 0)
     {
         var child = scaffold.Child("header");
         child.Data["user"]     = "******";
         child.Data["username"] = S.User.name;
     }
     else
     {
         scaffold.Child("header").Data["no-user"] = "******";
     }
 }
示例#3
0
        public void LoadHeader(ref Scaffold scaffold, bool hasMenu = true)
        {
            if (User.userId > 0)
            {
                scaffold.Child("header").Data["user"]        = "******";
                scaffold.Child("header").Data["boards-menu"] = Common.Platform.Boards.RenderBoardsMenu(this);

                if (User.photo == true)
                {
                    scaffold.Child("header").Data["user-photo"] = "/users/" + FileSystem.DateFolders(User.datecreated) + "/photo.jpg";
                }
                else
                {
                    scaffold.Child("header").Data["no-user"] = "******";
                }

                //apply user settings to UI layout configuration
                if (hasMenu == true)
                {
                    scaffold.Child("header").Data["boards"]   = "1";
                    scaffold.Child("header").Data["boards-2"] = "1";
                    if (User.keepMenuOpen == true)
                    {
                        scripts.Append("<script language=\"javascript\">S.head.boards.show();S.head.boards.alwaysShow(true);</script>");
                    }
                }
            }
            else
            {
                scaffold.Child("header").Data["no-user"] = "******";
            }
        }
示例#4
0
        public string LoadTrash()
        {
            if (!CheckSecurity())
            {
                return(AccessDenied());
            }

            var scaffold  = new Scaffold("/Services/Trash/trash.html", S.Server.Scaffold);
            var scaffBook = new Scaffold("/Services/Trash/trash-book.html", S.Server.Scaffold);

            scaffBook.Child("checkbox").Data["label"] = "Book Magic!";

            scaffold.Data["books"] = scaffBook.Render();

            return(Inject(new Response()
            {
                selector = ".trash",
                html = scaffold.Render()
            }));
        }