module.php

The module.php contains all "meta" information about your module, required by Form Tools to access and list your module in the administrator's Module section. It should be located in the module folder's root.

Here's an example of this file contents, taken from the Export Manager.

<?php
/*
 * Module file: Export Manager
 */

$MODULE["author"]          = "Ben Keen";
$MODULE["author_email"]    = "ben.keen@gmail.com";
$MODULE["author_link"]     = "http://www.formtools.org";
$MODULE["version"]         = "1.0.0-beta-20090114";
$MODULE["date"]            = "2009-01-14";
$MODULE["origin_language"] = "en_us";
$MODULE["supports_ft_versions"] = "2.0.0";

// define the module navigation - the keys are keys defined in the language file. This lets
// the navigation - like everything else - be customized to the users language. The paths are always built
// relative to the module's root, so help/index.php means: /[form tools root]/modules/export_manager/help/index.php
$MODULE["nav"] = array(
  "module_name"              => array('{$module_dir}/index.php', false),
  "word_settings"            => array('{$module_dir}/settings/', false),
  "word_help"                => array('{$module_dir}/help/', false)
);
?>
Setting
Explanation
author
(required) the name of the author, or company name.
author_email
(optional) the email address of the author / company email.
author_link
(optional) a URL to the author's website.
version
(required) the current module version. You can give your versions any numbering scheme you want. We use the commonly used technique of X.Y.Z, where X is the major release number, Y is the minor release and Z is for bug fix releases.
date
(optional) the release date of the module version in the format YYYY-MM-DD.
origin_language
(required) the name of the language file, minus the .php extension.
supports_ft_versions
A comma delimited list of supported Form Tools versions. This setting should ignore beta and release candidate releases - just the final versions.
nav
(required) This setting defines your module's menu items. It is an array, whose keys correspond to entries in your language file. The values are an array with two indexes: the URL of the page, and whether it should appear as a submenu item or not.
<?php
$MODULE["nav"] = array(
  "module_name"   => array('{$module_dir}/index.php', false),
  "word_settings" => array('{$module_dir}/settings/', false),
  "word_help"     => array('{$module_dir}/help/', false)
);
?>
The "module_name", "word_settings" and "word_help" have corresponding entries in the module's lang/en_us.php language file (i.e. $L["module_name"] = "Export Manager" etc.). The values each contain the {$module_dir} Smarty placeholder. This is a convenient way to refer to the module root URL. Often you find you won't need it, but if your module arranges its files in subfolders, this wards against invalid links.
Edit Page