本文整理汇总了PHP中NextendUri::fixrelative方法的典型用法代码示例。如果您正苦于以下问题:PHP NextendUri::fixrelative方法的具体用法?PHP NextendUri::fixrelative怎么用?PHP NextendUri::fixrelative使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NextendUri
的用法示例。
在下文中一共展示了NextendUri::fixrelative方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _renderAdmin
function _renderAdmin($data, $id, $sliderid, $items)
{
$link = (array) NextendParse::parse($data->get('link', ''));
if (!isset($link[1])) {
$link[1] = '';
}
return '
<div style="line-height:0; width:' . $data->get('width', '') . '; ' . htmlspecialchars($data->get('css', '')) . '" class="nextend-smartslider-flip-container ' . $data->get('flipclass', '') . '">
' . ($link[0] != '#' ? '<a href="' . $link[0] . '" target="' . $link[1] . '" style="background: none !important;display: block;">' : '') . '
<div class="nextend-smartslider-flip">
<img alt="' . htmlspecialchars($data->get('alt', '')) . '" src="' . NextendUri::fixrelative($data->get('imagefront', '')) . '" style="width: 100%;" class="nextend-smartslider-flip-front-img" >
<img alt="' . htmlspecialchars($data->get('alt', '')) . '" src="' . NextendUri::fixrelative($data->get('imageback', '')) . '" style="width: 100%;" class="nextend-smartslider-flip-back-img" >
</div>
' . ($link[0] != '#' ? '</a>' : '') . '
</div>
';
}
示例2: dirname
<?php
$js = NextendJavascript::getInstance();
$js->addLibraryJsFile('jquery', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'slider.js');
$backgroundimage = $this->_sliderParams->get('showcasebackgroundimage', '');
$backgroundimagecss = '';
if ($backgroundimage && $backgroundimage != '-1') {
$backgroundimagecss = 'background-image: url(' . NextendUri::fixrelative($backgroundimage) . ');';
}
$direction = '';
switch ($this->_sliderParams->get('showcasedirection', 'horizontal')) {
case 'vertical':
$sliderClasses .= ' smart-slider-showcase-vertical';
$direction = 'vertical';
break;
default:
$sliderClasses .= ' smart-slider-showcase-horizontal';
$direction = 'horizontal';
}
?>
<script type="text/javascript">
window['<?php
echo $id;
?>
-onresize'] = [];
</script>
<div id="<?php
echo $id;
?>
" class="<?php
示例3: _renderAdmin
function _renderAdmin($data, $id, $sliderid, $items)
{
$link = (array) NextendParse::parse($data->get('link', ''));
if (!isset($link[1])) {
$link[1] = '';
}
$attr = '';
$click = $data->get('onmouseclick', '');
if (!empty($click)) {
$attr = ' data-click="' . htmlspecialchars($click) . '"';
}
$enter = $data->get('onmouseenter', '');
if (!empty($enter)) {
$attr = ' data-enter="' . htmlspecialchars($enter) . '"';
}
$leave = $data->get('onmouseleave', '');
if (!empty($leave)) {
$attr = ' data-leave="' . htmlspecialchars($leave) . '"';
}
$size = (array) NextendParse::parse($data->get('size', ''));
if (!isset($size[0])) {
$size[0] = 'auto';
}
if (!isset($size[1])) {
$size[1] = 'auto';
}
$kenburns = (array) NextendParse::parse($data->get('kenburns', ''));
$style = '';
if (isset($kenburns[0]) && $kenburns[0]) {
$data->set('kenburnsclass', 'haskenburns');
}
return $style . '<div ' . $attr . '>
' . ($link[0] != '#' ? '<a href="' . $link[0] . '" style="display: block;background: none !important;">' : '') . '
<img id="' . $id . '" class="' . $data->get('cssclass', '') . '" src="' . NextendUri::fixrelative($data->get('image', '')) . '" style="display: block; max-width: 100%; ' . htmlspecialchars($data->get('css', '')) . ';width:' . $size[0] . ';height:' . $size[1] . ';" class="' . $data->get('kenburnsclass', '') . ' ' . $data->get('cssclass', '') . '" />
' . ($link[0] != '#' ? '</a>' : '') . '
</div>';
}
示例4: initSlides
function initSlides($slides)
{
if ($this->_backend) {
if (NextendRequest::getCmd('action') == 'create') {
array_unshift($slides, array('id' => 0, 'title' => '{_slidetitle}', 'slider' => NextendRequest::getInt('sliderid'), 'publish_up' => '0000-00-00 00:00:00', 'publish_down' => '0000-00-00 00:00:00', 'published' => 1, 'first' => 0, 'slide' => '', 'params' => '', 'thumbnail' => '', 'background' => 'ffffff00|*|', 'description' => 'Description', 'ordering' => count($slides)));
}
if (NextendRequest::getCmd('action') == 'generatoredit') {
global $smartslidergeneratorslide;
if (!$smartslidergeneratorslide) {
$smartslidergeneratorslide = array();
}
array_unshift($slides, array_merge(array('id' => 0, 'title' => '{_slidetitle}', 'slider' => NextendRequest::getInt('sliderid'), 'publish_up' => '0000-00-00 00:00:00', 'publish_down' => '0000-00-00 00:00:00', 'published' => 1, 'first' => 0, 'slide' => '', 'params' => '', 'thumbnail' => '', 'background' => 'ffffff00|*|', 'description' => 'Description', 'ordering' => count($slides)), $smartslidergeneratorslide));
} else {
if (NextendRequest::getCmd('controller') == 'layouts' && NextendRequest::getCmd('action') == 'edit') {
global $smartsliderlayout;
if (!$smartsliderlayout) {
$smartsliderlayout = '';
}
array_unshift($slides, array('id' => 0, 'title' => '{_slidetitle}', 'slide' => $smartsliderlayout, 'params' => ''));
} else {
if (NextendRequest::getCmd('controller') == 'slides') {
$currentlyedited = NextendRequest::getInt('slideid');
for ($i = 0; $i < count($slides); $i++) {
if ($slides[$i]['id'] == $currentlyedited) {
$this->_activeSlide = $i;
break;
}
}
}
}
}
} else {
for ($i = 0; $i < count($slides); $i++) {
if ($slides[$i]['first'] == 1) {
$this->_activeSlide = $i;
break;
}
}
}
nextendimport('nextend.image.color');
for ($i = 0; $i < count($slides); $i++) {
$params = new NextendData();
$params->loadJSON($slides[$i]['params']);
$slides[$i]['params'] = $params;
$slides[$i]['classes'] = 'smart-slider-canvas';
if (!isset($slides[$i]['background'])) {
$slides[$i]['background'] = 'ffffff00|*|';
}
$bg = (array) NextendParse::parse($slides[$i]['background']);
$style = '';
if (isset($bg[0]) && strlen($bg[0]) == 8) {
if (substr($bg[0], 6, 2) != '00') {
$style .= 'background-color: #' . substr($bg[0], 0, 6) . ';';
$rgba = NextendColor::hex2rgba($bg[0]);
$style .= 'background-color: RGBA(' . $rgba[0] . ',' . $rgba[1] . ',' . $rgba[2] . ',' . round($rgba[3] / 127, 2) . ');';
}
}
$slides[$i]['style'] = $style;
$bgmore = (array) NextendParse::parse($slides[$i]['params']->get('backgroundmore'));
$slides[$i]['bg'] = array('desktop' => empty($bg[1]) ? 0 : NextendUri::fixrelative($bg[1]), 'desktopretina' => empty($bgmore[0]) ? 0 : NextendUri::fixrelative($bgmore[0]), 'tablet' => empty($bgmore[1]) ? 0 : NextendUri::fixrelative($bgmore[1]), 'tabletretina' => empty($bgmore[2]) ? 0 : NextendUri::fixrelative($bgmore[2]), 'mobile' => empty($bgmore[3]) ? 0 : NextendUri::fixrelative($bgmore[3]), 'mobileretina' => empty($bgmore[4]) ? 0 : NextendUri::fixrelative($bgmore[4]), 'alt' => empty($bg[2]) ? '' : $bg[2]);
if (!empty($slides[$i]['thumbnail'])) {
$slides[$i]['thumbnail'] = NextendUri::fixrelative($slides[$i]['thumbnail']);
}
$link = $params->get('link', '');
$link = (array) NextendParse::parse($link);
if (!$this->_backend && $link && isset($link[0]) && $link[0] != '' && $link[0] != '#') {
if (!isset($link[1])) {
$link[1] = '_self';
}
$slides[$i]['link'] = ' onclick="' . htmlspecialchars(strpos($link[0], 'javascript:') === 0 ? $link[0] : ($link[1] == '_blank' ? "window.open('" . (nextendIsJoomla() ? JRoute::_($link[0], false) : $link[0]) . "','_blank');" : "window.location='" . (nextendIsJoomla() ? JRoute::_($link[0], false) : $link[0]) . "'")) . '" ';
$slides[$i]['style'] .= 'cursor:pointer;';
} else {
$slides[$i]['link'] = '';
}
}
return $slides;
}
示例5: fetchElement
function fetchElement()
{
$css = NextendCss::getInstance();
$css->addCssFile(NEXTEND_SMART_SLIDER2_ASSETS . 'admin/css/createquick.css');
$css->addCssLibraryFile('element/textarea.css');
$js = NextendJavascript::getInstance();
$js->addLibraryJsLibraryFile('jquery', 'ui/jquery.ui.core.min.js');
$js->addLibraryJsLibraryFile('jquery', 'ui/jquery.ui.widget.min.js');
$js->addLibraryJsLibraryFile('jquery', 'ui/jquery.ui.mouse.min.js');
$js->addLibraryJsLibraryFile('jquery', 'ui/jquery.ui.sortable.min.js');
$this->_value = $this->_form->get($this->_name, $this->_default);
$images = json_decode($this->_value, true);
$html = '<div id="selected-images-container" class="">';
if (nextendIsWordpress()) {
add_filter('media_view_strings', 'custom_media_uploader_tabs', 5);
function custom_media_uploader_tabs($strings)
{
$strings['insertMediaTitle'] = "Image";
$strings['insertIntoPost'] = "Add to slider";
// remove options
if (isset($strings['createGalleryTitle'])) {
unset($strings['createGalleryTitle']);
}
if (isset($strings['insertFromUrlTitle'])) {
unset($strings['insertFromUrlTitle']);
}
return $strings;
}
wp_enqueue_style('editor');
if (function_exists('wp_enqueue_media')) {
wp_enqueue_media();
} else {
wp_enqueue_style('thickbox');
wp_enqueue_script('media-upload');
wp_enqueue_script('thickbox');
}
$html .= '<a title="Add Image" data-editor="content" class="button add-image" href="#">
<span class="wp-media-buttons-icon"></span> Add Image
</a>
<div style="clear: both;"></div>';
} else {
if (nextendIsMagento()) {
$html .= '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'extjs/ext-tree.js"></script>';
$html .= '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'extjs/ext-tree-checkbox.js"></script>';
$html .= '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'extjs/fix-defer.js"></script>';
$html .= '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'mage/adminhtml/variables.js"></script>';
$html .= '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'mage/adminhtml/wysiwyg/widget.js"></script>';
$html .= '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'lib/flex.js"></script>';
$html .= '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'lib/FABridge.js"></script>';
$html .= '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'mage/adminhtml/flexuploader.js"></script>';
$html .= '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'mage/adminhtml/browser.js"></script>';
$html .= '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'prototype/window.js"></script>';
$html .= '<link rel="stylesheet" type="text/css" href="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'prototype/windows/themes/default.css" media="screen"/>';
$html .= '<link rel="stylesheet" type="text/css" href="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) . 'adminhtml/default/default/lib/prototype/windows/themes/magento.css" media="screen"/>';
$html .= '<a title="Add Image" data-editor="content" class="button add-image" href="#">
<span class="wp-media-buttons-icon"></span> Add Image
</a>
<input type="hidden" id="magentohidden" />
<div style="clear: both;"></div>';
}
}
$html .= '<div id="delete-image"></div>
<ul id="selected-images">';
if (is_array($images)) {
$i = 0;
foreach ($images as $img) {
$html .= '<li>';
$html .= '<img src="' . NextendUri::fixrelative($img['image']) . '" data-src="' . $img['image'] . '" /><div class="field-container">';
$html .= '
<div class="nextend-mixed-group">
<div class="nextend-mixed-label">
<label for="title' . $i . '" id="title' . $i . '-lbl">Title</label>
</div>
<div class="nextend-mixed-element">
<div class="nextend-text ">
<input type="text" autocomplete="off" style="width:390px;" value="' . $img['title'] . '" name="" id="title' . $i . '">
</div>
</div>
</div>';
$html .= '
<div class="nextend-mixed-group" style="clear: both;">
<div class="nextend-mixed-label">
<label for="link' . $i . '" id="link' . $i . '-lbl">Link</label>
</div>
<div class="nextend-mixed-element">
<div class="nextend-text">
<input type="text" autocomplete="off" style="width:390px;" value="' . $img['url'] . '" name="" id="link' . $i . '">
</div>
</div>
</div>';
$html .= '
<div class="nextend-mixed-group" style="clear: both;">
<div class="nextend-mixed-label">
<label for="description' . $i . '" id="description' . $i . '-lbl">Description</label>
</div>
<div class="nextend-mixed-element">
<div class="nextend-textarea ">
<textarea autocomplete="off" style="width:400px; height: 40px;" name="" id="description' . $i . '">' . $img['description'] . '</textarea>
</div>
</div>
//.........这里部分代码省略.........
示例6: _renderAdmin
function _renderAdmin($data, $id, $sliderid, $items)
{
$link = (array) NextendParse::parse($data->get('link', ''));
if (!isset($link[1])) {
$link[1] = '';
}
return '<div style="' . htmlspecialchars($data->get('css', '')) . ';line-height:0;position: relative;display: block;" class="nextend-smartslider-fade-container nextend-smartslider-fade-' . $data->get('fadeclass', '') . '">
' . ($link[0] != '#' ? '<a href="' . $link[0] . '" style="background: none !important; display:block;">' : '') . '
<span class="nextend-smartslider-fade">
<img alt="' . htmlspecialchars($data->get('alt', '')) . '" src="' . NextendUri::fixrelative($data->get('imagefront', '')) . '" style="max-width: 100%; width: ' . $data->get('width', '') . ';" class="nextend-smartslider-fade-front-img" >
<img alt="' . htmlspecialchars($data->get('alt', '')) . '" src="' . NextendUri::fixrelative($data->get('imageback', '')) . '" style="max-width: 100%; width: ' . $data->get('width', '') . ';" class="nextend-smartslider-fade-back-img" >
<style>
div#nextend-smart-slider-0 .nextend-smartslider-fade-container .nextend-smartslider-fade .nextend-smartslider-fade-back-img{
position:absolute;
top:0;
left:0;
-webkit-transition:opacity .4s ease-in-out;
-moz-transition:opacity .4s ease-in-out;
-o-transition:opacity .4s ease-in-out;
transition:opacity .4s ease-in-out;
opacity:0
}
div#nextend-smart-slider-0 .nextend-smartslider-fade-container .nextend-smartslider-fade:HOVER .nextend-smartslider-fade-back-img{
opacity: 0.9999;
}
</style>
</span>
' . ($link[0] != '#' ? '</a>' : '') . '
</div>';
}
示例7: _renderAdmin
function _renderAdmin($data, $id, $sliderid, $items)
{
$link = (array) NextendParse::parse($data->get('link', ''));
if (!isset($link[1])) {
$link[1] = '';
}
$colors = NextendColor::colorToCss($data->get('color', '00000080'));
$size = (array) NextendParse::parse($data->get('size', ''));
if (!isset($size[0])) {
$size[0] = '100';
}
if (!isset($size[1])) {
$size[1] = '100';
}
return '
<div id="' . $id . '">
' . ($link[0] != '#' ? '<a href="' . $link[0] . '" target="' . $link[1] . '" style="display: block; background: none !important;">' : '') . '
<div class="nextend-smartslider-caption ' . $data->get('customcaptionclass', '') . '" style="width:' . $size[0] . 'px; height:' . $size[1] . 'px;">
<img alt="' . htmlspecialchars($data->get('alt', '')) . '" src="' . NextendUri::fixrelative($data->get('image', '')) . '" class="img-' . $data->get('captionclass', '') . '" />
<div class="caption nextend-smartslider-caption-' . $data->get('captionclass', '') . '" style="background:#' . $colors[0] . ';background:' . $colors[1] . ';">
<h4 class="' . $data->get('fontclasstitle', '') . '">' . $data->get('content', '') . '</h4>
<p class="' . $data->get('fontclass', '') . '">' . $data->get('description', '') . '</p>
</div>
</div>
' . ($link[0] != '#' ? '</a>' : '') . '
<script type="text/javascript">
' . $this->getJs($sliderid, $id) . '
</script>
</div>
';
}