Skip to content

Commit

Permalink
Merge pull request #11 from Gernott/v1.1.2
Browse files Browse the repository at this point in the history
V1.1.2
  • Loading branch information
butu committed Mar 2, 2016
2 parents 6dbb286 + 9f37289 commit 3fe4c66
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 27 deletions.
3 changes: 1 addition & 2 deletions Classes/Controller/WizardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,7 @@ protected function saveHtml($key, $html) {
if (file_exists(PATH_site . $extConf["content"] . $key . ".html")) {
return false;
} else {
$handle = fopen(PATH_site . $extConf["content"] . $key . ".html", "w");
fwrite($handle, $html);
\TYPO3\CMS\Core\Utility\GeneralUtility::writeFile(PATH_site . $extConf["content"] . $key . ".html", $html);
return true;
}
}
Expand Down
10 changes: 4 additions & 6 deletions Classes/Domain/Repository/StorageRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,17 +197,16 @@ public function add($content) {
}

// Save
$extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['mask']);
$handle = fopen(PATH_site . $extConf["json"], "w");
$encodedJson = "";
$extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['mask']);
$encodedJson = "";

// Return JSON formatted in PHP 5.4.0 and higher
if (version_compare(phpversion(), '5.4.0', '<')) {
$encodedJson = json_encode($json);
} else {
$encodedJson = json_encode($json, JSON_PRETTY_PRINT);
}
fwrite($handle, $encodedJson);
\TYPO3\CMS\Core\Utility\GeneralUtility::writeFile(PATH_site . $extConf["json"], $encodedJson);
}

/**
Expand All @@ -230,8 +229,7 @@ public function remove($type, $key) {
}
// Save
$extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['mask']);
$handle = fopen(PATH_site . $extConf["json"], "w");
fwrite($handle, json_encode($json));
\TYPO3\CMS\Core\Utility\GeneralUtility::writeFile(PATH_site . $extConf["json"], json_encode($json));
}

/**
Expand Down
3 changes: 1 addition & 2 deletions Classes/Utility/MaskUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -665,8 +665,7 @@ public function generateTableTca($table, $tca) {
// Create Fields-Array
$fields = array_keys($tca);
if ($fields) {
$fieldsCopy = $fields;
$firstField = array_pop($fieldsCopy);
$firstField = $fields[0];
}

// backwards compatibility for typo3 6.2
Expand Down
9 changes: 7 additions & 2 deletions Classes/ViewHelpers/ConfigureExtensionViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace MASK\Mask\ViewHelpers;

use TYPO3\CMS\Backend\Utility\BackendUtility;

/**
*
* @package TYPO3
Expand All @@ -21,9 +23,12 @@ public function render() {
'tx_extensionmanager_tools_extensionmanagerextensionmanager[extension][key]' => 'mask',
'tx_extensionmanager_tools_extensionmanagerextensionmanager[action]' => 'showConfigurationForm',
'tx_extensionmanager_tools_extensionmanagerextensionmanager[controller]' => 'Configuration',
'returnUrl' => '/typo3/index.php?M=web_list&moduleToken=af60fa4a531eeec50e8d9890a4c278271d6c9c17&id=1&imagemode=1'
'returnUrl' => BackendUtility::getModuleUrl('tools_MaskMask', array(
'tx_mask_tools_maskmask[controller]' => $this->controllerContext->getRequest()->getControllerName(),
'tx_mask_tools_maskmask[action]' => $this->controllerContext->getRequest()->getControllerActionName(),
)),
);
$url = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('tools_ExtensionmanagerExtensionmanager', $urlParameters);
$url = BackendUtility::getModuleUrl('tools_ExtensionmanagerExtensionmanager', $urlParameters);
return'<a href="' . htmlspecialchars($url) . '">' . $this->renderChildren() . '</a>';
}

Expand Down
5 changes: 1 addition & 4 deletions Configuration/TypoScript/setup.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ temp.mask.content {
# temp.content is deprecated, always use temp.mask.content
temp.content < temp.mask.content


# Temporary page cObject:
temp.mask.page = PAGE
temp.mask.page {
Expand Down Expand Up @@ -76,9 +75,7 @@ lib.parseFunc {
typolink.extTarget =
typolink.extTarget.override = _blank
typolink.target < lib.parseTarget
typolink.target =
typolink.target.override = _blank
parseFunc.constants =1
parseFunc.constants = 1
}
}
allowTags = a, abbr, acronym, address, article, aside, b, bdo, big, blockquote, br, caption, center, cite, code, col, colgroup, dd, del, dfn, dl, div, dt, em, font, footer, header, h1, h2, h3, h4, h5, h6, hr, i, img, ins, kbd, label, li, link, meta, nav, ol, p, pre, q, samp, sdfield, section, small, span, strike, strong, style, sub, sup, table, thead, tbody, tfoot, td, th, tr, title, tt, u, ul, var
Expand Down
4 changes: 2 additions & 2 deletions Resources/Public/Scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -465,9 +465,9 @@ function syncBodyToHead(body) {
var title = jQuery(body).find("INPUT[name='tx_mask_tools_maskmask[storage][elements][labels][--index--]']:visible").val();

var head = findHeadByBody(body);
jQuery(head).find(" > .tx_mask_btn_row .id_keytext").html(key);
jQuery(head).find(" > .tx_mask_btn_row .id_keytext, > .id_keytext").html(key);
var head = findHeadByBody(body);
jQuery(head).find(" > .tx_mask_btn_row .id_labeltext").html(title);
jQuery(head).find(" > .tx_mask_btn_row .id_labeltext, > .id_labeltext").html(title);

// Show correct label and key in tabcell3 on top
jQuery(body).find(".tx_mask_fieldheader_text H1").html(title);
Expand Down
4 changes: 2 additions & 2 deletions ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

$EM_CONF[$_EXTKEY] = array(
'title' => 'Mask',
'description' => 'Create your own content elements and page templates. Easy to use, even without programming skills because of the comfortable drag&drop system. Stored in structured database tables.',
'description' => 'Create your own content elements and page templates. Easy to use, even without programming skills because of the comfortable drag&drop system. Stored in structured database tables. Style your frontend with Fluid tags. Ideal, if you want to switch from Templavoila and create an advancedCE (FCE).',
'category' => 'plugin',
'author' => 'TYPO3.experten Team',
'author_email' => 'office@typo3experten.com',
Expand All @@ -17,7 +17,7 @@
'modify_tables' => '',
'clearCacheOnLoad' => 1,
'lockType' => '',
'version' => '1.1.1',
'version' => '1.1.2',
'constraints' => array(
'depends' => array(
'typo3' => '6.2.0-7.6.99',
Expand Down
22 changes: 16 additions & 6 deletions ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

// Load JSON file
$extConf = unserialize($_EXTCONF);
if (file_exists(PATH_site . $extConf["json"])) {
if (!empty($extConf["json"]) && file_exists(PATH_site . $extConf["json"])) {
$json = json_decode(file_get_contents(PATH_site . $extConf["json"]), true);
}

Expand Down Expand Up @@ -218,11 +218,21 @@ function user_mask_beLayout($layout) {
$data = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($sql);
$uid = $data["pid"];
}
} elseif ($GLOBALS["SOBE"]->editconf["pages"]) { // after opening pages
$uid = intval(key($GLOBALS["SOBE"]->editconf["pages"]));
} else { // after opening or creating pages_language_overlay
$uid = $GLOBALS["SOBE"]->viewId;
}
} elseif ($GLOBALS["SOBE"]->editconf["pages"]) { // after opening pages
$uid = intval(key($GLOBALS["SOBE"]->editconf["pages"]));
} elseif ($GLOBALS["SOBE"]->viewId) { // after opening or creating pages_language_overlay
$uid = $GLOBALS["SOBE"]->viewId;
} else {
if ($GLOBALS["_SERVER"]["HTTP_REFERER"] != "") {
$url = $GLOBALS["_SERVER"]["HTTP_REFERER"];
$queryString = parse_url($url, PHP_URL_QUERY);
$result = array();
parse_str($queryString, $result);
if ($result["id"]) {
$uid = (int) $result["id"];
}
}
}

if ($uid) {
$sql = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
Expand Down
2 changes: 1 addition & 1 deletion ext_tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

// Load JSON-File from $_EXTCONF:
$extConf = unserialize($_EXTCONF);
if (file_exists(PATH_site . $extConf["json"])) {
if (!empty($extConf["json"]) && file_exists(PATH_site . $extConf["json"])) {

$json = json_decode(file_get_contents(PATH_site . $extConf["json"]), true);

Expand Down

0 comments on commit 3fe4c66

Please sign in to comment.