当前位置: 首页>>代码示例>>PHP>>正文


PHP RevSlider::getShortcode方法代码示例

本文整理汇总了PHP中RevSlider::getShortcode方法的典型用法代码示例。如果您正苦于以下问题:PHP RevSlider::getShortcode方法的具体用法?PHP RevSlider::getShortcode怎么用?PHP RevSlider::getShortcode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RevSlider的用法示例。


在下文中一共展示了RevSlider::getShortcode方法的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);
 }
开发者ID:perseusl,项目名称:kingdavid,代码行数:60,代码来源:Edit.php

示例2: switch

    $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}");
    $settingsSliderParams->init($settingsParams);
    $settingsSliderMain->init($settingsMain);
    $settingsSliderParams->isAccordion(true);
    require self::getPathTemplate("slider_edit");
} else {
    $settingsSliderParams->init($settingsParams);
    $settingsSliderMain->init($settingsMain);
    $settingsSliderParams->isAccordion(true);
    require self::getPathTemplate("slider_new");
}
?>
	
开发者ID:par-orillonsoft,项目名称:elearning-wordpress,代码行数:30,代码来源:slider.php

示例3: explode


//.........这里部分代码省略.........
            ?>
 />
		    <input style="display:none;" name="udesign_options[c3_autostop]" type="checkbox" id="c3_autostop" value="yes" <?php 
            checked('yes', $options['c3_autostop']);
            ?>
 />
		    <input name="udesign_options[no_slider_text]" type="hidden" id="no_slider_text" value="<?php 
            if ($options['no_slider_text']) {
                echo esc_attr($options['no_slider_text']);
            }
            ?>
" />

<?php 
            if (!is_plugin_active('revslider/revslider.php')) {
                ?>
                        <div style="background-color:#FFEBE8; border:1px solid #C00; padding:0 0.8em; margin:10px 0;">
                            <p style="font-weight:bold;"><?php 
                printf(__('You need  to install the "Revolution Slider" first before using this feature. You may install the slider through the %1$sInstall Plugins%2$s section.', 'udesign'), '<a href="themes.php?page=install-required-plugins">', '</a>');
                ?>
</p>
                        </div>
<?php 
            } else {
                ?>
                        <table class="form-table">
                            <tbody>
                                <tr valign="top">
                                    <th scope="row"><?php 
                esc_html_e('Revolution Slider', 'udesign');
                ?>
</th>
                                    <td>
  <?php 
                $slider = new RevSlider();
                $arrSliders = $slider->getArrSliders();
                if (empty($arrSliders)) {
                    ?>
                                            <div style="background-color:#FFFFE0; border:1px solid #E6DB55; padding:0 0.8em; margin:0;">
                                                <p style="font-weight:bold; margin:7px 0;"><?php 
                    printf(__('No sliders found!  Please create a new slider from the %1$sRevolution Slider%2$s page.', 'udesign'), '<a href="admin.php?page=revslider">', '</a>');
                    ?>
</p>
                                            </div>
<?php 
                } else {
                    ?>
                                            <label for="current_rev_slider"><?php 
                    esc_html_e('Choose a Revolution Slider:', 'udesign');
                    ?>
</label>
                                            <select name="udesign_options[rev_slider_shortcode]" id="current_rev_slider">
                                                    <option value=""<?php 
                    echo $options['rev_slider_shortcode'] == '' ? ' selected="selected"' : '';
                    ?>
><?php 
                    esc_html_e('--Select Slider--', 'udesign');
                    ?>
</option> 
<?php 
                    foreach ($arrSliders as $slider) {
                        ?>
                                                    <option value="<?php 
                        echo $slider->getShortcode();
                        ?>
"<?php 
                        echo $slider->getShortcode() == $options['rev_slider_shortcode'] ? ' selected="selected"' : '';
                        ?>
><?php 
                        echo $slider->getTitle();
                        ?>
</option> 
<?php 
                    }
                    ?>
                                            </select><br />
                                            <span class="description"><?php 
                    printf(__('To create additional sliders or to configure the existing ones please refer to the %1$sRevolution Slider%2$s page.', 'udesign'), '<a href="admin.php?page=revslider">', '</a>');
                    ?>
</span><br />
                                            <span class="description"><?php 
                    printf(__('For help please refer to the %1$sDocumentation%2$s.', 'udesign'), '<a target="_blank" href="' . get_bloginfo('template_url') . '/scripts/documentation/index.html#revslider-description">', '</a>');
                    ?>
</span>
                                            <div class="clear"></div>
<?php 
                }
                ?>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
<?php 
            }
            ?>
    
<?php 
        }
        display_save_changes_button();
    }
开发者ID:nimishavyas,项目名称:proiti,代码行数:101,代码来源:udesign_options_page.php


注:本文中的RevSlider::getShortcode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。