コード例 #1
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            filename = Request.QueryString["id"].Replace('\\', '/').TrimStart('/');

            var editor = Panel1.NewTabPage(ui.Text("stylesheet"));
            editor.Controls.Add(Pane7);

            var props = Panel1.NewTabPage(ui.Text("properties"));
            props.Controls.Add(Pane8);

            SaveButton = Panel1.Menu.NewButton();
            SaveButton.Text = ui.Text("save");
            SaveButton.ButtonType = MenuButtonType.Primary;
            SaveButton.ID = "save";
            SaveButton.CssClass = "client-side";
        }
コード例 #2
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            Panel1.Text           = ui.Text("treeHeaders", "installedPackages");
            pane_meta.Text        = ui.Text("packager", "packageMetaData");
            pp_name.Text          = ui.Text("packager", "packageName");
            pp_version.Text       = ui.Text("packager", "packageVersion");
            pp_author.Text        = ui.Text("packager", "packageAuthor");
            pp_repository.Text    = ui.Text("packager", "packageRepository");
            pp_documentation.Text = ui.Text("packager", "packageDocumentation");
            pp_readme.Text        = ui.Text("packager", "packageReadme");
            hl_docLink.Text       = ui.Text("packager", "packageDocumentation");
            lb_demoLink.Text      = ui.Text("packager", "packageDemonstration");

            pane_versions.Text = ui.Text("packager", "packageVersionHistory");
            pane_noItems.Text  = ui.Text("packager", "packageNoItemsHeader");

            pane_uninstall.Text      = ui.Text("packager", "packageUninstallHeader");
            bt_deletePackage.Text    = ui.Text("packager", "packageUninstallHeader");
            bt_confirmUninstall.Text = ui.Text("packager", "packageUninstallConfirm");

            pane_uninstalled.Text = ui.Text("packager", "packageUninstalledHeader");

            var general = Panel1.NewTabPage(ui.Text("packager", "packageName"));

            general.Controls.Add(pane_meta);
            general.Controls.Add(pane_versions);


            var uninstall = Panel1.NewTabPage(ui.Text("packager", "packageUninstallHeader"));

            uninstall.Controls.Add(pane_noItems);
            uninstall.Controls.Add(pane_uninstall);
            uninstall.Controls.Add(pane_uninstalled);
        }
コード例 #3
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            //check if a templateId is assigned, meaning we are editing a template
            if (!Request.QueryString["templateID"].IsNullOrWhiteSpace())
            {
                _template            = new Template(int.Parse(Request.QueryString["templateID"]));
                TemplateTreeSyncPath = "-1,init," + _template.Path.Replace("-1,", "");
            }
            else if (!Request.QueryString["file"].IsNullOrWhiteSpace())
            {
                //we are editing a view (i.e. partial view)
                OriginalFileName = HttpUtility.UrlDecode(Request.QueryString["file"]);

                //TemplateTreeSyncPath = "-1,init," + Path.GetFileName(OriginalFileName);

                TemplateTreeSyncPath = DeepLink.GetTreePathFromFilePath(OriginalFileName.TrimStart("MacroPartials/").TrimStart("Partials/"));
            }
            else
            {
                throw new InvalidOperationException("Cannot render the editor without a supplied templateId or a file");
            }

            Panel1.hasMenu = true;
            var editor = Panel1.NewTabPage(ui.Text("template"));

            editor.Controls.Add(Pane8);

            var props = Panel1.NewTabPage(ui.Text("properties"));

            props.Controls.Add(Pane7);


            SaveButton            = Panel1.Menu.NewButton();
            SaveButton.Text       = ui.Text("save");
            SaveButton.ButtonType = MenuButtonType.Primary;
            SaveButton.ID         = "save";
            SaveButton.CssClass   = "client-side";

            Panel1.Text            = ui.Text("edittemplate");
            pp_name.Text           = ui.Text("name", base.getUser());
            pp_alias.Text          = ui.Text("alias", base.getUser());
            pp_masterTemplate.Text = ui.Text("mastertemplate", base.getUser());

            // Editing buttons
            MenuIconI umbField = editorSource.Menu.NewIcon();

            umbField.ImageURL       = UmbracoPath + "/images/editor/insField.gif";
            umbField.OnClickCommand =
                ClientTools.Scripts.OpenModalWindow(
                    IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" +
                    editorSource.ClientID + "&tagName=UMBRACOGETDATA&mvcView=true", ui.Text("template", "insertPageField"), 640, 550);
            umbField.AltText = ui.Text("template", "insertPageField");


            // TODO: Update icon
            MenuIconI umbDictionary = editorSource.Menu.NewIcon();

            umbDictionary.ImageURL       = GlobalSettings.Path + "/images/editor/dictionaryItem.gif";
            umbDictionary.OnClickCommand =
                ClientTools.Scripts.OpenModalWindow(
                    IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" +
                    editorSource.ClientID + "&tagName=UMBRACOGETDICTIONARY&mvcView=true", ui.Text("template", "insertDictionaryItem"),
                    640, 550);
            umbDictionary.AltText = "Insert umbraco dictionary item";

            var macroSplitButton = new InsertMacroSplitButton
            {
                ClientCallbackInsertMacroMarkup = "function(alias) {editViewEditor.insertMacroMarkup(alias);}",
                ClientCallbackOpenMacroModel    = "function(alias) {editViewEditor.openMacroModal(alias);}"
            };

            editorSource.Menu.InsertNewControl(macroSplitButton, 40);

            MenuIconI umbTemplateQueryBuilder = editorSource.Menu.NewIcon();

            umbTemplateQueryBuilder.ImageURL       = UmbracoPath + "/images/editor/inshtml.gif";
            umbTemplateQueryBuilder.OnClickCommand = "editViewEditor.openQueryModal()";
            umbTemplateQueryBuilder.AltText        = "Open query builder";

            if (_template == null)
            {
                InitializeEditorForPartialView();
            }
            else
            {
                InitializeEditorForTemplate();
            }
        }
コード例 #4
0
        protected override void OnInit(EventArgs e)
        {
            _template = new Template(int.Parse(Request.QueryString["templateID"]));
            //
            // CODEGEN: This call is required by the ASP.NET Web Form Designer.
            //
            InitializeComponent();
            base.OnInit(e);
            Panel1.hasMenu = true;

            var editor = Panel1.NewTabPage(ui.Text("template"));

            editor.Controls.Add(Pane8);

            var props = Panel1.NewTabPage(ui.Text("properties"));

            props.Controls.Add(Pane7);

            SaveButton            = Panel1.Menu.NewButton();
            SaveButton.Text       = ui.Text("save");
            SaveButton.ButtonType = MenuButtonType.Primary;
            SaveButton.ID         = "save";
            SaveButton.CssClass   = "client-side";

            Panel1.Text            = ui.Text("edittemplate");
            pp_name.Text           = ui.Text("name", UmbracoUser);
            pp_alias.Text          = ui.Text("alias", UmbracoUser);
            pp_masterTemplate.Text = ui.Text("mastertemplate", UmbracoUser);


            // Editing buttons
            MenuIconI umbField = editorSource.Menu.NewIcon();

            umbField.ImageURL       = UmbracoPath + "/images/editor/insField.gif";
            umbField.OnClickCommand =
                ClientTools.Scripts.OpenModalWindow(
                    IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" +
                    editorSource.ClientID + "&tagName=UMBRACOGETDATA", ui.Text("template", "insertPageField"), 640, 550);
            umbField.AltText = ui.Text("template", "insertPageField");


            // TODO: Update icon
            MenuIconI umbDictionary = editorSource.Menu.NewIcon();

            umbDictionary.ImageURL       = GlobalSettings.Path + "/images/editor/dictionaryItem.gif";
            umbDictionary.OnClickCommand =
                ClientTools.Scripts.OpenModalWindow(
                    IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" +
                    editorSource.ClientID + "&tagName=UMBRACOGETDICTIONARY", ui.Text("template", "insertDictionaryItem"),
                    640, 550);
            umbDictionary.AltText = "Insert umbraco dictionary item";

            editorSource.Menu.NewElement("div", "splitButtonMacroPlaceHolder", "sbPlaceHolder", 40);

            if (UmbracoConfig.For.UmbracoSettings().Templates.UseAspNetMasterPages)
            {
                MenuIconI umbContainer = editorSource.Menu.NewIcon();
                umbContainer.ImageURL       = UmbracoPath + "/images/editor/masterpagePlaceHolder.gif";
                umbContainer.AltText        = ui.Text("template", "insertContentAreaPlaceHolder");
                umbContainer.OnClickCommand =
                    ClientTools.Scripts.OpenModalWindow(
                        IOHelper.ResolveUrl(SystemDirectories.Umbraco) +
                        "/dialogs/insertMasterpagePlaceholder.aspx?&id=" + _template.Id,
                        ui.Text("template", "insertContentAreaPlaceHolder"), 470, 320);

                MenuIconI umbContent = editorSource.Menu.NewIcon();
                umbContent.ImageURL       = UmbracoPath + "/images/editor/masterpageContent.gif";
                umbContent.AltText        = ui.Text("template", "insertContentArea");
                umbContent.OnClickCommand =
                    ClientTools.Scripts.OpenModalWindow(
                        IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/insertMasterpageContent.aspx?id=" +
                        _template.Id, ui.Text("template", "insertContentArea"), 470, 300);
            }


            //Spit button
            editorSource.Menu.InsertSplitter();
            editorSource.Menu.NewElement("div", "splitButtonPlaceHolder", "sbPlaceHolder", 40);

            // Help
            editorSource.Menu.InsertSplitter();

            MenuIconI helpIcon = editorSource.Menu.NewIcon();

            helpIcon.OnClickCommand =
                ClientTools.Scripts.OpenModalWindow(
                    IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/settings/modals/showumbracotags.aspx?alias=" +
                    _template.Alias, ui.Text("template", "quickGuide"), 600, 580);
            helpIcon.ImageURL = UmbracoPath + "/images/editor/help.png";
            helpIcon.AltText  = ui.Text("template", "quickGuide");
        }