CMS  Version 3.9
VideoListView Class Reference

Public Member Functions

 VideoListView ($videos, $linkFormat, $id="videos", $titleFormat="", $onClick="")
 
 writeScript ()
 
 drawGrid ()
 

Static Public Member Functions

static writeResizeScript ()
 

Public Attributes

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

Detailed Description

Definition at line 39 of file video_list_view.inc.

Member Function Documentation

◆ drawGrid()

VideoListView::drawGrid ( )

Definition at line 86 of file video_list_view.inc.

87  {
88  $imgMgr = new VideoManager();
89 
90  $this->writeScript();
91 ?>
92  <ul class="videoGrid" id="<?echo $this->id?>"<?if ($this->styles) echo " style='{$this->styles}'";?>>
93  <?
94 
95  foreach($this->videos as $video)
96  {
97  $thumb = $imgMgr->thumbnailLink($video->get("video_id"), 125);
98  $link = $video->format($this->linkFormat);
99  $onClick = $video->format($this->onClick);
100 
101  if (is_callable($this->titleFormat))
102  $caption = call_user_func($this->titleFormat, $video);
103  else
104  $caption = $video->format($this->titleFormat);
105 
106  ?>
107  <li><div class="videoLink"<?if ($this->spacing) echo " style='margin: {$this->spacing}'";?>><a href="<?echo $link?>"<? if ($onClick) echo " onClick=\"$onClick\""; ?>>
108  <span class="wrapVideo"><img src="<?echo $thumb ?> " alt="Small version of video"/></span>
109  <span class="caption"><?echo $caption ?></span></a>
110  </div></li>
111  <?
112  }
113  ?>
114  </ul>
115  <?
116  }
$view styles
$view spacing
$video
Definition: video_form.inc:42

◆ VideoListView()

VideoListView::VideoListView (   $videos,
  $linkFormat,
  $id = "videos",
  $titleFormat = "",
  $onClick = "" 
)

Definition at line 49 of file video_list_view.inc.

50  {
51  $this->id = $id;
52  $this->videos = $videos;
53  $this->linkFormat = $linkFormat;
54  $this->titleFormat = ($titleFormat) ? $titleFormat : "{title}";
55  $this->onClick = $onClick;
56  }

◆ writeResizeScript()

static VideoListView::writeResizeScript ( )
static

Definition at line 118 of file video_list_view.inc.

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

◆ writeScript()

VideoListView::writeScript ( )

Definition at line 58 of file video_list_view.inc.

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

Member Data Documentation

◆ $id

VideoListView::$id

Definition at line 41 of file video_list_view.inc.

◆ $linkFormat

VideoListView::$linkFormat

Definition at line 43 of file video_list_view.inc.

◆ $onClick

VideoListView::$onClick

Definition at line 47 of file video_list_view.inc.

◆ $spacing

VideoListView::$spacing = 0

Definition at line 44 of file video_list_view.inc.

◆ $styles

VideoListView::$styles

Definition at line 45 of file video_list_view.inc.

◆ $titleFormat

VideoListView::$titleFormat = "{title}"

Definition at line 46 of file video_list_view.inc.

◆ $videos

VideoListView::$videos

Definition at line 42 of file video_list_view.inc.


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