Class: GalleryTemplateAdapter
Source Location: /modules/core/classes/GalleryTemplateAdapter.class
Class GalleryTemplateAdapter
Property Summary
array |
$_callCount |
The number of times our block callbacks have been executed |
string |
$_trailer |
Aggregation of text that we want to output at the bottom of the page, useful for when we need to put javascript at the bottom. |
Method Summary
void |
block() |
Include a module's block into the current smarty page. The only required param is 'type' which should be of the form <module>.<blockname> eg: "core.LoginBlock". Any other parameters get passed on to the block itself. |
void |
callback() |
Call back to a module to get it to preload some data for the template. The only required param is 'type' which should be of the form <module>.<blockname> eg: "core.LoginBlock". |
HTML |
changeInDescendents() |
Return a checkbox asking whether to chenge the value in descendents. |
void |
container() |
Include a module's container into the current smarty page. The only required param is 'type' which should be of the form <module>.<blockname> eg: "core.LoginBlock". Any other parameters get passed on to the block itself. |
string |
date() |
Return a valid Gallery date. |
void |
debug() |
Show debug output. |
void |
defaultButton() |
Add hidden form elements to select a default submit button that is used if enter is pressed in a text input. |
void |
dimensions() |
Include form inputs for dimensions. |
HTML |
formVar() |
Return a transformed element name. |
string |
head() |
Render head content |
a |
hiddenFormVars() |
Return any hidden form variables that we want to embed in this form based on the current session and request context. We use this to pass the special "return" variable forward, for example. |
string |
image() |
Delegate to the appropriate item class to render an image. |
string |
itemLink() |
Render a single item link as an <option> or <a>. |
void |
language() |
Return active language code in format used with HTML lang attribute. |
string |
linkId() |
This takes an array and looks for view, subview, and controller to make a linkid (being used as a css classname) |
void |
shrinkDimensions() |
Use GalleryUtilities::shrinkDimensionsToFit to scale template vars to new target size. |
void |
theme() |
Perform a theme related function. Possible parameters are include => file to include inside the theme's templates/ dir url => url to a file inside the themes dir |
void |
trailer() |
Render trailer output |
string |
url() |
Return a valid Gallery URL, standalone or embedded. |
void |
_combineJavascriptFiles() |
Combine as many static Javascript files as possible into a single request to core.CombinedJavascript to minimize the number of connections required by the browser to retrieve them, which improves performance on slower connections. |
void |
_image() |
Implementation of image() that can return an error. |
string |
_safeCssName() |
This removes unsafe characters from a string so they can be used as a class name or id in html and be addressed via css |
Properties
The number of times our block callbacks have been executed
API Tags:
Current state of the progress bar.
API Tags:
The active theme
API Tags:
Aggregation of text that we want to output at the bottom of the page, useful for when we need to put javascript at the bottom.
API Tags:
Registered callbacks that will get executed during the trailer.
API Tags:
Methods
GalleryTemplateAdapter GalleryTemplateAdapter(
)
|
|
void addToTrailer(
array
$params, string
$content,
&$smarty, Smarty
$smarty
)
|
|
Add the content to our trailer block
Parameters:
array |
$params: |
|
string |
$content: |
|
Smarty |
$smarty: |
the smarty instance |
|
&$smarty: |
|
void autoComplete(
array
$params, string
$content,
&$smarty, Smarty
$smarty
)
|
|
Include our AutoCompletion template.
Parameters:
array |
$params: |
params |
string |
$content: |
content |
Smarty |
$smarty: |
the smarty instance |
|
&$smarty: |
|
void block(
array
$params,
&$smarty, Smarty
$smarty
)
|
|
Include a module's block into the current smarty page. The only required param is 'type' which should be of the form <module>.<blockname> eg: "core.LoginBlock". Any other parameters get passed on to the block itself.
Parameters:
array |
$params: |
('type' => <block descriptor>, ...) |
Smarty |
$smarty: |
the smarty instance |
|
&$smarty: |
|
void callback(
array
$params,
&$smarty, Smarty
$smarty
)
|
|
Call back to a module to get it to preload some data for the template. The only required param is 'type' which should be of the form <module>.<blockname> eg: "core.LoginBlock".
Any other parameters get passed on to the block itself.
Parameters:
array |
$params: |
('type' => <block descriptor>, ...) |
Smarty |
$smarty: |
the smarty instance |
|
&$smarty: |
|
HTML changeInDescendents(
array
$params,
&$smarty, Smarty
$smarty
)
|
|
Return a checkbox asking whether to chenge the value in descendents.
Useful when we are trying to change a value recursively.
Parameters:
array |
$params: |
key => value attributes |
Smarty |
$smarty: |
the smarty instance |
|
&$smarty: |
|
API Tags:
void completeProgressBar(
string
$continueUrl, [bool
$doRedirect = false]
)
|
|
Complete progress bar.
Parameters:
string |
$continueUrl: |
URL shown to continue the process |
bool |
$doRedirect: |
Whether to redirect automatically. Defaults to false, requiring user-interaction to follow the continue link. |
void container(
array
$params, string
$content,
&$smarty, Smarty
$smarty
)
|
|
Include a module's container into the current smarty page. The only required param is 'type' which should be of the form <module>.<blockname> eg: "core.LoginBlock". Any other parameters get passed on to the block itself.
This is like block() except it wraps actual content.
Parameters:
array |
$params: |
('type' => <block descriptor>, ...) |
string |
$content: |
|
Smarty |
$smarty: |
the smarty instance |
|
&$smarty: |
|
string date(
array
$params,
&$smarty, Smarty
$smarty
)
|
|
Return a valid Gallery date.
Parameters:
array |
$params: |
data in key/value pairs |
Smarty |
$smarty: |
the smarty instance |
|
&$smarty: |
|
API Tags:
Information Tags:
Todo: | This needs to be refactored. |
void debug(
$params,
&$smarty
)
|
|
Show debug output.
Parameters:
void defaultButton(
array
$params,
&$smarty, Smarty
$smarty
)
|
|
Add hidden form elements to select a default submit button that is used if enter is pressed in a text input.
Include this before any submit buttons are added to the form.
Parameters:
array |
$params: |
params |
Smarty |
$smarty: |
the smarty instance |
|
&$smarty: |
|
void dimensions(
array
$params,
&$smarty, Smarty
$smarty
)
|
|
Include form inputs for dimensions.
Parameters:
array |
$params: |
params |
Smarty |
$smarty: |
the smarty instance |
|
&$smarty: |
|
Display error progress bar.
Parameters:
HTML formVar(
array
$params
)
|
|
Return a transformed element name.
Parameters:
array |
$params: |
key => value attributes |
API Tags:
string head(
array
$params,
&$smarty, Smarty
$smarty
)
|
|
Render head content
Parameters:
array |
$params: |
|
Smarty |
$smarty: |
the smarty instance |
|
&$smarty: |
|
API Tags:
a hiddenFormVars(
array
$params,
&$smarty, Smarty
$smarty
)
|
|
Return any hidden form variables that we want to embed in this form based on the current session and request context. We use this to pass the special "return" variable forward, for example.
Parameters:
array |
$params: |
data in key/value pairs |
Smarty |
$smarty: |
the smarty instance |
|
&$smarty: |
|
API Tags:
Return: | series of XHTML 1.0 compliant <input> elements |
string image(
array
$params,
&$smarty, Smarty
$smarty
)
|
|
Delegate to the appropriate item class to render an image.
Parameters:
array |
$params: |
containing item, image, maxSize, fallback, and any img attributes |
Smarty |
$smarty: |
the smarty instance |
|
&$smarty: |
|
API Tags:
Information Tags:
Todo: | Figure out a more graceful way to deal with errors here. |
string itemLink(
array
$params
)
|
|
Render a single item link as an <option> or <a>.
Parameters:
array |
$params: |
'link' => getItemLinks data for one link 'type' => (optional) 'link' or 'option' (default=link) 'lowercase' => (optional) true to convert link text to lowercase Other keys are used as attributes. |
void language(
$params,
&$smarty
)
|
|
Return active language code in format used with HTML lang attribute.
Parameters:
string linkId(
array
$params
)
|
|
This takes an array and looks for view, subview, and controller to make a linkid (being used as a css classname)
Parameters:
array |
$params: |
the items to make a css class out of |
API Tags:
Return: | the id of the css class |
HTML logoButton(
array
$params,
&$smarty, Smarty
$smarty
)
|
|
Render logo button image.
Parameters:
array |
$params: |
('type' => logo type) |
Smarty |
$smarty: |
the smarty instance |
|
&$smarty: |
|
API Tags:
void mainDivAttributes(
$params,
&$smarty
)
|
|
Return attributes for container of all Gallery content.
Parameters:
void registerTrailerCallback(
callback
$callback, array
$args
)
|
|
Register a callback function to be executed when we run the trailer.
Parameters:
callback |
$callback: |
suitable to be used as an input for call_user_func() |
array |
$args: |
for callback |
void resetProgressBarStats(
)
|
|
Reset progress bar timing stats.
Set the theme
Parameters:
void shrinkDimensions(
array
$params,
&$smarty, Smarty
$smarty
)
|
|
Use GalleryUtilities::shrinkDimensionsToFit to scale template vars to new target size.
Parameters:
array |
$params: |
args; should contain widthVar, heightVar, maxSize keys |
Smarty |
$smarty: |
the smarty instance |
|
&$smarty: |
|
void text(
$params,
&$smarty
)
|
|
Parameters:
API Tags:
See: | GalleryTranslator::translateDomain |
void theme(
array
$params,
&$smarty, Smarty
$smarty
)
|
|
Perform a theme related function. Possible parameters are include => file to include inside the theme's templates/ dir url => url to a file inside the themes dir
Parameters:
array |
$params: |
('include' => ..., 'url' => ...) |
Smarty |
$smarty: |
the smarty instance |
|
&$smarty: |
|
void trailer(
$params,
&$smarty
)
|
|
Render trailer output
Parameters:
void updateProgressBar(
string
$title, string
$description, float
$percentComplete
)
|
|
Update progress bar
Parameters:
string |
$title: |
top heading |
string |
$description: |
subheading |
float |
$percentComplete: |
from 0 to 1 |
string url(
array
$params,
&$smarty, Smarty
$smarty
)
|
|
Return a valid Gallery URL, standalone or embedded.
Parameters:
array |
$params: |
data in key/value pairs |
Smarty |
$smarty: |
the smarty instance |
|
&$smarty: |
|
API Tags:
Return: | a URL |
See: | GalleryUrlGenerator::generateUrl |
string _buildCombinedJavascriptFileAndGenerateUrl(
mixed
$filteredFiles, mixed
$key
)
|
|
Combine the specified files into a single file and store it in the disk cache with the key.
API Tags:
Return: | a url to retrieve the combined script file or null |
void _combineJavascriptFiles(
array
$files,
&$output, array
$output
)
|
|
Combine as many static Javascript files as possible into a single request to core.CombinedJavascript to minimize the number of connections required by the browser to retrieve them, which improves performance on slower connections.
Parameters:
array |
$files: |
relative paths to javascript files |
array |
$output: |
output buffer to add lines. |
|
&$output: |
|
void _image(
$params,
&$smarty
)
|
|
Implementation of image() that can return an error.
Parameters:
API Tags:
Access: | private |
See: | GalleryTemplateAdapter::image |
string _safeCssName(
string
$string
)
|
|
This removes unsafe characters from a string so they can be used as a class name or id in html and be addressed via css
Purpose: Removes characters from a string so that it can be used for an html class name or id and be addressed via css
Parameters:
string |
$string: |
the input string |
API Tags:
|
|