示例#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 '<video
                 class="' . $this->getCSSClasses() . '"
                 src="' . $this->url->getOutput() . '"
                 width="' . $this->width->getOutput() . '"
                 height="' . ($this->height->hasBeenSet() ? $this->height->getOutput() : '') . '"
                 controls
                 preload >
             </video>';
 }
示例#2
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 . '"';
 }
示例#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 = "<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;
 }
示例#4
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 . '"';
 }