Skip to content

Commit

Permalink
add composer.json and Configuration/TCA/Overrides/pages.php
Browse files Browse the repository at this point in the history
  • Loading branch information
franzholz committed Mar 29, 2017
1 parent 2fed5e4 commit edeb705
Show file tree
Hide file tree
Showing 2 changed files with 138 additions and 0 deletions.
61 changes: 61 additions & 0 deletions Configuration/TCA/Overrides/pages.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php

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

$imageFile = PATH_TTPRODUCTS_ICON_TABLE_REL . 'tt_products.gif';

if (
version_compare(TYPO3_version, '7.5.0', '>')
) {
$iconRegistry =
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
$iconRegistry->registerIcon(
'tcarecords-pages-contains-tt_products',
\TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class,
array('source' => $imageFile)
);

$GLOBALS['TCA']['pages']['ctrl']['typeicon_classes']['contains-tt_products'] =
'tcarecords-pages-contains-tt_products';
} else {
// add folder icon
$pageType = 'ttpproduct';

$callingClassName = '\\TYPO3\\CMS\\Backend\\Sprite\\SpriteManager';
if (
class_exists($callingClassName) &&
method_exists($callingClassName, 'addTcaTypeIcon')
) {
call_user_func(
$callingClassName . '::addTcaTypeIcon',
'pages',
'contains-' . $pageType,
$imageFile
);
} else {
t3lib_SpriteManager::addTcaTypeIcon(
'pages',
'contains-' . $pageType,
$imageFile
);
}

$addToModuleSelection = TRUE;
foreach ($GLOBALS['TCA']['pages']['columns']['module']['config']['items'] as $item) {
if ($item['1'] == $pageType) {
$addToModuleSelection = FALSE;
continue;
}
}

if ($addToModuleSelection) {
$GLOBALS['TCA']['pages']['columns']['module']['config']['items'][] = array(
0 => 'LLL:EXT:' . TT_PRODUCTS_EXT . '/locallang.xml:pageModule.plugin',
1 => $pageType,
2 => 'EXT:' . TT_PRODUCTS_EXT . '/res/icons/table/tt_products.gif'
);
}
}

77 changes: 77 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"name": "jambagecom/tt-products",
"type": "typo3-cms-extension",
"description": "Shop system extension for TYPO3 CMS",
"keywords": [
"TYPO3",
"extension",
"shop",
"basket",
"cart"
],
"support": {
"issues": "http://jambage.com/kontakt/forum.html"
},
"homepage": "https://jambage.com",
"authors": [
{
"name": "Franz Holzinger",
"role": "Developer",
"homepage": "http://ttproducts.de"
}
],
"license": [
"GPL-2.0+"
],
"require": {
"typo3/cms-core": ">=4.5.0,<8.9.99",
"jambagecom/div2007": ">=1.7.0",
"jambagecom/table": ">=0.3.0",
"jambagecom/tsparser": "",
},
"suggest": {
"jambagecom/addons_em": "",
},
"autoload": {
"psr-4": {
"JambageCom\\TtProducts\\": "Classes"
},
"classmap": [
"api",
"cache",
"Classes",
"control",
"eid",
"hooks",
"lib",
"marker",
"model",
"modfunc1",
"modfunc2",
"pi1",
"pi_int",
"pi_search",
"view",
"widgets",
]
},
"replace": {
"tt_products": "self.version",
"typo3-ter/tt-products": "self.version"
},
"config": {
"vendor-dir": ".Build/vendor",
"bin-dir": ".Build/bin",
"preferred-install": {
"typo3/cms": "source",
"typo3/cms-core": "source",
"*": "dist"
}
},
"extra": {
"typo3/cms": {
"cms-package-dir": "{$vendor-dir}/typo3/cms",
"web-dir": ".Build/Web"
}
}
}

0 comments on commit edeb705

Please sign in to comment.