1: <?php
2: 3: 4: 5: 6: 7:
8: class Ansel_Widget_Links extends Ansel_Widget_Base
9: {
10: protected $_supported_views = array('Gallery', 'Image');
11:
12: public function __construct($params)
13: {
14: parent::__construct($params);
15: $this->_title = _("Links");
16: }
17:
18: public function html()
19: {
20: global $registry;
21:
22: $feedurl = Horde::url('rss.php', true);
23: $owner = $this->_view->gallery->get('owner');
24: $html = $this->_htmlBegin();
25: $html .= Ansel::getUrlFor('rss_user', array('owner' => $owner))->link() . Horde::img('feed.png') . ' ' . ($owner ? sprintf(_("Recent photos by %s"), $owner) : _("Recent system photos")) . '</a>';
26: $slug = $this->_view->gallery->get('slug');
27: $html .= '<br />' . Ansel::getUrlFor('rss_gallery', array('gallery' => $this->_view->gallery->id, 'slug' => $slug))->link() . ' ' . Horde::img('feed.png') . ' ' . sprintf(_("Recent photos in %s"), htmlspecialchars($this->_view->gallery->get('name'))) . '</a>';
28:
29:
30: if (empty($this->_view->_params['image_id'])) {
31:
32: $params = array('count' => 10);
33: if (!empty($slug)) {
34: $params['gallery_slug'] = $slug;
35: } else {
36: $params['gallery_id'] = $this->_view->gallery->id;
37: }
38: } else {
39:
40: $params = array('thumbsize' => 'screen',
41: 'images' => $this->_view->_params['image_id'],
42: 'count' => 10);
43:
44: }
45:
46: $embed = htmlentities(Ansel::embedCode($params));
47: $html .= '<div class="embedInput">' . _("Embed: ") . '<br /><input type="text" readonly="readonly" value="' . $embed . '" /></div>';
48: $html .= $this->_htmlEnd();
49:
50: return $html;
51: }
52:
53: }
54: