textButton; if(empty($buttonText)) $buttonText = esc_html__("Save Settings", "unlimited-elements-for-elementor"); $addParams = ""; if($this->isModeCustomSettings == true) $addParams = " data-settingskey='{$this->customSettingsKey}'"; ?>
headerTitle)) UniteFunctionsUC::throwError("Please init the header title variable"); if($this->isModeCustomSettings == true){ UniteFunctionsUC::validateNotEmpty($this->customSettingsKey, "Custom settings key"); UniteFunctionsUC::validateNotEmpty($this->customSettingsXmlFile, "Custom settings xml file"); } if(empty($this->saveAction)) UniteFunctionsUC::throwError("Please init the save action"); if(empty($this->objSettings)) UniteFunctionsUC::throwError("Please init the settings object"); } /** * modify custom settings - function for override */ protected function modifyCustomSettings($settings){ return($settings); } /** * init the custom mode */ protected function initCustomMode(){ $this->saveAction = "save_custom_settings"; UniteFunctionsUC::validateNotEmpty($this->customSettingsXmlFile,"xml file( customSettingsXmlFile variable)"); $this->objSettings = new UniteCreatorSettings(); $this->objSettings->loadXMLFile($this->customSettingsXmlFile); $arrValues = HelperUC::$operations->getCustomSettingsValues($this->customSettingsKey); if(!empty($arrValues)) $this->objSettings->setStoredValues($arrValues); $this->objSettings = $this->modifyCustomSettings($this->objSettings); } /** * add scripts */ protected function addScripts(){ HelperUC::addScript("unitecreator_admin_generalsettings", "unitecreator_admin_generalsettings"); } /** * display settings */ protected function display(){ $this->addScripts(); if($this->isModeCustomSettings == true) $this->initCustomMode(); $this->validateInited(); //show header if($this->showHeader == true){ $headerTitle = $this->headerTitle; require HelperUC::getPathTemplate("header"); }else require HelperUC::getPathTemplate("header_missing"); $objSettings = $this->objSettings; //get saps $arrSaps = $objSettings->getArrSaps(); $formID = "uc_general_settings"; $objOutput = new UniteSettingsOutputWideUC(); $objOutput->init($objSettings); $objOutput->setFormID($formID); $randomString = UniteFunctionsUC::getRandomString(5, true); require HelperUC::getPathTemplate("settings"); } }