Initial commit

This commit is contained in:
2018-04-02 08:07:38 +02:00
commit 7330c1ed3e
2054 changed files with 405203 additions and 0 deletions

View File

@@ -0,0 +1,205 @@
<?php
namespace TYPO3\TgmSocialshareprivacy\Controller;
/***************************************************************
* Copyright notice
*
* (c) 2014 Paul Beck <pb@teamgeist-medien.de>, Teamgeist Medien GbR
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
* Just always need this: \TYPO3\CMS\Core\Utility\DebugUtility::debug();
***************************************************************/
/**
*
*
* @package tgm_socialshareprivacy
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
*
*/
class SocialButtonController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
/**
* Include helper class
*
* @var \TYPO3\TgmSocialshareprivacy\Helper\HelperFunctions
* @inject
*/
protected $helperClass;
/**
* Content Object UID
* @var Number
*/
protected $cObjUid;
/**
* socialButtonRepository
*
* @var \TYPO3\TgmSocialshareprivacy\Domain\Repository\SocialButtonRepository
* @inject
*/
protected $socialButtonRepository;
/**
* Main buttons to show
*/
protected $main_buttons;
/**
* Additional buttons to show
*/
protected $additional_buttons;
/**
* Initialize action
* Adding required header data and Javascript
*
* @return void
*/
public function initializeAction() {
/** Combine Typoscript and Flexform settings first */
$this->settings = $this->helperClass->getSettings();
/** Get the cObj UID */
$this->cObjUid = $this->helperClass->getContentObjectUid();
if ($this->cObjUid == '') {
$this->cObjUid = 1;
}
/** Get the selected social buttons (main and additional buttons) */
/** @var \TYPO3\TgmSocialshareprivacy\Domain\Model\SocialButton */
$this->main_buttons = $this->socialButtonRepository->findByUids($this->settings['main_buttons']);
/** @var \TYPO3\TgmSocialshareprivacy\Domain\Model\SocialButton */
$this->additional_buttons = $this->socialButtonRepository->findByUids($this->settings['additional_buttons']);
/** Include Javascript libaries jQuery / jQuery UI depending on settings */
if($this->settings['include_jquery']) {
if($this->settings['include_to_footer']) {
$jqueryFile = '/typo3conf/ext/tgm_socialshareprivacy/Resources/Public/Javascript/jquery-1.10.2.js';
$GLOBALS['TSFE']->getPageRenderer()->addJsFooterFile ($jqueryFile, $type= 'text/javascript', $compress=FALSE, $forceOnTop=FALSE, $allWrap= '', $excludeFromConcatenation=TRUE);
}
else {
$this->response->addAdditionalHeaderData('<script src="typo3conf/ext/tgm_socialshareprivacy/Resources/Public/Javascript/jquery-1.10.2.js" type="text/javascript"></script>');
}
}
if($this->settings['include_jqueryui']) {
if($this->settings['include_to_footer']) {
$jqueryUiFile = '/typo3conf/ext/tgm_socialshareprivacy/Resources/Public/Javascript/jquery-ui-1.10.4.custom.min.js';
$GLOBALS['TSFE']->getPageRenderer()->addJsFooterFile ($jqueryUiFile, $type='text/javascript', $compress=FALSE, $forceOnTop=FALSE, $allWrap= '', $excludeFromConcatenation=TRUE);
}
else {
$this->response->addAdditionalHeaderData('<script src="typo3conf/ext/tgm_socialshareprivacy/Resources/Public/Javascript/jquery-ui-1.10.4.custom.min.js" type="text/javascript"></script>');
}
}
/** Add required extension Javascript, Javascript configuration, CSS and IE7 workaround */
if($this->settings['include_to_footer']) {
/** required extension Javascript */
$socialSharePrivacyJsFile = '/typo3conf/ext/tgm_socialshareprivacy/Resources/Public/Javascript/tgm_socialshareprivacy.js';
$GLOBALS['TSFE']->getPageRenderer()->addJsFooterFile ($socialSharePrivacyJsFile, $type= 'text/javascript', $compress=FALSE, $forceOnTop=FALSE, $allWrap= '', $excludeFromConcatenation=TRUE);
/** required CSS and IE7 workaround */
$this->response->addAdditionalHeaderData('
<link rel="stylesheet" type="text/css" href="'.$this->settings['css_path'].'" media="all">
<!--[if IE 7]>
<link rel="stylesheet" href="/typo3conf/ext/tgm_socialshareprivacy/Resources/Public/Css/fontello-ie7.css">
<![endif]-->
');
/** javascript configuration */
$socialSharePrivacyJsConfiguration = $this->renderJavascriptConfiguration();
$GLOBALS['TSFE']->getPageRenderer()->addJsFooterInlineCode ('socialSharePrivacyButtons', $socialSharePrivacyJsConfiguration, $compress=FALSE, $forceOnTop=FALSE);
}
else {
/** required extension Javascript, CSS and IE7 workaround */
$this->response->addAdditionalHeaderData('
<script src="typo3conf/ext/tgm_socialshareprivacy/Resources/Public/Javascript/tgm_socialshareprivacy.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="'.$this->settings['css_path'].'" media="all">
<!--[if IE 7]>
<link rel="stylesheet" href="/typo3conf/ext/tgm_socialshareprivacy/Resources/Public/Css/fontello-ie7.css">
<![endif]-->
');
/** javascript configuration */
$this->response->addAdditionalHeaderData('<script type="text/javascript">' . $this->renderJavascriptConfiguration() . '</script>');
}
// So könnte man auch CSS Dateien mit der TypoScript Methode einbinden
/*
$cssFile = $this->settings['css_path'];
$GLOBALS['TSFE']->getPageRenderer()->addCssFile ($cssFile, $rel='stylesheet', $media= 'all', $title= '', $compress=TRUE, $forceOnTop=FALSE, $allWrap= '');
*/
}
/**
* Index Action / Default View
*
* @return void
*/
public function indexAction() {
/** Pass the buttons and cObjUid to fluid */
$this->view->assignMultiple(array(
'socialbuttons' => $this->main_buttons,
'additional_socialbuttons' => $this->additional_buttons,
'cObjUid' => $this->cObjUid
));
}
/**
* Render the Javascript standalone template for configuration in FE
*
* @return string The rendered Javascript part
*/
public function renderJavascriptConfiguration() {
/** @var \TYPO3\CMS\Fluid\View\StandaloneView $javascriptConfigView */
$javascriptConfigView = $this->objectManager->get('TYPO3\\CMS\\Fluid\\View\\StandaloneView');
/** Define format */
$javascriptConfigView->setFormat('html');
$extbaseFrameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
/** Get configuration of the template from Typoscript */
$templateRootPath = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($extbaseFrameworkConfiguration['view']['templateRootPath']);
/** Set template path */
$templatePathAndFilename = $templateRootPath . 'Standalone/JavascriptConfiguration.html';
$javascriptConfigView->setTemplatePathAndFilename($templatePathAndFilename);
/** Pass the buttons, settings and cObjUid to the Fluid standalone template */
$javascriptConfigView->assignMultiple(array(
'socialbuttons' => $this->main_buttons,
'additional_socialbuttons' => $this->additional_buttons,
'settings' => $this->settings,
'cObjUid' => $this->cObjUid
));
/** Render the view and return it to the initializeAction for including */
$javascriptConfigView = $javascriptConfigView->render();
return $javascriptConfigView;
}
}
?>

View File

@@ -0,0 +1,237 @@
<?php
namespace TYPO3\TgmSocialshareprivacy\Domain\Model;
/***************************************************************
* Copyright notice
*
* (c) 2014 Paul Beck <pb@teamgeist-medien.de>, Teamgeist Medien GbR
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
*
*
* @package tgm_socialshareprivacy
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
*
*/
class SocialButton extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
/**
* Include helper class
*
* @var \TYPO3\TgmSocialshareprivacy\Helper\HelperFunctions
* @inject
*/
protected $helperClass;
/**
* Name of the Button
*
* @var \string
* @validate NotEmpty
*/
protected $name;
/**
* Name of the Button in the frontend
*
* @var \string
* @validate NotEmpty
*/
protected $nameFe;
/**
* Description text of the button
*
* @var \string
* @validate NotEmpty
*/
protected $descriptionText;
/**
* Dummyimage of the button
*
* @var \string
* @validate NotEmpty
*/
protected $dummyimage;
/**
* Required HTM
*
* @var \string
*/
protected $htmlCode;
/**
* Required Javascript
*
* @var \string
*/
protected $jsCode;
/**
* Append or Prepend JS to Body
*
* @var \integer
*/
protected $jsIncludeMethode;
/**
* Returns the name
*
* @return \string $name
*/
public function getName() {
return $this->name;
}
/**
* Sets the name
*
* @param \string $name
* @return void
*/
public function setName($name) {
$this->name = $name;
}
/**
* Returns the name for frontend
*
* @return \string $nameFe
*/
public function getNameFe() {
return $this->nameFe;
}
/**
* Sets the name for frontend
*
* @param \string $nameFe
* @return void
*/
public function setNameFe($nameFe) {
$this->nameFe = $nameFe;
}
/**
* Returns description text
*
* @return \string $descriptionText
*/
public function getDescriptionText() {
return $this->descriptionText;
}
/**
* Sets description text
*
* @param \string $descriptionText
* @return void
*/
public function setDescriptionText($descriptionText) {
$this->descriptionText = $descriptionText;
}
/**
* Returns the dummyimage
*
* @return \string $dummyimage
*/
public function getDummyimage() {
return $this->dummyimage;
}
/**
* Sets the dummyimage
*
* @param \string $dummyimage
* @return void
*/
public function setDummyimage($dummyimage) {
$this->dummyimage = $dummyimage;
}
/**
* Returns the htmlCode
*
* @return \string $htmlCode
*/
public function getHtmlCode() {
if(strpos($this->htmlCode, '###URL###')) {
$this->htmlCode = $this->helperClass->replaceUrlMarker($this->htmlCode);
}
return \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($this->htmlCode);
}
/**
* Sets the htmlCode
*
* @param \string $htmlCode
* @return void
*/
public function setHtmlCode($htmlCode) {
$this->htmlCode = $htmlCode;
}
/**
* Returns the jsCode
*
* @return \string $jsCode
*/
public function getJsCode() {
if(strpos($this->jsCode, '###URL###')) {
$this->jsCode = $this->helperClass->replaceUrlMarker($this->jsCode);
}
return \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($this->jsCode);
}
/**
* Sets the jsCode
*
* @param \string $jsCode
* @return void
*/
public function setJsCode($jsCode) {
$this->jsCode = $jsCode;
}
/**
* Returns the jsIncludeMethode
*
* @return \integer $jsIncludeMethode
*/
public function getJsIncludeMethode() {
return $this->jsIncludeMethode;
}
/**
* Sets the jsIncludeMethode
*
* @param \integer $jsIncludeMethode
* @return void
*/
public function setJsIncludeMethode($jsIncludeMethode) {
$this->jsIncludeMethode = $jsIncludeMethode;
}
}
?>

View File

@@ -0,0 +1,63 @@
<?php
namespace TYPO3\TgmSocialshareprivacy\Domain\Repository;
/***************************************************************
* Copyright notice
*
* (c) 2014 Paul Beck <pb@teamgeist-medien.de>, Teamgeist Medien GbR
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
*
*
* @package tgm_socialshareprivacy
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
*
*/
class SocialButtonRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
/**
* Find by multiple uids using , seperated string
*
* @param string String containing uids
* @return \TYPO3\TgmSocialshareprivacy\Domain\Model\SocialButton Matching social buttons
*/
public function findByUids($uids) {
$uidArray = explode(",", $uids);
$query = $this->createQuery();
foreach ($uidArray as $key => $value) {
$constraints[] = $query->equals('uid', $value);
}
return $query->matching(
$query->logicalAnd(
$query->logicalOr(
$constraints
),
$query->equals('hidden', 0),
$query->equals('deleted', 0)
)
)->execute();
}
}
?>

View File

@@ -0,0 +1,128 @@
<?php
namespace TYPO3\TgmSocialshareprivacy\Helper;
/***************************************************************
* Copyright notice
*
* (c) 2014 Paul Beck <pb@teamgeist-medien.de>, Teamgeist Medien GbR
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
* Just always need this: \TYPO3\CMS\Core\Utility\DebugUtility::debug();
***************************************************************/
/**
*
*
* @package tgm_socialshareprivacy
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
*
*/
class HelperFunctions {
/**
* Flexform / Typoscript Settings
*/
public $settings;
/**
* Configuration Manager
*/
public $configurationManager;
/**
* Inject the configuration manager
*
* @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager
* @inject
*/
public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager) {
$this->configurationManager = $configurationManager;
$this->settings = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS);
$this->initializeSettings();
}
/**
* Combine settings on empty Flexform values with Typoscript values
*
* @return boolean
*/
public function initializeSettings() {
if(isset($this->settings['flexform'])) {
foreach ($this->settings['flexform'] as $key => $value) {
if (isset($this->settings[$key]) && $value != '') {
$this->settings[$key] = $value;
}
}
}
}
/**
* Returns the combined settings
*
* @return array
*/
public function getSettings() {
return $this->settings;
}
/**
* Replace ###URL### Marker in string with URL
*
* @param string $code The code containing the marker
* @return string
*/
public function replaceUrlMarker($code) {
if(empty($this->settings['share_link']) || $this->settings['share_link'] == 'current') {
$code = str_replace('###URL###', $this->getCurPageURL(), $code);
} else {
$code = str_replace('###URL###', $this->settings['share_link'], $code);
}
return $code;
}
/**
* Returns current URL
*
* @return string
*/
public function getCurPageURL() {
$pageURL = 'http';
if ($_SERVER['HTTPS'] == 'on') {$pageURL .= 's';
}
$pageURL .= '://';
if ($_SERVER['SERVER_PORT'] != '80') {
$pageURL .= $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];
} else {
$pageURL .= $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
}
return $pageURL;
}
/**
* Returns the cObj UID
*
* @return number
*/
public function getContentObjectUid() {
$contentObject = $this->configurationManager->getContentObject();
return $contentObject->data['uid'];
}
}
?>

View File

@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<T3DataStructure>
<sheets>
<general>
<ROOT>
<TCEforms>
<sheetTitle>LLL:EXT:tgm_socialshareprivacy/Resources/Private/Language/locallang.xlf:flexform.generalInfo</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<settings.flexform.info_page_id>
<TCEforms>
<exclude>1</exclude>
<label>LLL:EXT:tgm_socialshareprivacy/Resources/Private/Language/locallang.xlf:flexform.general.info_link</label>
<config>
<type>group</type>
<internal_type>db</internal_type>
<allowed>pages</allowed>
<size>1</size>
<maxitems>1</maxitems>
<minitems>0</minitems>
<show_thumbs>0</show_thumbs>
</config>
</TCEforms>
</settings.flexform.info_page_id>
<settings.flexform.use_cookie>
<TCEforms>
<exclude>1</exclude>
<label>LLL:EXT:tgm_socialshareprivacy/Resources/Private/Language/locallang.xlf:flexform.general.use_cookie</label>
<config>
<type>check</type>
</config>
</TCEforms>
</settings.flexform.use_cookie>
<settings.flexform.cookie_description>
<TCEforms>
<exclude>1</exclude>
<label>LLL:EXT:tgm_socialshareprivacy/Resources/Private/Language/locallang.xlf:flexform.general.cookie_description</label>
<config>
<type>text</type>
<cols>24</cols>
<rows>2</rows>
</config>
</TCEforms>
</settings.flexform.cookie_description>
<settings.flexform.share_link>
<TCEforms>
<exclude>1</exclude>
<label>LLL:EXT:tgm_socialshareprivacy/Resources/Private/Language/locallang.xlf:flexform.general.share_link</label>
<config>
<type>input</type>
<size>40</size>
<max>1000</max>
<eval>trim</eval>
</config>
</TCEforms>
</settings.flexform.share_link>
<settings.flexform.main_buttons>
<TCEforms>
<exclude>1</exclude>
<label>LLL:EXT:tgm_socialshareprivacy/Resources/Private/Language/locallang.xlf:flexform.general.main_buttons</label>
<config>
<type>group</type>
<internal_type>db</internal_type>
<allowed>tx_tgmsocialshareprivacy_domain_model_socialbutton</allowed>
<size>5</size>
<maxitems>100</maxitems>
<minitems>0</minitems>
<show_thumbs>1</show_thumbs>
<eval>required</eval>
</config>
</TCEforms>
</settings.flexform.main_buttons>
<settings.flexform.additional_buttons>
<TCEforms>
<exclude>1</exclude>
<label>LLL:EXT:tgm_socialshareprivacy/Resources/Private/Language/locallang.xlf:flexform.general.additional_buttons</label>
<config>
<type>group</type>
<internal_type>db</internal_type>
<allowed>tx_tgmsocialshareprivacy_domain_model_socialbutton</allowed>
<size>5</size>
<maxitems>100</maxitems>
<minitems>0</minitems>
<show_thumbs>1</show_thumbs>
</config>
</TCEforms>
</settings.flexform.additional_buttons>
</el>
</ROOT>
</general>
</sheets>
</T3DataStructure>

View File

@@ -0,0 +1,177 @@
<?php
if (!defined ('TYPO3_MODE')) {
die ('Access denied.');
}
$TCA['tx_tgmsocialshareprivacy_domain_model_socialbutton'] = array(
'ctrl' => $TCA['tx_tgmsocialshareprivacy_domain_model_socialbutton']['ctrl'],
'interface' => array(
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, name, name_fe, description_text, dummyimage, html_code, js_code, js_include_methode',
),
'types' => array(
'1' => array('showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden;;1, name, name_fe, description_text, dummyimage, html_code, js_code, js_include_methode,--div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access,starttime, endtime'),
),
'palettes' => array(
'1' => array('showitem' => ''),
),
'columns' => array(
'sys_language_uid' => array(
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.language',
'config' => array(
'type' => 'select',
'foreign_table' => 'sys_language',
'foreign_table_where' => 'ORDER BY sys_language.title',
'items' => array(
array('LLL:EXT:lang/locallang_general.xlf:LGL.allLanguages', -1),
array('LLL:EXT:lang/locallang_general.xlf:LGL.default_value', 0)
),
),
),
'l10n_parent' => array(
'displayCond' => 'FIELD:sys_language_uid:>:0',
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.l18n_parent',
'config' => array(
'type' => 'select',
'items' => array(
array('', 0),
),
'foreign_table' => 'tx_tgmsocialshareprivacy_domain_model_socialbutton',
'foreign_table_where' => 'AND tx_tgmsocialshareprivacy_domain_model_socialbutton.pid=###CURRENT_PID### AND tx_tgmsocialshareprivacy_domain_model_socialbutton.sys_language_uid IN (-1,0)',
),
),
'l10n_diffsource' => array(
'config' => array(
'type' => 'passthrough',
),
),
't3ver_label' => array(
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.versionLabel',
'config' => array(
'type' => 'input',
'size' => 30,
'max' => 255,
)
),
'hidden' => array(
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.hidden',
'config' => array(
'type' => 'check',
),
),
'starttime' => array(
'exclude' => 1,
'l10n_mode' => 'mergeIfNotBlank',
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.starttime',
'config' => array(
'type' => 'input',
'size' => 13,
'max' => 20,
'eval' => 'datetime',
'checkbox' => 0,
'default' => 0,
'range' => array(
'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
),
),
),
'endtime' => array(
'exclude' => 1,
'l10n_mode' => 'mergeIfNotBlank',
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.endtime',
'config' => array(
'type' => 'input',
'size' => 13,
'max' => 20,
'eval' => 'datetime',
'checkbox' => 0,
'default' => 0,
'range' => array(
'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
),
),
),
'name' => array(
'exclude' => 0,
'label' => 'LLL:EXT:tgm_socialshareprivacy/Resources/Private/Language/locallang_db.xlf:tx_tgmsocialshareprivacy_domain_model_socialbutton.name',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim,required'
),
),
'name_fe' => array(
'exclude' => 0,
'label' => 'LLL:EXT:tgm_socialshareprivacy/Resources/Private/Language/locallang_db.xlf:tx_tgmsocialshareprivacy_domain_model_socialbutton.name_fe',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim,required'
),
),
'description_text' => array(
'exclude' => 0,
'label' => 'LLL:EXT:tgm_socialshareprivacy/Resources/Private/Language/locallang_db.xlf:tx_tgmsocialshareprivacy_domain_model_socialbutton.description_text',
'config' => array(
'type' => 'text',
'cols' => 40,
'rows' => 3,
'eval' => 'trim',
// TODO: Make this translateable
// 'default' => 'LLL:EXT:tgm_socialshareprivacy/Resources/Private/Language/locallang_db.xlf:tx_tgmsocialshareprivacy_domain_model_socialbutton.description_text_default'
'default' => 'This button is saving your privacy from social networks until you turn it on.',
),
),
'dummyimage' => array(
'exclude' => 0,
'label' => 'LLL:EXT:tgm_socialshareprivacy/Resources/Private/Language/locallang_db.xlf:tx_tgmsocialshareprivacy_domain_model_socialbutton.dummyimage',
'config' => array(
'type' => 'group',
'internal_type' => 'file',
'uploadfolder' => 'typo3conf/ext/tgm_socialshareprivacy/Resources/Public/Uploads',
'show_thumbs' => 1,
'size' => 1,
'maxitems' => 1,
'allowed' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'],
'disallowed' => '',
),
),
'html_code' => array(
'exclude' => 0,
'label' => 'LLL:EXT:tgm_socialshareprivacy/Resources/Private/Language/locallang_db.xlf:tx_tgmsocialshareprivacy_domain_model_socialbutton.html_code',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'js_code' => array(
'exclude' => 0,
'label' => 'LLL:EXT:tgm_socialshareprivacy/Resources/Private/Language/locallang_db.xlf:tx_tgmsocialshareprivacy_domain_model_socialbutton.js_code',
'config' => array(
'type' => 'text',
'cols' => 40,
'rows' => 15,
'eval' => 'trim'
),
),
'js_include_methode' => array(
'exclude' => 0,
'label' => 'LLL:EXT:tgm_socialshareprivacy/Resources/Private/Language/locallang_db.xlf:tx_tgmsocialshareprivacy_domain_model_socialbutton.js_include_methode',
'config' => array(
'type' => 'select',
'items' => array(
array('LLL:EXT:tgm_socialshareprivacy/Resources/Private/Language/locallang_db.xlf:tx_tgmsocialshareprivacy_domain_model_socialbutton.js_include_methode_append', 0),
array('LLL:EXT:tgm_socialshareprivacy/Resources/Private/Language/locallang_db.xlf:tx_tgmsocialshareprivacy_domain_model_socialbutton.js_include_methode_prepend', 1),
),
'size' => 1,
'maxitems' => 1,
'eval' => ''
),
),
),
);
?>

View File

@@ -0,0 +1,22 @@
plugin.tx_tgmsocialshareprivacy {
view {
# cat=plugin.tx_tgmsocialshareprivacy/file; type=string; label=Path to template root (FE)
templateRootPath = EXT:tgm_socialshareprivacy/Resources/Private/Templates/
# cat=plugin.tx_tgmsocialshareprivacy/file; type=string; label=Path to template partials (FE)
partialRootPath = EXT:tgm_socialshareprivacy/Resources/Private/Partials/
# cat=plugin.tx_tgmsocialshareprivacy/file; type=string; label=Path to template layouts (FE)
layoutRootPath = EXT:tgm_socialshareprivacy/Resources/Private/Layouts/
}
persistence {
# cat=plugin.tx_tgmsocialshareprivacy//a; type=string; label=Default storage PID
storagePid = 0
}
settings {
# cat=plugin.tx_tgmsocialshareprivacy//b; type=boolean; label=Include jQuery Libary
include_jquery = 1
# cat=plugin.tx_tgmsocialshareprivacy//b; type=boolean; label=Include jQuery UI Lib (for tooltips)
include_jqueryui = 1
# cat=plugin.tx_tgmsocialshareprivacy//b; type=boolean; label=Include all JS Files in the Footer
include_to_footer = 1
}
}

View File

@@ -0,0 +1,33 @@
plugin.tx_tgmsocialshareprivacy {
view {
templateRootPath = {$plugin.tx_tgmsocialshareprivacy.view.templateRootPath}
partialRootPath = {$plugin.tx_tgmsocialshareprivacy.view.partialRootPath}
layoutRootPath = {$plugin.tx_tgmsocialshareprivacy.view.layoutRootPath}
}
persistence {
storagePid = {$plugin.tx_tgmsocialshareprivacy.persistence.storagePid}
}
features {
# uncomment the following line to enable the new Property Mapper.
# rewrittenPropertyMapper = 1
}
settings {
include_jquery = {$plugin.tx_tgmsocialshareprivacy.settings.include_jquery}
include_jqueryui = {$plugin.tx_tgmsocialshareprivacy.settings.include_jqueryui}
include_to_footer = {$plugin.tx_tgmsocialshareprivacy.settings.include_to_footer}
info_page_id =
use_cookie = 1
cookie_path = "/"
cookie_expires = 365
cookie_description = You may permanently enable buttons.
#cookie_domain = document.location.host
#cookie_https = 0
css_path = typo3conf/ext/tgm_socialshareprivacy/Resources/Public/Css/tgm_socialshareprivacy.css
share_link = current
main_buttons = 1,2,3
additional_buttons =
}
}

View File

@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" target-language="de" datatype="plaintext" original="messages" date="2014-03-24T15:29:33Z" product-name="tgm_socialshareprivacy">
<header/>
<body>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton">
<source>Social Button</source>
<target>Social Button</target>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.name">
<source>Name of the button for the backend</source>
<target>Name des Buttons im Backend</target>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.name_fe">
<source>Name of the button in the frontend</source>
<target>Name des Buttons im Frontend (Cookie Config)</target>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.dummyimage">
<source>Dummyimage of the button</source>
<target>Dummybild des Buttons</target>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.html_code">
<source>Required HTML</source>
<target>Benötigtes HTML</target>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.js_code">
<source>Required Javascript</source>
<target>Benötigtes Javascript</target>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.js_include_methode">
<source>Javascript include position</source>
<target>Position für Javascript</target>
</trans-unit>
<trans-unit id="flexform.general.generalInfo">
<source>General settings</source>
<target>Allgemeine Einstellungen</target>
</trans-unit>
<trans-unit id="flexform.general.info_link">
<source>Page with additional privacy information</source>
<target>Seite mit weiteren Informationen zur Privatsphäre</target>
</trans-unit>
<trans-unit id="flexform.general.use_cookie">
<source>Enable cookie control</source>
<target>Aktiviere Cookie Einstellungen im Frontend</target>
</trans-unit>
<trans-unit id="flexform.general.share_link">
<source>URL to share when ###URL### marker is set (default = current)</source>
<target>Seite zum Teilen wenn ###URL### Marker gesetzt (default = current)</target>
</trans-unit>
<trans-unit id="flexform.general.main_buttons">
<source>Main buttons to show</source>
<target>Hauptbuttons zum Anzeigen</target>
</trans-unit>
<trans-unit id="flexform.general.additional_buttons">
<source>Additional buttons (collapsed)</source>
<target>Weitere Buttons (eingefahren)</target>
</trans-unit>
<trans-unit id="flexform.general.cookie_description">
<source>Infotext for cookie settings</source>
<target>Infotext für die Cookie Einstellungen</target>
</trans-unit>
<trans-unit id="frontend.addButtons_toggle_tooltip">
<source>Hide / show more buttons text</source>
<target>Text für Anzeige / Ausblenden weiterer Buttons</target>
</trans-unit>
<trans-unit id="frontend.error.no_buttons">
<source>No buttons selected / found.</source>
<target>Keine Buttons ausgewählt bzw. gefunden.</target>
</trans-unit>
</body>
</file>
</xliff>

View File

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" target-language="de" datatype="plaintext" original="messages" date="2014-03-24T15:29:33Z" product-name="tgm_socialshareprivacy">
<header/>
<body>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton">
<source>Social Button</source>
<target>Social Button</target>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.name">
<source>Name (BE only)</source>
<target>Name für das Backend</target>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.name_fe">
<source>Name in the frontend</source>
<target>Name für das Frontend</target>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.description_text">
<source>Tooltip text of the button</source>
<target>Tooltip Text für den Button</target>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.description_text_default">
<source>This button is saving your privacy from social networks until you turn it on.</source>
<target>Dieser Button schützt Ihre Privatsphäre vor sozialen Netzwerken bis sie diesen manuell aktivieren.</target>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.dummyimage">
<source>Dummyimage</source>
<target>Dummybild</target>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.html_code">
<source>HTML code</source>
<target>HTML Code</target>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.js_code">
<source>JS code</source>
<target>JS Code</target>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.js_include_methode">
<source>Javascript position</source>
<target>Position für das Javascript</target>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.js_include_methode_append">
<source>Before closing body-Tag</source>
<target>Vor dem schließenden body-Tag</target>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.js_include_methode_prepend">
<source>After opening body-Tag</source>
<target>Nach dem öffnenden body-Tag</target>
</trans-unit>
</body>
</file>
</xliff>

View File

@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2014-03-24T15:29:33Z" product-name="tgm_socialshareprivacy">
<header/>
<body>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton">
<source>Social Button</source>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.name">
<source>Name of the button for the backend</source>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.name_fe">
<source>Name of the button in the frontend</source>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.dummyimage">
<source>Dummyimage of the button</source>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.html_code">
<source>Required HTML</source>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.js_code">
<source>Required Javascript</source>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.js_include_methode">
<source>Javascript include position</source>
</trans-unit>
<trans-unit id="flexform.general.generalInfo">
<source>General settings</source>
</trans-unit>
<trans-unit id="flexform.general.info_link">
<source>Page with additional privacy information</source>
</trans-unit>
<trans-unit id="flexform.general.use_cookie">
<source>Enable cookie control</source>
</trans-unit>
<trans-unit id="flexform.general.share_link">
<source>URL to share when ###URL### marker is set (default = current)</source>
</trans-unit>
<trans-unit id="flexform.general.main_buttons">
<source>Main buttons to show</source>
</trans-unit>
<trans-unit id="flexform.general.additional_buttons">
<source>Additional buttons (collapsed)</source>
</trans-unit>
<trans-unit id="flexform.general.cookie_description">
<source>Infotext for cookie settings</source>
</trans-unit>
<trans-unit id="frontend.addButtons_toggle_tooltip">
<source>Hide / show more buttons text</source>
</trans-unit>
<trans-unit id="frontend.error.no_buttons">
<source>No buttons selected / found.</source>
</trans-unit>
</body>
</file>
</xliff>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2014-03-24T15:29:33Z" product-name="tgm_socialshareprivacy">
<header/>
<body>
<trans-unit id="name.description">
<source>Name of the Button</source>
</trans-unit>
<trans-unit id="dummyimage.description">
<source>Dummyimage of the button</source>
</trans-unit>
<trans-unit id="html_code.description">
<source>Required HTM</source>
</trans-unit>
<trans-unit id="js_code.description">
<source>Required Javascript</source>
</trans-unit>
<trans-unit id="js_include_methode.description">
<source>Append or Prepend JS to Body</source>
</trans-unit>
</body>
</file>
</xliff>

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2014-03-24T15:29:33Z" product-name="tgm_socialshareprivacy">
<header/>
<body>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton">
<source>Social Button</source>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.name">
<source>Name (BE only)</source>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.name_fe">
<source>Name in the frontend</source>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.description_text">
<source>Tooltip text of the button</source>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.description_text_default">
<source>This button is saving your privacy from social networks until you turn it on.</source>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.dummyimage">
<source>Dummyimage</source>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.html_code">
<source>HTML code</source>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.js_code">
<source>JS code</source>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.js_include_methode">
<source>Javascript position</source>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.js_include_methode_append">
<source>Before closing body-Tag</source>
</trans-unit>
<trans-unit id="tx_tgmsocialshareprivacy_domain_model_socialbutton.js_include_methode_prepend">
<source>After opening body-Tag</source>
</trans-unit>
</body>
</file>
</xliff>

View File

@@ -0,0 +1,3 @@
<div class="tx-tgm-socialshareprivacy">
<f:render section="main" />
</div>

View File

@@ -0,0 +1,77 @@
<f:layout name="Default" />
<f:section name="main">
<f:if condition="{socialbuttons}">
<f:then>
<ul class="tgm_social_buttons ssp_bar{cObjUid}">
<f:for each="{socialbuttons}" as="socialbutton">
<li class="ssp_btn_{socialbutton.uid} ssp_btn inactive">
<span class="ssp_btn_control"></span>
<div class="ssp_btn_container">
<div class="ssp_btn_src"></div>
<f:image class="ssp_btn_dummy_image" src="typo3conf/ext/tgm_socialshareprivacy/Resources/Public/Uploads/{socialbutton.dummyimage}" alt="{socialbutton.nameFe}" title="{socialbutton.descriptionText}" />
</div>
</li>
</f:for>
<f:if condition="{additional_socialbuttons}">
<f:then>
<div class="ssp_additional_buttons">
<f:for each="{additional_socialbuttons}" as="socialbutton">
<li class="ssp_btn_{socialbutton.uid} ssp_btn inactive">
<span class="ssp_btn_control"></span>
<div class="ssp_btn_container">
<div class="ssp_btn_src"></div>
<f:image class="ssp_btn_dummy_image" src="typo3conf/ext/tgm_socialshareprivacy/Resources/Public/Uploads/{socialbutton.dummyimage}" alt="{socialbutton.nameFe}" title="{socialbutton.descriptionText}" />
</div>
</li>
</f:for>
</div>
<li class="ssp_addButtons_toggle icon-plus-circled" title="<f:translate key="LLL:EXT:tgm_socialshareprivacy/Resources/Private/Language/locallang.xlf:frontend.addButtons_toggle_tooltip" default="Hide / show more buttons"></f:translate>"></li>
</f:then>
</f:if>
<f:if condition="{settings.info_page_id}">
<f:then>
<li class="ssp_info">
<f:link.page pageUid="{settings.info_page_id}" target="_blank"><span class="ssp_btn_info icon-info-circled"></span></f:link.page>
</li>
</f:then>
</f:if>
<f:if condition="{settings.use_cookie}">
<f:then>
<li class="ssp_settings">
<span class="ssp_settings_icon icon-cog"></span>
<form class="ssp_cookie_settings">
<p>{settings.cookie_description}</p>
<f:for each="{socialbuttons}" as="socialbutton">
<div class="ssp_cookie_settings_row">
<input type="checkbox" class="ssp_cookie_checkbox ssp_btn_uid{socialbutton.uid}" id="ssp_bar{contentObject}_btn{socialbutton.uid}" value="{socialbutton.uid}" />
<label for="ssp_bar{contentObject}_btn{socialbutton.uid}">{socialbutton.nameFe}</label>
</div>
</f:for>
<f:for each="{additional_socialbuttons}" as="socialbutton">
<div class="ssp_cookie_settings_row">
<input type="checkbox" class="ssp_cookie_checkbox ssp_btn_uid{socialbutton.uid}" id="ssp_bar{contentObject}_btn{socialbutton.uid}" value="{socialbutton.uid}" />
<label for="ssp_bar{contentObject}_btn{socialbutton.uid}">{socialbutton.nameFe}</label>
</div>
</f:for>
</form>
</li>
</f:then>
</f:if>
</ul>
</f:then>
<f:else>
<p><f:translate key="LLL:EXT:tgm_socialshareprivacy/Resources/Private/Language/locallang.xlf:frontend.error.no_buttons" default="No buttons selected / found"></f:translate></p>
</f:else>
</f:if>
</f:section>

View File

@@ -0,0 +1,25 @@
<f:format.raw>
var tgm_socialbutton_expires = {settings.cookie_expires};
var tgm_socialbutton_path = {settings.cookie_path};
$(document).ready(function() {
<f:for each="{socialbuttons}" as="socialbutton">
var ssp_btn_{socialbutton.uid} = new tgm_socialbutton({socialbutton.uid},{socialbutton.jsCode},{socialbutton.htmlCode}, {cObjUid}, {socialbutton.jsIncludeMethode});
</f:for>
<f:for each="{additional_socialbuttons}" as="socialbutton">
var ssp_btn_{socialbutton.uid} = new tgm_socialbutton({socialbutton.uid},{socialbutton.jsCode},{socialbutton.htmlCode}, {cObjUid}, {socialbutton.jsIncludeMethode});
</f:for>
if($('.ssp_cookie_settings_row .ssp_cookie_checkbox').length) {
$('.ssp_cookie_settings_row .ssp_cookie_checkbox').change(function(e) {
if(this.checked) {
createCookie('ssp_btn'+this.value+'_enable', 1);
eval('ssp_btn_'+this.value).toggleButtonState(true);
} else {
eraseCookie('ssp_btn'+this.value+'_enable');
}
});
}
});
</f:format.raw>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Copyright (C) 2014 by original authors @ fontello.com</metadata>
<defs>
<font id="fontello" horiz-adv-x="1000" >
<font-face font-family="fontello" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
<missing-glyph horiz-adv-x="1000" />
<glyph glyph-name="plus-circled" unicode="&#xe800;" d="m679 314v72q0 14-11 25t-25 10h-143v143q0 15-11 25t-25 11h-71q-15 0-25-11t-11-25v-143h-143q-14 0-25-10t-10-25v-72q0-14 10-25t25-11h143v-142q0-15 11-25t25-11h71q15 0 25 11t11 25v142h143q14 0 25 11t11 25z m178 36q0-117-57-215t-156-156t-215-58t-216 58t-155 156t-58 215t58 215t155 156t216 58t215-58t156-156t57-215z" horiz-adv-x="857.1" />
<glyph glyph-name="minus-circled" unicode="&#xe803;" d="m679 314v72q0 14-11 25t-25 10h-429q-14 0-25-10t-10-25v-72q0-14 10-25t25-10h429q14 0 25 10t11 25z m178 36q0-117-57-215t-156-156t-215-58t-216 58t-155 156t-58 215t58 215t155 156t216 58t215-58t156-156t57-215z" horiz-adv-x="857.1" />
<glyph glyph-name="info-circled" unicode="&#xe802;" d="m571 82v89q0 8-5 13t-12 5h-54v286q0 8-5 13t-13 5h-178q-8 0-13-5t-5-13v-89q0-8 5-13t13-5h53v-179h-53q-8 0-13-5t-5-13v-89q0-8 5-13t13-5h250q7 0 12 5t5 13z m-71 500v89q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-89q0-8 5-13t13-5h107q8 0 13 5t5 13z m357-232q0-117-57-215t-156-156t-215-58t-216 58t-155 156t-58 215t58 215t155 156t216 58t215-58t156-156t57-215z" horiz-adv-x="857.1" />
<glyph glyph-name="cog" unicode="&#xe801;" d="m571 350q0 59-41 101t-101 42t-101-42t-42-101t42-101t101-42t101 42t41 101z m286 61v-124q0-7-4-13t-11-7l-104-16q-10-30-21-51q19-27 59-77q6-6 6-13t-5-13q-15-21-55-61t-53-39q-7 0-14 5l-77 60q-25-13-51-21q-9-76-16-104q-4-16-20-16h-124q-8 0-14 5t-6 12l-16 103q-27 9-50 21l-79-60q-6-5-14-5q-8 0-14 6q-70 64-92 94q-4 5-4 13q0 6 5 12q8 12 28 37t30 40q-15 28-23 55l-102 15q-7 1-11 7t-5 13v124q0 7 5 13t10 7l104 16q8 25 22 51q-23 32-60 77q-6 7-6 14q0 5 5 12q15 20 55 60t53 40q7 0 15-5l77-60q24 13 50 21q9 76 17 104q3 15 20 15h124q7 0 13-4t7-12l15-103q28-9 50-21l80 60q5 5 13 5q7 0 14-5q72-67 92-95q4-5 4-13q0-6-4-12q-9-12-29-38t-30-39q14-28 23-55l102-15q7-1 12-7t4-13z" horiz-adv-x="857.1" />
</font>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -0,0 +1,16 @@
[class^="icon-"], [class*=" icon-"] {
font-family: 'fontello';
font-style: normal;
font-weight: normal;
/* fix buttons height */
line-height: 1em;
/* you can be more comfortable with increased icons size */
/* font-size: 120%; */
}
.icon-plus-circled { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe800;&nbsp;'); }
.icon-minus-circled { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe803;&nbsp;'); }
.icon-info-circled { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe802;&nbsp;'); }
.icon-cog { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe801;&nbsp;'); }

View File

@@ -0,0 +1,152 @@
ul.tgm_social_buttons {
float: left;
width: 100%;
margin: 0;
list-style: none;
}
ul.tgm_social_buttons li {
display: inline-block;
float: left;
position: relative;
padding: 6px 2px;
}
li.ssp_btn {
margin: 0 20px 0 0;
}
.ssp_btn_container {
margin: 0 0 0 26px;
}
.ssp_btn_control {
position: absolute;
top: 50%;
margin: -6px 0 0;
background: url(../Images/btn_off.png) no-repeat top left;
width: 21px;
height: 11px;
cursor: pointer;
}
.active .ssp_btn_control {
background-image: url(../Images/btn_on.png);
}
.ssp_info,
.ssp_settings_icon,
.ssp_addButtons_toggle {
font-size: 1.1em;
cursor: pointer;
}
.ssp_settings_icon {
position: relative;
z-index: 10;
}
.ssp_settings:hover .ssp_cookie_settings{
display: block;
}
.ssp_cookie_settings {
display: none;
position: absolute;
top: 0;
left: 0;
padding: 30px 8px 20px;
background: #fff;
border: 1px solid #909090;
width: 130px;
z-index: 0;
border-radius: 5px;
-webkit-border-radius: 5px;
-webkit-box-shadow: 0 0 5px #aaa;
box-shadow: 0 0 5px #aaa;
}
.ssp_additional_buttons {
display: none;
}
.ui-tooltip {
padding: 4px;
position: absolute;
z-index: 9999;
max-width: 300px;
-webkit-box-shadow: 0 0 5px #aaa;
box-shadow: 0 0 5px #aaa;
background: #fff;
font-size: 0.8em;
border-radius: 5px;
-webkit-border-radius: 5px;
}
body .ui-tooltip {
border-width: 2px;
}
/**********************************************************
*
* Fontello Icon Webfont
*
**********************************************************/
@font-face {
font-family: 'fontello';
src: url('font/fontello.eot?4611743');
src: url('font/fontello.eot?4611743#iefix') format('embedded-opentype'),
url('font/fontello.woff?4611743') format('woff'),
url('font/fontello.ttf?4611743') format('truetype'),
url('font/fontello.svg?4611743#fontello') format('svg');
font-weight: normal;
font-style: normal;
}
/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
/*
@media screen and (-webkit-min-device-pixel-ratio:0) {
@font-face {
font-family: 'fontello';
src: url('../font/fontello.svg?4611743#fontello') format('svg');
}
}
*/
[class^="icon-"]:before, [class*=" icon-"]:before {
font-family: "fontello";
font-style: normal;
font-weight: normal;
speak: none;
display: inline-block;
text-decoration: inherit;
width: 1em;
margin-right: .2em;
text-align: center;
/* opacity: .8; */
/* For safety - reset parent styles, that can break glyph codes*/
font-variant: normal;
text-transform: none;
/* fix buttons height, for twitter bootstrap */
line-height: 1em;
/* Animation center compensation - margins should be symmetric */
/* remove if not needed */
margin-left: .2em;
/* you can be more comfortable with increased icons size */
/* font-size: 120%; */
/* Uncomment for 3D effect */
/* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
}
.icon-plus-circled:before { content: '\e800'; } /* '' */
.icon-minus-circled:before { content: '\e803'; } /* '' */
.icon-info-circled:before { content: '\e802'; } /* '' */
.icon-cog:before { content: '\e801'; } /* '' */

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,155 @@
/**
* Social Share Privacy Button Class
*
* @param {number} uid
* @param {string} script The script as hex escaped string
* @param {string} html The HTML as hex escaped string
* @param {number} cObjUid The uid of the content element for multiple usage on a page
* @param {number} jsIncludeMethode The desired position for JS -> 0 = Append to Body, 1 = Prepend to Body
*/
var tgm_socialbutton = function(uid, script, html, cObjUid, jsIncludeMethode) {
/** Back reference to the class */
var self = this;
/** Basic variables */
this.script = script;
this.html = html;
this.requiredInitialization = true;
this.enabled = false;
this.button = $('.ssp_bar'+cObjUid+' .ssp_btn_'+ uid);
/**
* Initialze button function
* @return {void}
*/
this.init = function() {
$('.ssp_btn_dummy_image', this.button).hide();
$('.ssp_btn_src', this.button).html(this.html);
jsIncludeMethode ? $('body').prepend(this.script) : $('body').append(this.script);
this.requiredInitialization = false;
this.enabled = true;
}
/**
* Enable button function when button already has been initialized
* @return {void}
*/
this.enable = function() {
$('.ssp_btn_dummy_image', this.button).hide();
$('.ssp_btn_src', this.button).show();
this.enabled = true;
}
/**
* Disable button function
* @return {void}
*/
this.disable = function() {
$('.ssp_btn_dummy_image', this.button).show();
$('.ssp_btn_src', this.button).hide();
this.enabled = false;
}
/**
* Toggle the button state depending on it's current state
*
* @param {boolean} toggleOn To force activate the button
* @return {void}
*/
this.toggleButtonState = function(toggleOn) {
$(this.button).toggleClass('inactive active');
if (this.requiredInitialization) {
this.init();
} else if (!this.enabled) {
this.enable();
} else if (!toggleOn) {
this.disable();
}
}
/** Set default width of each container to the dummy images size */
$('.ssp_btn_container', this.button).css({
'width' : $('.ssp_btn_dummy_image', this.button).width() + 'px',
'height' : $('.ssp_btn_dummy_image', this.button).height() + 'px'
});
/** Provide tooltip to each button */
$('.ssp_btn_dummy_image', this.button).tooltip();
/** Event-Listener to control button */
$('.ssp_btn_control', this.button).click(function() {
self.toggleButtonState();
});
/** Activate button if a cookie has been set */
if (readCookie('ssp_btn' + uid + '_enable') == 1) {
this.toggleButtonState(true);
$('.ssp_btn_uid'+uid).attr('checked', 'checked');
}
}
/** Event-Listener for the additional buttons control */
$(document).ready(function() {
if($('.ssp_addButtons_toggle').length) {
$('.ssp_addButtons_toggle').tooltip().click(function() {
$(this).toggleClass('icon-plus-circled icon-minus-circled');
$('.ssp_additional_buttons').fadeToggle();
});
}
});
/**
* Create cookie function
*
* @param {string} name
* @param {number} value
*/
function createCookie(name, value) {
if (tgm_socialbutton_expires) {
var date = new Date();
date.setTime(date.getTime() + (tgm_socialbutton_expires * 24 * 60 * 60 * 1000));
var expires = "; expires=" + date.toGMTString();
} else {
var expires = "";
}
// TODO: Allow setup for the cookie domain also checking for https / http
if (!tgm_socialbutton_path) {
tgm_socialbutton_path = '/'
}
document.cookie = name + "=" + value + expires + "; path=" + tgm_socialbutton_path;
}
/**
* Read cookie function checking all cookies if the requestd cookie is existing
*
* @param {string} name
*/
function readCookie(name) {
var cookie_name = name + "=";
var cookie_array = document.cookie.split(';');
for (var i = 0; i < cookie_array.length; i++) {
var cur_cookie = cookie_array[i];
while (cur_cookie.charAt(0) == ' ')
cur_cookie = cur_cookie.substring(1, cur_cookie.length);
if (cur_cookie.indexOf(cookie_name) == 0)
return cur_cookie.substring(cookie_name.length, cur_cookie.length);
}
return null;
}
/**
* Delete cookie function
*
* @param {string} name
*/
function eraseCookie(name) {
createCookie(name, -1);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -0,0 +1,123 @@
<?php
/***************************************************************
* Copyright notice
*
* (c) 2014 Paul Beck <pb@teamgeist-medien.de>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Update class for the extension manager.
*
* @package TYPO3
* @subpackage TgmSocialshareprivacy
*/
class ext_update {
/**
* @var \TYPO3\CMS\Core\Database\DatabaseConnection
*/
protected $databaseConnection;
/**
* Constructor
*/
public function __construct() {
$this->databaseConnection = $GLOBALS['TYPO3_DB'];
}
/**
* Main update function called by the extension manager.
*
* @return string
*/
public function main() {
return $this->importSocialbuttons();
//return $this->render();
}
/**
* Show update mesage
*
* @return bool
*/
public function access() {
return TRUE;
}
/**
* Import default social buttons
* @return void
*/
protected function importSocialbuttons() {
$countButtons = $this->databaseConnection->exec_SELECTcountRows('*', 'tx_tgmsocialshareprivacy_domain_model_socialbutton', 'hidden=0 AND deleted=0');
if(!$countButtons) {
$insert = array(
'0' => array(
'pid' => '0',
'name' => 'Facebook',
'dummyimage' => 'fb_button.png',
'html_code' => '<div class="fb-share-button" data-type="button"></div>',
'js_code' => '<div id="fb-root"></div><script>(function(d, s, id) {var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_EN/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs);}(document, \'script\', \'facebook-jssdk\'));</script>',
'name_fe' => 'Facebook',
'description_text' => 'This button is saving your privacy from social networks until you turn it on.',
),
'1' => array(
'pid' => '0',
'name' => 'Google Plus',
'dummyimage' => 'gplus_button.png',
'html_code' => '<div class="g-plusone" data-size="medium" data-annotation="none"></div>',
'js_code' => '<script type="text/javascript">window.___gcfg = {lang: \'de\'}; (function() {var po = document.createElement(\'script\'); po.type = \'text/javascript\'; po.async = true; po.src = \'https://apis.google.com/js/platform.js\'; var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(po, s);})();</script>',
'name_fe' => 'Google+',
'description_text' => 'This button is saving your privacy from social networks until you turn it on.',
),
'2' => array(
'pid' => '0',
'name' => 'Twitter',
'dummyimage' => 'twitter_button.png',
'html_code' => '<a href="https://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a>',
'js_code' => '<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?\'http\':\'https\';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+\'://platform.twitter.com/widgets.js\';fjs.parentNode.insertBefore(js,fjs);}}(document, \'script\', \'twitter-wjs\');</script>',
'name_fe' => 'Twitter',
'description_text' => 'This button is saving your privacy from social networks until you turn it on.',
),
'3' => array(
'pid' => '0',
'name' => 'XING',
'dummyimage' => 'xing_button.png',
'html_code' => '<div data-type="XING/Share" data-counter="no_count"></div>',
'js_code' => '<script>;(function (d, s) {var x = d.createElement(s),s = d.getElementsByTagName(s)[0];x.src = "https://www.xing-share.com/js/external/share.js"; s.parentNode.insertBefore(x, s);})(document, "script");</script>',
'name_fe' => 'XING',
'description_text' => 'This button is saving your privacy from social networks until you turn it on.',
),
);
foreach($insert as $insertButton) {
$this->databaseConnection->exec_INSERTquery('tx_tgmsocialshareprivacy_domain_model_socialbutton', $insertButton);
}
/** @var \TYPO3\CMS\Core\Messaging\FlashMessage $flashMessage */
$flashMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage','Import successful, please check PID0.','',FlashMessage::OK);
} else {
/** @var \TYPO3\CMS\Core\Messaging\FlashMessage $flashMessage */
$flashMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage','Cannot import social buttons due to existing buttons. Delete all existing buttons before importing','',FlashMessage::ERROR);
}
return $flashMessage->render();
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,41 @@
<?php
/***************************************************************
* Extension Manager/Repository config file for ext "tgm_socialshareprivacy".
*
* Auto generated 15-12-2015 07:33
*
* Manual updates:
* Only the data in the array - everything else is removed by next
* writing. "version" and "dependencies" must not be touched!
***************************************************************/
$EM_CONF[$_EXTKEY] = array (
'title' => 'Teamgeist Social Share Privacy',
'description' => 'Extension inspired by "heise social share privacy" but completely new. Fully based on Extbase / Fluid. Create your own buttons as records or use some of the default buttons!',
'category' => 'plugin',
'version' => '1.0.0',
'state' => 'stable',
'uploadfolder' => true,
'createDirs' => '',
'clearcacheonload' => false,
'author' => 'Paul Beck',
'author_email' => 'pb@teamgeist-medien.de',
'author_company' => 'Teamgeist Medien GbR',
'constraints' =>
array (
'depends' =>
array (
'extbase' => '6.0',
'fluid' => '6.0',
'typo3' => '6.0.0-6.2.99',
),
'conflicts' =>
array (
),
'suggests' =>
array (
),
),
);

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1,20 @@
<?php
if (!defined('TYPO3_MODE')) {
die ('Access denied.');
}
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'TYPO3.' . $_EXTKEY,
'Main',
array(
'SocialButton' => 'index',
),
// non-cacheable actions
array(
'SocialButton' => '',
)
);
?>

View File

@@ -0,0 +1,48 @@
<?php
if (!defined('TYPO3_MODE')) {
die ('Access denied.');
}
$extensionName = TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase ( $_EXTKEY );
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
$_EXTKEY,
'Main',
'Teamgeist Social Share Privacy'
);
$pluginSignature = strtolower ( $extensionName ) . '_main';
$TCA ['tt_content'] ['types'] ['list'] ['subtypes_addlist'] [$pluginSignature] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($pluginSignature, 'FILE:EXT:' . $_EXTKEY . '/Configuration/Flexform/main_flexform.xml');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript', 'Teamgeist Social Share Privacy');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_tgmsocialshareprivacy_domain_model_socialbutton', 'EXT:tgm_socialshareprivacy/Resources/Private/Language/locallang_csh_tx_tgmsocialshareprivacy_domain_model_socialbutton.xlf');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_tgmsocialshareprivacy_domain_model_socialbutton');
$TCA['tx_tgmsocialshareprivacy_domain_model_socialbutton'] = array(
'ctrl' => array(
'title' => 'LLL:EXT:tgm_socialshareprivacy/Resources/Private/Language/locallang_db.xlf:tx_tgmsocialshareprivacy_domain_model_socialbutton',
'label' => 'name',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'dividers2tabs' => TRUE,
'versioningWS' => 2,
'versioning_followPages' => TRUE,
'origUid' => 't3_origuid',
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent',
'transOrigDiffSourceField' => 'l10n_diffsource',
'delete' => 'deleted',
'enablecolumns' => array(
'disabled' => 'hidden',
'starttime' => 'starttime',
'endtime' => 'endtime',
),
'searchFields' => 'name,dummyimage,html_code,js_code,js_include_methode,',
'dynamicConfigFile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Configuration/TCA/SocialButton.php',
'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY) . 'Resources/Public/Icons/tx_tgmsocialshareprivacy_domain_model_socialbutton.gif'
),
);
?>

View File

@@ -0,0 +1,38 @@
#
# Table structure for table "tx_tgmsocialshareprivacy_domain_model_socialbutton"
#
CREATE TABLE tx_tgmsocialshareprivacy_domain_model_socialbutton (
uid int(11) NOT NULL AUTO_INCREMENT,
pid int(11) NOT NULL default '0',
name varchar(255) NOT NULL default '',
dummyimage text NOT NULL,
html_code varchar(255) NOT NULL default '',
js_code text NOT NULL,
js_include_methode int(11) NOT NULL default '0',
tstamp int(11) unsigned NOT NULL default '0',
crdate int(11) unsigned NOT NULL default '0',
cruser_id int(11) unsigned NOT NULL default '0',
deleted tinyint(4) unsigned NOT NULL default '0',
hidden tinyint(4) unsigned NOT NULL default '0',
starttime int(11) unsigned NOT NULL default '0',
endtime int(11) unsigned NOT NULL default '0',
t3ver_oid int(11) NOT NULL default '0',
t3ver_id int(11) NOT NULL default '0',
t3ver_wsid int(11) NOT NULL default '0',
t3ver_label varchar(255) NOT NULL default '',
t3ver_state tinyint(4) NOT NULL default '0',
t3ver_stage int(11) NOT NULL default '0',
t3ver_count int(11) NOT NULL default '0',
t3ver_tstamp int(11) NOT NULL default '0',
t3ver_move_id int(11) NOT NULL default '0',
t3_origuid int(11) NOT NULL default '0',
sys_language_uid int(11) NOT NULL default '0',
l10n_parent int(11) NOT NULL default '0',
l10n_diffsource mediumblob,
name_fe varchar(255) NOT NULL default '',
description_text text NOT NULL,
PRIMARY KEY (uid),
KEY parent (pid),
KEY t3ver_oid (t3ver_oid,t3ver_wsid),
KEY language (l10n_parent,sys_language_uid)
) ENGINE=InnoDB;