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

    I looked at them but I am not able to figure out how to run it.

    I am sorry I am a little dense on this!
      • 32963
      • 1,732 Posts
      Ok,

      I might have to do some documentation on the installer but it might take a little while before I can get it done.

      But here another look at how it can be done:

      First you need to add your snippet/splugin code to a file and copy that file into the install/ folder. For example install/quickedit.plugin.tpl.

      Then edit the setup.info.php file:

      $moduleName = "QuickEdit Module";
      $moduleVersion = "1.0";
      $moduleSQLBaseFile = "setup.sql";
      $moduleWhatsNewFile = "";
      $moduleWhatsNewTitle = "";

      In the above we sspecify the name of the package to be installed using $moduleName, the version and the .sql to run doing install (optional).

      Here we specify the plugin to be installed by adding the parts to an array - name, description, type - 0:file or 1:content, file or content,properties, event, guid. Since our plugin source in contained inside a file we set the type to 0.

      # setup plugins - array : name, description, type - 0:file or 1:content, file or content,properties, event, guid
      $mp = &$modulePlugins;
      $mp[] = array("QuickEdit","Renders QuickEdit links in the frontend",0,"$setupPath/quickedit.plugin.tpl","","OnParseDocument,OnWebPagePrerender","f888bac76e1537ca8e0cbec772b4624a");

      Here we can also add a module to the installer but this time using the array - name, description, type - 0:file or 1:content, file or content,properties, guid,enable_sharedparams

      # setup modules - array : name, description, type - 0:file or 1:content, file or content,properties, guid,enable_sharedparams
      $mm = &$moduleModules;
      $mm[] = array("QuickEdit","Renders QuickEdit links in the frontend",0,"$setupPath/quickedit.module.tpl","&mod_path=Module Path (from site root);string;assets/modules/quick_edit","f888bac76e1537ca8e0cbec772b4624a",1);

      Use the callback function option to invoke a function at the end of the install. Here you can perform other tasks.

      # setup callback function
      $callBackFnc = "clean_up";
      
      function clean_up($sqlParser) {
         // your code here
      }


        xWisdom
        www.xwisdomhtml.com
        The fear of the Lord is the beginning of wisdom:
        MODx Co-Founder - Create and do more with less.
        • 34162
        • 1 Posts
        Raymond,

        I will take a closer look!

        Thanks