本文整理汇总了PHP中t3lib_BEfunc::getPagesTSconfig方法的典型用法代码示例。如果您正苦于以下问题:PHP t3lib_BEfunc::getPagesTSconfig方法的具体用法?PHP t3lib_BEfunc::getPagesTSconfig怎么用?PHP t3lib_BEfunc::getPagesTSconfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类t3lib_BEfunc
的用法示例。
在下文中一共展示了t3lib_BEfunc::getPagesTSconfig方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processAjaxRequest
/**
* Ajax handler for the "suggest" feature in TCEforms.
*
* @param array $params The parameters from the AJAX call
* @param TYPO3AJAX $ajaxObj The AJAX object representing the AJAX call
* @return void
*/
public function processAjaxRequest($params, &$ajaxObj)
{
// get parameters from $_GET/$_POST
$search = t3lib_div::_GP('value');
$table = t3lib_div::_GP('table');
$field = t3lib_div::_GP('field');
$uid = t3lib_div::_GP('uid');
$pageId = t3lib_div::_GP('pid');
t3lib_div::loadTCA($table);
// If the $uid is numeric, we have an already existing element, so get the
// TSconfig of the page itself or the element container (for non-page elements)
// otherwise it's a new element, so use given id of parent page (i.e., don't modify it here)
if (is_numeric($uid)) {
if ($table == 'pages') {
$pageId = $uid;
} else {
$row = t3lib_BEfunc::getRecord($table, $uid);
$pageId = $row['pid'];
}
}
$TSconfig = t3lib_BEfunc::getPagesTSconfig($pageId);
$queryTables = array();
$foreign_table_where = '';
$wizardConfig = $GLOBALS['TCA'][$table]['columns'][$field]['config']['wizards']['suggest'];
if (isset($GLOBALS['TCA'][$table]['columns'][$field]['config']['allowed'])) {
$queryTables = t3lib_div::trimExplode(',', $GLOBALS['TCA'][$table]['columns'][$field]['config']['allowed']);
} elseif (isset($GLOBALS['TCA'][$table]['columns'][$field]['config']['foreign_table'])) {
$queryTables = array($GLOBALS['TCA'][$table]['columns'][$field]['config']['foreign_table']);
$foreign_table_where = $GLOBALS['TCA'][$table]['columns'][$field]['config']['foreign_table_where'];
// strip ORDER BY clause
$foreign_table_where = trim(preg_replace('/ORDER[[:space:]]+BY.*/i', '', $foreign_table_where));
}
$resultRows = array();
// fetch the records for each query table. A query table is a table from which records are allowed to
// be added to the TCEForm selector, originally fetched from the "allowed" config option in the TCA
foreach ($queryTables as $queryTable) {
t3lib_div::loadTCA($queryTable);
// if the table does not exist, skip it
if (!is_array($GLOBALS['TCA'][$queryTable]) || !count($GLOBALS['TCA'][$queryTable])) {
continue;
}
$config = (array) $wizardConfig['default'];
if (is_array($wizardConfig[$queryTable])) {
$config = t3lib_div::array_merge_recursive_overrule($config, $wizardConfig[$queryTable]);
}
// merge the configurations of different "levels" to get the working configuration for this table and
// field (i.e., go from the most general to the most special configuration)
if (is_array($TSconfig['TCEFORM.']['suggest.']['default.'])) {
$config = t3lib_div::array_merge_recursive_overrule($config, $TSconfig['TCEFORM.']['suggest.']['default.']);
}
if (is_array($TSconfig['TCEFORM.']['suggest.'][$queryTable . '.'])) {
$config = t3lib_div::array_merge_recursive_overrule($config, $TSconfig['TCEFORM.']['suggest.'][$queryTable . '.']);
}
// use $table instead of $queryTable here because we overlay a config
// for the input-field here, not for the queried table
if (is_array($TSconfig['TCEFORM.'][$table . '.'][$field . '.']['suggest.']['default.'])) {
$config = t3lib_div::array_merge_recursive_overrule($config, $TSconfig['TCEFORM.'][$table . '.'][$field . '.']['suggest.']['default.']);
}
if (is_array($TSconfig['TCEFORM.'][$table . '.'][$field . '.']['suggest.'][$queryTable . '.'])) {
$config = t3lib_div::array_merge_recursive_overrule($config, $TSconfig['TCEFORM.'][$table . '.'][$field . '.']['suggest.'][$queryTable . '.']);
}
//process addWhere
if (!isset($config['addWhere']) && $foreign_table_where) {
$config['addWhere'] = $foreign_table_where;
}
if (isset($config['addWhere'])) {
$config['addWhere'] = strtr(' ' . $config['addWhere'], array('###THIS_UID###' => intval($uid), '###CURRENT_PID###' => intval($pageId)));
}
// instantiate the class that should fetch the records for this $queryTable
$receiverClassName = $config['receiverClass'];
if (!class_exists($receiverClassName)) {
$receiverClassName = 't3lib_TCEforms_Suggest_DefaultReceiver';
}
$receiverObj = t3lib_div::makeInstance($receiverClassName, $queryTable, $config);
$params = array('value' => $search);
$rows = $receiverObj->queryTable($params);
if (empty($rows)) {
continue;
}
$resultRows = t3lib_div::array_merge($resultRows, $rows);
unset($rows);
}
$listItems = array();
if (count($resultRows) > 0) {
// traverse all found records and sort them
$rowsSort = array();
foreach ($resultRows as $key => $row) {
$rowsSort[$key] = $row['text'];
}
asort($rowsSort);
$rowsSort = array_keys($rowsSort);
// Limit the number of items in the result list
$maxItems = $config['maxItemsInResultList'] ? $config['maxItemsInResultList'] : 10;
//.........这里部分代码省略.........
示例2: notifyStageChange
//.........这里部分代码省略.........
$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);
}
}
}
示例3: processDatamap_afterDatabaseOperations
/**
* Generate a different preview link
*
* @param string $status status
* @param string $table table name
* @param integer $recordUid id of the record
* @param array $fields fieldArray
* @param t3lib_TCEmain $parentObject parent Object
* @return void
*/
public function processDatamap_afterDatabaseOperations($status, $table, $recordUid, array $fields, t3lib_TCEmain $parentObject)
{
// Clear category cache
if ($table === 'tx_news_domain_model_category') {
$cache = t3lib_div::makeInstance('Tx_News_Service_CacheService', 'news_categorycache');
$cache->flush();
}
// Preview link
if ($table === 'tx_news_domain_model_news') {
// direct preview
if (!is_numeric($recordUid)) {
$recordUid = $parentObject->substNEWwithIDs[$recordUid];
}
if (isset($GLOBALS['_POST']['_savedokview_x']) && !$fields['type']) {
// If "savedokview" has been pressed and current article has "type" 0 (= normal news article)
$pagesTsConfig = t3lib_BEfunc::getPagesTSconfig($GLOBALS['_POST']['popViewId']);
if ($pagesTsConfig['tx_news.']['singlePid']) {
$record = t3lib_BEfunc::getRecord('tx_news_domain_model_news', $recordUid);
$parameters = array('no_cache' => 1, 'tx_news_pi1[controller]' => 'News', 'tx_news_pi1[action]' => 'detail', 'tx_news_pi1[news_preview]' => $record['uid']);
if ($record['sys_language_uid'] > 0) {
if ($record['l10n_parent'] > 0) {
$parameters['tx_news_pi1[news_preview]'] = $record['l10n_parent'];
}
$parameters['L'] = $record['sys_language_uid'];
}
$GLOBALS['_POST']['popViewId_addParams'] = t3lib_div::implodeArrayForUrl('', $parameters, '', FALSE, TRUE);
$GLOBALS['_POST']['popViewId'] = $pagesTsConfig['tx_news.']['singlePid'];
}
}
}
}
示例4: user_rgslideshow
/**
* Set the DB TCA field with an userfunction to allow dynamic manipulation
*
* @param array $PA:
* @param array $fobj:
* @return The TCA field
*/
function user_rgslideshow($PA, $fobj)
{
// get the correct tables which are allowed > tsconfig rgslideshow.tables
$pid = $this->getStorageFolderPid($PA['row']['pid']);
$pagesTSC = t3lib_BEfunc::getPagesTSconfig($pid);
// get page TSconfig
$table = $pagesTSC['rgslideshow.']['tables'];
// if there are any tables set in TsConfig
if ($table != '') {
// get the old value to set this into the field
$flexform = t3lib_div::xml2array($PA['row']['pi_flexform']);
$imgOld = is_array($flexform) ? $flexform['data']['sDEF']['lDEF']['images2']['vDEF'] : '';
// configuration of the field, see TCA for more options
$config = array('fieldConf' => array('label' => 'images2', 'config' => array('type' => 'group', 'prepend_tname' => 1, 'internal_type' => 'db', 'allowed' => $table, 'show_thumbs' => 1, 'size' => 10, 'autoSizeMax' => 20, 'maxitems' => 30, 'minitems' => 0, 'form_type' => 'group')), 'onFocus' => '', 'label' => 'Plugin Options', 'itemFormElValue' => $imgOld, 'itemFormElName' => 'data[tt_content][' . $PA['row']['uid'] . '][pi_flexform][data][sDEF][lDEF][images2][vDEF]', 'itemFormElName_file' => 'data_files[tt_content][' . $PA['row']['uid'] . '][pi_flexform][data][sDEF][lDEF][images2][vDEF]');
// create the element
$form = t3lib_div::makeInstance('t3lib_TCEforms');
$form->initDefaultBEMode();
$form->backPath = $GLOBALS['BACK_PATH'];
$element = $form->getSingleField_typeGroup('tt_content', 'pi_flexform', $PA['row'], $config);
return $form->printNeededJSFunctions_top() . $element . $form->printNeededJSFunctions();
} else {
// no tables allowed
return '<div style="font-weight:bold;padding:1px 10px;margin:2px:5px">
No Table allowed. Set it in TsConfig with
<pre>rgslideshow.tables = tt_news,pages,fe_users,...</pre>
</div> ';
}
}
示例5: init
function init()
{
global $BE_USER, $LANG, $BACK_PATH, $TCA_DESCR, $TCA, $CLIENT, $TYPO3_CONF_VARS;
if (t3lib_div::_GP('pageId') < 0 || t3lib_div::_GP('pageId') == '' || t3lib_div::_GP('templateId') < 0 || t3lib_div::_GP('templateId') == '' || t3lib_div::_GP('ISOcode') == '') {
die('if you want to us this mod you need at least to define pageId, templateId and ISOcode as GET parameter. Example path/to/TinyMCETemplate.php?pageId=7&templateId=2&ISOcode=en');
}
$this->pageId = t3lib_div::_GP('pageId');
$this->templateId = t3lib_div::_GP('templateId');
$this->ISOcode = t3lib_div::_GP('ISOcode');
$this->pageTSconfig = t3lib_BEfunc::getPagesTSconfig($this->pageId);
if (t3lib_div::_GP('mode') != 'FE') {
$this->conf = $this->pageTSconfig['RTE.']['default.'];
} else {
$this->conf = $this->pageTSconfig['RTE.']['default.']['FE.'];
}
$LANG->init(strtolower($this->ISOcode));
$this->tinymce_rte = t3lib_div::makeInstance('tx_tinymce_rte_base');
$this->conf = $this->tinymce_rte->init($this->conf);
$row = array('pid' => $this->pageId, 'ISOcode' => $this->ISOcode);
$this->conf = $this->tinymce_rte->fixTinyMCETemplates($this->conf, $row);
if (is_array($this->conf['TinyMCE_templates.'][$this->templateId]) && $this->conf['TinyMCE_templates.'][$this->templateId]['include'] != '') {
if (is_file($this->conf['TinyMCE_templates.'][$this->templateId]['include'])) {
include_once $this->conf['TinyMCE_templates.'][$this->templateId]['include'];
} else {
die('no file found at include path');
}
}
}
示例6: preStartPageHook
/**
* Hook-function: inject JavaScript code before the BE page is compiled
* called in typo3/template.php:startPage
*
* @param array $parameters (not very usable, as it just contains a title..)
* @param template $pObj
*/
function preStartPageHook($parameters, $pObj)
{
// Only add JS if this is the top TYPO3 frame/document
if ($pObj->bodyTagId == 'typo3-backend-php') {
$tinymce_rte = t3lib_div::makeInstance('tx_tinymce_rte_base');
$pageTSconfig = t3lib_BEfunc::getPagesTSconfig(0);
$conf = $pageTSconfig['RTE.']['pageLoad.'];
$conf = $tinymce_rte->init($conf);
$conf['init.']['mode'] = 'none';
unset($conf['init.']['spellchecker_rpc_url']);
$pObj->JScode .= $tinymce_rte->getCoreScript($conf);
//$pObj->JScode .= $tinymce_rte->getInitScript( $conf['init.'] );
$pObj->JScode .= '
<script type="text/javascript">
function typo3filemanager(field_name, url, type, win) {
if( document.getElementById("typo3-contentContainer") &&
document.getElementById("typo3-contentContainer").getElementsByTagName("iframe")[0] &&
document.getElementById("typo3-contentContainer").getElementsByTagName("iframe")[0].contentWindow &&
document.getElementById("typo3-contentContainer").getElementsByTagName("iframe")[0].contentWindow.typo3filemanager ) {
// TYPO3 4.5
document.getElementById("typo3-contentContainer").getElementsByTagName("iframe")[0].contentWindow.typo3filemanager(field_name, url, type, win);
} else if( document.getElementById("content").contentWindow.list_frame && document.getElementById("content").contentWindow.list_frame.typo3filemanager ) {
// < TYPO3 4.5
document.getElementById("content").contentWindow.list_frame.typo3filemanager(field_name, url, type, win);
} else {
// < TYPO3 4.5 compact mode
document.getElementById("content").contentWindow.typo3filemanager(field_name, url, type, win);
}
}
</script>
';
}
}
示例7: user_fieldvisibility
public function user_fieldvisibility($PA, $fobj)
{
$this->init();
//init some class attributes
$this->pageId = $PA['row']['pid'];
$uid = $PA['row']['uid'];
if (substr($uid, 0, 3) == 'NEW') {
$this->isNewElement = TRUE;
}
if ($PA['table'] == 'pages' && !$this->isNewElement) {
$this->pageId = $PA['row']['uid'];
}
$_modTSconfig = $GLOBALS["BE_USER"]->getTSConfig('mod.languagevisibility', t3lib_BEfunc::getPagesTSconfig($this->pageId));
$this->modTSconfig = $_modTSconfig['properties'];
###
$languageRep = t3lib_div::makeInstance('tx_languagevisibility_languagerepository');
$dao = t3lib_div::makeInstance('tx_languagevisibility_daocommon');
if (version_compare(TYPO3_version, '4.3.0', '<')) {
$elementfactoryName = t3lib_div::makeInstanceClassName('tx_languagevisibility_elementFactory');
$elementfactory = new $elementfactoryName($dao);
} else {
$elementfactory = t3lib_div::makeInstance('tx_languagevisibility_elementFactory', $dao);
}
$value = $PA['row'][$PA['field']];
$table = $PA['table'];
$isOverlay = tx_languagevisibility_beservices::isOverlayRecord($PA['row'], $table);
$visivilitySetting = @unserialize($value);
if (!is_array($visivilitySetting) && $value != '') {
$content .= 'Visibility Settings seems to be corrupt:' . $value;
}
if ($isOverlay) {
$uid = tx_languagevisibility_beservices::getOriginalUidOfTranslation($PA['row'], $table);
$table = tx_languagevisibility_beservices::getOriginalTableOfTranslation($table);
//This element is an overlay therefore we need to render the visibility field just for the language of the overlay
$overlayRecordsLanguage = $languageRep->getLanguageById($PA['row']['sys_language_uid']);
try {
$originalElement = $elementfactory->getElementForTable($table, $uid);
} catch (Exception $e) {
return '';
}
$infosStruct = $this->_getLanguageInfoStructurListForElementAndLanguageList($originalElement, array($overlayRecordsLanguage), $PA['itemFormElName'], true);
} else {
//This element is an original element (no overlay)
try {
$originalElement = $elementfactory->getElementForTable($table, $uid);
} catch (Exception $e) {
return 'sorry this element supports no visibility settings';
}
$content .= $originalElement->getInformativeDescription();
if ($originalElement->isMonolithicTranslated()) {
return $content;
}
$languageList = $languageRep->getLanguages();
$infosStruct = $this->_getLanguageInfoStructurListForElementAndLanguageList($originalElement, $languageList, $PA['itemFormElName'], false);
}
$content .= $this->_renderLanguageInfos($infosStruct);
return '<div id="fieldvisibility">' . $content . '<a href="#" onclick="resetSelectboxes()">reset</a></div>' . $this->_javascript();
}
示例8: addIncludes
function addIncludes()
{
global $TSFE;
$tinymce_rte = t3lib_div::makeInstance('tx_tinymce_rte_base');
$pageTSconfig = t3lib_BEfunc::getPagesTSconfig($TSFE->id);
$config = $pageTSconfig['RTE.']['default.'];
$config = $tinymce_rte->init($config);
$myIncludes = $tinymce_rte->getCoreScript($config);
$myIncludes .= "\n" . $tinymce_rte->getInitScript($config['init.']);
return $myIncludes;
}
示例9: getSingleField_preProcess
/**
* Preprocessing of fields
*
* @param string $table table name
* @param string $field field name
* @param array $row record row
* @param string $altName
* @param string $palette
* @param string $extra
* @param string $pal
* @param t3lib_TCEforms $parentObject
* @return void
*/
public function getSingleField_preProcess($table, $field, array &$row, $altName, $palette, $extra, $pal, t3lib_TCEforms $parentObject)
{
// Predefine the archive date
if ($table === 'tx_news_domain_model_news' && empty($row['archive']) && is_numeric($row['pid'])) {
$pagesTsConfig = t3lib_BEfunc::getPagesTSconfig($row['pid']);
if (is_array($pagesTsConfig['tx_news.']['predefine.']) && is_array($pagesTsConfig['tx_news.']['predefine.']) && isset($pagesTsConfig['tx_news.']['predefine.']['archive'])) {
$calculatedTime = strtotime($pagesTsConfig['tx_news.']['predefine.']['archive']);
if ($calculatedTime !== FALSE) {
$row['archive'] = $calculatedTime;
}
}
}
}
示例10: addIncludes
function addIncludes()
{
$tinymce_rte = t3lib_div::makeInstance('tx_tinymce_rte_base');
$pageTSconfig = t3lib_BEfunc::getPagesTSconfig("");
$myConf = $pageTSconfig['RTE.']['default.'];
$myConf['loadConfig'] = 'EXT:tinymce_rte/static/pageLoad.ts';
if ($myConf['pageLoadConfigFile'] != '' && is_file($tinymce_rte->getPath($myConf['pageLoadConfigFile'], 1))) {
$myConf['loadConfig'] = $myConf['pageLoadConfigFile'];
}
$rteConf = $tinymce_rte->init($myConf);
$rteConf['init.']['mode'] = 'none';
$myIncludes = array();
$myIncludes[] = $tinymce_rte->getCoreScript($rteConf);
$myIncludes[] = $tinymce_rte->getInitScript($rteConf['init.']);
return $myIncludes;
}
示例11: init
/**
* Initializes the Module
* @return void
*/
function init()
{
/*{{{*/
global $BE_USER, $LANG, $BACK_PATH, $TCA_DESCR, $TCA, $CLIENT, $TYPO3_CONF_VARS;
parent::init();
$this->enableFields_tickets = t3lib_BEfunc::deleteClause($this->tickets_table) . t3lib_BEfunc::BEenableFields($this->tickets_table);
$this->enableFields_fe_users = t3lib_BEfunc::deleteClause($this->users_table) . t3lib_BEfunc::BEenableFields($this->users_table);
$this->enableFields_category = t3lib_BEfunc::deleteClause($this->category_table) . t3lib_BEfunc::BEenableFields($this->category_table);
$this->enableFields_address = t3lib_BEfunc::deleteClause($this->address_table) . t3lib_BEfunc::BEenableFields($this->address_table);
$this->enableFields_pages = t3lib_BEfunc::deleteClause($this->pages_table) . t3lib_BEfunc::BEenableFields($this->pages_table);
$this->lib = t3lib_div::makeInstance('tx_ketroubletickets_lib');
// get the page ts config
$this->pageTSConfig = t3lib_BEfunc::getPagesTSconfig($this->id);
/*
if (t3lib_div::_GP('clear_all_cache')) {
$this->include_once[] = PATH_t3lib.'class.t3lib_tcemain.php';
}
*/
}
示例12: user_templateLayout
/**
* Itemsproc function to extend the selection of templateLayouts in the plugin
*
* @param array &$config configuration array
* @param t3lib_TCEforms $parentObject parent object
* @return void
*/
public function user_templateLayout(array &$config, t3lib_TCEforms $parentObject)
{
// Check if the layouts are extended by ext_tables
if (isset($GLOBALS['TYPO3_CONF_VARS']['EXT']['news']['templateLayouts']) && is_array($GLOBALS['TYPO3_CONF_VARS']['EXT']['news']['templateLayouts'])) {
// Add every item
foreach ($GLOBALS['TYPO3_CONF_VARS']['EXT']['news']['templateLayouts'] as $layouts) {
$additionalLayout = array($GLOBALS['LANG']->sL($layouts[0], TRUE), $layouts[1]);
array_push($config['items'], $additionalLayout);
}
}
// Add tsconfig values
if (is_numeric($config['row']['pid'])) {
$pagesTsConfig = t3lib_BEfunc::getPagesTSconfig($config['row']['pid']);
if (isset($pagesTsConfig['tx_news.']['templateLayouts.']) && is_array($pagesTsConfig['tx_news.']['templateLayouts.'])) {
// Add every item
foreach ($pagesTsConfig['tx_news.']['templateLayouts.'] as $key => $label) {
$additionalLayout = array($GLOBALS['LANG']->sL($label, TRUE), $key);
array_push($config['items'], $additionalLayout);
}
}
}
}
示例13: preStartPageHook
/**
* Hook-function: inject JavaScript code before the BE page is compiled
* called in typo3/template.php:startPage
*
* @param array $parameters (not very usable, as it just contains a title..)
* @param template $pObj
*/
function preStartPageHook($parameters, $pObj)
{
// Only add JS if this is the top TYPO3 frame/document
if ($pObj->bodyTagId == 'typo3-backend-php') {
$tinymce_rte = t3lib_div::makeInstance('tx_tinymce_rte_base');
$pageTSconfig = t3lib_BEfunc::getPagesTSconfig("");
$this->conf = $pageTSconfig['RTE.']['default.'];
$this->conf['loadConfig'] = 'EXT:tinymce_rte/static/pageLoad.ts';
if ($this->conf['pageLoadConfigFile'] != '' && is_file($tinymce_rte->getPath($this->conf['pageLoadConfigFile'], 1))) {
$this->conf['loadConfig'] = $this->conf['pageLoadConfigFile'];
}
$this->conf = $tinymce_rte->init($this->conf);
$this->conf['init.']['mode'] = 'none';
$pObj->JScode .= $tinymce_rte->getCoreScript($this->conf);
$pObj->JScode .= $tinymce_rte->getInitScript($this->conf['init.']);
$pObj->JScode .= '
<script type="text/javascript">
function typo3filemanager(field_name, url, type, win) {
document.getElementById("content").contentWindow.list_frame.typo3filemanager(field_name, url, type, win);
}
</script>
';
}
}
示例14: getTCEMAIN_TSconfig
/**
* Return TSconfig for a page id
*
* @param integer Page id (PID) from which to get configuration.
* @return array TSconfig array, if any
*/
function getTCEMAIN_TSconfig($tscPID)
{
if (!isset($this->cachedTSconfig[$tscPID])) {
$this->cachedTSconfig[$tscPID] = $this->BE_USER->getTSConfig('TCEMAIN', t3lib_BEfunc::getPagesTSconfig($tscPID));
}
return $this->cachedTSconfig[$tscPID]['properties'];
}
示例15: init
/**
* Constructor:
* Initializes a lot of variables, setting JavaScript functions in header etc.
*
* @return void
*/
function init()
{
global $BE_USER, $BACK_PATH;
// Main GPvars:
$this->pointer = t3lib_div::_GP('pointer');
$this->bparams = t3lib_div::_GP('bparams');
$this->P = t3lib_div::_GP('P');
$this->RTEtsConfigParams = t3lib_div::_GP('RTEtsConfigParams');
$this->expandPage = t3lib_div::_GP('expandPage');
$this->expandFolder = t3lib_div::_GP('expandFolder');
$this->PM = t3lib_div::_GP('PM');
// Find "mode"
$this->mode = t3lib_div::_GP('mode');
if (!$this->mode) {
$this->mode = 'rte';
}
// Creating backend template object:
$this->doc = t3lib_div::makeInstance('template');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
// Load the Prototype library and browse_links.js
$this->doc->getPageRenderer()->loadPrototype();
$this->doc->loadJavascriptLib('js/browse_links.js');
// init hook objects:
$this->hookObjects = array();
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.browse_links.php']['browseLinksHook'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.browse_links.php']['browseLinksHook'] as $classData) {
$processObject = t3lib_div::getUserObj($classData);
if (!$processObject instanceof t3lib_browseLinksHook) {
throw new UnexpectedValueException('$processObject must implement interface t3lib_browseLinksHook', 1195039394);
}
$parameters = array();
$processObject->init($this, $parameters);
$this->hookObjects[] = $processObject;
}
}
// Site URL
$this->siteURL = t3lib_div::getIndpEnv('TYPO3_SITE_URL');
// Current site url
// the script to link to
$this->thisScript = t3lib_div::getIndpEnv('SCRIPT_NAME');
// init fileProcessor
$this->fileProcessor = t3lib_div::makeInstance('t3lib_basicFileFunctions');
$this->fileProcessor->init($GLOBALS['FILEMOUNTS'], $GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions']);
// CurrentUrl - the current link url must be passed around if it exists
if ($this->mode == 'wizard') {
$currentLinkParts = t3lib_div::unQuoteFilenames($this->P['currentValue'], TRUE);
$initialCurUrlArray = array('href' => $currentLinkParts[0], 'target' => $currentLinkParts[1], 'class' => $currentLinkParts[2], 'title' => $currentLinkParts[3]);
$this->curUrlArray = is_array(t3lib_div::_GP('curUrl')) ? array_merge($initialCurUrlArray, t3lib_div::_GP('curUrl')) : $initialCurUrlArray;
$this->curUrlInfo = $this->parseCurUrl($this->siteURL . '?id=' . $this->curUrlArray['href'], $this->siteURL);
if ($this->curUrlInfo['pageid'] == 0 && $this->curUrlArray['href']) {
// pageid == 0 means that this is not an internal (page) link
if (file_exists(PATH_site . rawurldecode($this->curUrlArray['href']))) {
// check if this is a link to a file
if (t3lib_div::isFirstPartOfStr($this->curUrlArray['href'], PATH_site)) {
$currentLinkParts[0] = substr($this->curUrlArray['href'], strlen(PATH_site));
}
$this->curUrlInfo = $this->parseCurUrl($this->siteURL . $this->curUrlArray['href'], $this->siteURL);
} elseif (strstr($this->curUrlArray['href'], '@')) {
// check for email link
if (t3lib_div::isFirstPartOfStr($this->curUrlArray['href'], 'mailto:')) {
$currentLinkParts[0] = substr($this->curUrlArray['href'], 7);
}
$this->curUrlInfo = $this->parseCurUrl('mailto:' . $this->curUrlArray['href'], $this->siteURL);
} else {
// nothing of the above. this is an external link
if (strpos($this->curUrlArray['href'], '://') === false) {
$currentLinkParts[0] = 'http://' . $this->curUrlArray['href'];
}
$this->curUrlInfo = $this->parseCurUrl($currentLinkParts[0], $this->siteURL);
}
} elseif (!$this->curUrlArray['href']) {
$this->curUrlInfo = array();
$this->act = 'page';
} else {
$this->curUrlInfo = $this->parseCurUrl($this->siteURL . '?id=' . $this->curUrlArray['href'], $this->siteURL);
}
} else {
$this->curUrlArray = t3lib_div::_GP('curUrl');
if ($this->curUrlArray['all']) {
$this->curUrlArray = t3lib_div::get_tag_attributes($this->curUrlArray['all']);
}
$this->curUrlInfo = $this->parseCurUrl($this->curUrlArray['href'], $this->siteURL);
}
// Determine nature of current url:
$this->act = t3lib_div::_GP('act');
if (!$this->act) {
$this->act = $this->curUrlInfo['act'];
}
// Rich Text Editor specific configuration:
$addPassOnParams = '';
if ((string) $this->mode == 'rte') {
$RTEtsConfigParts = explode(':', $this->RTEtsConfigParams);
$addPassOnParams .= '&RTEtsConfigParams=' . rawurlencode($this->RTEtsConfigParams);
$RTEsetup = $GLOBALS['BE_USER']->getTSConfig('RTE', t3lib_BEfunc::getPagesTSconfig($RTEtsConfigParts[5]));
//.........这里部分代码省略.........