39 Fakoli::using(
"user",
"blog",
"article",
"comment",
"component");
104 $constraint .=
" AND article_id IN (SELECT id FROM taxonomy_term_association where class='Article' AND term_id=$term_id)";
109 echo
"<div id='blog_description' class='Standard'>{$blog->description}</div>";
114 $list->CSSclass =
"Standard";
115 $list->styles =
"clear: both";
117 if (
$blog->articles_per_page)
132 $out =
"<div class='article_summary'>";
137 $out .=
"<img src='/action/image/iconize?image_id={$article->image_id}&size=120' alt='{$image->ALT_tag}' align='left'/>";
140 $out .=
"<h4><a href='{$this->blog->identifier}?article_id={$article->article_id}'>";
141 $out .=
"{$article->title}</a></h4>";
144 $out .=
"<div class='blog_timestamp'>";
158 echo
"<div class='blog_timestamp'>";
159 echo
"By " .
$article->author .
", posted on " .$article->formatPostDate();
163 echo
"<div class='blog_tags'>" .
$article->tags .
"</div>";
203 $constraint .=
" AND MONTH(publish_date) = $month";
210 $constraint .=
" AND article_id IN (SELECT id FROM taxonomy_term_association where class='Article' AND term_id=$term_id)";
215 echo
"<div id='blog_description' class='Standard'>{$blog->description}</div>";
220 $list->CSSclass =
"Standard";
221 $list->styles =
"clear: both";
231 $out =
"<div class='article_summary'>";
236 $out .=
"<img src='/action/image/iconize?image_id={$article->image_id}&size=120' alt='{$image->ALT_tag}' align='left'/>";
239 $out .=
"<h4><a href='{$this->blog->identifier}?article_id={$article->article_id}'>";
240 $out .=
"{$article->title}</a></h4>";
241 $out .=
$article->format(
"<strong>{formatPostDate()}</strong>");
243 $out .=
"<br/><a href='{$this->blog->identifier}?article_id={$article->article_id}'>Read More »</a></div>";
255 ?><br/><a
class=
"button" href=
"/<?echo $blog->identifier?>">« Back
to <?echo
$blog->title?></a><?
287 $constraint .=
" AND MONTH(publish_date) = $month";
293 $constraint .=
" AND article_id IN (SELECT id FROM taxonomy_term_association where class='Article' AND term_id=$term_id)";
299 echo
"<div id='blog_description' class='Book'>{$blog->description}</div>";
304 $list->CSSclass =
"Standard";
305 $list->styles =
"clear: both; width: 100%";
314 $out =
"<div class='article_summary'>";
319 $out .=
"<img src='/action/image/iconize?image_id={$article->image_id}&size=120' alt='{$image->ALT_tag}' align='left'/>";
322 $out .=
"<h4><a href='{$this->blog->identifier}?article_id={$article->article_id}'>";
323 $out .=
"{$article->title}</a></h4>";
336 echo
"<div class='chapter'>\n";
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)?> »</a>
356 <a href=
"<?echo $blog->identifier?>?article_id=<?echo $articles[$idx-1]->article_id?>" class=
"button" style=
"float: left">« <?echo ellipsis(
$articles[$idx-1]->
title, 60,
true)?></a>
362 <a href=
"<?echo $blog->identifier?>" class=
"button" style=
"float: left">« Back
to Contents
Page</a>
366 echo
"<div style='clear:both'> </div></div>";
390 if ($this->blog->allow_subscriptions)
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>");
400 $type = $this->blog->blog_type;
401 if (!array_key_exists(
$type, $this->handlers))
$type =
"Standard";
403 trace (
"Month is " .
$month, 3);
416 $type = $this->blog->blog_type;
417 if (!array_key_exists(
$type, $this->handlers))
$type =
"Standard";
419 trace(
"** Rendering article for blog '{$this->blog->identifier}' with blog view handler '{$type}'", 3);
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>";
457 $blogs = Query::create(
Blog,
"ORDER BY title")->execute();
464 $table =
new DataListView(
$blogs,
"blogs");
466 ->column(
"Identifier",
"{identifier}",
true,
"width: 30%")
467 ->column(
"Owner",
"{getOwnerName()}",
true,
"width: 20%")
468 ->column(
"# Articles",
"{countArticles()}",
true,
"width: 10%; text-align: center")
469 ->column(
"Published", array($this,
showPublished),
true,
"width: 10%; text-align: center");
474 $table->emptyMessage =
"No blogs have been created yet.";
481 return $this->table->writeScript();
486 $this->table->drawView();
491 return $blog->format(
"<a href='blog_form?blog_id={blog_id}'>{title}</a>");
496 $img =
$blog->published ?
"on.png" :
"off.png";
497 $alt =
$blog->published ?
"Published" :
"Unpublished";
500 return "<img src='/fakoli/images/$img' alt='$alt' onclick='toggleBlogPublished(this, {$blog->blog_id})' style='display: inline-block; vertical-align: middle; border: none; cursor: pointer'/>";
508 parent::BlogListView();
513 return $blog->format(
"<a href='/admin/blog_form?blog_id={blog_id}'>{title}</a>");
533 $table =
new DataListView(
$articles,
"articles");
535 ->column(
"Author",
"{getAuthorName()}",
true)
536 ->column(
"Date Published",
"{publish_date}",
true)
537 ->column(
"Published", array($this,
showPublished),
false,
"text-align: center");
541 $table->excelFile =
"articles.xls";
543 $table->emptyMessage =
"No articles have been created yet.";
550 return $this->table->writeScript();
555 $this->table->drawView();
560 $img =
$article->published ?
"on.png" :
"off.png";
561 $alt =
$article->published ?
"Published" :
"Unpublished";
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'/>";
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>";
575 echo
"<br/>\n<a class='button' href=\"blog_article_form?blog_id={$this->blog->blog_id}\">Add an Article</a>\n<br/>\n";
583 parent::BlogArticlesView(
$blog);
589 if ($this->blog->default_article_order ==
"SORT")
591 $table->enableDragReorder(
"/action/blog/reorder_articles?blog_id={$this->blog->blog_id}");
592 $table->dragText =
"<span style='font-size: 10px'>Click and drag to change the order of the articles</span>";
601 return "<a title=\"{$item->title}\" href=\"/admin/blog_article_form?blog_id={$blog->blog_id}&article_id={$item->article_id}\">". ellipsis($item->title, 80) .
"</a>";
606 echo
"<p>\n<a class='button' href=\"/admin/blog_article_form?blog_id={$this->blog->blog_id}\">Add an Article</a>\n</p>\n";
623 $this->table =
new DataListView($blog_subscribers,
"blogSubscribers");
624 $this->table->column(
"Subscriber Email",
"{subscriber_email}",
true);
628 $this->table->column(
"First Name",
"{first_name}",
true);
629 $this->table->column(
"Last Name",
"{last_name}",
true);
630 $this->table->column(
"Organization",
"{organization}",
true);
635 $this->table->filter =
true;
636 $this->table->sortable =
true;
637 $this->table->excelFile =
"blog_subscribers.xls";
638 $this->table->emptyMessage =
"Currently there are no subscribers to this blog.";
639 $this->table->zebra = 1;
644 $blog_id = $blog_subscriber->blog_id;
647 $unsubscribeLink =
"<a href='/action/blog/unsubscribe?blog_id={$blog_id}&blog_subscriber_id={$blog_subscriber_id}'>Remove</a>";
648 return $unsubscribeLink ;
654 $script .= $this->table->writeScript();
656 $this->table->drawView();
AdminBlogArticlesView($blog)
Defines the Article class.
static inlineEditingControls($blog)
BlogSubscriberListView($blog_id)
formatUnsubscribeLink($blog_subscriber)
registerHandler($type, $handler)
static registerStandardHandlers($view)
drawArticleList($year=false, $month=false, $term_id=null)
drawArticle($blog, $article_id)
Draw the specific article in the blog.
drawArticleList($blog, $year=false, $month=false, $term_id=null)
static fireEvent($event, $parameter=null, $mustBeConsumed=false)
Fire an event to all subscribers as detailed in their manifests.
DefaultBlogViewHandler provides a standard, no-frills display for blog entries.
drawArticleList($blog, $year=false, $month=false, $term_id=null)
drawArticle($blog, $article_id)
Draw the specific article in the blog.
static usingFeature()
Uses the specified framework feature(s).
static using()
Import the datamodels, views and manifest for the specified component(s).
NewsBlogViewHandler provides a simple blog view tailored displaying news articles.
drawArticle($blog, $article_id)
Draw the specific article in the blog.
drawArticleList($blog, $year=false, $month=false, $term=null)
static getValue($component, $name)
Retrieve the value of the specified Setting.
static checkPermission($component, $name, $account=null)
Check whether a user has a specific permission.
static selectDisplayVersion($target, $param="version")
$method
Pull out a simple reference to the request method.
IBlogViewHandler defines the interface that BlogViewHandlers must provide.
drawArticleList($blog)
Draw the list of articles for the specified blog.
drawArticle($blog, $article_id)
Draw the specific article in the blog.