contributions/api.twitter/view/widgets/tweets.widget.php
Go to the documentation of this file.00001 <?php 00002 /** 00003 * Output twitter messages of airline 00004 */ 00005 class WidgetTweets implements IWidget { 00006 public $user; 00007 00008 public static function output($user, $policy = self::NONE) { 00009 $w = new WidgetTweets($user); 00010 return $w->render($policy); 00011 } 00012 00013 public function __construct($user) { 00014 $this->user = $user; 00015 } 00016 00017 public function render($policy = self::NONE) { 00018 Load::models('tweets'); 00019 $tweets = Tweets::get_latest_for_user($this->user, 10); 00020 $view = ViewFactory::create_view(IViewFactory::MESSAGE, 'widgets/tweets', $page_data); 00021 $view->assign('tweets', $tweets); 00022 return $view->render(); 00023 } 00024 }