本文整理汇总了PHP中JString::strtoupper方法的典型用法代码示例。如果您正苦于以下问题:PHP JString::strtoupper方法的具体用法?PHP JString::strtoupper怎么用?PHP JString::strtoupper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JString
的用法示例。
在下文中一共展示了JString::strtoupper方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: safe
/**
* Safe String. Remove no letter's, no number's and other's no allowed Signs.
*
* @param string $string String to safe
* @return string
*/
public static function safe($string)
{
static $items;
if (is_null($items)) {
$letters[] = 'abcdefghijklmnopqrstuvwxyz';
$letters[] = 'áćéǵíḱĺḿńóṕŕśúǘẃýź';
$letters[] = 'äëḧïöẗüẅẍÿ';
$letters[] = 'åůẘẙ';
$letters[] = 'ǎčďěǧȟǐǰǩľňǒřšťǔǚž';
$letters[] = '.-_ ';
$items = array();
foreach ($letters as $item) {
$items = array_merge($items, parent::str_split($item), parent::str_split(parent::strtoupper($item)));
}
$items = array_merge($items, parent::str_split('0123456789'));
}
$string = parent::str_split($string);
$safe = '';
foreach ($string as $item) {
if (in_array($item, $items)) {
$safe .= $item;
}
}
return parent::trim($safe);
}
示例2: display
function display($tpl = null)
{
JToolBarHelper::title(JText::_('Счета'), 'Bill');
JToolBarHelper::deleteList();
JToolBarHelper::editListX();
JToolBarHelper::addNewX();
JToolBarHelper::publishList();
JToolBarHelper::unpublishList();
$act = array();
$items =& $this->get('Data');
$users =& $this->get('users');
foreach ($users as $u) {
$act[$u->id] = $u->name;
}
$users = $act;
$profiles =& $this->get('profiles');
foreach ($profiles as $p) {
$act[$p->id] = $p->name;
}
$profiles = $act;
$this->assignRef('items', $items);
$this->assignRef('users', $users);
$this->assignRef('profiles', $profiles);
$pagination =& $this->get('Pagination');
$this->assignRef('pagination', $pagination);
global $option;
$apl = JFactory::getApplication();
$filter_order = $apl->getUserStateFromRequest($option . 'filter_order', 'filter_order', 'published');
$filter_order_Dir = JString::strtoupper($apl->getUserStateFromRequest($option . 'filter_order_Dir', 'filter_order_Dir', 'ASC'));
$lists = array();
$lists['order_Dir'] = $filter_order_Dir;
$lists['order'] = $filter_order;
$this->assignRef('lists', $lists);
parent::display($tpl);
}
示例3: getItemDetail
function getItemDetail($id)
{
$realtorModel = $this->getModel('realtors');
$row =& $realtorModel->getRowById($id);
if (!$row->id) {
return;
}
// combine name and short instruction (slogan)
// if ( !empty( $row->slogan ) )
// {
// $row->name .= " - " . $row->slogan;
// }
// set image default if no avatar
$avatar = JPATH_ROOT . DS . 'images' . DS . 'com_jea' . DS . 'images' . DS . 'realtors' . DS . $row->id . DS . 'avatar.jpg';
if (file_exists($avatar)) {
$row->avatar = JURI::root() . "images/com_jea/images/realtors/{$row->id}/avatar.jpg";
} else {
$row->avatar = JURI::root() . 'images/noimage.jpg';
}
// get mod search
$mod_search = JModuleHelper::getModule('jea_search', 'realtors_mod_search');
$attribs['style'] = 'search';
$mod_search->title = JText::_("REALTOR_MOD_SEARCH");
$row->mod_search = JModuleHelper::renderModule($mod_search, $attribs);
// get realtor's properties & assign to template
// $realtorListing = $realtorModel->getListingByRealtorId( $row->id );
//
// $templatePath = "templates/webkp/html/mod_jea_emphasis";
// $helperPath = "modules/mod_jea_emphasis";
//
// $listingTemplate = new JView();
// $listingTemplate->addTemplatePath($templatePath);
// $listingTemplate->addHelperPath($helperPath);
// $listingTemplate->loadHelper('helper');
//
// //$listingTemplate->assignRef('rows', $realtorListing);
// $listingTemplate->rows = &$realtorListing;
//
// $row->mod_realtors_properties = $listingTemplate->loadTemplate();
// $row->mod_realtors_properties = "chau test here";
$mod_properties = JModuleHelper::getModule('jea_emphasis', 'Realtor Properties');
$attribs['style'] = 'box8content';
$mod_properties->params .= "\n realtor_id={$row->id}";
$mod_properties->title = "DO " . JString::strtoupper($row->name);
$row->mod_realtors_properties = JModuleHelper::renderModule($mod_properties, $attribs);
// get concerned properties
$mod_same_properties = JModuleHelper::getModule('jea_emphasis', 'Realtor Same Properties');
$attribs['style'] = 'box8content';
$mod_same_properties->params .= "\n realtor_id={$row->id}";
$mod_same_properties->title = JText::_("REALTOR SAME PROPERTIES");
$row->mod_same_properties = JModuleHelper::renderModule($mod_same_properties, $attribs);
// get successful properties
$mod_successful_properties = JModuleHelper::getModule('jea_emphasis', 'Realtor Successful Properties');
$attribs['style'] = 'box8content';
$mod_successful_properties->params .= "\n realtor_id={$row->id}";
$mod_successful_properties->title = JText::_("REALTOR SUCCESSFUL PROPERTIES");
$row->mod_successful_properties = JModuleHelper::renderModule($mod_successful_properties, $attribs);
$this->assignRef('row', $row);
}
示例4: __construct
public function __construct(EasyBlogTableBlock &$block)
{
$this->type = $block->element;
$type = JString::strtoupper($this->type);
$this->title = JText::_('COM_EASYBLOG_BLOCKS_HANDLER_' . $type . '_TITLE');
$this->keywords = JText::_('COM_EASYBLOG_BLOCKS_HANDLER_' . $type . '_KEYWORDS');
$this->table = $block;
}
示例5: __construct
public function __construct(&$subject, $config = array())
{
parent::__construct($subject, $config);
$this->serviceProvider = 'PayPal Express';
$this->serviceAlias = 'paypalexpress';
$this->textPrefix .= '_' . \JString::strtoupper($this->serviceAlias);
$this->debugType .= '_' . \JString::strtoupper($this->serviceAlias);
}
示例6: apply
/**
* Save an existing or a new mood form POST
*/
public function apply()
{
CommunityLicenseHelper::_();
JRequest::checkToken() or jexit(JText::_('COM_COMMUNITY_INVALID_TOKEN'));
$mainframe = JFactory::getApplication();
$jinput = $mainframe->input;
$scss = $jinput->post->get('scss', null, 'array');
$settings = $jinput->post->get('settings', null, 'array');
if (JString::strtoupper($jinput->getMethod()) != 'POST') {
$mainframe->redirect('index.php?option=com_community&view=moods', JText::_('COM_COMMUNITY_PERMISSION_DENIED'), 'error');
}
if (!is_null($scss)) {
CommunityThemeHelper::parseScss($scss, 'general');
}
// Handle image uploads
$images['frontpage-image'] = $jinput->files->get('frontpage-image-new', '', 'NONE');
foreach ($images as $key => $image) {
if (!empty($image['tmp_name']) && isset($image['name']) && !empty($image['name'])) {
$imagePath = COMMUNITY_PATH_ASSETS;
// same as the image path
//check the file extension first and only allow jpg or png
$ext = strtolower(pathinfo($image['name'], PATHINFO_EXTENSION));
if (!in_array($ext, array('jpg', 'png')) || $image['type'] != 'image/png' && $image['type'] != 'image/jpeg') {
}
$imageJpg = $imagePath . '/' . $key . '.jpg';
$imagePng = $imagePath . '/' . $key . '.png';
//check if existing image exist, if yes, delete it
if (file_exists($imageJpg)) {
unlink($imageJpg);
}
if (file_exists($imagePng)) {
unlink($imagePng);
}
//let move the tmp image to the actual path
$finalPath = $imagePath . $key . '.' . $ext;
move_uploaded_file($image['tmp_name'], $finalPath);
require JPATH_ROOT . "/components/com_community/helpers/image.php";
CImageHelper::resizeProportional($finalPath, $finalPath, "image/{$ext}", 1000, 1000);
$settings[$key] = $ext;
}
}
// Parse settings finish
CommunityThemeHelper::parseSettings($settings, 'general');
$message = JText::_('COM_COMMUNITY_THEME_GENERAL_UPDATED');
$mainframe->redirect('index.php?option=com_community&view=themegeneral', $message, 'message');
// Get the view type
$document = JFactory::getDocument();
$viewType = $document->getType();
// Get the view
$viewName = JRequest::getCmd('view', 'community');
$view = $this->getView($viewName, $viewType);
$view->setLayout('edit');
$model = $this->getModel($viewName, 'CommunityAdminModel');
if ($model) {
$view->setModel($model, $viewName);
}
$view->display();
}
示例7: fromCSV
/**
* @param $value
* @param null $position
* @return Item|void
*/
public function fromCSV($value, $position = null)
{
$options = $this->_getArray($value, JBCSVItem::SEP_CELL);
foreach ($options as $key => $option) {
$options[$key] = JString::strtoupper($option);
}
$this->_element->bindData(array('country' => $options));
return $this->_item;
}
示例8: getRedirectUrl
/**
* Redirect to payment action
* @return null|string
*/
public function getRedirectUrl()
{
$order = $this->getOrder();
$payCurrency = $this->getDefaultCurrency();
$merchantUrl = $this->isDebug() ? $this->_testUrl : $this->_realUrl;
$orderAmount = $this->_order->val($this->getOrderSumm(), $order->getCurrency())->convert($payCurrency);
$fields = array('cmd' => '_xclick', 'no_shipping' => 1, 'rm' => 2, 'business' => JString::trim($this->config->get('email')), 'item_number' => $order->id, 'amount' => $orderAmount->val(), 'currency_code' => JString::strtoupper($payCurrency), 'return' => $this->_jbrouter->payment('success'), 'cancel_return' => $this->_jbrouter->payment('fail'), 'notify_url' => $this->_jbrouter->payment('callback'), 'item_name' => $this->getOrderDescription());
return $merchantUrl . '?' . $this->_jbrouter->query($fields);
}
示例9: isValid
/**
* Checks validation
* @return null|void
* @throws AppException
*/
public function isValid($params = array())
{
$crc = JString::trim(JString::strtoupper($_REQUEST["SignatureValue"]));
$myCrc = JString::trim(JString::strtoupper(md5(implode(':', array($_REQUEST['OutSum'], $this->getOrderId(), $this->config->get('password2'))))));
if ($crc === $myCrc) {
return true;
}
return false;
}
示例10: parserXMLDetails
function parserXMLDetails()
{
$arrayResult = array();
$arraylang = array();
$temp = null;
$fileDescription = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_imageshow' . DS . $this->_fileDescriptName;
$parserDescription = JFactory::getXMLParser('Simple');
$resultLoadFileDescription = $parserDescription->loadFile($fileDescription);
$documentDescription =& $parserDescription->document;
$nodeRealName =& $documentDescription->getElementByPath('name');
$nodVersion =& $documentDescription->getElementByPath('version');
$nodAuthor =& $documentDescription->getElementByPath('author');
$nodDate =& $documentDescription->getElementByPath('creationdate');
$nodLicense =& $documentDescription->getElementByPath('license');
$nodCopyright =& $documentDescription->getElementByPath('copyright');
$nodWebsite =& $documentDescription->getElementByPath('authorurl');
$languages =& $documentDescription->getElementByPath('languages');
$administration =& $documentDescription->getElementByPath('administration');
$nodEdition =& $documentDescription->getElementByPath('edition');
if ($administration != false) {
$submenu =& $administration->getElementByPath('submenu');
if ($submenu != false) {
$child = $submenu->children();
if (count($child) > 0) {
$arrayKey = array();
foreach ($child as $value) {
$keyValue = JString::strtoupper($value->data());
$arrayKey[] = $keyValue;
}
$arrayResult['menu'] = $arrayKey;
}
}
}
if ($nodAuthor != false && $nodVersion != false && $nodDate != false && $nodLicense != false && $nodCopyright != false && $nodWebsite != false && $nodeRealName != false) {
$arrayResult['realName'] = $nodeRealName->data();
$arrayResult['version'] = $nodVersion->data();
$arrayResult['author'] = $nodAuthor->data();
$arrayResult['date'] = $nodDate->data();
$arrayResult['license'] = $nodLicense->data();
$arrayResult['copyright'] = $nodCopyright->data();
$arrayResult['website'] = $nodWebsite->data();
$arrayResult['edition'] = $nodEdition != false ? $nodEdition->data() : '';
if ($languages != false && count($languages->children())) {
foreach ($languages->children() as $value) {
if ($temp != $value->attributes('tag')) {
$tag = $value->attributes('tag');
$arraylang[$tag] = $tag;
$temp = $tag;
}
}
}
$arrayResult['langs'] = $arraylang;
}
return $arrayResult;
}
示例11: check
function check()
{
$this->name = JString::trim($this->name);
$this->name = JString::str_ireplace('-', '', $this->name);
$this->name = JString::str_ireplace('.', '', $this->name);
$params = JComponentHelper::getParams('com_k2');
if ($params->get('k2TagNorm')) {
$searches = array('À', 'Á', 'Â', 'Ã', 'Ä', 'Å', 'à', 'á', 'â', 'ã', 'ä', 'å', 'Ā', 'ā', 'Ă', 'ă', 'Ą', 'ą', 'Ç', 'ç', 'Ć', 'ć', 'Ĉ', 'ĉ', 'Ċ', 'ċ', 'Č', 'č', 'Ð', 'ð', 'Ď', 'ď', 'Đ', 'đ', 'È', 'É', 'Ê', 'Ë', 'è', 'é', 'ê', 'ë', 'Ē', 'ē', 'Ĕ', 'ĕ', 'Ė', 'ė', 'Ę', 'ę', 'Ě', 'ě', 'Ĝ', 'ĝ', 'Ğ', 'ğ', 'Ġ', 'ġ', 'Ģ', 'ģ', 'Ĥ', 'ĥ', 'Ħ', 'ħ', 'Ì', 'Í', 'Î', 'Ï', 'ì', 'í', 'î', 'ï', 'Ĩ', 'ĩ', 'Ī', 'ī', 'Ĭ', 'ĭ', 'Į', 'į', 'İ', 'ı', 'Ĵ', 'ĵ', 'Ķ', 'ķ', 'ĸ', 'Ĺ', 'ĺ', 'Ļ', 'ļ', 'Ľ', 'ľ', 'Ŀ', 'ŀ', 'Ł', 'ł', 'Ñ', 'ñ', 'Ń', 'ń', 'Ņ', 'ņ', 'Ň', 'ň', 'ʼn', 'Ŋ', 'ŋ', 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', 'Ø', 'ò', 'ó', 'ô', 'õ', 'ö', 'ø', 'Ō', 'ō', 'Ŏ', 'ŏ', 'Ő', 'ő', 'Ŕ', 'ŕ', 'Ŗ', 'ŗ', 'Ř', 'ř', 'Ś', 'ś', 'Ŝ', 'ŝ', 'Ş', 'ş', 'Š', 'š', 'ſ', 'Ţ', 'ţ', 'Ť', 'ť', 'Ŧ', 'ŧ', 'Ù', 'Ú', 'Û', 'Ü', 'ù', 'ú', 'û', 'ü', 'Ũ', 'ũ', 'Ū', 'ū', 'Ŭ', 'ŭ', 'Ů', 'ů', 'Ű', 'ű', 'Ų', 'ų', 'Ŵ', 'ŵ', 'Ý', 'ý', 'ÿ', 'Ŷ', 'ŷ', 'Ÿ', 'Ź', 'ź', 'Ż', 'ż', 'Ž', 'ž', 'Ά', 'ά', 'Έ', 'έ', 'Ή', 'ή', 'Ί', 'ί', 'Ό', 'ό', 'Ύ', 'ύ', 'Ώ', 'ώ', 'ϋ', 'ϊ', 'ΐ');
$replacements = array('A', 'A', 'A', 'A', 'A', 'A', 'a', 'a', 'a', 'a', 'a', 'a', 'A', 'a', 'A', 'a', 'A', 'a', 'C', 'c', 'C', 'c', 'C', 'c', 'C', 'c', 'C', 'c', 'D', 'd', 'D', 'd', 'D', 'd', 'E', 'E', 'E', 'E', 'e', 'e', 'e', 'e', 'E', 'e', 'E', 'e', 'E', 'e', 'E', 'e', 'E', 'e', 'G', 'g', 'G', 'g', 'G', 'g', 'G', 'g', 'H', 'h', 'H', 'h', 'I', 'I', 'I', 'I', 'i', 'i', 'i', 'i', 'I', 'i', 'I', 'i', 'I', 'i', 'I', 'i', 'I', 'i', 'J', 'j', 'K', 'k', 'k', 'L', 'l', 'L', 'l', 'L', 'l', 'L', 'l', 'L', 'l', 'N', 'n', 'N', 'n', 'N', 'n', 'N', 'n', 'n', 'N', 'n', 'O', 'O', 'O', 'O', 'O', 'O', 'o', 'o', 'o', 'o', 'o', 'o', 'O', 'o', 'O', 'o', 'O', 'o', 'R', 'r', 'R', 'r', 'R', 'r', 'S', 's', 'S', 's', 'S', 's', 'S', 's', 's', 'T', 't', 'T', 't', 'T', 't', 'U', 'U', 'U', 'U', 'u', 'u', 'u', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'W', 'w', 'Y', 'y', 'y', 'Y', 'y', 'Y', 'Z', 'z', 'Z', 'z', 'Z', 'z', 'Α', 'α', 'Ε', 'ε', 'Η', 'η', 'Ι', 'ι', 'Ο', 'ο', 'Υ', 'υ', 'Ω', 'ω', 'υ', 'ι', 'ι');
$additionalReplacements = $params->get('k2TagNormAdditionalReplacements');
$pairs = @explode(',', $additionalReplacements);
if (is_array($pairs)) {
foreach ($pairs as $pair) {
@(list($search, $replace) = @explode('|', $pair));
if (isset($search) && $search && isset($replace) && $replace) {
$searches[] = $search;
$replacements[] = $replace;
}
}
}
//$this->name = JString::str_ireplace($searches, $replacements, $this->name); // This causes character stripping in J!1.5!!
$this->name = str_ireplace($searches, $replacements, $this->name);
// Switch case
if ($params->get('k2TagNormCase') == 'upper') {
$this->name = JString::strtoupper($this->name);
} else {
$this->name = JString::strtolower($this->name);
// Special case for Greek letter s final
$this->name = JString::str_ireplace('σ ', 'ς ', $this->name);
if (JString::substr($this->name, -1) == 'σ') {
$this->name = JString::substr($this->name, 0, -1);
$this->name .= 'ς';
}
}
}
$this->name = JString::trim($this->name);
if ($this->name == '') {
$this->setError(JText::_('K2_TAG_CANNOT_BE_EMPTY'));
return false;
}
if (strlen(utf8_decode($this->name)) < 2) {
$this->setError(JText::_('K2_TAG_CANNOT_BE_A_SINGLE_CHARACTER'));
return false;
}
// Check if tag exists already for new tags
if (!$this->id) {
$this->_db->setQuery("SELECT id FROM #__k2_tags WHERE name = " . $this->_db->Quote($this->name));
if ($this->_db->loadResult()) {
$this->setError(JText::_('K2_THIS_TAG_EXISTS_ALREADY'));
return false;
}
}
return true;
}
示例12: getListQuery
/**
* Get query to load full licenses list to browse table.
*
* @return string
*/
public function getListQuery()
{
$query = 'SELECT `lcs`.*, `edt`.`name` AS `editor`, `crt`.`name` AS `creator` ';
$query .= 'FROM `#__joomdoc_license` AS `lcs` ';
$query .= 'LEFT JOIN `#__users` AS `edt` ON `edt`.`id` = `lcs`.`checked_out` ';
$query .= 'LEFT JOIN `#__users` AS `crt` ON `crt`.`id` = `lcs`.`created_by` ';
if ($this->state->get(JOOMDOC_FILTER_KEYWORDS)) {
$query .= 'WHERE LOWER(`lcs`.`title`) LIKE ' . $this->_db->quote('%' . JString::strtolower($this->state->get(JOOMDOC_FILTER_KEYWORDS)) . '%') . ' ';
}
$query .= 'ORDER BY `' . $this->state->get(JOOMDOC_FILTER_ORDERING) . '` ' . JString::strtoupper($this->state->get(JOOMDOC_FILTER_DIRECTION));
return $query;
}
示例13: stringToJText
/**
* Process a string in a JOOMLA_TRANSLATION_STRING standard.
* This method processes a string and replaces all accented UTF-8 characters by unaccented
* ASCII-7 "equivalents" and the string is uppercase. Spaces replaced by underscore.
*
* @param string $string String to process
*
* @return string Processed string
*
* @since 1.0.0
*/
public static function stringToJText($string)
{
// Remove any '_' from the string since they will be used as concatenaters
$str = str_replace('_', ' ', $string);
$lang = JFactory::getLanguage();
$str = $lang->transliterate($str);
// Trim white spaces at beginning and end of translation string and make uppercase
$str = trim(JString::strtoupper($str));
// Remove any duplicate whitespace, and ensure all characters are alphanumeric
$str = preg_replace('/(\\s|[^A-Za-z0-9\\-])+/', '_', $str);
// Trim underscores at beginning and end of translation string
$str = trim($str, '_');
return $str;
}
示例14: addToolbar
/**
* Add the page title and toolbar.
*
*/
protected function addToolbar()
{
$canDo = JeaHelper::getActions();
$feature = $this->state->get('feature.name');
JToolBarHelper::title(JText::_(JString::strtoupper("com_jea_list_of_{$feature}_title")), 'jea.png');
if ($canDo->get('core.create')) {
JToolBarHelper::addNew('feature.add');
}
if ($canDo->get('core.edit')) {
JToolBarHelper::editList('feature.edit');
}
if ($canDo->get('core.delete')) {
JToolBarHelper::divider();
JToolBarHelper::deleteList(JText::_('COM_JEA_MESSAGE_CONFIRM_DELETE'), 'featurelist.delete');
}
}
示例15: getRedirectUrl
/**
* Redirect to payment form action
* @return null|string
*/
public function getRedirectUrl()
{
$order = $this->getOrder();
$orderId = $this->getOrderId();
$publicKey = JString::trim($this->config->get('public_key'));
$privateKey = JString::trim($this->config->get('private_key'));
$payCurrency = $this->getDefaultCurrency();
$orderAmount = $this->_order->val($this->getOrderSumm(), $order->getCurrency())->convert($payCurrency);
$data = array('version' => self::VERSION, 'amount' => $orderAmount->val(), 'currency' => JString::strtoupper($payCurrency), 'public_key' => $publicKey, 'description' => $this->getOrderDescription(), 'order_id' => $orderId, 'server_url' => $this->_jbrouter->payment('callback'), 'result_url' => $this->_jbrouter->payment('success') . '&orderId=' . $this->getOrderId());
if ($this->isDebug()) {
$data = array_merge($data, array('sandbox' => 1));
}
$dataEncode = base64_encode(json_encode($data));
$signature = base64_encode(sha1($privateKey . $dataEncode . $privateKey, 1));
return $this->_uri . '?' . $this->_jbrouter->query(array('data' => $dataEncode, 'signature' => $signature));
}