当前位置: 首页>>代码示例>>PHP>>正文


PHP vRequest::filterUword方法代码示例

本文整理汇总了PHP中vRequest::filterUword方法的典型用法代码示例。如果您正苦于以下问题:PHP vRequest::filterUword方法的具体用法?PHP vRequest::filterUword怎么用?PHP vRequest::filterUword使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vRequest的用法示例。


在下文中一共展示了vRequest::filterUword方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: check

 /**
  * @author Max Milbers
  * @param
  */
 function check()
 {
     if (!empty($this->_slugAutoName)) {
         $slugAutoName = $this->_slugAutoName;
         $slugName = $this->_slugName;
         if (in_array($slugAutoName, $this->_translatableFields)) {
             $checkTable = $this->_tbl_lang;
             vmTrace('Language table in normal check?');
         } else {
             $checkTable = $this->_tbl;
         }
         if (empty($this->{$slugName})) {
             // 				vmdebug('table check use _slugAutoName '.$slugAutoName.' '.$slugName);
             if (!empty($this->{$slugAutoName})) {
                 $this->{$slugName} = $this->{$slugAutoName};
             } else {
                 $pkey = $this->_pkey;
                 vmError('VmTable ' . $checkTable . ' Check not passed. Neither slug nor obligatory value at ' . $slugAutoName . ' for auto slug creation is given ' . $this->{$pkey});
                 return false;
             }
         }
         //if (JVM_VERSION === 1) $this->$slugName = JFilterOutput::stringURLSafe($this->$slugName);
         //else $this->$slugName = JApplication::stringURLSafe($this->$slugName);
         //pro+#'!"§$%&/()=?duct-w-| ||cu|st|omfield-|str<ing>
         //vmdebug('my slugName '.$slugName,$this->$slugName);
         $this->{$slugName} = str_replace('-', ' ', $this->{$slugName});
         $this->{$slugName} = html_entity_decode($this->{$slugName}, ENT_QUOTES);
         //$config =& JFactory::getConfig();
         //$transliterate = $config->get('unicodeslugs');
         $unicodeslugs = tsmConfig::get('transliterateSlugs', false);
         if ($unicodeslugs) {
             $lang = JFactory::getLanguage();
             $this->{$slugName} = $lang->transliterate($this->{$slugName});
         }
         // Trim white spaces at beginning and end of alias and make lowercase
         $this->{$slugName} = trim(JString::strtolower($this->{$slugName}));
         $this->{$slugName} = str_replace(array('`', '´', "'"), '', $this->{$slugName});
         $this->{$slugName} = vRequest::filterUword($this->{$slugName}, '-,_,|', '-');
         while (strpos($this->{$slugName}, '--')) {
             $this->{$slugName} = str_replace('--', '-', $this->{$slugName});
         }
         // Trim dashes at beginning and end of alias
         $this->{$slugName} = trim($this->{$slugName}, '-');
         if ($unicodeslugs) {
             $this->{$slugName} = rawurlencode($this->{$slugName});
         }
         $valid = $this->checkCreateUnique($checkTable, $slugName);
         //vmdebug('my Final slugName '.$slugName,$this->$slugName);
         if (!$valid) {
             return false;
         }
     }
     foreach ($this->_obkeys as $obkeys => $error) {
         if (empty($this->{$obkeys})) {
             $error = get_class($this) . ' ' . tsmText::sprintf('com_tsmart_STRING_ERROR_OBLIGATORY_KEY', 'com_tsmart_' . strtoupper($obkeys));
             vmError($error);
             return false;
         }
     }
     if ($this->_unique) {
         if (empty($this->_db)) {
             $this->_db = JFactory::getDBO();
         }
         foreach ($this->_unique_name as $obkeys => $error) {
             if (empty($this->{$obkeys})) {
                 $error = tsmText::sprintf('com_tsmart_STRING_ERROR_NOT_UNIQUE_NAME', 'com_tsmart_' . strtoupper($obkeys));
                 vmError('Non unique ' . $this->_unique_name . ' ' . $error);
                 return false;
             } else {
                 $valid = $this->checkCreateUnique($this->_tbl, $obkeys);
                 if (!$valid) {
                     return false;
                 }
             }
         }
     }
     if (property_exists($this, 'tsmart_vendor_id')) {
         if (empty($this->tsmart_vendor_id) and $this->_pkey == 'tsmart_vendor_id') {
             $this->tsmart_vendor_id = $this->_pvalue;
         }
         $multix = tsmConfig::get('multix', 'none');
         //Lets check if the user is admin or the mainvendor
         $tsmart_vendor_id = false;
         //Todo removed Quickn Dirty, use check in derived class
         if ($multix == 'none' and get_class($this) !== 'TableVmusers') {
             $this->tsmart_vendor_id = 1;
             return true;
         } else {
             $loggedVendorId = vmAccess::isSuperVendor();
             $user = JFactory::getUser();
             $tbl_key = $this->_tbl_key;
             $className = get_class($this);
             $admin = vmAccess::manager('managevendors');
             //Todo removed Quickn Dirty, use check in derived class
             if (strpos($this->_tbl, 'tsmart_vmusers') === FALSE) {
                 $q = 'SELECT `tsmart_vendor_id` FROM `' . $this->_tbl . '` WHERE `' . $this->_tbl_key . '`="' . $this->{$tbl_key} . '" ';
//.........这里部分代码省略.........
开发者ID:cuongnd,项目名称:etravelservice,代码行数:101,代码来源:tsmtable.php

示例2: check

 /**
  * @author Max Milbers
  * @param
  */
 function check()
 {
     if (!empty($this->_slugAutoName)) {
         $slugAutoName = $this->_slugAutoName;
         $slugName = $this->_slugName;
         if (in_array($slugAutoName, $this->_translatableFields)) {
             $checkTable = $this->_tbl . '_' . VmConfig::$vmlang;
         } else {
             $checkTable = $this->_tbl;
         }
         if (empty($this->{$slugName})) {
             // 				vmdebug('table check use _slugAutoName '.$slugAutoName.' '.$slugName);
             if (!empty($this->{$slugAutoName})) {
                 $this->{$slugName} = $this->{$slugAutoName};
             } else {
                 vmError('VmTable ' . $checkTable . ' Check not passed. Neither slug nor obligatory value at ' . $slugAutoName . ' for auto slug creation is given');
                 return false;
             }
         }
         //if (JVM_VERSION === 1) $this->$slugName = JFilterOutput::stringURLSafe($this->$slugName);
         //else $this->$slugName = JApplication::stringURLSafe($this->$slugName);
         //pro+#'!"§$%&/()=?duct-w-| ||cu|st|omfield-|str<ing>
         //vmdebug('my slugName '.$slugName,$this->$slugName);
         $this->{$slugName} = str_replace('-', ' ', $this->{$slugName});
         //$config =& JFactory::getConfig();
         //$transliterate = $config->get('unicodeslugs');
         $unicodeslugs = VmConfig::get('transliterateSlugs', false);
         if ($unicodeslugs) {
             $lang = JFactory::getLanguage();
             $this->{$slugName} = $lang->transliterate($this->{$slugName});
         }
         // Trim white spaces at beginning and end of alias and make lowercase
         $this->{$slugName} = trim(JString::strtolower($this->{$slugName}));
         $this->{$slugName} = str_replace(array('`', '´', "'"), '', $this->{$slugName});
         $this->{$slugName} = vRequest::filterUword($this->{$slugName}, '-,_,|', '-');
         while (strpos($this->{$slugName}, '--')) {
             $this->{$slugName} = str_replace('--', '-', $this->{$slugName});
         }
         // Trim dashes at beginning and end of alias
         $this->{$slugName} = trim($this->{$slugName}, '-');
         if ($unicodeslugs) {
             $this->{$slugName} = rawurlencode($this->{$slugName});
         }
         $valid = $this->checkCreateUnique($checkTable, $slugName);
         //vmdebug('my Final slugName '.$slugName,$this->$slugName);
         if (!$valid) {
             return false;
         }
     }
     foreach ($this->_obkeys as $obkeys => $error) {
         if (empty($this->{$obkeys})) {
             if (empty($error)) {
                 $error = 'Serious error cant save ' . $this->_tbl . ' without ' . $obkeys;
             } else {
                 //	$error = get_class($this).' '.vmText::_($error);
                 $error = get_class($this) . ' ' . $error;
             }
             $this->setError($error);
             vmError($error);
             return false;
         }
     }
     if ($this->_unique) {
         if (empty($this->_db)) {
             $this->_db = JFactory::getDBO();
         }
         foreach ($this->_unique_name as $obkeys => $error) {
             if (empty($this->{$obkeys})) {
                 // 					vmError(vmText::sprintf('COM_VIRTUEMART_NON_UNIQUE_KEY',$this->$obkeys));
                 $this->setError($error);
                 vmError('Non unique ' . $this->_unique_name . ' ' . $error);
                 return false;
             } else {
                 $valid = $this->checkCreateUnique($this->_tbl, $obkeys);
                 if (!$valid) {
                     return false;
                 }
             }
         }
     }
     if (isset($this->virtuemart_vendor_id)) {
         $multix = Vmconfig::get('multix', 'none');
         //Lets check if the user is admin or the mainvendor
         $virtuemart_vendor_id = false;
         if ($multix == 'none' and get_class($this) !== 'TableVmusers') {
             $this->virtuemart_vendor_id = 1;
             return true;
         } else {
             $loggedVendorId = Permissions::getInstance()->isSuperVendor();
             $user = JFactory::getUser();
             $admin = $user->authorise('core.admin', 'com_virtuemart');
             $tbl_key = $this->_tbl_key;
             $className = get_class($this);
             if (strpos($this->_tbl, 'virtuemart_vmusers') === FALSE) {
                 $q = 'SELECT `virtuemart_vendor_id` FROM `' . $this->_tbl . '` WHERE `' . $this->_tbl_key . '`="' . $this->{$tbl_key} . '" ';
                 if (!isset(self::$_cache[md5($q)])) {
//.........这里部分代码省略.........
开发者ID:juanmcortez,项目名称:Lectorum,代码行数:101,代码来源:vmtable.php

示例3: sanitize

 function sanitize($string)
 {
     $string = $this->replaceNonAsciiCharacters($string);
     $string = vRequest::filterUword($string, ' ');
     return $string;
 }
开发者ID:virtuemart-fr,项目名称:virtuemart-fr,代码行数:6,代码来源:helper.php


注:本文中的vRequest::filterUword方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。