CMS  Version 3.9
ImageListView Class Reference

Public Member Functions

 ImageListView ($images, $linkFormat, $id="images", $titleFormat="")
 
 writeScript ()
 
 drawGrid ()
 

Static Public Member Functions

static writeResizeScript ()
 

Public Attributes

 $id
 
 $images
 
 $linkFormat
 
 $spacing = 0
 
 $styles
 
 $titleFormat = "{title}"
 

Detailed Description

Definition at line 39 of file image_list_view.inc.

Member Function Documentation

◆ drawGrid()

ImageListView::drawGrid ( )

Definition at line 84 of file image_list_view.inc.

85  {
86  $imgMgr = new ImageManager();
87 
88  $this->writeScript();
89 ?>
90  <ul class="imageGrid" id="<?echo $this->id?>"<?if ($this->styles) echo " style='{$this->styles}'";?>>
91  <?
92 
93  foreach($this->images as $image)
94  {
95  $thumb = $imgMgr->thumbnailLink($image->get("image_id"), 125, true);
96  $link = $image->format($this->linkFormat);
97 
98  if (is_callable($this->titleFormat))
99  $caption = call_user_func($this->titleFormat, $image);
100  else
101  $caption = $image->format($this->titleFormat);
102 
103  ?>
104  <li><div class="imageLink"<?if ($this->spacing) echo " style='margin: {$this->spacing}'";?>><a href="<?echo $link?>">
105  <span class="wrapImage"><img src="<?echo $thumb ?> " alt="Small version of image"/></span>
106  <span class="caption"><?echo ellipsis($caption, 40, false) ?></span></a>
107  </div></li>
108  <?
109  }
110  ?>
111  </ul>
112  <?
113  }
$image
Definition: image_form.inc:46
The ImageManager class provides basic Image manipulation functions that are useful when working with ...
$view styles
$view spacing

◆ ImageListView()

ImageListView::ImageListView (   $images,
  $linkFormat,
  $id = "images",
  $titleFormat = "" 
)

Definition at line 48 of file image_list_view.inc.

49  {
50  $this->id = $id;
51  $this->images = $images;
52  $this->linkFormat = $linkFormat;
53  $this->titleFormat = ($titleFormat) ? $titleFormat : "{title}";
54  }

◆ writeResizeScript()

static ImageListView::writeResizeScript ( )
static

Definition at line 115 of file image_list_view.inc.

116  {
117 
118  $script .= <<<ENDSCRIPT
119 <script type="text/javascript">
120 window.addEvent('domready', function() { document.id('images_box').resizable(); });
121 </script>
122 ENDSCRIPT;
123 
124  return $script;
125  }

◆ writeScript()

ImageListView::writeScript ( )

Definition at line 56 of file image_list_view.inc.

57  {
58 // global $script;
59 // $script .= <<<ENDSCRIPT
60 // <script type="text/javascript">
61 // window.addEvent('domready', function()
62 // {
63 // $$(".imageGrid a").each(function(elt)
64 // {
65 // elt.addEvents(
66 // {
67 // 'mouseover': function()
68 // {
69 // this.morph({'background-color': '#A9CDED', 'border-color': '#666666'});
70 // }.bind(elt),
71 // 'mouseout': function()
72 // {
73 // this.morph({'background-color': '#eeeeff', 'border-color': '#cccccc'});
74 // }.bind(elt)
75 // });
76 // });
77 // });
78 // </script>
79 // ENDSCRIPT;
80 
81 // return $script;
82  }

Member Data Documentation

◆ $id

ImageListView::$id

Definition at line 41 of file image_list_view.inc.

◆ $images

ImageListView::$images

Definition at line 42 of file image_list_view.inc.

◆ $linkFormat

ImageListView::$linkFormat

Definition at line 43 of file image_list_view.inc.

◆ $spacing

ImageListView::$spacing = 0

Definition at line 44 of file image_list_view.inc.

◆ $styles

ImageListView::$styles

Definition at line 45 of file image_list_view.inc.

◆ $titleFormat

ImageListView::$titleFormat = "{title}"

Definition at line 46 of file image_list_view.inc.


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