コード例 #1
1
    /**
     * Send an email notification to users in workspace
     *
     * @param array $stat Workspace access array (from t3lib_userauthgroup::checkWorkspace())
     * @param integer $stageId New Stage number: 0 = editing, 1= just ready for review, 10 = ready for publication, -1 = rejected!
     * @param string $table Table name of element (or list of element names if $id is zero)
     * @param integer $id Record uid of element (if zero, then $table is used as reference to element(s) alone)
     * @param string $comment User comment sent along with action
     * @param t3lib_TCEmain $tcemainObj TCEmain object
     * @param string $notificationAlternativeRecipients Comma separated list of recipients to notificate instead of be_users selected by sys_workspace, list is generated by workspace extension module
     * @return void
     */
    protected function notifyStageChange(array $stat, $stageId, $table, $id, $comment, t3lib_TCEmain $tcemainObj, $notificationAlternativeRecipients = FALSE)
    {
        $workspaceRec = t3lib_BEfunc::getRecord('sys_workspace', $stat['uid']);
        // So, if $id is not set, then $table is taken to be the complete element name!
        $elementName = $id ? $table . ':' . $id : $table;
        if (is_array($workspaceRec)) {
            // Get the new stage title from workspaces library, if workspaces extension is installed
            if (t3lib_extMgm::isLoaded('workspaces')) {
                $stageService = t3lib_div::makeInstance('Tx_Workspaces_Service_Stages');
                $newStage = $stageService->getStageTitle((int) $stageId);
            } else {
                // TODO: CONSTANTS SHOULD BE USED - tx_service_workspace_workspaces
                // TODO: use localized labels
                // Compile label:
                switch ((int) $stageId) {
                    case 1:
                        $newStage = 'Ready for review';
                        break;
                    case 10:
                        $newStage = 'Ready for publishing';
                        break;
                    case -1:
                        $newStage = 'Element was rejected!';
                        break;
                    case 0:
                        $newStage = 'Rejected element was noticed and edited';
                        break;
                    default:
                        $newStage = 'Unknown state change!?';
                        break;
                }
            }
            if ($notificationAlternativeRecipients == false) {
                // Compile list of recipients:
                $emails = array();
                switch ((int) $stat['stagechg_notification']) {
                    case 1:
                        switch ((int) $stageId) {
                            case 1:
                                $emails = $this->getEmailsForStageChangeNotification($workspaceRec['reviewers']);
                                break;
                            case 10:
                                $emails = $this->getEmailsForStageChangeNotification($workspaceRec['adminusers'], TRUE);
                                break;
                            case -1:
                                #								$emails = $this->getEmailsForStageChangeNotification($workspaceRec['reviewers']);
                                #								$emails = array_merge($emails,$this->getEmailsForStageChangeNotification($workspaceRec['members']));
                                // List of elements to reject:
                                $allElements = explode(',', $elementName);
                                // Traverse them, and find the history of each
                                foreach ($allElements as $elRef) {
                                    list($eTable, $eUid) = explode(':', $elRef);
                                    $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('log_data,tstamp,userid', 'sys_log', 'action=6 and details_nr=30
											AND tablename=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($eTable, 'sys_log') . '
											AND recuid=' . intval($eUid), '', 'uid DESC');
                                    // Find all implicated since the last stage-raise from editing to review:
                                    foreach ($rows as $dat) {
                                        $data = unserialize($dat['log_data']);
                                        $emails = t3lib_div::array_merge($emails, $this->getEmailsForStageChangeNotification($dat['userid'], TRUE));
                                        if ($data['stage'] == 1) {
                                            break;
                                        }
                                    }
                                }
                                break;
                            case 0:
                                $emails = $this->getEmailsForStageChangeNotification($workspaceRec['members']);
                                break;
                            default:
                                $emails = $this->getEmailsForStageChangeNotification($workspaceRec['adminusers'], TRUE);
                                break;
                        }
                        break;
                    case 10:
                        $emails = $this->getEmailsForStageChangeNotification($workspaceRec['adminusers'], TRUE);
                        $emails = t3lib_div::array_merge($emails, $this->getEmailsForStageChangeNotification($workspaceRec['reviewers']));
                        $emails = t3lib_div::array_merge($emails, $this->getEmailsForStageChangeNotification($workspaceRec['members']));
                        break;
                }
            } else {
                $emails = array();
                foreach ($notificationAlternativeRecipients as $emailAddress) {
                    $emails[] = array('email' => $emailAddress);
                }
            }
            // prepare and then send the emails
            if (count($emails)) {
                // Path to record is found:
                list($elementTable, $elementUid) = explode(':', $elementName);
                $elementUid = intval($elementUid);
                $elementRecord = t3lib_BEfunc::getRecord($elementTable, $elementUid);
                $recordTitle = t3lib_BEfunc::getRecordTitle($elementTable, $elementRecord);
                if ($elementTable == 'pages') {
                    $pageUid = $elementUid;
                } else {
                    t3lib_BEfunc::fixVersioningPid($elementTable, $elementRecord);
                    $pageUid = $elementUid = $elementRecord['pid'];
                }
                // fetch the TSconfig settings for the email
                // old way, options are TCEMAIN.notificationEmail_body/subject
                $TCEmainTSConfig = $tcemainObj->getTCEMAIN_TSconfig($pageUid);
                // these options are deprecated since TYPO3 4.5, but are still
                // used in order to provide backwards compatibility
                $emailMessage = trim($TCEmainTSConfig['notificationEmail_body']);
                $emailSubject = trim($TCEmainTSConfig['notificationEmail_subject']);
                // new way, options are
                // pageTSconfig: tx_version.workspaces.stageNotificationEmail.subject
                // userTSconfig: page.tx_version.workspaces.stageNotificationEmail.subject
                $pageTsConfig = t3lib_BEfunc::getPagesTSconfig($pageUid);
                $emailConfig = $pageTsConfig['tx_version.']['workspaces.']['stageNotificationEmail.'];
                $markers = array('###RECORD_TITLE###' => $recordTitle, '###RECORD_PATH###' => t3lib_BEfunc::getRecordPath($elementUid, '', 20), '###SITE_NAME###' => $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'], '###SITE_URL###' => t3lib_div::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir, '###WORKSPACE_TITLE###' => $workspaceRec['title'], '###WORKSPACE_UID###' => $workspaceRec['uid'], '###ELEMENT_NAME###' => $elementName, '###NEXT_STAGE###' => $newStage, '###COMMENT###' => $comment, '###USER_REALNAME###' => $tcemainObj->BE_USER->user['realName'], '###USER_USERNAME###' => $tcemainObj->BE_USER->user['username']);
                // sending the emails the old way with sprintf(),
                // because it was set explicitly in TSconfig
                if ($emailMessage && $emailSubject) {
                    t3lib_div::deprecationLog('This TYPO3 installation uses Workspaces staging notification by setting the TSconfig options "TCEMAIN.notificationEmail_subject" / "TCEMAIN.notificationEmail_body". Please use the more flexible marker-based options tx_version.workspaces.stageNotificationEmail.message / tx_version.workspaces.stageNotificationEmail.subject');
                    $emailSubject = sprintf($emailSubject, $elementName);
                    $emailMessage = sprintf($emailMessage, $markers['###SITE_NAME###'], $markers['###SITE_URL###'], $markers['###WORKSPACE_TITLE###'], $markers['###WORKSPACE_UID###'], $markers['###ELEMENT_NAME###'], $markers['###NEXT_STAGE###'], $markers['###COMMENT###'], $markers['###USER_REALNAME###'], $markers['###USER_USERNAME###'], $markers['###RECORD_PATH###'], $markers['###RECORD_TITLE###']);
                    // filter out double email addresses
                    $emailRecipients = array();
                    foreach ($emails as $recip) {
                        $emailRecipients[$recip['email']] = $recip['email'];
                    }
                    $emailRecipients = implode(',', $emailRecipients);
                    // Send one email to everybody
                    t3lib_div::plainMailEncoded($emailRecipients, $emailSubject, $emailMessage);
                } else {
                    // send an email to each individual user, to ensure the
                    // multilanguage version of the email
                    $emailHeaders = $emailConfig['additionalHeaders'];
                    $emailRecipients = array();
                    // an array of language objects that are needed
                    // for emails with different languages
                    $languageObjects = array($GLOBALS['LANG']->lang => $GLOBALS['LANG']);
                    // loop through each recipient and send the email
                    foreach ($emails as $recipientData) {
                        // don't send an email twice
                        if (isset($emailRecipients[$recipientData['email']])) {
                            continue;
                        }
                        $emailSubject = $emailConfig['subject'];
                        $emailMessage = $emailConfig['message'];
                        $emailRecipients[$recipientData['email']] = $recipientData['email'];
                        // check if the email needs to be localized
                        // in the users' language
                        if (t3lib_div::isFirstPartOfStr($emailSubject, 'LLL:') || t3lib_div::isFirstPartOfStr($emailMessage, 'LLL:')) {
                            $recipientLanguage = $recipientData['lang'] ? $recipientData['lang'] : 'default';
                            if (!isset($languageObjects[$recipientLanguage])) {
                                // a LANG object in this language hasn't been
                                // instantiated yet, so this is done here
                                /** @var $languageObject language */
                                $languageObject = t3lib_div::makeInstance('language');
                                $languageObject->init($recipientLanguage);
                                $languageObjects[$recipientLanguage] = $languageObject;
                            } else {
                                $languageObject = $languageObjects[$recipientLanguage];
                            }
                            if (t3lib_div::isFirstPartOfStr($emailSubject, 'LLL:')) {
                                $emailSubject = $languageObject->sL($emailSubject);
                            }
                            if (t3lib_div::isFirstPartOfStr($emailMessage, 'LLL:')) {
                                $emailMessage = $languageObject->sL($emailMessage);
                            }
                        }
                        $emailSubject = t3lib_parseHtml::substituteMarkerArray($emailSubject, $markers, '', TRUE, TRUE);
                        $emailMessage = t3lib_parseHtml::substituteMarkerArray($emailMessage, $markers, '', TRUE, TRUE);
                        // Send an email to the recipient
                        t3lib_div::plainMailEncoded($recipientData['email'], $emailSubject, $emailMessage, $emailHeaders);
                    }
                    $emailRecipients = implode(',', $emailRecipients);
                }
                $tcemainObj->newlog2('Notification email for stage change was sent to "' . $emailRecipients . '"', $table, $id);
            }
        }
    }
コード例 #2
0
 /**
  * Render content with htmlspecialchars
  *
  * @return string Formatted date
  * @deprecated Use Tx_Fluid_ViewHelpers_Format_HtmlspecialcharsViewHelper instead
  */
 public function render()
 {
     if (class_exists('Tx_Fluid_ViewHelpers_Format_HtmlspecialcharsViewHelper')) {
         $message = 'EXT:news: Since TYPO3 4.6.0, a native ViewHelper for htmlspecialchars() ' . 'is available, use f:format.htmlspecialchars instead of n:format.hsc';
         t3lib_div::deprecationLog($message);
     }
     return htmlspecialchars($this->renderChildren());
 }
コード例 #3
0
 /**
  * Initializes deprectated hooks that existed in t3lib_matchCondition until TYPO3 4.3.
  *
  * @return	void
  */
 protected function initializeDeprecatedHooks()
 {
     // Hook: $TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_matchcondition.php']['matchConditionClass']:
     $matchConditionHooks =& $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_matchcondition.php']['matchConditionClass'];
     if (is_array($matchConditionHooks)) {
         t3lib_div::deprecationLog('The hook $TYPO3_CONF_VARS[SC_OPTIONS][t3lib/class.t3lib_matchcondition.php][matchConditionClass] ' . 'is deprecated since TYPO3 4.3. Use the new hooks getBrowserInfo and getDeviceType in ' . 't3lib_utility_Client instead.');
         foreach ($matchConditionHooks as $hookClass) {
             $this->deprecatedHooks[] = t3lib_div::getUserObj($hookClass, '');
         }
     }
 }
コード例 #4
0
    /**
     * Proxy for the PHP mail() function. Adds possibility to hook in and send the mails in a different way.
     * The hook can be used by adding function to the configuration array:
     * $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/utility/class.t3lib_utility_mail.php']['substituteMailDelivery']
     *
     * @param	string		Email address to send to.
     * @param	string		Subject line, non-encoded. (see PHP function mail())
     * @param	string		Message content, non-encoded. (see PHP function mail())
     * @param	string		 Additional headers for the mail (see PHP function mail())
     * @param	string		Additional flags for the sending mail tool (see PHP function mail())
     * @return	boolean		Indicates whether the mail has been sent or not
     * @see		PHP function mail() []
     * @link	http://www.php.net/manual/en/function.mail.php
     */
    public static function mail($to, $subject, $messageBody, $additionalHeaders = NULL, $additionalParameters = NULL)
    {
        $success = TRUE;
        // If the mail does not have a From: header, fall back to the default in TYPO3_CONF_VARS.
        if (!preg_match('/^From:/im', $additionalHeaders) && $GLOBALS['TYPO3_CONF_VARS']['MAIL']['defaultMailFromAddress']) {
            if (!is_null($additionalHeaders) && substr($additionalHeaders, -1) != LF) {
                $additionalHeaders .= LF;
            }
            if ($GLOBALS['TYPO3_CONF_VARS']['MAIL']['defaultMailFromName']) {
                $additionalHeaders .= 'From: "' . $GLOBALS['TYPO3_CONF_VARS']['MAIL']['defaultMailFromName'] . '" <' . $GLOBALS['TYPO3_CONF_VARS']['MAIL']['defaultMailFromAddress'] . '>';
            } else {
                $additionalHeaders .= 'From: ' . $GLOBALS['TYPO3_CONF_VARS']['MAIL']['defaultMailFromAddress'];
            }
        }
        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/utility/class.t3lib_utility_mail.php']['substituteMailDelivery'])) {
            $parameters = array('to' => $to, 'subject' => $subject, 'messageBody' => $messageBody, 'additionalHeaders' => $additionalHeaders, 'additionalParameters' => $additionalParameters);
            $fakeThis = FALSE;
            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/utility/class.t3lib_utility_mail.php']['substituteMailDelivery'] as $hookSubscriber) {
                $hookSubscriberContainsArrow = strpos($hookSubscriber, '->');
                if ($hookSubscriberContainsArrow !== FALSE) {
                    // deprecated, remove in TYPO3 4.7
                    t3lib_div::deprecationLog('The usage of user function notation for the substituteMailDelivery hook is deprecated,
						use the t3lib_mail_MailerAdapter interface instead.');
                    $success = $success && t3lib_div::callUserFunction($hookSubscriber, $parameters, $fakeThis);
                } else {
                    $mailerAdapter = t3lib_div::makeInstance($hookSubscriber);
                    if ($mailerAdapter instanceof t3lib_mail_MailerAdapter) {
                        $success = $success && $mailerAdapter->mail($to, $subject, $messageBody, $additionalHeaders, $additionalParameters, $fakeThis);
                    } else {
                        throw new RuntimeException($hookSubscriber . ' is not an implementation of t3lib_mail_MailerAdapter,
							but must implement that interface to be used in the substituteMailDelivery hook.', 1294062286);
                    }
                }
            }
        } else {
            if (t3lib_utility_PhpOptions::isSafeModeEnabled() && !is_null($additionalParameters)) {
                $additionalParameters = null;
            }
            if (is_null($additionalParameters)) {
                $success = @mail($to, $subject, $messageBody, $additionalHeaders);
            } else {
                $success = @mail($to, $subject, $messageBody, $additionalHeaders, $additionalParameters);
            }
        }
        if (!$success) {
            t3lib_div::sysLog('Mail to "' . $to . '" could not be sent (Subject: "' . $subject . '").', 'Core', 3);
        }
        return $success;
    }
コード例 #5
0
 /**
  * Converts all HTML entities to their applicable characters as needed
  * using PHPs html_entity_decode() function.
  *
  * @param string $value string to format
  * @param boolean $keepQuotes if TRUE, single and double quotes won't be replaced
  * @return string the altered string
  * @see http://www.php.net/html_entity_decode
  */
 public function render($value = NULL, $keepQuotes = FALSE)
 {
     if (class_exists('Tx_Fluid_ViewHelpers_Format_HtmlentitiesDecodeViewHelper')) {
         $message = 'EXT:news: Since TYPO3 4.6.0, a native ViewHelper for html_entity_decode() ' . 'is available, use f:format.htmlentitiesDecode instead of n:format.htmlEntityDecode';
         t3lib_div::deprecationLog($message);
     }
     if ($value === NULL) {
         $value = $this->renderChildren();
     }
     if (!is_string($value)) {
         return $value;
     }
     $flags = $keepQuotes ? ENT_NOQUOTES : ENT_COMPAT;
     return html_entity_decode($value, $flags);
 }
コード例 #6
0
 *
 *
 *
 *   73: class SC_alt_menu_sel
 *   81:     function main()
 *  108:     function printContent()
 *
 * TOTAL FUNCTIONS: 2
 * (This index is automatically created/updated by the extension "extdeveval")
 *
 * @deprecated since TYPO3 4.5, this file will be removed in TYPO3 4.7. The TYPO3 backend is using typo3/backend.php with less frames, which makes this file obsolete.
 */
require 'init.php';
require 'template.php';
require_once 'class.alt_menu_functions.inc';
t3lib_div::deprecationLog('alt_menu_sel.php is deprecated since TYPO3 4.5, this file will be removed in TYPO3 4.7. The TYPO3 backend is using typo3/backend.php with less frames, which makes this file obsolete.');
/**
 * Script Class for rendering the selector box menu
 *
 * @author	Kasper Skårhøj <*****@*****.**>
 * @package TYPO3
 * @subpackage core
 */
class SC_alt_menu_sel
{
    var $content;
    /**
     * Main function, making the selector box menu
     *
     * @return	void
     */
コード例 #7
0
        }
        #debug(array($dirRTE,$value),'OUT: '.$dirRTE);
        return $value;
    }
    /***********************************
     *
     * Helper functions
     *
     **********************************/
    /**
     * Trigger field - this field tells the TCEmain that processing should be done on this value!
     *
     * @param	string		Field name of the RTE field.
     * @return	string		<input> field of type "hidden" with a flag telling the TCEmain that this fields content should be traansformed back to database state.
     */
    function triggerField($fieldName)
    {
        $triggerFieldName = preg_replace('/\\[([^]]+)\\]$/', '[_TRANSFORM_\\1]', $fieldName);
        return '<input type="hidden" name="' . htmlspecialchars($triggerFieldName) . '" value="RTE" />';
    }
}
/**
 * @deprecated since TYPO3 4.4: Use XCLASS t3lib/class.t3lib_rteapi.php instead. Will be removed in TYPO3 4.6.
 */
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rte/class.tx_rte_base.php']) {
    t3lib_div::deprecationLog('XCLASS "ext/rte/class.tx_rte_base.php" is deprecated since TYPO3 4.4 - use "t3lib/class.t3lib_rteapi.php" instead.');
    include_once $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rte/class.tx_rte_base.php'];
}
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_rteapi.php']) {
    include_once $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_rteapi.php'];
}
コード例 #8
0
 /**
  * Returns the timestamp for the value parts in $this->values.
  *
  * @deprecated since 4.5
  * @return integer unix timestamp
  */
 public function getTstamp()
 {
     t3lib_div::deprecationLog('The method is deprecated since TYPO3 version 4.5.');
     return $this->getTimestamp();
 }
コード例 #9
0
 /**
  * Allow access to other tslib_content variables.
  *
  * Provides backwards compatibility for PHP_SCRIPT which simply
  * accesses properties like $this->parameters.
  *
  * @deprecated since 4.5, will be removed in 4.7. Use $this->cObj-><property> instead.
  *
  * @param string $name The name of the property
  * @return mixed
  */
 public function __get($name)
 {
     if (array_key_exists($name, get_object_vars($this->cObj))) {
         $trail = debug_backtrace();
         $location = $trail[1]['file'] . '#' . $trail[1]['line'];
         t3lib_div::deprecationLog(sprintf('%s: PHP_SCRIPT accessed $this->%s. Modify it to access $this->cObj->%s instead. Will be removed in 4.7.', $location, $name, $name));
         return $this->cObj->{$name};
     }
 }
コード例 #10
0
 /**
  * Resolve the template path and filename for the given action. If $actionName
  * is NULL, looks into the current request.
  *
  * @param string $actionName Name of the action. If NULL, will be taken from request.
  * @return string Full path to template
  * @throws Tx_Fluid_View_Exception_InvalidTemplateResourceException
  * @author Sebastian Kurfürst <*****@*****.**>
  */
 protected function getTemplateSource($actionName = NULL)
 {
     if ($this->templatePathAndFilename !== NULL) {
         $templatePathAndFilename = $this->templatePathAndFilename;
     } else {
         $actionName = $actionName !== NULL ? $actionName : $this->controllerContext->getRequest()->getControllerActionName();
         $paths = $this->expandGenericPathPattern($this->templatePathAndFilenamePattern, FALSE, FALSE);
         $found = FALSE;
         foreach ($paths as &$templatePathAndFilename) {
             // These tokens are replaced by the Backporter for the graceful fallback in version 4.
             $fallbackPath = str_replace('@action', $actionName, $templatePathAndFilename);
             $templatePathAndFilename = str_replace('@action', ucfirst($actionName), $templatePathAndFilename);
             if (file_exists($templatePathAndFilename)) {
                 $found = TRUE;
                 // additional check for deprecated template filename for case insensitive file systems (Windows)
                 $realFileName = basename(realpath($templatePathAndFilename));
                 if ($realFileName !== ucfirst($realFileName)) {
                     t3lib_div::deprecationLog('the template filename "' . t3lib_div::fixWindowsFilePath(realpath($templatePathAndFilename)) . '" is lowercase. This is deprecated since TYPO3 4.4. Please rename the template to "' . basename($templatePathAndFilename) . '"');
                 }
                 break;
             } elseif (file_exists($fallbackPath)) {
                 t3lib_div::deprecationLog('the template filename "' . $fallbackPath . '" is lowercase. This is deprecated since TYPO3 4.4. Please rename the template to "' . basename($templatePathAndFilename) . '"');
                 $found = TRUE;
                 $templatePathAndFilename = $fallbackPath;
                 break;
             }
         }
         if (!$found) {
             throw new Tx_Fluid_View_Exception_InvalidTemplateResourceException('Template could not be loaded. I tried "' . implode('", "', $paths) . '"', 1225709595);
         }
     }
     $templateSource = file_get_contents($templatePathAndFilename);
     if ($templateSource === FALSE) {
         throw new Tx_Fluid_View_Exception_InvalidTemplateResourceException('"' . $templatePathAndFilename . '" is not a valid template resource URI.', 1257246929);
     }
     return $templateSource;
 }
コード例 #11
0
 /**
  * This method stores the imported data in the database
  * New data is inserted, existing data is updated and absent data is deleted
  *
  * @param	array		$records: records containing the data
  * @return	void
  */
 protected function storeData($records)
 {
     if ($this->extConf['debug'] || TYPO3_DLOG) {
         t3lib_div::devLog('Data received for storage', $this->extKey, 0, $records);
     }
     // Initialize some variables
     $fieldsExcludedFromInserts = array();
     $fieldsExcludedFromUpdates = array();
     // Get the list of existing uids for the table
     $existingUids = $this->getExistingUids();
     // Check which columns are MM-relations and get mappings to foreign tables for each
     // NOTE: as it is now, it is assumed that the imported data is denormalised
     //
     // NOTE2:	as long as we're looping on all columns, we assemble the list
     //			of fields that are excluded from insert or update operations
     //
     // There's more to do than that:
     //
     // 1.	a sorting field may have been defined, but TCEmain assumes the MM-relations are in the right order
     //		and inserts its own number for the table's sorting field. So MM-relations must be sorted before executing TCEmain.
     // 2.a	it is possible to store additional fields in the MM-relations. This is not TYPO3-standard, so TCEmain will
     //		not be able to handle it. We thus need to store all that data now and rework the MM-relations when TCEmain is done.
     // 2.b	if a pair of records is related to each other several times (because the additional fields vary), this will be filtered out
     //		by TCEmain. So we must preserve also these additional relations.
     $mappings = array();
     $fullMappings = array();
     foreach ($this->tableTCA['columns'] as $columnName => $columnData) {
         // Check if some fields are excluded from some operations
         // and add them to the relevant list
         if (isset($columnData['external'][$this->columnIndex]['disabledOperations'])) {
             if (t3lib_div::inList($columnData['external'][$this->columnIndex]['disabledOperations'], 'insert')) {
                 $fieldsExcludedFromInserts[] = $columnName;
             }
             if (t3lib_div::inList($columnData['external'][$this->columnIndex]['disabledOperations'], 'update')) {
                 $fieldsExcludedFromUpdates[] = $columnName;
             }
         }
         // The "excludedOperations" property is deprecated and replaced by "disabledOperations"
         // It is currently kept for backwards-compatibility reasons
         // TODO: remove in next major version
         if (isset($columnData['external'][$this->columnIndex]['excludedOperations'])) {
             $deprecationMessage = 'Property "excludedOperations" has been deprecated. Please use "disabledOperations" instead.';
             $deprecationMessage .= LF . 'Support for "excludedOperations" will be removed in external_import version 3.0.';
             t3lib_div::deprecationLog($deprecationMessage);
             if (t3lib_div::inList($columnData['external'][$this->columnIndex]['excludedOperations'], 'insert')) {
                 $fieldsExcludedFromInserts[] = $columnName;
             }
             if (t3lib_div::inList($columnData['external'][$this->columnIndex]['excludedOperations'], 'update')) {
                 $fieldsExcludedFromUpdates[] = $columnName;
             }
         }
         // Process MM-relations, if any
         if (isset($columnData['external'][$this->columnIndex]['MM'])) {
             $mmData = $columnData['external'][$this->columnIndex]['MM'];
             $sortingField = isset($mmData['sorting']) ? $mmData['sorting'] : FALSE;
             $additionalFields = isset($mmData['additional_fields']) ? $mmData['additional_fields'] : FALSE;
             $mappings[$columnName] = array();
             if ($additionalFields || $mmData['multiple']) {
                 $fullMappings[$columnName] = array();
             }
             // Get foreign mapping for column
             // TODO: remove in next major version
             if (isset($mmData['mappings']['uid_foreign'])) {
                 $deprecationMessage = 'Property "mappings.uid_foreign" has been deprecated. Please use "mapping" instead.';
                 $deprecationMessage .= LF . 'Support for "mappings.uid_foreign" will be removed in external_import version 3.0.';
                 t3lib_div::deprecationLog($deprecationMessage);
                 $mappingInformation = $mmData['mappings']['uid_foreign'];
             } else {
                 $mappingInformation = $mmData['mapping'];
             }
             $foreignMappings = $this->getMapping($mappingInformation);
             // Go through each record and assemble pairs of primary and foreign keys
             foreach ($records as $theRecord) {
                 $externalUid = $theRecord[$this->externalConfig['reference_uid']];
                 // Make sure not to keep the value from the previous iteration
                 unset($foreignValue);
                 // Get foreign value
                 // First try the "soft" matching method to mapping table
                 if (!empty($mmData['mapping']['match_method'])) {
                     if ($mmData['mapping']['match_method'] == 'strpos' || $mmData['mapping']['match_method'] == 'stripos') {
                         // Try matching the value. If matching fails, unset it.
                         try {
                             $foreignValue = $this->matchSingleField($theRecord[$columnName], $mmData['mapping'], $foreignMappings);
                         } catch (Exception $e) {
                             // Nothing to do, foreign value must stay "unset"
                         }
                     }
                     // Then the "strict" matching method to mapping table
                 } elseif (isset($foreignMappings[$theRecord[$columnName]])) {
                     $foreignValue = $foreignMappings[$theRecord[$columnName]];
                 }
                 // If a value was found, use it
                 if (isset($foreignValue)) {
                     if (!isset($mappings[$columnName][$externalUid])) {
                         $mappings[$columnName][$externalUid] = array();
                         // Initialise only if necessary
                         if ($additionalFields || $mmData['multiple']) {
                             $fullMappings[$columnName][$externalUid] = array();
                         }
                     }
                     // If additional fields are defined, store those values in an intermediate array
                     $fields = array();
                     if ($additionalFields) {
                         foreach ($mmData['additional_fields'] as $localFieldName => $externalFieldName) {
                             $fields[$localFieldName] = $theRecord[$externalFieldName];
                         }
                     }
                     // If a sorting field is defined, use that value for indexing, otherwise just add the element at the end of the array
                     if ($sortingField) {
                         $sortingValue = $theRecord[$sortingField];
                         $mappings[$columnName][$externalUid][$sortingValue] = $foreignValue;
                         if ($additionalFields || $mmData['multiple']) {
                             $fullMappings[$columnName][$externalUid][$sortingValue] = array('value' => $foreignValue, 'additional_fields' => $fields);
                         }
                     } else {
                         $mappings[$columnName][$externalUid][] = $foreignValue;
                         if ($additionalFields || $mmData['multiple']) {
                             $fullMappings[$columnName][$externalUid][] = array('value' => $foreignValue, 'additional_fields' => $fields);
                         }
                     }
                 }
             }
             // If there was some special sorting to do, do it now
             if ($sortingField) {
                 foreach ($mappings as $innerColumnName => $columnMappings) {
                     foreach ($columnMappings as $uid => $values) {
                         ksort($values);
                         $mappings[$innerColumnName][$uid] = $values;
                         // Do the same for extended MM-relations, if necessary
                         if ($additionalFields || $mmData['multiple']) {
                             $fullValues = $fullMappings[$innerColumnName][$uid];
                             ksort($fullValues);
                             $fullMappings[$innerColumnName][$uid] = $fullValues;
                         }
                     }
                 }
             }
         }
     }
     $hasMMRelations = count($mappings);
     // Insert or update records depending on existing uids
     $updates = 0;
     $updatedUids = array();
     $handledUids = array();
     $tceData = array($this->table => array());
     $savedAdditionalFields = array();
     foreach ($records as $theRecord) {
         $localAdditionalFields = array();
         $externalUid = $theRecord[$this->externalConfig['reference_uid']];
         // Skip handling of already handled records (this can happen with denormalized structures)
         // NOTE: using isset() on index instead of in_array() offers far better performance
         if (isset($handledUids[$externalUid])) {
             continue;
         }
         $handledUids[$externalUid] = $externalUid;
         // Prepare MM-fields, if any
         if ($hasMMRelations) {
             foreach ($mappings as $columnName => $columnMappings) {
                 if (isset($columnMappings[$externalUid])) {
                     $theRecord[$columnName] = implode(',', $columnMappings[$externalUid]);
                     // Make sure not to keep the original value if no mapping was found
                 } else {
                     unset($theRecord[$columnName]);
                 }
             }
         }
         // Remove additional fields data, if any. They must not be saved to database
         // They are saved locally however, for later use
         if ($this->numAdditionalFields > 0) {
             foreach ($this->additionalFields as $fieldName) {
                 $localAdditionalFields[$fieldName] = $theRecord[$fieldName];
                 unset($theRecord[$fieldName]);
             }
         }
         $theID = '';
         // Reference uid is found, perform an update (if not disabled)
         if (isset($existingUids[$externalUid])) {
             if (!t3lib_div::inList($this->externalConfig['disabledOperations'], 'update')) {
                 // First call a pre-processing hook
                 if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey]['updatePreProcess'])) {
                     foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey]['updatePreProcess'] as $className) {
                         $preProcessor =& t3lib_div::getUserObj($className);
                         $theRecord = $preProcessor->processBeforeUpdate($theRecord, $this);
                     }
                 }
                 // Remove the fields which must be excluded from updates
                 if (count($fieldsExcludedFromUpdates) > 0) {
                     foreach ($fieldsExcludedFromUpdates as $excludedField) {
                         unset($theRecord[$excludedField]);
                     }
                 }
                 $theID = $existingUids[$externalUid];
                 $tceData[$this->table][$theID] = $theRecord;
                 $updatedUids[] = $theID;
                 $updates++;
             }
             // Reference uid not found, perform an insert (if not disabled)
         } elseif (!t3lib_div::inList($this->externalConfig['disabledOperations'], 'insert')) {
             // First call a pre-processing hook
             if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey]['insertPreProcess'])) {
                 foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey]['insertPreProcess'] as $className) {
                     $preProcessor =& t3lib_div::getUserObj($className);
                     $theRecord = $preProcessor->processBeforeInsert($theRecord, $this);
                 }
             }
             // Remove the fields which must be excluded from inserts
             if (count($fieldsExcludedFromInserts) > 0) {
                 foreach ($fieldsExcludedFromInserts as $excludedField) {
                     unset($theRecord[$excludedField]);
                 }
             }
             // Make sure the record has a pid, but avoid overwriting an existing one
             // (for example, when external data is imported into the pages table)
             if (!isset($theRecord['pid'])) {
                 $theRecord['pid'] = $this->pid;
             }
             // If a temporary key was already defined, use it, otherwise create a new one.
             // Temporary keys may exist if self-referential mapping was handled beforehand (see mapData())
             if (isset($this->temporaryKeys[$externalUid])) {
                 $theID = $this->temporaryKeys[$externalUid];
             } else {
                 $this->newKeysCounter++;
                 $theID = 'NEW_' . $this->newKeysCounter;
             }
             $tceData[$this->table][$theID] = $theRecord;
         }
         // Store local additional fields into general additional fields array
         // keyed to proper id's (if the record was processed)
         if (!empty($theID)) {
             $savedAdditionalFields[$theID] = $localAdditionalFields;
         }
     }
     if ($this->extConf['debug'] || TYPO3_DLOG) {
         t3lib_div::devLog('TCEmain data', $this->extKey, 0, $tceData);
     }
     // Create an instance of TCEmain and process the data
     /** @var $tce t3lib_TCEmain */
     $tce = t3lib_div::makeInstance('t3lib_TCEmain');
     $tce->stripslashes_values = 0;
     // Check if TCEmain logging should be turned on or off
     $disableLogging = empty($this->extConf['disableLog']) ? FALSE : TRUE;
     if (isset($this->externalConfig['disableLog'])) {
         $disableLogging = empty($this->externalConfig['disableLog']) ? FALSE : TRUE;
     }
     $tce->enableLogging = !$disableLogging;
     // If the table has a sorting field, reverse the data array,
     // otherwise the first record will come last (because TCEmain
     // itself inverts the incoming order)
     if (!empty($this->tableTCA['ctrl']['sortby'])) {
         $tce->reverseOrder = TRUE;
     }
     // Load the data and process it
     $tce->start($tceData, array());
     $tce->process_datamap();
     if ($this->extConf['debug'] || TYPO3_DLOG) {
         t3lib_div::devLog('New IDs', 'external_import', 0, $tce->substNEWwithIDs);
     }
     // Store the number of new IDs created. This is used in error reporting later
     $numberOfNewIDs = count($tce->substNEWwithIDs);
     // Post-processing hook after data was saved
     $savedData = array();
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey]['datamapPostProcess'])) {
         foreach ($tceData as $tableRecords) {
             foreach ($tableRecords as $id => $record) {
                 // Added status to record
                 // If operation was insert, match placeholder to actual id
                 $uid = $id;
                 if (isset($tce->substNEWwithIDs[$id])) {
                     $uid = $tce->substNEWwithIDs[$id];
                     $record['tx_externalimport:status'] = 'insert';
                 } else {
                     $record['tx_externalimport:status'] = 'update';
                 }
                 // Restore additional fields, if any
                 if ($this->numAdditionalFields > 0) {
                     foreach ($savedAdditionalFields[$id] as $fieldName => $fieldValue) {
                         $record[$fieldName] = $fieldValue;
                     }
                 }
                 $savedData[$uid] = $record;
             }
         }
         foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey]['datamapPostProcess'] as $className) {
             $postProcessor =& t3lib_div::getUserObj($className);
             $postProcessor->datamapPostProcess($this->table, $savedData, $this);
         }
     }
     // Clean up
     unset($tceData);
     unset($savedData);
     // Mark as deleted records with existing uids that were not in the import data anymore
     // (if automatic delete is activated)
     if (t3lib_div::inList($this->externalConfig['disabledOperations'], 'delete') || isset($this->externalConfig['deleteNonSynchedRecords']) && $this->externalConfig['deleteNonSynchedRecords'] === FALSE) {
         $deletes = 0;
     } else {
         $absentUids = array_diff($existingUids, $updatedUids);
         // Call a pre-processing hook
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey]['deletePreProcess'])) {
             foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey]['deletePreProcess'] as $className) {
                 $preProcessor =& t3lib_div::getUserObj($className);
                 $absentUids = $preProcessor->processBeforeDelete($this->table, $absentUids, $this);
             }
         }
         $deletes = count($absentUids);
         if ($deletes > 0) {
             $tceCommands = array($this->table => array());
             foreach ($absentUids as $id) {
                 $tceCommands[$this->table][$id] = array('delete' => 1);
             }
             if ($this->extConf['debug'] || TYPO3_DLOG) {
                 t3lib_div::devLog('TCEmain commands', $this->extKey, 0, $tceCommands);
             }
             $tce->start(array(), $tceCommands);
             $tce->process_cmdmap();
             // Call a post-processing hook
             if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey]['cmdmapPostProcess'])) {
                 foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey]['cmdmapPostProcess'] as $className) {
                     $postProcessor =& t3lib_div::getUserObj($className);
                     $absentUids = $postProcessor->cmdmapPostProcess($this->table, $absentUids, $this);
                 }
             }
         }
     }
     // Perform post-processing of MM-relations if necessary
     if (count($fullMappings) > 0) {
         $this->postProcessMmRelations($fullMappings);
     }
     // Check if there were any errors reported by TCEmain
     if (count($tce->errorLog) > 0) {
         // If yes, get these messages from the sys_log table
         $where = "tablename = '" . $this->table . "' AND error > '0'";
         $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_log', $where, '', 'tstamp DESC', count($tce->errorLog));
         if ($res) {
             while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                 // Check if there's a label for the message
                 $labelCode = 'msg_' . $row['type'] . '_' . $row['action'] . '_' . $row['details_nr'];
                 $label = $GLOBALS['LANG']->sL('LLL:EXT:belog/mod/locallang.xml:' . $labelCode);
                 // If not, use details field
                 if (empty($label)) {
                     $label = $row['details'];
                 }
                 // Substitute the first 5 items of extra data into the error message
                 $message = $label;
                 if (!empty($row['log_data'])) {
                     $data = unserialize($row['log_data']);
                     $message = sprintf($label, htmlspecialchars($data[0]), htmlspecialchars($data[1]), htmlspecialchars($data[2]), htmlspecialchars($data[3]), htmlspecialchars($data[4]));
                 }
                 $this->messages[t3lib_FlashMessage::ERROR][] = $message;
                 if ($this->extConf['debug'] || TYPO3_DLOG) {
                     t3lib_div::devLog($message, $this->extKey, 3);
                 }
             }
             $GLOBALS['TYPO3_DB']->sql_free_result($res);
         }
         // Substract the number of new IDs from the number of inserts,
         // to get a realistic number of new records
         $inserts = $this->newKeysCounter + ($numberOfNewIDs - $this->newKeysCounter);
         // Add a warning that numbers reported (below) may not be accurate
         $this->messages[t3lib_FlashMessage::WARNING][] = $GLOBALS['LANG']->getLL('things_happened');
     } else {
         $inserts = $numberOfNewIDs;
     }
     unset($tce);
     // Set informational messages
     $this->messages[t3lib_FlashMessage::OK][] = sprintf($GLOBALS['LANG']->getLL('records_inserted'), $inserts);
     $this->messages[t3lib_FlashMessage::OK][] = sprintf($GLOBALS['LANG']->getLL('records_updated'), $updates);
     $this->messages[t3lib_FlashMessage::OK][] = sprintf($GLOBALS['LANG']->getLL('records_deleted'), $deletes);
 }
コード例 #12
0
 /**
  * Constructor
  *
  * @author Bastian Waidelich <*****@*****.**>
  */
 public function __construct()
 {
     t3lib_div::deprecationLog('the ViewHelper "' . get_class($this) . '" extends "Tx_Fluid_Core_ViewHelper_TagBasedViewHelper". This is deprecated since TYPO3 4.5. Please extend the class "Tx_Fluid_Core_ViewHelper_AbstractTagBasedViewHelper"');
     parent::__construct();
 }
コード例 #13
0
 /**
  * Evaluates if auto creation of a version of a record is allowed.
  *
  * @param string $table Table of the record
  * @param integer $id UID of record
  * @param integer $recpid PID of record
  * @return boolean TRUE if ok.
  * @todo Define visibility
  */
 public function workspaceAllowAutoCreation($table, $id, $recpid)
 {
     // Auto-creation of version: In offline workspace, test if versioning is
     // enabled and look for workspace version of input record.
     // If there is no versionized record found we will create one and save to that.
     if ($this->workspace !== 0 && !$this->workspaceRec['disable_autocreate'] && $GLOBALS['TCA'][$table]['ctrl']['versioningWS'] && $recpid >= 0 && !t3lib_BEfunc::getWorkspaceVersionOfRecord($this->workspace, $table, $id, 'uid')) {
         // There must be no existing version of this record in workspace.
         return TRUE;
     } elseif ($this->workspaceRec['disable_autocreate']) {
         t3lib_div::deprecationLog('Usage of disable_autocreate feature is deprecated since 4.5.');
     }
 }
コード例 #14
0
ファイル: backend.php プロジェクト: NaveedWebdeveloper/Test
    /**
     * Checking if the "&edit" variable was sent so we can open it for editing the page.
     * Code based on code from "alt_shortcut.php"
     *
     * @return	void
     */
    protected function handlePageEditing()
    {
        if (!t3lib_extMgm::isLoaded('cms')) {
            return;
        }
        // EDIT page:
        $editId = preg_replace('/[^[:alnum:]_]/', '', t3lib_div::_GET('edit'));
        $editRecord = '';
        if ($editId) {
            // Looking up the page to edit, checking permissions:
            $where = ' AND (' . $GLOBALS['BE_USER']->getPagePermsClause(2) . ' OR ' . $GLOBALS['BE_USER']->getPagePermsClause(16) . ')';
            if (t3lib_div::testInt($editId)) {
                $editRecord = t3lib_BEfunc::getRecordWSOL('pages', $editId, '*', $where);
            } else {
                $records = t3lib_BEfunc::getRecordsByField('pages', 'alias', $editId, $where);
                if (is_array($records)) {
                    reset($records);
                    $editRecord = current($records);
                    t3lib_BEfunc::workspaceOL('pages', $editRecord);
                }
            }
            // If the page was accessible, then let the user edit it.
            if (is_array($editRecord) && $GLOBALS['BE_USER']->isInWebMount($editRecord['uid'])) {
                // Setting JS code to open editing:
                $this->js .= '
		// Load page to edit:
	window.setTimeout("top.loadEditId(' . intval($editRecord['uid']) . ');", 500);
			';
                // "Shortcuts" have been renamed to "Bookmarks"
                // @deprecated remove shortcuts code in TYPO3 4.7
                $shortcutSetPageTree = $GLOBALS['BE_USER']->getTSConfigVal('options.shortcut_onEditId_dontSetPageTree');
                $bookmarkSetPageTree = $GLOBALS['BE_USER']->getTSConfigVal('options.bookmark_onEditId_dontSetPageTree');
                if ($shortcutSetPageTree !== '') {
                    t3lib_div::deprecationLog('options.shortcut_onEditId_dontSetPageTree - since TYPO3 4.5, will be removed in TYPO3 4.7 - use options.bookmark_onEditId_dontSetPageTree instead');
                }
                // Checking page edit parameter:
                if (!$shortcutSetPageTree && !$bookmarkSetPageTree) {
                    $shortcutKeepExpanded = $GLOBALS['BE_USER']->getTSConfigVal('options.shortcut_onEditId_keepExistingExpanded');
                    $bookmarkKeepExpanded = $GLOBALS['BE_USER']->getTSConfigVal('options.bookmark_onEditId_keepExistingExpanded');
                    $keepExpanded = $shortcutKeepExpanded || $bookmarkKeepExpanded;
                    // Expanding page tree:
                    t3lib_BEfunc::openPageTree(intval($editRecord['pid']), !$keepExpanded);
                    if ($shortcutKeepExpanded) {
                        t3lib_div::deprecationLog('options.shortcut_onEditId_keepExistingExpanded - since TYPO3 4.5, will be removed in TYPO3 4.7 - use options.bookmark_onEditId_keepExistingExpanded instead');
                    }
                }
            } else {
                $this->js .= '
		// Warning about page editing:
	alert(' . $GLOBALS['LANG']->JScharCode(sprintf($GLOBALS['LANG']->getLL('noEditPage'), $editId)) . ');
			';
            }
        }
    }
コード例 #15
0
ファイル: db_list.php プロジェクト: NaveedWebdeveloper/Test
*  The GNU General Public License can be found at
*  http://www.gnu.org/copyleft/gpl.html.
*  A copy is found in the textfile GPL.txt and important notices to the license
*  from the author is found in LICENSE.txt distributed with these scripts.
*
*
*  This script is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
 * This is a wrapper file for direct calls to list module.
 * It's deprecated since 4.5, use proper link generation.
 *
 * @author	Steffen Kamper <*****@*****.**>
 * @deprecated
 *
 */
require 'init.php';
$query = t3lib_div::getIndpEnv('QUERY_STRING');
t3lib_div::deprecationLog('The list module is a system extension now, do not link to this file.' . LF . 'Referer: ' . t3lib_div::getIndpEnv('HTTP_REFERER'));
if (t3lib_extMgm::isLoaded('recordlist')) {
    t3lib_utility_Http::redirect(t3lib_BEfunc::getModuleUrl('web_list', array(), '', TRUE) . '&' . $query);
} else {
    $title = sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:extension.not.installed'), 'list');
    $message = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:link.to.dblist.correctly');
    throw new RuntimeException($title . ': ' . $message);
}
コード例 #16
0
 /**
  * Constrcutor
  */
 function __construct()
 {
     t3lib_div::deprecationLog("Class t3lib_sqlengine_resultobj is deprecated since TYPO3 4.3, will be removed in TYPO3 4.6, it has been integrated to extension DBAL.");
 }
コード例 #17
0
 /**
  * Resolve the template path and filename for the given action. If $actionName
  * is NULL, looks into the current request.
  *
  * @param string $actionName Name of the action. If NULL, will be taken from request.
  * @return string Full path to template
  * @throws Tx_Fluid_View_Exception_InvalidTemplateResourceException
  * @author Sebastian Kurfürst <*****@*****.**>
  */
 protected function resolveTemplatePathAndFilename($actionName = NULL)
 {
     if ($this->templatePathAndFilename !== NULL) {
         return $this->templatePathAndFilename;
     }
     $actionName = $actionName !== NULL ? $actionName : $this->controllerContext->getRequest()->getControllerActionName();
     $actionName = ucfirst($actionName);
     $paths = $this->expandGenericPathPattern($this->templatePathAndFilenamePattern, FALSE, FALSE);
     foreach ($paths as &$path) {
         // TODO remove fallback to lower case template files after grace period
         $fallbackPath = str_replace('@action', strtolower($actionName), $path);
         $path = str_replace('@action', $actionName, $path);
         if (file_exists($path)) {
             return $path;
         } else {
             if (file_exists($fallbackPath)) {
                 t3lib_div::deprecationLog('the template filename "' . $fallbackPath . '" is lowercase. This is deprecated since TYPO3 4.4. Please rename the template to "' . basename($path) . '"');
                 return $fallbackPath;
             }
         }
     }
     throw new Tx_Fluid_View_Exception_InvalidTemplateResourceException('Template could not be loaded. I tried "' . implode('", "', $paths) . '"', 1225709595);
 }
コード例 #18
0
}
// If this value is -1 then the setting has not been modified in localconf.php
if ($TYPO3_CONF_VARS['SYS']['setDBinit'] == '-1' && $typo_db) {
    if (t3lib_div::compat_version('4.5')) {
        // 1) no option was set in localconf.php but the Update Wizard
        //    was already used, so the admin is knowing what he's doing,
        // 2) a new installation with the new default value
        $TYPO3_CONF_VARS['SYS']['setDBinit'] = 'SET NAMES utf8';
    } elseif (TYPO3_enterInstallScript !== '1' && $typo_db) {
        // The value needs to be set in localconf.php
        die('This installation was just upgraded to TYPO3 ' . TYPO3_branch . '. In this version, some default settings have changed.<br />' . 'You can continue to use your settings by specifying the former default values in localconf.php.<br />' . 'Please proceed to the Update Wizard in the TYPO3 Install Tool to update your configuration.');
    }
    // Only accept "SET NAMES utf8" for this setting. Otherwise, a deprecation warning will be issued.
} elseif (!preg_match('/SET NAMES utf8/', $TYPO3_CONF_VARS['SYS']['setDBinit']) && $typo_db) {
    // TODO: Add a link to a website with more information here
    t3lib_div::deprecationLog('This TYPO3 installation is using the $TYPO3_CONF_VARS[\'SYS\'][\'setDBinit\'] property with the following value:' . chr(10) . $TYPO3_CONF_VARS['SYS']['setDBinit'] . chr(10) . chr(10) . 'It looks like UTF-8 is not used for this connection.' . chr(10) . chr(10) . 'Everything other than UTF-8 is deprecated since TYPO3 4.5.' . chr(10) . 'The DB, its connection and TYPO3 should be migrated to UTF-8 therefore. Please check your setup.');
}
$timeZone = $GLOBALS['TYPO3_CONF_VARS']['phpTimeZone'];
if (empty($timeZone)) {
    // time zone from the server environment (TZ env or OS query)
    $defaultTimeZone = @date_default_timezone_get();
    if ($defaultTimeZone !== '') {
        $timeZone = $defaultTimeZone;
    } else {
        $timeZone = 'UTC';
    }
}
// sets the default to avoid E_WARNINGs under PHP 5.3
date_default_timezone_set($timeZone);
// Defining the database setup as constants
define('TYPO3_db', $typo_db);
コード例 #19
0
 /**
  * Logs access to deprecated TypoScript objects and properties.
  * Dumps message to the TypoScript message log (admin panel) and the TYPO3 deprecation log.
  *
  * @param	string		Message string
  * @return	void
  * @see t3lib_div::deprecationLog(), t3lib_timeTrack::setTSlogMessage()
  */
 function logDeprecatedTyposcript($msg)
 {
     $GLOBALS['TT']->setTSlogMessage($msg . ' is deprecated.', 2);
     t3lib_div::deprecationLog('TypoScript ' . $msg);
 }
コード例 #20
0
 /**
  * If "editPage" value is sent to script and it points to an accessible page, the internal var $this->theEditRec is set to the page record which should be loaded.
  * Returns void
  *
  * @return	void
  */
 function editPageIdFunc()
 {
     global $BE_USER, $LANG;
     if (!t3lib_extMgm::isLoaded('cms')) {
         return;
     }
     // EDIT page:
     $this->editPage = trim($LANG->csConvObj->conv_case($LANG->charSet, $this->editPage, 'toLower'));
     $this->editError = '';
     $this->theEditRec = '';
     $this->searchFor = '';
     if ($this->editPage) {
         // First, test alternative value consisting of [table]:[uid] and if not found, proceed with traditional page ID resolve:
         $this->alternativeTableUid = explode(':', $this->editPage);
         if (!(count($this->alternativeTableUid) == 2 && $BE_USER->isAdmin())) {
             // We restrict it to admins only just because I'm not really sure if alt_doc.php properly checks permissions of passed records for editing. If alt_doc.php does that, then we can remove this.
             $where = ' AND (' . $BE_USER->getPagePermsClause(2) . ' OR ' . $BE_USER->getPagePermsClause(16) . ')';
             if (t3lib_div::testInt($this->editPage)) {
                 $this->theEditRec = t3lib_BEfunc::getRecordWSOL('pages', $this->editPage, '*', $where);
             } else {
                 $records = t3lib_BEfunc::getRecordsByField('pages', 'alias', $this->editPage, $where);
                 if (is_array($records)) {
                     reset($records);
                     $this->theEditRec = current($records);
                     t3lib_BEfunc::workspaceOL('pages', $this->theEditRec);
                 }
             }
             if (!is_array($this->theEditRec)) {
                 unset($this->theEditRec);
                 $this->searchFor = $this->editPage;
             } elseif (!$BE_USER->isInWebMount($this->theEditRec['uid'])) {
                 unset($this->theEditRec);
                 $this->editError = $LANG->getLL('bookmark_notEditable');
             } else {
                 // Visual path set:
                 $perms_clause = $BE_USER->getPagePermsClause(1);
                 $this->editPath = t3lib_BEfunc::getRecordPath($this->theEditRec['pid'], $perms_clause, 30);
                 // "Shortcuts" have been renamed to "Bookmarks"
                 // @deprecated remove shortcuts code in TYPO3 4.7
                 $shortcutSetPageTree = !$BE_USER->getTSConfigVal('options.shortcut_onEditId_dontSetPageTree');
                 $bookmarkSetPageTree = !$BE_USER->getTSConfigVal('options.bookmark_onEditId_dontSetPageTree');
                 if ($shortcutSetPageTree && $bookmarkSetPageTree) {
                     $shortcutKeepExpanded = $BE_USER->getTSConfigVal('options.shortcut_onEditId_keepExistingExpanded');
                     $bookmarkKeepExpanded = $BE_USER->getTSConfigVal('options.bookmark_onEditId_keepExistingExpanded');
                     $keepNotExpanded = !$shortcutKeepExpanded || !$bookmarkKeepExpanded;
                     // Expanding page tree:
                     t3lib_BEfunc::openPageTree($this->theEditRec['pid'], $keepNotExpanded);
                     if ($shortcutSetPageTree) {
                         t3lib_div::deprecationLog('options.shortcut_onEditId_dontSetPageTree - since TYPO3 4.5, will be removed in TYPO3 4.7 - use options.bookmark_onEditId_dontSetPageTree instead');
                     }
                     if ($shortcutKeepExpanded) {
                         t3lib_div::deprecationLog('options.shortcut_onEditId_keepExistingExpanded - since TYPO3 4.5, will be removed in TYPO3 4.7 - use options.bookmark_onEditId_keepExistingExpanded instead');
                     }
                 }
             }
         }
     }
 }
コード例 #21
0
 /**
  * Determine whether there's an according session record to a given session_id
  * in the database. Don't care if session record is still valid or not.
  *
  * This calls the parent function but additionally tries to look up the session ID in the "fe_session_data" table.
  *
  * @param	integer		Claimed Session ID
  * @return	boolean		Returns true if a corresponding session was found in the database
  */
 function isExistingSessionRecord($id)
 {
     // Perform check in parent function
     $count = parent::isExistingSessionRecord($id);
     // Check if there are any fe_session_data records for the session ID the client claims to have
     if ($count == false) {
         $statement = $GLOBALS['TYPO3_DB']->prepare_SELECTquery('content', 'fe_session_data', 'hash = :hash');
         $res = $statement->execute(array(':hash' => $id));
         if ($res !== FALSE) {
             if ($sesDataRow = $statement->fetch()) {
                 $count = true;
                 $this->sesData = unserialize($sesDataRow['content']);
             }
             $statement->free();
         }
     }
     // @deprecated: Check for commerce basket records. The following lines should be removed once a fixed commerce version is released.
     // Extensions like commerce which have their own session table should just put some small bit of data into fe_session_data using $GLOBALS['TSFE']->fe_user->setKey('ses', ...) to make the session stable.
     if ($count == false && t3lib_extMgm::isLoaded('commerce')) {
         t3lib_div::deprecationLog("EXT:commerce specific code in tslib_feuserauth::isExistingSessionRecord() is deprecated. Will be removed in 4.6");
         $dbres = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tx_commerce_baskets', 'sid=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($id, 'tx_commerce_baskets'));
         if ($dbres !== false) {
             if ($sesDataRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($dbres)) {
                 $count = true;
             }
             $GLOBALS['TYPO3_DB']->sql_free_result($dbres);
         }
     }
     return $count;
 }
コード例 #22
0
 /**
  * Evaluates if auto creation of a version of a record is allowed.
  *
  * @param	string		Table of the record
  * @param	integer		UID of record
  * @param	integer		PID of record
  * @return	boolean		TRUE if ok.
  */
 function workspaceAllowAutoCreation($table, $id, $recpid)
 {
     // Auto-creation of version: In offline workspace, test if versioning is enabled and look for workspace version of input record. If there is no versionized record found we will create one and save to that.
     if ($this->workspace !== 0 && !$this->workspaceRec['disable_autocreate'] && $GLOBALS['TCA'][$table]['ctrl']['versioningWS'] && $recpid >= 0 && !t3lib_BEfunc::getWorkspaceVersionOfRecord($this->workspace, $table, $id, 'uid') && !t3lib_BEfunc::isPidInVersionizedBranch($recpid, $table)) {
         // PID must NOT be in a versionized branch either
         return TRUE;
     } else {
         if ($this->workspaceRec['disable_autocreate']) {
             t3lib_div::deprecationLog('Usage of disable_autocreate feature is deprecated since 4.5.');
         }
     }
 }
コード例 #23
0
 /**
  * Recode string
  * Used with text strings for fonts when languages has other character sets.
  *
  * @param	string		The text to recode
  * @return	string		The recoded string. Should be UTF-8 output. MAY contain entities (eg. &#123; or &#quot; which should render as real chars).
  */
 function recodeString($string)
 {
     // Recode string to UTF-8 from $this->nativeCharset:
     if ($this->nativeCharset && $this->nativeCharset != 'utf-8') {
         $string = $this->csConvObj->utf8_encode($string, $this->nativeCharset);
         // Convert to UTF-8
     }
     // Recode string accoding to TTFLocaleConv. Deprecated.
     if ($this->TTFLocaleConv) {
         t3lib_div::deprecationLog('The option $TYPO3_CONF_VARS[\'GFX\'][\'TTFLocaleConv\'] is in use, but deprecated since TYPO3 3.6, will be removed in TYPO3 4.6. Make sure to unset this variable in your typo3conf/localconf.php and use a different way to encode your string.');
         list($from, $to) = t3lib_div::trimExplode('..', $this->TTFLocaleConv, TRUE);
         $string = $this->csConvObj->conv($string, $from, $to);
     }
     return $string;
 }
コード例 #24
0
 /**
  * Backwards compatibility methods, log usage to deprecation log.
  * Will be removed in 4.7
  *
  * @return void
  */
 private function compatibilityCalls()
 {
     // Fallback for $TYPE_ICONS "contains-module" icons
     foreach ((array) $GLOBALS['ICON_TYPES'] as $module => $icon) {
         $iconFile = $icon['icon'];
         t3lib_div::deprecationLog('Usage of $ICON_TYPES is deprecated since 4.4.' . LF . 'The extTables.php entry $ICON_TYPES[\'' . $module . '\'] = \'' . $iconFile . '\'; should be replaced with' . LF . 't3lib_SpriteManager::addTcaTypeIcon(\'pages\', \'contains-' . $module . '\', \'' . $iconFile . '\');' . LF . 'instead.');
         t3lib_SpriteManager::addTcaTypeIcon('pages', 'contains-' . $module, $iconFile);
     }
     // Fallback for $PAGE_TYPES icons
     foreach ((array) $GLOBALS['PAGES_TYPES'] as $type => $icon) {
         if (isset($icon['icon'])) {
             $iconFile = $icon['icon'];
             t3lib_div::deprecationLog('Usage of $PAGES_TYPES[\'icon\'] is deprecated since 4.4.' . LF . 'The extTables.php entry $PAGE_TYPES[\'' . $type . '\'][\'icon\'] = \'' . $iconFile . '\'; should be replaced with' . LF . 't3lib_SpriteManager::addTcaTypeIcon(\'pages\', \'' . $type . '\', \'' . $iconFile . '\');' . LF . 'instead.');
             t3lib_SpriteManager::addTcaTypeIcon('pages', $module, $iconFile);
         }
     }
 }
コード例 #25
0
 /**
  * gets the available shortcut groups from default gropups, user TSConfig,
  * and global groups
  *
  * @param	array		array of parameters from the AJAX interface, currently unused
  * @param	TYPO3AJAX	object of type TYPO3AJAX
  * @return	array
  */
 protected function initShortcutGroups($params = array(), TYPO3AJAX &$ajaxObj = null)
 {
     // groups from TSConfig
     // "Shortcuts" have been renamed to "Bookmarks"
     // @deprecated remove shortcuts code in TYPO3 4.7
     $userShortcutGroups = $GLOBALS['BE_USER']->getTSConfigProp('options.shortcutGroups');
     if ($userShortcutGroups) {
         t3lib_div::deprecationLog('options.shortcutGroups - since TYPO3 4.5, will be removed in TYPO3 4.7 - use options.bookmarkGroups instead');
     }
     $bookmarkGroups = $GLOBALS['BE_USER']->getTSConfigProp('options.bookmarkGroups');
     if ($bookmarkGroups !== NULL) {
         $userShortcutGroups = $bookmarkGroups;
     }
     if (is_array($userShortcutGroups) && count($userShortcutGroups)) {
         foreach ($userShortcutGroups as $groupId => $label) {
             if (strcmp('', $label) && strcmp('0', $label)) {
                 $this->shortcutGroups[$groupId] = (string) $label;
             } elseif ($GLOBALS['BE_USER']->isAdmin()) {
                 unset($this->shortcutGroups[$groupId]);
             }
         }
     }
     // generate global groups, all global groups have negative IDs.
     if (count($this->shortcutGroups)) {
         $groups = $this->shortcutGroups;
         foreach ($groups as $groupId => $groupLabel) {
             $this->shortcutGroups[$groupId * -1] = $groupLabel;
         }
     }
     // group -100 is kind of superglobal and can't be changed.
     $this->shortcutGroups[-100] = 1;
     // add labels
     foreach ($this->shortcutGroups as $groupId => $groupLabel) {
         $label = $groupLabel;
         if ($groupLabel == '1') {
             $label = $GLOBALS['LANG']->getLL('bookmark_group_' . abs($groupId), 1);
             if (empty($label)) {
                 // fallback label
                 $label = $GLOBALS['LANG']->getLL('bookmark_group', 1) . ' ' . abs($groupId);
             }
         }
         if ($groupId < 0) {
             // global group
             $label = $GLOBALS['LANG']->getLL('bookmark_global', 1) . ': ' . (!empty($label) ? $label : abs($groupId));
             if ($groupId == -100) {
                 $label = $GLOBALS['LANG']->getLL('bookmark_global', 1) . ': ' . $GLOBALS['LANG']->getLL('bookmark_all', 1);
             }
         }
         $this->shortcutGroups[$groupId] = $label;
     }
     return $this->shortcutGroups;
 }
コード例 #26
0
 /**
  * Gets the document's score.
  *
  * @param string $document The result document as serialized array
  * @return float The document's score
  * @throws RuntimeException if the serialized result document array cannot be unserialized
  */
 protected function getScore($document)
 {
     $rawDocument = $document;
     $score = 0;
     if (is_numeric($document)) {
         // backwards compatibility
         t3lib_div::deprecationLog('You are using an old notation of the ' . 'releavnace view helpers. The notation used to be ' . '###RELEVANCE:###RESULT_DOCUMENT.SCORE######, please change ' . 'this to simply provide the whole result document: ' . '###RELEVANCE:###RESULT_DOCUMENT######');
         return $document;
     }
     $document = unserialize($document);
     if (is_array($document)) {
         $score = $document['score'];
     } else {
         if ($rawDocument == '###RESULT_DOCUMENT###') {
             // unresolved marker
             // may happen when using search.spellchecking.searchUsingSpellCheckerSuggestion
             // -> ignore
         } else {
             $solrConfiguration = Tx_Solr_Util::getSolrConfiguration();
             if ($solrConfiguration['logging.']['exceptions']) {
                 t3lib_div::devLog('Could not resolve document score for relevance calculation', 'solr', 3, array('rawDocument' => $rawDocument, 'unserializedDocument' => $document));
             }
             throw new RuntimeException('Could not resolve document score for relevance calculation', 1343670545);
         }
     }
     return $score;
 }
コード例 #27
0
 /**
  * Redirect to somewhere (obsolete).
  *
  * @return	void
  * @deprecated since TYPO3 3.6, this function will be removed in TYPO3 4.5.
  * @obsolete
  * @ignore
  */
 function redirect()
 {
     if (!$this->userid && $this->auth_url) {
         // if no userid AND an include-document for login is given
         t3lib_div::deprecationLog('Redirection after login via PHP include is deprecated.');
         include $this->auth_include;
         exit;
     }
 }
コード例 #28
0
ファイル: lang.php プロジェクト: NaveedWebdeveloper/Test
 /**
  * Includes locallang file (and possibly additional localized version if configured for)
  * Read language labels will be merged with $LOCAL_LANG (if $setGlobal = true).
  *
  * @param	string		$fileRef is a file-reference (see t3lib_div::getFileAbsFileName)
  * @param	boolean		Setting in global variable $LOCAL_LANG (or returning the variable)
  * @param	boolean		If $mergeLocalOntoDefault is set the local part of the $LOCAL_LANG array is merged onto the default part (if the local part exists) and the local part is unset.
  * @return	mixed		If $setGlobal is true the LL-files will set the $LOCAL_LANG in the global scope. Otherwise the $LOCAL_LANG array is returned from function
  * @access	public
  */
 public function includeLLFile($fileRef, $setGlobal = 1, $mergeLocalOntoDefault = 0)
 {
     // Configure for global flag:
     if ($setGlobal) {
         global $LOCAL_LANG;
     }
     // Get default file
     $llang = $this->readLLfile($fileRef);
     if (is_array($llang) && count($llang)) {
         $LOCAL_LANG = t3lib_div::array_merge_recursive_overrule((array) $LOCAL_LANG, $llang);
         // Localized addition?
         $lFileRef = $this->localizedFileRef($fileRef);
         if ($lFileRef && (string) $LOCAL_LANG[$this->lang] == 'EXT') {
             $llang = $this->readLLfile($lFileRef);
             $LOCAL_LANG = t3lib_div::array_merge_recursive_overrule($LOCAL_LANG, $llang);
         }
         // Overriding file?
         // @deprecated since TYPO3 4.3, remove in TYPO3 4.5, please use the generic method in
         // t3lib_div::readLLfile and the global array $GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride']
         if (isset($GLOBALS['TYPO3_CONF_VARS']['BE']['XLLfile'][$fileRef])) {
             t3lib_div::deprecationLog('Usage of $TYPO3_CONF_VARS[\'BE\'][\'XLLfile\'] is deprecated since TYPO3 4.3. Use $TYPO3_CONF_VARS[\'SYS\'][\'locallangXMLOverride\'][] to include the file ' . $fileRef . ' instead.');
             $ORarray = $this->readLLfile($GLOBALS['TYPO3_CONF_VARS']['BE']['XLLfile'][$fileRef]);
             $LOCAL_LANG = t3lib_div::array_merge_recursive_overrule($LOCAL_LANG, $ORarray);
         }
         // Merge local onto default
         if ($mergeLocalOntoDefault && strcmp($this->lang, 'default') && is_array($LOCAL_LANG[$this->lang]) && is_array($LOCAL_LANG['default'])) {
             // array_merge can be used so far the keys are not
             // numeric - which we assume they are not...
             $LOCAL_LANG['default'] = array_merge($LOCAL_LANG['default'], $LOCAL_LANG[$this->lang]);
             unset($LOCAL_LANG[$this->lang]);
         }
     }
     // Return value if not global is set.
     if (!$setGlobal) {
         return $LOCAL_LANG;
     }
 }
コード例 #29
0
 /**
  * Implements the TypoScript data type "getText". This takes a string with parameters and based on those a value from somewhere in the system is returned.
  *
  * @param	string		The parameter string, eg. "field : title" or "field : navtitle // field : title" (in the latter case and example of how the value is FIRST splitted by "//" is shown)
  * @param	mixed		Alternative field array; If you set this to an array this variable will be used to look up values for the "field" key. Otherwise the current page record in $GLOBALS['TSFE']->page is used.
  * @return	string		The value fetched
  * @see getFieldVal()
  */
 function getData($string, $fieldArray)
 {
     global $TYPO3_CONF_VARS;
     if (!is_array($fieldArray)) {
         $fieldArray = $GLOBALS['TSFE']->page;
     }
     $retVal = '';
     $sections = explode('//', $string);
     while (!$retVal and list($secKey, $secVal) = each($sections)) {
         $parts = explode(':', $secVal, 2);
         $key = trim($parts[1]);
         if ((string) $key != '') {
             $type = strtolower(trim($parts[0]));
             switch ($type) {
                 case 'gpvar':
                     t3lib_div::deprecationLog('Using gpvar in TypoScript getText is deprecated since TYPO3 4.3 - Use gp instead of gpvar.');
                     // Fall Through
                 // Fall Through
                 case 'gp':
                     // Merge GET and POST and get $key out of the merged array
                     $retVal = $this->getGlobal($key, t3lib_div::array_merge_recursive_overrule(t3lib_div::_GET(), t3lib_div::_POST()));
                     break;
                 case 'tsfe':
                     $retVal = $this->getGlobal('TSFE|' . $key);
                     break;
                 case 'getenv':
                     $retVal = getenv($key);
                     break;
                 case 'getindpenv':
                     $retVal = t3lib_div::getIndpEnv($key);
                     break;
                 case 'field':
                     $retVal = $fieldArray[$key];
                     break;
                 case 'parameters':
                     $retVal = $this->parameters[$key];
                     break;
                 case 'register':
                     $retVal = $GLOBALS['TSFE']->register[$key];
                     break;
                 case 'global':
                     $retVal = $this->getGlobal($key);
                     break;
                 case 'leveltitle':
                     $nkey = $this->getKey($key, $GLOBALS['TSFE']->tmpl->rootLine);
                     $retVal = $this->rootLineValue($nkey, 'title', stristr($key, 'slide'));
                     break;
                 case 'levelmedia':
                     $nkey = $this->getKey($key, $GLOBALS['TSFE']->tmpl->rootLine);
                     $retVal = $this->rootLineValue($nkey, 'media', stristr($key, 'slide'));
                     break;
                 case 'leveluid':
                     $nkey = $this->getKey($key, $GLOBALS['TSFE']->tmpl->rootLine);
                     $retVal = $this->rootLineValue($nkey, 'uid', stristr($key, 'slide'));
                     break;
                 case 'levelfield':
                     $keyP = t3lib_div::trimExplode(',', $key);
                     $nkey = $this->getKey($keyP[0], $GLOBALS['TSFE']->tmpl->rootLine);
                     $retVal = $this->rootLineValue($nkey, $keyP[1], strtolower($keyP[2]) == 'slide');
                     break;
                 case 'fullrootline':
                     $keyP = t3lib_div::trimExplode(',', $key);
                     $fullKey = intval($keyP[0]) - count($GLOBALS['TSFE']->tmpl->rootLine) + count($GLOBALS['TSFE']->rootLine);
                     if ($fullKey >= 0) {
                         $retVal = $this->rootLineValue($fullKey, $keyP[1], stristr($keyP[2], 'slide'), $GLOBALS['TSFE']->rootLine);
                     }
                     break;
                 case 'date':
                     if (!$key) {
                         $key = 'd/m Y';
                     }
                     $retVal = date($key, $GLOBALS['EXEC_TIME']);
                     break;
                 case 'page':
                     $retVal = $GLOBALS['TSFE']->page[$key];
                     break;
                 case 'current':
                     $retVal = $this->data[$this->currentValKey];
                     break;
                 case 'level':
                     $retVal = count($GLOBALS['TSFE']->tmpl->rootLine) - 1;
                     break;
                 case 'db':
                     $selectParts = t3lib_div::trimExplode(':', $key);
                     $db_rec = $GLOBALS['TSFE']->sys_page->getRawRecord($selectParts[0], $selectParts[1]);
                     if (is_array($db_rec) && $selectParts[2]) {
                         $retVal = $db_rec[$selectParts[2]];
                     }
                     break;
                 case 'lll':
                     $retVal = $GLOBALS['TSFE']->sL('LLL:' . $key);
                     break;
                 case 'path':
                     $retVal = $GLOBALS['TSFE']->tmpl->getFileName($key);
                     break;
                 case 'cobj':
                     switch ((string) $key) {
                         case 'parentRecordNumber':
                             $retVal = $this->parentRecordNumber;
                             break;
                     }
                     break;
                 case 'debug':
                     switch ((string) $key) {
                         case 'rootLine':
                             $retVal = t3lib_utility_Debug::viewArray($GLOBALS['TSFE']->tmpl->rootLine);
                             break;
                         case 'fullRootLine':
                             $retVal = t3lib_utility_Debug::viewArray($GLOBALS['TSFE']->rootLine);
                             break;
                         case 'data':
                             $retVal = t3lib_utility_Debug::viewArray($this->data);
                             break;
                     }
                     break;
             }
         }
         if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_content.php']['getData'])) {
             foreach ($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_content.php']['getData'] as $classData) {
                 $hookObject = t3lib_div::getUserObj($classData);
                 if (!$hookObject instanceof tslib_content_getDataHook) {
                     throw new UnexpectedValueException('$hookObject must implement interface tslib_content_getDataHook', 1195044480);
                 }
                 $retVal = $hookObject->getDataExtension($string, $fieldArray, $secVal, $retVal, $this);
             }
         }
     }
     return $retVal;
 }
 /**
  * @deprecated Use getSearchColumns instead!
  */
 protected function getCols()
 {
     t3lib_div::deprecationLog('tx_mklib_mod1_searcher_abstractBase::getCols is deprecated' . 'use getSearchColumns instead!');
     return $this->getSearchColumns();
 }