We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13352
    • 26 Posts
    Hi,

    I want to add a SUB menu (MySubMenu) like this :

    SITE
    Home | Preview | MySubMenu | Clear Cache | Search | ....

    I add an item at file : .../manager/frames/menu.php :
    $sitemenu[] = ’<li><a onclick="this.blur();" href="index.php?a=71" target="main">’.$_lang[’MySubMenu’].’</a></li>’;

    And add definition of ’MySubMenu’ at .../manager/include/lang/english.inc.php

    I can see that submenu after relogin to manager area, but I don’t know how to link it. Please see : href="index.php?a=71" target="main"

    If I put a=71, it will call the search page. If a=4, it will go to home page.

    What must I put here ? Where is this value (4, 71, 72 etc) defined ?
    And is there any other file that must I change ?

    Thanks in advance.
    - Jack -


      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Those "a" values are used in the manager’s index.php file. There’s a huge switch to handle them. It’s usually much better to make a module to add functionality rather than try to hack the core scripts.

      You can easily add a link/icon to the main Manager "welcome" page (or if you really feel you must add a menu item) using "index.php?a=112&id=<id of your module>" since 112 runs a module, and the id tells it which one to run.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 13352
        • 26 Posts
        Quote from: sottwell at May 07, 2010, 03:35 AM

        Those "a" values are used in the manager’s index.php file. There’s a huge switch to handle them. It’s usually much better to make a module to add functionality rather than try to hack the core scripts.

        You can easily add a link/icon to the main Manager "welcome" page (or if you really feel you must add a menu item) using "index.php?a=112&id=<id of your module>" since 112 runs a module, and the id tells it which one to run.

        Hi Susan,

        Very quick answer, many thanks. Thanks also for your tutorial at : sottwell.com, very nice.
        One question: if the user don’t have access to module menu, what must I do ? Is there another way, not to hack the core ?

        Thanks.
        - jack -
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          As long as he has the ability to "run" modules, you can add an item to the icons on the "welcome" page (see the assets/templates/manager/welcome.html file).
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 13352
            • 26 Posts
            Quote from: sottwell at May 07, 2010, 03:43 AM

            As long as he has the ability to "run" modules, you can add an item to the icons on the "welcome" page (see the assets/templates/manager/welcome.html file).

            Hi Susan,

            Thanks for your tips. But if I give the "RUN module" access to this user, does it means that he can execute ALL of module ?
            How to set that he just can run the specific module ?
            If it’s inside of each module, it means I must edit ALL of module, something like checking the ROLE of this user ?
            I didn’t find it under Security -> Roles -> TheUserRoleName. I just can fine option to give him RUN module access.

            Or do you mean, I DON’T NEED to create a new module. Just create a new resource, then create a link from welcome page to point to this new resource ?

            Sorry, I’m not so clear ... sad
            I need a SUBMENU, so I think I must create a simple module for it. But can we grant access ONLY to this module, and restrict to other modules?

            Thanks.
            - jack -
              • 26931
              • 2,314 Posts
              ... is this of any help?:

              "Customized Manager"
              SystemEvents:
              OnManagerWelcomePrerender -> before the content
              OnManagerWelcomeHome -> in the home tab
              OnManagerWelcomeRender -> after the content

              http://modxcms.com/forums/index.php/topic,37321.msg225591.html#msg225591

              http://modxcms.com/forums/index.php/topic,43572.msg260167.html#msg260167
                • 13352
                • 26 Posts
                Quote from: sharkbait at May 07, 2010, 04:31 AM

                ... is this of any help?:

                "Customized Manager"
                SystemEvents:
                OnManagerWelcomePrerender -> before the content
                OnManagerWelcomeHome -> in the home tab
                OnManagerWelcomeRender -> after the content

                http://modxcms.com/forums/index.php/topic,37321.msg225591.html#msg225591

                http://modxcms.com/forums/index.php/topic,43572.msg260167.html#msg260167


                Hi Susan & sharkbait,

                Many thanks. I got it .. smiley

                Have a nice day,
                - jack -
                  • 13352
                  • 26 Posts
                  Quote from: jackprobe at May 07, 2010, 04:45 AM

                  Quote from: sharkbait at May 07, 2010, 04:31 AM

                  ... is this of any help?:

                  "Customized Manager"
                  SystemEvents:
                  OnManagerWelcomePrerender -> before the content
                  OnManagerWelcomeHome -> in the home tab
                  OnManagerWelcomeRender -> after the content

                  http://modxcms.com/forums/index.php/topic,37321.msg225591.html#msg225591

                  http://modxcms.com/forums/index.php/topic,43572.msg260167.html#msg260167


                  Hi Susan & sharkbait,

                  Many thanks. I got it .. smiley

                  Have a nice day,
                  - jack -

                  Hi,

                  It’s solved. Because I need a SUBmenu, so I must create a new module (like Susan said). Then in manager area, I must give a "RUN module" access to this user. The problem of creating new module is that modx add a backslash (\) [at the php code input form] to database, as I want to create a new module. This caused the module didn’t work (just got blank page). Setting the "magic_quotes_gpc" to OFF at my php.ini file didn’t solve this problem, so I just update from mysql shell prompt.
                  I’m using LAMP (PHP 5.3.x) & Modx 1.0.3.

                  Many thanks to Susan & Sharkbait.
                  - jack -


                    • 26931
                    • 2,314 Posts
                    hey Jack,

                    great to hear you got it solved ... and thanks for reporting back! smiley
                    have a great weekend,

                    j