Initial commit
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user