Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Configuration/TCA/Overrides/sys_template.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php
if (!defined ('TYPO3_MODE')) {
die ('Access denied.');
}
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile('pagebrowse', 'static/page_browser/', 'Page browser');
8 changes: 8 additions & 0 deletions Configuration/TCA/Overrides/tt_content.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

// Add pi1 plugin
$TCA['tt_content']['types']['list']['subtypes_excludelist']['pagebrowse_pi1'] = 'layout,select_key,pages';
$TCA['tt_content']['types']['list']['subtypes_addlist']['pagebrowse_pi1'] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(
array('LLL:EXT:pagebrowse/pi1/locallang.xml:tt_content.list_type_pi1','pagebrowse_pi1'), 'list_type', 'pagebrowse');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('pagebrowse_pi1', 'FILE:EXT:pagebrowse/pi1/flexform_ds.xml');
25 changes: 25 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "dmitryd/pagebrowse",
"type": "typo3-cms-extension",
"description": "Universal page browser",
"license": ["GPL-2.0+"],
"version": "2.0.0",
"require": {
"typo3/cms-core": ">6.2"
},
"replace": {
"pagebrowse": "*"
},
"extra": {
"typo3/cms": {
"Package": {
"partOfFactoryDefault": false
}
}
},
"autoload": {
"classmap": [
"pi1/"
]
}
}
6 changes: 3 additions & 3 deletions ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
'clearCacheOnLoad' => 0,
'lockType' => '',
'author_company' => '',
'version' => '1.3.3',
'version' => '2.0.0',
'constraints' => array(
'depends' => array(
'typo3' => '4.5.0-0.0.0',
'php' => '5.3.2-10.0.0',
'typo3' => '6.2.0-0.0.0',
'php' => '5.5.0-10.0.0',
),
'conflicts' => array(
),
Expand Down
4 changes: 1 addition & 3 deletions ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@

if (!defined ('TYPO3_MODE')) die('Access denied.');

t3lib_extMgm::addPItoST43($_EXTKEY, 'pi1/class.tx_pagebrowse_pi1.php', '_pi1', 'list_type', 1);

?>
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43($_EXTKEY, 'pi1/class.tx_pagebrowse_pi1.php', '_pi1', 'list_type', 1);
13 changes: 0 additions & 13 deletions ext_tables.php

This file was deleted.

37 changes: 13 additions & 24 deletions pi1/class.tx_pagebrowse_pi1.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@
*/


use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* This class implements page browser plugin
*
* @author Dmitry Dulepov [netcreators] <dmitry@typo3.org>
*/
class tx_pagebrowse_pi1 extends tslib_pibase {
class tx_pagebrowse_pi1 extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
// Default plugin variables:
public $prefixId = 'tx_pagebrowse_pi1';
public $scriptRelPath = 'pi1/class.tx_pagebrowse_pi1.php';
Expand All @@ -50,6 +51,7 @@ class tx_pagebrowse_pi1 extends tslib_pibase {
protected $currentPage;
protected $pagesBefore = 3;
protected $pagesAfter = 3;
protected $templateCode;

const PAGE_FIRST = 0;
const PAGE_PREV = 1;
Expand Down Expand Up @@ -90,7 +92,7 @@ function init() {
$params = array(
'pObj' => &$this,
);
t3lib_div::callUserFunction($userFunc, $params, $this);
GeneralUtility::callUserFunction($userFunc, $params, $this);
}
}

Expand All @@ -100,15 +102,15 @@ function init() {
$this->currentPage = max(0, intval($this->piVars['page']));
}
else {
$parts = t3lib_div::trimExplode('|', $pageParameterName, 2);
$parts = GeneralUtility::trimExplode('|', $pageParameterName, 2);
if (count($parts) == 2) {
$this->pageParameterName = $parts[0] . '[' . $parts[1] . ']';
$vars = t3lib_div::_GP($parts[0]);
$vars = GeneralUtility::_GP($parts[0]);
$this->currentPage = max(0, intval($vars[$parts[1]]));
}
else {
$this->pageParameterName = $pageParameterName;
$this->currentPage = max(0, intval(t3lib_div::_GP($pageParameterName)));
$this->currentPage = max(0, intval(GeneralUtility::_GP($pageParameterName)));
}
}

Expand All @@ -129,7 +131,7 @@ function init() {
$params = array(
'pObj' => &$this,
);
t3lib_div::callUserFunction($userFunc, $params, $this);
GeneralUtility::callUserFunction($userFunc, $params, $this);
}
}

Expand Down Expand Up @@ -184,7 +186,7 @@ protected function addHeaderParts() {
$GLOBALS['TSFE']->additionalHeaderData[$key] =
$this->cObj->substituteMarkerArray($subPart, array(
'###SITE_REL_PATH###' => $GLOBALS['TSFE']->config['config']['absRefPrefix'] .
t3lib_extMgm::siteRelPath($this->extKey),
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey),
));
}
}
Expand Down Expand Up @@ -262,7 +264,7 @@ protected function createPageBrowser() {
'page' => $i,
'pObj' => &$this
);
t3lib_div::callUserFunction($userFunc, $params, $this);
GeneralUtility::callUserFunction($userFunc, $params, $this);
}
}
$pageLinks .= $this->cObj->substituteMarkerArray($template, $localMarkers);
Expand Down Expand Up @@ -290,7 +292,7 @@ protected function createPageBrowser() {
'pObj' => &$this,
'subparts' => &$subPartMarkers
);
t3lib_div::callUserFunction($userFunc, $params, $this);
GeneralUtility::callUserFunction($userFunc, $params, $this);
}
}

Expand Down Expand Up @@ -344,7 +346,7 @@ protected function getPageLink($page, $pageType) {
'pageType' => $pageType,
'pageNumber' => $page,
);
$additionalParams = t3lib_div::callUserFunction($userFunc, $params, $this);
$additionalParams = GeneralUtility::callUserFunction($userFunc, $params, $this);
}
}
// Assemble typolink configuration
Expand All @@ -363,19 +365,6 @@ protected function getPageLink($page, $pageType) {
* @return bool
*/
static protected function testInt($value) {
if (class_exists('\\TYPO3\\CMS\\Core\\Utility\\MathUtility')) {
$result = \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($value);
} elseif (class_exists('t3lib_utility_Math')) {
$result = t3lib_utility_Math::canBeInterpretedAsInteger($value);
} else {
$result = t3lib_div::testInt($value);
}
return $result;
return \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($value);
}
}

if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/pagebrowse/pi1/class.tx_pagebrowse_pi1.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/pagebrowse/pi1/class.tx_pagebrowse_pi1.php']);
}

?>