/**
  * 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'];
             }
         }
     }
 }
 /**
  * Renders the review module user dependent with all workspaces.
  * The module will show all records of one workspace.
  *
  * @return void
  */
 public function indexAction()
 {
     $wsService = t3lib_div::makeInstance('tx_Workspaces_Service_Workspaces');
     $this->view->assign('showGrid', !($GLOBALS['BE_USER']->workspace === 0 && !$GLOBALS['BE_USER']->isAdmin()));
     $this->view->assign('showAllWorkspaceTab', $GLOBALS['BE_USER']->isAdmin());
     $this->view->assign('pageUid', t3lib_div::_GP('id'));
     $this->view->assign('showLegend', !($GLOBALS['BE_USER']->workspace === 0 && !$GLOBALS['BE_USER']->isAdmin()));
     $wsList = $wsService->getAvailableWorkspaces();
     $activeWorkspace = $GLOBALS['BE_USER']->workspace;
     $performWorkspaceSwitch = FALSE;
     if (!$GLOBALS['BE_USER']->isAdmin()) {
         $wsCur = array($activeWorkspace => true);
         $wsList = array_intersect_key($wsList, $wsCur);
     } else {
         $wsList = $wsService->getAvailableWorkspaces();
         if (strlen(t3lib_div::_GP('workspace'))) {
             $switchWs = (int) t3lib_div::_GP('workspace');
             if (in_array($switchWs, array_keys($wsList)) && $activeWorkspace != $switchWs) {
                 $activeWorkspace = $switchWs;
                 $GLOBALS['BE_USER']->setWorkspace($activeWorkspace);
                 $performWorkspaceSwitch = TRUE;
                 t3lib_BEfunc::setUpdateSignal('updatePageTree');
             } elseif ($switchWs == tx_Workspaces_Service_Workspaces::SELECT_ALL_WORKSPACES) {
                 $this->redirect('fullIndex');
             }
         }
     }
     $this->view->assign('performWorkspaceSwitch', $performWorkspaceSwitch);
     $this->view->assign('workspaceList', $wsList);
     $this->view->assign('activeWorkspaceUid', $activeWorkspace);
     $this->view->assign('activeWorkspaceTitle', tx_Workspaces_Service_Workspaces::getWorkspaceTitle($activeWorkspace));
     $this->view->assign('showPreviewLink', $wsService->canCreatePreviewLink(t3lib_div::_GP('id'), $activeWorkspace));
     $GLOBALS['BE_USER']->setAndSaveSessionData('tx_workspace_activeWorkspace', $activeWorkspace);
 }
 /**
  * Check all "root" sys_templates and try to find the value for config.sys_language_mode
  */
 public function getLangModes()
 {
     $message = '';
     $checked = array('ok' => array(), 'fail' => array());
     $value = $GLOBALS['LANG']->sL('LLL:EXT:languagevisibility/locallang_db.xml:reports.ok.value');
     $severity = tx_reports_reports_status_Status::OK;
     $rootTpls = t3lib_BEfunc::getRecordsByField('sys_template', 'root', '1', '', 'pid');
     foreach ($rootTpls as $tpl) {
         /**
          * @var t3lib_tsparser_ext
          */
         $tmpl = t3lib_div::makeInstance("t3lib_tsparser_ext");
         $tmpl->tt_track = 0;
         $tmpl->init();
         // Gets the rootLine
         $sys_page = t3lib_div::makeInstance("t3lib_pageSelect");
         $rootLine = $sys_page->getRootLine($tpl['pid']);
         $tmpl->runThroughTemplates($rootLine, $tpl['uid']);
         $tplRow = $tmpl->ext_getFirstTemplate($tpl['pid'], $tpl['uid']);
         $tmpl->generateConfig();
         if (!isset($tmpl->setup['config.']['sys_language_mode']) || $tmpl->setup['config.']['sys_language_mode'] != 'ignore') {
             $checked['fail'][] = array($tpl['pid'], $tpl['uid'], $tmpl->setup['config.']['sys_language_mode']);
         }
     }
     if (count($checked['fail'])) {
         $severity = tx_reports_reports_status_Status::WARNING;
         $value = $GLOBALS['LANG']->sL('LLL:EXT:languagevisibility/locallang_db.xml:reports.fail.value');
         $message .= $GLOBALS['LANG']->sL('LLL:EXT:languagevisibility/locallang_db.xml:reports.fail.message') . '<br/>';
         foreach ($checked['fail'] as $fail) {
             $message .= vsprintf($GLOBALS['LANG']->sL('LLL:EXT:languagevisibility/locallang_db.xml:reports.fail.message.detail'), $fail) . '<br />';
         }
     }
     return t3lib_div::makeInstance('tx_reports_reports_status_Status', 'EXT:languagevisibility config.sys_language_mode', $value, $message, $severity);
 }
    /**
     * 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>
			';
        }
    }
 /**
  * Render javascript in header
  *
  * @return string the rendered page info icon
  * @see template::getPageInfo() Note: can't call this method as it's protected!
  */
 public function render()
 {
     $doc = $this->getDocInstance();
     $id = t3lib_div::_GP('id');
     $pageRecord = t3lib_BEfunc::readPageAccess($id, $GLOBALS['BE_USER']->getPagePermsClause(1));
     // Add icon with clickmenu, etc:
     if ($pageRecord['uid']) {
         // If there IS a real page
         $alttext = t3lib_BEfunc::getRecordIconAltText($pageRecord, 'pages');
         $iconImg = t3lib_iconWorks::getSpriteIconForRecord('pages', $pageRecord, array('title' => htmlspecialchars($alttext)));
         // Make Icon:
         $theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($iconImg, 'pages', $pageRecord['uid']);
     } else {
         // On root-level of page tree
         // Make Icon
         $iconImg = '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/i/_icon_website.gif') . ' alt="' . htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']) . '" />';
         if ($BE_USER->user['admin']) {
             $theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($iconImg, 'pages', 0);
         } else {
             $theIcon = $iconImg;
         }
     }
     // Setting icon with clickmenu + uid
     $pageInfo = $theIcon . '<em>[pid: ' . $pageRecord['uid'] . ']</em>';
     return $pageInfo;
 }
	/**
	 * (non-PHPdoc)
	 * @see classes/preview/tx_templavoila_preview_type_text#render_previewContent($row, $table, $output, $alreadyRendered, $ref)
	 */
	public function render_previewContent ($row, $table, $output, $alreadyRendered, &$ref) {

		$this->parentObj = $ref;

		$uploadDir = $GLOBALS['TCA']['tt_content']['columns']['image']['config']['internal_type'] == 'file_reference' ? '' : NULL;

		$thumbnail = '<strong>'.$GLOBALS['LANG']->sL(t3lib_BEfunc::getItemLabel('tt_content','image'),1).'</strong><br />';
		$thumbnail .= t3lib_BEfunc::thumbCode($row, 'tt_content', 'image', $ref->doc->backPath, '', $uploadDir);

		$label = $this->getPreviewLabel();
		$data = $this->getPreviewData($row);

		if ($ref->currentElementBelongsToCurrentPage) {
			$text = $ref->link_edit('<strong>'. $label .'</strong> ' . $data ,'tt_content',$row['uid']);
		} else {
			$text = '<strong>'. $label .'</strong> ' . $data;
		}

		return '
		<table>
			<tr>
				<td valign="top">' . $text . '</td>
				<td valign="top">' . $thumbnail . '</td>
			</tr>
		</table>';
	}
    /**
     * This method is called by the Scheduler task that triggers
     * the autopublication process
     * It searches for workspaces whose publication date is in the past
     * and publishes them
     *
     * @return	void
     */
    public function autoPublishWorkspaces()
    {
        global $TYPO3_CONF_VARS;
        // Temporarily set admin rights
        // FIXME: once workspaces are cleaned up a better solution should be implemented
        $currentAdminStatus = $GLOBALS['BE_USER']->user['admin'];
        $GLOBALS['BE_USER']->user['admin'] = 1;
        // Select all workspaces that needs to be published / unpublished:
        $workspaces = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,swap_modes,publish_time,unpublish_time', 'sys_workspace', 'pid=0
				AND
				((publish_time!=0 AND publish_time<=' . intval($GLOBALS['EXEC_TIME']) . ')
				OR (publish_time=0 AND unpublish_time!=0 AND unpublish_time<=' . intval($GLOBALS['EXEC_TIME']) . '))' . t3lib_BEfunc::deleteClause('sys_workspace'));
        $workspaceService = t3lib_div::makeInstance('tx_Workspaces_Service_Workspaces');
        foreach ($workspaces as $rec) {
            // First, clear start/end time so it doesn't get select once again:
            $fieldArray = $rec['publish_time'] != 0 ? array('publish_time' => 0) : array('unpublish_time' => 0);
            $GLOBALS['TYPO3_DB']->exec_UPDATEquery('sys_workspace', 'uid=' . intval($rec['uid']), $fieldArray);
            // Get CMD array:
            $cmd = $workspaceService->getCmdArrayForPublishWS($rec['uid'], $rec['swap_modes'] == 1);
            // $rec['swap_modes']==1 means that auto-publishing will swap versions, not just publish and empty the workspace.
            // Execute CMD array:
            $tce = t3lib_div::makeInstance('t3lib_TCEmain');
            $tce->stripslashes_values = 0;
            $tce->start(array(), $cmd);
            $tce->process_cmdmap();
        }
        // Restore admin status
        $GLOBALS['BE_USER']->user['admin'] = $currentAdminStatus;
    }
 /**
  * Renders a record list as known from the TYPO3 list module
  * Note: This feature is experimental!
  *
  * @param string $tableName name of the database table
  * @param array $fieldList list of fields to be displayed. If empty, only the title column (configured in $TCA[$tableName]['ctrl']['title']) is shown
  * @param integer $storagePid by default, records are fetched from the storage PID configured in persistence.storagePid. With this argument, the storage PID can be overwritten
  * @param integer $levels corresponds to the level selector of the TYPO3 list module. By default only records from the current storagePid are fetched
  * @param string $filter corresponds to the "Search String" textbox of the TYPO3 list module. If not empty, only records matching the string will be fetched
  * @param integer $recordsPerPage amount of records to be displayed at once. Defaults to $TCA[$tableName]['interface']['maxSingleDBListItems'] or (if that's not set) to 100
  * @param string $sortField table field to sort the results by
  * @param boolean $sortDescending if TRUE records will be sorted in descending order
  * @param boolean $readOnly if TRUE, the edit icons won't be shown. Otherwise edit icons will be shown, if the current BE user has edit rights for the specified table!
  * @param boolean $enableClickMenu enables context menu
  * @param string $clickTitleMode one of "edit", "show" (only pages, tt_content), "info"
  * @param boolean $alternateBackgroundColors if set, rows will have alternate background colors
  * @return string the rendered record list
  * @see localRecordList
  */
 public function render($tableName, array $fieldList = array(), $storagePid = NULL, $levels = 0, $filter = '', $recordsPerPage = 0, $sortField = '', $sortDescending = FALSE, $readOnly = FALSE, $enableClickMenu = TRUE, $clickTitleMode = NULL, $alternateBackgroundColors = FALSE)
 {
     $pageinfo = t3lib_BEfunc::readPageAccess(t3lib_div::_GP('id'), $GLOBALS['BE_USER']->getPagePermsClause(1));
     $dblist = t3lib_div::makeInstance('localRecordList');
     $dblist->backPath = $GLOBALS['BACK_PATH'];
     $dblist->pageRow = $pageinfo;
     if ($readOnly === FALSE) {
         $dblist->calcPerms = $GLOBALS['BE_USER']->calcPerms($pageinfo);
     }
     $dblist->showClipboard = FALSE;
     $dblist->disableSingleTableView = TRUE;
     $dblist->clickTitleMode = $clickTitleMode;
     $dblist->alternateBgColors = $alternateBackgroundColors;
     $dblist->clickMenuEnabled = $enableClickMenu;
     if ($storagePid === NULL) {
         $frameworkConfiguration = $this->configurationManager->getConfiguration(Tx_Extbase_Configuration_ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
         $storagePid = $frameworkConfiguration['persistence']['storagePid'];
     }
     $dblist->start($storagePid, $tableName, (int) t3lib_div::_GP('pointer'), $filter, $levels, $recordsPerPage);
     $dblist->allFields = TRUE;
     $dblist->dontShowClipControlPanels = TRUE;
     $dblist->displayFields = FALSE;
     $dblist->setFields = array($tableName => $fieldList);
     $dblist->noControlPanels = TRUE;
     $dblist->sortField = $sortField;
     $dblist->sortRev = $sortDescending;
     $dblist->script = $_SERVER['REQUEST_URI'];
     $dblist->generateList();
     return $dblist->HTMLcode;
 }
 /**
  * Die dazu das aktuelle item für eine Detailseite zu holen bzw dieses zurückzusetzen.
  * Dazu muss den Linker einfach folgendes für den action namen liefern: "show" + den eigentlichen key.
  * 
  * Dann brauch man in der Detailansicht noch einen Button nach folgendem Schema:
  * $markerArray['###NEWSEARCHBTN###'] = $formTool->createSubmit('showHowTo[clear]', '###LABEL_BUTTON_BACK###'); 
  * 
  * @param string $key
  * @param tx_rnbase_mod_IModule $module
  * 
  * @return tx_rnbase_model_base
  */
 public static function getCurrentItem($key, tx_rnbase_mod_IModule $module)
 {
     $itemid = 0;
     $data = t3lib_div::_GP('show' . $key);
     if ($data) {
         list($itemid, ) = each($data);
     }
     $dataKey = 'current' . $key;
     if ($itemid === 'clear') {
         $data = t3lib_BEfunc::getModuleData(array($dataKey => ''), array($dataKey => '0'), $module->getName());
         return false;
     }
     // Daten mit Modul abgleichen
     $changed = $itemid ? array($dataKey => $itemid) : array();
     $data = t3lib_BEfunc::getModuleData(array($dataKey => ''), $changed, $module->getName());
     $itemid = $data[$dataKey];
     if (!$itemid) {
         return false;
     }
     $modelData = explode('|', $itemid);
     $item = tx_rnbase::makeInstance($modelData[0], $modelData[1]);
     if (!$item->isValid()) {
         $item = null;
         //auf null setzen damit die Suche wieder angezeigt wird
     }
     return $item;
 }
 /**
  * constructor
  *
  * @param	TYPO3backend	TYPO3 backend object reference
  */
 public function __construct(TYPO3backend &$backendReference = null)
 {
     $this->backendReference = $backendReference;
     $this->cacheActions = array();
     $this->optionValues = array('all', 'pages');
     // Clear cache for ALL tables!
     if ($GLOBALS['BE_USER']->isAdmin() || $GLOBALS['BE_USER']->getTSConfigVal('options.clearCache.all')) {
         $title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:rm.clearCacheMenu_all', true);
         $this->cacheActions[] = array('id' => 'all', 'title' => $title, 'href' => $this->backPath . 'tce_db.php?vC=' . $GLOBALS['BE_USER']->veriCode() . '&cacheCmd=all&ajaxCall=1' . t3lib_BEfunc::getUrlToken('tceAction'), 'icon' => t3lib_iconWorks::getSpriteIcon('actions-system-cache-clear-impact-high'));
     }
     // Clear cache for either ALL pages
     if ($GLOBALS['BE_USER']->isAdmin() || $GLOBALS['BE_USER']->getTSConfigVal('options.clearCache.pages')) {
         $title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:rm.clearCacheMenu_pages', true);
         $this->cacheActions[] = array('id' => 'pages', 'title' => $title, 'href' => $this->backPath . 'tce_db.php?vC=' . $GLOBALS['BE_USER']->veriCode() . '&cacheCmd=pages&ajaxCall=1' . t3lib_BEfunc::getUrlToken('tceAction'), 'icon' => t3lib_iconWorks::getSpriteIcon('actions-system-cache-clear-impact-medium'));
     }
     // Clearing of cache-files in typo3conf/ + menu
     if ($GLOBALS['BE_USER']->isAdmin() && $GLOBALS['TYPO3_CONF_VARS']['EXT']['extCache']) {
         $title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:rm.clearCacheMenu_allTypo3Conf', true);
         $this->cacheActions[] = array('id' => 'temp_CACHED', 'title' => $title, 'href' => $this->backPath . 'tce_db.php?vC=' . $GLOBALS['BE_USER']->veriCode() . '&cacheCmd=temp_CACHED&ajaxCall=1' . t3lib_BEfunc::getUrlToken('tceAction'), 'icon' => t3lib_iconWorks::getSpriteIcon('actions-system-cache-clear-impact-low'));
     }
     // hook for manipulate cacheActions
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['additionalBackendItems']['cacheActions'])) {
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['additionalBackendItems']['cacheActions'] as $cacheAction) {
             $hookObject = t3lib_div::getUserObj($cacheAction);
             if (!$hookObject instanceof backend_cacheActionsHook) {
                 throw new UnexpectedValueException('$hookObject must implement interface backend_cacheActionsHook', 1228262000);
             }
             $hookObject->manipulateCacheActions($this->cacheActions, $this->optionValues);
         }
     }
     t3lib_formprotection_Factory::get()->persistTokens();
 }
Beispiel #11
0
 /**
  * issue title
  *
  * @param object $parameters
  * @param object $parentObject
  *
  * @return void
  */
 public function issueTitle(&$parameters, $parentObject)
 {
     $titleLength = $GLOBALS['BE_USER']->uc['titleLen'] ? $GLOBALS['BE_USER']->uc['titleLen'] : 30;
     $record = t3lib_BEfunc::getRecord($parameters['table'], $parameters['row']['uid']);
     $newTitle = $record['extension'] . ': ' . $record['inspection'];
     $parameters['title'] = htmlspecialchars(t3lib_div::fixed_lgd_cs($newTitle, $titleLength));
 }
 /**
  * Returns a combined binary representation of the current users permissions for the page-record, $row.
  * The perms for user, group and everybody is OR'ed together (provided that the page-owner is the user and for the groups that the user is a member of the group
  * If the user is admin, 31 is returned	(full permissions for all five flags)
  *
  * @param	array		Input page row with all perms_* fields available.
  * @param	object		BE User Object
  * @return	integer		Bitwise representation of the users permissions in relation to input page row, $row
  */
 public function calcPerms($params, $that)
 {
     $row = $params['row'];
     $beAclConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['be_acl']);
     if (!$beAclConfig['disableOldPermissionSystem']) {
         $out = $params['outputPermissions'];
     } else {
         $out = 0;
     }
     $rootLine = t3lib_BEfunc::BEgetRootLine($row['uid']);
     $i = 0;
     $takeUserIntoAccount = 1;
     $groupIdsAlreadyUsed = array();
     foreach ($rootLine as $level => $values) {
         if ($i != 0) {
             $recursive = ' AND recursive=1';
         } else {
             $recursive = '';
         }
         $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tx_beacl_acl', 'pid=' . intval($values['uid']) . $recursive, '', 'recursive ASC');
         while ($result = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
             if ($result['type'] == 0 && $that->user['uid'] == $result['object_id'] && $takeUserIntoAccount) {
                 // user has to be taken into account
                 $out |= $result['permissions'];
                 $takeUserIntoAccount = 0;
             } elseif ($result['type'] == 1 && $that->isMemberOfGroup($result['object_id']) && !in_array($result['object_id'], $groupIdsAlreadyUsed)) {
                 $out |= $result['permissions'];
                 $groupIdsAlreadyUsed[] = $result['object_id'];
             }
         }
         $i++;
     }
     return $out;
 }
 /**
  * This method is the implementation of an abstract parent method.
  * The method should return the overlay record for a certain language.
  *
  * (non-PHPdoc)
  * @see classes/tx_languagevisibility_element#getOverLayRecordForCertainLanguageImplementation($languageId)
  */
 protected function getOverLayRecordForCertainLanguageImplementation($languageId)
 {
     $ctrl = $GLOBALS['TCA'][$this->table]['ctrl'];
     // we can't use the exclude fields here because we might loose (hidden) parent-records
     if (is_object($GLOBALS['TSFE']->sys_page)) {
         $excludeClause = $GLOBALS['TSFE']->sys_page->deleteClause($this->table);
     } else {
         $excludeClause = t3lib_BEfunc::deleteClause($this->table);
     }
     if (isset($ctrl['versioningWS']) && $ctrl['versioningWS'] > 0) {
         $workspaces = '0,' . $GLOBALS['BE_USER']->workspace;
         $workspaceCondition = 't3ver_wsid IN (' . rtrim($workspaces, ',') . ') AND ';
     } else {
         $workspaceCondition = '';
     }
     // Select overlay record (Live workspace, initial placeholders included):
     $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', $this->table, 'pid=' . intval($this->getPid()) . ' AND ' . $workspaceCondition . $ctrl['languageField'] . '=' . intval($languageId) . ($languageId > 0 ? ' AND ' . $ctrl['transOrigPointerField'] . '=' . intval($this->getUid()) : '') . $excludeClause, '', '', '1');
     $olrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
     $olrow = $this->getContextIndependentWorkspaceOverlay($this->table, $olrow);
     $GLOBALS['TYPO3_DB']->sql_free_result($res);
     if (!$this->getEnableFieldResult($olrow)) {
         $olrow = array();
     }
     return $olrow;
 }
Beispiel #14
0
 /**
  * Get the Records
  *
  * @param integer $startPage
  * @param array $basePages
  * @param Tx_GoogleServices_Controller_SitemapController $obj
  * @return Tx_GoogleServices_Domain_Model_Node
  */
 public function getRecords($startPage, $basePages, Tx_GoogleServices_Controller_SitemapController $obj)
 {
     $nodes = array();
     foreach ($basePages as $uid) {
         // Build URL
         $url = $obj->getUriBuilder()->setTargetPageUid($uid)->build();
         // can't generate a valid url
         if (!strlen($url)) {
             continue;
         }
         // Get Record
         $record = t3lib_BEfunc::getRecord('pages', $uid, "*", " AND tx_googleservicesext_hide_in_sitemap = 0");
         if (!is_array($record)) {
             continue;
         }
         // exclude Doctypes
         if (in_array($record['doktype'], array(4))) {
             continue;
         }
         // Build Node
         $node = new Tx_GoogleServices_Domain_Model_Node();
         $node->setLoc($url);
         $node->setPriority($this->getPriority($startPage, $record));
         $node->setChangefreq(Tx_GoogleServices_Service_SitemapDataService::mapTimeout2Period($record['cache_timeout']));
         $node->setLastmod($this->getModifiedDate($record));
         $nodes[] = $node;
     }
     return $nodes;
 }
    /**
     * Main function
     *
     * @return	void
     */
    function main()
    {
        switch ((string) t3lib_div::_GET('cmd')) {
            case 'menuitem':
                echo '
				<img src="gfx/x_t3logo.png" width="61" height="16" hspace="3" alt="" />';
                $menuItems = array(array('title' => 'About TYPO3', 'xurl' => 'http://typo3.com/', 'subitems' => array(array('title' => 'License', 'xurl' => 'http://typo3.com/License.1625.0.html'), array('title' => 'Support', 'subitems' => array(array('title' => 'Mailing lists', 'xurl' => 'http://lists.netfielders.de/cgi-bin/mailman/listinfo'), array('title' => 'Documentation', 'xurl' => 'http://typo3.org/documentation/'), array('title' => 'Find consultancy', 'xurl' => 'http://typo3.com/Consultancies.1248.0.html'))), array('title' => 'Contribute', 'xurl' => 'http://typo3.org/community/participate/'), array('title' => 'Donate', 'xurl' => 'http://typo3.com/Donations.1261.0.html', 'icon' => '1'))), array('title' => 'Extensions', 'url' => 'mod/tools/em/index.php'), array('title' => 'Menu preferences and such things', 'onclick' => 'alert("A dialog is now shown which will allow user configuration of items in the menu");event.stopPropagation();', 'state' => 'checked'), array('title' => '--div--'), array('title' => 'Recent Items', 'id' => $this->id . '_recent', 'subitems' => array(), 'html' => $this->menuItemObject($this->id . '_recent', '
							fetched: false,
							onActivate: function() {
//								if (!this.fetched)	{
									//Element.update("' . $this->id . '_recent-layer","asdfasdf");
									getElementContent("' . $this->id . '_recent-layer", 0, "logomenu.php?cmd=recent")
									this.fetched = true;
//								}
							}
						')), array('title' => '--div--'), array('title' => 'View frontend', 'xurl' => t3lib_div::getIndpEnv('TYPO3_SITE_URL')), array('title' => 'Log out', 'onclick' => "top.document.location='logout.php';"));
                echo $this->menuLayer($menuItems);
                break;
            case 'recent':
                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('sys_log.*, MAX(sys_log.tstamp) AS tstamp_MAX', 'sys_log,pages', 'pages.uid=sys_log.event_pid AND sys_log.userid=' . intval($GLOBALS['BE_USER']->user['uid']) . ' AND sys_log.event_pid>0 AND sys_log.type=1 AND sys_log.action=2 AND sys_log.error=0', 'tablename,recuid', 'tstamp_MAX DESC', 20);
                $items = array();
                while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                    $elRow = t3lib_BEfunc::getRecord($row['tablename'], $row['recuid']);
                    if (is_array($elRow)) {
                        $items[] = array('title' => t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getRecordTitle($row['tablename'], $elRow), $GLOBALS['BE_USER']->uc['titleLen']) . ' - ' . t3lib_BEfunc::calcAge($GLOBALS['EXEC_TIME'] - $row['tstamp_MAX']), 'icon' => array(t3lib_iconworks::getIcon($row['tablename'], $elRow), 'width="18" height="16"'), 'onclick' => 'content.' . t3lib_BEfunc::editOnClick('&edit[' . $row['tablename'] . '][' . $row['recuid'] . ']=edit', '', 'dummy.php'));
                    }
                }
                echo $this->menuItems($items);
                break;
        }
    }
 /**
  * Returns the New Icon with link
  *
  * @param string $table Table name
  * @param array $row Data row
  * @return string html output
  */
 protected function getNewIcon($table, array $row)
 {
     $params .= '&edit[' . $table . '][' . $row['storagePid'] . ']=new';
     $title = Tx_Extbase_Utility_Localization::translate('be.newEvent', 'woehrl_seminare', $arguments = NULL);
     $icon = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $this->backPath, -1)) . '" title="' . $title . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-new') . '</a>';
     return $icon;
 }
 /**
  * Main function
  *
  * @param clickMenu reference parent object
  * @param array menutitems for manipultation
  * @param string table name
  * @param int uid
  * @return array manipulated menuitems
  */
 function main(clickMenu $backRef, array $menuItems, $table, $uid)
 {
     if ($table != 'tx_crawler_configuration') {
         // early return without doing anything
         return $menuItems;
     }
     $localItems = array();
     $row = t3lib_BEfunc::getRecord($table, $uid, 'pid, name, processing_instruction_filter', '', true);
     if (!empty($row)) {
         if (version_compare(TYPO3_version, '4.5.0', '>=')) {
             $url = t3lib_extMgm::extRelPath('info') . 'mod1/index.php';
         } else {
             $url = $backRef->backPath . 'mod/web/info/index.php';
         }
         $url .= '?id=' . intval($row['pid']);
         $url .= '&SET[function]=tx_crawler_modfunc1';
         $url .= '&SET[crawlaction]=start';
         $url .= '&configurationSelection[]=' . $row['name'];
         foreach (t3lib_div::trimExplode(',', $row['processing_instruction_filter']) as $processing_instruction) {
             $url .= '&procInstructions[]=' . $processing_instruction;
         }
         // $onClick = $backRef->urlRefForCM($url);
         $onClick = "top.nextLoadModuleUrl='" . $url . "';top.goToModule('web_info',1);";
         $localItems[] = $backRef->linkItem('Crawl', $backRef->excludeIcon('<img src="' . $backRef->backPath . t3lib_extMgm::extRelPath('crawler') . 'icon_tx_crawler_configuration.gif" border="0" align="top" alt="" />'), $onClick, 0);
     }
     return array_merge($menuItems, $localItems);
 }
 private function prepareRecordsFrom($table)
 {
     $tableRows = $this->getExportableRowUids($table);
     foreach ($tableRows as $uid => $a) {
         $this->_txImpexpInstance->export_addRecord($table, t3lib_BEfunc::getRecord($table, $uid));
     }
 }
 /**
  * Obtains site URL.
  *
  * @static
  * @param int $pageId
  * @return string
  */
 protected static function getSiteUrl($pageId)
 {
     $domain = t3lib_BEfunc::firstDomainRecord(t3lib_BEfunc::BEgetRootLine($pageId));
     $pageRecord = t3lib_BEfunc::getRecord('pages', $pageId);
     $scheme = is_array($pageRecord) && isset($pageRecord['url_scheme']) && $pageRecord['url_scheme'] == t3lib_utility_Http::SCHEME_HTTPS ? 'https' : 'http';
     return $domain ? $scheme . '://' . $domain . '/' : t3lib_div::getIndpEnv('TYPO3_SITE_URL');
 }
 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');
         }
     }
 }
 /**
  * (non-PHPdoc)
  * @see classes/preview/tx_templavoila_preview_type_text#getPreviewData($row)
  */
 protected function getPreviewData($row)
 {
     $extraInfo = $this->getExtraInfo($row);
     $this->parentObj = $ref;
     $info = htmlspecialchars($GLOBALS['LANG']->sL(t3lib_BEfunc::getLabelFromItemlist('tt_content', 'list_type', $row['list_type'])));
     $info .= $extraInfo ? ' &ndash; ' . $extraInfo : '';
     return $info;
 }
 /**
  * Negative PID values is pointing to a page on the same level as the current.
  *
  * @param	int		$pid: The pid of the record
  * @return	The		real pid of a (new) record
  */
 function getStorageFolderPid($pid)
 {
     if ($pid < 0) {
         $pidRow = t3lib_BEfunc::getRecord('tt_content', abs($pid), 'pid');
         $pid = $pidRow['pid'];
     }
     return $pid;
 }
 /**
  * Main function
  *
  * @return	string		HTML output
  */
 function main()
 {
     $content = '';
     $content .= $this->pObj->getHeaderBar('', t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[tx_dam_tools_serviceinfo.func]', $this->pObj->MOD_SETTINGS['tx_dam_tools_serviceinfo.func'], $this->pObj->MOD_MENU['tx_dam_tools_serviceinfo.func']));
     $content .= $this->pObj->doc->spacer(10);
     $content .= $this->moduleContent();
     return $content;
 }
 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();
 }
 /**
  *
  * @return string;
  */
 public function getStoragePids()
 {
     $pids = array();
     $toList = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('tx_templavoila_tmplobj.uid,tx_templavoila_tmplobj.pid', 'tx_templavoila_tmplobj', 'tx_templavoila_tmplobj.datastructure=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this->filename, 'tx_templavoila_tmplobj') . t3lib_BEfunc::deleteClause('tx_templavoila_tmplobj'));
     foreach ($toList as $toRow) {
         $pids[$toRow['pid']]++;
     }
     return implode(',', array_keys($pids));
 }
 /**
  * Main function. Hook from t3lib/class.t3lib_tcemain.php
  *
  * @param	string		$status: Status of the current operation, 'new' or 'update
  * @param	string		$table: The table currently processing data for
  * @param	string		$id: The record uid currently processing data for, [integer] or [string] (like 'NEW...')
  * @param	array		$fieldArray: The field array of a record
  * @param	object		$reference: reference to parent object
  * @return	void
  */
 function processDatamap_afterDatabaseOperations($status, $table, $id, &$fieldArray, &$reference)
 {
     // Return if not the tx_dam_cat table or if status is not "new" or "update".
     if ($table != 'tx_dam_cat' || !($status == 'new' || $status == 'update')) {
         return;
     }
     // If not returned, update the dam_catedit tree.
     t3lib_BEfunc::setUpdateSignal('updateFolderTree');
 }
 /**
  * Render the sprite icon
  *
  * @param string $table table name
  * @param integer $uid uid of record
  * @param string $title title
  * @return string sprite icon
  */
 public function render($table, $uid, $title)
 {
     $icon = '';
     $row = t3lib_BEfunc::getRecord($table, $uid);
     if (is_array($row)) {
         $icon = t3lib_iconWorks::getSpriteIconForRecord($table, $row, array('title' => htmlspecialchars($title)));
     }
     return $icon;
 }
 /**
  * Main function
  *
  * @return	string		HTML output
  */
 function main()
 {
     global $LANG;
     $content = '';
     $content .= $this->pObj->getHeaderBar('', $LANG->getLL('tx_dam_tools_config.showConfig') . t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[tx_dam_tools_config.func]', $this->pObj->MOD_SETTINGS['tx_dam_tools_config.func'], $this->pObj->MOD_MENU['tx_dam_tools_config.func']));
     $content .= $this->pObj->doc->spacer(10);
     $content .= $this->moduleContent();
     return $content;
 }
	/**
	 * @param integer $uid
	 * @return array
	 */
	protected function getAllSubPages($uid) {
		$completeRecords = t3lib_BEfunc::getRecordsByField('pages', 'pid', $uid);
		$return = array($uid);
		if (count($completeRecords) > 0) {
			foreach ($completeRecords as $record) {
				$return = array_merge($return, $this->getAllSubPages($record['uid']));
			}
		}
		return $return;
	}
 /**
  * Render context sensitive help (CSH) for the given table
  *
  * @param string $table Table name ('_MOD_'+module name). If not set, the current module name will be used
  * @param string $field Field name (CSH locallang main key)
  * @param boolean $iconOnly If set, the full text will never be shown (only icon)
  * @param string $styleAttributes Additional style-attribute content for wrapping table (full text mode only)
  * @return string the rendered CSH icon
  * @see t3lib_BEfunc::cshItem
  */
 public function render($table = NULL, $field = '', $iconOnly = FALSE, $styleAttributes = '')
 {
     if ($table === NULL) {
         $currentRequest = $this->controllerContext->getRequest();
         $moduleName = $currentRequest->getPluginName();
         $table = '_MOD_' . $moduleName;
     }
     $cshButton = t3lib_BEfunc::cshItem($table, $field, $GLOBALS['BACK_PATH'], '', $iconOnly, $styleAttributes);
     return '<div class="docheader-csh">' . $cshButton . '</div>';
 }