-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#40 MINFO works for new model classes
- Loading branch information
Showing
4 changed files
with
109 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
/** | ||
* Copyright notice | ||
* | ||
* (c) 2016 René Nitzsche <[email protected]> | ||
* 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! | ||
*/ | ||
|
||
/** | ||
* | ||
* @package TYPO3 | ||
* @subpackage rn_base | ||
* @author René Nitzsche <[email protected]> | ||
*/ | ||
class Tx_Rnbase_Frontend_Marker_BaseMarker { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
/** | ||
* Copyright notice | ||
* | ||
* (c) 2016 René Nitzsche <[email protected]> | ||
* 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! | ||
*/ | ||
|
||
/** | ||
* | ||
* @package TYPO3 | ||
* @subpackage rn_base | ||
* @author René Nitzsche <[email protected]> | ||
*/ | ||
class Tx_Rnbase_Frontend_Marker_Utility { | ||
/** | ||
* Returns an array with all attribute names not used in template | ||
* | ||
* @param Tx_Rnbase_Domain_Model_Data $item | ||
* @param string $template | ||
* @param string $marker | ||
* @return array | ||
*/ | ||
public static function findUnusedAttributes(Tx_Rnbase_Domain_Model_Data $item, $template, $marker) { | ||
$ignore = array(); | ||
$minfo = self::containsMarker($template, $marker.'___MINFO'); | ||
$minfoArr = array(); | ||
foreach($item As $key=>$value) { | ||
if($minfo) { | ||
$minfoArr[$key] = $marker.'_'.strtoupper($key); | ||
} | ||
if(!self::containsMarker($template, $marker.'_'.strtoupper($key))) | ||
$ignore[] = $key; | ||
} | ||
if($minfo) { | ||
tx_rnbase::load('tx_rnbase_util_Debug'); | ||
$item->setProperty('__MINFO', tx_rnbase_util_Debug::viewArray($minfoArr)); | ||
} | ||
return $ignore; | ||
|
||
} | ||
|
||
/** | ||
* @param string $template | ||
* @param string $markerPrefix a string like MATCH_HOME | ||
* @return boolean | ||
*/ | ||
public static function containsMarker($template, $markerPrefix) { | ||
return (strpos($template, '###'.$markerPrefix) !== FALSE); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters