CMS  Version 3.9
VideoBlogHandler Class Reference
+ Inheritance diagram for VideoBlogHandler:
+ Collaboration diagram for VideoBlogHandler:

Public Member Functions

 VideoBlogHandler ()
 
 drawArticleList ($blog)
 Draw the list of articles for the specified blog. More...
 
 formatArticle ($article)
 
 drawArticle ($blog, $article_id)
 Draw the specific article in the blog. More...
 

Static Public Member Functions

static register ($view)
 

Public Attributes

 $blog
 

Detailed Description

Definition at line 41 of file video_blog_handler.inc.

Member Function Documentation

◆ drawArticle()

VideoBlogHandler::drawArticle (   $blog,
  $article_id 
)

Draw the specific article in the blog.

Parameters
Blog$blogthe Blog object
integer$article_idthe ID of the Article

Implements IBlogViewHandler.

Definition at line 114 of file video_blog_handler.inc.

115  {
116  global $page;
118  $page->page_title = $article->title;
119 
120  echo $article->message;
121  }
$article
$article_id
$page
Definition: help.inc:39
Defines the Article class.
Definition: article.inc:45

◆ drawArticleList()

VideoBlogHandler::drawArticleList (   $blog)

Draw the list of articles for the specified blog.

Parameters
Blog$blogthe Blog object

Implements IBlogViewHandler.

Definition at line 55 of file video_blog_handler.inc.

56  {
57  global $page;
58  global $script;
59 
60  $script .= <<<ENDSCRIPT
61  <script type="text/javascript">
62  window.addEvent('domready', function()
63  {
64  $$("#article_list a").each(function(elt)
65  {
66  elt.addEvents(
67  {
68  'mouseover': function()
69  {
70  this.morph({'background-color': '#A9CDED', 'border-color': '#666666'});
71  }.bind(elt),
72  'mouseout': function()
73  {
74  this.morph({'background-color': '#DEFAFF', 'border-color': '#cccccc'});
75  }.bind(elt)
76  });
77  });
78  });
79  </script>
80 ENDSCRIPT;
81 
82  $this->blog = $blog;
83 
84  $page->page_title = $blog->title;
85 
86  $articles = $blog->Articles("WHERE published=1 ORDER BY created_date {$this->blog->default_article_order}");
87 
88  echo "<div id='blog_description' class='Video'>{$blog->description}</div>";
89 
90  $list = new PagedList($articles, "article_list", array($this, formatArticle));
91  $list->CSSclass = "Video";
92  $list->styles = "clear: both";
93  $list->pageSize = 5;
94 
95  $script .= $list->writeScript();
96  $list->drawList();
97  }
$list
Definition: list_images.inc:41
$articles
Definition: rss.inc:62

◆ formatArticle()

VideoBlogHandler::formatArticle (   $article)

Definition at line 99 of file video_blog_handler.inc.

100  {
101  $out = "<a href='/{$this->blog->identifier}?article_id={$article->article_id}' style='display: block'>";
102  if ($article->image_id)
103  {
104  $image = $article->Image();
105  $out .= "<img src='/action/image/thumbnail?image_id={$article->image_id}&size=120' alt='{$image->ALT_tag}' align='left'/>";
106  }
107 
108  $out .= "<div class='article_summary'><h4>{$article->title}</h4>";
109  if ($article->teaser) $out .= $article->teaser;
110  $out .= "</div><div style='clear: both'></div></a>";
111  return $out;
112  }
$out
Definition: page.inc:66
$image
Definition: image_form.inc:46

◆ register()

static VideoBlogHandler::register (   $view)
static

Definition at line 49 of file video_blog_handler.inc.

50  {
51  $view->registerHandler("Video", new VideoBlogHandler());
52  return $view;
53  }
$view
Definition: help.inc:42

◆ VideoBlogHandler()

VideoBlogHandler::VideoBlogHandler ( )

Definition at line 45 of file video_blog_handler.inc.

46  {
47  }

Member Data Documentation

◆ $blog

VideoBlogHandler::$blog

Definition at line 43 of file video_blog_handler.inc.


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