Esempio n. 1
0
        public String EditDictaatStyling(string dictaatName, string fileName, string content)
        {
            string path = _pathHelper.StylePath(dictaatName, fileName);

            if (!_file.TryEditFile(path, content))
            {
                //wellicht in de toekomst 404 terug sturen? File not found?
                throw new Exceptions.PageNotFoundException();
            }

            return(GetDictaatStyling(dictaatName, fileName));
        }
Esempio n. 2
0
        public DictaatPage EditDictaatPage(string dictaatName, DictaatPage page)
        {
            string path = _pathHelper.PagePath(dictaatName, page.Name);

            if (!_file.TryEditFile(path, page.Source))
            {
                //wellicht in de toekomst 404 terug sturen? File not found?
                throw new Exceptions.PageNotFoundException();
            }

            return(GetDictaatPage(dictaatName, page.Name));
        }
Esempio n. 3
0
        public IEnumerable <Domain.MenuItem> EditMenu(string dictaatName, IEnumerable <Domain.MenuItem> menu)
        {
            var path = _pathHelper.MenuConfigPath(dictaatName);

            var menuString = Newtonsoft.Json.JsonConvert.SerializeObject(menu, Newtonsoft.Json.Formatting.Indented);

            if (_file.TryEditFile(path, menuString))
            {
                return(menu);
            }

            return(null);
        }
        public DictaatPage EditDictaatPage(string dictaatName, DictaatPage page)
        {
            string path = _pathHelper.PagePath(dictaatName, page.Name);

            //escape angular2 characters
            page.Source = page.Source.Replace("{", "&#123;");
            page.Source = page.Source.Replace("}", "&#125;");


            if (!_file.TryEditFile(path, page.Source))
            {
                //wellicht in de toekomst 404 terug sturen? File not found?
                throw new Exceptions.PageNotFoundException();
            }

            return(GetDictaatPage(dictaatName, page.Name));
        }