Packageindex Classtrees Modulegroups Elementlist Report XML Files

/home/ssmith/sandbox/syntax-cms/src/private/lib/syntaxcms/functions.lib.php::/home/ssmith/sandbox/syntax-cms/src/private/lib/syntaxcms/functions.lib.php

private module /home/ssmith/sandbox/syntax-cms/src/private/lib/syntaxcms/functions.lib.php

* the character count (currently period, question mark, and exclamation point), * or the whole string if it is too short. * Ex: stx_truncate_to_sentence('Hello World! How are you?', 8) would return 'Hello World!' * Ex: stx_truncate_to_sentence('Hello World! How', 80) would return 'Hello World! How' * *

Authors

 

Public Method Summary

string stx_get_section_template(object Section &$section)
Takes a Section object and looks for its template. Put here
string get_section_template(object Section &$section)
Alias for stx_get_section_template
int stx_find_last_date(int $month, int $year)
Finds the last date of a numerically given month and year
int find_last_day(int $month, int $year)
Alias for stx_find_last_date()
string stx_obfuscate_ascii(string $text)
Encodes ASCII text using numeric entities.
string obfuscate_ascii(string $text)
Alias for stx_obfuscate_ascii()
string stx_get_image_link(string $url, [ constant $restrict, string $class, string $alt ])
takes an image, finds the width and height, allows you to set a maximum width or height
string get_image_link(string $url, [ constant $restrict, string $class, string $alt ])
Alias for stx_get_image_link
object ListWidget &stx_list_from_picktable(string $name, string $picktable, [ array $prepend ])
single function call for getting a listWidget object based on
object ListWidget &list_from_picktable(string $name, string $picktable, [ array $prepend ])
alias for &stx_list_from_picktable()
object ListWidget &stx_list_from_picktable_tree(string $name, string $picktable, [ array $prepend ], $depth_label)
single function call for getting a listWidget object based on
object ListWidget &list_from_picktable_tree(string $name, string $picktable, [ array $prepend ], $depth_label)
Alias for &stx_list_from_picktable_tree()

Private Method Summary

void stx_create_link(string $url, string $text, [ string $title ])
Creates an a hreg tag given a url and its label
void _link(string $url, string $text, [ string $title ])
Alias for stx_link
string stx_format_text(string $text)
Formats text for display.
string _text(string $text)
Alias for stx_text()
string stx_format_timestamp(integer $ts, [ constant $fmt ])
Formats a timestamp into a date.
string _date(integer $ts, [ constant $fmt ])
Alias for stx_date()
string stx_format_date_string(integer $time, [ constant $format ])
Formats time string (such as a SQL formatted date) into a standard date format.
string _sql_date(integer $time, [ constant $format ])
Alias for stx_sql_date()
object reference &stx_request_factory(string $path)
A sort of factory method for the Request object, that looks
object reference &_request_factory(string $path)
Alias for &stx_request_factory()
string stx_get_sort_direction(string $field, object [unknown] &$Request)
Calculates a sort direction for a field.
string _direc(string $field, object [unknown] &$Request)
Alias for stx_get_sort_direction()
bool stx_is_url_external(string $url)
Tells whether a link is external to the current site
void stx_truncate_to_sentence( $text, $length)
Warning: documentation is missing.
void is_valid_email( $address)
Warning: documentation is missing.

Public Method Details

stx_get_section_template

public string stx_get_section_template( object Section &$section )

  so the Section object can be regenerated if its properties change. Useful for inheriting templates from parents.

Parameter
object Section &$section
Returns string


get_section_template

public string get_section_template( object Section &$section )

 

Parameter
object Section &$section
Returns string


stx_find_last_date

public int stx_find_last_date( int $month, int $year )

 

Parameter
int $month
to have last date found for
int $year
to make sure leap year is calculated correctly
Returns int

last date of given month

Author(s) Sandy Smith <ssmith@forumone.com>

find_last_day

public int find_last_day( int $month, int $year )

 

Parameter
int $month
to have last date found for
int $year
to make sure leap year is calculated correctly
Returns int

last date of given month


stx_obfuscate_ascii

public string stx_obfuscate_ascii( string $text )

  Useful for obfuscating e-mail addresses to prevent them from being harvested by spambots. Note--this will not work well with entities or non-ASCII characters.

Parameter
string $text
Plain ASCII text to be obfuscated
Returns string

obfuscated text


obfuscate_ascii

public string obfuscate_ascii( string $text )

 

Parameter
string $text
Plain ASCII text to be obfuscated
Returns string

obfuscated text


stx_get_image_link

public string stx_get_image_link( string $url, [ constant $restrict, string $class, string $alt ] )

  and returns an HTML img tag. Only works on local images.

Parameter
string $url
The local URL (everything after the domain)
constant $restrict = >>array('by'<<
Associative array. Valid keys are 'by' (string 'width' or 'height') and 'max' (int)
string $class = >>null<<
CSS class
string $alt = >>null<<
Alt text
Returns string

The img tag.


get_image_link

public string get_image_link( string $url, [ constant $restrict, string $class, string $alt ] )

 

Parameter
string $url
The local URL (everything after the domain)
constant $restrict = >>array('by'<<
Associative array. Valid keys are 'by' (string 'width' or 'height') and 'max' (int)
string $class = >>null<<
CSS class
string $alt = >>null<<
Alt text
Returns string

The img tag.


&stx_list_from_picktable

public object ListWidget &stx_list_from_picktable( string $name, string $picktable, [ array $prepend ] )

  a Syntax pick table object.

Parameter
string $name
, name of list widget
string $picktable
, name of pick table
array $prepend = >>null<<
, optional array of values to prepend to options array
Returns object ListWidget


&list_from_picktable

public object ListWidget &list_from_picktable( string $name, string $picktable, [ array $prepend ] )

 

Parameter
string $name
, name of list widget
string $picktable
, name of pick table
array $prepend = >>null<<
, optional array of values to prepend to options array
Returns object ListWidget


&stx_list_from_picktable_tree

public object ListWidget &stx_list_from_picktable_tree( string $name, string $picktable, [ array $prepend ], $depth_label )

  a Syntax pick table object.

Parameter
string $name
, name of list widget
string $picktable
, name of pick table
array $prepend = >>null<<
, optional array of values to prepend to options array
$depth_label
Warning: documentation is missing.
Returns object ListWidget


&list_from_picktable_tree

public object ListWidget &list_from_picktable_tree( string $name, string $picktable, [ array $prepend ], $depth_label )

 

Parameter
string $name
, name of list widget
string $picktable
, name of pick table
array $prepend = >>null<<
, optional array of values to prepend to options array
$depth_label
Warning: documentation is missing.
Returns object ListWidget


Private Method Details

stx_create_link

private void stx_create_link( string $url, string $text, [ string $title ] )

 

Parameter
string $url
string $text
text
string $title = >>null<<
title (optional)
Returns void

Author(s)

_link

private void _link( string $url, string $text, [ string $title ] )

 

Parameter
string $url
string $text
text
string $title = >>null<<
title (optional)
Returns void

Author(s)

stx_format_text

private string stx_format_text( string $text )

  This is for descriptions & longer text bodies. Is smart about whether to use nl2br() or to simply display raw.

Parameter
string $text
String to be formatted
Returns string $text

Formatted


_text

private string _text( string $text )

 

Parameter
string $text
String to be formatted
Returns string $text

Formatted


stx_format_timestamp

private string stx_format_timestamp( integer $ts, [ constant $fmt ] )

 

Parameter
integer $ts
Unix Timestamp
constant $fmt = >>LOCALE_DATE_STD<<
Time formatting string
Returns string

formatted date


_date

private string _date( integer $ts, [ constant $fmt ] )

 

Parameter
integer $ts
Unix Timestamp
constant $fmt = >>LOCALE_DATE_STD<<
Time formatting string
Returns string

formatted date


stx_format_date_string

private string stx_format_date_string( integer $time, [ constant $format ] )

 

Parameter
integer $time
SQL Timestamp
constant $format = >>LOCALE_DATE_STD<<
Time formatting string
Returns string

formatted date


_sql_date

private string _sql_date( integer $time, [ constant $format ] )

 

Parameter
integer $time
SQL Timestamp
constant $format = >>LOCALE_DATE_STD<<
Time formatting string
Returns string

formatted date


&stx_request_factory

private object reference &stx_request_factory( string $path )

  at a path and loads the correct Request module. Very site-specicific (because of path conventions) -- so dont' want this to be in Request classes [yet].

Parameter
string $path
Returns object reference

to new Request instance


&_request_factory

private object reference &_request_factory( string $path )

 

Parameter
string $path
Returns object reference

to new Request instance


stx_get_sort_direction

private string stx_get_sort_direction( string $field, object [unknown] &$Request )

 

Parameter
string $field
FIeld to sort by
object [unknown] &$Request
the request object
Returns string

The SQL direction for sorting


_direc

private string _direc( string $field, object [unknown] &$Request )

 

Parameter
string $field
FIeld to sort by
object [unknown] &$Request
the request object
Returns string

The SQL direction for sorting


stx_is_url_external

private bool stx_is_url_external( string $url )

 

Parameter
string $url
the url to test
Returns bool

true if external, false if on this site


stx_truncate_to_sentence

private void stx_truncate_to_sentence( $text, $length )

 

Warning: documentation is missing.

Parameter
$text
Warning: documentation is missing.
$length
Warning: documentation is missing.
Returns void


is_valid_email

private void is_valid_email( $address )

 

Warning: documentation is missing.

Parameter
$address
Warning: documentation is missing.
Returns void



Packageindex Classtrees Modulegroups Elementlist Report XML Files
Generated on Fri, 28 Apr 2006 19:06:12 -0400 by PHPDoc v1.5 www.phpdoc.de