Beispiel #1
0
        private void AddToolbarButton(umbracoPage page)
        {
            int pageId;
            int.TryParse(HttpContext.Current.Request.QueryString["id"], out pageId);

            // TODO: Hack for differing querystrings / consolidate
            if (pageId == 0)
                int.TryParse(HttpContext.Current.Request.QueryString["templateID"], out pageId);
            if (pageId == 0)
                int.TryParse(HttpContext.Current.Request.QueryString["macroID"], out pageId);

            var menu = (ScrollingMenu)Utility.FindControl<Control>((Control c) => c.ClientID.EndsWith("_menu"), page.Page);
            if (menu == null)
            {
                var tabView = (TabView)Utility.FindControl<Control>((Control c) => c.ID == "TabView1", page.Page);

                foreach (TabPage page3 in tabView.GetPanels())
                {
                    page3.Menu.InsertSplitter();
                    AddMenuIcon(page3.Menu, page, pageId);
                }
            }
            else
            {
                menu.InsertSplitter();
                AddMenuIcon(menu, page, pageId);
            }
        }
        private void InjectExtensionControls(umbracoPage umbPage)
        {
            var propertiesPanel = Utility.FindControl<Control>((Control c) => c.ClientID.EndsWith("pnlProperties"), umbPage.Page);

            umbPage.Page.LoadComplete += rootProperties_Load;   // Needed to keep ... after postback
            //this.rootProperties_Load(umbPage, new EventArgs());

            //AddFieldsetTextbox(propertiesPanel, "new", true, "");
            AddFieldsetTextboxForNew(propertiesPanel);
            // AddFieldsetTextboxForAll(rootProperties);
        }
Beispiel #3
0
        private void AddMenuIcon(ScrollingMenu menu, umbracoPage page, int pageId)
        {
            var title = Configuration.GetUmbracoObjectsByPagePath(page.Request.Path).First().Name + " Usages";

            MenuIconI ni = menu.NewIcon();
            ni.AltText = "View Usages";
            ni.OnClickCommand = string.Format("UmbClientMgr.openModalWindow('plugins/census/usages.aspx?sourcePage={0}&sourceId={1}', '{2}', true, 600, 500, 0, 0); return false;", page.Request.Path, pageId, title);
            ni.ImageURL = string.Concat(Configuration.PluginDirectory, "census-toolbar-icon.png");

            TweakMenuButton(ref page);
        }
Beispiel #4
0
        private void TweakMenuButton(ref umbracoPage page)
        {
            // Fix CSS cursor
            var js = @"<script type='text/javascript'>
            $(document).ready(function() {
                $('.editorIcon[alt]').each(
                    function() {
                        if ($(this).attr('alt').indexOf('View Usages') != -1) {
                            $(this).css('cursor', 'pointer');
                        } });
                    });
            </script>";
            page.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "censusJsFixCursor", js);

            // Fix positioning on TinyMCE pages
            var css = "<style type='text/css'>.mceToolbarExternal{padding-left: 15px;}</style>";
            page.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "censusCssFixPositioning", css);
        }
        private Control GetPanel1Control(umbracoPage up)
        {
            var cph = (ContentPlaceHolder)up.FindControl("body");

            return CompatibilityHelper.IsVersion7OrNewer ? cph.FindControl("body_Panel1_container") : cph.FindControl("Panel1");
        }