示例#1
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