UberBots Website Documentation

PHP Function Index - module.php

This inlcude file delcares all module related functions. These functions are mainly used for editing and adding modules.

  • renderModules

    Description

    string renderModules( int $pageId )

    This function will render all the modules on a single page as determined by $pageId. It will return at string containing the HTML of the modules on that page.

    Parameters

    • pageId

      This arguement is the numerical page identifier for the page which will be rendered. In a module, it can be found as $properties['pageId'].

    Return Values

    This function will return an HTML formatted string which contains all the modules on that page. Rendering the output will show the entire "main column" of the page.

    Notes

    This function is only meant to be used in low level OmniPage files; it shouldn't be used in most application of the system.

    Top of Page

  • renderEdit

    Description

    string renderModules( int $pageId , int $instanceId )

    This function will return the renderEdit state of a certain module on a page. The module is determined by pageId and instanceId. The renderEdit state is the graphical means of editing module variables.

    Parameters

    • pageId

      This is the numerical indicator for the page containing the module being edited. This can ususally be found as $properties['pageId'].

    • instanceId

      This is the numerical identifier of the module itself on the page. This can ususally be found as $properties['instanceId'].

    Return Values

    This function returns an HTML formatted string which contains the renderEdit state of the defined module (this is defined in the mod.php file of the module). The renderEdit state is the graphical means of editing module variables.

    Notes

    This function should only be used in low level OmniPage files; it shouldn't be used in most application of the system.

    Top of Page

  • getProps

    This function will build an associative array of module properties.

    Description

    array getProps( int $pageId , int $instanceId )

    This function takes the module as defined by pageId and instanceId and compiles an array of the module properties. These properties are stored in the moduleProps table in the SQL database.

    Parameters

    • pageId

      This is the numerical indicator for the page containing the module being edited. This can ususally be found as $properties['pageId'].

    • instanceId

      This is the numerical identifier of the module itself on the page. This can ususally be found as $properties['instanceId'].

    Return Values

    This function returns a PHP array conting module properties. The information is taken out of the SQL database and builds an associative array. The array is in the following format: $properties[propName] = propvalue.

    Notes

    This is the function used to build the array passsed on as arguements to the render, renderEdit, and Edit functions in module files.

    This function should only be used in low level files. It should not need to be used in most customizable applications.

    Top of Page

  • getModule

    This function will return a new module object depending on the module ID passed to it.

    Description

    object getModule( int $modId )

    This function will return a new object (as defined by a class in the module file) of the module, allowing it to be added to a page.

    Parameters

    • modId

      This is the numerical identifier of the module type being added. This is how the OmniCore differentiates between module types.

    Return Values

    This function returns an object as defined by the class defined in the mod.php file of the module. This class contains the three main module functions and is the "heart and soul" of the module.

    Notes

    WARNING:

    This function should only be used in its default location, at it could pose security dangers to the site if used elsewhere. Careful consideration should be taken before using this function in other places.

    Top of Page
  • deleteMod

    This function deletes a specified module.

    Description

    void deleteMod( int $pageId [, int $instanceId] )

    This function will delete the specified module (as per pageId and instanceId). If the instanceId parameter is left out, then all modules on the specified page will be deleted.

    Parameters

    • pageId

      This is the numerical indicator for the page containing the module being edited. This can ususally be found as $properties['pageId'].

    • [instanceId]

      This is the numerical identifier of the module itself on the page. This can ususally be found as $properties['instanceId']. This parameter is optional; if it's left out, then all modules on the specified page will be deleted.

    Return Values

    This function does not return a value. On error, it will return the SQL error.

    Notes

    WARNING:

    This function should only be used in its default methods. If used incorrectly, this function can pose a security risk to your site.

    Top of Page

Upcoming Events

Events in the next week:

No upcoming events.

Connect With Us

Follow us on Twitter! Connect with us on Facebook! Add us to your circles on Google+