com.lokorin.dfcrafters.lib
[ class tree: com.lokorin.dfcrafters.lib ] [ index: com.lokorin.dfcrafters.lib ] [ all elements ]

Procedural File: lib_updates.php

Source Location: /_includes/lib_updates.php



Classes:

Update
Describes an update. An update is a manifestation of a change to the site that viewers of the site should be aware of. An update belongs to an UpdateType.
UpdateType
Describes an update type. An update type is a group that updates are grouped into. The type decides how updates of its type should be displayed.


Page Details:

A library that contains everything that is connected to the site's update system.



Tags:

filesource:  Source Code for this file
license:  GNU Lesser General Public License
version:  $Revision: 1.23 $
author:  Andreas Launila


Includes:

require_once('common.php') [line 19]
For access to common constants and functions.






UPDATES_CACHE_PATH [line 27]

UPDATES_CACHE_PATH = FOLDER_CACHE.'updates.php'
The path (from the page root) where the cache of the updates should be kept.



Tags:

access:  private

[ Top ]




addUpdate [line 247]

void addUpdate( integer $updateType, mixed $updateLinkId, string $updateText)

Adds an update to the database.



Tags:

access:  public


Parameters

integer   $updateType   The unique identifier of the update type that the update should belong to.
mixed   $updateLinkId   The type specific identifier that is used when constructing links to the updated item.
string   $updateText   The text describing the specific update. This value will generally differ from each update.
[ Top ]



convertToDays [line 147]

integer convertToDays( integer $time)

Converts unixtime in seconds to the corresponding number of days.



Tags:

return:  The corresponding number of days.
access:  public


Parameters

integer   $time   A unix time (in seconds).
[ Top ]



getAllUpdateTypeDescriptions [line 175]

array getAllUpdateTypeDescriptions( )

Gets the descriptions of all available update types.



Tags:

return:  An array with each type's unique identifier as key and the corresponding description as the corresponding value.
access:  public


[ Top ]



getAllUpdateTypes [line 157]

array getAllUpdateTypes( )

Gets a list of all available update types.



Tags:

return:  An array of UpdateType instances where the key is the corresponding unique identifier for the update type.
access:  public


[ Top ]



getGroupedUpdates [line 101]

array getGroupedUpdates( integer $maxDays, integer $ageCutoff)

Retrives all updates that match the specified criterias. The updates are

grouped in days,




Tags:

return:  An array containg day groupings where the key is the number of days in unix time when the update occured. The value is an Update instance.
access:  private


Parameters

integer   $maxDays   The maximum number of day groupings that should be returned.
integer   $ageCutoff   The age cutoff in days. Any updates that are older than this number of days will not be included in the result.
[ Top ]



getUpdateBoxes [line 35]

string getUpdateBoxes( )

Gets boxes in XHTML format containing all recent updates that have been done to the site.



Tags:

return:  An XHTML representation of updateboxes.
access:  private


[ Top ]



getUpdates [line 130]

array getUpdates( string $sqlSelector)

Gets all updates that matches the specified selector.



Tags:

return:  An array where the key is the order in which the updates were retrieved. The values are Update instances.
access:  public


Parameters

string   $sqlSelector   The selector that specifies all matching updates, e.g. "WHERE id > 5" or "ORDER BY id".
[ Top ]



groupUpdatesByType [line 192]

array groupUpdatesByType( array $updates)

Groups update instance by their update types.



Tags:

return:  The grouped updates. The array has keys for each occuring update type's unique identifier. the value is an array of all update instance with that update type.
access:  public


Parameters

array   $updates   An array with Update instances as value.
[ Top ]



insertUpdateBox [line 227]

void insertUpdateBox( )

Inserts the update box from the cache.



Tags:

access:  public
throws:  IOException If the cache was not found and could not be created.


[ Top ]



notifyOfAdminActivity [line 269]

void notifyOfAdminActivity( string $table, string $module, integer $id)

Notifies all update types that there has been administrative activity. This allows the update types to catch table/module combinations that they are listening to and take the appropriate action.



Tags:

access:  public


Parameters

string   $table   The name of the table that the activity was performed on.
string   $module   The class name of the module that performed the activity.
integer   $id   The identifier for the row that the activity affected.
[ Top ]



updateUpdatesCache [line 209]

void updateUpdatesCache( )

Rebuilds the update boxes based on the latest information and then writes the result into the chache.



Tags:

access:  public


[ Top ]



Documentation generated on Tue, 10 Jan 2006 17:06:37 +0100 by phpDocumentor 1.3.0RC4