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

Public Member Functions

 DefaultBlogViewHandler ()
 
 drawArticleList ($blog, $year=false, $month=false, $term_id=null)
 
 formatArticle ($article)
 
 drawArticle ($blog, $article_id)
 Draw the specific article in the blog. More...
 
- Public Member Functions inherited from IBlogViewHandler
 drawArticleList ($blog)
 Draw the list of articles for the specified blog. More...
 

Static Public Member Functions

static register ($view)
 

Detailed Description

Definition at line 260 of file blog_view.inc.

Member Function Documentation

◆ DefaultBlogViewHandler()

BookBlogViewHandler::DefaultBlogViewHandler ( )

Definition at line 262 of file blog_view.inc.

263  {
264  }

◆ drawArticle()

BookBlogViewHandler::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 330 of file blog_view.inc.

331  {
332  global $page;
334  $page->page_title = $article->title;
335 
336  echo "<div class='chapter'>\n";
337 
338  echo $article->message;
339 
340  $articles = $blog->Articles("WHERE published=1");
341 
342  $idx = findItemIndex($articles, "article_id", $article->article_id);
343 
344  echo "<br/>";
345 
346  if ($idx < count($articles) - 1)
347  {
348 ?>
349 <a href="<?echo $blog->identifier?>?article_id=<?echo $articles[$idx+1]->article_id?>" class="button" style="float: right"><?echo ellipsis($articles[$idx+1]->title, 60, true)?> &raquo;</a>
350 <?
351  }
352 
353  if ($idx > 0)
354  {
355 ?>
356 <a href="<?echo $blog->identifier?>?article_id=<?echo $articles[$idx-1]->article_id?>" class="button" style="float: left">&laquo; <?echo ellipsis($articles[$idx-1]->title, 60, true)?></a>
357 <?
358  }
359  else
360  {
361 ?>
362 <a href="<?echo $blog->identifier?>" class="button" style="float: left">&laquo; Back to Contents Page</a>
363 <?
364  }
365 
366  echo "<div style='clear:both'>&nbsp;</div></div>";
367  }
$article
$article_id
$blog
$page
Definition: help.inc:39
$helpTree style
Definition: tree.inc:46
$bookmark title
Defines the Article class.
Definition: article.inc:45
Definition: page.inc:43
$forumRequest to
$articles
Definition: rss.inc:62

◆ drawArticleList()

BookBlogViewHandler::drawArticleList (   $blog,
  $year = false,
  $month = false,
  $term_id = null 
)

Definition at line 272 of file blog_view.inc.

273  {
274  global $page;
275  global $script;
276 
277  $this->blog = $blog;
278 
279  $page->page_title = $blog->title;
280 
281  if ($year)
282  {
283  $constraint = " AND YEAR(publish_date) = $year";
284 
285  if ($month)
286  {
287  $constraint .= " AND MONTH(publish_date) = $month";
288  }
289  }
290 
291  if ($term_id)
292  {
293  $constraint .= " AND article_id IN (SELECT id FROM taxonomy_term_association where class='Article' AND term_id=$term_id)";
294  }
295 
296 
297  $articles = $blog->Articles("WHERE published=1 AND publish_date <= curdate()" . $constraint);
298 
299  echo "<div id='blog_description' class='Book'>{$blog->description}</div>";
300 
302 
303  $list = new PagedList($articles, "article_list", array($this, formatArticle));
304  $list->CSSclass = "Standard";
305  $list->styles = "clear: both; width: 100%";
306  $list->pageSize = $blog->articles_per_page;
307 
308  $script .= $list->writeScript();
309  $list->drawList();
310  }
$constraint
static inlineEditingControls($blog)
formatArticle($article)
Definition: blog_view.inc:312
$list
Definition: list_images.inc:41
$term_id
Definition: blog.inc:40
$month
Definition: blog.inc:39
$year
Definition: blog.inc:38

◆ formatArticle()

BookBlogViewHandler::formatArticle (   $article)

Definition at line 312 of file blog_view.inc.

313  {
314  $out = "<div class='article_summary'>";
315 
316  if ($article->image_id)
317  {
318  $image = $article->Image();
319  $out .= "<img src='/action/image/iconize?image_id={$article->image_id}&size=120' alt='{$image->ALT_tag}' align='left'/>";
320  }
321 
322  $out .= "<h4><a href='{$this->blog->identifier}?article_id={$article->article_id}'>";
323  $out .= "{$article->title}</a></h4>";
324 
325  if ($article->teaser) $out .= $article->teaser;
326  $out .= "</div>";
327  return $out;
328  }
$out
Definition: page.inc:66
$image
Definition: image_form.inc:46

◆ register()

static BookBlogViewHandler::register (   $view)
static

Definition at line 266 of file blog_view.inc.

267  {
268  $view->registerHandler("Book", new BookBlogViewHandler());
269  return $view;
270  }
$view
Definition: help.inc:42

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