Пример #1
0
//set "slider_main" settings
$sliderMainSettings = new UniteSettingsAdvancedBiz();
$sliderMainSettings->addTextBox("title", "", "Slider Title", array("description" => "The title of the slider. Example: Slider1", "required" => "true"));
$sliderMainSettings->addTextBox("alias", "", "Slider Alias", array("description" => "The alias that will be used for embedding the slider. Example: slider1", "required" => "true"));
$sliderMainSettings->addTextBox("shortcode", "", "Slider Short Code", array("readonly" => true, "class" => "code"));
$sliderMainSettings->addHr();
//source type
$arrSourceTypes = array("posts" => "Posts", "specific_posts" => "Specific Posts", "gallery" => "Gallery");
if (UniteFunctionsWooCommerceBiz::isWooCommerceExists()) {
    $arrSourceTypes["woocommerce"] = "WooCommerce";
}
$sliderMainSettings->addRadio("source_type", $arrSourceTypes, "Source Type", "posts");
//post categories list
$sliderMainSettings->startBulkControl("source_type", UniteSettingsBiz::CONTROL_TYPE_SHOW, "posts");
//post types
$arrPostTypes = UniteFunctionsWPBiz::getPostTypesAssoc();
$arrParams = array("args" => "multiple size='5'");
$sliderMainSettings->addSelect("post_types", $arrPostTypes, "Post Types", "post", $arrParams);
//post categories
$arrParams = array("args" => "multiple size='7'");
$sliderMainSettings->addSelect("post_category", array(), "Post Categories", "", $arrParams);
//sort by
$arrSortBy = UniteFunctionsWPBiz::getArrSortBy();
$sliderMainSettings->addSelect("post_sortby", $arrSortBy, "Sort Posts By", ShowBizSlider::DEFAULT_POST_SORTBY);
//sort direction
$arrSortDir = UniteFunctionsWPBiz::getArrSortDirection();
$sliderMainSettings->addRadio("posts_sort_direction", $arrSortDir, "Sort Direction", ShowBizSlider::DEFAULT_POST_SORTDIR);
//max posts for slider
$arrParams = array("class" => "small", "unit" => "posts");
$sliderMainSettings->addTextBox("max_slider_posts", "30", "Max Posts Per Slider", $arrParams);
$sliderMainSettings->endBulkControl();