本文整理汇总了PHP中JString类的典型用法代码示例。如果您正苦于以下问题:PHP JString类的具体用法?PHP JString怎么用?PHP JString使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JString类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例7: check
function check()
{
if (JString::trim($this->url) != '' && substr($this->url, 0, 7) != 'http://') {
$this->url = 'http://' . $this->url;
}
return true;
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
}
}
示例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();
}
示例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();
}