CMS  Version 3.9
ImageGrid Class Reference

Inherits FacetFilterable.

Public Member Functions

 __construct ($id, $size=200, $puff=true, $useBackgroundImages=false)
 
 getID ()
 
 addItem ($image_id, $title, $text, $onclick="return false;")
 
 addFacetTaggingHandler ($handler)
 Adds a row tagging handler. More...
 
 writeScript ()
 
 drawView ()
 

Public Attributes

 $id
 
 $items
 
 $size
 
 $tagItemCallbacks = array()
 
 $puff
 
 $useBackgroundImages = false
 
 $retinaMode = false
 
 $cssClass = null
 
 $inlineSizing = true
 

Detailed Description

Definition at line 60 of file image_grid.inc.

Constructor & Destructor Documentation

◆ __construct()

ImageGrid::__construct (   $id,
  $size = 200,
  $puff = true,
  $useBackgroundImages = false 
)

Definition at line 72 of file image_grid.inc.

73  {
74  $this->id = $id;
75  $this->items = array();
76  $this->size = $size;
77  $this->puff = $puff;
78  $this->useBackgroundImages = $useBackgroundImages;
79  $this->retinaMode = Settings::getValue("image", "retina_mode");
80  }
$imageUpload size
Definition: image_form.inc:68
$useBackgroundImages
Definition: image_grid.inc:67
static getValue($component, $name)
Retrieve the value of the specified Setting.
Definition: settings.inc:104

Member Function Documentation

◆ addFacetTaggingHandler()

ImageGrid::addFacetTaggingHandler (   $handler)

Adds a row tagging handler.

This function will receive the data item for each row and can add custom attributes to the row tag.

Definition at line 98 of file image_grid.inc.

99  {
100  $this->tagItemCallbacks[] = $handler;
101  }
$handler
Definition: event_form.inc:62

◆ addItem()

ImageGrid::addItem (   $image_id,
  $title,
  $text,
  $onclick = "return false;" 
)

Definition at line 87 of file image_grid.inc.

88  {
89  $item = new ImageGridItem($this, $image_id, $title, $text, $onclick);
90  $this->items[] = $item;
91  return $item;
92  }
$image_id
Definition: image_form.inc:41

◆ drawView()

ImageGrid::drawView ( )

Definition at line 122 of file image_grid.inc.

123  {
124  $cssClass = $this->cssClass ? "image_grid {$this->cssClass}" : "image_grid";
125 ?>
126  <ul id="<?echo $this->id?>" class='<?echo $cssClass?>'>
127 <?
128  foreach($this->items as $item)
129  {
130  $attrs = array();
131 
132  foreach($this->tagItemCallbacks as $handler)
133  {
134  $attrs = call_user_func($handler, $item->item, $attrs);
135  }
136 
137  $item->draw($this->size, $attrs);
138  }
139 ?>
140  </ul>
141 <?
142  }
$table cssClass

◆ getID()

ImageGrid::getID ( )

Definition at line 82 of file image_grid.inc.

83  {
84  return $this->id;
85  }

◆ writeScript()

ImageGrid::writeScript ( )

Definition at line 104 of file image_grid.inc.

105  {
106  ob_start();
107 
108  $puff = $this->puff ? 'true' : 'false';
109 ?>
110 <script type="text/javascript">
111 window.addEvent('domready', function()
112 {
113  new ImageGrid('<?echo $this->id?>', <?echo $this->size?>, {puff: <?echo $puff?>});
114 });
115 </script>
116 <?
117  $script = ob_get_contents();
118  ob_end_clean();
119  return $script;
120  }

Member Data Documentation

◆ $cssClass

ImageGrid::$cssClass = null

Definition at line 69 of file image_grid.inc.

◆ $id

ImageGrid::$id

Definition at line 62 of file image_grid.inc.

◆ $inlineSizing

ImageGrid::$inlineSizing = true

Definition at line 70 of file image_grid.inc.

◆ $items

ImageGrid::$items

Definition at line 63 of file image_grid.inc.

◆ $puff

ImageGrid::$puff

Definition at line 66 of file image_grid.inc.

◆ $retinaMode

ImageGrid::$retinaMode = false

Definition at line 68 of file image_grid.inc.

◆ $size

ImageGrid::$size

Definition at line 64 of file image_grid.inc.

◆ $tagItemCallbacks

ImageGrid::$tagItemCallbacks = array()

Definition at line 65 of file image_grid.inc.

◆ $useBackgroundImages

ImageGrid::$useBackgroundImages = false

Definition at line 67 of file image_grid.inc.


The documentation for this class was generated from the following file: