예제 #1
0
 function putBannerRotator($data, $putIn = "")
 {
     $operations = new BannerOperations();
     $arrValues = $operations->getGeneralSettingsValues();
     $includesGlobally = UniteFunctionsBanner::getVal($arrValues, "includes_globally", "on");
     $strPutIn = UniteFunctionsBanner::getVal($arrValues, "pages_for_includes");
     $isPutIn = BannerRotatorOutput::isPutIn($strPutIn, true);
     if ($isPutIn == false && $includesGlobally == "off") {
         $output = new BannerRotatorOutput();
         $option1Name = "Include BannerRotator libraries globally (all pages/posts)";
         $option2Name = "Pages to include BannerRotator libraries";
         $output->putErrorMessage(__("If you want to use the PHP function \"putBannerRotator\" in your code please make sure to check \" ", BANNERROTATOR_TEXTDOMAIN) . $option1Name . __(" \" in the backend's \"General Settings\" (top right panel). <br> <br> Or add the current page to the \"", BANNERROTATOR_TEXTDOMAIN) . $option2Name . __("\" option box."));
         return false;
     }
     BannerRotatorOutput::putSlider($data, $putIn);
 }
 public function widget($args, $instance)
 {
     $sliderID = UniteFunctionsBanner::getVal($instance, "banner_rotator");
     $homepageCheck = UniteFunctionsBanner::getVal($instance, "banner_rotator_homepage");
     $homepage = "";
     if ($homepageCheck == "on") {
         $homepage = "homepage";
     }
     $pages = UniteFunctionsBanner::getVal($instance, "banner_rotator_pages");
     if (!empty($pages)) {
         if (!empty($homepage)) {
             $homepage .= ",";
         }
         $homepage .= $pages;
     }
     if (empty($sliderID)) {
         return false;
     }
     BannerRotatorOutput::putSlider($sliderID, $homepage);
 }