本文整理汇总了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;
}
示例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 . '®ionid=' . $regionId . '&mediaid=' . $mediaId . '&lkid=' . $lkId . '&width=' . $width . '&height=' . $height . '" width="' . $widthPx . '" height="' . $heightPx . '" style="border:0;"></iframe>';
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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>';
}