本文整理汇总了PHP中RevSlider::getSettingsFields方法的典型用法代码示例。如果您正苦于以下问题:PHP RevSlider::getSettingsFields方法的具体用法?PHP RevSlider::getSettingsFields怎么用?PHP RevSlider::getSettingsFields使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RevSlider
的用法示例。
在下文中一共展示了RevSlider::getSettingsFields方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: include_custom_css
public static function include_custom_css()
{
$type = isset($_GET['view']) ? $_GET['view'] : '';
$page = isset($_GET['page']) ? $_GET['page'] : '';
if ($page !== 'slider' && $page !== 'revslider_navigation') {
return false;
}
//showbiz fix
$sliderID = '';
switch ($type) {
case 'slider':
$sliderID = isset($_GET['id']) ? $_GET['id'] : '';
break;
case 'slide':
$slideID = isset($_GET['id']) ? $_GET['id'] : '';
if ($slideID == 'new') {
break;
}
$slide = new RevSlide();
$slide->initByID($slideID);
$sliderID = $slide->getSliderID();
break;
default:
if (isset($_GET['slider'])) {
$sliderID = $_GET['slider'];
}
break;
}
$arrFieldsParams = array();
if (!empty($sliderID)) {
$slider = new RevSlider();
$slider->initByID($sliderID);
$settingsFields = $slider->getSettingsFields();
$arrFieldsMain = $settingsFields['main'];
$arrFieldsParams = $settingsFields['params'];
$custom_css = @stripslashes($arrFieldsParams['custom_css']);
$custom_css = RevSliderCssParser::compress_css($custom_css);
echo '<style>' . $custom_css . '</style>';
}
}
示例3: RevSliderSettingsProduct
<?php
$settingsMain = self::getSettings("slider_main");
$settingsParams = self::getSettings("slider_params");
$settingsSliderMain = new RevSliderSettingsProduct();
$settingsSliderParams = new UniteSettingsProductSidebarRev();
//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 setting values from the slider
$settingsMain->setStoredValues($arrFieldsParams);
//set custom type params values:
$settingsMain = RevSliderSettingsProduct::setSettingsCustomValues($settingsMain, $arrFieldsParams);
$settingsParams->setStoredValues($arrFieldsParams);
//update short code setting
$shortcode = $slider->getShortcode();
$settingsMain->updateSettingValue("shortcode", $shortcode);
$linksEditSlides = self::getViewUrl(RevSliderAdmin::VIEW_SLIDES, "id={$sliderID}");