Class: ItemHelper

Source Location: /CORE/system/classes/item/ItemHelper.php

Class ItemHelper

Class Overview

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

Located in /CORE/system/classes/item/ItemHelper.php [line 36]



		
				Author(s):
		
  • Kevin Papst
Information Tags:
Version:  $Id: ItemHelper.php,v 1.12 2008/09/25 21:01:53 kpapst Exp $
Copyright:  Copyright (C) Kevin Papst
License:  GNU Public License

Methods

[ Top ]
Method Summary
static void   buildFutureURLComplete()  
static void   buildInitialFilename()   Build a Filename that can be used for new Items or Language Versions.
static void   buildInitialFilenameDirectory()   Build a Filename that can be used for new Items or Language Versions.
static void   buildURLComplete()  
static boolean   checkFile()   Static method to check if the given File is acessable and writeable.
static void   fixSqlValue()  
static void   getFutureURL()  
static void   getFutureURLFull()  
static String   getHistoryURL()  
static String   getHistoryURLForTS()  
static String   getHistoryURLFull()  
static String   getHistoryURLFullForTS()  
static array   prepareSqlValues()   Static method to prepare a SQL Substring.
static void   saveContent()   Saves the Content to the given File, by replacing the old File content.

[ Top ]
Methods
static method buildFutureURLComplete  [line 142]

  static void buildFutureURLComplete( $directory, $extension, $itemid, $languageid  )

Parameters:
   $directory: 
   $extension: 
   $itemid: 
   $languageid: 


[ Top ]
static method buildInitialFilename  [line 114]

  static void buildInitialFilename( extension $extension, [id $id = ''], [langid $langid = ''], [timestamp $timestamp = '']  )

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.

Parameters:
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


[ Top ]
static method buildInitialFilenameDirectory  [line 92]

  static void buildInitialFilenameDirectory( $directory, $extension, [ $id = ''], [ $langid = ''], [ $timestamp = '']  )

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.

Parameters:
   $directory: 
   $extension: 
   $id: 
   $langid: 
   $timestamp: 


[ Top ]
static method buildURLComplete  [line 81]

  static void buildURLComplete( $directory, $extension, $itemid, $languageid, [ $timestamp = '']  )

Parameters:
   $directory: 
   $extension: 
   $itemid: 
   $languageid: 
   $timestamp: 


[ Top ]
static method checkFile  [line 197]

  static boolean checkFile( $filename  )

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

Parameters:
   $filename: 

API Tags:
Return:  if file could be written


[ Top ]
static method fixSqlValue  [line 187]

  static void fixSqlValue( $str  )

Parameters:
   $str: 


[ Top ]
static method getFutureURL  [line 137]

  static void getFutureURL( $item  )

Parameters:
   $item: 


[ Top ]
static method getFutureURLFull  [line 132]

  static void getFutureURLFull( $item  )

Parameters:
   $item: 


[ Top ]
static method getHistoryURL  [line 66]

  static String getHistoryURL( $item  )

Parameters:
   $item: 

API Tags:
Return:  the Items History Version full name without directory


[ Top ]
static method getHistoryURLForTS  [line 58]

  static String getHistoryURLForTS( $item, $timestamp  )

Parameters:
   $item: 
   $timestamp: 

API Tags:
Return:  the Items History Version full name without directory for timestamp


[ Top ]
static method getHistoryURLFull  [line 42]

  static String getHistoryURLFull( $item  )

Parameters:
   $item: 

API Tags:
Return:  the Items History Version full name including directory


[ Top ]
static method getHistoryURLFullForTS  [line 50]

  static String getHistoryURLFullForTS( $item, $timestamp  )

Parameters:
   $item: 
   $timestamp: 

API Tags:
Return:  the Items History Version full name including directory for timestamp


[ Top ]
static method prepareSqlValues  [line 153]

  static array prepareSqlValues( $id, $langid, [ $values = array()]  )

Static method to prepare a SQL Substring.

Parameters:
   $id: 
   $langid: 
   $values: 

API Tags:
Return:  an Array with SQL Replacern


[ Top ]
static method saveContent  [line 212]

  static void saveContent( $filename, $content  )

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

Parameters:
   $filename: 
   $content: 


[ Top ]