Esempio n. 1
0
 public function Preview($width, $height, $scaleOverride = 0)
 {
     if ($this->previewEnabled == 0) {
         return parent::Preview($width, $height);
     }
     $msgWindows = __('Windows Command');
     $msgLinux = __('Linux Command');
     $preview = '';
     $preview .= '<p>' . $msgWindows . ': ' . urldecode($this->GetOption('windowsCommand')) . '</p>';
     $preview .= '<p>' . $msgLinux . ': ' . urldecode($this->GetOption('linuxCommand')) . '</p>';
     return $preview;
 }
Esempio n. 2
0
 /**
  * Preview
  * @param <type> $width
  * @param <type> $height
  * @return <type>
  */
 public function Preview($width, $height)
 {
     if ($this->previewEnabled == 0) {
         return parent::Preview($width, $height);
     }
     $layoutId = $this->layoutid;
     $regionId = $this->regionid;
     $mediaId = $this->mediaid;
     $lkId = $this->lkid;
     $mediaType = $this->type;
     $mediaDuration = $this->duration;
     $widthPx = $width . 'px';
     $heightPx = $height . 'px';
     return '<iframe scrolling="no" src="index.php?p=module&mod=' . $mediaType . '&q=Exec&method=GetResource&raw=true&preview=true&layoutid=' . $layoutId . '&regionid=' . $regionId . '&mediaid=' . $mediaId . '&lkid=' . $lkId . '&width=' . $width . '&height=' . $height . '" width="' . $widthPx . '" height="' . $heightPx . '" style="border:0;"></iframe>';
 }
Esempio n. 3
0
 public function Preview($width, $height, $scaleOverride = 0)
 {
     if ($this->previewEnabled == 0) {
         return parent::Preview($width, $height);
     }
     $proportional = $this->GetOption('scaleType') == 'stretch' ? 'false' : 'true';
     $align = $this->GetOption('align', 'center');
     $valign = $this->GetOption('valign', 'middle');
     $html = '<div style="display:table; width:100%%; height: %dpx">
         <div style="text-align:%s; display: table-cell; vertical-align: %s;">
             <img src="index.php?p=module&mod=image&q=Exec&method=GetResource&mediaid=%d&lkid=%d&width=%d&height=%d&dynamic=true&proportional=%s" />
         </div>
     </div>';
     // Show the image - scaled to the aspect ratio of this region (get from GET)
     return sprintf($html, $height, $align, $valign, $this->mediaid, $this->lkid, $width, $height, $proportional);
 }
Esempio n. 4
0
    public function Preview($width, $height)
    {
        if ($this->previewEnabled == 0) {
            return parent::Preview($width, $height);
        }
        $regionid = $this->regionid;
        // Get the text out of RAW
        $rawXml = new DOMDocument();
        $rawXml->loadXML($this->GetRaw());
        // Get the Text Node out of this
        $textNodes = $rawXml->getElementsByTagName('template');
        $textNode = $textNodes->item(0);
        $text = $textNode->nodeValue;
        $textId = $regionid . '_text';
        $innerId = $regionid . '_innerText';
        $timerId = $regionid . '_timer';
        $widthPx = $width . 'px';
        $heightPx = $height . 'px';
        //Show the contents of text accordingly
        $return = <<<END
        <div id="{$textId}" style="position:relative; overflow:hidden ;width:{$widthPx}; height:{$heightPx}; font-size: 1em;">
            <div id="{$innerId}" style="position:absolute; left: 0px; top: 0px;">
                <div class="article">
                        {$text}
                </div>
            </div>
        </div>
END;
        return $return;
    }
Esempio n. 5
0
 public function Preview($width, $height)
 {
     if ($this->previewEnabled == 0) {
         return parent::Preview($width, $height);
     }
     // Show the image - scaled to the aspect ratio of this region (get from GET)
     return sprintf('<div style="text-align:center;"><img src="index.php?p=module&mod=image&q=Exec&method=GetResource&mediaid=%d&width=%d&height=%d&dynamic=true" /></div>', $this->mediaid, $width, $height);
 }
Esempio n. 6
0
 /**
  * Preview
  * @param <double> $width
  * @param <double> $height
  * @return <string>
  */
 public function Preview($width, $height, $scaleOverride = 0)
 {
     // Each module should be able to output a preview to use in the Layout Designer
     // In most cases your preview will want to load the GetResource call associated with the module
     // This imitates the client
     return parent::Preview($width, $height, $scaleOverride);
 }
Esempio n. 7
0
 /**
  * Preview
  * @param <type> $width
  * @param <type> $height
  * @return <type>
  */
 public function Preview($width, $height)
 {
     if ($this->previewEnabled == 0) {
         return parent::Preview($width, $height);
     }
     $layoutId = $this->layoutid;
     $regionId = $this->regionid;
     $mediaId = $this->mediaid;
     $lkId = $this->lkid;
     $mediaType = $this->type;
     $mediaDuration = $this->duration;
     // Work out the url
     $url = urldecode($this->GetOption('uri'));
     $url = preg_match('/^' . preg_quote('http') . "/", $url) ? $url : 'http://' . $url;
     $offsetTop = $this->GetOption('offsetTop', 0);
     $offsetLeft = $this->GetOption('offsetLeft', 0);
     $widthPx = $width + $offsetLeft . 'px';
     $heightPx = $height + $offsetTop . 'px';
     $iframeStyle = 'margin-top:-' . $offsetTop . 'px; margin-left: -' . $offsetLeft . 'px; border:0;';
     return '<iframe scrolling="no" src="' . $url . '" width="' . $widthPx . '" height="' . $heightPx . '" style="' . $iframeStyle . '"></iframe>';
 }