本文整理汇总了PHP中UniteFunctionsRev::jsonEncodeForClientSide方法的典型用法代码示例。如果您正苦于以下问题:PHP UniteFunctionsRev::jsonEncodeForClientSide方法的具体用法?PHP UniteFunctionsRev::jsonEncodeForClientSide怎么用?PHP UniteFunctionsRev::jsonEncodeForClientSide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UniteFunctionsRev
的用法示例。
在下文中一共展示了UniteFunctionsRev::jsonEncodeForClientSide方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$revSliderAdmin = Mage::getSingleton('RevSliderAdmin');
$revSliderAdmin->requireSettings("slider_settings");
$settingsMain = $revSliderAdmin->getSettings("slider_main");
$settingsParams = $revSliderAdmin->getSettings("slider_params");
$settingsSliderMain = new RevSliderSettingsProduct();
$settingsSliderParams = new UniteSettingsProductSidebarRev();
//get taxonomies with cats
$postTypesWithCats = RevOperations::getPostTypesWithCatsForClient();
$jsonTaxWithCats = UniteFunctionsRev::jsonEncodeForClientSide($postTypesWithCats);
//check existing slider data:
$sliderID = $this->getRequest()->getParam('id');
if (!empty($sliderID)) {
$slider = new RevSlider();
$slider->initByID($sliderID);
//get setting fields
$settingsFields = $slider->getSettingsFields();
$arrFieldsMain = $settingsFields["main"];
$arrFieldsParams = $settingsFields["params"];
//modify arrows type for backword compatability
$arrowsType = UniteFunctionsRev::getVal($arrFieldsParams, "navigation_arrows");
switch ($arrowsType) {
case "verticalcentered":
$arrFieldsParams["navigation_arrows"] = "solo";
break;
}
//set custom type params values:
$settingsMain = RevSliderSettingsProduct::setSettingsCustomValues($settingsMain, $arrFieldsParams, $postTypesWithCats);
//set setting values from the slider
$settingsMain->setStoredValues($arrFieldsParams);
$settingsParams->setStoredValues($arrFieldsParams);
//update short code setting
$shortcode = $slider->getShortcode();
$settingsMain->updateSettingValue("shortcode", htmlentities($shortcode));
$linksEditSlides = $this->helper("adminhtml")->getUrl('adminhtml/nwdrevslider/slides/id/' . $sliderID);
$settingsSliderParams->init($settingsParams);
$settingsSliderMain->init($settingsMain);
$settingsSliderParams->isAccordion(true);
$this->assign('sliderID', $sliderID);
$this->assign('linksEditSlides', $linksEditSlides);
$this->assign('arrFieldsParams', $arrFieldsParams);
$this->setTemplate('nwdthemes/revslider/templates/slider_edit.phtml');
} else {
//set custom type params values:
$settingsMain = RevSliderSettingsProduct::setSettingsCustomValues($settingsMain, array(), $postTypesWithCats);
$settingsSliderParams->init($settingsParams);
$settingsSliderMain->init($settingsMain);
$settingsSliderParams->isAccordion(true);
$this->setTemplate('nwdthemes/revslider/templates/slider_new.phtml');
}
$this->assign('sliderTemplate', $this->_sliderTemplate);
$this->assign('settingsSliderMain', $settingsSliderMain);
$this->assign('settingsSliderParams', $settingsSliderParams);
$this->assign('jsonTaxWithCats', $jsonTaxWithCats);
}
示例2:
$settingsSlide = self::getSettings("slide_settings");
$cssContent = self::getSettings("css_captions_content");
$arrCaptionClasses = $operations->getArrCaptionClasses($cssContent);
$arrButtonClasses = $operations->getButtonClasses();
//set layer caption as first caption class
$firstCaption = !empty($arrCaptionClasses) ? $arrCaptionClasses[0] : "";
$settingsLayer->updateSettingValue("layer_caption", $firstCaption);
//set stored values from "slide params"
$settingsSlide->setStoredValues($slideParams);
//init the settings output object
$settingsLayerOutput->init($settingsLayer);
$settingsSlideOutput->init($settingsSlide);
//set various parameters needed for the page
$width = $sliderParams["width"];
$height = $sliderParams["height"];
$imageUrl = $slide->getImageUrl();
$imageFilename = $slide->getImageFilename();
$urlCaptionsCSS = GlobalsRevSlider::$urlCaptionsCSS;
$style = "width:{$width}px;height:{$height}px;background-image:url('{$imageUrl}')";
//set iframe parameters
$iframeWidth = $width + 60;
$iframeHeight = $height + 50;
$iframeStyle = "width:{$iframeWidth}px;height:{$iframeHeight}px;";
$closeUrl = self::getViewUrl(RevSliderAdmin::VIEW_SLIDES, "id=" . $sliderID);
$jsonLayers = UniteFunctionsRev::jsonEncodeForClientSide($arrLayers);
$jsonCaptions = UniteFunctionsRev::jsonEncodeForClientSide($arrCaptionClasses);
$loadGoogleFont = $slider->getParam("load_googlefont", "false");
require self::getPathTemplate("slide");
?>
示例3: intval
$imageID = $slide->getImageID();
$imageFilename = $slide->getImageFilename();
$style = "height:" . $height . "px;";
//
$divLayersWidth = "width:" . $width . "px;";
$divbgminwidth = "min-width:" . $width . "px;";
//set iframe parameters
$iframeWidth = $width + 60;
$iframeHeight = $height + 50;
$iframeStyle = "width:" . $iframeWidth . "px;height:" . $iframeHeight . "px;";
$closeUrl = self::getViewUrl(RevSliderAdmin::VIEW_SLIDES, "id=" . $sliderID);
$jsonLayers = UniteFunctionsRev::jsonEncodeForClientSide($arrLayers);
$jsonCaptions = UniteFunctionsRev::jsonEncodeForClientSide($arrCaptionClasses);
$jsonFontFamilys = UniteFunctionsRev::jsonEncodeForClientSide($arrFontFamily);
$arrCssStyles = UniteFunctionsRev::jsonEncodeForClientSide($arrCSS);
$arrCustomAnim = UniteFunctionsRev::jsonEncodeForClientSide($arrAnim);
//bg type params
$bgType = UniteFunctionsRev::getVal($slideParams, "background_type", "image");
$slideBGColor = UniteFunctionsRev::getVal($slideParams, "slide_bg_color", "#E7E7E7");
$divLayersClass = "slide_layers";
$bgSolidPickerProps = 'class="inputColorPicker slide_bg_color disabled" disabled="disabled"';
$bgFit = UniteFunctionsRev::getVal($slideParams, "bg_fit", "cover");
$bgFitX = intval(UniteFunctionsRev::getVal($slideParams, "bg_fit_x", "100"));
$bgFitY = intval(UniteFunctionsRev::getVal($slideParams, "bg_fit_y", "100"));
$bgPosition = UniteFunctionsRev::getVal($slideParams, "bg_position", "center top");
$bgPositionX = intval(UniteFunctionsRev::getVal($slideParams, "bg_position_x", "0"));
$bgPositionY = intval(UniteFunctionsRev::getVal($slideParams, "bg_position_y", "0"));
$bgEndPosition = UniteFunctionsRev::getVal($slideParams, "bg_end_position", "center top");
$bgEndPositionX = intval(UniteFunctionsRev::getVal($slideParams, "bg_end_position_x", "0"));
$bgEndPositionY = intval(UniteFunctionsRev::getVal($slideParams, "bg_end_position_y", "0"));
$kenburn_effect = UniteFunctionsRev::getVal($slideParams, "kenburn_effect", "off");
示例4: RevSliderSettingsProduct
<?php
$sliderTemplate = true;
$settingsMain = self::getSettings("slider_main");
$settingsParams = self::getSettings("slider_params");
$settingsSliderMain = new RevSliderSettingsProduct();
$settingsSliderParams = new UniteSettingsProductSidebarRev();
//get taxonomies with cats
$postTypesWithCats = RevOperations::getPostTypesWithCatsForClient();
$jsonTaxWithCats = UniteFunctionsRev::jsonEncodeForClientSide($postTypesWithCats);
//check existing slider data:
$sliderID = self::getGetVar("id");
if (!empty($sliderID)) {
$slider = new RevSlider();
$slider->initByID($sliderID);
//get setting fields
$settingsFields = $slider->getSettingsFields();
$arrFieldsMain = $settingsFields["main"];
$arrFieldsParams = $settingsFields["params"];
//modify arrows type for backword compatability
$arrowsType = UniteFunctionsRev::getVal($arrFieldsParams, "navigation_arrows");
switch ($arrowsType) {
case "verticalcentered":
$arrFieldsParams["navigation_arrows"] = "solo";
break;
}
//set custom type params values:
$settingsMain = RevSliderSettingsProduct::setSettingsCustomValues($settingsMain, $arrFieldsParams, $postTypesWithCats);
//set setting values from the slider
$settingsMain->setStoredValues($arrFieldsParams);
$settingsParams->setStoredValues($arrFieldsParams);
示例5: __construct
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
//get input
$slideID = $this->getRequest()->getParam('id');
//init slide object
$slide = new RevSlide();
$slide->initByID($slideID);
$slideParams = $slide->getParams();
$operations = new RevOperations();
//init slider object
$sliderID = $slide->getSliderID();
$slider = new RevSlider();
$slider->initByID($sliderID);
$sliderParams = $slider->getParams();
$arrSlideNames = $slider->getArrSlideNames();
//check if slider is template
$sliderTemplate = $slider->getParam("template", "false");
//set slide delay
$sliderDelay = $slider->getParam("delay", "9000");
$slideDelay = $slide->getParam("delay", "");
if (empty($slideDelay)) {
$slideDelay = $sliderDelay;
}
require $this->getSettingsFilePath("slide_settings");
require $this->getSettingsFilePath("layer_settings");
$settingsLayerOutput = new UniteSettingsProductSidebarRev();
$settingsSlideOutput = new UniteSettingsRevProductRev();
$arrLayers = $slide->getLayers();
$loadGoogleFont = $slider->getParam("load_googlefont", "false");
//get settings objects
$settingsLayer = $this->getSettings("layer_settings");
$settingsSlide = $this->getSettings("slide_settings");
$cssContent = $this->getSettings("css_captions_content");
$arrCaptionClasses = $operations->getArrCaptionClasses($cssContent);
$arrFontFamily = $operations->getArrFontFamilys($slider);
$arrCSS = $operations->getCaptionsContentArray();
$arrButtonClasses = $operations->getButtonClasses();
$urlCaptionsCSS = GlobalsRevSlider::$urlCaptionsCSS;
$arrAnim = $operations->getFullCustomAnimations();
//set layer caption as first caption class
$firstCaption = !empty($arrCaptionClasses) ? $arrCaptionClasses[0] : "";
$settingsLayer->updateSettingValue("layer_caption", $firstCaption);
//set stored values from "slide params"
$settingsSlide->setStoredValues($slideParams);
//init the settings output object
$settingsLayerOutput->init($settingsLayer);
$settingsSlideOutput->init($settingsSlide);
//set various parameters needed for the page
$width = $sliderParams["width"];
$height = $sliderParams["height"];
$imageUrl = $slide->getImageUrl();
$imageID = $slide->getImageID();
$imageFilename = $slide->getImageFilename();
$style = "height:" . $height . "px;";
//
$divLayersWidth = "width:" . $width . "px;";
$divbgminwidth = "min-width:" . $width . "px;";
//set iframe parameters
$iframeWidth = $width + 60;
$iframeHeight = $height + 50;
$iframeStyle = "width:" . $iframeWidth . "px;height:" . $iframeHeight . "px;";
$closeUrl = $this->getViewUrl(RevSliderAdmin::VIEW_SLIDES, "id=" . $sliderID);
$jsonLayers = UniteFunctionsRev::jsonEncodeForClientSide($arrLayers);
$jsonCaptions = UniteFunctionsRev::jsonEncodeForClientSide($arrCaptionClasses);
$jsonFontFamilys = UniteFunctionsRev::jsonEncodeForClientSide($arrFontFamily);
$arrCssStyles = UniteFunctionsRev::jsonEncodeForClientSide($arrCSS);
$arrCustomAnim = UniteFunctionsRev::jsonEncodeForClientSide($arrAnim);
//bg type params
$bgType = UniteFunctionsRev::getVal($slideParams, "background_type", "image");
$slideBGColor = UniteFunctionsRev::getVal($slideParams, "slide_bg_color", "#E7E7E7");
$divLayersClass = "slide_layers";
$bgSolidPickerProps = 'class="inputColorPicker slide_bg_color disabled" disabled="disabled"';
$bgFit = UniteFunctionsRev::getVal($slideParams, "bg_fit", "cover");
$bgFitX = intval(UniteFunctionsRev::getVal($slideParams, "bg_fit_x", "100"));
$bgFitY = intval(UniteFunctionsRev::getVal($slideParams, "bg_fit_y", "100"));
$bgPosition = UniteFunctionsRev::getVal($slideParams, "bg_position", "center top");
$bgPositionX = intval(UniteFunctionsRev::getVal($slideParams, "bg_position_x", "0"));
$bgPositionY = intval(UniteFunctionsRev::getVal($slideParams, "bg_position_y", "0"));
$bgEndPosition = UniteFunctionsRev::getVal($slideParams, "bg_end_position", "center top");
$bgEndPositionX = intval(UniteFunctionsRev::getVal($slideParams, "bg_end_position_x", "0"));
$bgEndPositionY = intval(UniteFunctionsRev::getVal($slideParams, "bg_end_position_y", "0"));
$kenburn_effect = UniteFunctionsRev::getVal($slideParams, "kenburn_effect", "off");
$kb_duration = UniteFunctionsRev::getVal($slideParams, "kb_duration", $sliderParams["delay"]);
$kb_easing = UniteFunctionsRev::getVal($slideParams, "kb_easing", "Linear.easeNone");
$kb_start_fit = UniteFunctionsRev::getVal($slideParams, "kb_start_fit", "100");
$kb_end_fit = UniteFunctionsRev::getVal($slideParams, "kb_end_fit", "100");
$bgRepeat = UniteFunctionsRev::getVal($slideParams, "bg_repeat", "no-repeat");
$slideBGExternal = UniteFunctionsRev::getVal($slideParams, "slide_bg_external", "");
$style_wrapper = '';
$class_wrapper = '';
switch ($bgType) {
case "trans":
$divLayersClass = "slide_layers";
$class_wrapper = "trans_bg";
break;
case "solid":
//.........这里部分代码省略.........
示例6: array
<?php
}
?>
<?php
if ($slide->isStaticSlide()) {
$arrayDemoLayers = array();
$arrayDemoSettings = array();
if (!empty($all_slides)) {
foreach ($all_slides as $cSlide) {
$arrayDemoLayers[$cSlide->getID()] = $cSlide->getLayers();
$arrayDemoSettings[$cSlide->getID()] = $cSlide->getParams();
}
}
$jsonDemoLayers = UniteFunctionsRev::jsonEncodeForClientSide($arrayDemoLayers);
$jsonDemoSettings = UniteFunctionsRev::jsonEncodeForClientSide($arrayDemoSettings);
?>
//set init demo layers object
UniteLayersRev.setInitDemoLayersJson(<?php
echo $jsonDemoLayers;
?>
);
UniteLayersRev.setInitDemoSettingsJson(<?php
echo $jsonDemoSettings;
?>
);
<?php
}
?>
<?php
示例7: setEditLayersSettings
/**
*
* set image style and preview url
*/
private function setEditLayersSettings()
{
//get slider id
if (!empty($this->item->id)) {
$sliderID = $this->item->sliderid;
} else {
$sliderID = JRequest::getCmd("sliderid");
}
$this->urlViewItems = HelperUniteRev::getViewUrl_Items($sliderID);
$this->urlViewItemPattern = HelperUniteRev::getViewUrl_Item($sliderID, "");
$this->urlViewItemNew = HelperUniteRev::getViewUrl_Item($sliderID);
$this->slideID = $this->item->id;
$this->sliderID = $sliderID;
$slider = HelperUniteRev::getSlider($sliderID);
$this->slider = $slider;
$params = $slider["params"];
$sliderHeight = $params->get("slider_height", 960);
$sliderWidth = $params->get("slider_width", 350);
//get image url
$urlImage = $this->params->get("image");
if (empty($urlImage)) {
$urlImage = GlobalsUniteRev::$urlDefaultSlideImage;
} else {
$urlImage = UniteFunctionJoomlaRev::getImageUrl($urlImage);
}
//create the style:
$this->styleLayers = "width:{$sliderWidth}px;height:{$sliderHeight}px;";
if (!empty($urlImage)) {
$this->styleLayers .= "background-image:url({$urlImage});";
}
//create iframe style:
//set iframe parameters
$iframeWidth = $sliderWidth + 60;
$iframeHeight = $sliderHeight + 50;
$this->styleIframe = "width:{$iframeWidth}px;height:{$iframeHeight}px;";
//load edit layers
$this->formLayer = new JForm("layer");
$this->formLayer->loadFile("layers");
//set captions list
//prepare
$contentCSS = $this->operations->getCaptionsContent();
$arrCaptionClasses = $this->operations->getArrCaptionClasses($contentCSS);
$firstCaption = !empty($arrCaptionClasses) ? $arrCaptionClasses[0] : "";
//set caption field value of the first caption
$this->formLayer->setValue("layer_caption", "", $firstCaption);
$jsonLayers = $this->prepareLayersForOutput($this->item->layers);
$this->jsonCaptions = UniteFunctionsRev::jsonEncodeForClientSide($arrCaptionClasses);
$this->jsonLayers = UniteFunctionsRev::jsonEncodeForClientSide($jsonLayers);
$this->arrButtonClasses = $this->operations->getButtonClasses();
//set slide delay
$this->slideDelay = $this->params->get("delay");
if (empty($slideDelay)) {
$this->slideDelay = $params->get("delay", "9000");
}
}
示例8: if
<script type="text/javascript">
jQuery(document).ready(function() {
<?php if(!empty($jsonLayers)):?>
//set init layers object
UniteLayersRev.setInitLayersJson(<?php echo $jsonLayers?>);
<?php endif?>
<?php if($slide->isStaticSlide()){
$arrayDemoLayers = array();
if(!empty($all_slides)){
foreach($all_slides as $cSlide){
$arrayDemoLayers[$cSlide->getID()] = $cSlide->getLayers();
}
}
$jsonDemoLayers = UniteFunctionsRev::jsonEncodeForClientSide($arrayDemoLayers);
?>
//set init demo layers object
UniteLayersRev.setInitDemoLayersJson(<?php echo $jsonDemoLayers?>);
<?php } ?>
<?php if(!empty($jsonCaptions)):?>
UniteLayersRev.setInitCaptionClasses(<?php echo $jsonCaptions?>);
<?php endif?>
<?php if(!empty($arrCustomAnim)):?>
UniteLayersRev.setInitLayerAnim(<?php echo $arrCustomAnim?>);
<?php endif?>
<?php if(!empty($jsonFontFamilys)):?>
UniteLayersRev.setInitFontTypes(<?php echo $jsonFontFamilys?>);