Inheritance diagram for BaseModule:
It handles pages, page validation, parameter validation, creating links, error handling, status messages, css, javascript, rss, and and provides many useful utility functions to make programming for the web as ridiculously simple as possible.
Definition at line 11 of file base-module.inc.php.
Public Member Functions | |
__construct () | |
Creates a new BaseModule. | |
init ($page= 'main', $vars=array()) | |
This function initializes a page in a module. | |
draw () | |
This function handles drawing the content area for the module page. | |
setTemplate (BaseTemplate $template) | |
sets our template object. | |
initParams ($page, $vars=array()) | |
This function initializes our page parameters and does quite a bit of error checking. | |
initPage ($page) | |
This function initializes the page we eventually want to draw. | |
getTitle () | |
This function gets the title of the page. | |
getContent () | |
This function gets our page as a string. | |
getError () | |
This function gets the errors for the module. | |
getStatus () | |
This function gets the status messages for the module. | |
getUrl ($params=array(), $base=null, $full=false) | |
Gets a string url from an array of parameters. | |
getParams ($array) | |
This function gets the parameters from an array in url form. | |
drawUrl ($params, $text) | |
This function draws a link. | |
getLink ($params, $text, $base=null, $full=false) | |
This function gets a text link. | |
hasError () | |
Do we have errors or that? | |
setError ($error) | |
Sets the error message for the page. | |
hasStatus () | |
Do we have status messages or not? | |
addStatus ($str) | |
Add a status message to the module. | |
initParametersPage () | |
This function initializes the parameters page. | |
drawParametersPage () | |
This function draws the module parameters page.. | |
initMainPage () | |
This function initializes teh main page of the module. | |
drawMainPage () | |
This function draws teh main page. | |
initModuleXmlPage () | |
This function initialializes the module page. | |
drawModuleXmlPage () | |
This function draws teh module page... | |
parseModuleXml () | |
This function generates the xml for the module. | |
params ($key=null) | |
This function is used to access the parameters of the object. | |
setParam ($key, $val) | |
Update the value of a parameter for a page. | |
getModuleXml () | |
This function gets the xml of the module in string format. | |
getPagesXml () | |
This function gets the string representation of the page xml. | |
getMainPageXml () | |
This function gets the xml for the main page configuration. | |
getModulePageXml () | |
This function gets the xml for the module page configuration. | |
getParametersPageXml () | |
This function gets the xml for the parameters page configuration. | |
getCreateTablePageXml () | |
This function gets the xml for the parameters page configuration. | |
addBox ($box) | |
This function adds a box to the module. | |
needsSideBar () | |
This function tells us whether we need to draw a sidebox or not. | |
drawSideBar () | |
This function will draw the sidebar, if needed. | |
addNav ($text) | |
This function adds text or link to the navigation. | |
getNav () | |
Get the navigation. | |
drawNavigation () | |
This draws the navigation as an unordered list wrapped in a div with class 'pageNav'. | |
drawPageNavigation ($links) | |
draw our page navigation links | |
drawPlainNavigation ($links) | |
draw our page navigation links in a plain format | |
assertLogin () | |
This function is used to ensure the user is logged in. | |
needsCss ($file) | |
Add a css file to the list of needed css files. | |
drawCss () | |
Draw the markup to include the css files. | |
needsJs ($file) | |
Add a javascript file to the page. | |
drawJs () | |
Draw the markup to include a javascript file. | |
addFeed ($url, $title) | |
This adds feed to global feed array. | |
drawFeeds () | |
This draws teh markup for rss feeds in the header. | |
drawHead () | |
This draws all the markup for needed css, javascript, and any rss feeds. | |
initCreateTablePage () | |
initialize our create table page. | |
drawCreateTablePage () | |
draw our create table page. | |
runCreateTableSql () | |
this function actually runs our create table code. | |
getCreateTableSql () | |
this gets the sql statement(s) that create the tables needed for this module. | |
Static Public Member Functions | |
getCachedPage ($key=null) | |
get the data for our cached page! | |
setCachedPage ($data, $key=null) | |
save the page as cached. | |
getPageCacheKey ($page=null) | |
get us a key that will be unique for the page we're on... | |
deleteCachedPage ($page) | |
deletes a page from the cache | |
tryPageCache ($page=null) | |
this function does two things: it generates a key and then uses that key to try the cache. | |
Public Attributes | |
$baseUrl | |
public String base url to use for creating links | |
$page | |
public String what page we are on. | |
$pageTitle | |
public String title of the page we are on. | |
$template = null | |
BaseTemplate our template to use to draw our page. | |
$english | |
public Boolean an english word description of what the module is. | |
$xml | |
public String xml description of object. | |
$doCachePage = false | |
public are we caching the page? | |
$_Name = null | |
store the name of our module for our XML | |
$_Description = null | |
store the description of our module for our XML | |
$_Version = null | |
store the version of our module for our XML | |
$_Author = null | |
store the author of our module for our XML | |
$_Website = null | |
store the website of our module for our XML | |
Static Public Attributes | |
$pageCacheLife = 900 | |
public the lifetime of the cached page. | |
Private Attributes | |
$params = array() | |
private Keyed Array of parameters for the page. | |
$error = null | |
private Array of string errors for the page. | |
$status = array() | |
private Array of string status messages for the page | |
$sideboxes = array() | |
private Array of BaseBox objects for the page. | |
$navigation = array() | |
private Array of text/links of navigation for the page. | |
Static Private Attributes | |
$Feeds = array() | |
Array of RSS feeds for drawing in <head> of page. | |
$FeedTitles = array() | |
corresponding array of titles for RSS feeds to be drawn |
|
Creates a new BaseModule.
Definition at line 116 of file base-module.inc.php. References Config::get(). Referenced by BaseObject::__set(). |
|
This function adds a box to the module. This is used to do custom sidebars.
Definition at line 820 of file base-module.inc.php. |
|
This adds feed to global feed array. that makes it so we can call addFeed from modules other than the main module.
Definition at line 1000 of file base-module.inc.php. Referenced by ObjectManager::getPlainRssLink(), and BaseForumThread::initViewPage(). |
|
This function adds text or link to the navigation.
Definition at line 859 of file base-module.inc.php. |
|
Add a status message to the module.
Definition at line 565 of file base-module.inc.php. Referenced by BaseObject::checkTable(), and BaseUser::initLoginPage(). |
|
|
deletes a page from the cache
Definition at line 1137 of file base-module.inc.php. References CacheBot::delete(). |
|
This function handles drawing the content area for the module page. Additionally, if any extra markup is needed, it draws that too. Reimplemented in BaseCrons. Definition at line 200 of file base-module.inc.php. |
|
draw our create table page. show our queries, etc. Reimplemented in BaseGroup. Definition at line 1057 of file base-module.inc.php. |
|
Draw the markup to include the css files. You probably wont call this directly... use drawHead() instead. Definition at line 952 of file base-module.inc.php. |
|
This draws teh markup for rss feeds in the header. You should probably use drawHead instead. Definition at line 1009 of file base-module.inc.php. |
|
This draws all the markup for needed css, javascript, and any rss feeds. You will most definitely need to add this to your drawHeader() function in your template. Definition at line 1024 of file base-module.inc.php. |
|
Draw the markup to include a javascript file. You probably wont use this, instead add drawHead() to your header. Definition at line 984 of file base-module.inc.php. |
|
This function draws teh main page. You should override this for your module if you want a main page. Reimplemented in BaseAdmin, BaseInvitation, BaseMap, BaseTags, BaseThread, and BaseTicket. Definition at line 678 of file base-module.inc.php. |
|
This function draws teh module page... which is the xml that describes teh module. Definition at line 695 of file base-module.inc.php. |
|
This draws the navigation as an unordered list wrapped in a div with class 'pageNav'.
Definition at line 877 of file base-module.inc.php. References Util::ieDrawClear(). |
|
draw our page navigation links
Definition at line 896 of file base-module.inc.php. Referenced by BaseForum::drawViewPage(). |
|
This function draws the module parameters page.. which is a nice representation of the pages contained in the module. Definition at line 581 of file base-module.inc.php. |
|
draw our page navigation links in a plain format the format is all the links seperated by '~' and wrapped in a div ov PageNavigation
Definition at line 908 of file base-module.inc.php. |
|
This function will draw the sidebar, if needed. It basically loops thru the boxxes that have been added. Definition at line 839 of file base-module.inc.php. References Util::ieDrawClear(). |
|
This function draws a link.
Definition at line 508 of file base-module.inc.php. Referenced by BaseMessage::drawRow(), and BaseMessage::drawViewPage(). |
|
get the data for our cached page!
Definition at line 1096 of file base-module.inc.php. References CacheBot::get(). Referenced by BaseJumper::start(). |
|
This function gets our page as a string.
Definition at line 352 of file base-module.inc.php. |
|
This function gets the xml for the parameters page configuration.
Definition at line 809 of file base-module.inc.php. |
|
this gets the sql statement(s) that create the tables needed for this module. these should be the tables the module directly accesses.
Reimplemented in BaseGroup, BaseObject, BaseTags, and BaseTicket. Definition at line 1085 of file base-module.inc.php. |
|
This function gets the errors for the module.
Definition at line 375 of file base-module.inc.php. |
|
This function gets a text link.
Definition at line 523 of file base-module.inc.php. Referenced by BaseUserAction::drawActionsBox(), BaseImage::drawBulkFormPage(), BaseImage::drawBulkFormSelect(), BaseRPSGame::drawChallengeBox(), BaseComment::drawCommentDetails(), BaseCalendar::drawDatePage(), BaseRPSGame::drawDefendBox(), BaseUser::drawLoginPage(), BaseAdmin::drawMainPage(), BaseUserAction::drawRow(), BaseUser::drawSetImagePage(), BaseAdmin::drawViewCachePage(), BaseUser::emailDeleteConfirmation(), BaseInvitation::getApproveLink(), BaseObject::getCommentsLink(), BaseInvitation::getDenyLink(), BaseTags::getLinkedTags(), BaseObject::getName(), ObjectManager::getPlainRssLink(), BaseInvitations::getSearchLinks(), and BaseUser::sendActivationEmail(). |
|
This function gets the xml for the main page configuration.
Reimplemented in BaseThread. Definition at line 779 of file base-module.inc.php. |
|
This function gets the xml for the module page configuration.
Definition at line 789 of file base-module.inc.php. |
|
This function gets the xml of the module in string format.
Definition at line 746 of file base-module.inc.php. |
|
Get the navigation.
Definition at line 869 of file base-module.inc.php. |
|
get us a key that will be unique for the page we're on...
Definition at line 1124 of file base-module.inc.php. |
|
This function gets the string representation of the page xml. If you are doing any sort of custom pages you will definitely be overriding this function.
Reimplemented in BaseAdmin, BaseCalendar, BaseEvent, BaseForum, BaseGroup, BaseImage, BaseInbox, BaseInvitation, BaseMap, BaseObject, BaseOutbox, BaseRPSGame, BaseTags, BaseTicket, BaseUserAction, BaseUser, and ObjectManager. Definition at line 762 of file base-module.inc.php. |
|
This function gets the xml for the parameters page configuration.
Definition at line 799 of file base-module.inc.php. |
|
This function gets the parameters from an array in url form.
Definition at line 495 of file base-module.inc.php. |
|
This function gets the status messages for the module.
Definition at line 385 of file base-module.inc.php. |
|
This function gets the title of the page.
Definition at line 339 of file base-module.inc.php. |
|
|
Do we have errors or that?
Definition at line 534 of file base-module.inc.php. |
|
Do we have status messages or not?
Definition at line 555 of file base-module.inc.php. |
|
This function initializes a page in a module.
Reimplemented in BaseAdmin, BaseCrons, and BaseImage. Definition at line 131 of file base-module.inc.php. References Config::get(), and Config::set(). |
|
initialize our create table page. anyone can view... easier for them to setup a table to work with our data. only admins can run the code, however. Definition at line 1036 of file base-module.inc.php. |
|
This function initializes teh main page of the module. You will probably override it at some point in time. Reimplemented in BaseAdmin, BaseCalendar, BaseInvitation, BaseMap, BaseTags, BaseThread, and ObjectManager. Definition at line 670 of file base-module.inc.php. |
|
This function initialializes the module page.
Definition at line 685 of file base-module.inc.php. |
|
This function initializes the page we eventually want to draw. It passes off the page initialization to init{$page}Page()
Definition at line 319 of file base-module.inc.php. |
|
This function initializes the parameters page. You probably wont ever use it. Definition at line 573 of file base-module.inc.php. |
|
This function initializes our page parameters and does quite a bit of error checking.
Definition at line 223 of file base-module.inc.php. |
|
Add a css file to the list of needed css files. Use this if you need some sort of extra css for your page.
Definition at line 942 of file base-module.inc.php. Referenced by BaseGallery::initSlideshow(). |
|
Add a javascript file to the page. If you need any special js... use this!
Definition at line 966 of file base-module.inc.php. Referenced by BaseMessage::__construct(), BaseTags::addPopularTagField(), ObjectManager::drawSearchForm(), BaseEvent::initEditPage(), BaseMap::initMainPage(), BaseGallery::initSlideshow(), and BaseObject::initViewPage(). |
|
This function tells us whether we need to draw a sidebox or not.
Definition at line 830 of file base-module.inc.php. |
|
This function is used to access the parameters of the object.
Definition at line 720 of file base-module.inc.php. Referenced by ObjectManager::createSearchForm(), BaseImage::drawBulkConfigPage(), BaseImage::drawBulkFormPage(), BaseImage::drawBulkPostPage(), BaseCalendar::drawCalendarPage(), BaseRPSGame::drawChallengePage(), BaseCalendar::drawDatePage(), BaseUserAction::drawDoActionPage(), BaseForum::drawPostPage(), BaseUser::drawRegisterPage(), ObjectManager::drawRssLink(), ObjectManager::drawSearchPage(), BaseMessage::editFormAddFields(), BaseMessage::editFormLoad(), BaseCalendar::findDate(), BaseInvitations::getSearchLinks(), BaseInvitation::initApprovePage(), BaseEvent::initAttendPage(), BaseImage::initBulkConfigPage(), BaseImage::initBulkPostPage(), BaseCalendar::initCalendarPage(), BaseRPSGame::initChallengePage(), BaseCalendar::initDatePage(), BaseRPSGame::initDefendPage(), BaseObject::initDeletePage(), BaseInvitation::initDenyPage(), BaseUserAction::initDoActionPage(), BaseUser::initEditPage(), BaseObject::initEditPage(), BaseMessage::initEditPage(), BaseComment::initEditPage(), BaseTicket::initGatePage(), BaseEvent::initInvitePage(), BaseGroup::initJoinPage(), BaseGroup::initLeavePage(), BaseEvent::initLeavePage(), BaseUser::initLoginPage(), BaseThread::initMainPage(), BaseUserAction::initMessagePage(), BaseImage::initResizePage(), BaseEvent::initRSVPPage(), ObjectManager::initSearchPage(), BaseThread::initSearchPage(), BaseInvitations::initSearchPage(), ObjectManager::initSearchPageOutput(), BaseRPSGame::initTauntPage(), BaseEvent::initUnInvitePage(), BaseUser::initViewPage(), BaseTags::initViewPage(), BaseObject::initViewPage(), and BaseMessage::initViewPage(). |
|
This function generates the xml for the module.
Definition at line 705 of file base-module.inc.php. Referenced by ObjectManager::getSearchWhere(). |
|
this function actually runs our create table code. extend this if you need to do any extra queries. Reimplemented in BaseGroup. Definition at line 1071 of file base-module.inc.php. References dbExecute(), and CacheBot::delete(). |
|
save the page as cached.
Definition at line 1110 of file base-module.inc.php. References CacheBot::set(). Referenced by BaseJumper::start(). |
|
Sets the error message for the page.
Definition at line 544 of file base-module.inc.php. |
|
Update the value of a parameter for a page.
Definition at line 736 of file base-module.inc.php. Referenced by BaseCalendar::findDate(), BaseCalendar::initPastPage(), BaseCalendar::initPopularPage(), ObjectManager::initSearchPage(), BaseCalendar::initUpcomingPage(), and BaseUser::initViewPage(). |
|
sets our template object.
Definition at line 211 of file base-module.inc.php. Referenced by BaseCrons::init(), ObjectManager::initAutocompleteOutput(), BaseImage::initBulkConfigPage(), BaseImage::initBulkPostPage(), ObjectManager::initJSONOutput(), BaseObject::initJSONPage(), BaseMap::initLookupPage(), BaseMap::initMapJsPage(), ObjectManager::initPHPOutput(), BaseObject::initPHPPage(), BaseImage::initResizePage(), ObjectManager::initRSSOutput(), ObjectManager::initXMLOutput(), and BaseObject::initXMLPage(). |
|
this function does two things: it generates a key and then uses that key to try the cache. if it finds it, it shows the cached page and returns false. otherwise it returns the key for use in caching. it makes caching pages easy. have one call and an if statement that contains the setCache call.
Definition at line 1155 of file base-module.inc.php. |
|
store the author of our module for our XML
Definition at line 106 of file base-module.inc.php. |
|
store the description of our module for our XML
Definition at line 96 of file base-module.inc.php. |
|
store the name of our module for our XML
Definition at line 91 of file base-module.inc.php. |
|
store the version of our module for our XML
Definition at line 101 of file base-module.inc.php. |
|
store the website of our module for our XML
Definition at line 111 of file base-module.inc.php. |
|
public String base url to use for creating links
Definition at line 16 of file base-module.inc.php. |
|
public are we caching the page?
Definition at line 46 of file base-module.inc.php. |
|
public Boolean an english word description of what the module is.
Definition at line 36 of file base-module.inc.php. |
|
private Array of string errors for the page.
Definition at line 61 of file base-module.inc.php. |
|
Array of RSS feeds for drawing in <head> of page.
Definition at line 81 of file base-module.inc.php. |
|
corresponding array of titles for RSS feeds to be drawn
Definition at line 86 of file base-module.inc.php. |
|
private Array of text/links of navigation for the page. May or may not be in future BaseModules Definition at line 76 of file base-module.inc.php. |
|
public String what page we are on.
Definition at line 21 of file base-module.inc.php. |
|
public the lifetime of the cached page. defaults to 1 hour. Definition at line 51 of file base-module.inc.php. |
|
public String title of the page we are on.
Definition at line 26 of file base-module.inc.php. |
|
private Keyed Array of parameters for the page.
Definition at line 56 of file base-module.inc.php. |
|
private Array of BaseBox objects for the page.
Definition at line 71 of file base-module.inc.php. |
|
private Array of string status messages for the page
Definition at line 66 of file base-module.inc.php. |
|
BaseTemplate our template to use to draw our page.
Definition at line 31 of file base-module.inc.php. |
|
public String xml description of object. derived from getPagesXml. this should probably be private. Definition at line 41 of file base-module.inc.php. |