phpDocumentor GalleryCore
Classes
[ class tree: GalleryCore ] [ index: GalleryCore ] [ all elements ]

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
array   $_progressBarStats   Current state of the progress bar.
GalleryTheme   $_theme   The active theme
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.
array   $_trailerCallbacks   Registered callbacks that will get executed during the trailer.

[ Top ]
Method Summary
GalleryTemplateAdapter   GalleryTemplateAdapter()  
void   addToTrailer()   Add the content to our trailer block
void   autoComplete()   Include our AutoCompletion template.
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   completeProgressBar()   Complete progress bar.
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.
void   errorProgressBar()   Display error progress bar.
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)
HTML   logoButton()   Render logo button image.
void   mainDivAttributes()   Return attributes for container of all Gallery content.
void   registerTrailerCallback()   Register a callback function to be executed when we run the trailer.
void   resetProgressBarStats()   Reset progress bar timing stats.
void   setTheme()   Set the theme
void   shrinkDimensions()   Use GalleryUtilities::shrinkDimensionsToFit to scale template vars to new target size.
void   text()  
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
void   updateProgressBar()   Update progress bar
string   url()   Return a valid Gallery URL, standalone or embedded.
string   _buildCombinedJavascriptFileAndGenerateUrl()   Combine the specified files into a single file and store it in the disk cache with the key.
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

[ Top ]
Properties
array   $_callCount [line 44]

The number of times our block callbacks have been executed

API Tags:
Access:  private


[ Top ]
array   $_progressBarStats [line 73]

Current state of the progress bar.

API Tags:
Access:  private


[ Top ]
GalleryTheme   $_theme [line 51]

The active theme

API Tags:
Access:  private


[ Top ]
string   $_trailer [line 59]

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:
Access:  private


[ Top ]
array   $_trailerCallbacks = array() [line 66]

Registered callbacks that will get executed during the trailer.

API Tags:
Access:  private


[ Top ]
Methods
Constructor GalleryTemplateAdapter  [line 76]

  GalleryTemplateAdapter GalleryTemplateAdapter( )



[ Top ]
addToTrailer  [line 1072]

  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: 


[ Top ]
autoComplete  [line 547]

  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: 


[ Top ]
block  [line 947]

  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: 


[ Top ]
callback  [line 1036]

  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: 


[ Top ]
changeInDescendents  [line 260]

  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:
Return:  content


[ Top ]
completeProgressBar  [line 1259]

  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.


[ Top ]
container  [line 1002]

  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: 


[ Top ]
date  [line 185]

  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:
Return:  date

Information Tags:
Todo:  This needs to be refactored.

[ Top ]
debug  [line 867]

  void debug( $params, &$smarty  )

Show debug output.

Parameters:
   $params: 
   &$smarty: 


[ Top ]
defaultButton  [line 610]

  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: 


[ Top ]
dimensions  [line 584]

  void dimensions( array $params, &$smarty, Smarty $smarty  )

Include form inputs for dimensions.

Parameters:
array   $params:  params
Smarty   $smarty:  the smarty instance
   &$smarty: 


[ Top ]
errorProgressBar  [line 1225]

  void errorProgressBar( GalleryStatus $status  )

Display error progress bar.

Parameters:
GalleryStatus   $status: 


[ Top ]
formVar  [line 286]

  HTML formVar( array $params  )

Return a transformed element name.

Parameters:
array   $params:  key => value attributes

API Tags:
Return:  content


[ Top ]
head  [line 383]

  string head( array $params, &$smarty, Smarty $smarty  )

Render head content

Parameters:
array   $params: 
Smarty   $smarty:  the smarty instance
   &$smarty: 

API Tags:
Return:  HTML content


[ Top ]
hiddenFormVars  [line 142]

  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


[ Top ]
image  [line 298]

  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:
Return:  HTML content

Information Tags:
Todo:  Figure out a more graceful way to deal with errors here.

[ Top ]
itemLink  [line 669]

  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.


[ Top ]
language  [line 755]

  void language( $params, &$smarty  )

Return active language code in format used with HTML lang attribute.

Parameters:
   $params: 
   &$smarty: 


[ Top ]
linkId  [line 632]

  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


[ Top ]
logoButton  [line 770]

  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:
Return:  content


[ Top ]
mainDivAttributes  [line 727]

  void mainDivAttributes( $params, &$smarty  )

Return attributes for container of all Gallery content.

Parameters:
   $params: 
   &$smarty: 


[ Top ]
registerTrailerCallback  [line 1085]

  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


[ Top ]
resetProgressBarStats  [line 1217]

  void resetProgressBarStats( )

Reset progress bar timing stats.



[ Top ]
setTheme  [line 87]

  void setTheme( GalleryTheme $theme  )

Set the theme

Parameters:
GalleryTheme   $theme: 


[ Top ]
shrinkDimensions  [line 1122]

  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: 


[ Top ]
text  [line 213]

  void text( $params, &$smarty  )

Parameters:
   $params: 
   &$smarty: 

API Tags:
See:  GalleryTranslator::translateDomain


[ Top ]
theme  [line 904]

  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: 


[ Top ]
trailer  [line 1092]

  void trailer( $params, &$smarty  )

Render trailer output

Parameters:
   $params: 
   &$smarty: 


[ Top ]
updateProgressBar  [line 1143]

  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


[ Top ]
url  [line 103]

  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


[ Top ]
_buildCombinedJavascriptFileAndGenerateUrl  [line 504]

  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


[ Top ]
_combineJavascriptFiles  [line 443]

  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: 


[ Top ]
_image  [line 312]

  void _image( $params, &$smarty  )

Implementation of image() that can return an error.

Parameters:
   $params: 
   &$smarty: 

API Tags:
Access:  private
See:  GalleryTemplateAdapter::image


[ Top ]
_safeCssName  [line 718]

  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:
Access:  private


[ Top ]

Documentation generated on Fri, 08 Oct 2010 05:05:18 -0700 by phpDocumentor 1.3.0RC6