Interworx Billing Plugin - WHCMS

Hello,

I am working on a plugin for Interworx to intergrate the WHCMS billing/support system. I have having a few problems and I wish you guys had API documentation for this.

  1. I have it listing one menu item for siteworx and nodeworx, is there a way to create subitems like other menu functions.

  2. I have a template in my Ctrl/Siteworx/Billing.php inside the class and index view. How do I pass that variable to the templates/default.tpl its currently only showing the text on that tpl file. I need access to that variable from the controller class, I tried setting it with setvar and getvar inside template but that did not work.

I would appreciate some advice/assistance in this plugin creation, maybe some documentation that has been written up but not yet published?

Thank You,
Anthony

[QUOTE=anthonycl;17061]Hello,

I am working on a plugin for Interworx to intergrate the WHCMS billing/support system. I have having a few problems and I wish you guys had API documentation for this.[/QUOTE]
Understood Anthony, the plugin documentation is currently lacking, as you’ve discovered, the existing plugins are all there is to go on currently.

  1. I have it listing one menu item for siteworx and nodeworx, is there a way to create subitems like other menu functions.

Yes - you could do the following for example:


  /**
   * Customizations to siteworx menu can be done here
   *
   * @param IWorxMenuManager $MenuMan
   */
  public function updateSiteworxMenu( IWorxMenuManager $MenuMan ) {
    $group = array( 'text'   => 'Hello Group',
                    'class'  => 'iw-i-star' );
    $MenuMan->addMenuItemAfter( 'iw-menu-home', 'your-group-id', $group );

    $item = array( 'text' => 'Hello Item',
                   'url' => '/siteworx/yourlink',
                   'parent' => 'your-group-id',
                   'class' => 'iw-i-plugin' );
    $MenuMan->addMenuItemAfter( 'your-group-id', 'your-item-id', $item );
  }


  1. I have a template in my Ctrl/Siteworx/Billing.php inside the class and index view. How do I pass that variable to the templates/default.tpl its currently only showing the text on that tpl file. I need access to that variable from the controller class, I tried setting it with setvar and getvar inside template but that did not work.

You’d assign a variable to the template from inside the controller action method like this:


    $this->getView()->assign( 'my_variable', 'some value' );

Then in default.tpl (assuming you didn’t specify a different template), you’d do:


<html>
<head></head>
<body>
My variable value is: {$my_variable}
</body>
</html>

Does that help?

I would appreciate some advice/assistance in this plugin creation, maybe some documentation that has been written up but not yet published?

Until and after such documentation is ready, we’ll continue to help you here as questions arise.

Paul