Each Addon is required to have an Addon.ini file. Taking a look at the Example plugin, we can see what the important features are.

Example Plugin Addon.ini

 

;Addon_Name
Addon_Name = 'Example Plugin'	

;Addon_Unique_ID
Addon_Unique_ID = 15

;Addon_Version
Addon_Version = 1.0

;min_gpeasy_version
min_gpeasy_version = 1.5b4

;Admin_links (Optional)
;Define scripts that are only accessible to administrators with appropriate permissions
[Admin_Link:Admin_Example]

;required
label = 'Admin Example'

;required relative to the addon directory
script = 'Admin_Example.php'

; optional
class = 'Admin_Example'

;Special_links (Optional)
;Define scripts that are accessible to all visitors and will show up in the menu_arrangement script
[Special_Link:Special_Example]

;required
label = 'Special Example'

;required
;relative to the addon directory
script = 'Special_Example.php'

;optional
class = 'Special_Example'

 

Addon Variables

Addon_Unique_ID
The unique id of an add-on is not required unless you wish to upload your add-on to typesettercms.com/Special_Addons.

 

Defining Links

Special and Admin links allow you to easily expand Typesetter CMS. In the above example, we define the Special_Example link with the label, script and class configurations.

Link Configuration

label
Assigns a user readable value to the link for use in menus.
script
Defines which script in your addon folder to execute when your link is requested.
class
If you want a class created when your script is executed, you can assign the name of the class here.

 

;Special_links (Optional)
;Define scripts that are accessible to all visitors and will show up in the menu_arrangement script
[Special_Link:Special_Example]

;required
label = 'Special Example'

;required
;relative to the addon directory
script = 'Special_Example.php'

;optional
class = 'Special_Example'

 

Special vs Admin

Special links are designed to be user accessible, whereas Admin links are protected and can only be accessed when an administrator is logged in.

Special links will also be added to the list of links avaiable to the menu configuration.

Passing Variables to Addon.ini

As of version 1.6.1, there are three variables that are passed to the Addon.ini file.

{$addon}
This is the name of the folder the addon is in.
{$addonRelativeData}
Equivalent to common::GetDir('/data/_addondata/'.$addonDir)
{$addonRelativeCode}
Equivalent to common::GetDir('/data/_addoncode/'.$addonDir)

 

News

Typesetter 5.1
8/12/2017

Typesetter 5.0.1 is now available for download. 5.1 includes bug fixes, UI/UX improvements, ... Read More

Over 8 Times Faster Than Wordpress
5/3/2016

We've known for a long time that Typesetter is fast. It's something we take pride ... Read More

More News

HH-Support

Company located in T├│rshavn, Faroe Islands. * Webpage Design * ReadSpeaker Distribution Partner * Consultant & Provider of a wide range of programs for visually impaired ...

Find out more about our Provider Spotlight

Log In

  Register