本文整理汇总了PHP中JPagination::setAdditionalUrlParam方法的典型用法代码示例。如果您正苦于以下问题:PHP JPagination::setAdditionalUrlParam方法的具体用法?PHP JPagination::setAdditionalUrlParam怎么用?PHP JPagination::setAdditionalUrlParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JPagination
的用法示例。
在下文中一共展示了JPagination::setAdditionalUrlParam方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setVar
/**
* Allows caller to set additional url parameters
*
* @since 1.0
* @access public
* @param string
* @return
*/
public function setVar($key, $value)
{
$this->pagination->setAdditionalUrlParam($key, $value);
}
示例2: browser
/**
* browser képernyo kirajzolása
* @JRequest string orderCol optional
* @JRequest string orderDir optional
* @JRequest string filterStr optional
* @JRequest integer limitstart optional
* @JRequest integer limit optional
* @JRequest string id optional
* @session object optional browser status {orderCol, orderDir, filterStr, limitstart, limit, id}
*/
public function browser()
{
$this->getState();
$this->saveState();
$this->state->limit = 20;
$model = $this->getModel($this->modelName);
$items = $model->getItems($this->state);
$form =& JForm::getInstance($this->browserName, JPATH_COMPONENT . '/models/forms/' . $this->formName . '.xml', array('control' => 'jform'));
for ($i = 0; $i < count($items); $i++) {
$this->itemAccess($items[$i]);
}
$total = $model->getTotal($this->state);
$pagination = new JPagination($total, $this->state->limitstart, $this->state->limit);
$pagination->setAdditionalUrlParam('termek_id', $this->state->termek_id);
$view = $this->getView($this->browserName, 'html');
$view->set('title', JText::_($this->lngPre . '_BROWSER'));
$view->set('state', $this->state);
$view->set('items', $items);
$view->set('form', $form);
$view->set('total', $total);
$view->set('pagination', $pagination);
$view->set('message', $this->message);
$view->termek = $model->getTermek($this->state->termek_id);
$view->isAdmin = $this->helper->isAdmin();
$buttons = $this->browserButtons();
$view->set('buttons', $buttons);
$view->setLayout('default');
$view->display();
}
示例3: browse
//.........这里部分代码省略.........
$alternativa_felvivo = $this->alternativa_felvivo();
// akciók definiálása
$akciok = array();
if ($this->temakorokHelper->isAdmin($user) | $szavazas_felvivo == 10 & ($this->szavazas->szavazok = 1) & $user->id > 0 | $szavazas_felvivo == 10 & $this->userTag($this->temakor_id, $user) | $this->szavazasIndito($this->szavazas_id, $user)) {
if ($this->szavazas->vita1 == 1) {
$akciok['ujAlternativa'] = JURI::base() . 'index.php?option=com_' . $this->NAME . '&view=' . $this->NAME . '&task=add' . '&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id . '&limit=' . JRequest::getVar('limit', 20) . '&limitstart=' . JRequest::getVar('limitstart', 0) . '&order=' . JRequest::getVar('order', 1) . '&filterStr=' . JRequest::getVar('filterStr', '');
}
}
if ($this->temakorokHelper->isAdmin($user) | $this->szavazas->letrehozo == $user->id) {
$akciok['szavazasedit'] = JURI::base() . 'index.php?option=com_szavazasok&view=szavazasok&task=edit' . '&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
}
if ($this->temakorokHelper->isAdmin($user) | $this->szavazas->letrehozo == $user->id) {
$akciok['szavazastorles'] = JURI::base() . 'index.php?option=com_szavazasok&view=szavazasok&task=deleteform' . '&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
}
if ($this->temakorokHelper->isAdmin($user) | $this->temakorIndito($this->temakor_id, $user)) {
$akciok['temakoredit'] = JURI::base() . 'index.php?option=com_temakorok&view=temakorok&task=edit' . '&temakor=' . $this->temakor_id;
}
if ($this->temakorokHelper->isAdmin($user) | $this->temakorIndito($this->temakor_id, $user)) {
$akciok['temakortorles'] = JURI::base() . 'index.php?option=com_temakorok&view=temakorok&task=deleteform' . '&temakor=' . $this->temakor_id;
}
if ($this->temakorokHelper->isAdmin($user) | $this->temakorIndito($this->temakor_id, $user)) {
if ($this->szavazas->vita1 == 1) {
$akciok['alternativaedit'] = JURI::base() . 'index.php?option=com_alternativak&view=alternativak&task=edit' . '&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
}
}
if ($this->temakorokHelper->isAdmin($user) | $this->temakorIndito($this->temakor_id, $user)) {
if ($this->szavazas->vita1 == 1) {
$akciok['alternativatorles'] = JURI::base() . 'index.php?option=com_alternativak&view=alternativak&task=deleteform' . '&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
}
}
if ($this->szavazas->szavazas == 1 & $user->id > 0) {
$db = JFactory::getDBO();
$db->setQuery('select id from #__szavazatok
where szavazas_id="' . $this->szavazas_id . '" and
user_id="' . $user->id . '"');
$res = $db->loadObjectList();
if (count($res) == 0) {
$akciok['szavazok'] = JURI::base() . 'index.php?option=com_szavazasok&view=szavazasok&task=szavazoform&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
}
}
if ($this->szavazas->lezart == 1) {
$akciok['eredmeny'] = JURI::base() . 'index.php?option=com_szavazasok&view=szavazasok&task=eredmeny&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
}
$akciok['tagok'] = JURI::base() . 'index.php?option=com_tagok&temakor=' . $this->temakor_id;
$akciok['sugo'] = JURI::base() . 'index.php?option=com_content&view=article' . '&id=' . JText::_(strtoupper($this->NAME) . 'LIST_SUGO') . '&Itemid=435&tmpl=component';
$this->view->set('Akciok', $akciok);
// globális képviselő/képviselő jelölt gombok definiálása
$altKepviselo = array();
$altKepviselo['kepviselojeLink'] = '';
$kepviselo = array();
$kepviselo['kepviselojeLink'] = '';
$kepviselo['kepviseloJeloltLink'] = '';
$kepviselo['kepviselotValasztLink'] = '';
$kepviselo['ujJeloltLink'] = '';
if ($user->id > 0) {
if ($altKepviseloje > 0) {
$kepviseloUser = JFactory::getUser($altKepviseloje);
if ($kepviseloUser) {
$userEx = HsUser::getInstance($altKepviseloje);
$altKepviselo['kepviselojeLink'] = JURI::base() . 'index.php?option=com_kepviselok&task=show&id=' . $altKepviseloje;
if (isset($userEx->image)) {
$altKepviselo['image'] = $userEx->get('image');
} else {
$altKepviselo['image'] = '<img src="components/com_hs_users/asset/images/noimage.png" width="50" height="50" />';
}
$altKepviselo['nev'] = $kepviseloUser->name;
}
}
if ($kepviseloje > 0) {
$kepviseloUser = JFactory::getUser($kepviseloje);
if ($kepviseloUser) {
$userEx = HsUser::getInstance($kepviseloje);
$kepviselo['kepviselojeLink'] = JURI::base() . 'index.php?option=com_kepviselok&task=show&id=' . $kepviseloje;
if (isset($userEx->image)) {
$kepviselo['image'] = $userEx->get('image');
} else {
$kepviselo['image'] = '<img src="components/com_hs_users/asset/images/noimage.png" width="50" height="50" />';
}
$kepviselo['nev'] = $kepviseloUser->name;
}
} else {
if ($kepviseloJelolt) {
$kepviselo['kepviseloJeloltLink'] = JURI::base() . 'index.php?option=com_kepviselo&task=edit&id=' . $user->id;
} else {
$kepviselo['kepviselotValasztLink'] = JURI::base() . 'index.php?option=com_kepviselok&task=find&temekor=' . $this->temakor_id . '&szavazas=0';
$kepviselo['ujJeloltLink'] = JURI::base() . 'index.php?option=com_kepviselojeloltek&task=add&temekor=' . $this->temakor_id . '&szavazas=0&id=' . $user->id;
}
}
}
$this->view->set('Kepviselo', $kepviselo);
$this->view->set('AltKepviselo', $altKepviselo);
//lapozósor definiálása
jimport('joomla.html.pagination');
$total = $this->model->getTotal($filterStr);
$pagination = new JPagination($total, $limitStart, $limit);
$pagination->setAdditionalUrlParam('order', $order);
$pagination->setAdditionalUrlParam('filterStr', urlencode($filterStr));
$this->view->set('Lapozosor', $pagination->getListFooter());
$this->view->display();
}
示例4: testSetEmptyAdditionalUrlParam
/**
* This method tests the setAdditionalUrlParam function by emptying an existing URL.
*
* @return void
*
* @covers JPagination::setAdditionalUrlParam
* @since 3.1
*/
public function testSetEmptyAdditionalUrlParam()
{
$pagination = new JPagination(100, 50, 20, '', $this->app);
$pagination->setAdditionalUrlParam('Joomla', '//www.joomla.org');
$this->assertEquals(TestReflection::getValue($pagination, 'additionalUrlParams'), array('Joomla' => '//www.joomla.org'), 'The URL is not the value expected');
$pagination->setAdditionalUrlParam('Joomla', null);
$this->assertArrayNotHasKey('Joomla', TestReflection::getValue($pagination, 'additionalUrlParams'));
unset($pagination);
}
示例5: getStreamDataHTML
public function getStreamDataHTML($filter = array(), $options = array())
{
jimport('joomla.html.pagination');
$app = JFactory::getApplication();
$jconfig = new JConfig();
$html = '';
$user = JXFactory::getUser();
if ($mention = JRequest::getVar('mention', '')) {
$filter['mention'] = '@' . $mention;
}
if ($user_id = JRequest::getVar('user_id', '')) {
$filter['user_id'] = $user_id;
}
if ($search = JRequest::getVar('search', '')) {
$filter['search'] = $search;
}
if ($group_id = JRequest::getVar('group_id', '')) {
$filter['group_id'] = $group_id;
}
if ($limit_start = JRequest::getVar('limitstart', '')) {
$filter['limitstart'] = $limit_start;
}
if ($overdue = JRequest::getVar('overdue', '')) {
$date = new JDate();
$filter['end_date'] = $date->toMySQL();
}
// Order by 'updated'
$filter['order_by_desc'] = 'updated';
$model = StreamFactory::getModel('stream');
$data = $model->getStream($filter, $jconfig->list_limit, JRequest::getVar('limitstart', 0));
$total = $model->countStream($filter);
// Set $user if user_id filter is specified
if (isset($filter['user_id'])) {
$user = JXFactory::getUser($filter['user_id']);
}
$tmpl = new StreamTemplate();
$tmpl->set('user', $user);
if (isset($options['filter'])) {
$html = $tmpl->fetch($options['filter']);
} else {
if (!isset($options['hide_filter'])) {
$html = $tmpl->fetch('stream.filter');
}
}
// Pagination
$pagination = new JPagination($total, JRequest::getVar('limitstart', 0), $jconfig->list_limit);
// If URI is defined, we need to set the pagination link properly
if ($uri = JRequest::getVar('uri', '')) {
$uri = new JURI($uri);
$router = $app->getRouter();
$result = $router->parse($uri);
foreach ($result as $key => $val) {
$pagination->setAdditionalUrlParam($key, $val);
}
}
$tmpl = new StreamTemplate();
$tmpl->set('rows', $data);
$tmpl->set('total', $total);
$tmpl->set('pagination', $pagination);
$tmpl->set('options', $options);
$html .= $tmpl->fetch('stream.data');
return $html;
}
示例6: display
//.........这里部分代码省略.........
$this->setLayout('category');
$user = JFactory::getUser();
$this->assignRef('user', $user);
// Set limit
$limit = $params->get('num_leading_items') + $params->get('num_primary_items') + $params->get('num_secondary_items') + $params->get('num_links');
// Set featured flag
JRequest::setVar('featured', $params->get('catFeaturedItems'));
// Set title
$title = $params->get('page_title');
// Set ordering
$ordering = $params->get('catOrdering');
$addHeadFeedLink = $params->get('catFeedLink', 1);
break;
}
// Set limit for model
if (!$limit) {
$limit = 10;
}
JRequest::setVar('limit', $limit);
// Get items
if (!isset($ordering)) {
$items = $model->getData();
} else {
$items = $model->getData($ordering);
}
if (count($items) == 0) {
return JError::raiseNotice(500, JText::_('SEARCH_RESULT_NULL'));
}
// Pagination
jimport('joomla.html.pagination');
$total = count($items) ? $model->getTotal() : 0;
$pagination = new JPagination($total, $limitstart, $limit);
$vars = JRequest::get('get');
$pagination->setAdditionalUrlParam('Itemid', $vars['Itemid']);
//Fix bug: page navigation does not work properly if SEF is enabled
/*
if(count($vars)) {
foreach ($vars as $k => $v) {
if($k == 'task') continue;
if(is_array($v)) {
foreach ($v as $sk => $sv) {
$pagination->setAdditionalUrlParam($k.'['.$sk.']', $sv);
}
} else {
$pagination->setAdditionalUrlParam($k, $v);
}
}
}*/
//Prepare items
$user = JFactory::getUser();
$cache = JFactory::getCache('com_k2_extended');
$model = JModelLegacy::getInstance('item', 'K2Model');
for ($i = 0; $i < sizeof($items); $i++) {
//Item group
// JA K2 FILTER - using category view for displaying search result
if ($task == "category" || $task == "search" || $task == "") {
if ($i < $params->get('num_links') + $params->get('num_leading_items') + $params->get('num_primary_items') + $params->get('num_secondary_items')) {
$items[$i]->itemGroup = 'links';
}
if ($i < $params->get('num_secondary_items') + $params->get('num_leading_items') + $params->get('num_primary_items')) {
$items[$i]->itemGroup = 'secondary';
}
if ($i < $params->get('num_primary_items') + $params->get('num_leading_items')) {
$items[$i]->itemGroup = 'primary';
}
if ($i < $params->get('num_leading_items')) {
示例7: ujTag
/**
* ujTag felvételi form
* @return void
* &JRequest: limit, limitstart, filterStr, order
*/
public function ujTag()
{
JHTML::_('behavior.modal');
$total = 0;
$pagination = null;
$user = JFactory::getUser();
$db = JFactory::getDBO();
if (!$this->temakorokHelper->isAdmin($user) & !$this->temakor_admin) {
echo '<div class="">Access denied</div>';
return;
}
// alapértelmezett browser status beolvasása sessionból
$session = JFactory::getSession();
$brStatusStr = '{"limit":20,"limitstart":0,"order":1,"filterStr":""}';
$brStatus = JSON_decode($brStatusStr);
$limitStart = JRequest::getVar('limitstart', $brStatus->limitstart);
$limit = JRequest::getVar('limit', $brStatus->limit);
$order = JRequest::getVar('order', $brStatus->order);
$filterStr = urldecode(JRequest::getVar('filterStr', $brStatus->filterStr));
JRequest::setVar('limit', $limit);
JRequest::setVar('limitstart', $limitStart);
JRequest::setVar('order', $order);
JRequest::setVar('filterStr', $filterStr);
// adattábla tartalom elérése és átadása a view -nek
$items = $this->model->getItems();
//DBG echo $this->model->getDBO()->getQuery();
$this->view->set('Items', $items);
// browser müködéshez linkek definiálása
$reorderLink = JURI::base() . 'index.php?option=com_' . $this->NAME . '&view=' . $this->NAME . 'list&tas=ujTag' . '&limit=' . JRequest::getVar('limit', '20') . '&limitstart=0' . '&temakor=' . $this->temakor_id . '&filterStr=' . urlencode($filterStr);
$doFilterLink = JURI::base() . 'index.php?option=com_' . $this->NAME . '&view=' . $this->NAME . 'list&task=ujTag' . '&limit=' . JRequest::getVar('limit', '20') . '&limitstart=0' . '&temakor=' . $this->temakor_id . '&order=' . JRequest::getVar('order', '1');
if ($this->temakor_id > 0) {
$itemLink = JURI::base() . 'index.php?option=com_tagok&view=tagok&task=doujtag' . '&limit=' . JRequest::getVar('limit', '20') . '&limitstart=0' . '&filterStr=' . urlencode($filterStr) . '&temakor=' . $this->temakor_id . '&order=' . JRequest::getVar('order', '1');
}
$this->view->set('reorderLink', $reorderLink);
$this->view->set('doFilterLink', $doFilterLink);
$this->view->set('itemLink', $itemLink);
// akciók definiálása
$akciok = array();
if ($this->temakor_id > 0) {
$akciok['temakor'] = JURI::base() . 'index.php?option=com_szavazasok&view=szavazasoklist&task=browse' . '&temakor=' . $this->temakor_id;
} else {
$akciok['temakorok'] = JURI::base() . 'index.php?option=com_temakorok&view=temakoroklist&task=browse';
}
$akciok['sugo'] = JURI::base() . 'index.php?option=com_content&view=article' . '&id=' . JText::_('UJTAG_SUGO') . '&Itemid=435&tmpl=component';
$this->view->set('Akciok', $akciok);
$this->view->set('Title', JText::_('UJTAG'));
$this->view->set('Temakor', $this->temakor);
//lapozósor definiálása
jimport('joomla.html.pagination');
$total = $this->model->getTotal($filterStr);
$pagination = new JPagination($total, $limitStart, $limit);
$pagination->setAdditionalUrlParam('order', $order);
$pagination->setAdditionalUrlParam('filterStr', urlencode($filterStr));
$pagination->setAdditionalUrlParam('temakor', $this->temakor_id);
$this->view->set('LapozoSor', $pagination->getListFooter());
$this->view->setLayout('ujtag');
$this->view->display();
}
示例8: _pagination
/** function that will create pagination for views
* @param object $setLimit
* total - total number of rows
* start - number or index to start e.g 0 ( will start from 0 - limit )
* value - ending number or limit e.g 20 ( will only show 20 rows )
* @return $display
*/
private static function _pagination($setLimit, $onlyBox = false, $showTotal = false)
{
jimport('joomla.html.pagination');
$total = $setLimit->total;
$start = $setLimit->start;
$value = $setLimit->end;
$pagination = new JPagination($total, $start, $value);
//alex pagination
$pagination->setAdditionalUrlParam('limit', JRequest::getVar('limit'));
if (version_compare(JVERSION, '3.0.0', '<')) {
if ($onlyBox) {
$display = "<div class=\"list-footer\">\n";
$display .= "\n<div class=\"limit\" style=\"float:left; height:22px; line-height:22px; margin:0 10px;\">" . JText::_('Display Num') . ' ' . $pagination->getLimitBox() . "</div>";
$display .= "\n<div class=\"counter\" style=\"float:left; height:22px; line-height:22px; margin:0 10px;\">" . ' ' . $pagination->getPagesCounter() . "</div>";
if ($showTotal) {
$display .= "\n<div class=\"outof\" style=\"float:left; height:22px; line-height:22px; margin:0 10px;\">" . ' ' . JText::_('Total Result:') . ' <span style="font-weight: bold; text-decoration: underlined;">' . $total . "</span></div>";
}
$display .= "\n</div>";
} else {
$display = $pagination->getListFooter();
}
} else {
$display = '<div style="display:inline; font-size:14px;">';
$display .= '<div class="jnews_pagination_one" style="float:right; margin-left:15px;">';
$display .= $pagination->getLimitBox();
$display .= '</div>';
$pagi = $pagination->getListFooter();
if (!empty($pagi)) {
$display .= '<div class="jnews_pagination" style="float:right; margin-left:15px;">';
$display .= $pagi;
$display .= '</div>';
}
$pagi = $pagination->getPagesCounter();
if (!empty($pagi)) {
$display .= '<div style="float:right;padding-top: 4px;">';
$display .= $pagi;
$display .= '</div>';
}
$display .= '</div>';
}
return $display;
}
示例9: szavazatok
/**
* képviselő eddigi szavazatainak megjelenítése
* (böngésző képernyő)
* @return void
* @JRequest integer temakor
* @JRequest integer id - kepviselo_id
* @JRequest integer limitstart
* @JRequest integer limit
* @JRequest string filterStr
* @JRequest integer order
*/
public function szavazatok()
{
JHTML::_('behavior.modal');
$total = 0;
$pagination = null;
$user = JFactory::getUser();
$db = JFactory::getDBO();
$document = JFactory::getDocument();
$viewType = $document->getType();
$view =& $this->getView('szavazatoklist', $viewType);
$model =& $this->getModel('szavazatoklist');
// alapértelmezett browser status beolvasása sessionból
$session = JFactory::getSession();
$brStatusStr = $session->get('szavazasoklist_status');
if ($brStatusStr == '') {
$brStatusStr = '{"limit":20,"limitstart":0,"order":1,"filterStr":""}';
}
$brStatus = JSON_decode($brStatus);
$limitStart = JRequest::getVar('limitstart', $brStatus->limitstart);
$limit = JRequest::getVar('limit', $brStatus->limit);
$order = JRequest::getVar('order', $brStatus->order);
$filterStr = urldecode(JRequest::getVar('filterStr', $brStatus->filterStr));
// browser status save to session and JRequest
$brStatus->limit = $limit;
$brStatus->limitStart = $limitStart;
$brStatus->order = $order;
$brStatus->filterStr = $filterStr;
// ebben az esetben inkább ne jegyezze meg....
//$session->set('szavazatoklist_status', JSON_encode($brStatus));
JRequest::setVar('limit', $limit);
JRequest::setVar('limitstart', $limitStart);
JRequest::setVar('order', $order);
JRequest::setVar('filterStr', $filterStr);
// adattábla tartalom elérése és átadása a view -nek
$items = $model->getItems();
//DBG echo '<p>'.$model->getDBO()->getQuery().'</p>';
// items-temakor-user hozzáférés ellenörzés
if ($this->temakorokHelper->isAdmin($user) == false) {
for ($i = 0; $i < count($items); $i++) {
$item = $items[$i];
if ($item->lathatosag == 1 & $user->id == 0 | $item->lathatosag == 2 & $this->temakorokHelper->userTag($item->id, $user) == false) {
// letiltott
$items[$i]->szmegenevezes = '***';
$items[$i]->amegenevezes = '***';
$items[$i]->pozicio = '**';
}
}
}
$view->set('Items', $items);
// témakör beolvasása
$db->setQuery('select * from #__temakorok where id="' . JRequest::getVar('temakor', 0) . '"');
$view->Temakor = $db->loadObject();
if ($view->Temakor == false) {
$view->Temakor = new stdclass();
$view->Temakor->megnevezes = JText::_('ALTALANOSKEPVISELO');
$view->Temakor->id = 0;
} else {
$view->Temakor->megnevezes .= ' ' . JText::_('KEPVISELO');
}
// képviselő adatok beolvasása
$view->set('Kuser', JFactory::getUser(JRequest::getVar('id', 0)));
// browser müködéshez linkek definiálása
$reorderLink = JURI::base() . 'index.php?option=com_kepviselok&view=kepviselok&task=szavazatok' . '&limit=' . JRequest::getVar('limit', '20') . '&limitstart=0' . '&filterStr=' . urlencode($filterStr) . '&temakor=' . JRequest::getVar('temakor') . '&id=' . JRequest::getVar('id', 0);
$doFilterLink = JURI::base() . 'index.php?option=com_kepviselok&view=kepviselok&task=add' . '&limit=' . JRequest::getVar('limit', '20') . '&limitstart=0' . '&order=' . JRequest::getVar('order', '1') . '&temakor=' . JRequest::getVar('temakor') . '&id=' . JRequest::getVar('id', 0);
$view->set('reorderLink', $reorderLink);
$view->set('doFilterLink', $doFilterLink);
// akciók definiálása
$akciok = array();
$akciok['back'] = JURI::base() . 'index.php?option=com_kepviselok&view=kepviselok&task=show' . '&temakor=' . JRequest::getVar('temakor') . '&id=' . JRequest::getVar('id', 0);
$akciok['sugo'] = JURI::base() . 'index.php?option=com_content&view=article' . '&id=' . JText::_('SZAVAZATOKSUGO') . '&Itemid=435&tmpl=component';
$view->set('Akciok', $akciok);
//lapozósor definiálása
jimport('joomla.html.pagination');
$total = $model->getTotal($filterStr);
$pagination = new JPagination($total, $limitStart, $limit);
$pagination->setAdditionalUrlParam('order', $order);
$pagination->setAdditionalUrlParam('filterStr', urlencode($filterStr));
$view->set('LapozoSor', $pagination->getListFooter());
// display
$view->setLayout('browse');
$view->display();
}
示例10: browse
//.........这里部分代码省略.........
$akciok['alternativaedit'] = JURI::base() . 'index.php?option=com_alternativak&view=alternativak&task=edit' . '&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
}
}
if ($this->temakorokHelper->isAdmin($user) | $this->temakor_admin | $this->temakorIndito($this->temakor_id, $user)) {
if ($this->szavazas->vita1 == 1) {
$akciok['alternativatorles'] = JURI::base() . 'index.php?option=com_alternativak&view=alternativak&task=deleteform' . '&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
}
}
if ($this->szavazas->szavazas == 1 & $user->id > 0) {
// a szavazás folyamatban van és bejelentkezett user
$db = JFactory::getDBO();
$db->setQuery('select id from #__szavazatok
where szavazas_id="' . $this->szavazas_id . '" and
user_id="' . $user->id . '"');
$res = $db->loadObjectList();
if (count($res) == 0) {
// ez a user még nem szavazott
if ($this->szavazas->szavazok == 1 | $this->szavazas->szavazok == 2 & $this->temakorokHelper->userTag($this->temakor_id, $user, false) | $this->szavazas->szavazok == 3 & $this->temakorokHelper->userTag($this->temakor_id, $user, true)) {
$akciok['szavazok'] = JURI::base() . 'index.php?option=com_szavazasok&view=szavazasok&task=szavazoform&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
}
} else {
$akciok['szavaztal'] = 'Y';
if ($this->szavazas->titkos == 0) {
$akciok['szavazatTorles'] = JURI::base() . 'index.php?option=com_alternativak&&task=szavazattorles&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
}
}
}
// if ($this->szavazas->lezart == 1) {
$akciok['eredmeny'] = JURI::base() . 'index.php?option=com_szavazasok&view=szavazasok&task=eredmeny&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
// }
if ($this->szavazas->szavazas == 1 & $user->id > 0) {
$akciok['emailszavazas'] = JURI::base() . 'index.php?option=com_szavazasok&view=szavazasok&task=meghivo&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
}
$akciok['copy'] = JURI::base() . 'index.php?option=com_alternativak&view=alternativaklist&task=copy' . '&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
$akciok['tagok'] = JURI::base() . 'index.php?option=com_tagok&temakor=' . $this->temakor_id;
$akciok['sugo'] = JURI::base() . 'index.php?option=com_content&view=article' . '&id=' . JText::_(strtoupper($this->NAME) . 'LIST_SUGO') . '&Itemid=435&tmpl=component';
$akciok['deleteSzavazas'] = JURI::base() . 'index.php?option=com_szavazasok&view=szavazasok&task=deleteform' . '&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
$this->view->set('Akciok', $akciok);
// globális képviselő/képviselő jelölt gombok definiálása
$altKepviselo = array();
$altKepviselo['kepviselojeLink'] = '';
$kepviselo = array();
$kepviselo['kepviselojeLink'] = '';
$kepviselo['kepviseloJeloltLink'] = '';
$kepviselo['kepviselotValasztLink'] = '';
$kepviselo['ujJeloltLink'] = '';
if ($user->id > 0) {
if ($altKepviseloje > 0) {
$kepviseloUser = JFactory::getUser($altKepviseloje);
if ($kepviseloUser) {
$userEx = HsUser::getInstance($altKepviseloje);
$altKepviselo['kepviselojeLink'] = JURI::base() . 'index.php?option=com_kepviselok&task=show&id=' . $altKepviseloje;
if (isset($userEx->image)) {
$altKepviselo['image'] = $userEx->get('image');
} else {
$altKepviselo['image'] = '<img src="components/com_hs_users/asset/images/noimage.png" width="50" height="50" />';
}
$altKepviselo['nev'] = $kepviseloUser->name;
}
}
if ($kepviseloje > 0) {
$kepviseloUser = JFactory::getUser($kepviseloje);
if ($kepviseloUser) {
$userEx = HsUser::getInstance($kepviseloje);
$kepviselo['kepviselojeLink'] = JURI::base() . 'index.php?option=com_kepviselok&task=show&id=' . $kepviseloje;
if (isset($userEx->image)) {
$kepviselo['image'] = $userEx->get('image');
} else {
$kepviselo['image'] = '<img src="components/com_hs_users/asset/images/noimage.png" width="50" height="50" />';
}
$kepviselo['nev'] = $kepviseloUser->name;
}
} else {
if ($kepviseloJelolt) {
$kepviselo['kepviseloJeloltLink'] = JURI::base() . 'index.php?option=com_kepviselo&task=edit&id=' . $user->id;
} else {
$kepviselo['kepviselotValasztLink'] = JURI::base() . 'index.php?option=com_kepviselok&task=find&temekor=' . $this->temakor_id . '&szavazas=0';
$kepviselo['ujJeloltLink'] = JURI::base() . 'index.php?option=com_kepviselojeloltek&task=add&temekor=' . $this->temakor_id . '&szavazas=0&id=' . $user->id;
}
}
}
$this->view->set('Kepviselo', $kepviselo);
$this->view->set('AltKepviselo', $altKepviselo);
//lapozósor definiálása
jimport('joomla.html.pagination');
$total = $this->model->getTotal($filterStr);
$pagination = new JPagination($total, $limitStart, $limit);
$pagination->setAdditionalUrlParam('order', $order);
$pagination->setAdditionalUrlParam('filterStr', urlencode($filterStr));
$this->view->set('LapozoSor', $pagination->getListFooter());
// kacsolodó cikk id-jének elérése és átadása a viewer-nek
$db->setQuery('SELECT id from #__content WHERE alias="sz' . $this->szavazas_id . '"');
$res = $db->loadObject();
if ($res) {
$this->view->set('CommentId', $res->id);
} else {
$this->view->set('CommentId', 0);
}
$this->view->display();
}
示例11: szavaztam
/**
* szavaztam
* @return void
* @request integer limit
* @request integer limitstart
* @request integer order
* @request integer filterStr
* @session object 'temakoroklist_status'
*/
public function szavaztam()
{
jimport('hs.user.user');
JHTML::_('behavior.modal');
$total = 0;
$pagination = null;
$user = JFactory::getUser();
$db = JFactory::getDBO();
// hozzáférés ellenörzés
if ($user->id == 0) {
$this->temakorokHelper->getLogin(JText::_('JELENTKEZZBE'));
}
// alapértelmezett browser status beolvasása sessionból
$session = JFactory::getSession();
$brStatusStr = '{"limit":20,"limitstart":0,"order":1,"filterStr":"|1"}';
$brStatus = JSON_decode($brStatus);
$limitStart = JRequest::getVar('limitstart', $brStatus->limitstart);
$limit = JRequest::getVar('limit', $brStatus->limit);
$order = JRequest::getVar('order', $brStatus->order);
$filterStr = urldecode(JRequest::getVar('filterStr', $brStatus->filterStr));
if ($this->temakor_id == '') {
$this->temakor_id = $brStatus->temakor_id;
}
JRequest::setVar('limit', $limit);
JRequest::setVar('limitstart', $limitStart);
JRequest::setVar('order', $order);
JRequest::setVar('filterStr', $filterStr);
JRequest::setVar('temakor', $this->temakor_id);
// adattábla tartalom elérése és átadása a view -nek
$items = $this->model->getItems();
if ($this->model->getDBO()->getErrorNum() > 0) {
$this->model->getDBO()->stderr();
}
if ($this->model->getError() != '') {
$this->view->Msg = $this->model->getError();
}
$this->view->set('Items', $items);
$this->view->set('Title', JText::_('SZAVAZASOK_SZAVAZTAM'));
// browser müködéshez linkek definiálása
$reorderLink = JURI::base() . 'index.php?option=com_' . $this->NAME . '&view=szavazhatok&task=szavazhatok' . '&limit=' . JRequest::getVar('limit', '20') . '&limitstart=0' . '&filterStr=' . urlencode($filterStr) . '&temakor=' . $this->temakor_id;
$doFilterLink = JURI::base() . 'index.php?option=com_' . $this->NAME . '&view=szavazhatok&task=szavazhatok' . '&limit=' . JRequest::getVar('limit', '20') . '&limitstart=0' . '&order=' . JRequest::getVar('order', '1') . '&temakor=' . $this->temakor_id;
$itemLink = JURI::base() . 'index.php?option=com_alternativak&view=alternativaklist&task=szavazhatok' . '&task=browse' . '&limit=' . JRequest::getVar('limit', '20') . '&limitstart=0' . '&filterStr=' . urlencode($filterStr) . '&order=' . JRequest::getVar('order', '1');
$backLink = JURI::base() . 'index.php?option=com_temakorok&view=temakoroklist' . '&task=browse';
$this->view->set('reorderLink', $reorderLink);
$this->view->set('doFilterLink', $doFilterLink);
$this->view->set('itemLink', $itemLink);
$this->view->set('backLink', $backLink);
$this->view->set('temakorLink', $temakorLink);
// kik a szavazaás felvivők?
$szavazas_felvivo = $this->szavazas_felvivo();
// akciók definiálása
$akciok = array();
$this->view->set('Akciok', $akciok);
//lapozósor definiálása
jimport('joomla.html.pagination');
$total = $this->model->getTotal($filterStr);
$pagination = new JPagination($total, $limitStart, $limit);
$pagination->setAdditionalUrlParam('order', $order);
$pagination->setAdditionalUrlParam('filterStr', urlencode($filterStr));
$this->view->set('LapozoSor', $pagination->getListFooter());
$this->view->display();
}
示例12: showMessages
public function showMessages()
{
jimport('joomla.html.pagination');
$app = JFactory::getApplication();
$my = JXFactory::getUser();
$jconfig = new JConfig();
$html = '';
if ($ids = JRequest::getVar('ids', '')) {
$filter['id'] = $ids;
}
$model = StreamFactory::getModel('stream');
$data = $model->getStream($filter, $jconfig->list_limit, JRequest::getVar('limitstart', 0));
// for some reason, data retrieved has not permissable view message
foreach ($data as $streamMsg) {
if (!$my->authorise('stream.message.read', $streamMsg)) {
$app = JFactory::getApplication();
$app->redirect(JURI::base(), JText::_('COM_STREAM_ERROR_NO_ACCESS'), 'error');
exit;
}
}
$total = $model->countStream($filter);
// Pagination
$pagination = new JPagination($total, JRequest::getVar('limitstart', 0), $jconfig->list_limit);
// If URI is defined, we need to set the pagination link properly
if ($uri = JRequest::getVar('uri', '')) {
$uri = new JURI($uri);
$router = $app->getRouter();
$result = $router->parse($uri);
foreach ($result as $key => $val) {
$pagination->setAdditionalUrlParam($key, $val);
}
}
$tmpl = new StreamTemplate();
$tmpl->set('rows', $data);
$tmpl->set('total', $total);
$tmpl->set('pagination', $pagination);
$html .= $tmpl->fetch('stream.data');
return $html;
}