Пример #1
0
 /**
  * 
  * @return string
  */
 protected function getClass()
 {
     $classes = array();
     $classes[] = 'wfmk_button';
     if ($this->right->getValue()) {
         $classes[] = 'wfmk_right';
     } elseif ($this->left->getValue()) {
         $classes[] = 'wfmk_left';
     }
     $classes[] = 'wfmk_button_' . $this->color->getOutput();
     $classes = Tools::ArrayToCSSClasses($classes);
     return 'class="' . $classes . '"';
 }
Пример #2
0
 /**
  * 
  * @return string
  */
 public function getCSSClasses()
 {
     $classes = array();
     $classes[] = 'bandcamp';
     $classes[] = 'wfmk_block';
     $float = $this->float->getOutput();
     if ($float == 'right') {
         $classes[] = 'wfmk_right';
     } elseif ($float == 'left') {
         $classes[] = 'wfmk_left';
     }
     if ($this->size->getOutput() != 'short') {
         $classes[] = 'wfmk_frame';
     }
     return Tools::ArrayToCSSClasses($classes);
 }
Пример #3
0
 /**
  * Called after arguments have been parsed, parameters are set and validated.
  * 
  * Returns the output as raw HTML.
  * 
  * @return string raw HTML
  */
 public function getOutput()
 {
     $output = "<a class=\"FlattrButton\" style=\"display:none;\" href=\"{$this->url->getOutput()}\" title=\"{$this->title->getOutput()}\"";
     if ($this->uid->hasBeenSet()) {
         $output .= " data-flattr-uid=\"{$this->uid->getOutput()}\"";
     }
     if ($this->category->hasBeenSet()) {
         $output .= " data-flattr-category=\"{$this->category->getOutput()}\"";
     }
     if ($this->language->hasBeenSet()) {
         $output .= " data-flattr-language=\"{$this->language->getOutput()}\"";
     }
     if ($this->tags->hasBeenSet()) {
         $output .= " data-flattr-tags=\"{$this->tags->getOutput()}\"";
     }
     if ($this->compact->hasBeenSet()) {
         $output .= " data-flattr-button=\"compact\"";
     }
     if ($this->nopopout->hasBeenSet()) {
         $output .= " data-flattr-popout=\"0\"";
     }
     if ($this->hidden->hasBeenSet()) {
         $output .= " data-flattr-hidden=\"1\"";
     }
     $output .= ">";
     $output .= $this->description->getOutput();
     $output .= "</a>";
     $output .= "<script type=\"text/javascript\" src=\"http://api.flattr.com/js/0.6/load.js?mode=auto\"></script>";
     if ($this->left->hasBeenSet() || $this->right->hasBeenSet()) {
         $output = "<div class=\"{$this->getCSSClasses()}\">{$output}</div>";
     }
     return $output;
 }
Пример #4
0
 protected function getOutput()
 {
     $source = $this->source->getParameter()->getName();
     // 'track' or 'album'
     $id = $this->source->getOutput();
     $lang = $this->lang->getOutput();
     $autoplay = $this->autoplay->getValue() ? 'playerautoplay=1&amp;' : '';
     return '
         <div class="' . $this->getCSSClasses() . '">
         <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" height="300" width="200" align="middle">
         <param name="allowScriptAccess" value="always">
         <param name="wmode" value="transparent">
         <param name="movie" value="http://widgets.jamendo.com/' . $lang . '/' . $source . '/?' . $source . '_id=' . $id . '&amp;' . $autoplay . 'playertype=2008">
         <param name="quality" value="high"><param name="bgcolor" value="#FFFFFF">
         <embed src="http://widgets.jamendo.com/' . $lang . '/' . $source . '/?' . $source . '_id=' . $id . '&amp;' . $autoplay . 'playertype=2008" quality="high" wmode="transparent" bgcolor="#FFFFFF" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" height="300" width="200" align="middle">
         </object>
         </div>';
 }
Пример #5
0
 /**
  * Used when displaying an icon
  * 
  * @return string
  */
 protected function getIconSize()
 {
     $selected_size = $this->size->getOutput();
     switch ($selected_size) {
         case 'small':
             return '16';
         case 'large':
             return '64';
     }
     return '32';
     // standard
 }
Пример #6
0
 /**
  * Called after arguments have been parsed, parameters are set and validated.
  * 
  * Returns the output as raw HTML.
  * 
  * @return string raw HTML
  */
 protected function getOutput()
 {
     $type = $this->getType();
     if ($type == 'follow') {
         return $this->getFollowButton();
     } elseif ($type == 'search') {
         $search = "search: '" . $this->source->getOutput() . "',";
         // source = search
     } else {
         $search = "";
     }
     return "<div class=\"" . $this->getCSSClasses() . "\">\n                    <script\n                        charset=\"utf-8\"\n                        src=\"http://widgets.twimg.com/j/2/widget.js\">\n                    </script>\n                    <script>\n                        new TWTR.Widget({\n                          version: 2,\n                          type: '" . $type . "',\n                          rpp: '" . $this->count->getOutput() . "',\n                          " . $search . "\n                          interval: 6000,\n                          title: '" . $this->title->getOutput() . "',\n                          subject: '" . $this->subject->getOutput() . "',\n                          width: " . $this->width->getOutput() . ",\n                          height: " . $this->height->getOutput() . ",\n                          theme: {\n                            shell: {\n                              background: '#dad9d9',\n                              color: '#ffffff'\n                            },\n                            tweets: {\n                              background: '#fcfcfc',\n                              color: '#4d4e4f',\n                              links: '#e22c2e'\n                            }\n                          },\n                          features: {\n                            scrollbar: " . $this->scrollbar->getOutput() . ",\n                            loop: " . $this->loop->getOutput() . ",\n                            live: " . $this->live->getOutput() . ",\n                            behavior: '" . ($this->all->getValue() ? 'all' : 'default') . "',\n                          }\n                        })" . $this->getJSWidgetStartCall($type) . ";\n                    </script>\n                </div>";
 }
Пример #7
0
 /**
  * 
  * @return string
  */
 public function getCSSClasses()
 {
     $classes = array();
     $classes[] = '500px';
     $classes[] = 'wfmk_block';
     $float = $this->float->getOutput();
     if ($float == 'right') {
         $classes[] = 'wfmk_right';
     } elseif ($float == 'left') {
         $classes[] = 'wfmk_left';
     }
     return Tools::ArrayToCSSClasses($classes);
 }
Пример #8
0
 /**
  * Called after arguments have been parsed, parameters are set and validated.
  * 
  * Returns the output as raw HTML.
  * 
  * @return string raw HTML
  */
 protected function getOutput()
 {
     $show_name = $this->nolink->getValue() ? '' : 'show_name=1&';
     // seems to be useless
     $random_or_recent = $this->random->getValue() ? 'random' : 'latest';
     return '<!-- Start of Flickr Badge -->  
             <style type="text/css">' . $this->getCSS() . '</style>
             <div class="' . $this->getCSSClasses() . '" ' . $this->getWidthStyleOutput() . '>
                 ' . $this->getFlickrLinkOutput() . '
                 <div class="flickr_badge_container">
                     <script 
                         type="text/javascript" 
                         src="http://www.flickr.com/badge_code_v2.gne?' . $show_name . 'count=' . $this->count->getOutput() . '&display=' . $random_or_recent . '&size=' . $this->size->getOutput() . '&layout=x&' . $this->getSourceOutput() . '">
                     </script>
                     ' . $this->getPhotostreamOutput() . '
                 </div>
             </div>
             <!-- End of Flickr Badge -->';
 }