コード例 #1
0
 /**
  * @param string $link the given link as integer uid or string
  * @return boolean
  * @author Alexander Fuchs <*****@*****.**>
  * @api
  */
 public function render($link)
 {
     if ($link === NULL) {
         return FALSE;
     }
     return t3lib_utility_Math::canBeInterpretedAsInteger($link) ? TRUE : FALSE;
 }
コード例 #2
0
 /**
  * Tests if the input can be interpreted as integer.
  * @return boolean
  */
 public static function testInt($var)
 {
     if (tx_rnbase_util_TYPO3::isTYPO46OrHigher()) {
         return t3lib_utility_Math::canBeInterpretedAsInteger($var);
     } else {
         return t3lib_div::testInt($var);
     }
 }
コード例 #3
0
 /**
  * Wrapper for t3lib_div::testInt and \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($var)
  * @param mixed $var
  * @return boolean
  */
 public static function isInteger($var)
 {
     if (tx_rnbase_util_TYPO3::isTYPO62OrHigher()) {
         $isInteger = \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($var);
     } elseif (tx_rnbase_util_TYPO3::isTYPO46OrHigher()) {
         $isInteger = t3lib_utility_Math::canBeInterpretedAsInteger($var);
     } else {
         $isInteger = t3lib_div::testInt($var);
     }
     return $isInteger;
 }
コード例 #4
0
 public static function testInt($var)
 {
     $result = FALSE;
     $callingClassName = '\\TYPO3\\CMS\\Core\\Utility\\MathUtility';
     if (class_exists($callingClassName) && method_exists($callingClassName, 'canBeInterpretedAsInteger')) {
         $result = call_user_func($callingClassName . '::canBeInterpretedAsInteger', $var);
     } else {
         if (class_exists('t3lib_utility_Math') && method_exists('t3lib_utility_Math', 'canBeInterpretedAsInteger')) {
             $result = t3lib_utility_Math::canBeInterpretedAsInteger($var);
         } else {
             if (class_exists('t3lib_div') && method_exists('t3lib_div', 'testInt')) {
                 $result = t3lib_div::testInt($var);
             }
         }
     }
     return $result;
 }
コード例 #5
0
 /**
  * Adds elements to the input $markContentArray based on the values from the fields from $fieldList found in $row
  *
  * @param	array		Array with key/values being marker-strings/substitution values.
  * @param	array		An array with keys found in the $fieldList (typically a record) which values should be moved to the $markContentArray
  * @param	string		A list of fields from the $row array to add to the $markContentArray array. If empty all fields from $row will be added (unless they are integers)
  * @param	boolean		If set, all values added to $markContentArray will be nl2br()'ed
  * @param	string		Prefix string to the fieldname before it is added as a key in the $markContentArray. Notice that the keys added to the $markContentArray always start and end with "###"
  * @param	boolean		If set, all values are passed through htmlspecialchars() - RECOMMENDED to avoid most obvious XSS and maintain XHTML compliance.
  * @return	array		The modified $markContentArray
  */
 public function fillInMarkerArray(&$markerArray, $row, $securedArray, $fieldList = '', $nl2br = TRUE, $prefix = 'FIELD_', $HSC = TRUE)
 {
     if (is_array($securedArray)) {
         foreach ($securedArray as $field => $value) {
             $row[$field] = $securedArray[$field];
         }
     }
     if ($fieldList) {
         $fArr = t3lib_div::trimExplode(',', $fieldList, 1);
         foreach ($fArr as $field) {
             $markerArray['###' . $prefix . $field . '###'] = $nl2br ? nl2br($row[$field]) : $row[$field];
         }
     } else {
         if (is_array($row)) {
             foreach ($row as $field => $value) {
                 $bFieldIsInt = class_exists('t3lib_utility_Math') ? t3lib_utility_Math::canBeInterpretedAsInteger($field) : t3lib_div::testInt($field);
                 if (!$bFieldIsInt) {
                     if (is_array($value)) {
                         $value = implode(',', $value);
                     }
                     if ($HSC) {
                         $value = htmlspecialchars($value);
                     }
                     $markerArray['###' . $prefix . $field . '###'] = $nl2br ? nl2br($value) : $value;
                 }
             }
         }
     }
     // Add global markers
     $extKey = $this->controlData->getExtKey();
     $prefixId = $this->controlData->getPrefixId();
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$extKey][$prefixId]['registrationProcess'])) {
         foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$extKey][$prefixId]['registrationProcess'] as $classRef) {
             $hookObj = t3lib_div::getUserObj($classRef);
             if (method_exists($hookObj, 'addGlobalMarkers')) {
                 $hookObj->addGlobalMarkers($markerArray, $this);
             }
         }
     }
     return $markerArray;
 }
コード例 #6
0
 /**
  * Tests if the input can be interpreted as integer.
  *
  * @access	public
  *
  * @param	integer		$theInt: Input value
  *
  * @return	boolean		TRUE if $theInt is an integer, FALSE otherwise
  */
 public static function testInt($theInt)
 {
     if (t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version) >= 6000000) {
         // TYPO3 > 6.0
         return t3lib_utility_Math::canBeInterpretedAsInteger($theInt);
     } else {
         // TYPO3 4.5 - 4.7
         return t3lib_div::testInt($theInt);
     }
 }
コード例 #7
0
	/**
	 * Forces the integer $theInt into the boundaries of $min and $max. If the $theInt is FALSE then the $defaultValue is applied.
	 *
	 * @see t3lib_utility_Math::canBeInterpretedAsInteger
	 * @param $theInt integer Input value
	 * @param $min integer Lower limit
	 * @param $max integer Higher limit
	 * @param $defaultValue integer Default value if input is FALSE.
	 * @return integer The input value forced into the boundaries of $min and $max
	 */
	public static function canBeInterpretedAsInteger($var) {

		if (class_exists('t3lib_utility_Math')) {
			$result = t3lib_utility_Math::canBeInterpretedAsInteger($var);
		} else {
			$result = t3lib_div::testInt($var);
		}
		return $result;
	}
コード例 #8
0
ファイル: class.tx_realurl.php プロジェクト: hacksch/Realurl
 /**
  * Tests if the value represents an integer number.
  *
  * @param mixed $value
  * @return bool
  */
 public static function testInt($value)
 {
     static $useOldGoodTestInt = null;
     if (is_null($useOldGoodTestInt)) {
         $useOldGoodTestInt = !class_exists('t3lib_utility_Math');
     }
     if ($useOldGoodTestInt) {
         /** @noinspection PhpDeprecationInspection PhpUndefinedMethodInspection */
         $result = t3lib_div::testInt($value);
     } else {
         /** @noinspection PhpDeprecationInspection PhpUndefinedClassInspection */
         $result = t3lib_utility_Math::canBeInterpretedAsInteger($value);
     }
     return $result;
 }
コード例 #9
0
 /**
  * Prepares an email message
  *
  * @param string  $key: template key
  * @param array $cObj: the cObject
  * @param array $langObj: the language object
  * @param array $controlData: the object of the control data
  * @param string $theTable: the table in use
  * @param string $prefixId: the extension prefix id
  * @param array  $DBrows: invoked with just one row of fe_users
  * @param string  $recipient: an email or the id of a front user
  * @param array  Array with key/values being marker-strings/substitution values.
  * @param array  $errorFieldArray: array of field with errors (former $dataObj->inError[$theField])
  * @param array  $setFixedConfig: a setfixed TS config array
  * @return string : text in case of error
  */
 public function compile($key, $conf, $cObj, $langObj, $controlData, $tcaObj, $markerObj, $dataObj, $displayObj, $setfixedObj, $theTable, $prefixId, array $DBrows, array $origRows, array $securedArray, $recipient, array $markerArray, $cmd, $cmdKey, $templateCode, $errorFieldArray, array $setFixedConfig, &$errorCode)
 {
     $missingSubpartArray = array();
     $userSubpartsFound = 0;
     $adminSubpartsFound = 0;
     $bHTMLMailEnabled = $this->isHTMLMailEnabled($conf);
     if (!isset($DBrows[0]) || !is_array($DBrows[0])) {
         $DBrows = $origRows;
     }
     $authObj = t3lib_div::getUserObj('&tx_srfeuserregister_auth');
     $bHTMLallowed = $DBrows[0]['module_sys_dmail_html'];
     // Setting CSS style markers if required
     if ($bHTMLMailEnabled) {
         $this->addCSSStyleMarkers($markerArray, $conf, $cObj);
     }
     $viewOnly = TRUE;
     $content = array('user' => array(), 'userhtml' => array(), 'admin' => array(), 'adminhtml' => array(), 'mail' => array());
     $content['mail'] = '';
     $content['user']['all'] = '';
     $content['userhtml']['all'] = '';
     $content['admin']['all'] = '';
     $content['adminhtml']['all'] = '';
     $setfixedArray = array('SETFIXED_CREATE', 'SETFIXED_CREATE_REVIEW', 'SETFIXED_INVITE', 'SETFIXED_REVIEW');
     $infomailArray = array('INFOMAIL', 'INFOMAIL_NORECORD');
     if (isset($conf['email.'][$key]) && $conf['email.'][$key] != '0' || $conf['enableEmailConfirmation'] && in_array($key, $setfixedArray) || $conf['infomail'] && in_array($key, $infomailArray) && !($key === 'INFOMAIL_NORECORD' && $conf['email.'][$key] == '0')) {
         $subpartMarker = '###' . $this->emailMarkPrefix . $key . '###';
         $content['user']['all'] = trim($cObj->getSubpart($templateCode, $subpartMarker));
         if ($content['user']['all'] == '') {
             $missingSubpartArray[] = $subpartMarker;
         } else {
             $content['user']['all'] = $displayObj->removeRequired($conf, $cObj, $controlData, $dataObj, $content['user']['all'], $errorFieldArray);
             $userSubpartsFound++;
         }
         if ($bHTMLMailEnabled && $bHTMLallowed) {
             $subpartMarker = '###' . $this->emailMarkPrefix . $key . $this->emailMarkHTMLSuffix . '###';
             $content['userhtml']['all'] = trim($cObj->getSubpart($templateCode, $subpartMarker));
             if ($content['userhtml']['all'] == '') {
                 $missingSubpartArray[] = $subpartMarker;
             } else {
                 $content['userhtml']['all'] = $displayObj->removeRequired($conf, $cObj, $controlData, $dataObj, $content['userhtml']['all'], $errorFieldArray);
                 $userSubpartsFound++;
             }
         }
     }
     if (!isset($conf['notify.'][$key]) || $conf['notify.'][$key]) {
         $subpartMarker = '###' . $this->emailMarkPrefix . $key . $this->emailMarkAdminSuffix . '###';
         $content['admin']['all'] = trim($cObj->getSubpart($templateCode, $subpartMarker));
         if ($content['admin']['all'] == '') {
             $missingSubpartArray[] = $subpartMarker;
         } else {
             $content['admin']['all'] = $displayObj->removeRequired($conf, $cObj, $controlData, $dataObj, $content['admin']['all'], $errorFieldArray);
             $adminSubpartsFound++;
         }
         if ($bHTMLMailEnabled) {
             $subpartMarker = '###' . $this->emailMarkPrefix . $key . $this->emailMarkAdminSuffix . $this->emailMarkHTMLSuffix . '###';
             $content['adminhtml']['all'] = trim($cObj->getSubpart($templateCode, $subpartMarker));
             if ($content['adminhtml']['all'] == '') {
                 $missingSubpartArray[] = $subpartMarker;
             } else {
                 $content['adminhtml']['all'] = $displayObj->removeRequired($conf, $cObj, $controlData, $dataObj, $content['adminhtml']['all'], $errorFieldArray);
                 $adminSubpartsFound++;
             }
         }
     }
     $contentIndexArray = array();
     $contentIndexArray['text'] = array();
     $contentIndexArray['html'] = array();
     if ($content['user']['all']) {
         $content['user']['rec'] = $cObj->getSubpart($content['user']['all'], '###SUB_RECORD###');
         $contentIndexArray['text'][] = 'user';
     }
     if ($content['userhtml']['all']) {
         $content['userhtml']['rec'] = $cObj->getSubpart($content['userhtml']['all'], '###SUB_RECORD###');
         $contentIndexArray['html'][] = 'userhtml';
     }
     if ($content['admin']['all']) {
         $content['admin']['rec'] = $cObj->getSubpart($content['admin']['all'], '###SUB_RECORD###');
         $contentIndexArray['text'][] = 'admin';
     }
     if ($content['adminhtml']['all']) {
         $content['adminhtml']['rec'] = $cObj->getSubpart($content['adminhtml']['all'], '###SUB_RECORD###');
         $contentIndexArray['html'][] = 'adminhtml';
     }
     $bChangesOnly = $conf['email.']['EDIT_SAVED'] == '2' && $cmd == 'edit';
     if ($bChangesOnly) {
         $keepFields = array('uid', 'pid', 'tstamp', 'name', 'username');
     } else {
         $keepFields = array();
     }
     $markerArray = $markerObj->fillInMarkerArray($markerArray, $DBrows[0], $securedArray, '', FALSE);
     $markerObj->addLabelMarkers($markerArray, $conf, $cObj, $controlData->getExtKey(), $theTable, $DBrows[0], $origRows[0], $securedArray, $keepFields, $controlData->getRequiredArray(), $dataObj->getFieldList(), $GLOBALS['TCA'][$theTable]['columns'], $bChangesOnly);
     $content['user']['all'] = $cObj->substituteMarkerArray($content['user']['all'], $markerArray);
     $content['userhtml']['all'] = $cObj->substituteMarkerArray($content['userhtml']['all'], $markerArray);
     $content['admin']['all'] = $cObj->substituteMarkerArray($content['admin']['all'], $markerArray);
     $content['adminhtml']['all'] = $cObj->substituteMarkerArray($content['adminhtml']['all'], $markerArray);
     foreach ($DBrows as $k => $row) {
         $origRow = $origRows[$k];
         if (isset($origRow) && is_array($origRow)) {
             if (isset($row) && is_array($row)) {
                 $currentRow = array_merge($origRow, $row);
             } else {
                 $currentRow = $origRow;
             }
         } else {
             $currentRow = $row;
         }
         if ($bChangesOnly) {
             $mrow = array();
             foreach ($row as $field => $v) {
                 if (in_array($field, $keepFields)) {
                     $mrow[$field] = $row[$field];
                 } else {
                     if ($row[$field] != $origRow[$field]) {
                         $mrow[$field] = $row[$field];
                     } else {
                         $mrow[$field] = '';
                         // needed to empty the ###FIELD_...### markers
                     }
                 }
             }
         } else {
             $mrow = $currentRow;
         }
         $markerArray['###SYS_AUTHCODE###'] = $authObj->authCode($row);
         $setfixedObj->computeUrl($cmdKey, $prefixId, $cObj, $controlData, $markerArray, $setFixedConfig, $currentRow, $theTable, $conf['useShortUrls'], $conf['edit.']['setfixed'], $conf['confirmType']);
         $markerObj->addStaticInfoMarkers($markerArray, $prefixId, $row, $viewOnly);
         foreach ($GLOBALS['TCA'][$theTable]['columns'] as $theField => $fieldConfig) {
             if ($fieldConfig['config']['internal_type'] == 'file' && $fieldConfig['config']['allowed'] != '' && $fieldConfig['config']['uploadfolder'] != '') {
                 $markerObj->addFileUploadMarkers($theTable, $theField, $fieldConfig, $markerArray, $cmd, $cmdKey, $row, $viewOnly, 'email', $emailType == 'html');
             }
         }
         $markerObj->addLabelMarkers($markerArray, $conf, $cObj, $controlData->getExtKey(), $theTable, $row, $origRow, $securedArray, $keepFields, $controlData->getRequiredArray(), $dataObj->getFieldList(), $GLOBALS['TCA'][$theTable]['columns'], $bChangesOnly);
         foreach ($contentIndexArray as $emailType => $indexArray) {
             $fieldMarkerArray = array();
             $fieldMarkerArray = $markerObj->fillInMarkerArray($fieldMarkerArray, $mrow, $securedArray, '', FALSE, 'FIELD_', $emailType == 'html');
             $tcaObj->addTcaMarkers($fieldMarkerArray, $conf, $cObj, $langObj, $controlData, $row, $origRow, $cmd, $cmdKey, $theTable, $prefixId, $viewOnly, 'email', $bChangesOnly, $emailType == 'html');
             $markerArray = array_merge($markerArray, $fieldMarkerArray);
             foreach ($indexArray as $index) {
                 $content[$index]['rec'] = $markerObj->removeStaticInfoSubparts($content[$index]['rec'], $markerArray, $viewOnly);
                 $content[$index]['accum'] .= $cObj->substituteMarkerArray($content[$index]['rec'], $markerArray);
                 if ($emailType == 'text') {
                     $content[$index]['accum'] = htmlSpecialChars_decode($content[$index]['accum'], ENT_QUOTES);
                 }
             }
         }
     }
     // Substitute the markers and eliminate HTML markup from plain text versions
     if ($content['user']['all']) {
         $content['user']['final'] = $cObj->substituteSubpart($content['user']['all'], '###SUB_RECORD###', $content['user']['accum']);
         $content['user']['final'] = $displayObj->removeHTMLComments($content['user']['final']);
         $content['user']['final'] = $displayObj->replaceHTMLBr($content['user']['final']);
         $content['user']['final'] = $displayObj->removeHtmlTags($content['user']['final']);
         $content['user']['final'] = $displayObj->removeSuperfluousLineFeeds($content['user']['final']);
         // Remove erroneous \n from locallang file
         $content['user']['final'] = str_replace('\\n', '', $content['user']['final']);
     }
     if ($content['userhtml']['all']) {
         $content['userhtml']['final'] = $cObj->substituteSubpart($content['userhtml']['all'], '###SUB_RECORD###', $this->pibaseObj->pi_wrapInBaseClass($content['userhtml']['accum']));
         // Remove HTML comments
         $content['userhtml']['final'] = $displayObj->removeHTMLComments($content['userhtml']['final']);
         // Remove erroneous \n from locallang file
         $content['userhtml']['final'] = str_replace('\\n', '', $content['userhtml']['final']);
     }
     if ($content['admin']['all']) {
         $content['admin']['final'] = $cObj->substituteSubpart($content['admin']['all'], '###SUB_RECORD###', $content['admin']['accum']);
         $content['admin']['final'] = $displayObj->removeHTMLComments($content['admin']['final']);
         $content['admin']['final'] = $displayObj->replaceHTMLBr($content['admin']['final']);
         $content['admin']['final'] = $displayObj->removeHtmlTags($content['admin']['final']);
         $content['admin']['final'] = $displayObj->removeSuperfluousLineFeeds($content['admin']['final']);
         // Remove erroneous \n from locallang file
         $content['admin']['final'] = str_replace('\\n', '', $content['admin']['final']);
     }
     if ($content['adminhtml']['all']) {
         $content['adminhtml']['final'] = $cObj->substituteSubpart($content['adminhtml']['all'], '###SUB_RECORD###', $this->pibaseObj->pi_wrapInBaseClass($content['adminhtml']['accum']));
         // Remove HTML comments
         $content['adminhtml']['final'] = $displayObj->removeHTMLComments($content['adminhtml']['final']);
         // Remove erroneous \n from locallang file
         $content['adminhtml']['final'] = str_replace('\\n', '', $content['adminhtml']['final']);
     }
     $bRecipientIsInt = class_exists('t3lib_utility_Math') ? t3lib_utility_Math::canBeInterpretedAsInteger($recipient) : t3lib_div::testInt($recipient);
     if ($bRecipientIsInt) {
         $fe_userRec = $GLOBALS['TSFE']->sys_page->getRawRecord('fe_users', $recipient);
         $recipient = $fe_userRec['email'];
     }
     // Check if we need to add an attachment
     if ($conf['addAttachment'] && $conf['addAttachment.']['cmd'] == $cmd && $conf['addAttachment.']['sFK'] == $controlData->getFeUserData('sFK')) {
         $file = $conf['addAttachment.']['file'] ? $GLOBALS['TSFE']->tmpl->getFileName($conf['addAttachment.']['file']) : '';
     }
     // SETFIXED_REVIEW will be sent to user only id the admin part is present
     if ($userSubpartsFound + $adminSubpartsFound >= 1 && ($adminSubpartsFound >= 1 || $key != 'SETFIXED_REVIEW')) {
         $this->send($conf, $recipient, $conf['email.']['admin'], $content['user']['final'], $content['userhtml']['final'], $content['admin']['final'], $content['adminhtml']['final'], $file);
     } else {
         if ($conf['notify.'][$key]) {
             $errorCode = array();
             $errorCode['0'] = 'internal_no_subtemplate';
             $errorCode['1'] = $missingSubpartArray['0'];
             return FALSE;
         }
     }
 }
コード例 #10
0
	/**
	 * Returns the type of an iso code: nr, 2, 3
	 *
	 * @param	string		iso code
	 * @return	string		iso code type
	 */
	function isoCodeType ($isoCode) {
		$type = '';
			// t3lib_utility_Math was introduced in TYPO3 4.6
		$isoCodeAsInteger = class_exists('t3lib_utility_Math')
			? t3lib_utility_Math::canBeInterpretedAsInteger($isoCode)
			: t3lib_div::testInt($isoCode);
		if ($isoCodeAsInteger) {
			$type = 'nr';
		} elseif (strlen($isoCode) == 2) {
			$type = '2';
		} elseif (strlen($isoCode) == 3) {
			$type = '3';
		}
		return $type;
	}
コード例 #11
0
 /**
  * Tests if the value can be interpreted as integer.
  *
  * @param mixed $value
  * @return bool
  */
 protected static function testInt($value)
 {
     if (class_exists('\\TYPO3\\CMS\\Core\\Utility\\MathUtility')) {
         $result = \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($value);
     } elseif (class_exists('t3lib_utility_Math')) {
         $result = t3lib_utility_Math::canBeInterpretedAsInteger($value);
     } else {
         $result = t3lib_div::testInt($value);
     }
     return $result;
 }
    /**
     * Creates the TCA for fields
     *
     * @param	array		&$DBfields: array of fields (PASSED BY REFERENCE)
     * @param	array		$columns: $array of fields (PASSED BY REFERENCE)
     * @param	array		$fConf: field config
     * @param	string		$WOP: ???
     * @param	string		$table: tablename
     * @param	string		$extKey: extensionkey
     * @return	void
     */
    function makeFieldTCA(&$DBfields, &$columns, $fConf, $WOP, $table, $extKey)
    {
        if (!(string) $fConf['type']) {
            return;
        }
        $id = $table . '_' . $fConf['fieldname'];
        $version = class_exists('t3lib_utility_VersionNumber') ? t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version) : t3lib_div::int_from_ver(TYPO3_version);
        $configL = array();
        $t = (string) $fConf['type'];
        switch ($t) {
            case 'input':
            case 'input+':
                $isString = true;
                $configL[] = '\'type\' => \'input\',	' . $this->WOPcomment('WOP:' . $WOP . '[type]');
                if ($version < 4006000) {
                    $configL[] = '\'size\' => \'' . t3lib_div::intInRange($fConf['conf_size'], 5, 48, 30) . '\',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_size]');
                    if (intval($fConf['conf_max'])) {
                        $configL[] = '\'max\' => \'' . t3lib_div::intInRange($fConf['conf_max'], 1, 255) . '\',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_max]');
                    }
                } else {
                    $configL[] = '\'size\' => \'' . t3lib_utility_Math::forceIntegerInRange($fConf['conf_size'], 5, 48, 30) . '\',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_size]');
                    if (intval($fConf['conf_max'])) {
                        $configL[] = '\'max\' => \'' . t3lib_utility_Math::forceIntegerInRange($fConf['conf_max'], 1, 255) . '\',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_max]');
                    }
                }
                $evalItems = array();
                if ($fConf['conf_required']) {
                    $evalItems[0][] = 'required';
                    $evalItems[1][] = $WOP . '[conf_required]';
                }
                if ($t == 'input+') {
                    $isString = (bool) (!$fConf['conf_eval']) || t3lib_div::inList('alphanum,upper,lower', $fConf['conf_eval']);
                    $isDouble2 = (bool) (!$fConf['conf_eval']) || t3lib_div::inList('double2', $fConf['conf_eval']);
                    if ($fConf['conf_varchar'] && $isString) {
                        $evalItems[0][] = 'trim';
                        $evalItems[1][] = $WOP . '[conf_varchar]';
                    }
                    if ($fConf['conf_eval'] === 'int+') {
                        $configL[] = '\'range\' => array(\'lower\' => 0, \'upper\' => 1000),	' . $this->WOPcomment('WOP:' . $WOP . '[conf_eval] = int+ results in a range setting');
                        $fConf['conf_eval'] = 'int';
                    }
                    if ($fConf['conf_eval']) {
                        $evalItems[0][] = $fConf['conf_eval'];
                        $evalItems[1][] = $WOP . '[conf_eval]';
                    }
                    if ($fConf['conf_check']) {
                        $configL[] = '\'checkbox\' => \'' . ($isString ? '' : '0') . '\',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_check]');
                    }
                    if ($fConf['conf_stripspace']) {
                        $evalItems[0][] = 'nospace';
                        $evalItems[1][] = $WOP . '[conf_stripspace]';
                    }
                    if ($fConf['conf_pass']) {
                        $evalItems[0][] = 'password';
                        $evalItems[1][] = $WOP . '[conf_pass]';
                    }
                    if ($fConf['conf_md5']) {
                        $evalItems[0][] = 'md5';
                        $evalItems[1][] = $WOP . '[conf_md5]';
                    }
                    if ($fConf['conf_unique']) {
                        if ($fConf['conf_unique'] == 'L') {
                            $evalItems[0][] = 'uniqueInPid';
                            $evalItems[1][] = $WOP . '[conf_unique] = Local (unique in this page (PID))';
                        }
                        if ($fConf['conf_unique'] == 'G') {
                            $evalItems[0][] = 'unique';
                            $evalItems[1][] = $WOP . '[conf_unique] = Global (unique in whole database)';
                        }
                    }
                    $wizards = array();
                    if ($fConf['conf_wiz_color']) {
                        $wizards[] = trim($this->sPS('
							' . $this->WOPcomment('WOP:' . $WOP . '[conf_wiz_color]') . '
							\'color\' => array(
								\'title\' => \'Color:\',
								\'type\' => \'colorbox\',
								\'dim\' => \'12x12\',
								\'tableStyle\' => \'border:solid 1px black;\',
								\'script\' => \'wizard_colorpicker.php\',
								\'JSopenParams\' => \'height=300,width=250,status=0,menubar=0,scrollbars=1\',
							),
						'));
                    }
                    if ($fConf['conf_wiz_link']) {
                        $wizards[] = trim($this->sPS('
							' . $this->WOPcomment('WOP:' . $WOP . '[conf_wiz_link]') . '
							\'link\' => array(
								\'type\' => \'popup\',
								\'title\' => \'Link\',
								\'icon\' => \'link_popup.gif\',
								\'script\' => \'browse_links.php?mode=wizard\',
								\'JSopenParams\' => \'height=300,width=500,status=0,menubar=0,scrollbars=1\'
							),
						'));
                    }
                    if (count($wizards)) {
                        $configL[] = trim($this->wrapBody('
							\'wizards\' => array(
								\'_PADDING\' => 2,
								', implode(chr(10), $wizards), '
							),
						'));
                    }
                } else {
                    if ($fConf['conf_varchar']) {
                        $evalItems[0][] = 'trim';
                        $evalItems[1][] = $WOP . '[conf_varchar]';
                    }
                }
                if (count($evalItems)) {
                    $configL[] = '\'eval\' => \'' . implode(",", $evalItems[0]) . '\',	' . $this->WOPcomment('WOP:' . implode(' / ', $evalItems[1]));
                }
                if (!$isString && !$isDouble2) {
                    $DBfields[] = $fConf['fieldname'] . ' int(11) DEFAULT \'0\' NOT NULL,';
                } elseif (!$isString && $isDouble2) {
                    $DBfields[] = $fConf["fieldname"] . " double(11,2) DEFAULT '0.00' NOT NULL,";
                } elseif (!$fConf['conf_varchar']) {
                    $DBfields[] = $fConf['fieldname'] . ' tinytext,';
                } else {
                    if ($version < 4006000) {
                        $varCharLn = intval($fConf['conf_max']) ? t3lib_div::intInRange($fConf['conf_max'], 1, 255) : 255;
                    } else {
                        $varCharLn = intval($fConf['conf_max']) ? t3lib_utility_Math::forceIntegerInRange($fConf['conf_max'], 1, 255) : 255;
                    }
                    $DBfields[] = $fConf['fieldname'] . ' ' . ($varCharLn > $this->wizard->charMaxLng ? 'var' : '') . 'char(' . $varCharLn . ') DEFAULT \'\' NOT NULL,';
                }
                break;
            case 'link':
                $DBfields[] = $fConf['fieldname'] . ' tinytext,';
                $configL[] = trim($this->sPS('
					\'type\'     => \'input\',
					\'size\'     => \'15\',
					\'max\'      => \'255\',
					\'checkbox\' => \'\',
					\'eval\'     => \'trim\',
					\'wizards\'  => array(
						\'_PADDING\' => 2,
						\'link\'     => array(
							\'type\'         => \'popup\',
							\'title\'        => \'Link\',
							\'icon\'         => \'link_popup.gif\',
							\'script\'       => \'browse_links.php?mode=wizard\',
							\'JSopenParams\' => \'height=300,width=500,status=0,menubar=0,scrollbars=1\'
						)
					)
				'));
                break;
            case 'datetime':
            case 'date':
                $DBfields[] = $fConf['fieldname'] . ' int(11) DEFAULT \'0\' NOT NULL,';
                $configL[] = trim($this->sPS('
					\'type\'     => \'input\',
					\'size\'     => \'' . ($t == "datetime" ? 12 : 8) . '\',
					\'max\'      => \'20\',
					\'eval\'     => \'' . $t . '\',
					\'checkbox\' => \'0\',
					\'default\'  => \'0\'
				'));
                break;
            case 'integer':
                $DBfields[] = $fConf['fieldname'] . ' int(11) DEFAULT \'0\' NOT NULL,';
                $configL[] = trim($this->sPS('
					\'type\'     => \'input\',
					\'size\'     => \'4\',
					\'max\'      => \'4\',
					\'eval\'     => \'int\',
					\'checkbox\' => \'0\',
					\'range\'    => array(
						\'upper\' => \'1000\',
						\'lower\' => \'10\'
					),
					\'default\' => 0
				'));
                break;
            case 'textarea':
            case 'textarea_nowrap':
                $DBfields[] = $fConf['fieldname'] . ' text,';
                $configL[] = '\'type\' => \'text\',';
                if ($t == 'textarea_nowrap') {
                    $configL[] = '\'wrap\' => \'OFF\',';
                }
                if ($version < 4006000) {
                    $configL[] = '\'cols\' => \'' . t3lib_div::intInRange($fConf['conf_cols'], 5, 48, 30) . '\',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_cols]');
                    $configL[] = '\'rows\' => \'' . t3lib_div::intInRange($fConf['conf_rows'], 1, 20, 5) . '\',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_rows]');
                } else {
                    $configL[] = '\'cols\' => \'' . t3lib_utility_Math::forceIntegerInRange($fConf['conf_cols'], 5, 48, 30) . '\',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_cols]');
                    $configL[] = '\'rows\' => \'' . t3lib_utility_Math::forceIntegerInRange($fConf['conf_rows'], 1, 20, 5) . '\',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_rows]');
                }
                if ($fConf["conf_wiz_example"]) {
                    $wizards = array();
                    $wizards[] = trim($this->sPS('
						' . $this->WOPcomment('WOP:' . $WOP . '[conf_wiz_example]') . '
						\'example\' => array(
							\'title\'         => \'Example Wizard:\',
							\'type\'          => \'script\',
							\'notNewRecords\' => 1,
							\'icon\'          => t3lib_extMgm::extRelPath(\'' . $extKey . '\').\'' . $id . '/wizard_icon.gif\',
							\'script\'        => t3lib_extMgm::extRelPath(\'' . $extKey . '\').\'' . $id . '/index.php\',
						),
					'));
                    $cN = $this->returnName($extKey, 'class', $id . 'wiz');
                    $this->writeStandardBE_xMod($extKey, array('title' => 'Example Wizard title...'), $id . '/', $cN, 0, $id . 'wiz');
                    $this->addFileToFileArray($id . '/wizard_icon.gif', t3lib_div::getUrl(t3lib_extMgm::extPath('kickstarter') . 'res/notfound.gif'));
                    $configL[] = trim($this->wrapBody('
						\'wizards\' => array(
							\'_PADDING\' => 2,
							', implode(chr(10), $wizards), '
						),
					'));
                }
                break;
            case 'textarea_rte':
                $DBfields[] = $fConf['fieldname'] . ' text,';
                $configL[] = '\'type\' => \'text\',';
                $configL[] = '\'cols\' => \'30\',';
                $configL[] = '\'rows\' => \'5\',';
                if ($fConf['conf_rte_fullscreen']) {
                    $wizards = array();
                    $wizards[] = trim($this->sPS('
						' . $this->WOPcomment('WOP:' . $WOP . '[conf_rte_fullscreen]') . '
						\'RTE\' => array(
							\'notNewRecords\' => 1,
							\'RTEonly\'       => 1,
							\'type\'          => \'script\',
							\'title\'         => \'Full screen Rich Text Editing|Formatteret redigering i hele vinduet\',
							\'icon\'          => \'wizard_rte2.gif\',
							\'script\'        => \'wizard_rte.php\',
						),
					'));
                    $configL[] = trim($this->wrapBody('
						\'wizards\' => array(
							\'_PADDING\' => 2,
							', implode(chr(10), $wizards), '
						),
					'));
                }
                $rteImageDir = '';
                if ($fConf['conf_rte_separateStorageForImages'] && t3lib_div::inList('moderate,basic,custom', $fConf['conf_rte'])) {
                    $this->wizard->EM_CONF_presets['createDirs'][] = $this->ulFolder($extKey) . 'rte/';
                    $rteImageDir = '|imgpath=' . $this->ulFolder($extKey) . 'rte/';
                }
                $transformation = 'ts_images-ts_reglinks';
                if ($fConf['conf_mode_cssOrNot'] && t3lib_div::inList('moderate,custom', $fConf['conf_rte'])) {
                    $transformation = 'ts_css';
                }
                switch ($fConf['conf_rte']) {
                    case 'tt_content':
                        $typeP = 'richtext[]:rte_transform[mode=ts]';
                        break;
                    case 'moderate':
                        $typeP = 'richtext[]:rte_transform[mode=' . $transformation . '' . $rteImageDir . ']';
                        break;
                    case 'basic':
                        $typeP = 'richtext[]:rte_transform[mode=ts_css' . $rteImageDir . ']';
                        $this->wizard->ext_localconf[] = trim($this->wrapBody("\n\t\t\t\t\t\t\t\tt3lib_extMgm::addPageTSConfig('\n\n\t\t\t\t\t\t\t\t\t# ***************************************************************************************\n\t\t\t\t\t\t\t\t\t# CONFIGURATION of RTE in table \"" . $table . "\", field \"" . $fConf["fieldname"] . "\"\n\t\t\t\t\t\t\t\t\t# ***************************************************************************************\n\n\t\t\t\t\t\t\t\t\t", trim($this->slashValueForSingleDashes(str_replace(chr(9), "  ", $this->sPS("\n\t\t\t\t\t\t\t\t\t\tRTE.config." . $table . "." . $fConf["fieldname"] . " {\n\t\t\t\t\t\t\t\t\t\t\thidePStyleItems = H1, H4, H5, H6\n\t\t\t\t\t\t\t\t\t\t\tproc.exitHTMLparser_db=1\n\t\t\t\t\t\t\t\t\t\t\tproc.exitHTMLparser_db {\n\t\t\t\t\t\t\t\t\t\t\t\tkeepNonMatchedTags=1\n\t\t\t\t\t\t\t\t\t\t\t\ttags.font.allowedAttribs= color\n\t\t\t\t\t\t\t\t\t\t\t\ttags.font.rmTagIfNoAttrib = 1\n\t\t\t\t\t\t\t\t\t\t\t\ttags.font.nesting = global\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t")))), "\n\t\t\t\t\t\t\t\t');\n\t\t\t\t\t\t", 0));
                        break;
                    case 'none':
                        $typeP = 'richtext[]';
                        break;
                    case 'custom':
                        $enabledButtons = array();
                        $traverseList = explode(',', 'cut,copy,paste,formatblock,class,fontstyle,fontsize,textcolor,bold,italic,underline,left,center,right,orderedlist,unorderedlist,outdent,indent,link,table,image,line,user,chMode');
                        $HTMLparser = array();
                        $fontAllowedAttrib = array();
                        $allowedTags_WOP = array();
                        $allowedTags = array();
                        while (list(, $lI) = each($traverseList)) {
                            $nothingDone = 0;
                            if ($fConf['conf_rte_b_' . $lI]) {
                                $enabledButtons[] = $lI;
                                switch ($lI) {
                                    case 'formatblock':
                                    case 'left':
                                    case 'center':
                                    case 'right':
                                        $allowedTags[] = 'div';
                                        $allowedTags[] = 'p';
                                        break;
                                    case 'class':
                                        $allowedTags[] = 'span';
                                        break;
                                    case 'fontstyle':
                                        $allowedTags[] = 'font';
                                        $fontAllowedAttrib[] = 'face';
                                        break;
                                    case 'fontsize':
                                        $allowedTags[] = 'font';
                                        $fontAllowedAttrib[] = 'size';
                                        break;
                                    case 'textcolor':
                                        $allowedTags[] = 'font';
                                        $fontAllowedAttrib[] = 'color';
                                        break;
                                    case 'bold':
                                        $allowedTags[] = 'b';
                                        $allowedTags[] = 'strong';
                                        break;
                                    case 'italic':
                                        $allowedTags[] = 'i';
                                        $allowedTags[] = 'em';
                                        break;
                                    case 'underline':
                                        $allowedTags[] = 'u';
                                        break;
                                    case 'orderedlist':
                                        $allowedTags[] = 'ol';
                                        $allowedTags[] = 'li';
                                        break;
                                    case 'unorderedlist':
                                        $allowedTags[] = 'ul';
                                        $allowedTags[] = 'li';
                                        break;
                                    case 'outdent':
                                    case 'indent':
                                        $allowedTags[] = 'blockquote';
                                        break;
                                    case 'link':
                                        $allowedTags[] = 'a';
                                        break;
                                    case 'table':
                                        $allowedTags[] = 'table';
                                        $allowedTags[] = 'tr';
                                        $allowedTags[] = 'td';
                                        break;
                                    case 'image':
                                        $allowedTags[] = 'img';
                                        break;
                                    case 'line':
                                        $allowedTags[] = 'hr';
                                        break;
                                    default:
                                        $nothingDone = 1;
                                        break;
                                }
                                if (!$nothingDone) {
                                    $allowedTags_WOP[] = $WOP . '[conf_rte_b_' . $lI . ']';
                                }
                            }
                        }
                        if (count($fontAllowedAttrib)) {
                            $HTMLparser[] = 'tags.font.allowedAttribs = ' . implode(',', $fontAllowedAttrib);
                            $HTMLparser[] = 'tags.font.rmTagIfNoAttrib = 1';
                            $HTMLparser[] = 'tags.font.nesting = global';
                        }
                        if (count($enabledButtons)) {
                            $typeP = 'richtext[' . implode('|', $enabledButtons) . ']:rte_transform[mode=' . $transformation . '' . $rteImageDir . ']';
                        }
                        $rte_colors = array();
                        $setupUpColors = array();
                        for ($a = 1; $a <= 3; $a++) {
                            if ($fConf['conf_rte_color' . $a]) {
                                $rte_colors[$id . '_color' . $a] = trim($this->sPS('
									' . $this->WOPcomment('WOP:' . $WOP . '[conf_rte_color' . $a . ']') . '
									' . $id . '_color' . $a . ' {
										name = Color ' . $a . '
										value = ' . $fConf['conf_rte_color' . $a] . '
									}
								'));
                                $setupUpColors[] = trim($fConf['conf_rte_color' . $a]);
                            }
                        }
                        $rte_classes = array();
                        for ($a = 1; $a <= 6; $a++) {
                            if ($fConf['conf_rte_class' . $a]) {
                                $rte_classes[$id . '_class' . $a] = trim($this->sPS('
									' . $this->WOPcomment('WOP:' . $WOP . '[conf_rte_class' . $a . ']') . '
									' . $id . '_class' . $a . ' {
										name = ' . $fConf['conf_rte_class' . $a] . '
										value = ' . $fConf['conf_rte_class' . $a . '_style'] . '
									}
								'));
                            }
                        }
                        $PageTSconfig = array();
                        if ($fConf['conf_rte_removecolorpicker']) {
                            $PageTSconfig[] = '	' . $this->WOPcomment('WOP:' . $WOP . '[conf_rte_removecolorpicker]');
                            $PageTSconfig[] = 'disableColorPicker = 1';
                        }
                        if (count($rte_classes)) {
                            $PageTSconfig[] = '	' . $this->WOPcomment('WOP:' . $WOP . '[conf_rte_class*]');
                            $PageTSconfig[] = 'classesParagraph = ' . implode(', ', array_keys($rte_classes));
                            $PageTSconfig[] = 'classesCharacter = ' . implode(', ', array_keys($rte_classes));
                            if (in_array('p', $allowedTags) || in_array('div', $allowedTags)) {
                                $HTMLparser[] = '	' . $this->WOPcomment('WOP:' . $WOP . '[conf_rte_class*]');
                                if (in_array('p', $allowedTags)) {
                                    $HTMLparser[] = 'p.fixAttrib.class.list = ,' . implode(',', array_keys($rte_classes));
                                }
                                if (in_array('div', $allowedTags)) {
                                    $HTMLparser[] = 'div.fixAttrib.class.list = ,' . implode(',', array_keys($rte_classes));
                                }
                            }
                        }
                        if (count($rte_colors)) {
                            $PageTSconfig[] = '	' . $this->WOPcomment('WOP:' . $WOP . '[conf_rte_color*]');
                            $PageTSconfig[] = 'colors = ' . implode(', ', array_keys($rte_colors));
                            if (in_array('color', $fontAllowedAttrib) && $fConf['conf_rte_removecolorpicker']) {
                                $HTMLparser[] = '	' . $this->WOPcomment('WOP:' . $WOP . '[conf_rte_removecolorpicker]');
                                $HTMLparser[] = 'tags.font.fixAttrib.color.list = ,' . implode(',', $setupUpColors);
                                $HTMLparser[] = 'tags.font.fixAttrib.color.removeIfFalse = 1';
                            }
                        }
                        if (!strcmp($fConf['conf_rte_removePdefaults'], 1)) {
                            $PageTSconfig[] = '	' . $this->WOPcomment('WOP:' . $WOP . '[conf_rte_removePdefaults]');
                            $PageTSconfig[] = 'hidePStyleItems = H1, H2, H3, H4, H5, H6, PRE';
                        } elseif ($fConf['conf_rte_removePdefaults'] == 'H2H3') {
                            $PageTSconfig[] = '	' . $this->WOPcomment('WOP:' . $WOP . '[conf_rte_removePdefaults]');
                            $PageTSconfig[] = 'hidePStyleItems = H1, H4, H5, H6';
                        } else {
                            $allowedTags[] = 'h1';
                            $allowedTags[] = 'h2';
                            $allowedTags[] = 'h3';
                            $allowedTags[] = 'h4';
                            $allowedTags[] = 'h5';
                            $allowedTags[] = 'h6';
                            $allowedTags[] = 'pre';
                        }
                        $allowedTags = array_unique($allowedTags);
                        if (count($allowedTags)) {
                            $HTMLparser[] = '	' . $this->WOPcomment('WOP:' . implode(' / ', $allowedTags_WOP));
                            $HTMLparser[] = 'allowTags = ' . implode(', ', $allowedTags);
                        }
                        if ($fConf['conf_rte_div_to_p']) {
                            $HTMLparser[] = '	' . $this->WOPcomment('WOP:' . $WOP . '[conf_rte_div_to_p]');
                            $HTMLparser[] = 'tags.div.remap = P';
                        }
                        if (count($HTMLparser)) {
                            $PageTSconfig[] = trim($this->wrapBody('
								proc.exitHTMLparser_db=1
								proc.exitHTMLparser_db {
									', implode(chr(10), $HTMLparser), '
								}
							'));
                        }
                        $finalPageTSconfig = array();
                        if (count($rte_colors)) {
                            $finalPageTSconfig[] = trim($this->wrapBody('
								RTE.colors {
								', implode(chr(10), $rte_colors), '
								}
							'));
                        }
                        if (count($rte_classes)) {
                            $finalPageTSconfig[] = trim($this->wrapBody('
								RTE.classes {
								', implode(chr(10), $rte_classes), '
								}
							'));
                        }
                        if (count($PageTSconfig)) {
                            $finalPageTSconfig[] = trim($this->wrapBody('
								RTE.config.' . $table . '.' . $fConf['fieldname'] . ' {
								', implode(chr(10), $PageTSconfig), '
								}
							'));
                        }
                        if (count($finalPageTSconfig)) {
                            $this->wizard->ext_localconf[] = trim($this->wrapBody("\n\t\t\t\t\t\t\t\tt3lib_extMgm::addPageTSConfig('\n\n\t\t\t\t\t\t\t\t\t# ***************************************************************************************\n\t\t\t\t\t\t\t\t\t# CONFIGURATION of RTE in table \"" . $table . "\", field \"" . $fConf["fieldname"] . "\"\n\t\t\t\t\t\t\t\t\t# ***************************************************************************************\n\n\t\t\t\t\t\t\t\t", trim($this->slashValueForSingleDashes(str_replace(chr(9), "  ", implode(chr(10) . chr(10), $finalPageTSconfig)))), "\n\t\t\t\t\t\t\t\t');\n\t\t\t\t\t\t\t", 0));
                        }
                        break;
                }
                $this->wizard->_typeP[$fConf['fieldname']] = $typeP;
                break;
            case 'check':
            case 'check_4':
            case 'check_10':
                $configL[] = '\'type\' => \'check\',';
                if ($t == 'check') {
                    $DBfields[] = $fConf['fieldname'] . ' tinyint(3) DEFAULT \'0\' NOT NULL,';
                    if ($fConf['conf_check_default']) {
                        $configL[] = '\'default\' => 1,	' . $this->WOPcomment('WOP:' . $WOP . '[conf_check_default]');
                    }
                } else {
                    $DBfields[] = $fConf['fieldname'] . ' int(11) DEFAULT \'0\' NOT NULL,';
                }
                if ($t == 'check_4' || $t == 'check_10') {
                    $configL[] = '\'cols\' => 4,';
                    $cItems = array();
                    $aMax = intval($fConf["conf_numberBoxes"]);
                    for ($a = 0; $a < $aMax; $a++) {
                        $cItems[] = 'array(\'' . addslashes($this->getSplitLabels_reference($fConf, "conf_boxLabel_" . $a, $table . "." . $fConf["fieldname"] . ".I." . $a)) . '\', \'\'),';
                    }
                    $configL[] = trim($this->wrapBody('
						\'items\' => array(
							', implode(chr(10), $cItems), '
						),
					'));
                }
                break;
            case 'radio':
            case 'select':
                $configL[] = '\'type\' => \'' . ($t == 'select' ? 'select' : 'radio') . '\',';
                $notIntVal = 0;
                $len = array();
                $numberOfItems = $version < 4006000 ? t3lib_div::intInRange($fConf['conf_select_items'], 1, 20) : t3lib_utility_Math::forceIntegerInRange($fConf['conf_select_items'], 1, 20);
                for ($a = 0; $a < $numberOfItems; $a++) {
                    $val = $fConf["conf_select_itemvalue_" . $a];
                    if ($version < 4006000) {
                        $notIntVal += t3lib_div::testInt($val) ? 0 : 1;
                    } else {
                        $notIntVal += t3lib_utility_Math::canBeInterpretedAsInteger($val) ? 0 : 1;
                    }
                    $len[] = strlen($val);
                    if ($fConf["conf_select_icons"] && $t == "select") {
                        $icon = ', t3lib_extMgm::extRelPath(\'' . $extKey . '\').\'' . 'selicon_' . $id . '_' . $a . '.gif' . '\'';
                        // Add wizard icon
                        $this->addFileToFileArray("selicon_" . $id . "_" . $a . ".gif", t3lib_div::getUrl(t3lib_extMgm::extPath("kickstarter") . "res/wiz.gif"));
                    } else {
                        $icon = "";
                    }
                    //					$cItems[]='Array("'.str_replace("\\'","'",addslashes($this->getSplitLabels($fConf,"conf_select_item_".$a))).'", "'.addslashes($val).'"'.$icon.'),';
                    $cItems[] = 'array(\'' . addslashes($this->getSplitLabels_reference($fConf, "conf_select_item_" . $a, $table . "." . $fConf["fieldname"] . ".I." . $a)) . '\', \'' . addslashes($val) . '\'' . $icon . '),';
                }
                $configL[] = trim($this->wrapBody('
					' . $this->WOPcomment('WOP:' . $WOP . '[conf_select_items]') . '
					\'items\' => array(
						', implode(chr(10), $cItems), '
					),
				'));
                if ($fConf['conf_select_pro'] && $t == 'select') {
                    $cN = $this->returnName($extKey, 'class', $id);
                    $configL[] = '\'itemsProcFunc\' => \'' . $cN . '->main\',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_select_pro]');
                    $classContent = $this->sPS('class ' . $cN . ' {

	/**
	 * [Describe function...]
	 *
	 * @param	[type]		$$params: ...
	 * @param	[type]		$pObj: ...
	 * @return	[type]		...
	 */
							function main(&$params,&$pObj)	{
/*
								debug(\'Hello World!\',1);
								debug(\'$params:\',1);
								debug($params);
								debug(\'$pObj:\',1);
								debug($pObj);
*/
									// Adding an item!
								$params[\'items\'][] = array($pObj->sL(\'Added label by PHP function|Tilfjet Dansk tekst med PHP funktion\'), 999);

								// No return - the $params and $pObj variables are passed by reference, so just change content in then and it is passed back automatically...
							}
						}
					', 0);
                    $this->addFileToFileArray('class.' . $cN . '.php', $this->PHPclassFile($extKey, 'class.' . $cN . '.php', $classContent, 'Class/Function which manipulates the item-array for table/field ' . $id . '.'));
                    $this->wizard->ext_tables[] = $this->sPS('
						' . $this->WOPcomment('WOP:' . $WOP . '[conf_select_pro]:') . '
						if (TYPO3_MODE === \'BE\')	{
							include_once(t3lib_extMgm::extPath(\'' . $extKey . '\').\'' . 'class.' . $cN . '.php\');
						}
					');
                }
                $numberOfRelations = $version < 4006000 ? t3lib_div::intInRange($fConf['conf_relations'], 1, 100) : t3lib_utility_Math::forceIntegerInRange($fConf['conf_relations'], 1, 100);
                if ($t == 'select') {
                    if ($version < 4006000) {
                        $configL[] = '\'size\' => ' . t3lib_div::intInRange($fConf['conf_relations_selsize'], 1, 100) . ',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_relations_selsize]');
                    } else {
                        $configL[] = '\'size\' => ' . t3lib_utility_Math::forceIntegerInRange($fConf['conf_relations_selsize'], 1, 100) . ',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_relations_selsize]');
                    }
                    $configL[] = '\'maxitems\' => ' . $numberOfRelations . ',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_relations]');
                }
                if ($numberOfRelations > 1 && $t == "select") {
                    if ($numberOfRelations * 4 < 256) {
                        $DBfields[] = $fConf["fieldname"] . " varchar(" . $numberOfRelations * 4 . ") DEFAULT '' NOT NULL,";
                    } else {
                        $DBfields[] = $fConf["fieldname"] . " text,";
                    }
                } elseif ($notIntVal) {
                    $varCharLn = $version < 4006000 ? t3lib_div::intInRange(max($len), 1) : t3lib_utility_Math::forceIntegerInRange(max($len), 1);
                    $DBfields[] = $fConf["fieldname"] . " " . ($varCharLn > $this->wizard->charMaxLng ? 'var' : '') . "char(" . $varCharLn . ") DEFAULT '' NOT NULL,";
                } else {
                    $DBfields[] = $fConf["fieldname"] . ' int(11) DEFAULT \'0\' NOT NULL,';
                }
                break;
            case 'rel':
                if ($fConf["conf_rel_type"] == "group") {
                    $configL[] = '\'type\' => \'group\',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_rel_type]');
                    $configL[] = '\'internal_type\' => \'db\',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_rel_type]');
                } else {
                    $configL[] = '\'type\' => \'select\',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_rel_type]');
                }
                if ($fConf["conf_rel_type"] != "group" && $fConf["conf_relations"] == 1 && $fConf["conf_rel_dummyitem"]) {
                    $configL[] = trim($this->wrapBody('
						' . $this->WOPcomment('WOP:' . $WOP . '[conf_rel_dummyitem]') . '
						\'items\' => array(
							', 'array(\'\', 0),', '
						),
					'));
                }
                if (t3lib_div::inList("tt_content,fe_users,fe_groups", $fConf["conf_rel_table"])) {
                    $this->wizard->EM_CONF_presets["dependencies"][] = "cms";
                }
                if ($fConf["conf_rel_table"] == "_CUSTOM") {
                    $fConf["conf_rel_table"] = $fConf["conf_custom_table_name"] ? $fConf["conf_custom_table_name"] : "NO_TABLE_NAME_AVAILABLE";
                }
                if ($fConf["conf_rel_type"] == "group") {
                    $configL[] = '\'allowed\' => \'' . ($fConf["conf_rel_table"] != "_ALL" ? $fConf["conf_rel_table"] : "*") . '\',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_rel_table]');
                    if ($fConf["conf_rel_table"] == "_ALL") {
                        $configL[] = '\'prepend_tname\' => 1,	' . $this->WOPcomment('WOP:' . $WOP . '[conf_rel_table]=_ALL');
                    }
                } else {
                    switch ($fConf["conf_rel_type"]) {
                        case "select_cur":
                            $where = "AND " . $fConf["conf_rel_table"] . ".pid=###CURRENT_PID### ";
                            break;
                        case "select_root":
                            $where = "AND " . $fConf["conf_rel_table"] . ".pid=###SITEROOT### ";
                            break;
                        case "select_storage":
                            $where = "AND " . $fConf["conf_rel_table"] . ".pid=###STORAGE_PID### ";
                            break;
                        default:
                            $where = "";
                            break;
                    }
                    $configL[] = '\'foreign_table\' => \'' . $fConf["conf_rel_table"] . '\',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_rel_table]');
                    $configL[] = '\'foreign_table_where\' => \'' . $where . 'ORDER BY ' . $fConf["conf_rel_table"] . '.uid\',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_rel_type]');
                }
                if ($version < 4006000) {
                    $configL[] = '\'size\' => ' . t3lib_div::intInRange($fConf['conf_relations_selsize'], 1, 100) . ',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_relations_selsize]');
                    $configL[] = '\'minitems\' => 0,';
                    $configL[] = '\'maxitems\' => ' . t3lib_div::intInRange($fConf['conf_relations'], 1, 100) . ',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_relations]');
                    $confRelations = t3lib_div::intInRange($fConf['conf_relations'], 1, 100);
                } else {
                    $configL[] = '\'size\' => ' . t3lib_utility_Math::forceIntegerInRange($fConf['conf_relations_selsize'], 1, 100) . ',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_relations_selsize]');
                    $configL[] = '\'minitems\' => 0,';
                    $configL[] = '\'maxitems\' => ' . t3lib_utility_Math::forceIntegerInRange($fConf['conf_relations'], 1, 100) . ',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_relations]');
                    $confRelations = t3lib_utility_Math::forceIntegerInRange($fConf['conf_relations'], 1, 100);
                }
                if ($fConf["conf_relations_mm"]) {
                    $mmTableName = $id . "_mm";
                    $configL[] = '"MM" => "' . $mmTableName . '",	' . $this->WOPcomment('WOP:' . $WOP . '[conf_relations_mm]');
                    $DBfields[] = $fConf["fieldname"] . ' int(11) DEFAULT \'0\' NOT NULL,';
                    $createTable = $this->sPS("\n\t\t\t\t\t\t#\n\t\t\t\t\t\t# Table structure for table '" . $mmTableName . "'\n\t\t\t\t\t\t# " . $this->WOPcomment('WOP:' . $WOP . '[conf_relations_mm]') . "\n\t\t\t\t\t\t#\n\t\t\t\t\t\tCREATE TABLE " . $mmTableName . " (\n\t\t\t\t\t\t  uid_local int(11) DEFAULT '0' NOT NULL,\n\t\t\t\t\t\t  uid_foreign int(11) DEFAULT '0' NOT NULL,\n\t\t\t\t\t\t  tablenames varchar(30) DEFAULT '' NOT NULL,\n\t\t\t\t\t\t  sorting int(11) DEFAULT '0' NOT NULL,\n\t\t\t\t\t\t  KEY uid_local (uid_local),\n\t\t\t\t\t\t  KEY uid_foreign (uid_foreign)\n\t\t\t\t\t\t);\n\t\t\t\t\t");
                    $this->wizard->ext_tables_sql[] = chr(10) . $createTable . chr(10);
                } elseif ($confRelations > 1 || $fConf["conf_rel_type"] == "group") {
                    $DBfields[] = $fConf["fieldname"] . " text,";
                } else {
                    $DBfields[] = $fConf["fieldname"] . ' int(11) DEFAULT \'0\' NOT NULL,';
                }
                if ($fConf["conf_rel_type"] != "group") {
                    $wTable = $fConf["conf_rel_table"];
                    $wizards = array();
                    if ($fConf["conf_wiz_addrec"]) {
                        $wizards[] = trim($this->sPS('
							' . $this->WOPcomment('WOP:' . $WOP . '[conf_wiz_addrec]') . '
							\'add\' => array(
								\'type\'   => \'script\',
								\'title\'  => \'Create new record\',
								\'icon\'   => \'add.gif\',
								\'params\' => array(
									\'table\'    => \'' . $wTable . '\',
									\'pid\'      => \'###CURRENT_PID###\',
									\'setValue\' => \'prepend\'
								),
								\'script\' => \'wizard_add.php\',
							),
						'));
                    }
                    if ($fConf["conf_wiz_listrec"]) {
                        $wizards[] = trim($this->sPS('
							' . $this->WOPcomment('WOP:' . $WOP . '[conf_wiz_listrec]') . '
							\'list\' => array(
								\'type\'   => \'script\',
								\'title\'  => \'List\',
								\'icon\'   => \'list.gif\',
								\'params\' => array(
									\'table\' => \'' . $wTable . '\',
									\'pid\'   => \'###CURRENT_PID###\',
								),
								\'script\' => \'wizard_list.php\',
							),
						'));
                    }
                    if ($fConf["conf_wiz_editrec"]) {
                        $wizards[] = trim($this->sPS('
							' . $this->WOPcomment('WOP:' . $WOP . '[conf_wiz_editrec]') . '
							\'edit\' => array(
								\'type\'                     => \'popup\',
								\'title\'                    => \'Edit\',
								\'script\'                   => \'wizard_edit.php\',
								\'popup_onlyOpenIfSelected\' => 1,
								\'icon\'                     => \'edit2.gif\',
								\'JSopenParams\'             => \'height=350,width=580,status=0,menubar=0,scrollbars=1\',
							),
						'));
                    }
                    if (count($wizards)) {
                        $configL[] = trim($this->wrapBody('
							\'wizards\' => array(
								\'_PADDING\'  => 2,
								\'_VERTICAL\' => 1,
								', implode(chr(10), $wizards), '
							),
						'));
                    }
                }
                break;
            case "files":
                $configL[] = '\'type\' => \'group\',';
                $configL[] = '\'internal_type\' => \'file\',';
                switch ($fConf["conf_files_type"]) {
                    case "images":
                        $configL[] = '\'allowed\' => $GLOBALS[\'TYPO3_CONF_VARS\'][\'GFX\'][\'imagefile_ext\'],	' . $this->WOPcomment('WOP:' . $WOP . '[conf_files_type]');
                        break;
                    case "webimages":
                        $configL[] = '\'allowed\' => \'gif,png,jpeg,jpg\',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_files_type]');
                        // TODO use web images definition from install tool
                        break;
                    case "all":
                        $configL[] = '\'allowed\' => \'\',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_files_type]');
                        $configL[] = '\'disallowed\' => \'php,php3\',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_files_type]');
                        break;
                }
                $configL[] = '\'max_size\' => $GLOBALS[\'TYPO3_CONF_VARS\'][\'BE\'][\'maxFileSize\'],	' . $this->WOPcomment('WOP:' . $WOP . '[conf_max_filesize]');
                $this->wizard->EM_CONF_presets["uploadfolder"] = 1;
                $ulFolder = 'uploads/tx_' . str_replace("_", "", $extKey);
                $configL[] = '\'uploadfolder\' => \'' . $ulFolder . '\',';
                if ($fConf['conf_files_thumbs']) {
                    $configL[] = '\'show_thumbs\' => 1,	' . $this->WOPcomment('WOP:' . $WOP . '[conf_files_thumbs]');
                }
                if ($version < 4006000) {
                    $configL[] = '\'size\' => ' . t3lib_div::intInRange($fConf['conf_files_selsize'], 1, 100) . ',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_files_selsize]');
                    $configL[] = '\'minitems\' => 0,';
                    $configL[] = '\'maxitems\' => ' . t3lib_div::intInRange($fConf['conf_files'], 1, 100) . ',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_files]');
                } else {
                    $configL[] = '\'size\' => ' . t3lib_utility_Math::forceIntegerInRange($fConf['conf_files_selsize'], 1, 100) . ',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_files_selsize]');
                    $configL[] = '\'minitems\' => 0,';
                    $configL[] = '\'maxitems\' => ' . t3lib_utility_Math::forceIntegerInRange($fConf['conf_files'], 1, 100) . ',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_files]');
                }
                $DBfields[] = $fConf["fieldname"] . " text,";
                break;
            case 'flex':
                $DBfields[] = $fConf['fieldname'] . ' mediumtext,';
                $configL[] = trim($this->sPS('
					\'type\' => \'flex\',
		\'ds\' => array(
			\'default\' => \'FILE:EXT:' . $extKey . '/flexform_' . $table . '_' . $fConf['fieldname'] . '.xml\',
		),
				'));
                $this->addFileToFileArray('flexform_' . $table . '_' . $fConf['fieldname'] . '.xml', $this->createFlexForm());
                break;
            case "none":
                $DBfields[] = $fConf["fieldname"] . " tinytext,";
                $configL[] = trim($this->sPS('
					\'type\' => \'none\',
				'));
                break;
            case "passthrough":
                $DBfields[] = $fConf["fieldname"] . " tinytext,";
                $configL[] = trim($this->sPS('
					\'type\' => \'passthrough\',
				'));
                break;
            case 'inline':
                #$DBfields=$this->getInlineDBfields($fConf);
                if ($DBfields) {
                    $DBfields = array_merge($DBfields, $this->getInlineDBfields($table, $fConf));
                }
                $configL = $this->getInlineTCAconfig($table, $fConf);
                break;
            default:
                debug("Unknown type: " . (string) $fConf["type"]);
                break;
        }
        if ($t == "passthrough") {
            $columns[$fConf["fieldname"]] = trim($this->wrapBody('
				\'' . $fConf["fieldname"] . '\' => array(		' . $this->WOPcomment('WOP:' . $WOP . '[fieldname]') . '
					\'config\' => array(
						', implode(chr(10), $configL), '
					)
				),
			', 2));
        } else {
            $columns[$fConf["fieldname"]] = trim($this->wrapBody('
				\'' . $fConf["fieldname"] . '\' => array(		' . $this->WOPcomment('WOP:' . $WOP . '[fieldname]') . '
					\'exclude\' => ' . ($fConf["excludeField"] ? 1 : 0) . ',		' . $this->WOPcomment('WOP:' . $WOP . '[excludeField]') . '
					\'label\' => \'' . addslashes($this->getSplitLabels_reference($fConf, "title", $table . "." . $fConf["fieldname"])) . '\',		' . $this->WOPcomment('WOP:' . $WOP . '[title]') . '
					\'config\' => array(
						', implode(chr(10), $configL), '
					)
				),
			', 2));
        }
    }
コード例 #13
0
	/**
	 * Tests if the value represents an integer number.
	 *
	 * @param mixed $value
	 * @return bool
	 */
	static public function testInt($value) {
		static $useOldGoodTestInt = null;

		if (is_null($useOldGoodTestInt)) {
			$useOldGoodTestInt = !class_exists('t3lib_utility_Math');
		}
		if ($useOldGoodTestInt) {
			$result = t3lib_div::testInt($value);
		}
		else {
			$result = t3lib_utility_Math::canBeInterpretedAsInteger($value);
		}
		return $result;
	}
コード例 #14
0
 /**
  * Implements the "typolink" property of stdWrap (and others)
  * Basically the input string, $linktext, is (typically) wrapped in a <a>-tag linking to some page, email address, file or URL based on a parameter defined by the configuration array $conf.
  * This function is best used from internal functions as is. There are some API functions defined after this function which is more suited for general usage in external applications.
  * Generally the concept "typolink" should be used in your own applications as an API for making links to pages with parameters and more. The reason for this is that you will then automatically make links compatible with all the centralized functions for URL simulation and manipulation of parameters into hashes and more.
  * For many more details on the parameters and how they are intepreted, please see the link to TSref below.
  *
  * @param string $linktxt The string (text) to link
  * @param array $conf TypoScript configuration (see link below)
  * @param tslib_cObj $cObj
  * @return	string		A link-wrapped string.
  * @see stdWrap(), tslib_pibase::pi_linkTP()
  * @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=321&cHash=59bd727a5e
  */
 function typoLink($linktxt, $conf, $cObj = NULL)
 {
     $finalTagParts = array();
     // If called from media link handler, use the reference of the passed cObj
     if (!is_object($this->cObj)) {
         $this->cObj = $cObj;
     }
     $link_param = trim($this->cObj->stdWrap($conf['parameter'], $conf['parameter.']));
     $initP = '?id=' . $GLOBALS['TSFE']->id . '&type=' . $GLOBALS['TSFE']->type;
     $this->cObj->lastTypoLinkUrl = '';
     $this->cObj->lastTypoLinkTarget = '';
     if ($link_param) {
         $link_paramA = t3lib_div::unQuoteFilenames($link_param, TRUE);
         $link_param = trim($link_paramA[0]);
         // Link parameter value
         $linkClass = trim($link_paramA[2]);
         // Link class
         if ($linkClass === '-') {
             $linkClass = '';
         }
         // The '-' character means 'no class'. Necessary in order to specify a title as fourth parameter without setting the target or class!
         $forceTarget = trim($link_paramA[1]);
         // Target value
         $forceTitle = trim($link_paramA[3]);
         // Title value
         if ($forceTarget === '-') {
             $forceTarget = '';
         }
         // The '-' character means 'no target'. Necessary in order to specify a class as third parameter without setting the target!
         // Check, if the target is coded as a JS open window link:
         $JSwindowParts = array();
         $JSwindowParams = '';
         $onClick = '';
         if ($forceTarget && preg_match('/^([0-9]+)x([0-9]+)(:(.*)|.*)$/', $forceTarget, $JSwindowParts)) {
             // Take all pre-configured and inserted parameters and compile parameter list, including width+height:
             $JSwindow_tempParamsArr = t3lib_div::trimExplode(',', strtolower($conf['JSwindow_params'] . ',' . $JSwindowParts[4]), TRUE);
             $JSwindow_paramsArr = array();
             foreach ($JSwindow_tempParamsArr as $JSv) {
                 list($JSp, $JSv) = explode('=', $JSv);
                 $JSwindow_paramsArr[$JSp] = $JSp . '=' . $JSv;
             }
             // Add width/height:
             $JSwindow_paramsArr['width'] = 'width=' . $JSwindowParts[1];
             $JSwindow_paramsArr['height'] = 'height=' . $JSwindowParts[2];
             // Imploding into string:
             $JSwindowParams = implode(',', $JSwindow_paramsArr);
             $forceTarget = '';
             // Resetting the target since we will use onClick.
         }
         // Internal target:
         $target = isset($conf['target']) ? $conf['target'] : $GLOBALS['TSFE']->intTarget;
         if ($conf['target.']) {
             $target = $this->cObj->stdWrap($target, $conf['target.']);
         }
         // Checking if the id-parameter is an alias.
         if (version_compare(TYPO3_version, '4.6.0', '>=')) {
             $isInteger = t3lib_utility_Math::canBeInterpretedAsInteger($link_param);
         } else {
             $isInteger = t3lib_div::testInt($link_param);
         }
         if (!$isInteger) {
             $GLOBALS['TT']->setTSlogMessage("tx_dam_tsfemediatag->typolink(): File id '" . $link_param . "' is not an integer, so '" . $linktxt . "' was not linked.", 1);
             return $linktxt;
         }
         if (!is_object($media = tx_dam::media_getByUid($link_param))) {
             $GLOBALS['TT']->setTSlogMessage("tx_dam_tsfemediatag->typolink(): File id '" . $link_param . "' was not found, so '" . $linktxt . "' was not linked.", 1);
             return $linktxt;
         }
         if (!$media->isAvailable) {
             $GLOBALS['TT']->setTSlogMessage("tx_dam_tsfemediatag->typolink(): File '" . $media->getPathForSite() . "' (" . $link_param . ") did not exist, so '" . $linktxt . "' was not linked.", 1);
             return $linktxt;
         }
         $meta = $media->getMetaArray();
         if (is_array($this->conf['procFields.'])) {
             foreach ($this->conf['procFields.'] as $field => $fieldConf) {
                 if (substr($field, -1, 1) === '.') {
                     $fN = substr($field, 0, -1);
                 } else {
                     $fN = $field;
                     $fieldConf = array();
                 }
                 $meta[$fN] = $media->getContent($fN, $fieldConf);
             }
         }
         $this->addMetaToData($meta);
         // Title tag
         $title = $conf['title'];
         if ($conf['title.']) {
             $title = $this->cObj->stdWrap($title, $conf['title.']);
         }
         // Setting title if blank value to link:
         if ($linktxt === '') {
             $linktxt = $media->getContent('title');
         }
         if ($GLOBALS['TSFE']->config['config']['jumpurl_enable']) {
             $this->cObj->lastTypoLinkUrl = $GLOBALS['TSFE']->absRefPrefix . $GLOBALS['TSFE']->config['mainScript'] . $initP . '&jumpurl=' . rawurlencode($media->getPathForSite()) . $GLOBALS['TSFE']->getMethodUrlIdToken;
         } else {
             $this->cObj->lastTypoLinkUrl = $media->getURL();
         }
         if ($forceTarget) {
             $target = $forceTarget;
         }
         $this->cObj->lastTypoLinkTarget = $target;
         $finalTagParts['url'] = $this->cObj->lastTypoLinkUrl;
         $finalTagParts['targetParams'] = $target ? ' target="' . $target . '"' : '';
         $finalTagParts['aTagParams'] = $this->cObj->getATagParams($conf);
         $finalTagParts['TYPE'] = 'file';
         if ($forceTitle) {
             $title = $forceTitle;
         }
         if ($JSwindowParams) {
             // Create TARGET-attribute only if the right doctype is used
             if (!t3lib_div::inList('xhtml_strict,xhtml_11,xhtml_2', $GLOBALS['TSFE']->xhtmlDoctype)) {
                 $target = ' target="FEopenLink"';
             } else {
                 $target = '';
             }
             $onClick = "vHWin=window.open('" . $GLOBALS['TSFE']->baseUrlWrap($finalTagParts['url']) . "','FEopenLink','" . $JSwindowParams . "');vHWin.focus();return false;";
             $res = '<a href="' . htmlspecialchars($finalTagParts['url']) . '"' . $target . ' onclick="' . htmlspecialchars($onClick) . '"' . ($title ? ' title="' . $title . '"' : '') . ($linkClass ? ' class="' . $linkClass . '"' : '') . $finalTagParts['aTagParams'] . '>';
         } else {
             $res = '<a href="' . htmlspecialchars($finalTagParts['url']) . '"' . ($title ? ' title="' . $title . '"' : '') . $finalTagParts['targetParams'] . ($linkClass ? ' class="' . $linkClass . '"' : '') . $finalTagParts['aTagParams'] . '>';
         }
         // Call userFunc
         if ($conf['userFunc']) {
             $finalTagParts['TAG'] = $res;
             $res = $this->cObj->callUserFunction($conf['userFunc'], $conf['userFunc.'], $finalTagParts);
         }
         // If flag "returnLastTypoLinkUrl" set, then just return the latest URL made:
         if ($conf['returnLast']) {
             switch ($conf['returnLast']) {
                 case 'url':
                     return $this->cObj->lastTypoLinkUrl;
                     break;
                 case 'target':
                     return $this->cObj->lastTypoLinkTarget;
                     break;
             }
         }
         if ($conf['postUserFunc']) {
             $linktxt = $this->cObj->callUserFunction($conf['postUserFunc'], $conf['postUserFunc.'], $linktxt);
         }
         if ($conf['ATagBeforeWrap']) {
             return $res . $this->cObj->wrap($linktxt, $conf['wrap']) . '</a>';
         } else {
             return $this->cObj->wrap($res . $linktxt . '</a>', $conf['wrap']);
         }
     } else {
         return $linktxt;
     }
 }
 /**
  * Computes the setfixed url's
  *
  * @param array  $markerArray: the input marker array
  * @param array  $setfixed: the TS setup setfixed configuration
  * @param array  $record: the record row
  * @param array $controlData: the object of the control data
  * @return void
  */
 public function computeUrl($cmdKey, $prefixId, $cObj, $controlData, &$markerArray, $setfixed, array $record, $theTable, $useShortUrls, $editSetfixed, $confirmType)
 {
     if ($controlData->getSetfixedEnabled() && is_array($setfixed)) {
         $authObj = t3lib_div::getUserObj('&tx_srfeuserregister_auth');
         foreach ($setfixed as $theKey => $data) {
             if (strstr($theKey, '.')) {
                 $theKey = substr($theKey, 0, -1);
             }
             $setfixedpiVars = array();
             if ($theTable != 'fe_users' && $theKey == 'EDIT') {
                 $noFeusersEdit = TRUE;
             } else {
                 $noFeusersEdit = FALSE;
             }
             $setfixedpiVars[$prefixId . '%5BrU%5D'] = $record['uid'];
             $fieldList = $data['_FIELDLIST'];
             $fieldListArray = t3lib_div::trimExplode(',', $fieldList);
             foreach ($fieldListArray as $fieldname) {
                 if (isset($data[$fieldname])) {
                     $fieldValue = $data[$fieldname];
                     if ($fieldname == 'usergroup' && $data['usergroup.']) {
                         $tablesObj = t3lib_div::getUserObj('&tx_srfeuserregister_lib_tables');
                         $addressObj = $tablesObj->get('address');
                         $userGroupObj = $addressObj->getFieldObj('usergroup');
                         if (is_object($userGroupObj)) {
                             $fieldValue = $userGroupObj->getExtendedValue($controlData->getExtKey(), $fieldValue, $data['usergroup.'], $record);
                             $data[$fieldname] = $fieldValue;
                         }
                     }
                     $record[$fieldname] = $fieldValue;
                 }
             }
             if ($noFeusersEdit) {
                 $cmd = $pidCmd = 'edit';
                 if ($editSetfixed) {
                     $bSetfixedHash = TRUE;
                 } else {
                     $bSetfixedHash = FALSE;
                     $setfixedpiVars[$prefixId . '%5BaC%5D'] = $authObj->authCode($record, $fieldList);
                 }
             } else {
                 $cmd = 'setfixed';
                 $pidCmd = $controlData->getCmd() == 'invite' ? 'confirmInvitation' : 'confirm';
                 $setfixedpiVars[$prefixId . '%5BsFK%5D'] = $theKey;
                 $bSetfixedHash = TRUE;
                 if (isset($record['auto_login_key'])) {
                     $setfixedpiVars[$prefixId . '%5Bkey%5D'] = $record['auto_login_key'];
                 }
             }
             if ($bSetfixedHash) {
                 $setfixedpiVars[$prefixId . '%5BaC%5D'] = $authObj->setfixedHash($record, $fieldList);
             }
             $setfixedpiVars[$prefixId . '%5Bcmd%5D'] = $cmd;
             if (is_array($data)) {
                 foreach ($data as $fieldname => $fieldValue) {
                     if (strpos($fieldname, '.') !== FALSE) {
                         continue;
                     }
                     $setfixedpiVars['fD%5B' . $fieldname . '%5D'] = rawurlencode($fieldValue);
                 }
             }
             $linkPID = $controlData->getPid($pidCmd);
             if (t3lib_div::_GP('L') && !t3lib_div::inList($GLOBALS['TSFE']->config['config']['linkVars'], 'L')) {
                 $setfixedpiVars['L'] = t3lib_div::_GP('L');
             }
             if ($useShortUrls) {
                 $thisHash = $this->storeFixedPiVars($setfixedpiVars);
                 $setfixedpiVars = array($prefixId . '%5BregHash%5D' => $thisHash);
             }
             $urlConf = array();
             $urlConf['disableGroupAccessCheck'] = TRUE;
             $bconfirmTypeIsInt = class_exists('t3lib_utility_Math') ? t3lib_utility_Math::canBeInterpretedAsInteger($confirmType) : t3lib_div::testInt($confirmType);
             $confirmType = $bconfirmTypeIsInt ? intval($confirmType) : $GLOBALS['TSFE']->type;
             $url = Tx_SrFeuserRegister_Utility_UrlUtility::getTypoLink_URL($cObj, $linkPID . ',' . $confirmType, $setfixedpiVars, '', $urlConf);
             $bIsAbsoluteURL = strncmp($url, 'http://', 7) == 0 || strncmp($url, 'https://', 8) == 0;
             $markerKey = '###SETFIXED_' . $cObj->caseshift($theKey, 'upper') . '_URL###';
             $url = ($bIsAbsoluteURL ? '' : $controlData->getSiteUrl()) . ltrim($url, '/');
             $markerArray[$markerKey] = str_replace(array('[', ']'), array('%5B', '%5D'), $url);
         }
         // foreach
     }
 }
コード例 #16
0
 /**
  * makeStatisticsReportsCommand
  *
  * @param int stroagePid
  * @param string senderEmailAddress
  * @param string receiverEmailAddress list of receiver email addresses separated by comma
  * @return void
  */
 public function makeStatisticsReportsCommand($storagePid, $senderEmailAddress = '', $receiverEmailAddress = '')
 {
     // do some init work...
     $this->initializeAction();
     // abort if no storagePid is found
     if (!t3lib_utility_Math::canBeInterpretedAsInteger($storagePid)) {
         echo 'NO storagePid given. Please enter the storagePid in the scheduler task.';
         exit(1);
     }
     // abort if no senderEmailAddress is found
     if (empty($senderEmailAddress)) {
         echo 'NO senderEmailAddress given. Please enter the senderEmailAddress in the scheduler task.';
         exit(1);
     }
     // abort if no senderEmailAddress is found
     if (empty($receiverEmailAddress)) {
         echo 'NO receiverEmailAddress given. Please enter the receiverEmailAddress in the scheduler task.';
         exit(1);
     } else {
         $receiverEmailAddress = explode(', ', $receiverEmailAddress);
     }
     // set storagePid to point extbase to the right repositories
     $configurationArray = array('persistence' => array('storagePid' => $storagePid));
     $this->configurationManager->setConfiguration($configurationArray);
     // start the work...
     // 1. get the categories
     $categories = $this->categoryRepository->findAll();
     foreach ($categories as $uid => $category) {
         $searchParameter['category'][$uid] = $uid;
     }
     // 2. get events of last month
     $startDateTime = strtotime('first day of last month 00:00:00');
     $endDateTime = strtotime('last day of last month 23:59:59');
     $allevents = $this->eventRepository->findAllByCategoriesAndDateInterval($searchParameter['category'], $startDateTime, $endDateTime);
     // used to name the csv file...
     $helper['nameto'] = strftime('%Y%m', $startDateTime);
     // email to all receivers...
     $out = $this->sendTemplateEmail($receiverEmailAddress, array($senderEmailAddress => 'WÖHRL Akademie - noreply'), 'Statistik Report Veranstaltungen: ' . ': ' . strftime('%x', $startDateTime) . ' - ' . strftime('%x', $endDateTime), 'Statistics', array('events' => $allevents, 'categories' => $categories, 'helper' => $helper, 'attachCsv' => TRUE, 'attachIcs' => FALSE));
     return;
 }
 public function getPid($type = '')
 {
     if ($type) {
         if (isset($this->pid[$type])) {
             $result = $this->pid[$type];
         }
     }
     if (!$result) {
         $bPidIsInt = class_exists('t3lib_utility_Math') ? t3lib_utility_Math::canBeInterpretedAsInteger($this->conf['pid']) : t3lib_div::testInt($this->conf['pid']);
         $result = $bPidIsInt ? intval($this->conf['pid']) : $GLOBALS['TSFE']->id;
     }
     return $result;
 }
コード例 #18
0
 /**
  * Gets the error message to be displayed
  *
  * @param string  $theField: the name of the field being validated
  * @param string  $theRule: the name of the validation rule being evaluated
  * @param string  $label: a default error message provided by the invoking function
  * @param integer $orderNo: ordered number of the rule for the field (>0 if used)
  * @param string  $param: parameter for the error message
  * @param boolean $bInternal: if the bug is caused by an internal problem
  * @return string  the error message to be displayed
  */
 public function getFailureText($theField, $theRule, $label, $orderNo = '', $param = '', $bInternal = FALSE)
 {
     if ($orderNo != '' && $theRule && isset($this->conf['evalErrors.'][$theField . '.'][$theRule . '.'])) {
         $count = 0;
         foreach ($this->conf['evalErrors.'][$theField . '.'][$theRule . '.'] as $k => $v) {
             $bKIsInt = class_exists('t3lib_utility_Math') ? t3lib_utility_Math::canBeInterpretedAsInteger($k) : t3lib_div::testInt($k);
             if ($bInternal) {
                 if ($k == 'internal') {
                     $failureLabel = $v;
                     break;
                 }
             } else {
                 if ($bKIsInt) {
                     $count++;
                     if ($count == $orderNo) {
                         $failureLabel = $v;
                         break;
                     }
                 }
             }
         }
     }
     if (!isset($failureLabel)) {
         if ($theRule && isset($this->conf['evalErrors.'][$theField . '.'][$theRule])) {
             $failureLabel = $this->conf['evalErrors.'][$theField . '.'][$theRule];
         } else {
             $failureLabel = '';
             $internalPostfix = $bInternal ? '_internal' : '';
             if ($theRule) {
                 $labelname = 'evalErrors_' . $theRule . '_' . $theField . $internalPostfix;
                 $failureLabel = $this->lang->getLL($labelname);
                 $failureLabel = $failureLabel ? $failureLabel : $this->lang->getLL('evalErrors_' . $theRule . $internalPostfix);
             }
             if (!$failureLabel) {
                 // this remains only for compatibility reasons
                 $labelname = $label;
                 $failureLabel = $this->lang->getLL($labelname);
             }
         }
     }
     if ($param != '') {
         $failureLabel = sprintf($failureLabel, $param);
     }
     return $failureLabel;
 }
コード例 #19
0
 /**
  * Tests if the input can be interpreted as integer.
  *
  * @param mixed $var Any input variable to test
  * @return boolean Returns TRUE if string is an integer
  */
 public static function canBeInterpretedAsInteger($var)
 {
     $result = '';
     if (self::isEqualOrHigherSixZero()) {
         $result = \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($var);
     } elseif (class_exists('t3lib_utility_Math')) {
         $result = t3lib_utility_Math::canBeInterpretedAsInteger($var);
     } else {
         $result = t3lib_div::testInt($var);
     }
     return $result;
 }
コード例 #20
0
 /**
  * Hook function for cleaning output XHTML
  * hooks on "class.tslib_fe.php:2946"
  * page.config.tx_seo.sourceCodeFormatter.indentType = space
  * page.config.tx_seo.sourceCodeFormatter.indentAmount = 16
  *
  * @param       array           hook parameters
  * @param       object          Reference to parent object (TSFE-obj)
  * @return      void
  */
 public function processOutputHook(&$feObj, $ref)
 {
     if ($GLOBALS['TSFE']->type != 0) {
         return;
     }
     $configuration = $GLOBALS['TSFE']->config['config']['tx_seo.']['sourceCodeFormatter.'];
     // disabled for this page type
     if (isset($configuration['enable']) && $configuration['enable'] == '0') {
         return;
     }
     // 4.5 compatibility
     if (method_exists('t3lib_div', 'intInRange')) {
         $indentAmount = t3lib_div::intInRange($configuration['indentAmount'], 1, 100);
     } else {
         $indentAmount = t3lib_utility_Math::forceIntegerInRange($configuration['indentAmount'], 1, 100);
     }
     // use the "space" character as a indention type
     if ($configuration['indentType'] == 'space') {
         $indentElement = ' ';
         // use any character from the ASCII table
     } else {
         $indentTypeIsNumeric = FALSE;
         // 4.5 compatibility
         if (method_exists('t3lib_div', 'testInt')) {
             $indentTypeIsNumeric == t3lib_div::testInt($configuration['indentType']);
         } else {
             $indentTypeIsNumeric = t3lib_utility_Math::canBeInterpretedAsInteger($configuration['indentType']);
         }
         if ($indentTypeIsNumeric) {
             $indentElement = chr($configuration['indentType']);
         } else {
             // use tab by default
             $indentElement = "\t";
         }
     }
     $indention = '';
     for ($i = 1; $i <= $indentAmount; $i++) {
         $indention .= $indentElement;
     }
     $spltContent = explode("\n", $ref->content);
     $level = 0;
     $cleanContent = array();
     $textareaOpen = false;
     foreach ($spltContent as $lineNum => $line) {
         $line = trim($line);
         if (empty($line)) {
             continue;
         }
         $out = $line;
         // ugly strpos => TODO: use regular expressions
         // starts with an ending tag
         if (strpos($line, '</div>') === 0 || strpos($line, '<div') !== 0 && strpos($line, '</div>') === strlen($line) - 6 || strpos($line, '</html>') === 0 || strpos($line, '</body>') === 0 || strpos($line, '</head>') === 0 || strpos($line, '</ul>') === 0) {
             $level--;
         }
         if (strpos($line, '<textarea') !== false) {
             $textareaOpen = true;
         }
         // add indention only if no textarea is open
         if (!$textareaOpen) {
             for ($i = 0; $i < $level; $i++) {
                 $out = $indention . $out;
             }
         }
         if (strpos($line, '</textarea>') !== false) {
             $textareaOpen = false;
         }
         // starts with an opening <div>, <ul>, <head> or <body>
         if (strpos($line, '<div') === 0 && strpos($line, '</div>') !== strlen($line) - 6 || strpos($line, '<body') === 0 && strpos($line, '</body>') !== strlen($line) - 7 || strpos($line, '<head') === 0 && strpos($line, '</head>') !== strlen($line) - 7 || strpos($line, '<ul') === 0 && strpos($line, '</ul>') !== strlen($line) - 5) {
             $level++;
         }
         $cleanContent[] = $out;
     }
     $ref->content = implode("\n", $cleanContent);
 }
コード例 #21
0
 /**
  * @param string| int $value
  * @return bool
  */
 public function canBeInterpretedAsInteger($value)
 {
     $canBeInterpretedAsInteger = NULL;
     if (class_exists('t3lib_utility_Math')) {
         $canBeInterpretedAsInteger = t3lib_utility_Math::canBeInterpretedAsInteger($value);
     } else {
         $canBeInterpretedAsInteger = t3lib_div::testInt($value);
     }
     return $canBeInterpretedAsInteger;
 }
コード例 #22
0
 /**
  * Deprecated to call directly (unless you are aware of using XML prologues)! Use "array2xml_cs" instead (which adds an XML-prologue)
  *
  * Converts a PHP array into an XML string.
  * The XML output is optimized for readability since associative keys are used as tag names.
  * This also means that only alphanumeric characters are allowed in the tag names AND only keys NOT starting with numbers (so watch your usage of keys!). However there are options you can set to avoid this problem.
  * Numeric keys are stored with the default tag name "numIndex" but can be overridden to other formats)
  * The function handles input values from the PHP array in a binary-safe way; All characters below 32 (except 9,10,13) will trigger the content to be converted to a base64-string
  * The PHP variable type of the data IS preserved as long as the types are strings, arrays, integers and booleans. Strings are the default type unless the "type" attribute is set.
  * The output XML has been tested with the PHP XML-parser and parses OK under all tested circumstances with 4.x versions. However, with PHP5 there seems to be the need to add an XML prologue a la <?xml version="1.0" encoding="[charset]" standalone="yes" ?> - otherwise UTF-8 is assumed! Unfortunately, many times the output from this function is used without adding that prologue meaning that non-ASCII characters will break the parsing!! This suchs of course! Effectively it means that the prologue should always be prepended setting the right characterset, alternatively the system should always run as utf-8!
  * However using MSIE to read the XML output didn't always go well: One reason could be that the character encoding is not observed in the PHP data. The other reason may be if the tag-names are invalid in the eyes of MSIE. Also using the namespace feature will make MSIE break parsing. There might be more reasons...
  *
  * @param array $array The input PHP array with any kind of data; text, binary, integers. Not objects though.
  * @param string $NSprefix tag-prefix, eg. a namespace prefix like "T3:"
  * @param integer $level Current recursion level. Don't change, stay at zero!
  * @param string $docTag Alternative document tag. Default is "phparray".
  * @param integer $spaceInd If greater than zero, then the number of spaces corresponding to this number is used for indenting, if less than zero - no indentation, if zero - a single TAB is used
  * @param array $options Options for the compilation. Key "useNindex" => 0/1 (boolean: whether to use "n0, n1, n2" for num. indexes); Key "useIndexTagForNum" => "[tag for numerical indexes]"; Key "useIndexTagForAssoc" => "[tag for associative indexes"; Key "parentTagMap" => array('parentTag' => 'thisLevelTag')
  * @param array $stackData Stack data. Don't touch.
  * @return string An XML string made from the input content in the array.
  * @see xml2array()
  */
 public static function array2xml(array $array, $NSprefix = '', $level = 0, $docTag = 'phparray', $spaceInd = 0, array $options = array(), array $stackData = array())
 {
     // The list of byte values which will trigger binary-safe storage. If any value has one of these char values in it, it will be encoded in base64
     $binaryChars = chr(0) . chr(1) . chr(2) . chr(3) . chr(4) . chr(5) . chr(6) . chr(7) . chr(8) . chr(11) . chr(12) . chr(14) . chr(15) . chr(16) . chr(17) . chr(18) . chr(19) . chr(20) . chr(21) . chr(22) . chr(23) . chr(24) . chr(25) . chr(26) . chr(27) . chr(28) . chr(29) . chr(30) . chr(31);
     // Set indenting mode:
     $indentChar = $spaceInd ? ' ' : TAB;
     $indentN = $spaceInd > 0 ? $spaceInd : 1;
     $nl = $spaceInd >= 0 ? LF : '';
     // Init output variable:
     $output = '';
     // Traverse the input array
     foreach ($array as $k => $v) {
         $attr = '';
         $tagName = $k;
         // Construct the tag name.
         if (isset($options['grandParentTagMap'][$stackData['grandParentTagName'] . '/' . $stackData['parentTagName']])) {
             // Use tag based on grand-parent + parent tag name
             $attr .= ' index="' . htmlspecialchars($tagName) . '"';
             $tagName = (string) $options['grandParentTagMap'][$stackData['grandParentTagName'] . '/' . $stackData['parentTagName']];
         } elseif (isset($options['parentTagMap'][$stackData['parentTagName'] . ':_IS_NUM']) && t3lib_utility_Math::canBeInterpretedAsInteger($tagName)) {
             // Use tag based on parent tag name + if current tag is numeric
             $attr .= ' index="' . htmlspecialchars($tagName) . '"';
             $tagName = (string) $options['parentTagMap'][$stackData['parentTagName'] . ':_IS_NUM'];
         } elseif (isset($options['parentTagMap'][$stackData['parentTagName'] . ':' . $tagName])) {
             // Use tag based on parent tag name + current tag
             $attr .= ' index="' . htmlspecialchars($tagName) . '"';
             $tagName = (string) $options['parentTagMap'][$stackData['parentTagName'] . ':' . $tagName];
         } elseif (isset($options['parentTagMap'][$stackData['parentTagName']])) {
             // Use tag based on parent tag name:
             $attr .= ' index="' . htmlspecialchars($tagName) . '"';
             $tagName = (string) $options['parentTagMap'][$stackData['parentTagName']];
         } elseif (!strcmp(intval($tagName), $tagName)) {
             // If integer...;
             if ($options['useNindex']) {
                 // If numeric key, prefix "n"
                 $tagName = 'n' . $tagName;
             } else {
                 // Use special tag for num. keys:
                 $attr .= ' index="' . $tagName . '"';
                 $tagName = $options['useIndexTagForNum'] ? $options['useIndexTagForNum'] : 'numIndex';
             }
         } elseif ($options['useIndexTagForAssoc']) {
             // Use tag for all associative keys:
             $attr .= ' index="' . htmlspecialchars($tagName) . '"';
             $tagName = $options['useIndexTagForAssoc'];
         }
         // The tag name is cleaned up so only alphanumeric chars (plus - and _) are in there and not longer than 100 chars either.
         $tagName = substr(preg_replace('/[^[:alnum:]_-]/', '', $tagName), 0, 100);
         // If the value is an array then we will call this function recursively:
         if (is_array($v)) {
             // Sub elements:
             if ($options['alt_options'][$stackData['path'] . '/' . $tagName]) {
                 $subOptions = $options['alt_options'][$stackData['path'] . '/' . $tagName];
                 $clearStackPath = $subOptions['clearStackPath'];
             } else {
                 $subOptions = $options;
                 $clearStackPath = FALSE;
             }
             $content = $nl . self::array2xml($v, $NSprefix, $level + 1, '', $spaceInd, $subOptions, array('parentTagName' => $tagName, 'grandParentTagName' => $stackData['parentTagName'], 'path' => $clearStackPath ? '' : $stackData['path'] . '/' . $tagName)) . ($spaceInd >= 0 ? str_pad('', ($level + 1) * $indentN, $indentChar) : '');
             if ((int) $options['disableTypeAttrib'] != 2) {
                 // Do not set "type = array". Makes prettier XML but means that empty arrays are not restored with xml2array
                 $attr .= ' type="array"';
             }
         } else {
             // Just a value:
             // Look for binary chars:
             $vLen = strlen($v);
             // check for length, because PHP 5.2.0 may crash when first argument of strcspn is empty
             if ($vLen && strcspn($v, $binaryChars) != $vLen) {
                 // Go for base64 encoding if the initial segment NOT matching any binary char has the same length as the whole string!
                 // If the value contained binary chars then we base64-encode it an set an attribute to notify this situation:
                 $content = $nl . chunk_split(base64_encode($v));
                 $attr .= ' base64="1"';
             } else {
                 // Otherwise, just htmlspecialchar the stuff:
                 $content = htmlspecialchars($v);
                 $dType = gettype($v);
                 if ($dType == 'string') {
                     if ($options['useCDATA'] && $content != $v) {
                         $content = '<![CDATA[' . $v . ']]>';
                     }
                 } elseif (!$options['disableTypeAttrib']) {
                     $attr .= ' type="' . $dType . '"';
                 }
             }
         }
         // Add the element to the output string:
         $output .= ($spaceInd >= 0 ? str_pad('', ($level + 1) * $indentN, $indentChar) : '') . '<' . $NSprefix . $tagName . $attr . '>' . $content . '</' . $NSprefix . $tagName . '>' . $nl;
     }
     // If we are at the outer-most level, then we finally wrap it all in the document tags and return that as the value:
     if (!$level) {
         $output = '<' . $docTag . '>' . $nl . $output . '</' . $docTag . '>';
     }
     return $output;
 }
 public function getAllowedWhereClause($theTable, $pid, $conf, $cmdKey, $bAllow = TRUE)
 {
     $whereClause = '';
     $subgroupWhereClauseArray = array();
     $pidArray = array();
     $tmpArray = t3lib_div::trimExplode(',', $conf['userGroupsPidList'], 1);
     if (count($tmpArray)) {
         foreach ($tmpArray as $value) {
             $valueIsInt = class_exists('t3lib_utility_Math') ? t3lib_utility_Math::canBeInterpretedAsInteger($value) : t3lib_div::testInt($value);
             if ($valueIsInt) {
                 $pidArray[] = intval($value);
             }
         }
     }
     if (count($pidArray) > 0) {
         $whereClause = ' pid IN (' . implode(',', $pidArray) . ') ';
     } else {
         $whereClause = ' pid=' . intval($pid) . ' ';
     }
     $whereClausePart2 = '';
     $whereClausePart2Array = array();
     $this->getAllowedValues($conf, $cmdKey, $allowedUserGroupArray, $allowedSubgroupArray, $deniedUserGroupArray);
     if ($allowedUserGroupArray['0'] != 'ALL') {
         $uidArray = $GLOBALS['TYPO3_DB']->fullQuoteArray($allowedUserGroupArray, $theTable);
         $subgroupWhereClauseArray[] = 'uid ' . ($bAllow ? 'IN' : 'NOT IN') . ' (' . implode(',', $uidArray) . ')';
     }
     if (count($allowedSubgroupArray)) {
         $subgroupArray = $GLOBALS['TYPO3_DB']->fullQuoteArray($allowedSubgroupArray, $theTable);
         $subgroupWhereClauseArray[] = 'subgroup ' . ($bAllow ? 'IN' : 'NOT IN') . ' (' . implode(',', $subgroupArray) . ')';
     }
     if (count($subgroupWhereClauseArray)) {
         $subgroupWhereClause .= implode(' ' . ($bAllow ? 'OR' : 'AND') . ' ', $subgroupWhereClauseArray);
         $whereClausePart2Array[] = '( ' . $subgroupWhereClause . ' )';
     }
     if (count($deniedUserGroupArray)) {
         $uidArray = $GLOBALS['TYPO3_DB']->fullQuoteArray($deniedUserGroupArray, $theTable);
         $whereClausePart2Array[] = 'uid ' . ($bAllow ? 'NOT IN' : 'IN') . ' (' . implode(',', $uidArray) . ')';
     }
     if (count($whereClausePart2Array)) {
         $whereClausePart2 = implode(' ' . ($bAllow ? 'AND' : 'OR') . ' ', $whereClausePart2Array);
         $whereClause .= ' AND (' . $whereClausePart2 . ')';
     }
     return $whereClause;
 }
 /**
  * For RTE: This displays all content elements on a page and lets you create a link to the element.
  *
  * @return	string		HTML output. Returns content only if the ->expandPage value is set (pointing to a page uid to show tt_content records from ...)
  */
 function expandPage()
 {
     $out = '';
     $expPageId = $this->browseLinks->expandPage;
     // Set page id (if any) to expand
     // If there is an anchor value (content element reference) in the element reference, then force an ID to expand:
     if (!$this->browseLinks->expandPage && $this->browseLinks->curUrlInfo['cElement']) {
         $expPageId = $this->browseLinks->curUrlInfo['pageid'];
         // Set to the current link page id.
     }
     // Draw the record list IF there is a page id to expand:
     if ($expPageId && t3lib_utility_Math::canBeInterpretedAsInteger($expPageId) && $GLOBALS['BE_USER']->isInWebMount($expPageId)) {
         // Set header:
         $out .= $this->browseLinks->barheader($GLOBALS['LANG']->getLL('contentElements') . ':');
         // Create header for listing, showing the page title/icon:
         $titleLen = intval($GLOBALS['BE_USER']->uc['titleLen']);
         $mainPageRec = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordWSOL('pages', $expPageId);
         $picon = t3lib_iconWorks::getSpriteIconForRecord('pages', $mainPageRec);
         $picon .= \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('pages', $mainPageRec, TRUE);
         $out .= $picon . '<br />';
         // Look up tt_content elements from the expanded page:
         $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,header,hidden,starttime,endtime,fe_group,CType,colPos,bodytext,tx_jfmulticontent_view,tx_jfmulticontent_pages,tx_jfmulticontent_contents', 'tt_content', 'pid=' . intval($expPageId) . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('tt_content') . \TYPO3\CMS\Backend\Utility\BackendUtility::versioningPlaceholderClause('tt_content'), '', 'colPos,sorting');
         $cc = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
         // Traverse list of records:
         $c = 0;
         while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
             $c++;
             $icon = t3lib_iconWorks::getSpriteIconForRecord('tt_content', $row);
             if ($this->browseLinks->curUrlInfo['act'] == 'page' && $this->browseLinks->curUrlInfo['cElement'] == $row['uid']) {
                 $arrCol = '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/blinkarrow_left.gif', 'width="5" height="9"') . ' class="c-blinkArrowL" alt="" />';
             } else {
                 $arrCol = '';
             }
             // Putting list element HTML together:
             $out .= '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/ol/join' . ($c == $cc ? 'bottom' : '') . '.gif', 'width="18" height="16"') . ' alt="" />' . $arrCol . '<a href="#" onclick="return link_typo3Page(\'' . $expPageId . '\',\'#' . $row['uid'] . '\');">' . $icon . \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('tt_content', $row, TRUE) . '</a><br />';
             $contents = array();
             // get all contents
             switch ($row['tx_jfmulticontent_view']) {
                 case "page":
                     $contents = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(",", $row['tx_jfmulticontent_pages']);
                     break;
                 case "content":
                     $contents = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(",", $row['tx_jfmulticontent_contents']);
                     break;
                 case "irre":
                     $resIrre = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tt_content', 'tx_jfmulticontent_irre_parentid=' . intval($row['uid']) . ' AND deleted = 0 AND hidden = 0', '', '');
                     while ($rowIrre = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resIrre)) {
                         $contents[] = $rowIrre['uid'];
                     }
                     break;
             }
             if (count($contents) > 0) {
                 $out .= '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/ol/line.gif', 'width="18" height="16"') . ' alt="" />' . '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/ol/blank.gif', 'width="18" height="16"') . ' alt="" />';
                 foreach ($contents as $key => $content) {
                     $out .= '<a href="#" onclick="return link_typo3Page(\'' . $expPageId . '\',\'#jfmulticontent_c' . $row['uid'] . '-' . ($key + 1) . '\');">' . '&nbsp;' . ($key + 1) . '&nbsp;' . '</a>';
                 }
                 $out .= '<br/>';
             }
         }
     }
     return $out;
 }
コード例 #25
0
 /**
  * Wrapper to support old an new method to test integer value.
  *
  * @param integer $value
  * @return bool
  */
 public static function canBeInterpretedAsInteger($value)
 {
     if (version_compare(TYPO3_version, '4.6.0', '>=')) {
         $result = t3lib_utility_Math::canBeInterpretedAsInteger($value);
     } else {
         $result = t3lib_div::testInt($value);
     }
     return $result;
 }