function displayItems() { $mainframe = JFactory::getApplication(); $user = JFactory::getUser(); $option = JRequest::getCmd('option'); $view = JRequest::getCmd('view'); $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int'); $limitstart = $mainframe->getUserStateFromRequest($option . $view . '.limitstart', 'limitstart', 0, 'int'); $filter_order = $mainframe->getUserStateFromRequest($option . $view . 'filter_order', 'filter_order', 'id', 'cmd'); $filter_order_Dir = $mainframe->getUserStateFromRequest($option . $view . 'filter_order_Dir', 'filter_order_Dir', 'DESC', 'word'); $filter_state = $mainframe->getUserStateFromRequest($option . $view . 'filter_state', 'filter_state', -1, 'int'); $search = $mainframe->getUserStateFromRequest($option . $view . 'search', 'search', '', 'string'); $search = JString::strtolower($search); $model = $this->getModel(); $tags = $model->getData(); $this->assignRef('rows', $tags); $total = $model->getTotal(); jimport('joomla.html.pagination'); $pageNav = new JPagination($total, $limitstart, $limit); $this->assignRef('page', $pageNav); $lists = array(); $lists['search'] = $search; $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; $filter_state_options[] = JHTML::_('select.option', -1, JText::_('_SELECT_STATE_')); $filter_state_options[] = JHTML::_('select.option', 1, JText::_('PUBLISHED')); $filter_state_options[] = JHTML::_('select.option', 0, JText::_('UNPUBLISHED')); $lists['state'] = JHTML::_('select.genericlist', $filter_state_options, 'filter_state', 'onchange="this.form.submit();"', 'value', 'text', $filter_state); $this->assignRef('lists', $lists); JToolBarHelper::title(JText::_('TAGS')); JToolBarHelper::publishList(); JToolBarHelper::unpublishList(); JToolBarHelper::deleteList(JText::_('ARE_YOU_SURE_YOU_WANT_TO_DELETE_SELECTED_TAGS'), 'remove', JText::_('DELETE')); JToolBarHelper::addNew(); }
/** * 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; }
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); }
/** * 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); }
function getTotal() { $mainframe = JFactory::getApplication(); $option = JRequest::getCmd('option'); $view = JRequest::getCmd('view'); $db = JFactory::getDBO(); $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int'); $limitstart = $mainframe->getUserStateFromRequest($option . '.limitstart', 'limitstart', 0, 'int'); $filter_state = $mainframe->getUserStateFromRequest($option . $view . 'filter_state', 'filter_state', 1, 'int'); $filter_category = $mainframe->getUserStateFromRequest($option . $view . 'filter_category', 'filter_category', 0, 'int'); $filter_author = $mainframe->getUserStateFromRequest($option . $view . 'filter_author', 'filter_author', 0, 'int'); $search = $mainframe->getUserStateFromRequest($option . $view . 'search', 'search', '', 'string'); $search = JString::strtolower($search); $query = "SELECT COUNT(*) FROM #__k2_comments AS c LEFT JOIN #__k2_items AS i ON c.itemID=i.id WHERE c.id>0"; if ($filter_state > -1) { $query .= " AND c.published={$filter_state}"; } if ($filter_category) { $query .= " AND i.catid={$filter_category}"; } if ($filter_author) { $query .= " AND i.created_by={$filter_author}"; } if ($search) { $escaped = K2_JVERSION == '15' ? $db->getEscaped($search, true) : $db->escape($search, true); $query .= " AND LOWER( c.commentText ) LIKE " . $db->Quote('%' . $escaped . '%', false); } $db->setQuery($query); $total = $db->loadresult(); return $total; }
public function setImage($path, $type = 'thumb') { CError::assert($path, '', '!empty', __FILE__, __LINE__); $db = $this->getDBO(); // Fix the back quotes $path = CString::str_ireplace('\\', '/', $path); $type = JString::strtolower($type); // Test if the record exists. $oldFile = $this->{$type}; if ($db->getErrorNum()) { JError::raiseError(500, $db->stderr()); } if ($oldFile) { // File exists, try to remove old files first. $oldFile = CString::str_ireplace('/', '/', $oldFile); // If old file is default_thumb or default, we should not remove it. // // Need proper way to test it if (!JString::stristr($oldFile, 'group.jpg') && !JString::stristr($oldFile, 'group_thumb.jpg') && !JString::stristr($oldFile, 'default.jpg') && !JString::stristr($oldFile, 'default_thumb.jpg')) { jimport('joomla.filesystem.file'); JFile::delete($oldFile); } } $this->{$type} = $path; $this->store(); }
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(); }
function getTotal() { $mainframe =& JFactory::getApplication(); $option = JRequest::getCmd('option'); $view = JRequest::getCmd('view'); $db =& JFactory::getDBO(); $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int'); $limitstart = $mainframe->getUserStateFromRequest($option . '.limitstart', 'limitstart', 0, 'int'); $search = $mainframe->getUserStateFromRequest($option . $view . 'search', 'search', '', 'string'); $search = JString::strtolower($search); $filter_trash = $mainframe->getUserStateFromRequest($option . $view . 'filter_trash', 'filter_trash', 0, 'int'); $filter_state = $mainframe->getUserStateFromRequest($option . $view . 'filter_state', 'filter_state', 1, 'int'); $query = "SELECT COUNT(*) FROM #__k2_categories WHERE id>0"; if (!$filter_trash) { $query .= " AND trash=0"; } if ($search) { $query .= " AND LOWER( name ) LIKE " . $db->Quote('%' . $db->getEscaped($search, true) . '%', false); } if ($filter_state > -1) { $query .= " AND published={$filter_state}"; } $db->setQuery($query); $total = $db->loadResult(); return $total; }
function getTotal() { $mainframe = JFactory::getApplication(); $option = JRequest::getCmd('option'); $view = JRequest::getCmd('view'); $db = JFactory::getDBO(); $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int'); $limitstart = $mainframe->getUserStateFromRequest($option . '.limitstart', 'limitstart', 0, 'int'); $filter_state = $mainframe->getUserStateFromRequest($option . $view . 'filter_state', 'filter_state', 1, 'int'); $search = $mainframe->getUserStateFromRequest($option . $view . 'search', 'search', '', 'string'); $search = JString::strtolower($search); $filter_type = $mainframe->getUserStateFromRequest($option . $view . 'filter_type', 'filter_type', '', 'string'); $filter_group = $mainframe->getUserStateFromRequest($option . $view . 'filter_group', 'filter_group', '', 'string'); $query = "SELECT COUNT(*) FROM #__k2_extra_fields WHERE id>0"; if ($filter_state > -1) { $query .= " AND published={$filter_state}"; } if ($search) { $escaped = K2_JVERSION == '15' ? $db->getEscaped($search, true) : $db->escape($search, true); $query .= " AND LOWER( name ) LIKE " . $db->Quote('%' . $escaped . '%', false); } if ($filter_type) { $query .= " AND `type`=" . $db->Quote($filter_type); } if ($filter_group) { $query .= " AND `group`=" . $db->Quote($filter_group); } $db->setQuery($query); $total = $db->loadresult(); return $total; }
public function display($tpl = null) { $document = JFactory::getDocument(); $db = JFactory::getDBO(); $app = JFactory::getApplication(); $jinput = JFactory::getApplication()->input; $itemid = $jinput->getInt('id', 0) . ':' . $jinput->getInt('Itemid', 0); $filter_order = $app->getUserStateFromRequest('com_jem.categoryelement.filter_order', 'filter_order', 'c.ordering', 'cmd'); $filter_order_Dir = $app->getUserStateFromRequest('com_jem.categoryelement.filter_order_Dir', 'filter_order_Dir', '', 'word'); $filter_state = $app->getUserStateFromRequest('com_jem.categoryelement.' . $itemid . '.filter_state', 'filter_state', '', 'string'); $search = $app->getUserStateFromRequest('com_jem.categoryelement.' . $itemid . '.filter_search', 'filter_search', '', 'string'); $search = $db->escape(trim(JString::strtolower($search))); // prepare document $document->setTitle(JText::_('COM_JEM_SELECT_CATEGORY')); // Load css JemHelper::loadCss('backend'); // Get data from the model $rows = $this->get('Data'); $pagination = $this->get('Pagination'); // publish/unpublished filter $lists['state'] = JHtml::_('grid.state', $filter_state); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search'] = $search; // assign data to template $this->lists = $lists; $this->filter_state = $filter_state; $this->rows = $rows; $this->pagination = $pagination; parent::display($tpl); }
function _buildContentWhere() { $option = JRequest::getCmd('option'); $mainframe = JFactory::getApplication(); $filter_sports_type = $mainframe->getUserStateFromRequest($option . '.' . $this->_identifier . '.filter_sports_type', 'filter_sports_type', '', 'int'); $filter_state = $mainframe->getUserStateFromRequest($option . '.' . $this->_identifier . '.filter_state', 'filter_state', '', 'word'); $search = $mainframe->getUserStateFromRequest($option . '.' . $this->_identifier . '.search', 'search', '', 'string'); $search_mode = $mainframe->getUserStateFromRequest($option . '.' . $this->_identifier . '.search_mode', 'search_mode', '', 'string'); $search = JString::strtolower($search); $where = array(); if ($filter_sports_type > 0) { $where[] = 'obj.sports_type_id=' . $this->_db->Quote($filter_sports_type); } if ($search) { $where[] = 'LOWER(obj.name) LIKE ' . $this->_db->Quote('%' . $search . '%'); } if ($filter_state) { if ($filter_state == 'P') { $where[] = 'obj.published = 1'; } elseif ($filter_state == 'U') { $where[] = 'obj.published = 0'; } } $where = count($where) ? '' . implode(' AND ', $where) : ''; return $where; }
function display($tpl = null) { ## If we want the add/edit form.. if ($this->getLayout() == 'form') { $this->_displayForm($tpl); return; } $mainframe = JFactory::getApplication(); $db = JFactory::getDBO(); $model = $this->getModel(); ## Getting the items into a variable $items = $this->get('list'); $pagination = $this->get('Pagination'); $filter_order = $mainframe->getUserStateFromRequest('filter_ordering', 'filter_ordering', 'a.fueltype', 'cmd'); $filter_order_Dir = $mainframe->getUserStateFromRequest('filter_order_Dir', 'filter_order_Dir', 'asc', 'word'); $search = $mainframe->getUserStateFromRequest('search', 'search', '', 'string'); $search = JString::strtolower($search); $lists['search'] = $search; ## Filling the Array() for doors and make a select list for it. $ordering = array('a.name' => array('value' => 'a.name', 'text' => JText::_('COM_TICKETMASTER_SEARCH_NAME')), 'a.address' => array('value' => 'a.address', 'text' => JText::_('COM_TICKETMASTER_SEARCH_ADDRESS')), 'a.zipcode' => array('value' => 'a.zipcode', 'text' => JText::_('COM_TICKETMASTER_SEARCH_ZIPCODE')), 'a.city' => array('value' => 'a.city', 'text' => JText::_('COM_TICKETMASTER_SEARCH_CITY')), 'a.emailaddress' => array('value' => 'a.emailaddress', 'text' => JText::_('COM_TICKETMASTER_SEARCH_EMAIL'))); $lists['ordering'] = JHTML::_('select.genericList', $ordering, 'filter_ordering', ' class="inputbox" ', 'value', 'text', $filter_order); $this->assignRef('pagination', $pagination); $this->assignRef('items', $items); $this->assignRef('lists', $lists); parent::display($tpl); }
function _buildContentWhere() { $mainframe =& JFactory::getApplication(); $option = 'com_joomleague'; $filter_state = $mainframe->getUserStateFromRequest($option . 'tmb_filter_state', 'filter_state', '', 'word'); $filter_order = $mainframe->getUserStateFromRequest($option . 'tmb_filter_order', 'filter_order', 'u.username', 'cmd'); $filter_order_Dir = $mainframe->getUserStateFromRequest($option . 'tmb_filter_order_Dir', 'filter_order_Dir', '', 'word'); $search = $mainframe->getUserStateFromRequest($option . 'tmb_search', 'search', '', 'string'); $search_mode = $mainframe->getUserStateFromRequest($option . 'tmb_search_mode', 'search_mode', '', 'string'); $search = JString::strtolower($search); $where = array(); $prediction_id = (int) $mainframe->getUserState('com_joomleague' . 'prediction_id'); if ($prediction_id > 0) { $where[] = 'tmb.prediction_id = ' . $prediction_id; } if ($search) { $where[] = "LOWER(u.username) LIKE " . $this->_db->Quote($search . '%'); } if ($filter_state) { if ($filter_state == 'P') { $where[] = 'tmb.approved = 1'; } elseif ($filter_state == 'U') { $where[] = 'tmb.approved = 0'; } } $where = count($where) ? '' . implode(' AND ', $where) : ''; return $where; }
function display($tpl = null) { $mainframe = JFactory::getApplication(); $option = 'com_k2store'; $ns = 'com_k2store.fields'; $db = JFactory::getDBO(); $uri = JFactory::getURI(); $params = JComponentHelper::getParams('com_k2store'); $filter_order = $mainframe->getUserStateFromRequest($ns . 'filter_order', 'filter_order', 'a.field_id', 'cmd'); $filter_order_Dir = $mainframe->getUserStateFromRequest($ns . 'filter_order_Dir', 'filter_order_Dir', 'ASC', 'word'); $filter_orderstate = $mainframe->getUserStateFromRequest($ns . 'filter_orderstate', 'filter_orderstate', '', 'string'); $search = $mainframe->getUserStateFromRequest($ns . 'search', 'search', '', 'string'); if (strpos($search, '"') !== false) { $search = str_replace(array('=', '<'), '', $search); } $search = JString::strtolower($search); // Get data from the model $items = $this->get('Data'); $total = $this->get('Total'); $pagination = $this->get('Pagination'); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search'] = $search; $this->assignRef('lists', $lists); $this->assignRef('items', $items); $this->assignRef('pagination', $pagination); $this->params = $params; $model = $this->getModel(); $this->addToolBar(); $toolbar = new K2StoreToolBar(); $toolbar->renderLinkbar(); parent::display($tpl); }
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); }
public function display() { jimport('joomla.html.pagination'); // get application $app = Zoo::getApplication(); // set toolbar items $this->joomla->set('JComponentTitle', $app->getToolbarTitle(JText::_('Tags'))); JToolBarHelper::deleteList(); ZooHelper::toolbarHelp(); JHTML::_('behavior.tooltip'); // get request vars $state_prefix = $this->option . '_' . $app->id . '.tags.'; $filter_order = $this->joomla->getUserStateFromRequest($state_prefix . 'filter_order', 'filter_order', '', 'cmd'); $filter_order_Dir = $this->joomla->getUserStateFromRequest($state_prefix . 'filter_order_Dir', 'filter_order_Dir', 'desc', 'word'); $limit = $this->joomla->getUserStateFromRequest('global.list.limit', 'limit', $this->joomla->getCfg('list_limit'), 'int'); $limitstart = $this->joomla->getUserStateFromRequest($state_prefix . 'limitstart', 'limitstart', 0, 'int'); $search = $this->joomla->getUserStateFromRequest($state_prefix . 'search', 'search', '', 'string'); $search = JString::strtolower($search); // is filtered ? $this->is_filtered = !empty($search); // in case limit has been changed, adjust limitstart accordingly $limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0; // get data $filter = $filter_order ? $filter_order . ' ' . $filter_order_Dir : ''; $this->tags = YTable::getInstance('tag')->getAll($app->id, $search, '', $filter, $limitstart, $limit); $count = (int) YTable::getInstance('tag')->count($app->id); $this->pagination = new JPagination($count, $limitstart, $limit); // table ordering and search filter $this->lists['order_Dir'] = $filter_order_Dir; $this->lists['order'] = $filter_order; $this->lists['search'] = $search; // display view $this->getView()->display(); }
function display($tpl = null) { $option = JRequest::getCmd('option'); $mainframe = JFactory::getApplication(); $uri = JFactory::getURI(); $filter_order = $mainframe->getUserStateFromRequest($option . 's_filter_order', 'filter_order', 's.ordering', 'cmd'); $filter_order_Dir = $mainframe->getUserStateFromRequest($option . 's_filter_order_Dir', 'filter_order_Dir', '', 'word'); $search = $mainframe->getUserStateFromRequest($option . 's_search', 'search', '', 'string'); $search = JString::strtolower($search); $items = $this->get('Data'); $total = $this->get('Total'); $pagination = $this->get('Pagination'); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search'] = $search; $user = JFactory::getUser(); $this->user = $user; $this->lists = $lists; $this->items = $items; $this->pagination = $pagination; $this->request_url = $uri->toString(); $this->addToolbar(); parent::display($tpl); }
public function display($tpl = null) { // @rule: Test for user access if on 1.6 and above if (DiscussHelper::getJoomlaVersion() >= '1.6') { if (!JFactory::getUser()->authorise('discuss.manage.labels', 'com_easydiscuss')) { JFactory::getApplication()->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR'), 'error'); JFactory::getApplication()->close(); } } $task = JRequest::getCmd('task'); if ($task == 'labels.edit') { $this->diplayLabel(); } else { // Initialise variables $mainframe = JFactory::getApplication(); $filter_state = $mainframe->getUserStateFromRequest('com_easydiscuss.labels.filter_state', 'filter_state', '*', 'word'); $search = $mainframe->getUserStateFromRequest('com_easydiscuss.labels.search', 'search', '', 'string'); $search = trim(JString::strtolower($search)); $order = $mainframe->getUserStateFromRequest('com_easydiscuss.labels.filter_order', 'filter_order', 'a.ordering', 'cmd'); $orderDirection = $mainframe->getUserStateFromRequest('com_easydiscuss.labels.filter_order_Dir', 'filter_order_Dir', 'asc', 'word'); // Get data from the model $labels = $this->get('Data'); $pagination = $this->get('Pagination'); $this->state = $this->get('State'); $this->assignRef('labels', $labels); $this->assignRef('pagination', $pagination); $this->assign('state', JHTML::_('grid.state', $filter_state)); $this->assign('search', $search); $this->assign('order', $order); $this->assign('orderDirection', $orderDirection); parent::display($tpl); } }
function display($tpl = null) { ## If we want the add/edit form.. if ($this->getLayout() == 'form') { $this->_displayForm($tpl); return; } $db = JFactory::getDBO(); $mainframe = JFactory::getApplication(); $filter_scan_result = $mainframe->getUserStateFromRequest('filter_scan_result', 'filter_scan_result', '0', 'cmd'); $search = $mainframe->getUserStateFromRequest('searchbox', 'searchbox', '', 'string'); $search = JString::strtolower($search); $lists['search'] = $search; ## Filling the Array() for doors and make a select list for it. $result = array('0' => array('value' => '0', 'text' => JText::_('COM_TICKETMASTER_PLS_SELECT')), '1' => array('value' => '100', 'text' => JText::_('COM_TICKETMASTER_SCAN_SUCCESS')), '2' => array('value' => '101', 'text' => JText::_('COM_TICKETMASTER_SCAN_BLACKLISTED')), '3' => array('value' => '102', 'text' => JText::_('COM_TICKETMASTER_TICKET_WAS_UNPAID')), '4' => array('value' => '103', 'text' => JText::_('COM_TICKETMASTER_TICKET_WAS_SCANNED_BEFORE')), '5' => array('value' => '104', 'text' => JText::_('COM_TICKETMASTER_UNAUTHORIZED_SCANNER')), '6' => array('value' => '105', 'text' => JText::_('COM_TICKETMASTER_NO_BARCODE_FOUND'))); $lists['result'] = JHTML::_('select.genericList', $result, 'filter_scan_result', ' class="input-medium" ', 'value', 'text', (int) $filter_scan_result); ## Model is defined in the controller $model = $this->getModel(); ## Getting the items into a variable $items = $this->get('list'); $pagination = $this->get('pagination'); $data = $this->get('config'); $this->assignRef('pagination', $pagination); $this->assignRef('lists', $lists); $this->assignRef('items', $items); $this->assignRef('data', $data); parent::display($tpl); }
/** * 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; }
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)); } }
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(); }
public function getDanhsach() { $data = $this->inputData(); $vName = JRequest::getString('view'); AdminTochucHelper::addSubmenu($vName); AdminTochucHelper::addButton($vName); $this->mainframe = JFactory::getApplication(); $this->option = JRequest::getWord('option'); $uri = JFactory::getURI(); $status = $this->mainframe->getUserStateFromRequest($this->option . 'status', 'status', '', 'string'); $filter_order = $this->mainframe->getUserStateFromRequest($this->option . 'filter_order', 'filter_order', 'name', 'cmd'); $filter_order_Dir = $this->mainframe->getUserStateFromRequest($this->option . 'filter_order_Dir', 'filter_order_Dir', '', 'word'); $search = $this->mainframe->getUserStateFromRequest($this->option . 'search', 'search', '', 'string'); if (strpos($search, '"') !== false) { $search = str_replace(array('=', '<'), '', $search); } $search = JString::strtolower($search); if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC'))) { $filter_order_Dir = ''; } $javascript = 'onchange="document.adminForm.submit()"'; $lists['status'] = JHTML::_('select.genericlist', array(array('value' => '', 'text' => '--Trạng thái--'), array('value' => '1', 'text' => 'Sử dụng'), array('value' => '0', 'text' => 'Không sử dụng')), 'status', $javascript . ' class="inputbox" size="1"', 'value', 'text', $status); $model = JModelLegacy::getInstance('tochucdang', 'TochucModel'); $items = $model->listDanhsach($data['table']); $totals = $model->getTotal($data['table']); $pagination = $model->getPagination($data['table']); $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; $lists['search'] = $search; $this->sidebar = JHtmlSidebar::render(); $this->assignRef('data', $data); $this->assignRef('lists', $lists); $this->assignRef('items', $items); $this->assignRef('pagination', $pagination); }
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; } }
function display() { global $mainframe; $db =& JFactory::getDBO(); $user =& JFactory::getUser(); $context = 'com_banners.bannerclient.list.'; $filter_order = $mainframe->getUserStateFromRequest($context . 'filter_order', 'filter_order', 'a.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'); $where = array(); if ($search) { $where[] = 'LOWER(a.name) LIKE ' . $db->Quote('%' . $db->getEscaped($search, true) . '%', false); } $where = count($where) ? ' WHERE ' . implode(' AND ', $where) : ''; $orderby = ' ORDER BY ' . $filter_order . ' ' . $filter_order_Dir . ', a.cid'; // get the total number of records $query = 'SELECT a.*, count(b.bid) AS nbanners, u.name AS editor' . ' FROM #__bannerclient AS a' . ' LEFT JOIN #__banner AS b ON a.cid = b.cid' . ' LEFT JOIN #__users AS u ON u.id = a.checked_out' . $where . ' GROUP BY a.cid' . $orderby; $db->setQuery($query); $db->query(); $total = $db->getNumRows(); jimport('joomla.html.pagination'); $pageNav = new JPagination($total, $limitstart, $limit); $db->setQuery($query, $pageNav->limitstart, $pageNav->limit); $rows = $db->loadObjectList(); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search'] = $search; require_once JPATH_COMPONENT . DS . 'views' . DS . 'client.php'; BannersViewClients::clients($rows, $pageNav, $lists); }
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; }
function display($tpl = null) { //initialise variables $document =& JFactory::getDocument(); $db =& JFactory::getDBO(); $app =& JFactory::getApplication(); JHTML::_('behavior.tooltip'); JHTML::_('behavior.modal'); //get vars $filter_order = $app->getUserStateFromRequest('com_eventlist.categoryelement.filter_order', 'filter_order', 'c.ordering', 'cmd'); $filter_order_Dir = $app->getUserStateFromRequest('com_eventlist.categoryelement.filter_order_Dir', 'filter_order_Dir', '', 'word'); $filter_state = $app->getUserStateFromRequest('com_eventlist.categoryelement.filter_state', 'filter_state', '*', 'word'); $search = $app->getUserStateFromRequest('com_eventlist.categoryelement.search', 'search', '', 'string'); $search = $db->getEscaped(trim(JString::strtolower($search))); $template = $app->getTemplate(); //prepare document $document->setTitle(JText::_('SELECT CATEGORY')); $document->addStyleSheet('templates/' . $template . '/css/general.css'); $document->addStyleSheet('components/com_eventlist/assets/css/eventlistbackend.css'); // Get data from the model $rows =& $this->get('Data'); $pageNav =& $this->get('Pagination'); //publish unpublished filter $lists['state'] = JHTML::_('grid.state', $filter_state); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search'] = $search; //assign data to template $this->assignRef('lists', $lists); $this->assignRef('rows', $rows); $this->assignRef('pageNav', $pageNav); parent::display($tpl); }
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; }
function _buildContentWhere() { $option = 'com_joomleague'; $mainframe = JFactory::getApplication(); $project_id = $mainframe->getUserState($option . 'project'); $team_id = $mainframe->getUserState($option . 'project_team_id'); $filter_state = $mainframe->getUserStateFromRequest($option . 'ts_filter_state', 'filter_state', '', 'word'); $search = $mainframe->getUserStateFromRequest($option . 'ts_search', 'search', '', 'string'); $search_mode = $mainframe->getUserStateFromRequest($option . 'ts_search_mode', 'search_mode', '', 'string'); $search = JString::strtolower($search); $where = array(); $where[] = 'ts.projectteam_id=' . $team_id; $where[] = "ppl.published = '1'"; if ($search) { if ($search_mode) { $where[] = 'LOWER(lastname) LIKE ' . $this->_db->Quote($search . '%'); } else { $where[] = 'LOWER(lastname) LIKE ' . $this->_db->Quote('%' . $search . '%'); } } if ($filter_state) { if ($filter_state == 'P') { $where[] = 'ts.published = 1'; } elseif ($filter_state == 'U') { $where[] = 'ts.published = 0'; } } $where = count($where) ? ' WHERE ' . implode(' AND ', $where) : ''; return $where; }
function _buildContentWhere() { $option = JRequest::getCmd('option'); $mainframe = JFactory::getApplication(); $filter_state = $mainframe->getUserStateFromRequest($option . 'a_filter_state', 'filter_state', '', 'word'); $filter_order = $mainframe->getUserStateFromRequest($option . 'a_filter_order', 'filter_order', 'a.ordering', 'cmd'); $filter_order_Dir = $mainframe->getUserStateFromRequest($option . 'a_filter_order_Dir', 'filter_order_Dir', '', 'word'); $search = $mainframe->getUserStateFromRequest($option . 'a_search', 'search', '', 'string'); $search_mode = $mainframe->getUserStateFromRequest($option . 'a_search_mode', 'search_mode', '', 'string'); $search = JString::strtolower($search); $where = array(); if ($search) { if ($search_mode) { $where[] = 'LOWER(a.name) LIKE ' . $this->_db->Quote($search . '%'); } else { $where[] = 'LOWER(a.name) LIKE ' . $this->_db->Quote('%' . $search . '%'); } } if ($filter_state) { if ($filter_state == 'P') { $where[] = 'a.published=1'; } elseif ($filter_state == 'U') { $where[] = 'a.published=0'; } } $where = count($where) ? '' . implode(' AND ', $where) : ''; return $where; }