/**
  * Constructor for criteria. Takes a collection of fields and a search string.
  *
  * @param Tx_PtExtlist_Domain_Configuration_Data_Fields_FieldConfigCollection $fields
  * @param string $searchString
  * @param array $searchParameter
  */
 public function __construct(Tx_PtExtlist_Domain_Configuration_Data_Fields_FieldConfigCollection $fields, $searchString, array $searchParameter = array())
 {
     Tx_PtExtbase_Assertions_Assert::isPositiveInteger($fields->count(), array('message' => 'No field given to search in! 1313532571'));
     Tx_PtExtbase_Assertions_Assert::isNotEmptyString($searchString, array('message' => 'SearchString must not be empty! 1313532596'));
     $this->fields = $fields;
     $this->searchString = $searchString;
     $this->searchParameter = $searchParameter;
 }
Esempio n. 2
0
 /**
  * Factory method for repository to be used with this data backend.
  * 
  * Although it's called data source, we create an extbase repository here which acts as a 
  * datasource for this backend.
  *
  * @param Tx_PtExtlist_Domain_Configuration_ConfigurationBuilder $configurationBuilder
  * @return mixed
  */
 public static function createDataSource(Tx_PtExtlist_Domain_Configuration_ConfigurationBuilder $configurationBuilder)
 {
     $dataBackendSettings = $configurationBuilder->getSettingsForConfigObject('dataBackend');
     Tx_PtExtbase_Assertions_Assert::isNotEmptyString($dataBackendSettings['repositoryClassName'], array('message' => 'No repository class name is given for extBase backend. 1281546327'));
     Tx_PtExtbase_Assertions_Assert::isTrue(class_exists($dataBackendSettings['repositoryClassName']), array('message' => 'Given class does not exist: ' . $dataBackendSettings['repositoryClassName'] . ' 1281546328'));
     $repository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager')->get($dataBackendSettings['repositoryClassName']);
     return $repository;
 }
Esempio n. 3
0
 /**
  * Constructor for criteria. Takes a field name a value and a operator.
  * Works like 'field' <operator> 'value'
  *
  * @param string $field
  * @param string $value
  * @param string $operator
  */
 public function __construct($field = '', $value, $operator)
 {
     Tx_PtExtbase_Assertions_Assert::isNotEmptyString($field, array('message' => 'Field must not be empty! 1282849697'));
     Tx_PtExtbase_Assertions_Assert::isNotEmptyString($operator, array('message' => 'Operator must not be empty! 1282849699'));
     $this->field = $field;
     $this->value = $value;
     $this->operator = $operator;
 }
 /**
  * Initialize the Controller
  *
  * @param array $settings Settings container of the current extension
  * @return void
  */
 public function initializeAction()
 {
     parent::initializeAction();
     Tx_PtExtbase_Assertions_Assert::isNotEmptyString($this->settings['filterboxIdentifier'], array('message' => 'No filterbox identifier has been set. Set filterbox identifier in flexform! 1277889418'));
     $this->filterboxIdentifier = $this->settings['filterboxIdentifier'];
     $this->filterboxCollection = $this->dataBackend->getFilterboxCollection();
     $this->filterbox = $this->filterboxCollection->getFilterboxByFilterboxIdentifier($this->filterboxIdentifier, true);
     $this->pagerCollection = $this->dataBackend->getPagerCollection();
 }
Esempio n. 5
0
 /**
  * @return void
  */
 public function initializeAction()
 {
     parent::initializeAction();
     $this->exportListIdentifier = $this->settings['exportListIdentifier'];
     if (!$this->exportListIdentifier) {
         $this->exportListIdentifier = $this->listIdentifier;
     }
     Tx_PtExtbase_Assertions_Assert::isNotEmptyString($this->exportListIdentifier, array('message' => 'No export list identifier set.', 1316446015));
 }
Esempio n. 6
0
 /**
  * Set and validate the config values
  *
  * @return void
  */
 protected function initByTsConfig()
 {
     $this->dateIteratorStart = (int) Tx_PtExtlist_Utility_RenderValue::stdWrapIfPlainArray($this->filterConfig->getSettings('dateIteratorStart'));
     Tx_PtExtbase_Assertions_Assert::isPositiveInteger($this->dateIteratorStart, false, array('message' => 'The Value dateIteratorStart is not given. 1314608757'));
     $this->dateIteratorEnd = (int) Tx_PtExtlist_Utility_RenderValue::stdWrapIfPlainArray($this->filterConfig->getSettings('dateIteratorEnd'));
     Tx_PtExtbase_Assertions_Assert::isPositiveInteger($this->dateIteratorEnd, false, array('message' => 'The Value dateIteratorEnd is not given. 1314608758'));
     $this->dateIteratorFormat = $this->filterConfig->getSettings('dateIteratorFormat');
     Tx_PtExtbase_Assertions_Assert::isNotEmptyString($this->dateIteratorFormat, array('message' => 'The Value dateIteratorFormat is not given. 1314608759'));
     $this->dateIteratorIncrement = strtolower(trim($this->filterConfig->getSettings('dateIteratorIncrement')));
     Tx_PtExtbase_Assertions_Assert::isNotEmptyString($this->dateIteratorIncrement, array('message' => 'The Value dateIteratorIncrement is not given. 1314608760'));
     Tx_PtExtbase_Assertions_Assert::isTrue(in_array($this->dateIteratorIncrement, array('s', 'i', 'h', 'd', 'm', 'y')), array('message' => "The parameter dateIteratorIncrement has to be out of 's', 'i', 'h', 'd', 'm', 'y'"));
     Tx_PtExtbase_Assertions_Assert::isTrue($this->dateIteratorStart < $this->dateIteratorEnd, array('message' => 'The Value dateIteratorStart (' . $this->dateIteratorStart . ') is higher than dateIteratorEnd (' . $this->dateIteratorEnd . ')'));
 }
 /**
  * Factory method for filter boxes. Returns filterbox for a given filterbox configuration and list identifier
  *
  * @param Tx_PtExtlist_Domain_Configuration_Filters_FilterboxConfig $filterboxConfiguration
  * @return Tx_PtExtlist_Domain_Model_Filter_Filterbox
  */
 public function createInstance(Tx_PtExtlist_Domain_Configuration_Filters_FilterboxConfig $filterboxConfiguration)
 {
     Tx_PtExtbase_Assertions_Assert::isNotEmptyString($filterboxConfiguration->getListIdentifier(), array('message' => 'List identifier must not be empty 1277889458'));
     $filterbox = $this->objectManager->get('Tx_PtExtlist_Domain_Model_Filter_Filterbox');
     /* @var $filterbox Tx_PtExtlist_Domain_Model_Filter_Filterbox */
     $filterbox->_injectFilterboxConfiguration($filterboxConfiguration);
     $filterbox->_injectFilterboxFactory($this);
     foreach ($filterboxConfiguration as $filterConfiguration) {
         $filter = $this->filterFactory->createInstance($filterConfiguration);
         $filter->_injectFilterbox($filterbox);
         $filterbox->addFilter($filter, $filter->getFilterIdentifier());
     }
     $sessionPersistenceManager = $this->sessionPersistenceManagerBuilder->getInstance();
     $sessionPersistenceManager->registerObjectAndLoadFromSession($filterbox);
     return $filterbox;
 }
Esempio n. 8
0
 /**
  * Initialize additional class properties
  */
 public function initConfiguration()
 {
     parent::initConfiguration();
     //echo 's';
     $this->templatePath = $this->exportConfiguration->getSettings('templatePath');
     Tx_PtExtbase_Assertions_Assert::isNotEmptyString($this->templatePath, array('message' => 'No template path given for fluid export! 1284621481'));
     $this->setTemplatePathAndFilename(\TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($this->templatePath));
     $this->paperSize = strtolower($this->exportConfiguration->getSettings('paperSize'));
     Tx_PtExtbase_Assertions_Assert::isNotEmptyString($this->paperSize, array('message' => 'No PaperSize given for the PDF output! 1322585559'));
     $this->paperOrientation = $this->exportConfiguration->getSettings('paperOrientation');
     Tx_PtExtbase_Assertions_Assert::isInArray($this->paperOrientation, array('portrait', 'landscape'), array('message' => 'The Orientation must either be portrait or landscape! 1322585560'));
     $this->cssFilePath = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($this->exportConfiguration->getSettings('cssFilePath'));
     Tx_PtExtbase_Assertions_Assert::isTrue(file_exists($this->cssFilePath), array('message' => 'The CSS File with the filename ' . $this->cssFilePath . ' can not be found. 1322587627'));
     $this->dompdfSourcePath = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($this->exportConfiguration->getSettings('dompdfSourcePath'));
     Tx_PtExtbase_Assertions_Assert::isTrue(is_dir($this->dompdfSourcePath), array('message' => 'DomPdf source in path ' . $this->dompdfSourcePath . ' was not found. 1322753515'));
     $this->dompdfSourcePath = substr($this->dompdfSourcePath, -1, 1) == '/' ? $this->dompdfSourcePath : $this->dompdfSourcePath . '/';
 }
 /**
  * 
  * @param string $identifier aggregate identifier 
  * @param array $aggregateSettings
  * @param Tx_PtExtlist_Domain_Configuration_ConfigurationBuilder $configurationBuilder
  * @throws Exception
  */
 public function __construct($identifier, $aggregateSettings, Tx_PtExtlist_Domain_Configuration_ConfigurationBuilder $configurationBuilder)
 {
     Tx_PtExtbase_Assertions_Assert::isNotEmptyString($identifier, array('message' => 'No aggregate identifier specified. 1282891490'));
     $this->identifier = $identifier;
     if (!trim($aggregateSettings['fieldIdentifier'])) {
         throw new Exception('No fieldIdentifier for aggregate given! 1282891630');
     }
     $this->fieldIdentifier = $configurationBuilder->buildFieldsConfiguration()->getFieldConfigByIdentifier($aggregateSettings['fieldIdentifier']);
     if (!array_key_exists('method', $aggregateSettings) && !array_key_exists('special', $aggregateSettings)) {
         throw new Exception('No aggregate method or special sql given for aggregate ' . $this->identifier . '! 1282891831');
     }
     if (array_key_exists('method', $aggregateSettings)) {
         $this->method = trim($aggregateSettings['method']);
     }
     if (array_key_exists('scope', $aggregateSettings)) {
         $this->scope = $aggregateSettings['scope'];
     }
     if (array_key_exists('special', $aggregateSettings)) {
         $this->special = $aggregateSettings['special'];
         $this->scope = 'query';
     }
 }
 /**
  * Get the session data for object
  *
  * @param string $objectNamespace
  * @return array sessiondata
  */
 public function getSessionDataForObjectNamespace($objectNamespace)
 {
     Tx_PtExtbase_Assertions_Assert::isNotEmptyString($objectNamespace, array('message' => 'object namespace must not be empty! 1278436823'));
     return Tx_PtExtbase_Utility_NameSpace::getArrayContentByArrayAndNamespace($this->sessionData, $objectNamespace);
 }
Esempio n. 11
0
 /**
  * Returns configuration object for filterbox identifier
  *
  * @param string $filterboxIdentifier
  * @return Tx_PtExtlist_Domain_Configuration_Filters_FilterboxConfig
  */
 public function getFilterboxConfigurationByFilterboxIdentifier($filterboxIdentifier)
 {
     Tx_PtExtbase_Assertions_Assert::isNotEmptyString($filterboxIdentifier, array('message' => 'Filterbox identifier must not be empty! 1277889453'));
     return $this->buildFilterConfiguration()->getItemById($filterboxIdentifier);
 }
 /**
  * Get the valueArray with the right objectNamespace
  * 
  * @param Tx_PtExtbase_State_IdentifiableInterface $object
  * @param string $key
  * @param string $value
  * @return array
  */
 public function buildObjectValueArray(Tx_PtExtbase_State_IdentifiableInterface $object, $key, $value)
 {
     $nameSpace = $object->getObjectNamespace();
     Tx_PtExtbase_Assertions_Assert::isNotEmptyString($nameSpace, array('message' => 'No ObjectNamespace returned from Obejct ' . get_class($object) . '! 1280771624'));
     return $this->buildNamespaceValueArray($nameSpace, $key, $value);
 }
Esempio n. 13
0
 /**
  * Builds from part from all parts of plugin
  *
  * @return string FROM part of query without 'FROM'
  */
 public function buildFromPart()
 {
     if ($this->baseFromClause) {
         $fromPart = $this->baseFromClause;
     } else {
         $fromPart = $this->tables;
     }
     Tx_PtExtbase_Assertions_Assert::isNotEmptyString($fromPart, array('message' => 'Backend must have a tables setting or a baseFromClause in TS! None of both is given! 1280234420'));
     return $fromPart;
 }
Esempio n. 14
0
 /**
  * Initialize additional class properties
  */
 public function initConfiguration()
 {
     $this->templatePath = $this->exportConfiguration->getSettings('templatePath');
     Tx_PtExtbase_Assertions_Assert::isNotEmptyString($this->templatePath, array('message' => 'No template path given for fluid export!', 1284621481));
     $this->setTemplatePathAndFilename(\TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($this->templatePath));
 }
 /**
  * Check existance of given class and set the property
  * @param string $queryInterpreterClassName
  */
 protected function checkAndSetQueryInterpreterClass($queryInterpreterClassName)
 {
     Tx_PtExtbase_Assertions_Assert::isNotEmptyString($queryInterpreterClassName, array('message' => 'queryInterpreterClass must not be empty! 1281178538'));
     Tx_PtExtbase_Assertions_Assert::isTrue(class_exists($queryInterpreterClassName), array('message' => ' QueryInterpreter class ' . $queryInterpreterClassName . ' does not exist! 1281178539'));
     $this->queryInterpreterClass = $queryInterpreterClassName;
 }
 /**
  * (non-PHPdoc)
  * @see Tx_PtExtbase_Configuration_AbstractConfiguration::init()
  */
 protected function init()
 {
     // required
     $this->setRequiredValue('columnIdentifier', 'Column identifier for aggregate not given 1282916617');
     Tx_PtExtbase_Assertions_Assert::isNotEmptyString($this->settings['aggregateDataIdentifier'], array('message' => 'Aggregate data identifier not given for aggregate column "' . $this->columnIdentifier . '" 1282916619'));
     $this->aggregateDataIdentifier = GeneralUtility::trimExplode(',', $this->settings['aggregateDataIdentifier']);
     // optional
     $this->setValueIfExistsAndNotNothing('renderTemplate');
     $this->setValueIfExistsAndNotNothing('cellCSSClass');
     $this->setBooleanIfExistsAndNotNothing('cacheRendering');
     if (array_key_exists('renderUserFunctions', $this->settings) && is_array($this->settings['renderUserFunctions'])) {
         asort($this->settings['renderUserFunctions']);
         $this->renderUserFunctions = $this->settings['renderUserFunctions'];
     }
     if (array_key_exists('renderObj', $this->settings)) {
         $this->renderObj = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Service\\TypoScriptService')->convertPlainArrayToTypoScriptArray(array('renderObj' => $this->settings['renderObj']));
     }
 }
 /**
  * @param Tx_PtExtbase_State_IdentifiableInterface $object
  * @return String
  */
 public function getObjectNameSpace(Tx_PtExtbase_State_IdentifiableInterface $object)
 {
     $nameSpace = $object->getObjectNamespace();
     Tx_PtExtbase_Assertions_Assert::isNotEmptyString($nameSpace, array('message' => 'No ObjectNamespace returned from Obejct ' . get_class($object) . '! 1280771624'));
     return $nameSpace;
 }
Esempio n. 18
0
 private function initTypoScriptSettings()
 {
     $this->fluidTemplatePath = $this->exportConfiguration->getSettings('templatePath');
     Tx_PtExtbase_Assertions_Assert::isNotEmptyString($this->fluidTemplatePath, array('message' => 'No template path given for fluid export! 1284621481'));
     $this->setTemplatePathAndFilename(\TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($this->fluidTemplatePath));
     // TODO take a look at http://madalgo.au.dk/~jakobt/wkhtmltoxdoc/wkhtmltopdf_0.10.0_rc2-doc.html for further information on parameters!
     // --page-size	<Size>	Set paper size to: A4, Letter, etc. (default A4)
     $this->size = strtolower($this->exportConfiguration->getSettings('paperSize'));
     Tx_PtExtbase_Assertions_Assert::isNotEmptyString($this->size, array('message' => 'No PaperSize given for the PDF output! 1322585559'));
     // TODO take a look at http://madalgo.au.dk/~jakobt/wkhtmltoxdoc/wkhtmltopdf_0.10.0_rc2-doc.html for further informatoin on parameters
     // --orientation	<orientation>	Set orientation to Landscape or Portrait (default Portrait)
     $this->orient = $this->exportConfiguration->getSettings('paperOrientation');
     Tx_PtExtbase_Assertions_Assert::isInArray($this->orient, array('portrait', 'landscape'), array('message' => 'The Orientation must either be portrait or landscape! 1322585560'));
     $this->cssFilePath = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($this->exportConfiguration->getSettings('cssFilePath'));
     Tx_PtExtbase_Assertions_Assert::isTrue(file_exists($this->cssFilePath), array('message' => 'The CSS File with the filename ' . $this->cssFilePath . ' can not be found. 1322587627'));
     $this->additionalWkhtmlParams = $this->exportConfiguration->getSettings('additionalWkhtmlParams');
     $this->wkhtmlHeaderHtml = $this->exportConfiguration->getSettings('wkhtmlHeaderHtml');
     $this->wkhtmlFooterHtml = $this->exportConfiguration->getSettings('wkhtmlFooterHtml');
 }
Esempio n. 19
0
 /**
  * Setter for exclude filters for this filterbox.
  *
  * Set excludeFilters = filterboxIdentifier1.filterIdentifier1, filterboxIdentifier1.filterIdentifier2, ...
  *
  * @param $excludeFiltersString
  * @return void
  */
 protected function setExcludeFilters($excludeFiltersString)
 {
     $excludeFilters = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $excludeFiltersString);
     foreach ($excludeFilters as $excludedFilter) {
         list($filterboxIdentifier, $filterIdentifier) = explode('.', $excludedFilter);
         Tx_PtExtbase_Assertions_Assert::isNotEmptyString($filterboxIdentifier, array('message' => 'You have not set a filterboxIdentifier in your excludeFilter configuration for filterbox ' . $this->getFilterboxIdentifier() . ' 1315845416'));
         Tx_PtExtbase_Assertions_Assert::isNotEmptyString($filterIdentifier, array('message' => 'You have not set a filterIdentifier in your excludeFilter configuration for filterbox ' . $this->getFilterboxIdentifier() . ' 1315845417'));
         if (!is_array($this->excludeFilters[$filterboxIdentifier]) || !in_array($filterIdentifier, $this->excludeFilters[$filterboxIdentifier])) {
             $this->excludeFilters[$filterboxIdentifier][] = $filterIdentifier;
         }
     }
 }
Esempio n. 20
0
 /**
  * Creates filter object for given filter class name
  *
  * @param string $filterClassName
  * @return Tx_PtExtlist_Domain_Model_Filter_FilterInterface
  */
 private function createFilterObject($filterClassName)
 {
     Tx_PtExtbase_Assertions_Assert::isNotEmptyString($filterClassName, array('message' => 'No filter class name given, check TS configuration! 1277889459'));
     Tx_PtExtbase_Assertions_Assert::isTrue(class_exists($filterClassName), array('message' => 'Given filter class ' . $filterClassName . ' does not exist or is not loaded! 1277889460'));
     $filter = $this->objectManager->get($filterClassName);
     /* @var $filter Tx_PtExtlist_Domain_Model_Filter_FilterInterface */
     Tx_PtExtbase_Assertions_Assert::isTrue(is_a($filter, 'Tx_PtExtlist_Domain_Model_Filter_FilterInterface'), array('message' => 'Given filter class does not implement filter interface! 1277889461'));
     $filter->_injectGpVarsAdapter($this->getPostVarsAdapterFactory->getInstance());
     return $filter;
 }
Esempio n. 21
0
 /**
  * Init the data provider
  */
 public function init()
 {
     // TODO use DI here!
     $this->dbObj = $GLOBALS['TYPO3_DB'];
     $sqlQuerySettings = $this->filterConfig->getSettings('optionsSqlQuery');
     foreach ($sqlQuerySettings as $type => $part) {
         if (!is_array($part)) {
             $sqlQuerySettings[$type] = trim($part);
         }
     }
     if ($sqlQuerySettings['select']) {
         $this->selectPart = Tx_PtExtlist_Utility_RenderValue::stdWrapIfPlainArray($sqlQuerySettings['select']);
     }
     if ($sqlQuerySettings['from']) {
         $this->fromPart = Tx_PtExtlist_Utility_RenderValue::stdWrapIfPlainArray($sqlQuerySettings['from']);
     }
     if ($sqlQuerySettings['where']) {
         $this->wherePart = Tx_PtExtlist_Utility_RenderValue::stdWrapIfPlainArray($sqlQuerySettings['where']);
     }
     if ($sqlQuerySettings['orderBy']) {
         $this->orderByPart = Tx_PtExtlist_Utility_RenderValue::stdWrapIfPlainArray($sqlQuerySettings['orderBy']);
     }
     if ($sqlQuerySettings['groupBy']) {
         $this->groupByPart = Tx_PtExtlist_Utility_RenderValue::stdWrapIfPlainArray($sqlQuerySettings['groupBy']);
     }
     if ($sqlQuerySettings['limit']) {
         $this->limitPart = Tx_PtExtlist_Utility_RenderValue::stdWrapIfPlainArray($sqlQuerySettings['limit']);
     }
     $this->filterField = trim($this->filterConfig->getSettings('filterField'));
     $this->displayFields = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->filterConfig->getSettings('displayFields'));
     Tx_PtExtbase_Assertions_Assert::isNotEmptyString($this->filterField, array('info' => 'No filter field is given for filter ' . $this->filterConfig->getFilterIdentifier() . ' 1315221957'));
     Tx_PtExtbase_Assertions_Assert::isNotEmptyString($this->selectPart, array('info' => 'No Select part is given for filter ' . $this->filterConfig->getFilterIdentifier() . ' 1315221958'));
     Tx_PtExtbase_Assertions_Assert::isNotEmptyString($this->fromPart, array('info' => 'No from part is given for filter ' . $this->filterConfig->getFilterIdentifier() . ' 1315221959'));
 }
Esempio n. 22
0
 /**
  * @see Tx_PtExtlist_Domain_Model_Filter_AbstractFilter::initFilterByTsConfig()
  */
 protected function initFilterByTsConfig()
 {
     $filterSettings = $this->filterConfig->getSettings();
     Tx_PtExtbase_Assertions_Assert::isNotEmptyString($filterSettings['proxyPath'], array('message' => 'No proxy path to the proxy filter set.', 1288033657));
     $this->setProxyConfigFromProxyPath(trim($filterSettings['proxyPath']));
 }
 /**
  * Returns all group bookmarks for a given user and a given list of group uids for which bookmarks should be collected for a given list identifier.
  * 
  * Example: 
  *     User is in Groups (1,2,3,4)
  *     Groups to be shown (3,4)
  *     ==> all bookmarks for groups 3,4 are returned
  *
  * @param \TYPO3\CMS\Extbase\Domain\Model\FrontendUser $feUser
  * @param string $groupIds Comma-separated list of group uids
  * @param string $listIdentifier
  * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<Tx_PtExtlist_Domain_Model_Bookmarks_Bookmark>
  */
 public function findBookmarksByFeUserGroupIdsAndListIdentifier(\TYPO3\CMS\Extbase\Domain\Model\FrontendUser $feUser, $groupIds, $listIdentifier)
 {
     Tx_PtExtbase_Assertions_Assert::isNotEmptyString($listIdentifier, array('message' => 'List identifier must not be empty! 1283117069'));
     if (!is_array($groupIds)) {
         $groupIds = explode(',', $groupIds);
     }
     $groupBookmarks = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
     $feUserGroups = $feUser->getUsergroups();
     foreach ($feUserGroups as $feUserGroup) {
         /* @var $feUserGroup \TYPO3\CMS\Extbase\Domain\Model\FrontendUserGroup */
         if (in_array($feUserGroup->getUid(), $groupIds)) {
             $bookmarks = $this->findGroupBookmarksByFeGroupAndListIdentifier($feUserGroup, $listIdentifier);
             foreach ($bookmarks as $bookmark) {
                 $groupBookmarks->attach($bookmark);
             }
         }
     }
     return $groupBookmarks;
 }
Esempio n. 24
0
 /**
  * Get Typoscript from array
  *
  * @example To get an array: Tx_PtExtbase_Div::getTS('plugin.my_ext.');
  * @example To get a single value: Tx_PtExtbase_Div::getTS('plugin.my_ext.my_key');
  * @param   string      typoscript path
  * @param   array       (optional) typoscript array, if empty using $GLOBALS['TSFE']->tmpl->setup
  * @return  mixed       typoscript array or single value
  * @throws    Tx_PtExtbase_Exception_Assertion     if no tsArray is given and not being in a frontend context
  * @throws    Tx_PtExtbase_Exception_Assertion     if tsPath is not valid
  * @throws    \PunktDe\PtExtbase\Exception\Exception            if subKey was not found
  * @author  Rainer Kuhn , Fabrizio Branca <*****@*****.**>
  */
 public static function getTS($tsPath, array $tsArray = array())
 {
     Tx_PtExtbase_Assertions_Assert::isNotEmptyString($tsPath, array('message' => '"tsPath" is empty!'));
     // TODO: improve pattern, so that ".blub" or "plugin..test" are not matched
     if (empty($tsArray)) {
         Tx_PtExtbase_Assertions_Assert::isInstanceOf($GLOBALS['TSFE'], 'tslib_fe', array('message' => 'No TSFE available!'));
         $tsArray = $GLOBALS['TSFE']->tmpl->setup;
     }
     Tx_PtExtbase_Assertions_Assert::isNotEmpty($tsArray);
     $lastKeyIsArray = false;
     if (substr($tsPath, -1) == '.') {
         $lastKeyIsArray = true;
     }
     $keyPartsArray = explode('.', $tsPath);
     for ($i = 0; $i < count($keyPartsArray); $i++) {
         if (!empty($keyPartsArray[$i])) {
             $newSubKey = $keyPartsArray[$i] . ($i < count($keyPartsArray) - 1 || $lastKeyIsArray == true ? '.' : '');
             $tsArray = $tsArray[$newSubKey];
         }
     }
     return $tsArray;
 }
Esempio n. 25
0
 /**
  * Adds a sorting for a given field and a given direction to array of sortings.
  * Direction may be either self::SORTINGSTATE_DESC oder self::SORTINGSTATE_ASC
  *
  * @param string $field Field to be sorted
  * @param integer $direction Direction of sorting
  * @throws Exception
  */
 public function addSorting($field, $direction = self::SORTINGSTATE_ASC)
 {
     Tx_PtExtbase_Assertions_Assert::isNotEmptyString($field, array('message' => 'field must not be empty! 1280060692'));
     if ($direction == self::SORTINGSTATE_ASC || $direction == self::SORTINGSTATE_DESC) {
         $this->sortings[$field] = $direction;
     } else {
         throw new Exception('Given direction must be either SORTINGSTATE_ASC(1) or SORTINGSTATE_DESC(-1), but was ' . $direction);
     }
 }