Class SnapshotViewerInline

Description

this class implements methods to display snapshots

Located in /program/modules/snapshots/snapshots_view.php (line 693)

SnapshotViewer
   |
   --SnapshotViewerInline
Variable Summary
Method Summary
 SnapshotViewerInline SnapshotViewerInline (object &$theme, int $area_id, int $node_id, array $module, int $width, int $height, int $visible)
 void javascript_add_inline_show (array $imgs, [string $m = ''])
 void noscript_add_inline_show (array $imgs, [string $m = ''])
 bool run ()
Variables
int $inline_show_height = 120 (line 699)
  • var: $inline_show_height is the available height in the inline slideshow
int $inline_show_visible_images = 1 (line 702)
  • var: $inline_show_visible_images is the number of images to show simultaneously
int $inline_show_width = 120 (line 696)
  • var: $inline_show_width is the available width in the inline slideshow

Inherited Variables

Inherited from SnapshotViewer

SnapshotViewer::$area_id
SnapshotViewer::$default_showtime
SnapshotViewer::$dimension
SnapshotViewer::$domain
SnapshotViewer::$header
SnapshotViewer::$introduction
SnapshotViewer::$module_record
SnapshotViewer::$node_id
SnapshotViewer::$snapshots
SnapshotViewer::$snapshots_path
SnapshotViewer::$theme
SnapshotViewer::$variant
Methods
Constructor SnapshotViewerInline (line 715)

the constructor only stores relevant data for future use

SnapshotViewerInline SnapshotViewerInline (object &$theme, int $area_id, int $node_id, array $module, int $width, int $height, int $visible)
  • object &$theme: collects the (html) output
  • int $area_id: identifies the area where $node_id lives (currently unused)
  • int $node_id: the node to which this module is connected
  • array $module: the module record straight from the database
  • int $width: the available width for the inline slideshow
  • int $height: the available height for the inline slideshow
  • int $visible: the # of visible images in the inline slideshow
javascript_add_inline_show (line 773)

construct the necessary Javascript-code to do the inline slideshow configuration

this steps through the snapshots list and prepares the necessary javascript function calls to create and populate the inline slideshow. The following slideshow parameters are conveyed:

  • the available width
  • the available height
  • the number of visible images
The following image parameters are conveyed:
  • width of the image (in pixels)
  • height of the image (in pixels)
  • the url of the image file (src-attribute of the img tag)
  • the number of seconds to display this image
  • title to add to the display (document title)

void javascript_add_inline_show (array $imgs, [string $m = ''])
  • array $imgs: contains array with values to convey to javascript code
  • string $m: code readability
noscript_add_inline_show (line 822)

construct the necessary code to show N static images in case JavaScript is OFF

this steps through the first N images of the snapshots list and prepares the necessary code to create and populate N static non-rotating img-tags, sandwiched in a noscript tag (graceful degradation...)

The following slideshow parameters are used:

  • the available width
  • the available height
  • the number N of visible images
The following parameters of the first N images are used:
  • width of the image (in pixels)
  • height of the image (in pixels)
  • the url of the image file (src-attribute of the img tag)
  • title to add to the display (document title)
Notably absent:
  • the number of seconds to display this image ;-)

void noscript_add_inline_show (array $imgs, [string $m = ''])
  • array $imgs: contains array with values for static images
  • string $m: code readability
run (line 730)

read configuration paramerters and actually generate the inline slide show

this routine decides what to do and calls the appropriate workhorse routine(s)

  • return: TRUE on success, FALSE otherwise
  • todo: check permissions (ACL) to prevent leaking a private area path to anonymous visitors?
bool run ()

Redefinition of:
SnapshotViewer::run()
task dispatcher

Inherited Methods

Inherited From SnapshotViewer

 SnapshotViewer::SnapshotViewer()
 SnapshotViewer::add_snapshot_navbar()
 SnapshotViewer::get_snapshots()
 SnapshotViewer::get_snapshots_configuration()
 SnapshotViewer::images_array()
 SnapshotViewer::javascript_add_configuration()
 SnapshotViewer::javascript_include_once()
 SnapshotViewer::run()
 SnapshotViewer::view_raw()
 SnapshotViewer::view_slideshow()
 SnapshotViewer::view_snapshot()
 SnapshotViewer::view_thumbnails()

Documentation generated on Tue, 28 Jun 2016 19:12:02 +0200 by phpDocumentor 1.4.0