Jeff PHP framework  0.99
Modular, extensible, OOP, MVC, lightweight php framework designed to ease the programmers in the development of web applications.
functions.php File Reference

PHP functions used a bit everywhere. More...

Go to the source code of this file.

Functions

 __ ($id)
 String localization.
 anchor ($link, $text, $opts=null)
 Anchor link.
 chargeEditor ($selector)
 Charge dojo editor.
 clearFloat ()
 Element used to clear css float.
 cutHtmlText ($html, $length, $ending, $strip_tags, $cut_words, $cut_images, $opts=null)
 Cut html strings without truncating tags.
 floatcomp ($a, $comp, $b, $decimals=2)
 Comparation of floating numbers.
 gOpt ($opts, $name, $dft=null)
 Retrieve value from associative array by key.
 layerWindow ($title, $url, $text, $opts=null)
 Layer window link.
 layerWindowCall ($title, $url, $opts=null)
 Javascript code to open a layer window.
 relativePath ($abspath)
 Relative path from absolute path.
 share ($social, $url, $title=null, $description=null)
 Social sharing.
 tooltip ($label, $title, $text, $opts=null)
 Span element with tooltip.

Detailed Description

PHP functions used a bit everywhere.

Author:
abidibo abidi.nosp@m.bo@g.nosp@m.mail..nosp@m.com
Version:
0.99
Date:
2011-2012

Definition in file functions.php.


Function Documentation

anchor ( link,
text,
opts = null 
)

Anchor link.

Parameters:
string$linklink's url
string$textlink's text
array$optsassociative array of options:
  • over: onmouseover attribute
  • out: onmouseout function
  • class: css class
  • title: title attribute
  • target: target attribute
Returns:
the anchor element

Definition at line 60 of file functions.php.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

chargeEditor ( selector)

Charge dojo editor.

Charges the dojo editor in the elements selected through the given css selector

Parameters:
string$selectorcss selector
Returns:
javascript code which charges the editor

Definition at line 211 of file functions.php.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Element used to clear css float.

Returns:
the clear float element

Definition at line 141 of file functions.php.

+ Here is the caller graph for this function:

cutHtmlText ( html,
length,
ending,
strip_tags,
cut_words,
cut_images,
opts = null 
)

Cut html strings without truncating tags.

Parameters:
string$htmlhtml string
int$lengthcut string length
string$endingcut string ending characters
bool$strip_tagswhether to remove all html tags or not
bool$cut_wordswhether to allow words cut or not
bool$cut_imageswhether to remove image tags or not
array$optsassociative array of options:
  • endingPosition "in" or "out". Whether to add the ending characters inside or outside the outer tag
Returns:
void

Definition at line 324 of file functions.php.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

floatcomp ( a,
comp,
b,
decimals = 2 
)

Comparation of floating numbers.

Parameters:
float$afirst number
string$compcomparation type
float$bsecond number
int$decimalsnumber of decimals
Returns:
comparation result

Definition at line 186 of file functions.php.

gOpt ( opts,
name,
dft = null 
)

Retrieve value from associative array by key.

It's also possible to set a default value if the requested key is not set

Parameters:
array$optsassociative array
string$namekey name
mixed$dftdefault value
Returns:
array value or default

Definition at line 171 of file functions.php.

+ Here is the caller graph for this function:

layerWindow ( title,
url,
text,
opts = null 
)

Layer window link.

Returns a link which opens a js layer window

Parameters:
string$titlewindow title
string$urlcontent's url
string$textlink's text
array$optsassociative array of options, see layerWindowCall
Returns:
the link element

Definition at line 87 of file functions.php.

layerWindowCall ( title,
url,
opts = null 
)

Javascript code to open a layer window.

Parameters:
string$titlewindow title
string$urlcontent's url
array$optsassociative array of options:
  • width: int default 800. The window width
  • height: int default null. The window height. If null the window height depends on its contents.
  • bodyId: string default 'bid'. Id attribute of the window body.
  • reloadZindex: bool default false. Whether to check the maximum z-index in the document or not. If not the maximum z-index is considered equal to 1.
Returns:
the javascript code

Definition at line 105 of file functions.php.

+ Here is the call graph for this function:

relativePath ( abspath)

Relative path from absolute path.

Parameters:
array$abspathabsolute path
Returns:
relative path

Definition at line 151 of file functions.php.

+ Here is the caller graph for this function:

share ( social,
url,
title = null,
description = null 
)

Social sharing.

Parameters:
mixed$social"all" or an array of social site names. Supported ones are:
  • facebook
  • twitter
  • linkedin
  • digg
  • googleplus
string$urlthe url to share
string$titletitle to share
string$descriptiondescription to share
Returns:
share links

Definition at line 277 of file functions.php.

+ Here is the call graph for this function:

tooltip ( label,
title,
text,
opts = null 
)

Span element with tooltip.

Parameters:
string$labelelement text
string$titletooltip title
string$texttooltip text
array$optsassociative array of options:
  • class: element css class
Returns:
the tooltip element

Definition at line 131 of file functions.php.

+ Here is the call graph for this function:

+ Here is the caller graph for this function: