Difference between revisions of "TNG Mod Manager"

From Genwiki

Jump to: navigation, search
m
m
Line 30: Line 30:
 
** if the new file already exists, it examines the version level
 
** if the new file already exists, it examines the version level
 
* if the mod is not yet installed and the target locations can be identified, then the option to install is presented
 
* if the mod is not yet installed and the target locations can be identified, then the option to install is presented
* if the mod is completely installed, the option to remove the Mod is presented
+
* if the mod is completely installed, the option to remove the Mod is presented and the option to edit parameters if any exist
 
* if the mod is partially installed, the option to clean the Mod is presented.  A Clean operation will attempt to remove any inserted code, restore and replaced code, and remove any created file.
 
* if the mod is partially installed, the option to clean the Mod is presented.  A Clean operation will attempt to remove any inserted code, restore and replaced code, and remove any created file.
  

Revision as of 21:37, 27 April 2009

Overview

This TNG Mod Manager is intended 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. Once installed, it may be connected into the TNG Administrative page for easy access. The Mod Manager consists of a single script that is copied to the TNG admin folder. A sub folder in the TNG admin folder must also be created and is used to contain the Mod configuration files and associated Mod support files.

  • Rev 1.0 Apr 26 2009 - Initial public release
  • Rev 0.2 Apr 15 2009 - Continued Testing with small user group, added a parameter editing directive allowing easier customization of mod variables
  • Rev 0.1 Mar 28 2009 - Beta Release to small user group (contact me if you wish to assist with this testing)
  • Rev 0.0 Mar 21 2009 - Pre-Release Testing
  • Rev A.0 Mar 20 2009 - Dev Testing

Screen Shot of the Mod Manager

Operation

The Mod Manager examines the mod_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
  • identifies new files to be created
    • if the new file already exists, it examines the version level
  • if the mod is not yet installed and the target locations can be identified, then the option to install is presented
  • if the mod is completely installed, the option to remove the Mod is presented and the option to edit parameters if any exist
  • if the mod is partially installed, the option to clean the Mod is presented. A Clean operation will attempt to remove any inserted code, restore and replaced code, and remove any created file.

Installation

  • Download the current version of the Mod Manager from Mod_Manager_V1.0.zip
  • Unzip the archive and examine the contents.
  • Extract the manage_mods.php script and copy it to your TNG admin folder
  • Create a new sub folder in the TNG admin folder and name it "mod_folder"
  • Extract the Manage_Mods_Ver.cfg configuration file and copy it to the mod_folder

Using the Manager

  • The Mod Manager may be called directly via your browser by adding /manage_mods.php to the end of your admin folder url. For example, my site would be "http://genealogy.mcfadyen.ca/admin/manage_mods.php"
  • After running the script for the first time, you should install the Mod Manager mod, this will create a link to the Mod Manager in the left hand administrative menu and a "Mod Manager" button in the main window menu.


Mod Directive Files

The following Mod Directive Files are available and included in the download zip

  • Gendex Search Form for the Advanced Search Page
  • Place Search Form for the Advanced Search Page
  • Private Notes Display for Administrators
  • Lastname Comma Firstname display format
  • Geocoding Assistant
  • MediaWiki Links

Creating Mod Configuration Files

The following outlines a typical configuration file and the associated keywords. Note that the % character is used to assist in delimiting the fields and keywords.


%name:Insert Mod Title Here%
%version:V1.0%
%description:Insert the description of your mod here.
Include any special notes or even links to your support page.
The percent sign marks the end of the description%

%target:filename_to_change.php%
%location:%
This must be a unique section of code in the target source file.  
If you have a choice, select snippits that are likely to be the 
same from TNG version to version.  It is all the code between the %location:%
and the %end:%.  White space before and after this section will be trimmed
before trying to locate it in the source file.
%end:%
%insert:before%
This is the new code that will be inserted immediately before
the %location:% code.  The directive can be %insert:before%,  %insert:after%, or %replace:%
%end:%  


%newfile:placesearchform.php%
%fileversion:2.0%
This would be the contents of a new file to be created.    
The fileversion above is used to compare against a possible version number
in the newfile if it already exists. The new file contents will be
everything between the %fileversion:$ directive and the %fileend:% directive.
The new file should have a %version:% directive as shown below.
// New File Contents
// More Comments
// %version:2.0%
Code
Code
%fileend:%
%copyfile:new_icon_file.gif%

The %copyfile: directive is used to copy a file from mod_folder to the main TNG folder.

Additional Directives

  •  %fileoptional:% - used after a %target:% keyword to indicate that if the file does not exist, no error should be generated. This is useful when describing parameters in a file that will be created during the mod
  •  %parameter - see cfg files for examples or contact the author
  •  %desc - see cfg files for examples or contact the author
Personal tools