CMS  Version 3.9
BlogArticlesView Class Reference
+ Inheritance diagram for BlogArticlesView:

Public Member Functions

 BlogArticlesView ($blog)
 
 buildTable ($articles)
 
 writeScript ()
 
 drawView ()
 
 showPublished ($article)
 
 formatTitle ($item)
 
 drawAddButton ()
 

Public Attributes

 $blog
 
 $table
 

Detailed Description

Definition at line 517 of file blog_view.inc.

Member Function Documentation

◆ BlogArticlesView()

BlogArticlesView::BlogArticlesView (   $blog)

Definition at line 522 of file blog_view.inc.

523  {
524  $this->blog = $blog;
525 
526  $articles = $blog->Articles();
527 
528  $this->table = $this->buildTable($articles);
529  }
buildTable($articles)
Definition: blog_view.inc:531
$articles
Definition: rss.inc:62

◆ buildTable()

BlogArticlesView::buildTable (   $articles)

Reimplemented in AdminBlogArticlesView.

Definition at line 531 of file blog_view.inc.

532  {
533  $table = new DataListView($articles, "articles");
534  $table->column("Title", array($this, formatTitle), true)
535  ->column("Author", "{getAuthorName()}", true)
536  ->column("Date Published", "{publish_date}", true)
537  ->column("Published", array($this, showPublished), false, "text-align: center");
538 
539  $table->sortable = true;
540  $table->filter = true;
541  $table->excelFile = "articles.xls";
542  $table->pageSize = 20;
543  $table->emptyMessage = "No articles have been created yet.";
544 
545  return $table;
546  }
showPublished($article)
Definition: blog_view.inc:558
formatTitle($item)
Definition: blog_view.inc:567

◆ drawAddButton()

BlogArticlesView::drawAddButton ( )

Reimplemented in AdminBlogArticlesView.

Definition at line 573 of file blog_view.inc.

574  {
575  echo "<br/>\n<a class='button' href=\"blog_article_form?blog_id={$this->blog->blog_id}\">Add an Article</a>\n<br/>\n";
576  }

◆ drawView()

BlogArticlesView::drawView ( )

Definition at line 553 of file blog_view.inc.

554  {
555  $this->table->drawView();
556  }

◆ formatTitle()

BlogArticlesView::formatTitle (   $item)

Reimplemented in AdminBlogArticlesView.

Definition at line 567 of file blog_view.inc.

568  {
569  global $blog;
570  return "<a title=\"{$item->title}\" href=\"blog_article_form?blog_id={$blog->blog_id}&article_id={$item->article_id}\">". ellipsis($item->title, 80) ."</a>";
571  }

◆ showPublished()

BlogArticlesView::showPublished (   $article)

Definition at line 558 of file blog_view.inc.

559  {
560  $img = $article->published ? "on.png" : "off.png";
561  $alt = $article->published ? "Published" : "Unpublished";
562 
563  return "<img src='/fakoli/images/$img' alt='$alt' onclick='toggleArticlePublished(this, {$article->article_id})' style='display: inline-block; vertical-align: middle; border: none; cursor: pointer'/>";
564  }
$article

◆ writeScript()

BlogArticlesView::writeScript ( )

Definition at line 548 of file blog_view.inc.

549  {
550  return $this->table->writeScript();
551  }

Member Data Documentation

◆ $blog

BlogArticlesView::$blog

Definition at line 519 of file blog_view.inc.

◆ $table

BlogArticlesView::$table

Definition at line 520 of file blog_view.inc.


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