/** * * put kb slider on the page. * the data can be slider ID or slider alias. */ function putShowBiz($data, $putIn = "") { $operations = new BizOperations(); $arrValues = $operations->getGeneralSettingsValues(); $includesGlobally = UniteFunctionsBiz::getVal($arrValues, "includes_globally", "on"); $strPutIn = UniteFunctionsBiz::getVal($arrValues, "pages_for_includes"); $isPutIn = ShowBizOutput::isPutIn($strPutIn, true); if ($isPutIn == false && $includesGlobally == "off") { $output = new ShowBizOutput(); $option1Name = "Include ShowBiz libraries globally (all pages/posts)"; $option2Name = "Pages to include ShowBiz libraries"; $output->putErrorMessage(__("If you want to use the PHP function \"putShowBiz\" in your code please make sure to check \" ", SHOWBIZ_TEXTDOMAIN) . $option1Name . __(" \" in the backend's \"General Settings\" (top right panel). <br> <br> Or add the current page to the \"", SHOWBIZ_TEXTDOMAIN) . $option2Name . __("\" option box.")); return false; } ShowBizOutput::putSlider($data, $putIn); }
/** * * widget output */ public function widget($args, $instance) { $sliderID = UniteFunctionsBiz::getVal($instance, "showbiz"); $title = UniteFunctionsBiz::getVal($instance, "showbiz_title"); $homepageCheck = UniteFunctionsBiz::getVal($instance, "showbiz_homepage"); $homepage = ""; if ($homepageCheck == "on") { $homepage = "homepage"; } $pages = UniteFunctionsBiz::getVal($instance, "showbiz_pages"); if (!empty($pages)) { if (!empty($homepage)) { $homepage .= ","; } $homepage .= $pages; } if (empty($sliderID)) { return false; } //widget output $beforeWidget = UniteFunctionsBiz::getVal($args, "before_widget"); $afterWidget = UniteFunctionsBiz::getVal($args, "after_widget"); $beforeTitle = UniteFunctionsBiz::getVal($args, "before_title"); $afterTitle = UniteFunctionsBiz::getVal($args, "after_title"); echo $beforeWidget; echo $beforeTitle . $title . $afterTitle; ShowBizOutput::putSlider($sliderID, $homepage, true); echo $afterWidget; }