Class Klutz

Description

Klutz Base Class.

$Horde: klutz/lib/Klutz.php,v 1.42 2008/11/25 18:09:04 mrubinsk Exp $

Copyright 2002-2008 The Horde Project (http://www.horde.org/)

Located in /lib/Klutz.php (line 48)


	
			
Variable Summary
 array $comics
 array $days
 array $image_types
 integer $sort
Method Summary
 Klutz Klutz ([integer $sort = KLUTZ_SORT_NAME])
 object A comicObject (string $index)
 void getMenu ([ $returnType = 'object'])
 mixed getProperty (string $index, string $property)
 array listByDriver (string $driver, [array $list = null])
 array listEnabled ([array $list = null], [timestamp $date = null])
 string _convertDay (string $a)
 integer _sortComics (string $a, string $b)
Variables
array $comics = array() (line 76)

Array of comics and their associated attributes

array $days = array('sun', 'mon', 'tue', 'wed',
'thu', 'fri', 'sat', 'sun')
(line 55)

Used to translate between literal dow and numeric dow (sun = 0, 7)

array $image_types = array(1 => 'image/gif',
2 => 'image/jpg',
3 => 'image/png',
6 => 'image/bmp',
7 => 'image/tiff',
8 => 'image/tiff',
)
(line 63)

MIME types for images based on the return value from getimagesize

integer $sort = null (line 85)

Sorting method to use. Options are KLUTZ_SORT_NAME (sort by comic title), KLUTZ_SORT_AUTHOR (sort by Author's last name), and KLUTZ_SORT_NOSORT (don't promise any given sorting order).

Methods
Constructor Klutz (line 95)

Constructor - Parse the /config/comics.php config file and store

the results in $comic. Also tries to validate all the data it can and adjust case, etc., to more predictible consistency than humans editing config files can give. :)

Klutz Klutz ([integer $sort = KLUTZ_SORT_NAME])
  • integer $sort: Sorting method to use
comicObject (line 280)

Return a Klutz_Comic for the given index

  • return: Klutz_Comic object for the given index
object A comicObject (string $index)
  • string $index: The index key for the desired comic
getMenu (line 332)

Build Klutz's list of menu items.

void getMenu ([ $returnType = 'object'])
  • $returnType
getProperty (line 304)

Return the requested property for the requested comic

  • return: The value of $property for $index
mixed getProperty (string $index, string $property)
  • string $index: The index key for the desired comic
  • string $property: The desired property
listByDriver (line 260)

Return a list of comics that use the given fetch driver

  • return: A list of the comics passed in that have been filtered based on driver
array listByDriver (string $driver, [array $list = null])
  • string $driver: The driver to check for
  • array $list: The list to filter by driver (default all comics)
listEnabled (line 227)

Return a list of comics that are marked as enabled, and that should appear on a given day if a date is passed in.

  • return: A list of comic indecies
array listEnabled ([array $list = null], [timestamp $date = null])
  • array $list: The list to extract from (default is all comics, but smaller arrays are okay).
  • timestamp $date: If passed in, check the $days array to make sure the comic should appear today.
_convertDay (line 143)

Convert a user-passed string into a three-letter, lowercased day abbr.

  • return: A three-letter abbreviation for the requested day, or the first three letters of the passed string lowercased.
string _convertDay (string $a)
  • string $a: The string to convert
_sortComics (line 197)

Comparse two comics and return -1, 0, or 1 based on the $sort member variable

  • return: @see strcmp
integer _sortComics (string $a, string $b)
  • string $a: The index of the first comic
  • string $b: The index of the second comic

Documentation generated on Sun, 30 Jan 2011 05:30:35 +0000 by phpDocumentor 1.4.3