本文整理汇总了PHP中FSS_Input::getcmd方法的典型用法代码示例。如果您正苦于以下问题:PHP FSS_Input::getcmd方法的具体用法?PHP FSS_Input::getcmd怎么用?PHP FSS_Input::getcmd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FSS_Input
的用法示例。
在下文中一共展示了FSS_Input::getcmd方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($tpl = NULL)
{
parent::init();
$this->plugins = $this->load_plugins();
$this->mode = FSS_Input::getcmd('mode', 'pick');
$this->usergroup = FSS_Input::getInt('usergroup');
foreach ($this->plugins as $plugin) {
$plugin->mode = $this->mode;
}
$limitstart = FSS_Input::getInt('limitstart');
$mainframe = JFactory::getApplication();
$limit = $mainframe->getUserStateFromRequest('users.limit', 'limit', 10, 'int');
$search = FSS_Input::getString('search');
$this->lists = array();
$this->lists['order_Dir'] = FSS_Input::getCmd('filter_order_Dir');
$this->lists['order'] = FSS_Input::getCmd('filter_order');
$ticket_has_groups = false;
// load in ticket if there is one
$this->ticketid = FSS_Input::getInt("ticketid");
if ($this->mode == "user" || $this->mode == "admin") {
$this->ticket = new SupportTicket();
$this->ticket->load($this->ticketid);
$this->ticket->loadCC();
$this->ticket->loadGroups();
if (count($this->ticket->groups) > 0) {
$ticket_has_groups = true;
}
}
// ticket group, default to t if we are in user or admin mode
$this->ticketgroup = null;
if ($ticket_has_groups && $this->mode == "user") {
$this->ticketgroup = "t";
}
$this->ticketgroup = FSS_Input::getcmd('ticketgroup', $this->ticketgroup);
$db = JFactory::getDBO();
$qry = "SELECT * FROM #__users ";
$where = array();
if ($search != "") {
$search_parts = array();
$search_parts[] = "username LIKE '%" . $db->escape($search) . "%'";
$search_parts[] = "name LIKE '%" . $db->escape($search) . "%'";
$search_parts[] = "email LIKE '%" . $db->escape($search) . "%'";
$this->searchFields($search_parts);
foreach ($this->plugins as $plugin) {
$ids = $plugin->search($search);
if (count($ids) > 0) {
$search_parts[] = "id IN ('" . implode("', '", $ids) . "')";
}
}
$where[] = "( " . implode(" OR ", $search_parts) . " )";
}
// filter by usergroup
if ($this->usergroup > 0) {
$where[] = "id IN (SELECT user_id FROM #__user_usergroup_map WHERE group_id = " . $db->escape($this->usergroup) . ")";
}
// filter by ticket group
if ($this->ticketgroup == "t") {
$group_ids = array();
$group_ids[] = 0;
foreach ($this->ticket->groups as $group) {
$group_ids[] = $group->id;
}
$where[] = "id IN (SELECT user_id FROM #__fss_ticket_group_members WHERE group_id IN (" . implode(", ", $group_ids) . "))";
} elseif ($this->ticketgroup > 0) {
$where[] = "id IN (SELECT user_id FROM #__fss_ticket_group_members WHERE group_id = " . $db->escape($this->ticketgroup) . ")";
}
if ($this->mode == "admin") {
$handlers = SupportUsers::getHandlers(false, false);
$ids = array();
$ids[] = 0;
foreach ($handlers as $handler) {
$ids[] = $handler->id;
}
$where[] = "id IN (" . implode(", ", $ids) . ")";
}
// add where
if (count($where) > 0) {
$qry .= " WHERE " . implode(" AND ", $where);
}
$order = FSS_Input::getCmd('filter_order');
$dir = FSS_Input::getCmd('filter_order_Dir', 'asc');
if ($order == "username" || $order == "name" || $order == "email") {
// Sort ordering
$qry .= " ORDER BY {$order} {$dir} ";
} else {
$qry .= " ORDER BY name ";
}
//echo $qry . "<br>";
// get max items
$db->setQuery($qry);
$db->query();
$maxitems = $db->getNumRows();
// select picked items
$db->setQuery($qry, $limitstart, $limit);
$this->users = $db->loadObjectList();
//print_p(reset($this->users));
// build pagination
$this->pagination = new JPaginationEx($maxitems, $limitstart, $limit);
$this->search = $search;
if ($this->mode != "admin") {
//.........这里部分代码省略.........