Example #1
0
	public function run($widgetParams, $orient, $request)
	{
		if (Flattr::needsWidget($request))
		{
			$args = func_get_args();
			array_shift($args); // $widgetParams
			array_shift($args); // $orient
			$url = CoOrg::createFullURL($args);
			$widget = Flattr::widget($this, $request);
			$this->flattrTitle = $widget->title;
			$this->flattrDescription = $widget->description;
			$this->flattrLanguage = $widget->language;
			$this->flattrTags = $widget->tags;
			$this->flattrCategory = $widget->category;
			$this->flattrUID = $widgetParams['uid'];
			$this->flattrButton = $orient == CoOrg::PANEL_ORIENT_VERTICAL ? 'default' : 'compact';
			$this->flattrLink = $url;
			return $this->render('flattr-button');
		}
	}
Example #2
0
<?php

class FlattrBlogShowRequest
{
	public function run($controller)
	{
		$class = new stdClass;
		$class->language = $controller->blog->language;
		$class->tags = array();
		$class->category = 'text';
		$class->title = $controller->blog->title;
		$class->description = $controller->blog->text;
		return $class;
	}
}

Flattr::request('blog/show', new FlattrBlogShowRequest);

?>
 public static function extend_item($podcast, $episode, $feed, $format)
 {
     $url = sprintf('https://flattr.com/submit/auto?user_id=%s&amp;language=%s&amp;url=%s&amp;title=%s&amp;description=%s', urlencode(Flattr::get_setting("account")), urlencode(str_replace("-", "_", $podcast->language)), urlencode($episode->permalink()), urlencode($episode->title()), urlencode($episode->description()));
     echo sprintf('<atom:link rel="payment" title="Flattr this!" href="%s" type="text/html" />', $url);
 }
 public static function adjust_contributors_shortcode_defaults($defaults)
 {
     $defaults['flattr'] = Flattr::get_setting('contributor_shortcode_default') === 'yes' ? 'yes' : 'no';
     return $defaults;
 }
Example #5
0
<?php

class FlattrHomeRequest
{
	public function run($controller)
	{
		$class = new stdClass;
		$class->language = CoOrg::getLanguage();
		$class->tags = array();
		$class->category = 'text';
		$class->title = CoOrg::config()->get('site/title');
		$class->description = CoOrg::config()->get('site/subtitle');
		return $class;
	}
}

Flattr::request('home/index', new FlattrHomeRequest);

?>
Example #6
0
<?php

class FlattrPageShowRequest
{
	public function run($controller)
	{
		$class = new stdClass;
		$class->language = $controller->page->language;
		$class->tags = array();
		$class->category = 'text';
		$class->title = $controller->page->title;
		$class->description = $controller->page->content;
		return $class;
	}
}

Flattr::request('page/show', new FlattrPageShowRequest);

?>