Skip to content
This repository has been archived by the owner on Nov 19, 2017. It is now read-only.

problem displaying images in FE #1

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/nbproject/
11 changes: 11 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
SmoothGallery
=============

A TYPO3 extension to create slideshow and galleries.

This is a fork of `rgsmoothgallery`_ 1.5.2 to provide TYPO3 6.2+ compatibility.

Read more in ``doc/`` folder.

.. _rgsmoothgallery: https://forge.typo3.org/projects/extension-rgsmoothgallery

2 changes: 0 additions & 2 deletions README.txt

This file was deleted.

428 changes: 199 additions & 229 deletions class.tx_rgsmoothgallery_fe.php

Large diffs are not rendered by default.

116 changes: 54 additions & 62 deletions class.tx_rgsmoothgallery_rgsg.php
Original file line number Diff line number Diff line change
@@ -1,69 +1,61 @@
<?php
class tx_rgsmoothgallery_rgsg {

function user_rgsg($content,$conf) {

require_once (PATH_t3lib.'class.t3lib_page.php');
require_once (PATH_t3lib.'class.t3lib_tstemplate.php');
require_once (PATH_t3lib.'class.t3lib_tsparser_ext.php');

$sysPageObj = t3lib_div::makeInstance('t3lib_pageSelect');
$rootLine = $sysPageObj->getRootLine($GLOBALS['TSFE']->id);
$TSObj = t3lib_div::makeInstance('t3lib_tsparser_ext');
$TSObj->tt_track = 0;
$TSObj->init();
$TSObj->runThroughTemplates($rootLine);
$TSObj->generateConfig();
$this->conf = $TSObj->setup['plugin.']['tx_rgsmoothgallery_pi1.'];

$split=strpos($GLOBALS['TSFE']->currentRecord,':');
$id = substr($GLOBALS['TSFE']->currentRecord,$split+1);
$where = 'uid ='.$id;
$table = 'tt_content';
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('imagewidth,imageheight',$table,$where,$groupBy='',$orderBy,$limit='');
$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);

$css .= ($row['imagewidth']) ? 'width:'.$row['imagewidth'].'px;' : '';
$css .= ($row['imageheight']) ? 'height:'.$row['imageheight'].'px;' : '';
$GLOBALS['TSFE']->additionalCSS['rgsmoothgallery'.$id] = '#myGallery'.$id.' {'.$css.'}';

if (t3lib_extMgm::isLoaded('t3mootools')) {
require_once(t3lib_extMgm::extPath('t3mootools').'class.tx_t3mootools.php');
}

if (defined('T3MOOTOOLS')) {
tx_t3mootools::addMooJS();

} else {
$header.= $this->getPath($this->conf['pathToMootools']) ? '<script src="'.$this->getPath($this->conf['pathToMootools']).'" type="text/javascript"></script>' :'';

}

// path to js + css

$GLOBALS['TSFE']->additionalHeaderData['rgsmoothgallery'] = $header.'
<script src="'.$this->getPath($this->conf['pathToJdgalleryJS']).'" type="text/javascript"></script>
<script src="'.$this->getPath($this->conf['pathToSlightboxJS']).'" type="text/javascript"></script>
<link rel="stylesheet" href="'.$this->getPath($this->conf['pathToJdgalleryCSS']).'" type="text/css" media="screen" />
<link rel="stylesheet" href="'.$this->getPath($this->conf['pathToSlightboxCSS']).'" type="text/css" media="screen" />
class tx_rgsmoothgallery_rgsg
{
public function user_rgsg($content, $conf)
{
$sysPageObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Page\\PageRepository');
$rootLine = $sysPageObj->getRootLine($GLOBALS['TSFE']->id);
$TSObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\TypoScript\\ExtendedTemplateService');
$TSObj->tt_track = 0;
$TSObj->init();
$TSObj->runThroughTemplates($rootLine);
$TSObj->generateConfig();
$this->conf = $TSObj->setup['plugin.']['tx_rgsmoothgallery_pi1.'];

$split = strpos($GLOBALS['TSFE']->currentRecord, ':');
$id = substr($GLOBALS['TSFE']->currentRecord, $split + 1);
$where = 'uid =' . $id;
$table = 'tt_content';
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('imagewidth,imageheight', $table, $where, $groupBy = '', $orderBy, $limit = '');
$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);

$css .= ($row['imagewidth']) ? 'width:' . $row['imagewidth'] . 'px;' : '';
$css .= ($row['imageheight']) ? 'height:' . $row['imageheight'] . 'px;' : '';
$GLOBALS['TSFE']->additionalCSS['rgsmoothgallery' . $id] = '#myGallery' . $id . ' {' . $css . '}';

if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('t3mootools')) {
require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('t3mootools') . 'class.tx_t3mootools.php';
}

if (defined('T3MOOTOOLS')) {
tx_t3mootools::addMooJS();
} else {
$header .= $this->getPath($this->conf['pathToMootools']) ? '<script src="' . $this->getPath($this->conf['pathToMootools']) . '" type="text/javascript"></script>' : '';
$header .= $this->getPath($this->conf['pathToMootoolsMore']) ? '<script src="' . $this->getPath($this->conf['pathToMootoolsMore']) . '" type="text/javascript"></script>' : '';
}

// path to js + css

$GLOBALS['TSFE']->additionalHeaderData['rgsmoothgallery'] = $header . '
<script src="' . $this->getPath($this->conf['pathToJdgalleryJS']) . '" type="text/javascript"></script>
<link rel="stylesheet" href="' . $this->getPath($this->conf['pathToJdgalleryCSS']) . '" type="text/css" media="screen" />
';

return $content;
}

return $content;
}


function getPath($path) {
if (substr($path,0,4)=='EXT:') {
$keyEndPos = strpos($path, '/', 6);
$key = substr($path,4,$keyEndPos-4);
$keyPath = t3lib_extMgm::siteRelpath($key);
$newPath = $keyPath.substr($path,$keyEndPos+1);
return $newPath;
} else {
return $path;
public function getPath($path)
{
if (substr($path, 0, 4) == 'EXT:') {
$keyEndPos = strpos($path, '/', 6);
$key = substr($path, 4, $keyEndPos - 4);
$keyPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelpath($key);
$newPath = $keyPath . substr($path, $keyEndPos + 1);

return $newPath;
} else {
return $path;
}
}
} # end getPath

}
?>
8 changes: 8 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "ecodev/rgsmoothgallery",
"type": "typo3-cms-extension",
"description": "Slideshow & Gallery. Shows images from directory folders, from records and inside tt_content (Element 'Text with images') DAM and tt_news. +Thumbnail-Browser.",
"homepage": "https://github.com/ecodev/rgsmoothgallery",
"license": "GPL-2.0+",
"keywords": ["TYPO3 CMS", "slider", "slideshow", "gallery"]
}
Binary file modified doc/manual.sxw
Binary file not shown.
1 change: 0 additions & 1 deletion doc/wizard_form.dat

This file was deleted.

12 changes: 0 additions & 12 deletions doc/wizard_form.html

This file was deleted.

76 changes: 30 additions & 46 deletions ext_emconf.php
Original file line number Diff line number Diff line change
@@ -1,50 +1,34 @@
<?php

########################################################################
# Extension Manager/Repository config file for ext: "rgsmoothgallery"
#
# Auto generated 09-03-2009 21:25
#
# Manual updates:
# Only the data in the array - anything else is removed by next write.
# "version" and "dependencies" must not be touched!
########################################################################

$EM_CONF[$_EXTKEY] = array(
'title' => 'SmoothGallery for TYPO3',
'description' => 'Slideshow & Gallery. Shows images from directory folders, from records and inside tt_content (Element "Text with images") DAM and tt_news. +Thumbnail-Browser, +Lightbox. Demo: http://www.rggooglemap.com/dev/rgsmoothgallery.html',
'category' => 'plugin',
'shy' => 0,
'version' => '1.5.1',
'dependencies' => '',
'conflicts' => '',
'priority' => '',
'loadOrder' => '',
'module' => '',
'state' => 'stable',
'uploadfolder' => 0,
'createDirs' => 'uploads/tx_rgsmoothgallery/',
'modify_tables' => '',
'clearcacheonload' => 1,
'lockType' => '',
'author' => 'Georg Ringer (just2b)',
'author_email' => 'http://www.just2b.com',
'author_company' => 'http://www.just2b.com',
'CGLcompliance' => '',
'CGLcompliance_note' => '',
'constraints' => array(
'depends' => array(
),
'conflicts' => array(
),
'suggests' => array(
'rgfolderselector' => '0.0.1',
't3mootools' => '1.0.0',
),
),
'_md5_values_when_last_written' => 'a:77:{s:9:"ChangeLog";s:4:"5272";s:10:"README.txt";s:4:"ee2d";s:31:"class.tx_rgsmoothgallery_fe.php";s:4:"85e6";s:33:"class.tx_rgsmoothgallery_rgsg.php";s:4:"3502";s:21:"ext_conf_template.txt";s:4:"c9b6";s:12:"ext_icon.gif";s:4:"ecd9";s:17:"ext_localconf.php";s:4:"8220";s:14:"ext_tables.php";s:4:"f8c5";s:14:"ext_tables.sql";s:4:"0d79";s:28:"ext_typoscript_constants.txt";s:4:"3b61";s:18:"flexformDAM_ds.xml";s:4:"6178";s:15:"flexform_ds.xml";s:4:"c433";s:33:"icon_tx_rgsmoothgallery_image.gif";s:4:"ecd9";s:13:"locallang.xml";s:4:"0d92";s:16:"locallang_db.xml";s:4:"1a7d";s:12:"savefile.php";s:4:"cd91";s:14:"t3mootools.txt";s:4:"c2f6";s:7:"tca.php";s:4:"a7aa";s:26:"res/css/externalThumbs.css";s:4:"6325";s:27:"res/css/externalThumbs2.css";s:4:"c95c";s:22:"res/css/jd.gallery.css";s:4:"8040";s:27:"res/css/jd.galleryColor.css";s:4:"fb23";s:26:"res/css/jd.galleryCool.css";s:4:"fac0";s:25:"res/css/jd.galleryMod.css";s:4:"a71a";s:18:"res/css/layout.css";s:4:"59a9";s:21:"res/css/slightbox.css";s:4:"68cb";s:26:"res/css/slightboxColor.css";s:4:"4211";s:27:"res/css/img/ajax-loader.gif";s:4:"37e2";s:19:"res/css/img/big.gif";s:4:"e438";s:23:"res/css/img/carrow1.gif";s:4:"6994";s:23:"res/css/img/carrow2.gif";s:4:"7502";s:21:"res/css/img/close.gif";s:4:"97ab";s:24:"res/css/img/close9yj.gif";s:4:"5bc0";s:29:"res/css/img/control_pause.png";s:4:"9c20";s:28:"res/css/img/control_play.png";s:4:"3170";s:33:"res/css/img/control_play_blue.png";s:4:"56f5";s:26:"res/css/img/cooldesign.zip";s:4:"4851";s:27:"res/css/img/cooldisplay.png";s:4:"ef80";s:24:"res/css/img/coolnext.gif";s:4:"8045";s:24:"res/css/img/coolplus.gif";s:4:"5a67";s:24:"res/css/img/coolprev.gif";s:4:"ef26";s:20:"res/css/img/disk.png";s:4:"bb6d";s:23:"res/css/img/fleche1.gif";s:4:"a413";s:23:"res/css/img/fleche1.png";s:4:"6193";s:23:"res/css/img/fleche2.gif";s:4:"3c35";s:23:"res/css/img/fleche2.png";s:4:"e0a1";s:20:"res/css/img/left.gif";s:4:"f785";s:33:"res/css/img/loading-bar-black.gif";s:4:"b010";s:34:"res/css/img/loading-bar-black2.gif";s:4:"d552";s:25:"res/css/img/nextlabel.gif";s:4:"485d";s:20:"res/css/img/open.gif";s:4:"15f6";s:20:"res/css/img/open.png";s:4:"c2b2";s:21:"res/css/img/pause.gif";s:4:"f56b";s:20:"res/css/img/play.gif";s:4:"3ad6";s:25:"res/css/img/prevlabel.gif";s:4:"d935";s:23:"res/css/img/printer.png";s:4:"2424";s:21:"res/css/img/right.gif";s:4:"0999";s:20:"res/css/img/save.gif";s:4:"6691";s:29:"res/scripts/HistoryManager.js";s:4:"8948";s:29:"res/scripts/jd.gallery1010.js";s:4:"352d";s:28:"res/scripts/jd.galleryMod.js";s:4:"fa47";s:23:"res/scripts/mootools.js";s:4:"9f73";s:36:"res/scripts/mootools.uncompressed.js";s:4:"de7f";s:29:"res/scripts/mootools.v1.00.js";s:4:"cf85";s:27:"res/scripts/slightbox107.js";s:4:"942d";s:15:"pi1/_ce_wiz.gif";s:4:"ecd9";s:14:"pi1/ce_wiz.gif";s:4:"9573";s:36:"pi1/class.tx_rgsmoothgallery_pi1.php";s:4:"3134";s:44:"pi1/class.tx_rgsmoothgallery_pi1_wizicon.php";s:4:"23b7";s:13:"pi1/clear.gif";s:4:"cc11";s:17:"pi1/locallang.xml";s:4:"f748";s:7:"pi1/tmp";s:4:"6c78";s:24:"pi1/static/editorcfg.txt";s:4:"bc8a";s:20:"pi1/static/setup.txt";s:4:"4160";s:14:"doc/manual.sxw";s:4:"6028";s:19:"doc/wizard_form.dat";s:4:"fa36";s:20:"doc/wizard_form.html";s:4:"6053";}',
'suggests' => array(
),
'title' => 'SmoothGallery for TYPO3',
'description' => 'Slideshow & Gallery. Shows images from directory folders, from records and inside tt_content (Element "Text with images") DAM and tt_news. +Thumbnail-Browser.',
'category' => 'plugin',
'shy' => 0,
'version' => '1.6.1',
'dependencies' => '',
'conflicts' => '',
'priority' => '',
'loadOrder' => '',
'module' => '',
'state' => 'stable',
'uploadfolder' => 0,
'createDirs' => 'uploads/tx_rgsmoothgallery/',
'modify_tables' => '',
'clearcacheonload' => 0,
'lockType' => '',
'author' => 'Georg Ringer (just2b)',
'author_email' => 'http://www.just2b.com',
'author_company' => 'http://www.just2b.com',
'CGLcompliance' => '',
'CGLcompliance_note' => '',
'constraints' => array(
'depends' => array(
'typo3' => '6.2.0-7.99.99',
),
'conflicts' => array(
),
'suggests' => array(
),
),
);

?>
24 changes: 13 additions & 11 deletions ext_localconf.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
<?php
if (!defined ('TYPO3_MODE')) die ('Access denied.');

## Extending TypoScript from static template uid=43 to set up userdefined tag:
t3lib_extMgm::addTypoScript($_EXTKEY,'editorcfg','
tt_content.CSS_editor.ch.tx_rgsmoothgallery_pi1 = < plugin.tx_rgsmoothgallery_pi1.CSS_editor
',43);
if (!defined('TYPO3_MODE')) {
die('Access denied.');
}

## Extending TypoScript from static template uid=43 to set up userdefined tag:
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript($_EXTKEY, 'editorcfg', '
tt_content.CSS_editor.ch.tx_rgsmoothgallery_pi1 = < plugin.tx_rgsmoothgallery_pi1.CSS_editor
', 43);

t3lib_extMgm::addPItoST43($_EXTKEY,'pi1/class.tx_rgsmoothgallery_pi1.php','_pi1','list_type',1);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43($_EXTKEY, 'pi1/class.tx_rgsmoothgallery_pi1.php', '_pi1', 'list_type', 1);

t3lib_extMgm::addUserTSConfig('
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig('
options.saveDocNew.tx_rgsmoothgallery_image=1
');

// hook for tt_news
if (TYPO3_MODE == 'FE') {
require_once(t3lib_extMgm::extPath($_EXTKEY).'class.tx_rgsmoothgallery_fe.php');
if (TYPO3_MODE == 'FE') {
require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'class.tx_rgsmoothgallery_fe.php';
}
$TYPO3_CONF_VARS['EXTCONF']['tt_news']['extraItemMarkerHook'][] = 'tx_rgsmoothgallery_fe';
$TYPO3_CONF_VARS['EXTCONF']['tt_news']['extraItemMarkerHook'][] = 'tx_rgsmoothgallery_fe';
#$TYPO3_CONF_VARS['EXTCONF']['tt_news']['extraGlobalMarkerHook'][] = 'tx_rgsmoothgallery_fe';
?>
;
Loading