Beispiel #1
0
        public ActionResult DeleteLayout(int id)
        {
            // delete layout by id
            LayoutWorker.Remove(id, LayoutWorker.RepositoryWebConfig);

            // reload
            return(RedirectToAction("Layouts"));
        }
        public string Resolve(string name)
        {
            string ret = "MASTER NOT FOUND";

            InventioLayout layout = LayoutWorker.SelectByTitle(name, LayoutWorker.RepositoryWebConfig);

            if (layout != null)
            {
                ret = System.Text.Encoding.UTF8.GetString(layout.Body);
            }

            return(ret);
        }
Beispiel #3
0
        void ResentLayout(ref HelperClass helper, ref ControllerWorker controller, ref string bufS, string layoutName, bool content)
        {
            LayoutWorker layout = GetLayout(layoutName);

            GetStaticPlugins(layout, ref helper);
            layout._Work(helper);
            helper.GetData(layout._GetHelper());
            EchoClass ec = layout._GetNextContent();

            while (ec.type != EchoClass.EchoType.End)
            {
                switch (ec.type)
                {
                case EchoClass.EchoType.String:
                    bufS += (string)ec.param;
                    break;

                case EchoClass.EchoType.Layout:
                    ResentLayout(ref helper, ref controller, ref bufS, (string)ec.param, content);
                    break;

                case EchoClass.EchoType.Content:
                    if (content)
                    {
                        ResentContent(ref helper, ref controller, ref bufS);
                    }
                    break;
                }
                //while (bufS.Length > 16000) {
                //	byte[] buf = Encoding.UTF8.GetBytes(bufS.Substring(0, 16000));
                //	bufS = bufS.Remove(0, 16000);
                //	helper.Context.Response.OutputStream.Write(buf, 0, buf.Length);
                //}
                ec = layout._GetNextContent();
            }
        }
Beispiel #4
0
        // LAYOUTS -------------------------------------------------------------------------------

        public ActionResult Layouts()
        {
            List <InventioLayout> model = LayoutWorker.SelectAll(LayoutWorker.RepositoryWebConfig);

            return(View(model));
        }