NucleusPlugin Class Reference

Inheritance diagram for NucleusPlugin:

NP_Ping NP_SkinFiles

List of all members.

Public Member Functions

 getName ()
 getAuthor ()
 getURL ()
 getVersion ()
 getDescription ()
 getMinNucleusVersion ()
 getMinNucleusPatchLevel ()
 getEventList ()
 getTableList ()
 hasAdminArea ()
 install ()
 unInstall ()
 init ()
 doSkinVar ($skinType)
 doTemplateVar (&$item)
 doTemplateCommentsVar (&$item, &$comment)
 doAction ($type)
 doIf ($key, $value)
 doItemVar ()
 supportsFeature ($feature)
 getPluginDep ()
 createOption ($name, $desc, $type, $defValue= '', $typeExtras= '')
 createBlogOption ($name, $desc, $type, $defValue= '', $typeExtras= '')
 createMemberOption ($name, $desc, $type, $defValue= '', $typeExtras= '')
 createCategoryOption ($name, $desc, $type, $defValue= '', $typeExtras= '')
 createItemOption ($name, $desc, $type, $defValue= '', $typeExtras= '')
 deleteOption ($name)
 deleteBlogOption ($name)
 deleteMemberOption ($name)
 deleteCategoryOption ($name)
 deleteItemOption ($name)
 setOption ($name, $value)
 setBlogOption ($blogid, $name, $value)
 setMemberOption ($memberid, $name, $value)
 setCategoryOption ($catid, $name, $value)
 setItemOption ($itemid, $name, $value)
 getOption ($name)
 getBlogOption ($blogid, $name)
 getMemberOption ($memberid, $name)
 getCategoryOption ($catid, $name)
 getItemOption ($itemid, $name)
 getAllBlogOptions ($name)
 getAllMemberOptions ($name)
 getAllCategoryOptions ($name)
 getAllItemOptions ($name)
 getBlogOptionTop ($name, $amount=10, $sort= 'desc')
 getMemberOptionTop ($name, $amount=10, $sort= 'desc')
 getCategoryOptionTop ($name, $amount=10, $sort= 'desc')
 getItemOptionTop ($name, $amount=10, $sort= 'desc')
 _getOptionTop ($context, $name, $amount=10, $sort= 'desc')
 getID ()
 getAdminURL ()
 getDirectory ()
 getShortName ()
 NucleusPlugin ()
 clearOptionValueCache ()
 _createOption ($context, $name, $desc, $type, $defValue, $typeExtras= '')
 _deleteOption ($context, $name)
 _setOption ($context, $contextid, $name, $value)
 _getOption ($context, $contextid, $name)
 _getAllOptions ($context, $name)
 _getOID ($context, $name)
 _getDefVal ($context, $name)
 _deleteOptionValues ($context, $contextid)
 getOptionSelectValues ($typeExtra)
 subscribtionListIsUptodate ()

Static Public Member Functions

 getOptionMeta ($typeExtra)
 _applyPluginOptions (&$aOptions, $newContextid=0)

Public Attributes

 $_aOptionValues
 $_aOptionToInfo
 $plugin_options
 $plugid


Detailed Description

This is an (abstract) class of which all Nucleus Plugins must inherit

for more information on plugins and how to write your own, see the plugins.html file that is included with the Nucleus documenation

http://nucleuscms.org/license.txt GNU General Public License Copyright (C) 2002-2007 The Nucleus Group

Version:
Id
PLUGIN.php 1196 2007-09-05 07:39:40Z kimitake
NucleusJP
PLUGIN.php,v 1.12.2.3 2007/12/03 02:22:42 kmorimatsu Exp

Definition at line 23 of file PLUGIN.php.


Member Function Documentation

NucleusPlugin::getName (  ) 

Reimplemented in NP_Ping, and NP_SkinFiles.

Definition at line 27 of file PLUGIN.php.

NucleusPlugin::getAuthor (  ) 

Reimplemented in NP_Ping, and NP_SkinFiles.

Definition at line 28 of file PLUGIN.php.

NucleusPlugin::getURL (  ) 

Reimplemented in NP_Ping, and NP_SkinFiles.

Definition at line 29 of file PLUGIN.php.

NucleusPlugin::getVersion (  ) 

Reimplemented in NP_Ping, and NP_SkinFiles.

Definition at line 30 of file PLUGIN.php.

NucleusPlugin::getDescription (  ) 

Reimplemented in NP_Ping, and NP_SkinFiles.

Definition at line 31 of file PLUGIN.php.

NucleusPlugin::getMinNucleusVersion (  ) 

Reimplemented in NP_Ping.

Definition at line 35 of file PLUGIN.php.

NucleusPlugin::getMinNucleusPatchLevel (  ) 

Definition at line 36 of file PLUGIN.php.

NucleusPlugin::getEventList (  ) 

Reimplemented in NP_Ping, and NP_SkinFiles.

Definition at line 37 of file PLUGIN.php.

Referenced by subscribtionListIsUptodate().

NucleusPlugin::getTableList (  ) 

Definition at line 38 of file PLUGIN.php.

NucleusPlugin::hasAdminArea (  ) 

Reimplemented in NP_SkinFiles.

Definition at line 39 of file PLUGIN.php.

NucleusPlugin::install (  ) 

Reimplemented in NP_Ping, and NP_SkinFiles.

Definition at line 41 of file PLUGIN.php.

NucleusPlugin::unInstall (  ) 

Reimplemented in NP_SkinFiles.

Definition at line 42 of file PLUGIN.php.

NucleusPlugin::init (  ) 

Reimplemented in NP_Ping, and NP_SkinFiles.

Definition at line 44 of file PLUGIN.php.

NucleusPlugin::doSkinVar ( skinType  ) 

Definition at line 46 of file PLUGIN.php.

NucleusPlugin::doTemplateVar ( &$  item  ) 

Definition at line 47 of file PLUGIN.php.

NucleusPlugin::doTemplateCommentsVar ( &$  item,
&$  comment 
)

Definition at line 53 of file PLUGIN.php.

NucleusPlugin::doAction ( type  ) 

Definition at line 60 of file PLUGIN.php.

NucleusPlugin::doIf ( key,
value 
)

Definition at line 61 of file PLUGIN.php.

NucleusPlugin::doItemVar (  ) 

Definition at line 62 of file PLUGIN.php.

NucleusPlugin::supportsFeature ( feature  ) 

Checks if a plugin supports a certain feature.

Returns:
1 if the feature is reported, 0 if not
Parameters:
$feature Name of the feature. See plugin documentation for more info 'SqlTablePrefix' -> if the plugin uses the sql_table() method to get table names 'HelpPage' -> if the plugin provides a helppage

Reimplemented in NP_Ping, and NP_SkinFiles.

Definition at line 73 of file PLUGIN.php.

NucleusPlugin::getPluginDep (  ) 

Report a list of plugin that is required to function

Returns:
an array of names of plugin, an empty array indicates no dependency

Definition at line 82 of file PLUGIN.php.

NucleusPlugin::createOption ( name,
desc,
type,
defValue = '',
typeExtras = '' 
)

Creates a new option for this plugin

Parameters:
name A string uniquely identifying your option. (max. length is 20 characters)
description A description that will show up in the nucleus admin area (max. length: 255 characters)
type Either 'text', 'yesno' or 'password' This info is used when showing 'edit plugin options' screens
value Initial value for the option (max. value length is 128 characters)

Definition at line 99 of file PLUGIN.php.

References _createOption().

Referenced by NP_Ping::install().

NucleusPlugin::createBlogOption ( name,
desc,
type,
defValue = '',
typeExtras = '' 
)

Definition at line 102 of file PLUGIN.php.

References _createOption().

NucleusPlugin::createMemberOption ( name,
desc,
type,
defValue = '',
typeExtras = '' 
)

Definition at line 105 of file PLUGIN.php.

References _createOption().

NucleusPlugin::createCategoryOption ( name,
desc,
type,
defValue = '',
typeExtras = '' 
)

Definition at line 108 of file PLUGIN.php.

References _createOption().

NucleusPlugin::createItemOption ( name,
desc,
type,
defValue = '',
typeExtras = '' 
)

Definition at line 111 of file PLUGIN.php.

References _createOption().

NucleusPlugin::deleteOption ( name  ) 

Removes the option from the database

Note: Options get erased automatically on plugin uninstall

Definition at line 120 of file PLUGIN.php.

References _deleteOption().

NucleusPlugin::deleteBlogOption ( name  ) 

Definition at line 123 of file PLUGIN.php.

References _deleteOption().

NucleusPlugin::deleteMemberOption ( name  ) 

Definition at line 126 of file PLUGIN.php.

References _deleteOption().

NucleusPlugin::deleteCategoryOption ( name  ) 

Definition at line 129 of file PLUGIN.php.

References _deleteOption().

NucleusPlugin::deleteItemOption ( name  ) 

Definition at line 132 of file PLUGIN.php.

References _deleteOption().

NucleusPlugin::setOption ( name,
value 
)

Sets the value of an option to something new

Definition at line 139 of file PLUGIN.php.

References _setOption().

NucleusPlugin::setBlogOption ( blogid,
name,
value 
)

Definition at line 142 of file PLUGIN.php.

References $blogid, and _setOption().

NucleusPlugin::setMemberOption ( memberid,
name,
value 
)

Definition at line 145 of file PLUGIN.php.

References $memberid, and _setOption().

NucleusPlugin::setCategoryOption ( catid,
name,
value 
)

Definition at line 148 of file PLUGIN.php.

References $catid, and _setOption().

NucleusPlugin::setItemOption ( itemid,
name,
value 
)

Definition at line 151 of file PLUGIN.php.

References $itemid, and _setOption().

NucleusPlugin::getOption ( name  ) 

Retrieves the current value for an option

Definition at line 158 of file PLUGIN.php.

References $query, _getOption(), getID(), mysql_fetch_object(), sql_query(), and sql_table().

Referenced by NP_Ping::event_JustPosted(), and NP_Ping::sendPings().

NucleusPlugin::getBlogOption ( blogid,
name 
)

Definition at line 181 of file PLUGIN.php.

References $blogid, and _getOption().

NucleusPlugin::getMemberOption ( memberid,
name 
)

Definition at line 184 of file PLUGIN.php.

References $memberid, and _getOption().

NucleusPlugin::getCategoryOption ( catid,
name 
)

Definition at line 187 of file PLUGIN.php.

References $catid, and _getOption().

NucleusPlugin::getItemOption ( itemid,
name 
)

Definition at line 190 of file PLUGIN.php.

References $itemid, and _getOption().

NucleusPlugin::getAllBlogOptions ( name  ) 

Retrieves an associative array with the option value for each context id

Definition at line 198 of file PLUGIN.php.

References _getAllOptions().

NucleusPlugin::getAllMemberOptions ( name  ) 

Definition at line 201 of file PLUGIN.php.

References _getAllOptions().

NucleusPlugin::getAllCategoryOptions ( name  ) 

Definition at line 204 of file PLUGIN.php.

References _getAllOptions().

NucleusPlugin::getAllItemOptions ( name  ) 

Definition at line 207 of file PLUGIN.php.

References _getAllOptions().

NucleusPlugin::getBlogOptionTop ( name,
amount = 10,
sort = 'desc' 
)

Retrieves an indexed array with the top (or bottom) of an option (delegates to _getOptionTop())

Definition at line 215 of file PLUGIN.php.

References $amount, and _getOptionTop().

NucleusPlugin::getMemberOptionTop ( name,
amount = 10,
sort = 'desc' 
)

Definition at line 218 of file PLUGIN.php.

References $amount, and _getOptionTop().

NucleusPlugin::getCategoryOptionTop ( name,
amount = 10,
sort = 'desc' 
)

Definition at line 221 of file PLUGIN.php.

References $amount, and _getOptionTop().

NucleusPlugin::getItemOptionTop ( name,
amount = 10,
sort = 'desc' 
)

Definition at line 224 of file PLUGIN.php.

References $amount, and _getOptionTop().

NucleusPlugin::_getOptionTop ( context,
name,
amount = 10,
sort = 'desc' 
)

Retrieves an array of the top (or bottom) of an option from a plugin.

Author:
TeRanEX
Parameters:
string $context the context for the option: item, blog, member,...
string $name the name of the option
int $amount how many rows must be returned
string $sort desc or asc
Returns:
array array with both values and contextid's private

Definition at line 238 of file PLUGIN.php.

References $amount, $query, _getOID(), mysql_fetch_array(), and sql_query().

Referenced by getBlogOptionTop(), getCategoryOptionTop(), getItemOptionTop(), and getMemberOptionTop().

NucleusPlugin::getID (  ) 

Returns the plugin ID

Definition at line 273 of file PLUGIN.php.

Referenced by getOption(), and subscribtionListIsUptodate().

NucleusPlugin::getAdminURL (  ) 

returns the URL of the admin area for this plugin (in case there's no such area, the returned information is invalid)

Definition at line 281 of file PLUGIN.php.

References $CONF, and getShortName().

Referenced by NP_SkinFiles::event_QuickMenu().

NucleusPlugin::getDirectory (  ) 

Returns the directory where the admin directory is located and where the plugin can maintain his extra files

Definition at line 290 of file PLUGIN.php.

References $DIR_PLUGINS, and getShortName().

Referenced by NP_SkinFiles::init(), and NP_Ping::init().

NucleusPlugin::getShortName (  ) 

Derives the short name for the plugin from the classname (all lowercase)

Definition at line 298 of file PLUGIN.php.

Referenced by getAdminURL(), and getDirectory().

NucleusPlugin::NucleusPlugin (  ) 

Definition at line 309 of file PLUGIN.php.

NucleusPlugin::clearOptionValueCache (  ) 

Definition at line 315 of file PLUGIN.php.

NucleusPlugin::_createOption ( context,
name,
desc,
type,
defValue,
typeExtras = '' 
)

NucleusPlugin::_deleteOption ( context,
name 
)

NucleusPlugin::_setOption ( context,
contextid,
name,
value 
)

private returns: 1 on success, 0 on failure

Definition at line 361 of file PLUGIN.php.

Referenced by setBlogOption(), setCategoryOption(), setItemOption(), setMemberOption(), and setOption().

NucleusPlugin::_getOption ( context,
contextid,
name 
)

NucleusPlugin::_getAllOptions ( context,
name 
)

Returns assoc array with all values for a given option (one option per possible context id)

Definition at line 432 of file PLUGIN.php.

Referenced by getAllBlogOptions(), getAllCategoryOptions(), getAllItemOptions(), and getAllMemberOptions().

NucleusPlugin::_getOID ( context,
name 
)

Gets the 'option identifier' that corresponds to a given option name. When this method is called for the first time, all the OIDs for the plugin are loaded into memory, to avoid re-doing the same query all over.

Definition at line 469 of file PLUGIN.php.

Referenced by _getOptionTop().

NucleusPlugin::_getDefVal ( context,
name 
)

Definition at line 486 of file PLUGIN.php.

NucleusPlugin::_deleteOptionValues ( context,
contextid 
)

Deletes all option values for a given context and contextid (used when e.g. a blog, member or category is deleted)

(static method)

Definition at line 499 of file PLUGIN.php.

Referenced by ADMIN::action_deleteblogconfirm(), ITEM::delete(), ADMIN::deleteOneCategory(), and ADMIN::deleteOneMember().

NucleusPlugin::getOptionMeta ( typeExtra  )  [static]

splits the option's typeextra field (at ;'s) to split the meta collection

Parameters:
string $typeExtra the value of the typeExtra field of an option
Returns:
array array of the meta-key/value-pairs
Author:
TeRanEX

Definition at line 522 of file PLUGIN.php.

Referenced by _applyPluginOptions(), getOptionSelectValues(), and listplug_plugOptionRow().

NucleusPlugin::getOptionSelectValues ( typeExtra  ) 

filters the selectlists out of the meta collection

Parameters:
string $typeExtra the value of the typeExtra field of an option
Returns:
string the selectlist
Author:
TeRanEX

Definition at line 543 of file PLUGIN.php.

References getOptionMeta().

Referenced by listplug_plugOptionRow().

NucleusPlugin::subscribtionListIsUptodate (  ) 

checks if the eventlist in the database is up-to-date

Returns:
bool if it is up-to-date it return true, else false
Author:
TeRanEX

Definition at line 554 of file PLUGIN.php.

References $a, getEventList(), getID(), mysql_fetch_array(), sql_query(), and sql_table().

NucleusPlugin::_applyPluginOptions ( &$  aOptions,
newContextid = 0 
) [static]

Parameters:
$aOptions,: array ( 'oid' => array( 'contextid' => 'value')) (taken from request using requestVar())
$newContextid,: integer (accepts a contextid when it is for a new contextid there was no id available at the moment of writing the formcontrols into the page (by ex: itemOptions for new item)

Definition at line 579 of file PLUGIN.php.

References $manager, $query, getOptionMeta(), mysql_fetch_object(), sql_query(), sql_table(), and undoMagic().

Referenced by ADMIN::action_blogsettingsupdate(), ADMIN::action_changemembersettings(), ADMIN::action_pluginoptionsupdate(), ITEM::createFromRequest(), and ITEM::update().


Member Data Documentation

NucleusPlugin::$_aOptionValues

Definition at line 302 of file PLUGIN.php.

NucleusPlugin::$_aOptionToInfo

Definition at line 303 of file PLUGIN.php.

NucleusPlugin::$plugin_options

Definition at line 304 of file PLUGIN.php.

NucleusPlugin::$plugid

Definition at line 305 of file PLUGIN.php.


The documentation for this class was generated from the following file:



Generated on Wed Jun 25 17:26:02 2008 by  doxygen 1.5.5