[ Index ]

PHP Cross Reference of Eventum

title

Body

[close]

/include/ -> class.misc.php (summary)

(no description)

File Size: 720 lines (23 kb)
Included or required: 46 times
Referenced: 0 times
Includes or requires: 2 files
 include/class.error_handler.php
 include/class.setup.php

Defines 1 class

Misc:: (25 methods):
  arrayDiff()
  getToolCaption()
  prompt()
  getInput()
  checkSpelling()
  getFileContents()
  escapeWhitespace()
  array_map_deep()
  formatFileSize()
  dispelMagicQuotes()
  escapeString()
  escapeInteger()
  prepareBooleanSearch()
  getRandomTip()
  getFileList()
  getFormattedTime()
  activateLinks()
  indent()
  formatReply()
  formatReplyDate()
  isWritableDirectory()
  highlightQuotedReply()
  displayRequirementErrors()
  base64encode()
  getBooleanDisplayValue()


Class: Misc  - X-Ref

Class to hold methods and algorythms that woudln't fit in other classes, such
as functions to work around PHP bugs or incompatibilities between separate
PHP configurations.

arrayDiff($foo, $bar)   X-Ref
Method used to simulate the correct behavior of array_diff().

param: array $foo The first array
param: array $bar The second array
return: array The different values

getToolCaption()   X-Ref
Method used to get the title given to the current installation of Eventum.

return: string The installation title

prompt($message, $default_value)   X-Ref
Method used to print a prompt asking the user for information.

param: string $message The message to print
param: string $default_value The default value to be used if the user just press <enter>
return: string The user response

getInput($is_one_liner = FALSE)   X-Ref
Method used to get the standard input.

return: string The standard input value

checkSpelling($text)   X-Ref
Method used to check the spelling of a given text.

param: string $text The text to check the spelling against
return: array Information about the mispelled words, if any

getFileContents($full_path)   X-Ref
Method used to get the full contents of the given file.

param: string $full_path The full path to the file
return: string The full contents of the file

escapeWhitespace($str)   X-Ref
Method used to replace all special whitespace characters (\n,
\r and \t) by their string equivalents. It is usually used in
JavaScript code.

param: string $str The string to be escaped
return: string The escaped string

array_map_deep(&$in_array, $in_func, $in_args = array()   X-Ref
Method used to simulate array_map()'s functionality in a deeply nested
array. The PHP built-in function does not allow that.

param: array $in_array The array to run the function against
param: string $in_func The function to run
param: array $in_args The array of arguments to pass to the function
param: integer $in_index Internal parameter to specify which index of the array we are currently mapping
return: array The mapped array

formatFileSize($bytes)   X-Ref
Method used to format a filesize in bytes to the appropriate string,
showing 'Kb' and 'Mb'.

param: integer $bytes The filesize to format
return: string The formatted filesize

dispelMagicQuotes(&$var)   X-Ref
The Util:: class provides generally useful methods of different kinds.

$Horde: framework/Util/Util.php,v 1.366 2004/03/30 17:03:58 jan Exp $

Copyright 1999-2004 Chuck Hagenbuch <chuck@horde.org>
Copyright 1999-2004 Jon Parise <jon@horde.org>

See the enclosed file COPYING for license information (LGPL). If you
did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

author: Chuck Hagenbuch <chuck@horde.org>
author: Jon Parise <jon@horde.org>

escapeString($input)   X-Ref
Method used to escape a string before using it in a query.

param: string $str The original string
return: string The escaped (or not) string

escapeInteger($input)   X-Ref
Accepts a value and cleans it to only contain numeric values

param: mixed $input The original input.
return: integer The input converted to an integer

prepareBooleanSearch($field, $value)   X-Ref
Method used to prepare a set of fields and values for a boolean search

param: string $field The field name
param: string $value The value for that field
return: string The prepared boolean search string

getRandomTip($tpl)   X-Ref
Method used to get a random file from the 'daily tips' directory.

param: object $tpl The template object
return: string Random filename

getFileList($directory)   X-Ref
Method used to get the full list of files contained in a specific
directory.

param: string $directory The path to list the files from
return: array The list of files

getFormattedTime($minutes, $omit_days = false, $omit_empty = false)   X-Ref
Method used to format the given number of minutes in a string showing
the number of hours and minutes (02:30)

param: integer $minutes The number of minutes to format
param: boolean $omit_days If days should not be used, hours will just show up as greater then 24.
param: boolean $omit_empty If true, values that are "00" will be omitted.
return: string The formatted time

activateLinks($text, $class = "link")   X-Ref
Method used to parse the given string for references to URLs and create
real links out of those.

param: string $text The text to search against
param: string $class The CSS class to use on the actual links
return: string The parsed string

indent($str)   X-Ref
Method used to indent a given string.

param: string $str The string to be indented
return: string The indented string

formatReply($str)   X-Ref
Method used to format the reply of someone's email that is available in
the system.

param: string $str The string to be formatted
return: string the formatted string

formatReplyDate($ts)   X-Ref
Method used to format a RFC 822 compliant date for the given unix
timestamp.

param: integer $ts The unix timestamp
return: string The formatted date string

isWritableDirectory($file)   X-Ref
Method used to check whether the given directory is writable by the
web server user or not.

param: string $file The full path to the directory
return: boolean

highlightQuotedReply($text)   X-Ref
Highlights quoted replies. Relies on a smarty plugin written by
Joscha Feth, joscha@feth.com, www.feth.com

param: string $text The text to highlight
return: string The highlighted text

displayRequirementErrors($errors)   X-Ref
Method used to display a nice error message when one (or more) of the
system requirements for Eventum is not found.

param: array $errors The list of errors
return: void

base64encode($values)   X-Ref
Base 64 encodes all elements of an array.

param: array $values The values to encode
return: array The array of encoded values.

getBooleanDisplayValue($value)   X-Ref
Changes a boolean value to either "Yes" or "No".

param: boolean $value The boolean value
return: string Either 'Yes' or 'No'.



Generated: Wed Dec 19 21:21:33 2007 Cross-referenced by PHPXref 0.7