CMS  Version 3.9
BlogView Class Reference

Public Member Functions

 BlogView ($blog)
 
 registerHandler ($type, $handler)
 
 drawSubscribeButton ()
 
 drawArticleList ($year=false, $month=false, $term_id=null)
 
 drawArticle ($article_id)
 

Static Public Member Functions

static registerStandardHandlers ($view)
 

Public Attributes

 $blog
 
 $handlers
 

Detailed Description

Definition at line 370 of file blog_view.inc.

Member Function Documentation

◆ BlogView()

BlogView::BlogView (   $blog)

Definition at line 375 of file blog_view.inc.

376  {
377  $this->blog = $blog;
378  ComponentManager::fireEvent("RegisterBlogViewHandlers", $this);
379  }
static fireEvent($event, $parameter=null, $mustBeConsumed=false)
Fire an event to all subscribers as detailed in their manifests.

◆ drawArticle()

BlogView::drawArticle (   $article_id)

Definition at line 410 of file blog_view.inc.

411  {
412  global $script;
413  global $method;
414  global $user;
415 
416  $type = $this->blog->blog_type;
417  if (!array_key_exists($type, $this->handlers)) $type = "Standard";
418 
419  trace("** Rendering article for blog '{$this->blog->identifier}' with blog view handler '{$type}'", 3);
420 
421  $this->handlers[$type]->drawArticle($this->blog, $article_id);
422 
423  if (Settings::getValue("settings", "enable_inline_editing") && Settings::checkPermission("settings", "editor_roles"))
424  {
426 
428 
429  $versioningControls = ComponentManager::fireEvent("RenderVersioningControls", $article);
430  echo "<p id='inline_editing' class='inline_editor_toolbar'><a href='#' class='edit' onclick='new ArticleManager().editArticle({$article_id}, {$this->blog->blog_id}); return false;'>Edit</a>$versioningControls</p>";
431  }
432 
433  $this->drawSubscribeButton();
434 
435  if ($this->blog->allow_comments && $article_id)
436  {
438  }
439  }
$article
$article_id
Defines the Article class.
Definition: article.inc:45
drawSubscribeButton()
Definition: blog_view.inc:386
static addCommentPanel($qs=null)
static getValue($component, $name)
Retrieve the value of the specified Setting.
Definition: settings.inc:104
static checkPermission($component, $name, $account=null)
Check whether a user has a specific permission.
Definition: settings.inc:241
static selectDisplayVersion($target, $param="version")
global $user
$method
Pull out a simple reference to the request method.
Definition: core.inc:1573

◆ drawArticleList()

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

Definition at line 398 of file blog_view.inc.

399  {
400  $type = $this->blog->blog_type;
401  if (!array_key_exists($type, $this->handlers)) $type = "Standard";
402 
403  trace ("Month is " . $month, 3);
404 
405  $this->drawSubscribeButton();
406 
407  $this->handlers[$type]->drawArticleList($this->blog, $year, $month, $term_id);
408  }
$term_id
Definition: blog.inc:40
$month
Definition: blog.inc:39
$year
Definition: blog.inc:38

◆ drawSubscribeButton()

BlogView::drawSubscribeButton ( )

Definition at line 386 of file blog_view.inc.

387  {
388  if (!Settings::getValue("blog", "allow_subscription_options")) return;
389 
390  if ($this->blog->allow_subscriptions)
391  {
392  $buttonFormat = Settings::getValue("blog", "subscribe_button_format");
393 
394  echo $this->blog->format("<a id='blog_subscription_button' class='button' href='#' onclick='new BlogManager().showSubscriptionDialog({blog_id},\"{title:jsSafe}\"); return false;'>$buttonFormat</a>");
395  }
396  }

◆ registerHandler()

BlogView::registerHandler (   $type,
  $handler 
)

Definition at line 381 of file blog_view.inc.

382  {
383  $this->handlers[$type] = $handler;
384  }
$handler
Definition: event_form.inc:62

◆ registerStandardHandlers()

static BlogView::registerStandardHandlers (   $view)
static

Definition at line 441 of file blog_view.inc.

442  {
443  $view->registerHandler("Standard", new DefaultBlogViewHandler());
444  $view->registerHandler("News", new NewsBlogViewHandler());
445  $view->registerHandler("Book", new BookBlogViewHandler());
446 
447  return $view;
448  }
$view
Definition: help.inc:42
DefaultBlogViewHandler provides a standard, no-frills display for blog entries.
Definition: blog_view.inc:71
NewsBlogViewHandler provides a simple blog view tailored displaying news articles.
Definition: blog_view.inc:177

Member Data Documentation

◆ $blog

BlogView::$blog

Definition at line 372 of file blog_view.inc.

◆ $handlers

BlogView::$handlers

Definition at line 373 of file blog_view.inc.


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