示例#1
0
$operations = new BannerOperations();
//Set Layer settings
$contentCSS = $operations->getCaptionsContent();
$arrAnimations = $operations->getArrAnimations();
$arrEndAnimations = $operations->getArrEndAnimations();
$htmlButtonDown = '<div id="layer_captions_down" class="ui-state-default ui-corner-all"><span class="ui-icon ui-icon-arrowthick-1-s"></span></div>';
$buttonEditStyles = UniteFunctionsBanner::getHtmlLink("javascript:void(0)", "<i class='icon-magic'></i>Edit CSS File", "button_edit_css", "button-primary btn-blue");
$arrEasing = $operations->getArrEasing();
$arrEndEasing = $operations->getArrEndEasing();
$captionsAddonHtml = $htmlButtonDown . $buttonEditStyles;
//Set Layer settings
$layerSettings = new UniteSettingsAdvancedBanner();
$layerSettings->addSection(__("Layer Params", BANNERROTATOR_TEXTDOMAIN), __("layer_params", BANNERROTATOR_TEXTDOMAIN));
$layerSettings->addSap(__("Layer Params", BANNERROTATOR_TEXTDOMAIN), __("layer_params"));
$layerSettings->addTextBox(__("layer_caption"), __("caption_green"), __("Style", BANNERROTATOR_TEXTDOMAIN), array(UniteSettingsBanner::PARAM_ADDTEXT => $captionsAddonHtml, "class" => "textbox-caption"));
$addHtmlTextarea = UniteFunctionsBanner::getHtmlLink("javascript:void(0)", "insert button", "linkInsertButton", "disabled");
$layerSettings->addTextArea("layer_text", "", __("Text / Html", BANNERROTATOR_TEXTDOMAIN), array("class" => "area-layer-params", UniteSettingsBanner::PARAM_ADDTEXT_BEFORE_ELEMENT => $addHtmlTextarea));
$layerSettings->addTextBox("layer_image_link", "", __("Image Link", BANNERROTATOR_TEXTDOMAIN), array("class" => "text-sidebar-link", "hidden" => true));
$layerSettings->addSelect("layer_link_open_in", array("same" => __("Same Window", BANNERROTATOR_TEXTDOMAIN), "new" => __("New Window", BANNERROTATOR_TEXTDOMAIN)), __("Link Open In", BANNERROTATOR_TEXTDOMAIN), "same", array("hidden" => true));
$layerSettings->addSelect("layer_animation", $arrAnimations, __("Animation", BANNERROTATOR_TEXTDOMAIN), "fade");
$layerSettings->addSelect("layer_easing", $arrEasing, __("Easing", BANNERROTATOR_TEXTDOMAIN), "easeOutExpo");
$params = array("unit" => __("ms", BANNERROTATOR_TEXTDOMAIN));
$layerSettings->addTextBox("layer_speed", "", "Speed", $params);
$layerSettings->addCheckbox("layer_hidden", false, __("Hide Under Width", BANNERROTATOR_TEXTDOMAIN));
//Put left top
$textOffsetX = __("OffsetX", BANNERROTATOR_TEXTDOMAIN);
$textX = __("X", BANNERROTATOR_TEXTDOMAIN);
$params = array("attrib_text" => "data-textoffset='{$textOffsetX}' data-textnormal='{$textX}'");
$layerSettings->addTextBox("layer_left", "", __("X", BANNERROTATOR_TEXTDOMAIN), $params);
$textOffsetY = __("OffsetY", BANNERROTATOR_TEXTDOMAIN);
<?php

//Set "slider_main" settings
$sliderMainSettings = new UniteSettingsAdvancedBanner();
$sliderMainSettings->addTextBox("title", "", __("Slider Title", BANNERROTATOR_TEXTDOMAIN), array("description" => __("The title of the slider. Example: Slider1", BANNERROTATOR_TEXTDOMAIN), "required" => "true"));
$sliderMainSettings->addTextBox("alias", "", __("Slider Alias", BANNERROTATOR_TEXTDOMAIN), array("description" => __("The alias that used for embedding the slider. Example: slider1", BANNERROTATOR_TEXTDOMAIN), "required" => "true"));
$sliderMainSettings->addTextBox("shortcode", "", __("Slider Shortcode", BANNERROTATOR_TEXTDOMAIN), array("readonly" => true, "class" => "code"));
$sliderMainSettings->addHr();
//Set slider type / texts
$sliderMainSettings->addRadio("sliderType", array("responsitive" => __("Custom", BANNERROTATOR_TEXTDOMAIN), "fullwidth" => __("Responsive", BANNERROTATOR_TEXTDOMAIN), "fullscreen" => __("Full Screen", BANNERROTATOR_TEXTDOMAIN), "fixed" => __("Fixed", BANNERROTATOR_TEXTDOMAIN)), __("Slider Layout", BANNERROTATOR_TEXTDOMAIN), "fullwidth");
$arrParams = array("class" => "regular-text", "description" => __("Example: #header or .header, .footer, #somecontainer | The height of fullscreen slider will be decreased with the height of these Containers to fit perfect in the screen", BANNERROTATOR_TEXTDOMAIN));
$sliderMainSettings->addTextBox("fullScreenOffsetContainer", "", __("Offset Containers", BANNERROTATOR_TEXTDOMAIN), $arrParams);
$sliderMainSettings->addControl("sliderType", "fullScreenOffsetContainer", UniteSettingsBanner::CONTROL_TYPE_SHOW, "fullscreen");
$paramsSize = array("width" => 1170, "height" => 500);
$sliderMainSettings->addCustom("sliderSize", "sliderSize", "", __("Grid Settings", BANNERROTATOR_TEXTDOMAIN), $paramsSize);
$paramsResponsitive = array("w1" => 1300, "sw1" => 960, "w2" => 1100, "sw2" => 760, "w3" => 768, "sw3" => 480, "w4" => 480, "sw4" => 320);
$sliderMainSettings->addCustom("responsitiveSettings", "responsitive", "", __("Responsive Sizes"), $paramsResponsitive);
$sliderMainSettings->addHr();
self::storeSettings("slider_main", $sliderMainSettings);
//Set "slider_params" settings
$sliderParamsSettings = new UniteSettingsAdvancedBanner();
$sliderParamsSettings->loadXMLFile(self::$path_settings . "/slider_settings.xml");
//Store params
self::storeSettings("slider_params", $sliderParamsSettings);
示例#3
0
<?php

//Set Slide settings
$arrTransitions = $operations->getArrTransition();
$arrSlideNames = $slider->getArrSlideNames();
$slideSettings = new UniteSettingsAdvancedBanner();
//Title
$params = array("description" => __("The title of the slide, will be shown in the slides list.", BANNERROTATOR_TEXTDOMAIN), "class" => "medium-text");
$slideSettings->addTextBox("title", __("Slide", BANNERROTATOR_TEXTDOMAIN), __("Slide Title", BANNERROTATOR_TEXTDOMAIN), $params);
//State
$params = array("description" => __("The state of the slide. The unpublished slide will be excluded from the slider.", BANNERROTATOR_TEXTDOMAIN));
$slideSettings->addSelect("state", array("published" => __("Published", BANNERROTATOR_TEXTDOMAIN), "unpublished" => __("Unpublished", BANNERROTATOR_TEXTDOMAIN)), __("State", BANNERROTATOR_TEXTDOMAIN), "published", $params);
//Visible from
$params = array("description" => __("If set, slide will be visible after the date is reached", BANNERROTATOR_TEXTDOMAIN));
$slideSettings->addDatePicker("date_from", "", __("Visible from", BANNERROTATOR_TEXTDOMAIN), $params);
//Visible until
$params = array("description" => __("If set, slide will be visible till the date is reached", BANNERROTATOR_TEXTDOMAIN));
$slideSettings->addDatePicker("date_to", "", __("Visible until", BANNERROTATOR_TEXTDOMAIN), $params);
$slideSettings->addHr("");
//WPML
$isWpmlExists = UniteWpmlBanner::isWpmlExists();
$useWpml = $slider->getParam("useWpml", "false");
if ($isWpmlExists && $useWpml == "true") {
    $arrLangs = UniteWpmlBanner::getArrLanguages();
    $params = array("description" => __("The language of the slide (uses WPML plugin).", BANNERROTATOR_TEXTDOMAIN));
    $slideSettings->addSelect("lang", $arrLangs, __("Language", BANNERROTATOR_TEXTDOMAIN), "all", $params);
}
//Transition
$params = array("description" => "The appearance transition of this slide.");
$slideSettings->addSelect("slide_transition", $arrTransitions, "Transition", "random", $params);
//Delay