Own button opening a custom window/tab

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • HansMaulwurf
    Junior Member
    • Jul 2012
    • 20

    #1

    Own button opening a custom window/tab

    Hey,

    I'm working with OX community edition and try to integrate an own plugin.

    I already studies the plugin-page and I understood the SMS-button in the contacts-panel. But I can't find a guide or a hint to add these buttons to a different tab (actually it's in the "new-tab") or to the E-Mail-Section.

    The second problem for me is opening a new custom window with labels, buttons etc. I only found how to add own configuration-tabs.

    The guides are a bit outdated sometimes but I want to learn
  • Viktor Pracht
    Open-Xchange Developer
    • Feb 2007
    • 253

    #2
    For the menu, see this post.

    For opening a new window, just use window.open() with your own HTML page as URL. This page can reuse scripts and CSS files of the GUI to get the same look as the main window.

    Comment

    • HansMaulwurf
      Junior Member
      • Jul 2012
      • 20

      #3
      Isn't it possible to create an own inside-window like OX does e.g. with a new-mail-window?

      Comment

      • HansMaulwurf
        Junior Member
        • Jul 2012
        • 20

        #4
        ox.api.mail.open(); does open the new-mail-window. But where is this function defined to look how the window i built?

        Comment

        • Viktor Pracht
          Open-Xchange Developer
          • Feb 2007
          • 253

          #5
          Then you want to use ox.api.window.open(). The first aprameter is the path to your HTML file, the second parameter is an options object. See js/api.js around line 1800 for details.

          Comment

          • HansMaulwurf
            Junior Member
            • Jul 2012
            • 20

            #6
            Great, that's exactly what I was looking for

            Now there is a new question. Which parameter has to be changed (from the own-panel-button-example) to add the button to the edit-tab and not the new-tab? And how do I make a big button instead of the small ones?

            Comment

            • Viktor Pracht
              Open-Xchange Developer
              • Feb 2007
              • 253

              #7
              I'm not sure which example you mean, but the buttons appear in the section to which they are added. The default sections are stored in ox.widgets.toolBar.sections.

              The option to create a big button is a boolean called "big":
              Code:
              var button = new ox.gui.MenuItem({ big: true, ... })

              Comment

              • HansMaulwurf
                Junior Member
                • Jul 2012
                • 20

                #8
                Ok, the function MenuNodes.createBigButtonContext contains this value. But only using
                Code:
                MenuNodes.createBigButtonContext ( "myId", "mailEdit", "themes/default/img/menu/btn_save.gif", alert("This is my own big button") );
                is not enough i guess, because it's not working :/

                I meant this example here: http://oxpedia.org/wiki/index.php?ti...s_in_the_panel

                Comment

                • HansMaulwurf
                  Junior Member
                  • Jul 2012
                  • 20

                  #9
                  Well, this works for adding a big button to the new-tab in the mail section

                  Code:
                  var section = MenuNodes.contexts["moveid"] = { node: new ox.gui.PanelMenuSection("movemail") };
                  
                  var item = ox.widgets.toolBar.menuItems["moveid"] = new ox.gui.MenuItem({
                      id: "moveid",
                      title: "MoveMailTitle",
                      icons: "themes/default/img/menu/btn_save.gif",
                      big: true,
                      action: null
                  });
                  
                  
                  section.node.add(item);
                  
                  changeDisplay("mail", "moveid");
                  But I want it to the edit-tab. changeDisplay("mailedit", "moveid"); or changeDisplay("mailEdit", "moveid"); doesn't work

                  Comment

                  • Viktor Pracht
                    Open-Xchange Developer
                    • Feb 2007
                    • 253

                    #10
                    MenuNodes is wrapper for backward compatibility. The old API had no notion of multiple tabs, and that's why all buttons land on the first tab.
                    The tab-based code is implemented in js/wtk/classes/, with examples of how it's used in js/wtk/.

                    Comment

                    • HansMaulwurf
                      Junior Member
                      • Jul 2012
                      • 20

                      #11
                      ok, I guess I understand the tab-based code, but I don't get how to add only one button to an existing tab. I need the $p, but $p = ox.gui.initToolBar(). If I use this, I create a second ToolBar at the top. And $p.add only adds a whole tab, e.g. the edit-tab. Do I have to rebuild everything just to add one button?

                      Comment

                      • HansMaulwurf
                        Junior Member
                        • Jul 2012
                        • 20

                        #12
                        Is there no way to get this done? I don't believe that it is impossible.

                        Comment

                        • Viktor Pracht
                          Open-Xchange Developer
                          • Feb 2007
                          • 253

                          #13
                          Look at the member of ox.widgets.toolBar. All default tabs and sections are stored there.

                          Comment

                          Working...
                          X