We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4385
    • 372 Posts
    Does anyone have an example of creating a resolver to import migxconfigs for a customer manager page package?

    This question has been answered by Bruno17. See the first response.

      DropboxUploader -- Upload files to a Dropbox account.
      DIG -- Dynamic Image Generator
      gus -- Google URL Shortener
      makeQR -- Uses google chart api to make QR codes.
      MODxTweeter -- Update your twitter status on publish.
    • discuss.answer
      • 4172
      • 5,888 Posts
      you don't need to import them.
      you can use the parameter &configs=yourConfiguration:yourPackage
      MIGX will load the configuration from exported .js - file from your Package.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 4385
        • 372 Posts
        Great, that sounds simple. Where do I use the parameter? I have all three in
        /core/components/mypackage/migxconfigs/tab1.config.js
        they work fine if I use the import button.

        Where does this go? &configs=tab1.config.js:mycomponent
        [ed. note: bwente last edited this post 12 years, 8 months ago.]
          DropboxUploader -- Upload files to a Dropbox account.
          DIG -- Dynamic Image Generator
          gus -- Google URL Shortener
          makeQR -- Uses google chart api to make QR codes.
          MODxTweeter -- Update your twitter status on publish.
          • 4172
          • 5,888 Posts
          see screeshot and this is

          transport.menus.php for that package:

          /**
           * menus transport file for migxMultiLang extra
           *
           * Copyright 2014 by Bruno Perner [email protected]
           * Created on 01-10-2014
           *
           * @package migxmultilang
           * @subpackage build
           */
          
          if (! function_exists('stripPhpTags')) {
              function stripPhpTags($filename) {
                  $o = file_get_contents($filename);
                  $o = str_replace('<' . '?' . 'php', '', $o);
                  $o = str_replace('?>', '', $o);
                  $o = trim($o);
                  return $o;
              }
          }
          /* @var $modx modX */
          /* @var $sources array */
          /* @var xPDOObject[] $menus */
          
          $action = $modx->newObject('modAction');
          $action->fromArray( array (
            'id' => 1,
            'namespace' => 'migx',
            'controller' => 'index',
            'haslayout' => '1',
            'lang_topics' => 'example:default',
            'assets' => '',
          ), '', true, true);
          
          $menus[1] = $modx->newObject('modMenu');
          $menus[1]->fromArray( array (
            'text' => 'migxMultiLang',
            'parent' => '',
            'description' => '',
            'icon' => '',
            'menuindex' => '',
            'params' => '&configs=mml_languages:migxmultilang||mml_translationslist:migxmultilang||mml_formtabs:migxmultilang',
            'handler' => '',
            'permissions' => '',
          ), '', true, true);
          $menus[1]->addOne($action);
          
          return $menus;
          
          
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 4385
            • 372 Posts
            I was close. I was just missing the format of the parameters. I thought what I had was correct, since it imported correctly when I used the button or created the menu manually.

            <?php
            /**
             * menus transport file for TargetX extra
             *
             * Created on 02-09-2014
             *
             * @package targetx
             * @subpackage build
             */
            
            if (! function_exists('stripPhpTags')) {
                function stripPhpTags($filename) {
                    $o = file_get_contents($filename);
                    $o = str_replace('<' . '?' . 'php', '', $o);
                    $o = str_replace('?>', '', $o);
                    $o = trim($o);
                    return $o;
                }
            }
            /* @var $modx modX */
            /* @var $sources array */
            /* @var xPDOObject[] $menus */
            
            $action = $modx->newObject('modAction');
            $action->fromArray( array (
              'id' => 1,
              'namespace' => 'targetx',
              'controller' => 'index',
              'haslayout' => true,
              'lang_topics' => 'targetx:default',
              'assets' => '',
            ), '', true, true);
            
            $menus[1] = $modx->newObject('modMenu');
            $menus[1]->fromArray( array (
              'text' => 'TargetX',
              'parent' => 'components',
              'description' => 'Target Marketing for MODx',
              'icon' => '',
              'menuindex' => 0,
              'params' => '&configs=targetx||targetprofiles||targetgroups',
              'handler' => '',
              'permissions' => '',
              'id' => 1,
            ), '', true, true);
            $menus[1]->addOne($action);
            
            return $menus;
            


            Maybe that will solve my other problem with the menu not being assigned to MIGX, I need to make the namespace migx too.
              DropboxUploader -- Upload files to a Dropbox account.
              DIG -- Dynamic Image Generator
              gus -- Google URL Shortener
              makeQR -- Uses google chart api to make QR codes.
              MODxTweeter -- Update your twitter status on publish.