• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP JString类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: appFullView

 /**
  * Application full view
  **/
 function appFullView()
 {
     $document =& JFactory::getDocument();
     $this->showSubmenu();
     $applicationName = JString::strtolower(JRequest::getVar('app', '', 'GET'));
     if (empty($applicationName)) {
         JError::raiseError(500, 'CC APP ID REQUIRED');
     }
     if (!$this->accessAllowed('registered')) {
         return;
     }
     $output = '';
     //@todo: Since group walls doesn't use application yet, we process it manually now.
     if ($applicationName == 'walls') {
         CFactory::load('libraries', 'wall');
         $jConfig = JFactory::getConfig();
         $limit = $jConfig->get('list_limit');
         $limitstart = JRequest::getVar('limitstart', 0, 'REQUEST');
         $eventId = JRequest::getVar('eventid', '', 'GET');
         $my = CFactory::getUser();
         $config = CFactory::getConfig();
         $eventsModel = CFactory::getModel('Events');
         $event =& JTable::getInstance('Event', 'CTable');
         $event->load($eventId);
         $config = CFactory::getConfig();
         $document->setTitle(JText::sprintf('CC EVENTS WALL TITLE', $event->title));
         CFactory::load('helpers', 'owner');
         $guest = $event->isMember($my->id);
         $waitingApproval = $event->isPendingApproval($my->id);
         $status = $event->getUserStatus($my->id);
         $responded = $status == COMMUNITY_EVENT_STATUS_ATTEND || $status == COMMUNITY_EVENT_STATUS_WONTATTEND || $status == COMMUNITY_EVENT_STATUS_MAYBE;
         if (!$config->get('lockeventwalls') || $config->get('lockeventwalls') && $guest && !$waitingApproval && $responded || COwnerHelper::isCommunityAdmin()) {
             $output .= CWallLibrary::getWallInputForm($event->id, 'events,ajaxSaveWall', 'events,ajaxRemoveWall');
             // Get the walls content
             $output .= '<div id="wallContent">';
             $output .= CWallLibrary::getWallContents('events', $event->id, $event->isAdmin($my->id), 0, $limitstart, 'wall.content', 'events,events');
             $output .= '</div>';
             jimport('joomla.html.pagination');
             $wallModel = CFactory::getModel('wall');
             $pagination = new JPagination($wallModel->getCount($event->id, 'events'), $limitstart, $limit);
             $output .= '<div class="pagination-container">' . $pagination->getPagesLinks() . '</div>';
         }
     } else {
         CFactory::load('libraries', 'apps');
         $model = CFactory::getModel('apps');
         $applications =& CAppPlugins::getInstance();
         $applicationId = $model->getUserApplicationId($applicationName);
         $application = $applications->get($applicationName, $applicationId);
         if (!$application) {
             JError::raiseError(500, 'CC APPLICATION NOT FOUND');
         }
         // Get the parameters
         $manifest = JPATH_PLUGINS . DS . 'community' . DS . $applicationName . DS . $applicationName . '.xml';
         $params = new JParameter($model->getUserAppParams($applicationId), $manifest);
         $application->params =& $params;
         $application->id = $applicationId;
         $output = $application->onAppDisplay($params);
     }
     echo $output;
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:63,代码来源:view.html.php


示例2: getTrans

 /**
  * Get language items and store them in an array
  *
  */
 function getTrans($lang, $item)
 {
     $app = JFactory::getApplication();
     $option = 'com_osmembership';
     $registry = new JRegistry();
     $languages = array();
     if (strpos($item, 'admin.') !== false) {
         $isAdmin = true;
         $item = substr($item, 6);
     } else {
         $isAdmin = false;
     }
     if ($isAdmin) {
         $path = JPATH_ROOT . '/administrator/language/en-GB/en-GB.' . $item . '.ini';
     } else {
         $path = JPATH_ROOT . '/language/en-GB/en-GB.' . $item . '.ini';
     }
     $registry->loadFile($path, 'INI');
     $languages['en-GB'][$item] = $registry->toArray();
     if ($isAdmin) {
         $path = JPATH_ROOT . '/administrator/language/' . $lang . '/' . $lang . '.' . $item . '.ini';
     } else {
         $path = JPATH_ROOT . '/language/' . $lang . '/' . $lang . '.' . $item . '.ini';
     }
     $search = $app->getUserStateFromRequest($option . 'search', 'search', '', 'string');
     $search = JString::strtolower($search);
     if (JFile::exists($path)) {
         $registry->loadFile($path, 'INI');
         $languages[$lang][$item] = $registry->toArray();
     } else {
         $languages[$lang][$item] = array();
     }
     return $languages;
 }
开发者ID:vstorm83,项目名称:propertease,代码行数:38,代码来源:language.php


示例3: displayItems

 function displayItems()
 {
     $model = $this->getModel('logs');
     $lists = $model->getvar();
     $filter_order = $lists['filter_order'];
     $filter_order_Dir = $lists['filter_order_Dir'];
     $limit = $lists['limit'];
     $limitstart = $lists['limitstart'];
     $search = $lists['search'];
     $search = JString::strtolower($search);
     $where = $model->getWhereClause($lists);
     //echo $where;
     //order by
     $orderby = '  ORDER BY ' . $filter_order . ' ' . $filter_order_Dir;
     $total = $model->getItems($where, 1);
     //limit
     if ($limit > $total) {
         $limitstart = 0;
     }
     if ($limit == 0) {
         $limit = $total;
     }
     $limited = "  LIMIT " . $limitstart . ',' . $limit;
     jimport('joomla.html.pagination');
     $pageNav = new JPagination($total, $lists['limitstart'], $lists['limit']);
     $items = $model->getItems($where, 0, $orderby, $limited);
     $this->assign('items', $items);
     $this->assign('lists', $lists);
     $this->assign('pageNav', $pageNav);
 }
开发者ID:jomsocial,项目名称:JSVoice,代码行数:30,代码来源:view.html.php


示例4: render

 /**
  * @param array $params
  * @return array|mixed|null|string
  */
 public function render($params = array())
 {
     if (!$this->hasValue($params)) {
         return $this->renderWrapper();
     }
     $prices = $this->getPrices();
     $discount = JBCart::val();
     $curList = $discount->getCurList();
     if ($prices['save']->isNegative()) {
         $discount->set($prices['save']->val(), $prices['save']->cur());
     }
     /** @type JBCartValue $total */
     $total = $prices['total'];
     $message = JText::_(JString::trim($params->get('empty_text', '')));
     $layout = $params->get('layout', 'full-div');
     if ($total->isEmpty() && !empty($message)) {
         $layout = 'empty';
     }
     if ($layout == 'totla-cur' && isset($curList[$total->cur()])) {
         unset($curList[$total->cur()]);
     }
     unset($curList[JBCartValue::DEFAULT_CODE]);
     if ($layout = $this->getLayout($layout . '.php')) {
         return $this->renderLayout($layout, array('total' => $total, 'price' => $prices['price'], 'save' => $prices['save']->abs(true), 'discount' => $discount->abs(), 'currency' => $this->currency(), 'curList' => $curList, 'message' => $message));
     }
     return null;
 }
开发者ID:alexmixaylov,项目名称:real,代码行数:31,代码来源:value.php


示例5: getThumbnail

 public function getThumbnail($obj)
 {
     $config = CFactory::getConfig();
     $file = $obj->thumb;
     // Site origin
     if (JString::substr($file, 0, 4) == 'http') {
         $uri = $file;
         return $uri;
     }
     // Remote storage
     if ($obj->storage != 'file') {
         $storage = CStorage::getStorage($obj->storage);
         $uri = $storage->getURI($file);
         return $uri;
     }
     // Default thumbnail
     if (empty($file) || !JFile::exists(JPATH_ROOT . '/' . $file)) {
         $template = new CTemplateHelper();
         $asset = $template->getTemplateAsset('video_thumb.png', 'images');
         $uri = $asset->url;
         return $uri;
     }
     // Strip cdn path if exists.
     // Note: At one point, cdn path was stored along with the thumbnail path
     //       in the db which is the mistake we are trying to rectify here.
     $file = str_ireplace($config->get('videocdnpath'), '', $file);
     // CDN or local
     $baseUrl = $config->get('videobaseurl') or $baseUrl = JURI::root();
     $uri = str_replace('\\', '/', rtrim($baseUrl, '/') . '/' . ltrim($file, '/'));
     return $uri;
 }
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:31,代码来源:view.html.php


示例6: configure

 /**
  * Tareas comunes a pantalla de listas
  *
  */
 function configure()
 {
     $option = JRequest::getCMD('option');
     $mainframe = JFactory::getApplication();
     // orden
     $filter_order = $mainframe->getUserStateFromRequest($this->_context . 'filter_order', 'filter_order', $this->_orderfield, 'cmd');
     $filter_order_Dir = $mainframe->getUserStateFromRequest($this->_context . 'filter_order_Dir', 'filter_order_Dir', 'asc', 'word');
     // cadena de búsqueda
     $search = $mainframe->getUserStateFromRequest($this->_context . 'search', 'search', '', 'string');
     $search = JString::strtolower($search);
     // Configuramos el modelo
     $model =& $this->getModel();
     $model->_orderby_filter_order = $filter_order;
     $model->_orderby_filter_order_dir = $filter_order_Dir;
     // seteamos búsqueda en el modelo
     $db = JFactory::getDBO();
     if ($search) {
         $model->setWhere('LOWER(' . $this->_searchfield . ') LIKE ' . $db->Quote('%' . $db->getEscaped($search, true) . '%', false));
     }
     // table ordering
     $this->_lists['order_Dir'] = $filter_order_Dir;
     $this->_lists['order'] = $filter_order;
     $this->_lists['search'] = $search;
     $this->assignRef('lists', $this->_lists);
 }
开发者ID:BGCX261,项目名称:zonales-svn-to-git,代码行数:29,代码来源:baseview.php


示例7: check

 function check()
 {
     if (JString::trim($this->url) != '' && substr($this->url, 0, 7) != 'http://') {
         $this->url = 'http://' . $this->url;
     }
     return true;
 }
开发者ID:Gskflute,项目名称:joomla25,代码行数:7,代码来源:k2user.php


示例8: check

 function check()
 {
     //initialize
     $this->_error = null;
     $this->oldurl = JString::trim($this->oldurl);
     $this->newurl = JString::trim($this->newurl);
     // check for valid URLs
     if ($this->oldurl == '' || $this->newurl == '') {
         $this->_error .= JTExt::_('COM_SH404SEF_EMPTYURL');
         return false;
     }
     if (JString::substr($this->oldurl, 0, 1) == '/') {
         $this->_error .= JText::_('COM_SH404SEF_NOLEADSLASH');
     }
     if (JString::substr($this->newurl, 0, 9) != 'index.php') {
         $this->_error .= JText::_('COM_SH404SEF_BADURL');
     }
     // V 1.2.4.t remove this check. We check for pre-existing non-sef instead of SEF
     if (is_null($this->_error)) {
         // check for existing URLS
         $this->_db->setQuery("SELECT id,oldurl FROM #__sh404sef_urls WHERE `newurl` LIKE " . $this->_db->Quote($this->newurl));
         $xid = $this->_db->loadObject();
         // V 1.3.1 don't raise error if both newurl and old url are same. It means we may have changed alias list
         if ($xid && $xid->id != intval($this->id)) {
             $this->_error = JText::_('COM_SH404SEF_URLEXIST');
             return false;
         }
         $identical = $xid->id == intval($this->id) && $xid->oldurl == $this->oldurl;
         return $identical ? 'identical' : true;
     } else {
         return false;
     }
 }
开发者ID:lautarodragan,项目名称:ideary,代码行数:33,代码来源:shMosSEF.class.php


示例9: _buildContentWhere

 function _buildContentWhere()
 {
     global $mainframe, $option;
     $db =& JFactory::getDBO();
     $where = null;
     $filterState = $mainframe->getUserStateFromRequest('com_imageshow.showcase.filter_state', 'filter_state', '', 'word');
     $filter_order = $mainframe->getUserStateFromRequest('com_imageshow.showcase.filter_order', 'filter_order', '', 'cmd');
     $filter_order_Dir = $mainframe->getUserStateFromRequest('com_imageshow.showcase.filter_order_Dir', 'filter_order_Dir', '', 'word');
     $showcaseTitle = $mainframe->getUserStateFromRequest('com_imageshow.showcase.showcase_title', 'showcase_title', '', 'string');
     $showcaseTitle = JString::strtolower($showcaseTitle);
     if ($showcaseTitle) {
         $where[] = 'LOWER(showcase_title) LIKE ' . $db->Quote('%' . $db->getEscaped($showcaseTitle, true) . '%', false);
     }
     if ($filterState) {
         if ($filterState == 'P') {
             $where[] = 'published = 1';
         } else {
             if ($filterState == 'U') {
                 $where[] = 'published = 0';
             }
         }
     }
     $where = count($where) ? ' WHERE ' . implode(' AND ', $where) : '';
     return $where;
 }
开发者ID:sangkasi,项目名称:joomla,代码行数:25,代码来源:showcases.php


示例10: _buildContentWhere

 function _buildContentWhere()
 {
     global $mainframe;
     $context = 'com_phocagallery.phocagallery.list.';
     $filter_state = $mainframe->getUserStateFromRequest($context . 'filter_state', 'filter_state', '', 'word');
     $filter_catid = $mainframe->getUserStateFromRequest($context . 'filter_catid', 'filter_catid', 0, 'int');
     $filter_order = $mainframe->getUserStateFromRequest($context . 'filter_order', 'filter_order', 'a.ordering', 'cmd');
     $filter_order_Dir = $mainframe->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', '', 'word');
     $search = $mainframe->getUserStateFromRequest($context . 'search', 'search', '', 'string');
     $search = JString::strtolower($search);
     $where = array();
     if ($filter_catid > 0) {
         $where[] = 'a.catid = ' . (int) $filter_catid;
     }
     if ($search) {
         $where[] = 'LOWER(a.title) LIKE ' . $this->_db->Quote('%' . $search . '%');
     }
     if ($filter_state) {
         if ($filter_state == 'P') {
             $where[] = 'a.published = 1';
         } else {
             if ($filter_state == 'U') {
                 $where[] = 'a.published = 0';
             }
         }
     }
     $where = count($where) ? ' WHERE ' . implode(' AND ', $where) : '';
     return $where;
 }
开发者ID:RangerWalt,项目名称:ecci,代码行数:29,代码来源:phocagallerycos.php


示例11: execute

 public function execute($item, $calendar)
 {
     $model = FD::model('comments');
     $users = $model->getParticipants($item->uid, $item->context_type);
     // Include the notification actor
     $users[] = $item->actor_id;
     // Exclude the current user
     $users = array_values(array_unique(array_diff($users, array(FD::user()->id))));
     $names = FD::string()->namesToNotifications($users);
     $plurality = count($users) > 1 ? '_PLURAL' : '_SINGULAR';
     $content = '';
     if (count($users) == 1 && !empty($item->content)) {
         $content = JString::substr(strip_tags($item->content), 0, 30);
         if (JString::strlen($item->content) > 30) {
             $content .= JText::_('COM_EASYSOCIAL_ELLIPSES');
         }
     }
     $item->content = $content;
     if ($calendar->user_id == $item->target_id && $item->target_type == SOCIAL_TYPE_USER) {
         $item->title = JText::sprintf('APP_USER_CALENDAR_USER_COMMENTED_ON_YOUR_EVENT' . $plurality, $names);
         return $item;
     }
     if ($calendar->user_id == $item->actor_id && count($users) == 1) {
         $item->title = JText::sprintf('APP_USER_CALENDAR_OWNER_COMMENTED_ON_EVENT' . FD::user($calendar->user_id)->getGendarLang(), $names);
         return $item;
     }
     $item->title = JText::sprintf('APP_USER_CALENDAR_USER_COMMENTED_ON_USER_EVENT' . $plurality, $names, FD::user($calendar->user_id)->getName());
     return $item;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:29,代码来源:notification.comments.php


示例12: transliterate

 public static function transliterate($string)
 {
     switch (uk_UALocalise::simple_detect_language($string)) {
         case 'ru':
             $str = JString::strtolower($string);
             $glyph_array = array('a' => 'а', 'b' => 'б', 'v' => 'в', 'g' => 'г,ґ', 'd' => 'д', 'e' => 'е,є,э', 'jo' => 'ё', 'zh' => 'ж', 'z' => 'з', 'i' => 'и,і', 'ji' => 'ї', 'j' => 'й', 'k' => 'к', 'l' => 'л', 'm' => 'м', 'n' => 'н', 'o' => 'о', 'p' => 'п', 'r' => 'р', 's' => 'с', 't' => 'т', 'u' => 'у', 'f' => 'ф', 'kh' => 'х', 'ts' => 'ц', 'ch' => 'ч', 'sh' => 'ш', 'shch' => 'щ', '' => 'ъ', 'y' => 'ы', '' => 'ь', 'yu' => 'ю', 'ya' => 'я', '' => '—', '' => '!', '' => '?', '' => ':', '' => ';', '' => ',', '' => '’', '' => '\'', '' => '--', '' => '.', '' => '@', '' => '', '' => '^', '' => '*', '' => '(', '' => ')', '' => '_', '' => '=', '' => '+', 'uah' => '₴', 'eur' => '€', 'usd' => '$', 'protsen' => '%');
             foreach ($glyph_array as $letter => $glyphs) {
                 $glyphs = explode(',', $glyphs);
                 $str = str_replace($glyphs, $letter, $str);
             }
             $str = preg_replace('#\\&\\#?[a-z0-9]+\\;#ismu', '', $str);
             return $str;
             break;
         default:
         case 'ua':
             $trans = array("а" => "a", "б" => "b", "в" => "v", "г" => "h", "ґ" => "g", "д" => "d", "е" => "e", "ё" => "e", "э" => "e", "є" => "ie", "ж" => "zh", "з" => "z", "и" => "y", "ы" => "y", "і" => "i", "ї" => "i", "й" => "i", "к" => "k", "л" => "l", "м" => "m", "н" => "n", "о" => "o", "п" => "p", "р" => "r", "с" => "s", "т" => "t", "у" => "u", "ф" => "f", "х" => "kh", "ц" => "ts", "ч" => "ch", "ш" => "sh", "щ" => "shch", "ю" => "iu", "я" => "ia", "ь" => "", "Ь" => "", "ъ" => "", "Ъ" => "", "!" => "", "?" => "", ":" => "", ";" => "", "’" => "", "'" => "", "—" => "", "--" => "", "-" => "", "." => "", "@" => "", "#" => "", "#" => "", "^" => "", "*" => "", "(" => "", ")" => "", "_" => "", "=" => "", "+" => "", "₴" => "uah", "€" => "eur", "\$" => "usd", "%" => "protsent", 'à' => 'a', 'ô' => 'o', 'ď' => 'd', 'ḟ' => 'f', 'ë' => 'e', 'š' => 's', 'ơ' => 'o', 'ß' => 'ss', 'ă' => 'a', 'ř' => 'r', 'ț' => 't', 'ň' => 'n', 'ā' => 'a', 'ķ' => 'k', 'ŝ' => 's', 'ỳ' => 'y', 'ņ' => 'n', 'ĺ' => 'l', 'ħ' => 'h', 'ṗ' => 'p', 'ó' => 'o', 'ú' => 'u', 'ě' => 'e', 'é' => 'e', 'ç' => 'c', 'ẁ' => 'w', 'ċ' => 'c', 'õ' => 'o', 'ṡ' => 's', 'ø' => 'o', 'ģ' => 'g', 'ŧ' => 't', 'ș' => 's', 'ė' => 'e', 'ĉ' => 'c', 'ś' => 's', 'î' => 'i', 'ű' => 'u', 'ć' => 'c', 'ę' => 'e', 'ŵ' => 'w', 'ṫ' => 't', 'ū' => 'u', 'č' => 'c', 'ö' => 'oe', 'è' => 'e', 'ŷ' => 'y', 'ą' => 'a', 'ł' => 'l', 'ų' => 'u', 'ů' => 'u', 'ş' => 's', 'ğ' => 'g', 'ļ' => 'l', 'ƒ' => 'f', 'ž' => 'z', 'ẃ' => 'w', 'ḃ' => 'b', 'å' => 'a', 'ì' => 'i', 'ï' => 'i', 'ḋ' => 'd', 'ť' => 't', 'ŗ' => 'r', 'ä' => 'ae', 'í' => 'i', 'ŕ' => 'r', 'ê' => 'e', 'ü' => 'ue', 'ò' => 'o', 'ē' => 'e', 'ñ' => 'n', 'ń' => 'n', 'ĥ' => 'h', 'ĝ' => 'g', 'đ' => 'd', 'ĵ' => 'j', 'ÿ' => 'y', 'ũ' => 'u', 'ŭ' => 'u', 'ư' => 'u', 'ţ' => 't', 'ý' => 'y', 'ő' => 'o', 'â' => 'a', 'ľ' => 'l', 'ẅ' => 'w', 'ż' => 'z', 'ī' => 'i', 'ã' => 'a', 'ġ' => 'g', 'ṁ' => 'm', 'ō' => 'o', 'ĩ' => 'i', 'ù' => 'u', 'į' => 'i', 'ź' => 'z', 'á' => 'a', 'û' => 'u', 'þ' => 'th', 'ð' => 'dh', 'æ' => 'ae', 'µ' => 'u', 'ĕ' => 'e', 'œ' => 'oe', "А" => "A", "Б" => "B", "В" => "V", "Г" => "H", "Ґ" => "G", "Д" => "D", "Е" => "E", "Ё" => "E", "Э" => "E", "Є" => "Ye", "Ж" => "Zh", "З" => "Z", "И" => "Y", "Й" => "Y", "Ы" => "Y", "І" => "I", "Ї" => "Yi", "К" => "K", "Л" => "L", "М" => "M", "Н" => "N", "О" => "O", "П" => "P", "Р" => "R", "С" => "S", "Т" => "T", "У" => "U", "Ф" => "F", "Х" => "Kh", "Ц" => "Ts", "Ч" => "Ch", "Ш" => "Sh", "Щ" => "Shch", "Ю" => "Yu", "Я" => "Ya", 'À' => 'A', 'Ô' => 'O', 'Ď' => 'D', 'Ḟ' => 'F', 'Ë' => 'E', 'Š' => 'S', 'Ơ' => 'O', 'Ă' => 'A', 'Ř' => 'R', 'Ț' => 'T', 'Ň' => 'N', 'Ā' => 'A', 'Ķ' => 'K', 'Ŝ' => 'S', 'Ỳ' => 'Y', 'Ņ' => 'N', 'Ĺ' => 'L', 'Ħ' => 'H', 'Ṗ' => 'P', 'Ó' => 'O', 'Ú' => 'U', 'Ě' => 'E', 'É' => 'E', 'Ç' => 'C', 'Ẁ' => 'W', 'Ċ' => 'C', 'Õ' => 'O', 'Ṡ' => 'S', 'Ø' => 'O', 'Ģ' => 'G', 'Ŧ' => 'T', 'Ș' => 'S', 'Ė' => 'E', 'Ĉ' => 'C', 'Ś' => 'S', 'Î' => 'I', 'Ű' => 'U', 'Ć' => 'C', 'Ę' => 'E', 'Ŵ' => 'W', 'Ṫ' => 'T', 'Ū' => 'U', 'Č' => 'C', 'Ö' => 'Oe', 'È' => 'E', 'Ŷ' => 'Y', 'Ą' => 'A', 'Ł' => 'L', 'Ų' => 'U', 'Ů' => 'U', 'Ş' => 'S', 'Ğ' => 'G', 'Ļ' => 'L', 'Ƒ' => 'F', 'Ž' => 'Z', 'Ẃ' => 'W', 'Ḃ' => 'B', 'Å' => 'A', 'Ì' => 'I', 'Ï' => 'I', 'Ḋ' => 'D', 'Ť' => 'T', 'Ŗ' => 'R', 'Ä' => 'Ae', 'Í' => 'I', 'Ŕ' => 'R', 'Ê' => 'E', 'Ü' => 'Ue', 'Ò' => 'O', 'Ē' => 'E', 'Ñ' => 'N', 'Ń' => 'N', 'Ĥ' => 'H', 'Ĝ' => 'G', 'Đ' => 'D', 'Ĵ' => 'J', 'Ÿ' => 'Y', 'Ũ' => 'U', 'Ŭ' => 'U', 'Ư' => 'U', 'Ţ' => 'T', 'Ý' => 'Y', 'Ő' => 'O', 'Â' => 'A', 'Ľ' => 'L', 'Ẅ' => 'W', 'Ż' => 'Z', 'Ī' => 'I', 'Ã' => 'A', 'Ġ' => 'G', 'Ṁ' => 'M', 'Ō' => 'O', 'Ĩ' => 'I', 'Ù' => 'U', 'Į' => 'I', 'Ź' => 'Z', 'Á' => 'A', 'Û' => 'U', 'Þ' => 'Th', 'Ð' => 'Dh', 'Æ' => 'Ae', 'Ĕ' => 'E', 'Œ' => 'Oe');
             if (preg_match("/[а-яА-Яa-zA-Z]/", $string)) {
                 $str = strtr($string, $trans);
             } else {
                 $str = $string;
             }
             $str = preg_replace('#\\&\\#?[a-z0-9]+\\;#ismu', '', $str);
             return $str;
             break;
     }
 }
开发者ID:densem-2013,项目名称:exikom,代码行数:26,代码来源:uk-UA.localise.php


示例13: prepareGroupField

 protected function prepareGroupField()
 {
     $basetype = isset($this->element['basetype']) ? $this->element['basetype'] : 'text';
     $basetype = (string) $basetype;
     $first_char = JString::substr($this->element['name'], 0, 1);
     $last_char = JString::substr($this->element['name'], JString::strlen($this->element['name']) - 1, 1);
     if ($basetype == 'group') {
         //If start or end of group
         if ($first_char == "{") {
             // Починаю нову групу (може бути будь-якого рівня вкладеності)
             $GLOBALS['variablefield']['output'] = false;
             $GLOBALS['variablefield']['current_group'][] = (string) $this->element['name'] . '}';
             // Lower in the code I know, that last element of array $GLOBALS['variablefield']['current_group'] is always the current group.
             $this->groupstate = 'start';
             $GLOBALS['variablefield']['fields'][] = clone $this;
             // I must clone
         } else {
             if ($last_char == "}") {
                 $this->groupstate = 'end';
                 $GLOBALS['variablefield']['fields'][] = clone $this;
                 array_pop($GLOBALS['variablefield']['current_group']);
                 if (empty($GLOBALS['variablefield']['current_group'])) {
                     $GLOBALS['variablefield']['output'] = true;
                 }
             }
         }
     } else {
         if (!empty($GLOBALS['variablefield']['current_group'])) {
             // If in element from inside the group
             $this->groupstate = 'continue';
             $this->defaultvalue = $this->value;
             $GLOBALS['variablefield']['fields'][] = clone $this;
         }
     }
 }
开发者ID:emeraldstudio,项目名称:somosmaestros,代码行数:35,代码来源:variablefield.php


示例14: display

 function display()
 {
     global $option, $mainframe;
     $document =& JFactory::getDocument();
     $view =& $this->getView(JRequest::getVar('controller', 'querydefinitions'), $document->getType());
     $model =& $this->getModel('querydefinitions');
     $user =& JFactory::getUser();
     $context = 'com_kbi.querydefinitions.list';
     $filter_order = $mainframe->getUserStateFromRequest($context . 'filter_order', 'filter_order', 'name', 'cmd');
     $filter_order_Dir = $mainframe->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', '', 'word');
     $search = $mainframe->getUserStateFromRequest($context . 'search', 'search', '', 'string');
     $search = JString::strtolower($search);
     $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
     $limitstart = $mainframe->getUserStateFromRequest($context . 'limitstart', 'limitstart', 0, 'int');
     $orderby = ' ORDER BY ' . $filter_order . ' ' . $filter_order_Dir . ', id';
     $rows = $model->getList($total, $limitstart, $limit, $search, $orderby);
     jimport('joomla.html.pagination');
     $pageNav = new JPagination($total, $limitstart, $limit);
     // table ordering
     $lists['order_Dir'] = $filter_order_Dir;
     $lists['order'] = $filter_order;
     // search filter
     $lists['search'] = $search;
     $view->setLayout('default');
     $view->assignRef('rows', $rows);
     $view->assignRef('pageNav', $pageNav);
     $view->assignRef('lists', $lists);
     $view->display();
 }
开发者ID:KIZI,项目名称:sewebar-cms,代码行数:29,代码来源:querydefinitions.php


示例15: display

 public function display($tpl = null)
 {
     $app = JFactory::getApplication('');
     if ($this->getLayout() == 'form') {
         $this->_displayForm($tpl);
         return;
     }
     $context = 'com_jacc' . '.' . strtolower($this->getName()) . '.list.';
     $filter_state = $app->getUserStateFromRequest($context . 'filter_state', 'filter_state', '', 'word');
     $filter_order = $app->getUserStateFromRequest($context . 'filter_order', 'filter_order', $this->get('DefaultFilter'), 'cmd');
     $filter_order_Dir = $app->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', '', 'word');
     $search = $app->getUserStateFromRequest($context . 'search', 'search', '', 'string');
     $search = JString::strtolower($search);
     // Get data from the model
     $this->total = $this->get('Total');
     $this->pagination = $this->get('Pagination');
     //create the lists
     $lists = array();
     $lists['state'] = JHTML::_('grid.state', $filter_state);
     // table ordering
     $lists['order_Dir'] = $filter_order_Dir;
     $lists['order'] = $filter_order;
     // search filter
     $lists['search'] = $search;
     $this->items = $this->get('Data');
     $this->user = JFactory::getUser();
     $this->lists = $lists;
     parent::display();
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:29,代码来源:view.html.php


示例16: getFieldHTML

    public function getFieldHTML($field, $required)
    {
        $required = $field->required == 1 ? ' data-required="true"' : '';
        //a fix for wrong data
        $field->value = JString::trim($field->value);
        if (JString::strrpos($field->value, ',') == JString::strlen($field->value) - 1) {
            $field->value = JString::substr($field->value, 0, -1);
        }
        $lists = explode(',', $field->value);
        //CFactory::load( 'helpers' , 'string' );
        $html = '<select id="field' . $field->id . '" name="field' . $field->id . '[]" type="select-multiple" multiple="multiple" class="joms-select joms-select--multiple" title="' . CStringHelper::escape(JText::_($field->tips)) . '" ' . $required . '>';
        $elementSelected = 0;
        foreach ($field->options as $option) {
            $selected = in_array($option, $lists) ? ' selected="selected"' : '';
            if (empty($selected)) {
                $elementSelected++;
            }
            $html .= '<option value="' . $option . '"' . $selected . '>' . JText::_($option) . '</option>';
        }
        if ($elementSelected == 0) {
            //if nothing is selected, we default the 1st option to be selected.
            $elementName = 'field' . $field->id;
            $html .= <<<HTML

                   <script type='text/javascript'>
                       var slt = document.getElementById('{$elementName}');
                       if(slt != null){
                          slt.options[0].selected = true;
                       }
                   </script>
HTML;
        }
        $html .= '</select>';
        return $html;
    }
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:35,代码来源:list.php


示例17: save

 function save($url = null)
 {
     if (!JSession::checkToken('post')) {
         $this->app->enqueueMessage(JText::_('COM_KUNENA_ERROR_TOKEN'), 'error');
         $this->app->redirect(KunenaRoute::_($this->baseurl, false));
     }
     $properties = $this->config->getProperties();
     foreach (JRequest::get('post', JREQUEST_ALLOWHTML) as $postsetting => $postvalue) {
         if (JString::strpos($postsetting, 'cfg_') === 0) {
             //remove cfg_ and force lower case
             if (is_array($postvalue)) {
                 $postvalue = implode(',', $postvalue);
             }
             $postname = JString::strtolower(JString::substr($postsetting, 4));
             // No matter what got posted, we only store config parameters defined
             // in the config class. Anything else posted gets ignored.
             if (array_key_exists($postname, $properties)) {
                 $this->config->set($postname, $postvalue);
             }
         }
     }
     $this->config->save();
     $this->app->enqueueMessage(JText::_('COM_KUNENA_CONFIGSAVED'));
     if (empty($url)) {
         $this->app->redirect(KunenaRoute::_($this->kunenabaseurl, false));
     } else {
         $this->app->redirect(KunenaRoute::_($url, false));
     }
 }
开发者ID:proyectoseb,项目名称:University,代码行数:29,代码来源:config.php


示例18: display

 function display($tpl = null)
 {
     $document = JFactory::getDocument();
     $user = JFactory::getUser();
     $mainframe = JFactory::getApplication();
     if (Komento::joomlaVersion() >= '1.6') {
         if (!$user->authorise('komento.manage.pendings', 'com_komento')) {
             $mainframe->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR'), 'error');
             $mainframe->close();
         }
     }
     $filter_component = $mainframe->getUserStateFromRequest('com_komento.pending.filter_component', 'filter_component', '*', 'string');
     $search = $mainframe->getUserStateFromRequest('com_komento.pending.search', 'search', '', 'string');
     $search = trim(JString::strtolower($search));
     $order = $mainframe->getUserStateFromRequest('com_komento.pending.filter_order', 'filter_order', 'created', 'cmd');
     $orderDirection = $mainframe->getUserStateFromRequest('com_komento.pending.filter_order_Dir', 'filter_order_Dir', 'DESC', 'word');
     // Set Options
     $options['published'] = 2;
     $options['no_tree'] = 1;
     $options['no_child'] = 1;
     // Get data from the model
     $commentsModel = Komento::getModel('comments');
     $comments = $commentsModel->getData($options);
     $pagination = $commentsModel->getPagination();
     $this->assignRef('comments', $comments);
     $this->assignRef('pagination', $pagination);
     $this->assign('search', $search);
     $this->assign('order', $order);
     $this->assign('orderDirection', $orderDirection);
     $this->assign('component', $this->getComponentState($filter_component));
     $this->assign('columns', Komento::getConfig('com_komento_pending_columns', false));
     $this->assign('columnCount', 2);
     parent::display($tpl);
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:34,代码来源:view.html.php


示例19: genericordering

 /**
  * Description
  *
  * @param string SQL with ordering As value and 'name field' AS text
  * @param integer The length of the truncated headline
  * @since 1.5
  */
 function genericordering($sql, $chop = '30')
 {
     $db =& JFactory::getDBO();
     $order = array();
     $db->setQuery($sql);
     if (!($orders = $db->loadObjectList())) {
         if ($db->getErrorNum()) {
             echo $db->stderr();
             return false;
         } else {
             $order[] = JHTML::_('select.option', 1, JText::_('first'));
             return $order;
         }
     }
     $order[] = JHTML::_('select.option', 0, '0 ' . JText::_('first'));
     for ($i = 0, $n = count($orders); $i < $n; $i++) {
         if (JString::strlen($orders[$i]->text) > $chop) {
             $text = JString::substr($orders[$i]->text, 0, $chop) . "...";
         } else {
             $text = $orders[$i]->text;
         }
         $order[] = JHTML::_('select.option', $orders[$i]->value, $orders[$i]->value . ' (' . $text . ')');
     }
     $order[] = JHTML::_('select.option', $orders[$i - 1]->value + 1, $orders[$i - 1]->value + 1 . ' ' . JText::_('last'));
     return $order;
 }
开发者ID:RangerWalt,项目名称:ecci,代码行数:33,代码来源:list.php


示例20: isValid

 /**
  * Validates the username.
  *
  * @since	1.0
  * @access	public
  * @param	null
  * @return	JSON	A jsong encoded string.
  *
  * @author	Jason Rey <[email protected]>
  */
 public function isValid()
 {
     // Render the ajax lib.
     $ajax = FD::getInstance('Ajax');
     // Get the userid
     $userid = JRequest::getInt('userid', 0);
     // Get the event
     $event = JRequest::getString('event');
     // Set the current username
     $current = '';
     if (!empty($userid)) {
         $user = FD::user($userid);
         $current = $user->username;
     }
     // Get the provided username that the user has typed.
     $username = JRequest::getVar('username', '');
     // Username is required, check if username is empty
     if (JString::strlen($username) < $this->params->get('min')) {
         return $ajax->reject(JText::sprintf('PLG_FIELDS_JOOMLA_USERNAME_MIN_CHARACTERS', $this->params->get('min')));
     }
     // Test if username is allowed (by pass for adminedit).
     if ($event !== 'onAdminEdit' && !SocialFieldsUserJoomlaUsernameHelper::allowed($username, $this->params)) {
         return $ajax->reject(JText::_('PLG_FIELDS_JOOMLA_USERNAME_NOT_ALLOWED'));
     }
     // Test if username exists.
     if (SocialFieldsUserJoomlaUsernameHelper::exists($username, $current)) {
         return $ajax->reject(JText::_('PLG_FIELDS_JOOMLA_USERNAME_NOT_AVAILABLE'));
     }
     // Test if the username is valid
     if (!SocialFieldsUserJoomlaUsernameHelper::isValid($username, $this->params)) {
         return $ajax->reject(JText::_('PLG_FIELDS_JOOMLA_USERNAME_IS_INVALID'));
     }
     $text = JText::_('PLG_FIELDS_JOOMLA_USERNAME_AVAILABLE');
     return $ajax->resolve($text);
 }
开发者ID:ppantilla,项目名称:bbninja,代码行数:45,代码来源:ajax.php



注:本文中的JString类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP JStringPunycode类代码示例发布时间:2022-05-23
下一篇:
PHP JSite类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap