Skip to content

Commit

Permalink
Merge branch 'tollwerk-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
butu committed Oct 16, 2015
2 parents 76ed699 + 097dab6 commit a7c6a67
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 30 deletions.
6 changes: 3 additions & 3 deletions Classes/Controller/WizardContentController.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function createAction($storage) {
$html = $this->generateHtml($storage["elements"]["key"]); // generate HTML
$this->saveHtml($storage["elements"]["key"], $html); // save HTML
$this->savePreviewImage($storage["elements"]["key"]); // save preview image
$this->flashMessageContainer->add(\TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('tx_mask.content.newcontentelement', 'mask'));
$this->addFlashMessage(\TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('tx_mask.content.newcontentelement', 'mask'));
$this->redirectByAction();
}

Expand Down Expand Up @@ -113,7 +113,7 @@ public function updateAction($storage) {
$this->generateAction();
$html = $this->generateHtml($storage["elements"]["key"]); // generate HTML
$this->saveHtml($storage["elements"]["key"], $html); // save HTML
$this->flashMessageContainer->add(\TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('tx_mask.content.updatedcontentelement', 'mask'));
$this->addFlashMessage(\TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('tx_mask.content.updatedcontentelement', 'mask'));
$this->redirectByAction();
}

Expand All @@ -127,7 +127,7 @@ public function updateAction($storage) {
public function deleteAction($key, $type) {
$this->storageRepository->remove($type, $key);
$this->generateAction();
$this->flashMessageContainer->add(\TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('tx_mask.content.deletedcontentelement', 'mask'));
$this->addErrorFlashMessage(\TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('tx_mask.content.deletedcontentelement', 'mask'));
$this->redirect('list');
}

Expand Down
15 changes: 7 additions & 8 deletions Classes/Controller/WizardController.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* ************************************************************* */

/**
*
*^
*
* @package mask
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
Expand Down Expand Up @@ -99,8 +99,7 @@ protected function checkForDbUpdate($extensionKey, $sqlContent) {
$sqlHandler = $this->objectManager->get('TYPO3\\CMS\\Install\\Sql\\SchemaMigrator');
}
/** @var $cacheManager \TYPO3\CMS\Core\Cache\CacheManager */
$cacheManager = $GLOBALS['typo3CacheManager'];
$cacheManager->setCacheConfigurations($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']);
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Cache\\CacheManager')->setCacheConfigurations($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']);
$sqlContent .= \TYPO3\CMS\Core\Cache\Cache::getDatabaseTableDefinitions();
$fieldDefinitionsFromFile = $sqlHandler->getFieldDefinitions_fileContent($sqlContent);
if (count($fieldDefinitionsFromFile)) {
Expand Down Expand Up @@ -366,7 +365,7 @@ protected function checkFolders() {
*/
public function checkFieldKey($params = array(), \TYPO3\CMS\Core\Http\AjaxRequestHandler &$ajaxObj = NULL) {
$this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
$this->storageRepository = $this->objectManager->get("\MASK\Mask\Domain\Repository\StorageRepository");
$this->storageRepository = $this->objectManager->get("MASK\Mask\Domain\Repository\StorageRepository");
// Get parameters, is there a better way? $params is not used yet
$fieldKey = $_GET["key"];
if ($_GET["table"]) {
Expand Down Expand Up @@ -394,7 +393,7 @@ public function checkFieldKey($params = array(), \TYPO3\CMS\Core\Http\AjaxReques
*/
public function checkElementKey($params = array(), \TYPO3\CMS\Core\Http\AjaxRequestHandler &$ajaxObj = NULL) {
$this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
$this->storageRepository = $this->objectManager->get("\MASK\Mask\Domain\Repository\StorageRepository");
$this->storageRepository = $this->objectManager->get("MASK\Mask\Domain\Repository\StorageRepository");
// Get parameters, is there a better way? $params is not used yet
$elementKey = $_GET["key"];
// check if elementKey is available
Expand Down Expand Up @@ -439,10 +438,10 @@ protected function createMissingFolders() {
$extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['mask']);
$success = TRUE;
if (!file_exists(PATH_site . $extConf["content"])) {
$success = $success && mkdir(PATH_site . $extConf["content"]);
$success = $success && mkdir(PATH_site . $extConf["content"], 0755, true);
}
if (!file_exists(PATH_site . $extConf["preview"])) {
$success = $success && mkdir(PATH_site . $extConf["preview"]);
$success = $success && mkdir(PATH_site . $extConf["preview"], 0755, true);
}
return $success;
}
Expand All @@ -453,7 +452,7 @@ protected function createMissingFolders() {
*/
public function createMissingFoldersAction() {
if ($this->createMissingFolders()) {
$this->flashMessageContainer->add(\TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('tx_mask.all.createdmissingfolders', 'mask'));
$this->addFlashMessage(\TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('tx_mask.all.createdmissingfolders', 'mask'));
}
$this->redirect("list");
}
Expand Down
6 changes: 3 additions & 3 deletions Classes/Controller/WizardPageController.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function newAction() {
public function createAction($storage) {
$this->storageRepository->add($storage);
$this->generateAction();
$this->flashMessageContainer->add('Your new Content-Element was created.');
$this->addFlashMessage('Your new Content-Element was created.');
$this->redirect('list');
}

Expand All @@ -99,7 +99,7 @@ public function editAction($layout) {
public function updateAction($storage) {
$this->storageRepository->update($storage);
$this->generateAction();
$this->flashMessageContainer->add(\TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('tx_mask.page.updatedpage', 'mask'));
$this->addErrorFlashMessage(\TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('tx_mask.page.updatedpage', 'mask'));
$this->redirectByAction();
}

Expand All @@ -111,7 +111,7 @@ public function updateAction($storage) {
*/
public function deleteAction(array $storage) {
$this->storageRepository->remove($storage);
$this->flashMessageContainer->add('Your Page was removed.');
$this->addErrorFlashMessage('Your Page was removed.');
$this->redirect('list');
}

Expand Down
13 changes: 7 additions & 6 deletions Classes/Fluid/FluidTemplateContentObject.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?php

namespace MASK\Mask\Fluid;

/***************************************************************
/* * *************************************************************
* Copyright notice
*
* (c) 2010-2013 Extbase Team (http://forge.typo3.org/projects/typo3v4-mvc)
Expand All @@ -26,7 +27,7 @@
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
* ************************************************************* */

class FluidTemplateContentObject extends \TYPO3\CMS\Frontend\ContentObject\FluidTemplateContentObject {

Expand All @@ -48,16 +49,15 @@ class FluidTemplateContentObject extends \TYPO3\CMS\Frontend\ContentObject\Fluid
/**
* Assign content object renderer data and current to view
*
* @param array $conf Configuration
* @author Benjamin Butschell <bb@webprofil.at>
* @return void
*/
protected function assignContentObjectDataAndCurrent(array $conf) {
protected function assignContentObjectDataAndCurrent() {
// Call Parent Function to maintain core functions
parent::assignContentObjectDataAndCurrent($conf);
parent::assignContentObjectDataAndCurrent();

$this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
$this->utility = $this->objectManager->get("\MASK\Mask\Utility\MaskUtility");
$this->utility = $this->objectManager->get("MASK\Mask\Utility\MaskUtility");

// Make some enhancements to data
$data = $this->cObj->data;
Expand All @@ -66,4 +66,5 @@ protected function assignContentObjectDataAndCurrent(array $conf) {

$this->view->assign('data', $data);
}

}
14 changes: 7 additions & 7 deletions Classes/Utility/MaskUtility.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class MaskUtility {
public function __construct(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager, \MASK\Mask\Domain\Repository\StorageRepository $storageRepository = NULL) {
$this->objectManager = $objectManager;
if (!$storageRepository) {
$this->storageRepository = $this->objectManager->get("\MASK\Mask\Domain\Repository\StorageRepository");
$this->storageRepository = $this->objectManager->get("MASK\Mask\Domain\Repository\StorageRepository");
} else {
$this->storageRepository = $storageRepository;
}
Expand All @@ -37,7 +37,7 @@ public function __construct(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $ob
* @author Benjamin Butschell <bb@webprofil.at>
*/
public function getElementsWhichUseField($key, $type = "tt_content") {
$this->storageRepository = $this->objectManager->get("\MASK\Mask\Domain\Repository\StorageRepository");
$this->storageRepository = $this->objectManager->get("MASK\Mask\Domain\Repository\StorageRepository");
$storage = $this->storageRepository->load();

$elementsInUse = array();
Expand Down Expand Up @@ -66,7 +66,7 @@ public function getElementsWhichUseField($key, $type = "tt_content") {
* @author Benjamin Butschell <bb@webprofil.at>
*/
public function getLabel($elementKey, $fieldKey, $type = "tt_content", $isInlineField = FALSE) {
$this->storageRepository = $this->objectManager->get("\MASK\Mask\Domain\Repository\StorageRepository");
$this->storageRepository = $this->objectManager->get("MASK\Mask\Domain\Repository\StorageRepository");
$storage = $this->storageRepository->load();
$fieldIndex = -1;
if (count($storage[$type]["elements"][$elementKey]["columns"]) > 0) {
Expand Down Expand Up @@ -94,7 +94,7 @@ public function getLabel($elementKey, $fieldKey, $type = "tt_content", $isInline
* @author Benjamin Butschell <bb@webprofil.at>
*/
public function getFormType($fieldKey, $elementKey = "", $type = "tt_content") {
$this->storageRepository = $this->objectManager->get("\MASK\Mask\Domain\Repository\StorageRepository");
$this->storageRepository = $this->objectManager->get("MASK\Mask\Domain\Repository\StorageRepository");
$formType = "String";

// Load element and TCA of field
Expand Down Expand Up @@ -222,7 +222,7 @@ public function getFormType($fieldKey, $elementKey = "", $type = "tt_content") {
* @author Benjamin Butschell <bb@webprofil.at>
*/
public function isEvalValueSet($fieldKey, $evalValue, $type = "tt_content") {
$this->storageRepository = $this->objectManager->get("\MASK\Mask\Domain\Repository\StorageRepository");
$this->storageRepository = $this->objectManager->get("MASK\Mask\Domain\Repository\StorageRepository");
$storage = $this->storageRepository->load();
$found = FALSE;
if ($storage[$type]["tca"][$fieldKey]["config"]["eval"] != "") {
Expand All @@ -242,7 +242,7 @@ public function isEvalValueSet($fieldKey, $evalValue, $type = "tt_content") {
* @author Benjamin Butschell <bb@webprofil.at>
*/
public function isBlindLinkOptionSet($fieldKey, $evalValue, $type = "tt_content") {
$this->storageRepository = $this->objectManager->get("\MASK\Mask\Domain\Repository\StorageRepository");
$this->storageRepository = $this->objectManager->get("MASK\Mask\Domain\Repository\StorageRepository");
$storage = $this->storageRepository->load();
$found = FALSE;
if ($storage[$type]["tca"][$fieldKey]["config"]["wizards"]["link"]["params"]["blindLinkOptions"] != "") {
Expand All @@ -261,7 +261,7 @@ public function isBlindLinkOptionSet($fieldKey, $evalValue, $type = "tt_content"
* @author Benjamin Butschell <bb@webprofil.at>
*/
public function getFieldType($fieldKey, $elementKey = "") {
$this->storageRepository = $this->objectManager->get("\MASK\Mask\Domain\Repository\StorageRepository");
$this->storageRepository = $this->objectManager->get("MASK\Mask\Domain\Repository\StorageRepository");
$storage = $this->storageRepository->load();

$types = array("pages", "tt_content");
Expand Down
12 changes: 9 additions & 3 deletions ext_localconf.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,15 @@
// generate TypoScript setup
$setupContent = 'module.tx_mask {
view {
templateRootPath = EXT:mask/Resources/Private/Backend/Templates/
partialRootPath = EXT:mask/Resources/Private/Backend/Partials/
layoutRootPath = EXT:mask/Resources/Private/Backend/Layouts/
templateRootPaths {
10 = EXT:mask/Resources/Private/Backend/Templates/
}
partialRootPaths {
10 = EXT:mask/Resources/Private/Backend/Partials/
}
layoutRootPaths {
10 = EXT:mask/Resources/Private/Backend/Layouts/
}
}
persistence{
classes {
Expand Down

0 comments on commit a7c6a67

Please sign in to comment.