Beispiel #1
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()
 {
     return '<iframe
                 class="' . $this->getCSSClasses() . '"
                 frameborder="0"
                 width="' . $this->width->getOutput() . '"
                 height="' . $this->height->getOutput() . '"
                 src="http://www.dailymotion.com/embed/video/' . $this->id->getOutput() . '">
            </iframe>';
 }
Beispiel #2
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()
 {
     return '<video
                 class="' . $this->getCSSClasses() . '"
                 src="' . $this->url->getOutput() . '"
                 width="' . $this->width->getOutput() . '"
                 height="' . ($this->height->hasBeenSet() ? $this->height->getOutput() : '') . '"
                 controls
                 preload >
             </video>';
 }
Beispiel #3
0
 protected function getStyle()
 {
     $styles = array();
     if ($this->width->hasBeenSet()) {
         $styles[] = 'width:' . $this->width->getOutput() . 'px;';
     }
     if ($this->height->hasBeenSet()) {
         $styles[] = 'height:' . $this->height->getOutput() . 'px;';
     }
     $styles = Tools::ArrayToCSSStyle($styles);
     return empty($styles) ? '' : 'style="' . $styles . '"';
 }
Beispiel #4
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()
 {
     return '<iframe 
                 class="' . $this->getCSSClasses() . '"
                 allowfullscreen=""
                 frameborder="0"
                 width="' . $this->width->getOutput() . 'px"
                 height="' . $this->height->getOutput() . 'px"
                 src="http://player.vimeo.com/video/' . $this->id->getOutput() . '?title=0&amp;byline=0&amp;portrait=0"
                 webkitallowfullscreen="">
             </iframe>';
 }
Beispiel #5
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 = "<div id=\"disqus_thread\" class=\"{$this->getCSSClasses()}\" style=\"";
     if ($this->width->hasBeenSet()) {
         $output .= "width:{$this->width->getOutput()}px;";
     }
     if ($this->height->hasBeenSet()) {
         $output .= "height:{$this->height->getOutput()}px;";
     }
     $output .= "\"></div>";
     $output .= "\n<script type=\"text/javascript\">";
     $output .= "\nvar disqus_shortname='{$this->shortname->getOutput()}';";
     if ($this->id->hasBeenSet()) {
         $output .= "\nvar disqus_identifier='{$this->id->getOutput()}';";
     }
     $output .= "\nvar disqus_title='{$this->title->getOutput()}';";
     $output .= "\nvar disqus_url='{$this->url->getOutput()}';";
     if ($this->dev->hasBeenSet()) {
         $output .= "\nvar disqus_developer=1;";
     }
     $output .= "\n(function() {\r\nvar dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;\r\ndsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';\r\n(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);\r\n})()";
     $output .= "</script>";
     $output .= "<noscript>Please enable JavaScript to view the <a href=\"http://disqus.com/?ref_noscript\">comments powered by Disqus.</a></noscript>";
     // $output .= "<a href=\"http://disqus.com\" class=\"dsq-brlink\">comments powered by <span class=\"logo-disqus\">Disqus</span></a>";
     return $output;
 }
Beispiel #6
0
 /**
  * 
  * @return string
  */
 protected function getDataWidthOutput()
 {
     if ($this->target->getParameter()->getName() == 'user' || $this->annotation->getOutput() == 'inline') {
         return 'data-width="' . $this->width->getOutput() . '"';
     }
     // else
     return '';
 }
Beispiel #7
0
 /**
  * Called after arguments have been parsed, parameters are set and validated.
  * 
  * Returns the output.
  * 
  * @return string|array The output string, or an array containing output and MediaWiki parser flags.
  */
 protected function getOutput()
 {
     return '<iframe
                 class="' . $this->getCSSClasses() . '"
                 width="' . $this->width->getOutput() . '"
                 height="' . $this->height->getOutput() . '"
                 src="' . $this->getIframeSrc() . '"
                 frameborder="0"
                 allowfullscreen>
             </iframe>';
 }
Beispiel #8
0
 protected function getOutput()
 {
     $this->setBlock(false);
     $email = $force_default = $a_open = $a_close = '';
     if (($source = $this->source->getValue()) instanceof \User) {
         // parameter 'user'
         $email = $source->getEmail();
         $a_open = '<a href="' . $source->getUserPage()->getFullURL() . '">';
         $a_close = '</a>';
     } elseif (is_string($source)) {
         // parameter 'email'
         $email = $source;
     } else {
         $force_default = '&f=y';
     }
     $email_md5 = md5(strtolower(trim($email)));
     $size = 's=' . $this->size->getOutput();
     // $rating = $this->rating->hasBeenSet() ? '&r='.$this->rating->getOutput() : '';
     $rating = '&r=g';
     // "suitable for display on all websites with any audience type."
     return $a_open . '<img class="' . $this->getCSSClasses() . '" src="http://www.gravatar.com/avatar/' . $email_md5 . '?' . $size . $rating . $force_default . '&d=mm" alt="" />' . $a_close;
 }
Beispiel #9
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>";
 }
Beispiel #10
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()
 {
     return '<iframe
                 class="' . $this->getCSSClasses() . '"
                 src="' . $this->getIframeSrc() . '"
                 scrolling="no"
                 frameborder="0"
                 style="
                     overflow:hidden;
                     width:' . $this->width->getOutput() . 'px;
                     height:' . $this->height->getOutput() . 'px"
                 allowTransparency="true">
             </iframe>';
 }
Beispiel #11
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()
 {
     // source is required, at this point, we are sure that one of the subparameters has been set
     $source = $this->source->getParameter();
     $source_type = $source->getName() . 's';
     $source_id = $source->getOutput();
     return '<iframe
                 class="' . $this->getCSSClasses() . '"
                 width="' . $this->width->getOutput() . '"
                 height="' . $this->height->getOutput() . '"
                 scrolling="no"
                 frameborder="no"
                 src="http://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2F' . $source_type . '%2F' . $source_id . '&amp;auto_play=' . $this->autoplay->getOutput() . '&amp;show_artwork=' . $this->artwork->getOutput() . '&amp;color=e22c2e&amp;show_comments=' . $this->comments->getOutput() . '&amp;show_playcount=' . $this->playcount->getOutput() . '&amp;liking=' . $this->like->getOutput() . '">
             </iframe>';
 }
Beispiel #12
0
 /**
  * 
  * @return string
  */
 protected function getWidthStyleOutput()
 {
     $style = 'style="';
     if ($this->width->hasBeenSet()) {
         if ($this->size->getOutput() == 's' && $this->width->getValue() < 10) {
             // images are squares of 75x75px, and user wrote size in number of columns
             $style .= 'width: ' . (12 + 85 * $this->width->getValue()) . 'px;';
         } else {
             $style .= 'width: ' . $this->width->getOutput() . 'px;';
         }
     }
     if ($this->height->hasBeenSet()) {
         $style .= 'height: ' . $this->height->getOutput() . 'px;';
     }
     return $style . '"';
 }
Beispiel #13
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()
 {
     return '<iframe src="http://docs.google.com/viewer?url=' . $this->url->getOutput() . '&embedded=true" style="border:none;" width="' . $this->width->getOutput() . '" height="' . $this->height->getOutput() . '"></iframe>';
 }
 /**
  * 
  * @return string
  */
 protected function getIframeSrc()
 {
     $src = "http://500pxwidget.com/" . ($this->slideshow->getValue() ? 'sl' : 'in') . "/?" . ($this->tag->hasBeenSet() ? 'h' : 'u') . "=";
     $parameters = $this->source->getOutput() . '|in|' . $this->size->getValue() . '|' . $this->width->getValue() . '|' . $this->height->getValue() . '|' . $this->color->getOutput() . '|' . ($this->border->getValue() ? 'yes' : 'no') . '|' . $this->padding->getValue() . '|' . $this->category->getOutput();
     return $src . base64_encode($parameters) . '=';
 }
Beispiel #15
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()
 {
     return '<iframe width="' . $this->width->getOutput() . '" height="' . $this->height->getOutput() . '" frameborder="1" src="http://docs.google.com/' . $this->get_id_key() . '"></iframe>';
 }