Esempio n. 1
0
    $_SESSION['cal_api_' . $pid . '_conf'] = $calAPI->conf;
    $_SESSION['cal_api_' . $pid . '_tsfe'] = $GLOBALS['TSFE'];
    $_SESSION['cal_api_' . $pid . '_tca'] = $GLOBALS['TCA'];
}
if ($controllerPiVars['translations']) {
    if ($calAPI->controller->conf['language']) {
        $calAPI->controller->LLkey = $calAPI->controller->conf['language'];
    }
    $tempScriptRelPath = $calAPI->controller->scriptRelPath;
    $calAPI->controller->scriptRelPath = $calAPI->controller->locallangPath;
    $calAPI->controller->pi_loadLL();
    $calAPI->controller->scriptRelPath = $tempScriptRelPath;
    switch ($controllerPiVars['translations']) {
        case 'day':
        case 'month':
            $returnValue = array("timeSeparator" => ' ' . $calAPI->controller->pi_getLL('l_to') . ' ', "newEventText" => $calAPI->controller->pi_getLL('l_new_event'), "shortMonths" => \TYPO3\CMS\Cal\Utility\Functions::getMonthNames('%b'), "longMonths" => \TYPO3\CMS\Cal\Utility\Functions::getMonthNames('%B'), "shortDays" => \TYPO3\CMS\Cal\Utility\Functions::getWeekdayNames('%a'), "longDays" => \TYPO3\CMS\Cal\Utility\Functions::getWeekdayNames('%A'), "buttonText" => array('today' => $calAPI->controller->pi_getLL('l_today'), 'lastWeek' => $calAPI->controller->pi_getLL('l_prev'), 'nextWeek' => $calAPI->controller->pi_getLL('l_next'), 'create' => $calAPI->controller->pi_getLL('l_create'), 'edit' => $calAPI->controller->pi_getLL('l_edit'), 'deleteText' => $calAPI->controller->pi_getLL('l_delete'), 'save' => $calAPI->controller->pi_getLL('l_save'), 'cancel' => $calAPI->controller->pi_getLL('l_cancel')));
            $ajax_return_data = json_encode($returnValue);
            $htmlheader_contenttype = 'Content-Type: application/json';
            break;
    }
} else {
    if (is_array($controllerPiVars['translate'])) {
        $tempScriptRelPath = $calAPI->controller->scriptRelPath;
        $calAPI->controller->scriptRelPath = $calAPI->controller->locallangPath;
        $calAPI->controller->pi_loadLL();
        $calAPI->controller->scriptRelPath = $tempScriptRelPath;
        $translationArray = array();
        foreach ($controllerPiVars['translate'] as $value) {
            $translationArray[$value] = $calAPI->controller->pi_getLL('l_' . strtolower($value));
        }
        $ajax_return_data = json_encode($translationArray);