addons/example/info.php

Properties

Description

Required file. Used to register what this addon can do with the addon system. Also holds information about this addon that may be viewed in the addon management page in the admin.

This is the only required file for an addon; the rest of the files should only be used if the functionality provided by those files are needed. This file is included with each page load if the addon is installed and enabled, so it needs to be kept "lean". It should only contain the class and variables documented in this example. This is NOT the place to put custom classes, functions, or large (in data size) variables, as doing so will add more overhead to every page load. Remember to rename the class name, replacing "example" with the folder name for your addon. Note that this version of the Example Addon is only compatible with at least Geo 5.0, since stuff has changed since previous versions.

Classes

addon_example_info

Properties

 
 
No 
No 

Description

Required class for addons, this is the Addon information class, used by the addon system to determine what the addon can do. Also contains info about the addon that can be viewed in the addon management page in the admin.

Methods

enableCheck,

enableCheck( ) : bool

Description

Optional, if addon is enabled, at the time the enabled addons are being initialized it will call this method (if it exists), and if it returns false, it will not enable this addon. If it returns false, no changes are made in the database, it will only affect the current page load.
Be sure to remove this method on addons that have no use for it (which will be most addons), if this method does not exist, it will act normally. This functionality was added to allow commercial Addon developers to do any license validation if they desire to do so, this would be the best place to do licensing checks as failure would have no negative consequences except that the addon would not be able to be used.

Return value

Type Description
bool Return true to allow this addon to be enabled for the current page load, or false to temporarily disable the addon for the current page load.

Tags

Name Description
since Geo version 4.0.6

Properties

$auth_tag, $author, $author_url, $core_events, $core_version_minimum, $description, $exclusive, $icon_image, $info_url, $listing_tags, $name, $pages, $pages_info, $tag_info_url, $tags, $title, $upgrade_url, $version,

string  public  $auth_tag = 'geo_addons'

Required, used in referencing tags. Also may have other uses in the future.

alpha-numeric, "-", and "_" chars only


Should be something unique, used by all of your addons. Do NOT use Geodesic Solutions' value of "geo_addons" as you may create conflicts with future versions. For future compatibility, this should be safe to use as a file name. Required to ensure future compatibility. NOT HTML friendly. Used to prevent name conflicts.

string  public  $author = "Geodesic Solutions LLC."

Required, the author, used in the addon management page.
Required. HTML friendly. For display purposes only.

string  public  $author_url = 'http://geodesicsolutions.com'

Optional, URL for author site link, used in link [ Author's Site ]. If not used, the link will not show for this addon.
Optional. For display purposes only. Holds URL used in link.

array  public  $core_events = array('filter_display_page', 'filter_display_image', 'filter_display_page_nocache', 'filter_ssl_url_checks', 'filter_geoFilter_replaceDisallowedHtml', 'filter_geoFilter_listingDescription', 'filter_geoFilter_listingShortenDescription', 'filter_email', 'filter_listing_placement_category_query', 'email', 'notify_user', 'notify_user_remove', 'notify_Display_ad_display_classified_after_vars_set', 'notify_display_page', 'notify_new_bid_success', 'notify_image_insert', 'notify_image_remove', 'notify_ListingFeed_generateSql', 'notify_modules_preload', 'notify_sold_sign_status_changed', 'notify_geoPC_get_hash_types', 'errorhandle', 'app_bottom', 'auth_admin_login', 'auth_admin_display_page', 'auth_admin_update_page', 'auth_listing_edit', 'auth_listing_delete', 'auth_admin_user_login', 'overload_Notify_seller_notify_seller_', 'overload_Notify_seller_notify_seller_sendMail', 'overload_Notify_friend_notify_friend_sendMail', 'overload_Notify_friend_notify_friend_', 'overload_Site_display_image', 'overload_Browse_ads_display_browse_result', 'overload_Browse_tag_display_browse_result', 'overload_Search_classifieds_BuildResults', 'overload_imagesOrderItem_processImages', 'overload_geoFilter_replaceDisallowedHtml', 'overload_geoFilter_listingDescription', 'overload_geoFilter_listingShortenDescription', 'session_create', 'session_touch', 'session_login', 'session_logout', 'user_register', 'user_edit', 'user_remove', 'registration_add_field_display', 'registration_add_field_update', 'registration_add_variable', 'registration_check_info', 'admin_update_insert_group', 'admin_display_page_attachments_edit_end', 'admin_category_manage_add_links', 'admin_category_list_specific_icons', 'Browse_ads_display_browse_result_addRow', 'Browse_ads_display_browse_result_addHeader', 'Browse_tag_display_browse_result_addRow', 'Browse_tag_display_browse_result_addHeader', 'Browse_ads_generate_query', 'Browse_featured_pic_generate_query', 'Browse_newest_ads_generate_query', 'Browse_tag_generate_query', 'Browse_module_display_browse_result_addRow', 'Browse_module_display_browse_result_addHeader', 'Search_classifieds_search_form', 'Search_classifieds_generate_query', 'Search_classifieds_BuildResults_addHeader', 'Search_classifieds_BuildResults_addRow', 'my_account_home_add_box', 'User_management_information_display_user_data', 'User_management_information_display_user_data_plan_information', 'user_information_edit_form_display', 'user_information_edit_form_check_info', 'user_information_edit_form_update', 'my_account_links_add_link', 'geoFields_getDefaultLocations', 'geoFields_getDefaultFields', 'module_title_add_text', 'module_title_prepend_text', 'module_search_box_add_search_fields', 'admin_home_display_news', 'current_listings_add_action_button', 'current_listings_end', 'display_login_bottom', 'display_registration_code_form_top', 'display_registration_form_top', 'geoCategory_getListingCount', 'Admin_site_display_user_data', 'Admin_user_management_update_users_view', 'Admin_Group_Management_edit_group_display', 'Admin_Group_Management_edit_group_update', 'prevent_new_listing', 'add_listing_icons', 'use_listing_icons', 'rewrite_single_url', 'show_listing_alerts_table_headers', 'show_listing_alerts_table_body', 'display_add_listing_alert_field', 'update_add_listing_alert_field', 'delete_listing_alert', 'check_listing_alert', 'show_listing_alert_filter_data')

Optional, Array of core events (aka software hooks) for this addon. Each core event type works differently. See {@link util.php} for more info and examples of how to use each core event.
Core events so far: - filter -- type of core event, all core events prepended with filter_ act the same way. - - filter_display_page - - filter_display_image - - filter_display_page_nocache -- Only in 3.1+, used in cache system. - - filter_ssl_url_checks -- Only 4.0.4+ - filter an array, not a string - - filter_geoFilter_replaceDisallowedHtml - - filter_geoFilter_listingDescription - - filter_geoFilter_listingShortenDescription - - filter_email - email -- special core event, Sends an e-mail. Soon to be deprecated. - notify -- type of core event, used for notification type events - - notify_user - - notify_user_remove - - notify_Display_ad_display_classified_after_vars_set - - notify_display_page - - notify_geoListing_remove - - notify_geoTemplate_loadTemplateSets - - notify_new_bid_success - - notify_image_insert - - notify_image_remove - - notify_ListingFeed_generateSql - - notify_modules_preload - - notify_geoPC_get_hash_types - errorhandle - app_bottom - auth -- type of core event, all core events prepended with auth_ act the same way. - - auth_admin_login - - auth_admin_display_page - - auth_admin_update_page - - auth_listing_edit - - auth_listing_delete - - auth_admin_user_login - overload -- type of core event, all core events prepended with overload_ act the same way. - - overload_Notify_seller_notify_seller_ - - overload_Notify_friend_notify_friend_ - - overload_Site_display_image - - overload_Browse_ads_display_browse_result - Browse_ads::display_browse_result() - - overload_Browse_tag_display_browse_result - Browse_tag::display_browse_result() - - overload_Search_classifieds_BuildResults - Search_classifieds::BuildResults() - - overload_imagesOrderItem_processImages - - overload_geoFilter_replaceDisallowedHtml - - overload_geoFilter_listingDescription - - overload_geoFilter_listingShortenDescription - session -- type of core event - - session_create - - session_touch - - session_login - - session_logout - user -- type of core event - - user_register - - user_edit - - user_remove -- not implemented in software - registration -- type of core event, designed to allow adding additional data for registration information collected. - - registration_add_field_display - - registration_add_field_update - - registration_add_variable - - registration_check_info - misc -- Miscelanious core events - - admin_update_insert_group - - admin_display_page_attachments_edit_end - - Browse_ads_display_browse_result_addRow - - Browse_ads_display_browse_result_addHeader - - Browse_tag_display_browse_result_addRow - - Browse_tag_display_browse_result_addHeader - - Browse_module_display_browse_result_addRow - - Browse_module_display_browse_result_addHeader - - Browse_ads_generate_query - - Browse_featured_pic_generate_query - - Browse_newest_ads_generate_query - - Browse_tag_generate_query - - Search_classifieds_search_form - - Search_classifieds_generate_query - - Search_classifieds_BuildResults_addHeader - - Search_classifieds_BuildResults_addRow - - my_account_home_add_box - - User_management_information_display_user_data - - User_management_information_display_user_data_plan_information - - user_information_edit_form_display - - user_information_edit_form_check_info - - user_information_edit_form_update - - my_account_links_add_link - - geoFields_getDefaultLocations - - geoFields_getDefaultFields - - module_title_add_text - - module_title_prepend_text - - module_search_box_add_search_fields - - admin_home_display_news - - cron_close_listings_skip_listing - - display_login_bottom - - display_registration_code_form_top - - display_registration_form_top - - geoCategory_getListingCount - - Admin_site_display_user_data - - Admin_user_management_update_users_view - - Admin_Group_Management_edit_group_display - - Admin_Group_Management_edit_group_update Optional. Only needed if using any of the core events. See {@link util.php} for more info.

string  public  $core_version_minimum = '7.4beta1'

Optional, if the Geodesic base software's version is not at least this number, the addon will not install/enable/upgrade
If this is not present, the system will allow this addon to function on any version of the Geo software

string  public  $description = 'This is an example addon. It can be used by developers as a starting point when creating a new addon.<br /><br /> <strong>Notes:</strong><br /> - This addon <strong>will conflict with e-mail addon!</strong> This is <strong>not a bug</strong>, it is designed to work this way to demonstrate the use of the $exclusive variable in info.php. <br /> - Broken image - This addon will have a broken image. This is also just to demonstrate a feature of the addon management system, to demonstrate how to specify an icon for the addon. Since the icon image does not actually exist, there is a broken image instead. See info.php in the addon for more details.'

Required, holds the content for the "Full Addon Description" on the addon management page. Use this for special instructions and general information about the addon.
Required (even if empty string). HTML friendly. For display purposes only.

\Assoc  public  $exclusive = array('filter_display_page' => false, 'filter_display_image' => false, 'email' => true, 'errorhandle' => false)

Optional, If this associative array is set, is an array, and has a key for a core event, other addons that also have exclusive set to true for that core event cannot be enabled at the same time as this one.

array


As an example, if an addon sends an e-mail, it would not want another addon that also sends an e-mail to be enabled at the same time. Otherwise, two e-mails would be sent. However, if an addon only logs the e-mails, it would be set to not exclusive and allowed to be enabled at the same time as an exclusive email addon. Optional. Only use this if you need to make a core event exclusive.

string  public  $icon_image = 'menu_example.gif'

Optional, used on the addon management page and any admin pages. The path is relative to this addon's folder.
As an example, if this value is set to "icon.gif", the icon used for this addon would be physically located at "addons/example/icon.gif". Optional. NOT HTML friendly. For display purposes only. Used as part of "src" in an image tag.

string  public  $info_url = 'http://geodesicsolutions.com/component/content/article/49-programming-trouble-shooting/72-example-addon.html?directory=64'

Optional, URL for more info link, used in link [ More Info ]. If not used, the link will not show for this addon.
Optional. For display purposes only. Holds URL used in link.

array  public  $listing_tags = array('listing_tag_example')

Optional, array of tag names used for listing tags. Used to "register" certain listing tags to be used by this addon. Note that to have a tag replaced, in the template it needs:
{listing addon='example' tag='listing_tag_example'} || || $name $listing_tags[] If the tag name is not defined in the $listing_tags array, it will not get used, even if the tag replacement function exists in the tags.php file. Optional. Only needed if using the listing addon tags. See {@link tags.php} for more info.

string  public  $name = 'example'

Required, this must be the same as the addon's folder name, and is used as part of the name for all classes throughout the addon.
Be sure to use something that is unique to prevent name conflicts. Required. NOT HTML Friendly. Must be exactly the same as the folder named used for the addon.

array  public  $pages = array('page1', 'page2', 'youAreCool', 'almostFinished')

Optional, Array of page names. Used to "register" certain pages to be used by this addon.
It should be an array of page names. The URL to one of these pages would be: index.php?a=ap&addon=example&page=page1 -- displays hello world page. Optional. Only needed if using addon pages. See {@link pages.php} for info.

array  public  $pages_info = array('page1' => array('main_page' => 'basic_page.tpl', 'title' => 'Example Page 1'), 'page2' => array('main_page' => 'basic_page.tpl', 'title' => 'Example Page 2'), 'youAreCool' => array('main_page' => 'cart_page.tpl', 'title' => 'You are Cool'), 'almostFinished' => array('main_page' => 'cart_page.tpl', 'title' => 'Almost Finished'))

Optional, Array of data arrays for each of the pages specified in the $pages var (above). This allows to specify info about each page, such as what main_page template should be used from the default template set, or what the page's "title" is, displayed in the admin panel for that page. Note that the title is able to have HTML in it.

Each element in the array should have a key matching one of the pages in the $pages var above, and the value should be array similar to: array ('main_page' => 'page_template_attachment.tpl', 'title' => 'Page Title in Admin')




string  public  $tag_info_url = 'index.php?mc=addon_example_admin&page=addon_example_tag_help'

Optional, URL for tag info link, used in link [ Tag Details ], If not used, the link will not show for this addon.
In the example value, it uses a link relative to the admin, linking to an admin page added by this addon. Note that the use of a relative link is for demonstration only, any URI can be used, and that use of a relative link can be used for any of the URL variables, not just the tag info url. Optional. For display purposes only. Holds URL used in link.

array  public  $tags = array('tag_name1', 'tag_name2')

Optional, Array of tag names. Used to "register" certain tags to be used by this addon.
It should be an array of tag names. Note that to have a tag replaced, in the template it needs: template addon tag example: {addon author='geo_addons' addon='example' tag='tag_name1'} || || || $auth_tag $name $tags[] If the tag name is not defined in the $tags array, it will not get used, even if the tag replacement function exists in the tags.php file. Optional. Only needed if using addon tags. See {@link tags.php} for more info.

string  public  $title = 'Example Addon'

Required, the title of the addon that will be displayed in the menu and on the addon management page.
Required. HTML friendly. For display purposes only.

string  public  $upgrade_url = 'http://geodesicsolutions.com/component/content/article/49-programming-trouble-shooting/72-example-addon.html?directory=64'

Optional, URL for upgrades link, used in link [ Check For Upgrades ]. If not used, the link will not show for this addon.
Optional. For display purposes only. Holds URL used in link.

string  public  $version = '2.5.5'

Required, this version number is compared to the version held in the database to determine whether the update script must be run.
Required. NOT HTML friendly. Stored in database. Used by addon system for addon upgrades.

Documentation was generated by phpDocumentor 2.2.0 .

Namespaces

  • global

    Packages

    • Default
      • ExampleAddon
        • addon_example_admin
          In charge of doing stuff on the admin side, this is optional.
        • addon_example_info
          Required class for addons, this is the Addon information class, used by the addon system to determine what the addon can do. Also contains info about the addon that can be viewed in the addon management page in the admin.
        • addon_example_pages
          Addon page class, used by the addon system to display pages on the client side.
        • addon_example_setup
          This class is not required. If it, and the function for a particular routine exist, then that function will be called IN ADDITION TO the automated routines of the addon framework.
        • addon_example_tags
          Expects one function for each tag. Function name should be the same as the tag name. Can also have a constructor if anything needs to be constructed.
        • addon_example_util
          This is where to put functions that the main part of the addon will use.
        • eWidgetOrderItem
          This order item is designed to allow users on your site to purchase an eWidget.
      • System
        • DataAccess
          This is the main Database access object.
        • Singleton
          Singleton method class
        • _templateOrderItem
          Developers: use this file as a template to create a new order item.
        • _templatePaymentGateway
          This is the "developer template" payment gateway handler, a developer could use this file as a starting point for creating a new payment gateway in the system.
        • geoAPI
          The main system class for receiving and handling remote API calls, this acts as a translation layer between the communication with the "outside" and each API call.
        • geoAddon
          This is the class that handles anything and everything to do with addons.
        • geoArrayTools
          Utility functions for manipulating arrays
        • geoBrowse
          Contains functions common to browsing listings
        • geoBrowsingFilter
          System for activating, storing, and deactivating browsing filters.
        • geoCJAX
          Class that wraps the CJAX_FRAMEWORK, used to get the CJAX class.
        • geoCache
          This is the main part of the Geo cache system, it does all the "low level" stuff like writing files and escaping cache data.
        • geoCacheModule
          Part of Geo Cache system, specifically tuned to work best with cacheing module data (which will be an array).
        • geoCachePage
          Cache system specifically tuned to work best with cacheing output of pages and modules
        • geoCacheSetting
          Part of Geo Cache system, specifically tuned to work best with cacheing site-wide key=value type settings.
        • geoCacheText
          Part of Geo Cache system, this part specifically tuned to work best with cacheing language specific messages.
        • geoCalendar
          Holds utility method(s) for manipulating stuff dealing with calendar selector.
        • geoCart
          This class is behind the cart, loading all the order items and such and displaying, and processing all the different pages.
        • geoCategory
          Utility class that holds various methods to do stuff with categories in the system.
        • geoCombineResources
          This class helps to combine CSS and JS files, minify them, and optionally compress them.
        • geoCron
          This is the cron job backend, it handles all the communication and security and all that.
        • geoCrypt
          Class to use for encrypting information that needs to be able to be retrieved later.
        • geoDate
          Holds utility method(s) for manipulating stuff dealing with dates.
        • geoEmail
          Class that sends out e-mails.
        • geoFields
          Class that holds settings information for fields to use.
        • geoFieldsField
          A mini object to hold data about a specific field.
        • geoFile
          As the name implies, this is used for file-based utility methods.
        • geoFilter
          A few utility methods, good for filtering stuff.
        • geoFormatString
          Used to display a message nice and pretty, we'll probably be getting rid of this class though so don't go crazy using it.
        • geoHTML
          Class to generate chunks of HTML that are very common, used the most in the admin panel.
        • geoImage
          This class is responsible for a lot of the image processing, along with other aspects like generating the image tag for thumbnails.
        • geoInvoice
          This is the invoice object representing an invoice in the system.
        • geoLeveledField
          Class for doing common things with leveled fields.
        • geoListing
          A listing object, basically a container object for particular listing.
        • geoListingDisplay
          This is basically a container that is responsible for helping to display {listing .
        • geoListingFeed
          Class that helps to render RSS or other types of feeds based on list of listings.
        • geoMaster
          This is dedicated class for getting the value of, and setting, the various "master switches" within the software. Since this is meant as an easy way to get the values of master switches, most of the methods are static.
        • geoNumber
          Utility functions relating to number conversion/manipulation/validation ect.
        • geoOrder
          The geoOrder object, an object representation of an order in the system.
        • geoOrderItem
          The class that all order items must extend.
        • geoPC
          Used for login credential validation, password hashing, etc. along with software licensing.
        • geoPagination
          Utility functions useful for generating pagination of a results page such as when browing ads or searching
        • geoPaymentGateway
          This class should be extended by each different payment gateway, this will have some default functions that each gateway will inherit, and also has a few final static methods used by the system to affect all order items.
        • geoPlanItem
          A container to hold settings for a particular order item type, according to price plan ID, and optionally category ID for category specific settings.
        • geoRecurringBilling
          The geoRecurringBilling object, an object representation of a recurring billing in the system.
        • geoRegion
          Stuff for regions and sub-regions.
        • geoRegistry
          Handy little object, can be used to set registry type settings.
        • geoSearchUtils
          Class for search utilities.
        • geoSellerBuyer
          Handles back-end for the seller/buyer payment gateways, to allow the buyer to more easily pay the seller for a won auction. This handles the underlying system, but the actual work is done by individual seller/buyer gateways, for instance the Paypal buy-now functionality.
        • geoSession
          Manages session storage and session cookies for user sessions.
        • geoString
          Utility functions relating to languages and string manipulation.
        • geoStringData
          This class is to store accented chars, to be used by {@link geoString::removeAccents()}, mainly to keep the String.class.php file un-cluttered.
        • geoTable
          NOT FULLY IMPLEMENTED! Do not use this class yet as it is not finished and may change drastically before we are done with it, or may even be removed.
        • geoTableRow
          NOT FULLY IMPLEMENTED! Do not use this class yet as it is not finished and may change drastically before we are done with it, or may even be removed.
        • geoTableRowset
          NOT FULLY IMPLEMENTED! Do not use this class yet as it is not finished and may change drastically before we are done with it, or may even be removed.
        • geoTableSelect
          Class used to generate a select query, useful when multiple areas want to affect a single query, for instance when generating a search query and there are addons involved.
        • geoTables
          Used to hold database table names, used throughout the code.
        • geoTemplate
          Template object that extends the Smarty class (a 3rd party library) to enable using templates to display things.
        • geoTransaction
          This is the object used for a transaction in the order and invoice system.
        • geoUser
          An object representative of a certain user in the system.
        • geoUserRating
          Store, retrieve, and display inter-user ratings
        • geoUtil
          Misc utility functions
        • geoView
          As the name implies, this is used for creating the page view. It does take a little setup (like any class), the setup is normally done in the display_page method in geoSite, or display_page in geoAdmin if displaying a page in the admin.
        • iApiTransport
          Interface for API Transports, a transport must implement this interface for the system to use it.
        • iOrderItem
          You cannot have abstract static functions, so instead need to have an interface to force the given static functions to be defined.
        • metaDbTables
          Used so that old locations that use the old name geoTables will still work.