當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UniteFunctionsRev::throwError方法代碼示例

本文整理匯總了PHP中UniteFunctionsRev::throwError方法的典型用法代碼示例。如果您正苦於以下問題:PHP UniteFunctionsRev::throwError方法的具體用法?PHP UniteFunctionsRev::throwError怎麽用?PHP UniteFunctionsRev::throwError使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UniteFunctionsRev的用法示例。


在下文中一共展示了UniteFunctionsRev::throwError方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getControlFields

 /**
  * 
  * get fields that relevant for the control
  */
 public function getControlFields()
 {
     $arrControls = array();
     //get base elements array
     $arrBase = array();
     $arrBase["parent"] = (string) UniteFunctionsRev::getVal($this->element, 'parent');
     $arrBase["value"] = (string) UniteFunctionsRev::getVal($this->element, 'value');
     $arrBase["ctype"] = (string) UniteFunctionsRev::getVal($this->element, 'ctype');
     //validate fields:
     if (empty($arrBase["parent"])) {
         UniteFunctionsRev::throwError("The parent can't be empty in control");
     }
     if (empty($arrBase["value"])) {
         UniteFunctionsRev::throwError("The value can't be empty in control: {$arrBase['parent']}");
     }
     if (empty($arrBase["ctype"])) {
         UniteFunctionsRev::throwError("The ctype can't be empty in control: {$arrBase['parent']}");
     }
     //get children
     $strchild = (string) UniteFunctionsRev::getVal($this->element, 'child');
     //validate child
     if (empty($strchild)) {
         UniteFunctionsRev::throwError("The child can't be empty in control: {$arrBase['parent']}");
     }
     $strchild = trim($strchild);
     $children = explode(",", $strchild);
     foreach ($children as $child) {
         $arrControl = $arrBase;
         $arrControl["child"] = $child;
         $arrControls[] = $arrControl;
     }
     return $arrControls;
 }
開發者ID:DanyCan,項目名稱:wisten.github.io,代碼行數:37,代碼來源:control.php

示例2: getSliderID

 /**
  * 
  * get slider id
  */
 public function getSliderID()
 {
     $sliderID = JRequest::getCmd("id");
     if (empty($sliderID)) {
         UniteFunctionsRev::throwError("Slider ID url argument not found (id)");
     }
     return $sliderID;
 }
開發者ID:DanyCan,項目名稱:wisten.github.io,代碼行數:12,代碼來源:items.php

示例3: checkCopyCaptionsCssFile

 /**
  * 
  * check that captions file exists and if not - copy it to it's place.
  */
 private function checkCopyCaptionsCssFile()
 {
     if (file_exists(GlobalsUniteRev::$pathCaptionsCss) == false) {
         copy(GlobalsUniteRev::$pathCaptionsCssOriginal, GlobalsUniteRev::$pathCaptionsCss);
     }
     if (file_exists(GlobalsUniteRev::$pathCaptionsCss) == false) {
         UniteFunctionsRev::throwError("The captions file couldn't be copied to it's place: {GlobalsUniteRev::{$pathCaptionsCss}}, please copy it by hand from captions-original.css from the same folder, or turn to support.");
     }
 }
開發者ID:DanyCan,項目名稱:wisten.github.io,代碼行數:13,代碼來源:controller.php

示例4: update

 public function update($table, $arrItems, $where)
 {
     $response = $this->wpdb->update($table, $arrItems, $where);
     if ($response === false) {
         UniteFunctionsRev::throwError("no update action taken!");
     }
     $this->checkForErrors("Update query error");
     return $response;
 }
開發者ID:rinodung,項目名稱:opencart-15x-flat-admin,代碼行數:9,代碼來源:db.class.php

示例5: getFieldFromDB

 /**
  *
  * get field from db
  */
 public function getFieldFromDB($name)
 {
     $arr = $this->db->fetch(GlobalsRevSlider::$table_settings);
     if (empty($arr)) {
         return "";
     }
     $arr = $arr[0];
     if (array_key_exists($name, $arr) == false) {
         UniteFunctionsRev::throwError("The settings db should cotnain field: {$name}");
     }
     $value = $arr[$name];
     return $value;
 }
開發者ID:perseusl,項目名稱:kingdavid,代碼行數:17,代碼來源:revslider_params.class.php

示例6: isDBTableExists

 /**
  * 
  * check if some db table exists
  */
 public static function isDBTableExists($tableName)
 {
     global $wpdb;
     if (empty($tableName)) {
         UniteFunctionsRev::throwError("Empty table name!!!");
     }
     $sql = "show tables like '{$tableName}'";
     $table = $wpdb->get_var($sql);
     if ($table == $tableName) {
         return true;
     }
     return false;
 }
開發者ID:ashanrupasinghe,項目名稱:govforuminstalledlocal,代碼行數:17,代碼來源:functions_wordpress.class.php

示例7: displayMasterTemplate

 /**
  * 
  * display master template (master.php from tpl folder) 
  */
 private function displayMasterTemplate()
 {
     //each view has self controls
     UniteControlsRev::emptyControls();
     if (isset($this->form)) {
         UniteControlsRev::loadControlsFromForm($this->form);
     }
     $filepath = dirname(__FILE__) . "/tpl/master.php";
     if (!is_file($filepath)) {
         UniteFunctionsRev::throwError("master template not found: {$filepath}");
     }
     $arrControls = UniteControlsRev::getArrayForJsOutput();
     $jsonControls = json_encode($arrControls);
     //prepare content
     ob_start();
     require $filepath;
     $output = ob_get_contents();
     ob_end_clean();
     //output content
     echo $output;
 }
開發者ID:DanyCan,項目名稱:wisten.github.io,代碼行數:25,代碼來源:masterview.class.php

示例8: checkPurchaseVerification

 public function checkPurchaseVerification($data)
 {
     global $wp_version;
     $response = wp_remote_post('http://updates.themepunch.com/activate.php', array('user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo('url'), 'body' => array('name' => urlencode($data['username']), 'api' => urlencode($data['api_key']), 'code' => urlencode($data['code']), 'product' => urlencode('revslider'))));
     $response_code = wp_remote_retrieve_response_code($response);
     $version_info = wp_remote_retrieve_body($response);
     if ($response_code != 200 || is_wp_error($version_info)) {
         return false;
     }
     if ($version_info == 'valid') {
         update_option('revslider-valid', 'true');
         update_option('revslider-api-key', $data['api_key']);
         update_option('revslider-username', $data['username']);
         update_option('revslider-code', $data['code']);
         return true;
     } elseif ($version_info == 'exist') {
         UniteFunctionsRev::throwError(__('Purchase Code already registered!', REVSLIDER_TEXTDOMAIN));
     } else {
         return false;
     }
 }
開發者ID:misfist,項目名稱:missdrepants-network,代碼行數:21,代碼來源:revslider_operations.class.php

示例9: validateInited

 /**
  * 
  * validate that the slide is inited and the id exists.
  */
 private function validateInited()
 {
     if (empty($this->id)) {
         UniteFunctionsRev::throwError("The slide is not inited!!!");
     }
 }
開發者ID:ranrolls,項目名稱:ras-full-portal,代碼行數:10,代碼來源:revslider_slide.class.php

示例10: trimArrayItems

 /**
  * 
  * do "trim" operation on all array items.
  */
 public static function trimArrayItems($arr)
 {
     if (gettype($arr) != "array") {
         UniteFunctionsRev::throwError("trimArrayItems error: The type must be array");
     }
     foreach ($arr as $key => $item) {
         if (is_array($item)) {
             foreach ($item as $key => $value) {
                 $arr[$key][$key] = trim($value);
             }
         } else {
             $arr[$key] = trim($item);
         }
     }
     return $arr;
 }
開發者ID:AlexanderBogdan,項目名稱:poliplast,代碼行數:20,代碼來源:functions.class.php

示例11: updatePlugin

 /**
  * 
  * Enter description here ...
  */
 protected static function updatePlugin($viewBack = false)
 {
     $linkBack = self::getViewUrl($viewBack);
     $htmlLinkBack = UniteFunctionsRev::getHtmlLink($linkBack, "Go Back");
     //check if css table exist, if not, we need to verify that the current captions.css can be parsed
     if (UniteFunctionsWPRev::isDBTableExists(GlobalsRevSlider::TABLE_CSS_NAME)) {
         $captions = RevOperations::getCaptionsCssContentArray();
         if ($captions === false) {
             $message = "CSS parse error! Please make sure your captions.css is valid CSS before updating the plugin!";
             echo "<div style='color:#B80A0A;font-size:18px;'><b>Update Error: </b> {$message}</div><br>";
             echo $htmlLinkBack;
             exit;
         }
     }
     $zip = new UniteZipRev();
     try {
         if (function_exists("unzip_file") == false) {
             if (UniteZipRev::isZipExists() == false) {
                 UniteFunctionsRev::throwError("The ZipArchive php extension not exists, can't extract the update file. Please turn it on in php ini.");
             }
         }
         dmp("Update in progress...");
         $arrFiles = UniteFunctionsRev::getVal($_FILES, "update_file");
         if (empty($arrFiles)) {
             UniteFunctionsRev::throwError("Update file don't found.");
         }
         $filename = UniteFunctionsRev::getVal($arrFiles, "name");
         if (empty($filename)) {
             UniteFunctionsRev::throwError("Update filename not found.");
         }
         $fileType = UniteFunctionsRev::getVal($arrFiles, "type");
         /*				
         $fileType = strtolower($fileType);
         
         if($fileType != "application/zip")
         	UniteFunctionsRev::throwError("The file uploaded is not zip.");
         */
         $filepathTemp = UniteFunctionsRev::getVal($arrFiles, "tmp_name");
         if (file_exists($filepathTemp) == false) {
             UniteFunctionsRev::throwError("Can't find the uploaded file.");
         }
         //crate temp folder
         UniteFunctionsRev::checkCreateDir(self::$path_temp);
         //create the update folder
         $pathUpdate = self::$path_temp . "update_extract/";
         UniteFunctionsRev::checkCreateDir($pathUpdate);
         //remove all files in the update folder
         if (is_dir($pathUpdate)) {
             $arrNotDeleted = UniteFunctionsRev::deleteDir($pathUpdate, false);
             if (!empty($arrNotDeleted)) {
                 $strNotDeleted = print_r($arrNotDeleted, true);
                 UniteFunctionsRev::throwError("Could not delete those files from the update folder: {$strNotDeleted}");
             }
         }
         //copy the zip file.
         $filepathZip = $pathUpdate . $filename;
         $success = move_uploaded_file($filepathTemp, $filepathZip);
         if ($success == false) {
             UniteFunctionsRev::throwError("Can't move the uploaded file here: " . $filepathZip . ".");
         }
         if (function_exists("unzip_file") == true) {
             WP_Filesystem();
             $response = unzip_file($filepathZip, $pathUpdate);
         } else {
             $zip->extract($filepathZip, $pathUpdate);
         }
         //get extracted folder
         $arrFolders = UniteFunctionsRev::getFoldersList($pathUpdate);
         if (empty($arrFolders)) {
             UniteFunctionsRev::throwError("The update folder is not extracted");
         }
         if (count($arrFolders) > 1) {
             UniteFunctionsRev::throwError("Extracted folders are more then 1. Please check the update file.");
         }
         //get product folder
         $productFolder = $arrFolders[0];
         if (empty($productFolder)) {
             UniteFunctionsRev::throwError("Wrong product folder.");
         }
         if ($productFolder != self::$dir_plugin) {
             UniteFunctionsRev::throwError("The update folder don't match the product folder, please check the update file.");
         }
         $pathUpdateProduct = $pathUpdate . $productFolder . "/";
         //check some file in folder to validate it's the real one:
         $checkFilepath = $pathUpdateProduct . $productFolder . ".php";
         if (file_exists($checkFilepath) == false) {
             UniteFunctionsRev::throwError("Wrong update extracted folder. The file: " . $checkFilepath . " not found.");
         }
         //copy the plugin without the captions file.
         //$pathOriginalPlugin = $pathUpdate."copy/";
         $pathOriginalPlugin = self::$path_plugin;
         $arrBlackList = array();
         $arrBlackList[] = "rs-plugin/css/captions.css";
         $arrBlackList[] = "rs-plugin/css/dynamic-captions.css";
         $arrBlackList[] = "rs-plugin/css/static-captions.css";
         UniteFunctionsRev::copyDir($pathUpdateProduct, $pathOriginalPlugin, "", $arrBlackList);
//.........這裏部分代碼省略.........
開發者ID:pqzada,項目名稱:avispate,代碼行數:101,代碼來源:base_admin.class.php

示例12: getWPQuery

 /**
  * 
  * get meta query
  */
 public static function getWPQuery($filterType, $sortBy)
 {
     $dayMs = 60 * 60 * 24;
     $time = current_time('timestamp');
     $todayStart = strtotime(date('Y-m-d', $time));
     $todayEnd = $todayStart + $dayMs - 1;
     $tomorrowStart = $todayEnd + 1;
     $tomorrowEnd = $tomorrowStart + $dayMs - 1;
     //dmp(UniteFunctionsRev::timestamp2DateTime($tomorrowStart));exit();
     $start_month = strtotime(date('Y-m-1', $time));
     $end_month = strtotime(date('Y-m-t', $time)) + 86399;
     $next_month_middle = strtotime('+1 month', $time);
     //get the end of this month + 1 day
     $start_next_month = strtotime(date('Y-m-1', $next_month_middle));
     $end_next_month = strtotime(date('Y-m-t', $next_month_middle)) + 86399;
     $query = array();
     switch ($filterType) {
         case self::DEFAULT_FILTER:
             //none
             break;
         case "today":
             $query[] = array('key' => '_start_ts', 'value' => $todayEnd, 'compare' => '<=');
             $query[] = array('key' => '_end_ts', 'value' => $todayStart, 'compare' => '>=');
             break;
         case "future":
             $query[] = array('key' => '_start_ts', 'value' => $time, 'compare' => '>');
             break;
         case "tomorrow":
             $query[] = array('key' => '_start_ts', 'value' => $tomorrowEnd, 'compare' => '<=');
             $query[] = array('key' => '_end_ts', 'value' => $todayStart, 'compare' => '>=');
             break;
         case "past":
             $query[] = array('key' => '_end_ts', 'value' => $todayStart, 'compare' => '<');
             break;
         case "month":
             $query[] = array('key' => '_start_ts', 'value' => $end_month, 'compare' => '<=');
             $query[] = array('key' => '_end_ts', 'value' => $start_month, 'compare' => '>=');
             break;
         case "nextmonth":
             $query[] = array('key' => '_start_ts', 'value' => $end_next_month, 'compare' => '<=');
             $query[] = array('key' => '_end_ts', 'value' => $start_next_month, 'compare' => '>=');
             break;
         default:
             UniteFunctionsRev::throwError("Wrong event filter");
             break;
     }
     if (!empty($query)) {
         $response["meta_query"] = $query;
     }
     //convert sortby
     switch ($sortBy) {
         case "event_start_date":
             $response["orderby"] = "meta_value_num";
             $response["meta_key"] = "_start_ts";
             break;
         case "event_end_date":
             $response["orderby"] = "meta_value_num";
             $response["meta_key"] = "_end_ts";
             break;
     }
     return $response;
 }
開發者ID:naka211,項目名稱:myloyal,代碼行數:66,代碼來源:em_integration.class.php

示例13: drawCustomInputs

 /**
  * 
  * draw custom inputs for rev slider
  * @param $setting
  */
 protected function drawCustomInputs($setting)
 {
     $customType = UniteFunctionsRev::getVal($setting, "custom_type");
     switch ($customType) {
         case "slider_size":
             $this->drawSliderSize($setting);
             break;
         case "responsitive_settings":
             $this->drawResponsitiveSettings($setting);
             break;
         default:
             UniteFunctionsRev::throwError("No handler function for type: {$customType}");
             break;
     }
 }
開發者ID:naka211,項目名稱:myloyal,代碼行數:20,代碼來源:revslider_settings_product.class.php

示例14: validateWpmlExists

 /**
  * 
  * valdiate that wpml exists
  */
 private static function validateWpmlExists()
 {
     if (!self::isWpmlExists()) {
         UniteFunctionsRev::throwError("The wpml plugin don't exists");
     }
 }
開發者ID:shahadat014,項目名稱:geleyi,代碼行數:10,代碼來源:wpml.class.php

示例15: getSettings

 /**
  * 
  * get settings object
  */
 protected static function getSettings($key)
 {
     if (!isset(self::$arrSettings[$key])) {
         UniteFunctionsRev::throwError("Settings {$key} not found");
     }
     $settings = self::$arrSettings[$key];
     return $settings;
 }
開發者ID:ConceptHaus,項目名稱:huasca,代碼行數:12,代碼來源:base_admin.class.php


注:本文中的UniteFunctionsRev::throwError方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。