当前位置: 首页>>代码示例>>PHP>>正文


PHP Module::Preview方法代码示例

本文整理汇总了PHP中Module::Preview方法的典型用法代码示例。如果您正苦于以下问题:PHP Module::Preview方法的具体用法?PHP Module::Preview怎么用?PHP Module::Preview使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Module的用法示例。


在下文中一共展示了Module::Preview方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Preview

 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;
 }
开发者ID:fignew,项目名称:xibo-cms,代码行数:12,代码来源:shellcommand.module.php

示例2: Preview

 /**
  * 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>';
 }
开发者ID:abbeet,项目名称:server39,代码行数:21,代码来源:ticker.module.php

示例3: Preview

 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);
 }
开发者ID:fignew,项目名称:xibo-cms,代码行数:16,代码来源:image.module.php

示例4: Preview

    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;
    }
开发者ID:fignew,项目名称:xibo-cms,代码行数:30,代码来源:counter.module.php

示例5: Preview

 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);
 }
开发者ID:abbeet,项目名称:server39,代码行数:8,代码来源:image.module.php

示例6: Preview

 /**
  * 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);
 }
开发者ID:fignew,项目名称:xibo-cms,代码行数:13,代码来源:module_template.php

示例7: Preview

 /**
  * 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>';
 }
开发者ID:abbeet,项目名称:server39,代码行数:27,代码来源:webpage.module.php


注:本文中的Module::Preview方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。