本文整理汇总了PHP中RevOperations::getPostTypesWithCatsForClient方法的典型用法代码示例。如果您正苦于以下问题:PHP RevOperations::getPostTypesWithCatsForClient方法的具体用法?PHP RevOperations::getPostTypesWithCatsForClient怎么用?PHP RevOperations::getPostTypesWithCatsForClient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RevOperations
的用法示例。
在下文中一共展示了RevOperations::getPostTypesWithCatsForClient方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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);