Class ItemHelper

Description

Holds helper methods for building informations out of Items and/or for Items.

  • version: $Id: ItemHelper.php,v 1.8 2006/11/26 22:04:09 kpapst Exp $
  • copyright: Copyright (C) 2002-2006 Kevin Papst
  • author: Kevin Papst
  • license: GNU Public License


			
Method Summary
void buildFutureURLComplete ( $directory,  $extension,  $itemid,  $languageid)
void buildInitialFilename (extension $extension, [id $id = ''], [langid $langid = ''], [timestamp $timestamp = ''])
void buildInitialFilenameDirectory ( $directory,  $extension, [ $id = ''], [ $langid = ''], [ $timestamp = ''])
void buildURLComplete ( $directory,  $extension,  $itemid,  $languageid, [ $timestamp = ''])
boolean checkFile ( $filename)
void fixSqlValue ( $str)
void getFutureURL ( $item)
void getFutureURLFull ( $item)
String getHistoryURL ( $item)
String getHistoryURLForTS ( $item,  $timestamp)
String getHistoryURLFull ( $item)
String getHistoryURLFullForTS ( $item,  $timestamp)
array prepareSqlValues ( $id,  $langid, [ $values = array()])
void saveContent ( $filename,  $content)
Methods
buildFutureURLComplete (line 144)
void buildFutureURLComplete ( $directory,  $extension,  $itemid,  $languageid)
  • $directory
  • $extension
  • $itemid
  • $languageid
buildInitialFilename (line 116)

Build a Filename that can be used for new Items or Language Versions.

If Item ID or Language ID is not passed, a random string will be generated, if the timestamp is missing, it uses the current timestamp.

void buildInitialFilename (extension $extension, [id $id = ''], [langid $langid = ''], [timestamp $timestamp = ''])
  • extension $extension: the File Extension (for example 'html')
  • id $id: the Item ID or an empty String
  • langid $langid: the Language ID or an empty String
  • timestamp $timestamp: the Timestamp or an empty String
buildInitialFilenameDirectory (line 94)

Build a Filename that can be used for new Items or Language Versions.

This method gurantees to return a Filename that is unique within the given Directory and that can be used for creating new Files. It returns the new Filename WITHOUT the directory.

void buildInitialFilenameDirectory ( $directory,  $extension, [ $id = ''], [ $langid = ''], [ $timestamp = ''])
  • $directory
  • $extension
  • $id
  • $langid
  • $timestamp
buildURLComplete (line 83)

May be accessed static.

void buildURLComplete ( $directory,  $extension,  $itemid,  $languageid, [ $timestamp = ''])
  • $directory
  • $extension
  • $itemid
  • $languageid
  • $timestamp
checkFile (line 198)

Static method to check if the given File is acessable and writeable.

  • return: if file could be written
boolean checkFile ( $filename)
  • $filename
fixSqlValue (line 188)
void fixSqlValue ( $str)
  • $str
getFutureURL (line 139)
void getFutureURL ( $item)
  • $item
getFutureURLFull (line 134)
void getFutureURLFull ( $item)
  • $item
getHistoryURL (line 65)
  • return: the Items History Version full name without directory
String getHistoryURL ( $item)
  • $item
getHistoryURLForTS (line 57)
  • return: the Items History Version full name without directory for timestamp
String getHistoryURLForTS ( $item,  $timestamp)
  • $item
  • $timestamp
getHistoryURLFull (line 41)
  • return: the Items History Version full name including directory
String getHistoryURLFull ( $item)
  • $item
getHistoryURLFullForTS (line 49)
  • return: the Items History Version full name including directory for timestamp
String getHistoryURLFullForTS ( $item,  $timestamp)
  • $item
  • $timestamp
prepareSqlValues (line 155)

Static method to prepare a SQL Substring.

  • return: an Array with SQL Replacern
array prepareSqlValues ( $id,  $langid, [ $values = array()])
  • $id
  • $langid
  • $values
saveContent (line 213)

Saves the Content to the given File, by replacing the old File content.

void saveContent ( $filename,  $content)
  • $filename
  • $content

Documentation generated by phpDocumentor 1.3.1