Help: Mod Manager

Overview

The TNG 12 version of the Mod Manager is based on the Mod Manager originally developed by Brian McFadyen, updated by Sean Schwoere to work with the Joomla TNG Component, and updated in TNG 10.0.3 and 10.1 to provide a more integrated way to install, remove and manage modifications to the TNG software package that have been coded to work with this manager.

The new Mod Manager provides a single line summary of the mod status which can be expanded to view the complete Description and errors when applicable. The Affected Files List can be displayed by hovering over the + plus sign in the Files column. You can also use the Expand All inner menu to expand all entries to show the status like the old Mod Manager used to do. The Expand All option is helpful when filtering the list by Partially Installed or Cannot Install so you can see what the errors are.

The Mod Manager is connected into the TNG Administrative page for easy access. The Mod Manager adds the following folders to TNG:

  • mods to contain the Mod configuration files and associated Mod support files. The mods folder can now be renamed. The Mod Manager uses the $modspath variable to resolve the folder name.
  • extensions to contain some of the mod extensions that are installed by other Mod Manager config files. The extensions folder can now be renamed. The Mod Manager uses the $extspath variable to resolve the folder name.
  • classes which contain the Object Orient Progamming classes that were split and enhanced from the previous managemods.class.php created by Sean Schwoere from Brian's original Mod Manager code.

The Mod List tab now combines the previous Mod List and Batch Updates that was added by Rick Bisbee in TNG 10.0.3 to provide the capability to execute the same action against multiple mods. The Description and extended status can be displayed by clicking the right arrow in the Status column or anywhere on the line. Hovering over the line will high light the line to make it easier to select the status to expand. Hovering over the + plus sign in the Files column will display the Affected Files list, that is the files modified, created, and copied by this mod.

TNG v12 adds the following changes if the Show Other Developer Tools option is enabled:

  • a click on the file name will open the Parser Table for that mod
  • a click on the cfg file name will display the cfg file in another tab
  • a Detail button in the Status cell acts as a toggle to expand or collapse the display of the file directives when the status is Installed or OK to Install.

The View Log tab was added by Ken Roy in TNG 10.0.3 to display the Mod Manager Log which is now split from the Admin Log. The Mod Manager log is the reformated log from the Mod Manager created by Rick Bisbee and Robin Richmond in TNG 10.03 for easier readability of the actions. The messages were also greatly simplified.

The Options tab is a modification of the one added by Ken Roy in TNG 10.0.3 to allow changing some of the execution behavior of the Mod Manager.

The Analyze TNG Files tab is an optional tab that can be enabled in the Options screen that allows you to select a TNG file and view which mods change that specific TNG file.

The View Parser Table tab is an optional tab that can be enabled in the Options screen by enabling the Show Other Development Tools that allows you to view how the mod is parsed by the Mod Manager.

The Recommended Changes tab is an optional tab that can be enabled in the Options screen that allows you to update your cust_text.php files if you did not do so as part of the TNG upgrade readme.

Additional information can be found in the Mod Manager article and in the TNG Mod Manager category of articles on the TNG Wiki.

You can view the Mod Manager article in TNG Wiki to see what enhancements were made in TNG v12.

Top

Operation

The Mod Manager examines the mods folder and reads each cfg file that it finds. The cfg files are directive files that describe the mod, the files and locations to be modified, and the code that is used in the modification.

The Mod Manager checks the following:

  • ensures the user is logged in
  • examines each code location and change
    • ensures the location can be found
    • ensures the target location is unique
    • identifies whether the target location has already been installed
  • creates any specified folder or directory
  • identifies new files to be created. If the file is marked as protected it will not be removed by the Uninstall or Clean Up.
  • identifies files to be copied to the TNG root or a specified folder. If the file is marked as protected it will not be removed by the Uninstall or Clean Up.

Top

Status

The Mod Manager returns the following status:

  • Ok to Install if the mod is not yet installed and the target locations can be identified, then the Install button is displayed
  • Installed if the mod is completely installed, the option to Uninstall the Mod is presented and the option to Edit parameters if any exist. Mods with edit parameters are identified by[Option] after the Installed status.
  • Partially installed if the mod is partially installed, the Cleanup button is provided. A Clean up operation will attempt to remove any inserted code, restore and replaced code, and remove any created or copied files.
  • Cannot Install if the mod cannot be installed. You will need to expand the Status to get more detailed messages as to why the mod cannot be installed.

For examples of the Mod Manager Status screens and how to interpret the various statuses, see Mod Manager - Interpreting Status

Top

Mod Syntax

The Mod Manager syntax basically includes:

Header section that includes

  • Name - the name of the mod, wiki article and file name
  • Version - the version of the mod, where the first 3 period places represents the lowest TNG version to which the mod applies
  • Description - provides a brief description of the mod, the Mod Developer's name, and a URL link to the TNG Wiki article for the mod.

Target sections that specify the file that is the target of the change and includes the following directives. A note can now be added to the target.

  • Location - that specifies the code location to be changed. A note can now be added to the location.
  • Action keyword - that specifies whether to replace or insert code before or after the location

New File directives that create the file when the mod is installed

Copy File directives that copy the specified file to the TNG root (%copyfile) or to a subfolder (%copyfile2)

For detailed information on the Mod Manager Syntax, see Mod Manager Syntax

Top

Config Files

Installing Mods

The TNG Wiki provides information on Installing Config Files to install the TNG mods.

Interpreting Status

The TNG Wiki provides information on Interpreting Status.

Config File Syntax

The TNG Wiki provides information on the Mod Manager Syntax.

Creating Config Files

The TNG Wiki provides information for the mod developers on the Creating Config Files.

Top

Batch Operations

The Batch Operations function introduced in TNG 10.0.3 as a Batch Updates tab is now combined in the Mod List and allows specific actions on multiple mods using the Select Filter. You must choose from the status filter list pull down and click Go to display the available controls for the specific status selected. Delete is only available for the Partially Installed status if you enable the Option, which we recommend that you leave as No, except for when you need to delete multiple mods in the Partially Installed status, such as a prior version of the same mod. Likewise there is a Delete Installed mods option that will allow deleting installed mods without first uninstalling them. This option was added to allow deleting previous versions of the same mod, if you forgot to delete them before installing the new version. Here again it is recommend that you leave the option as No and just enable it when needed. The Delete button is only shown on the Select list if both allow delete options are enabled.

Caution:You should only use Batch Operations if you have a good backup of your website and can quickly restore it if the batch operations renders your site inoperable, which can easily happen if you do not delete previous versions of the mods. Note that it is recommended that you batch Uninstall all your Installed mods and then batch Clean Up all Partially Installed mods before doing a TNG upgrade.

The Select Filter options are:

  • All - displays all a list of all the .cfg files in the mods folder. When you select a specific status then Action buttons will become available
  • Ok to Install - displays a list of all the mods that can be
    • Installed based on your selections and clicking the Install button
    • Deleted from your mods folder based on your selections and clicking the Delete button
  • Installed - displays a list of all the mods that are currently installed that can be
    • Removed based on your selections and clicking the Remove button
  • Partially Installed - displays a list of all the mods that are partially installed and must be
    • Cleaned up based on your selections and clicking the Clean Up Selected button
  • Cannot Install - displays a list of all the mods that cannot be installed, either due to Bad Targets or Missing files, that can be
    • Deleted from your mods folder based on your selections and clicking the Delete Selected button
  • Select - added in TNG v12 - displays a list of all the mods that can be selected regardless of status and then just returns those mods in the list
    • The Delete button will only be available on the Select list if you Allow Delete Selected of Partially Installed Mods and Allow Delete of individually Installed Mods. This capability was added mainly for the mod developer to clean up their testing environments.

Top

Options

The Options allows you to specify some of the Mod Manager behavior for the

Mod Manager Log Options

  • Log File Name - allows you to specify the file name to be used for the Mod Manager log. The default is modmgrlog.txt.
  • Max number of Transactions - allows you to specify how many log transactions to keep in the log. The default is 200 transactions.
  • Collapse Log display - allows you to specify if you want the View Log displayed in a collapsed or expanded format initially. The default is Yes but can be changed to No to display the log expanded normally.
  • Redirect to Log For - allows you to specify if you want go to the Mod List to be redirected to the View Log on Errors Only or for All Transactions. The default is to redirect on Errors Only which displays the View Log only if errors are encountered in the install, uninstall, clean up, or delete transaction.
  • Log full path for file actions - allows you to select No to only display the relative path for files in the log. The default is Yes to display the full absolute path.

Display Settings Options

  • Sort Lists by - allows you to specify on which column to sort the Mod List. Options are Mod Name or Config File Name. The default is Mod Name.
  • Use Fixed Headers - allows you to change the option so that fixed headers are not displayed. This option is not noticable if you have a large monitor and few mods. The default is Yes to display the fixed headers. Note that regardless of this option setting, fixed headers will not be displayed for smart phones (mobile mode).
  • Adjust Fixed Headers - allows you to enable the adjust fixed headers jQuery when the fixed headers are not displayed correctly. This option is only needed on certain monitors. The default is No to not use the jQuery javascript to adjust the fixed headers.
  • Use Stripes - allows you to change the option not to use stripes when displaying the Mod List. The default is Yes which uses the databackalt class to provide alternate color striping after N number of rows.
  • Stripe after number of rows - allows you to set the number of rows to display before the alternate color stripe is displayed. The default is 3 rows of databack and then 3 rows of databackalt.
  • Remove spaces from file names in Mod List: - allows you to remove the blanks from the Mod Names before displaying them in the Mod Name list. The default is No which will display the embedded blanks in the Mod Name which should match the TNG Wiki article name.
  • Show Analyze TNG Files tab - allows you to specify if you want the Analyzer TNG Files tab to be displayed. The default is No which is to suppress the display of the Analyze TNG Files tab.
  • Show Other Developer tools - allows you to specify if you want the View Parser Table tab to be displayed. The default is No which is to suppress the display of the View Parser Table tab. This option also controls whether a click on the Mod Name will display the Parser Table for that specific mod, and whether a click on the Config File Name will show the config file in another tab.
  • Show Recommended Updates tab - allows you to specify if you want the Recommended Updates tab to be displayed. The default is No which is to suppress the display of the Recommended Updates tab. Note that this tab should not be necessary if you did the TNG v12 cust_text.php upgrade.

Other Options

  • Allow Delete Selected on Partially Installed Mods - enables the Delete button on the Partially Installed filtered list screen that allows deleting more than one mod at a time, such as deleting the prior versions of mods that were not deleted prior to installing the newer versions. The default is No. We recommend that you only enable this option when you need it to delete multiple mods without having to uninstall the current versions to delete the prior versions of the mod when you forgot to Uninstall and Delete previous versions of the mod before installing a new version and that you normally leave this option set to No and reset the option to No after you deleted previous versions of the mod that show as partially installed.
  • Allow Delete of individually Installed Mods - allows you to turn on the option to display a Delete button next to the Uninstall button for individually installed mods, such as deleting the prior version of a mod that was not deleted prior to installing the newer version. We recommend that you only enable this option when you need it to delete a previous version of a mod without having to uninstall the current version in order to delete the prior version and that you normally leave the option set to No and reset the option to No after you deleted previous versions of the mod that show as installed..
  • Allow Delete support folder when mod is deleted: - allows you to turn on the option to delete the folder(s) associated with a mod when deleting the mod. The default is No. We recommend that you only enable this option if you understand the risk that unintended folders could be deleted. We believe this risk is very small..

Top

Analyze TNG Files

Created by Rick Bisbee this tool located under the Analyze TNG Files tab was previously provided as a mod. This tool lets developers examine mods to see precisely how they interact with each other. Two mods changing the same block of code almost always results in Mod Manager errors. You must enable the Show Analyzer TNG Files tab by setting the Options to Yes if want the Analyze TNG Files tab to be displayed.

The analyzer works by examining every mod in the mods folder and cataloging which target files and which blocks of code each one modifies. It then lists the affected file names in the left hand column. Selecting one of those target files displays a list on the right showing all the mods that change it. Each mod shown on the right has a link to open a section of the page displaying the actual modifications made by the Mod Manager Config file. A user can compare changes to the target file to see where potential conflicts might be.

This is helpful not only to find conflicts between two mods but also to know which mods need to be cleaned up and re-installed after replacing the given target file.

The TNG Wiki provides additional information for the mod developers on Using the Mod Analyzer.

Top

View Parser Table

This tool is designed mainly for developers. The Parser Table shows how the Mod Manager parsed the mod config file (.cfg) for processing its components into a table, which is then passed to other mod manager scripts for further processing. If there is a problem with a mod, the first place to check is the parse table to see if all the mod's directives and arguments are being captured properly.

You can use this tab to select a mod from a list whose table you want to view, or alternatively you can click on the mod name in the Mod List to view the parse table for that mod, if you enabled the Show Other Developer Tools option.

Displaying this tab is optional. To use it select 'Display Settings/Show Other Developer tools' on the options tab. If the tab option is turned off, the link on the listing page will also be disabled.

Top

Recommended Changes

The Recommended Changes tab is an optional tab that can be enabled in the Options screen that allows you to update your cust_text.php files if you did not do so as part of the TNG upgrade readme.

It is intended to be used if a mod cannot be installed because it is looking for the new comment string at the top of the cust_text.php files starting with TNG v12. The option will be turned off when you click the Update button to change your existing cust_text.php files. The code checks whether the files have previously been updated.