Esempio n. 1
0
        public AssetEditor Init(IApp app, int templateId, bool isSuperUser, bool isAdmin, ILog parentLog)
        {
            InitShared(app, isSuperUser, isAdmin, parentLog);
            var template = _cmsRuntime.Views.Get(templateId);

            EditInfo = TemplateAssetsInfo(template);
            return(this);
        }
Esempio n. 2
0
        public AssetEditor(IApp app, string path, bool isSuperUser, bool isAdmin, bool global, ILog parentLog)
            : base("Sxc.AstEdt", parentLog)
        {
            _app             = app;
            _userIsSuperUser = isSuperUser;
            _userIsAdmin     = isAdmin;

            EditInfo = new AssetEditInfo(_app.AppId, _app.Name, path, global);
        }
Esempio n. 3
0
        public AssetEditor(IApp app, int templateId, bool isSuperUser, bool isAdmin, ILog parentLog)
            : base("Sxc.AstEdt", parentLog)
        {
            _app             = app;
            _userIsSuperUser = isSuperUser;
            _userIsAdmin     = isAdmin;

            // todo: 2dm Views - see if we can get logger to flow
            var template = new CmsRuntime(app, Log, true, false).Views.Get(templateId);

            EditInfo = TemplateAssetsInfo(template);
        }
Esempio n. 4
0
        private AssetEditInfo TemplateAssetsInfo(IView view)
        {
            var t = new AssetEditInfo(_app.AppId, _app.Name, view.Path, view.IsShared)
            {
                // Template specific properties, not really available in other files
                Type                    = view.Type,
                Name                    = view.Name,
                HasList                 = view.UseForList,
                TypeContent             = view.ContentType,
                TypeContentPresentation = view.PresentationType,
                TypeList                = view.HeaderType,
                TypeListPresentation    = view.HeaderPresentationType
            };

            return(t);
        }
Esempio n. 5
0
        private AssetEditInfo TemplateAssetsInfo(IView view)
        {
            var t = new AssetEditInfo(_app.AppId, _app.Name, view.Path,
                                      view.Location == Settings.TemplateLocations.HostFileSystem)
            {
                // Template specific properties, not really available in other files
                LocationScope           = view.Location,
                Type                    = view.Type,
                Name                    = view.Name,
                HasList                 = view.UseForList,
                TypeContent             = view.ContentType,
                TypeContentPresentation = view.PresentationType,
                TypeList                = view.HeaderType,
                TypeListPresentation    = view.HeaderPresentationType
            };

            return(t);
        }
Esempio n. 6
0
 public AssetEditor Init(IApp app, string path, bool isSuperUser, bool isAdmin, bool global, ILog parentLog)
 {
     InitShared(app, isSuperUser, isAdmin, parentLog);
     EditInfo = new AssetEditInfo(_app.AppId, _app.Name, path, global);
     return(this);
 }