当前位置: 首页>>代码示例>>PHP>>正文


PHP BackendUtility::BEenableFields方法代码示例

本文整理汇总了PHP中TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields方法的典型用法代码示例。如果您正苦于以下问题:PHP BackendUtility::BEenableFields方法的具体用法?PHP BackendUtility::BEenableFields怎么用?PHP BackendUtility::BEenableFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TYPO3\CMS\Backend\Utility\BackendUtility的用法示例。


在下文中一共展示了BackendUtility::BEenableFields方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 /**
  * Initializing global variables
  *
  * @return	void
  */
 function init()
 {
     $this->MCONF = $GLOBALS['MCONF'];
     parent::init();
     // initialize IconFactory
     $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
     $temp = BackendUtility::getModTSconfig($this->id, 'mod.web_modules.dmail');
     if (!is_array($temp['properties'])) {
         $temp['properties'] = array();
     }
     $this->params = $temp['properties'];
     $this->implodedParams = DirectMailUtility::implodeTSParams($this->params);
     if ($this->params['userTable'] && is_array($GLOBALS["TCA"][$this->params['userTable']])) {
         $this->userTable = $this->params['userTable'];
         $this->allowedTables[] = $this->userTable;
     }
     $this->MOD_MENU['dmail_mode'] = BackendUtility::unsetMenuItems($this->params, $this->MOD_MENU['dmail_mode'], 'menu.dmail_mode');
     // initialize backend user language
     if ($this->getLanguageService()->lang && ExtensionManagementUtility::isLoaded('static_info_tables')) {
         $res = $GLOBALS["TYPO3_DB"]->exec_SELECTquery('sys_language.uid', 'sys_language LEFT JOIN static_languages ON sys_language.static_lang_isocode=static_languages.uid', 'static_languages.lg_typo3=' . $GLOBALS["TYPO3_DB"]->fullQuoteStr($this->getLanguageService()->lang, 'static_languages') . BackendUtility::BEenableFields('sys_language') . BackendUtility::deleteClause('sys_language') . BackendUtility::deleteClause('static_languages'));
         while ($row = $GLOBALS["TYPO3_DB"]->sql_fetch_assoc($res)) {
             $this->sys_language_uid = $row['uid'];
         }
         $GLOBALS["TYPO3_DB"]->sql_free_result($res);
     }
     // load contextual help
     $this->cshTable = '_MOD_' . $this->MCONF['name'];
     if ($GLOBALS["BE_USER"]->uc['edit_showFieldHelp']) {
         $this->getLanguageService()->loadSingleTableDescription($this->cshTable);
     }
 }
开发者ID:Teddytrombone,项目名称:direct_mail,代码行数:36,代码来源:MailerEngine.php

示例2: preProcess

 /**
  * Processes the item to be rendered before the actual example content gets rendered
  * Deactivates the original example content output
  *
  * @param PageLayoutView $parentObject : The parent object that triggered this hook
  * @param boolean $drawItem : A switch to tell the parent object, if the item still must be drawn
  * @param string $headerContent : The content of the item header
  * @param string $itemContent : The content of the item itself
  * @param array $row : The current data row for this item
  *
  * @return    void
  */
 public function preProcess(PageLayoutView &$parentObject, &$drawItem, &$headerContent, &$itemContent, array &$row)
 {
     if ($row['CType']) {
         $showHidden = $parentObject->tt_contentConfig['showHidden'] ? '' : BackendUtility::BEenableFields('tt_content');
         $deleteClause = BackendUtility::deleteClause('tt_content');
         if ($GLOBALS['BE_USER']->uc['hideContentPreview']) {
             $drawItem = FALSE;
         }
         switch ($row['CType']) {
             case 'gridelements_pi1':
                 $drawItem = FALSE;
                 $itemContent .= $this->renderCTypeGridelements($parentObject, $row, $showHidden, $deleteClause);
                 $refIndexObj = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Database\\ReferenceIndex');
                 /* @var $refIndexObj \TYPO3\CMS\Core\Database\ReferenceIndex */
                 $refIndexObj->updateRefIndexTable('tt_content', $row['uid']);
                 break;
             case 'shortcut':
                 $drawItem = FALSE;
                 $itemContent .= $this->renderCTypeShortcut($parentObject, $row, $showHidden, $deleteClause);
                 break;
         }
     }
     $gridType = $row['tx_gridelements_backend_layout'] ? ' t3-gridtype-' . $row['tx_gridelements_backend_layout'] : '';
     $headerContent = '<div id="ce' . $row['uid'] . '" class="t3-ctype-' . $row['CType'] . $gridType . '">' . $headerContent . '</div>';
 }
开发者ID:blumenbach,项目名称:bb-online.neu,代码行数:37,代码来源:DrawItem.php

示例3: batchCreateAction

 /**
  * @return void
  */
 public function batchCreateAction()
 {
     $categories = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'sys_category', '1=1' . BackendUtility::BEenableFields('sys_category'), '', 'sorting', '', 'uid');
     foreach ($categories as $key => $category) {
         $level = 0;
         while ($category['parent'] > 0) {
             $category = $categories[$category['parent']];
             $level++;
         }
         $categories[$key]['title'] = str_repeat('- ', $level) . $categories[$key]['title'];
     }
     $this->view->assign('categories', $categories);
     if ($this->request->hasArgument('categories')) {
         $parents = array();
         if (!empty($this->request->getArgument('parent'))) {
             $parents[] = $this->request->getArgument('parent');
         }
         $categories = explode(chr(10), $this->request->getArgument('categories'));
         foreach ($categories as $category) {
             $category = rtrim($category);
             $depth = strlen($category) - strlen(ltrim($category, "\t"));
             $category = trim($category);
             $data = array('pid' => intval($_GET['id']), 'title' => $category, 'tstamp' => time(), 'crdate' => time(), 'parent' => isset($parents[$depth]) ? $parents[$depth] : 0);
             $GLOBALS['TYPO3_DB']->exec_INSERTquery('sys_category', $data);
             $parents[$depth + 1] = $GLOBALS['TYPO3_DB']->sql_insert_id();
         }
         $this->redirect('index');
     }
 }
开发者ID:mia3,项目名称:mia3_categories,代码行数:32,代码来源:CategoryController.php

示例4: runConversion

 /**
  * Runs conversion procedure.
  *
  * @return    string    Generated content
  */
 function runConversion()
 {
     $content = '';
     // Select all instances
     $res = $this->getDatabaseConnection()->exec_SELECTquery('uid,pid,pi_flexform', 'tt_content', 'list_type=\'irfaq_pi1\'' . BackendUtility::BEenableFields('tt_content') . BackendUtility::deleteClause('tt_content'));
     $results = $this->getDatabaseConnection()->sql_num_rows($res);
     $converted = 0;
     $data = array();
     $pidList = array();
     $replaceEmpty = intval(GeneralUtility::_GP('replaceEmpty'));
     /** @var \TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools $flexformtools */
     $flexformtools = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Configuration\\FlexForm\\FlexFormTools');
     /* @var $flexformtools t3lib_flexformtools */
     $GLOBALS['TYPO3_CONF_VARS']['BE']['compactFlexFormXML'] = true;
     $GLOBALS['TYPO3_CONF_VARS']['BE']['niceFlexFormXMLtags'] = true;
     // Walk all rows
     while (false !== ($row = $this->getDatabaseConnection()->sql_fetch_assoc($res))) {
         $ffArray = GeneralUtility::xml2array($row['pi_flexform']);
         $modified = false;
         if (is_array($ffArray) && isset($ffArray['data']['sDEF'])) {
             foreach ($ffArray['data']['sDEF'] as $sLang => $sLdata) {
                 foreach ($this->fieldSet as $sheet => $fieldList) {
                     foreach ($fieldList as $field) {
                         if (isset($ffArray['data']['sDEF'][$sLang][$field]) && isset($ffArray['data']['sDEF'][$sLang][$field]['vDEF']) && strlen($ffArray['data']['sDEF'][$sLang][$field]['vDEF']) > 0 && (!isset($ffArray['data'][$sheet][$sLang][$field]) || !isset($ffArray['data'][$sheet][$sLang][$field]['vDEF']) || $replaceEmpty && strlen($ffArray['data'][$sheet][$sLang][$field]['vDEF']) == 0)) {
                             $ffArray['data'][$sheet][$sLang][$field]['vDEF'] = $ffArray['data']['sDEF'][$sLang][$field]['vDEF'];
                             if ($row['pid'] > 0) {
                                 $pidList[$row['pid']] = $row['pid'];
                             }
                             $modified = true;
                         }
                     }
                 }
             }
         }
         if ($modified) {
             // Assemble data back
             $data['tt_content'][$row['uid']] = array('pi_flexform' => $flexformtools->flexArray2Xml($ffArray));
             $converted++;
         }
     }
     $this->getDatabaseConnection()->sql_free_result($res);
     if ($converted > 0) {
         // Update data
         /** @var \TYPO3\CMS\Core\DataHandling\DataHandler $tce */
         $tce = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\DataHandling\\DataHandler');
         /* @var $tce t3lib_TCEmain */
         $tce->start($data, null);
         $tce->process_datamap();
         if (count($tce->errorLog) > 0) {
             $content .= '<p>' . $this->lang->getLL('errors') . '</p><ul><li>' . implode('</li><li>', $tce->errorLog) . '</li></ul>';
         }
         // Clear cache
         foreach ($pidList as $pid) {
             $tce->clear_cacheCmd($pid);
         }
     }
     $content .= '<p>' . sprintf($this->lang->getLL('result'), $results, $converted) . '</p>';
     return $content;
 }
开发者ID:spoonerWeb,项目名称:irfaq,代码行数:64,代码来源:class.ext_update.php

示例5: enableFields

 /**
  * Enable fields for BE and FE
  *
  * @param string $table
  *
  * @return string
  */
 public function enableFields($table)
 {
     $where = '';
     if (TYPO3_MODE === 'FE') {
         $where .= GeneralUtility::getTsFe()->sys_page->enableFields($table);
     } else {
         $where .= BackendUtility::BEenableFields($table);
         $where .= BackendUtility::deleteClause($table);
     }
     return $where;
 }
开发者ID:dextar1,项目名称:t3extblog,代码行数:18,代码来源:AbstractRepository.php

示例6: getLanguages

 /**
  * Returns available language records.
  * The method stores the records in the property to speed up the process as the method can be often called.
  *
  * @return array
  */
 public function getLanguages()
 {
     if (is_null($this->languages)) {
         $tableName = 'sys_language';
         $clause = '1 = 1';
         $clause .= BackendUtility::deleteClause($tableName);
         $clause .= BackendUtility::BEenableFields($tableName);
         $this->languages = $this->getDatabaseConnection()->exec_SELECTgetRows('*', $tableName, $clause);
     }
     return $this->languages;
 }
开发者ID:BergischMedia,项目名称:vidi,代码行数:17,代码来源:LanguageService.php

示例7: addCityItems

 /**
  * add cities to selectbox.
  *
  * @param array                              $parentArray
  * @param \TYPO3\CMS\Backend\Form\FormEngine $fObj
  */
 public function addCityItems(array $parentArray, \TYPO3\CMS\Backend\Form\FormEngine $fObj)
 {
     $this->init();
     $rows = $this->database->exec_SELECTgetRows('city', 'tx_clubdirectory_domain_model_address', '1=1 ' . BackendUtility::BEenableFields('tx_clubdirectory_domain_model_address') . BackendUtility::deleteClause('tx_clubdirectory_domain_model_address'), 'city', 'city', '');
     foreach ($rows as $row) {
         $item = array();
         $item[0] = $row['city'];
         $item[1] = $row['city'];
         $item[2] = null;
         $parentArray['items'][] = $item;
     }
 }
开发者ID:jweiland-net,项目名称:clubdirectory,代码行数:18,代码来源:Cities.php

示例8: getSubPageIds

 /**
  * When the extend to subpages flag was set, we determine the affected subpages and return them.
  *
  * @param int $pageId
  * @return array
  */
 protected function getSubPageIds($pageId)
 {
     /** @var $queryGenerator \TYPO3\CMS\Core\Database\QueryGenerator */
     $queryGenerator = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Database\\QueryGenerator');
     // here we retrieve only the subpages of this page because the permission clause is not evaluated
     // on the root node.
     $permissionClause = ' 1 ' . BackendUtility::BEenableFields('pages');
     $treePageIdList = $queryGenerator->getTreeList($pageId, 20, 0, $permissionClause);
     $treePageIds = array_map('intval', explode(',', $treePageIdList));
     // the first one can be ignored because this is the page isself
     array_shift($treePageIds);
     return $treePageIds;
 }
开发者ID:sitegeist,项目名称:ext-solr,代码行数:19,代码来源:AbstractDataHandlerListener.php

示例9: findAll

 /**
  * Looks for all external calendars on a certain pid-list
  * 
  * @param string $pidList
  *        	to search in
  * @return array array of array (array of $rows)
  */
 function findAll($pidList)
 {
     $enableFields = '';
     $orderBy = \TYPO3\CMS\Cal\Utility\Functions::getOrderBy('tx_cal_calendar');
     if (TYPO3_MODE == 'BE') {
         $enableFields = BackendUtility::BEenableFields('tx_cal_calendar') . ' AND tx_cal_calendar.deleted = 0';
     } else {
         $enableFields = $this->cObj->enableFields('tx_cal_calendar');
     }
     $return = array();
     if ($pidList == '') {
         $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tx_cal_calendar', ' type IN (1,2) ' . $enableFields, '', $orderBy);
     } else {
         $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tx_cal_calendar', ' type IN (1,2) AND pid IN (' . $pidList . ') ' . $enableFields, '', $orderBy);
     }
     if ($result) {
         while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
             $return[] = $row;
         }
         $GLOBALS['TYPO3_DB']->sql_free_result($result);
     }
     return $return;
 }
开发者ID:ulrikkold,项目名称:cal,代码行数:30,代码来源:ICalendarService.php

示例10: run

 public function run($time, $notificationEmail, $testRunner)
 {
     $this->isTestRunner = $testRunner;
     $timestamp = $this->convertToTimeStamp($time);
     $this->sendNotificationEmail = !empty($notificationEmail);
     // update alle user
     // welche NICHT Administratoren sind
     // und einen lastlogin kleiner/gleich $timestamp haben
     // und lastlogin NICHT 0 ist -> die haben sich noch nicht eingeloggt
     // und nicht mit '_cli' beginnen
     $normalUser = ' admin=0
                     AND donotdisable=0' . ' AND lastLogin <=' . (int) $timestamp . ' AND lastLogin!=0' . ' AND username NOT LIKE "_cli_%"' . BackendUtility::deleteClause('be_users') . BackendUtility::BEenableFields('be_users');
     $this->disableUser($normalUser);
     // update alle user
     // welche NICHT Administratoren sind
     // und einen lastlogin GLEICH 0 haben -> die haben sich noch nicht eingeloggt
     // UND ein Erstellungsdatum kleiner/gleich $timestamp haben
     // und nicht mit '_cli' beginnen
     $userNeverLoggedIn = '  admin=0
                             AND lastLogin = 0' . ' AND donotdisable=0' . ' AND crdate <=' . (int) $timestamp . ' AND username NOT LIKE "_cli_%"' . BackendUtility::deleteClause('be_users') . BackendUtility::BEenableFields('be_users');
     $this->disableUser($userNeverLoggedIn);
     return $this->manageMailTransport($notificationEmail);
 }
开发者ID:sven-er,项目名称:disable_beuser,代码行数:23,代码来源:DisableBeuser.php

示例11: buildJSAcronymArray

 /**
  * Return an acronym array for the Acronym plugin
  *
  * @return 	string		acronym Javascript array
  * @todo Define visibility
  */
 public function buildJSAcronymArray($languageUid)
 {
     $button = 'acronym';
     $acronymArray = array();
     $abbrArray = array();
     $tableA = 'tx_rtehtmlarea_acronym';
     $tableB = 'static_languages';
     $fields = $tableA . '.type,' . $tableA . '.term,' . $tableA . '.acronym,' . $tableB . '.lg_iso_2,' . $tableB . '.lg_country_iso_2';
     $tableAB = $tableA . ' LEFT JOIN ' . $tableB . ' ON ' . $tableA . '.static_lang_isocode=' . $tableB . '.uid';
     $whereClause = '1=1';
     // Get all acronyms on pages to which the user has access
     $lockBeUserToDBmounts = isset($this->thisConfig['buttons.'][$button . '.']['lockBeUserToDBmounts']) ? $this->thisConfig['buttons.'][$button . '.']['lockBeUserToDBmounts'] : $GLOBALS['TYPO3_CONF_VARS']['BE']['lockBeUserToDBmounts'];
     if (!$GLOBALS['BE_USER']->isAdmin() && $GLOBALS['TYPO3_CONF_VARS']['BE']['lockBeUserToDBmounts'] && $lockBeUserToDBmounts) {
         // Temporarily setting alternative web browsing mounts
         $altMountPoints = trim($GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.altElementBrowserMountPoints'));
         if ($altMountPoints) {
             $savedGroupDataWebmounts = $GLOBALS['BE_USER']->groupData['webmounts'];
             $GLOBALS['BE_USER']->groupData['webmounts'] = implode(',', array_unique(\TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $altMountPoints)));
             $GLOBALS['WEBMOUNTS'] = $GLOBALS['BE_USER']->returnWebmounts();
         }
         $webMounts = $GLOBALS['BE_USER']->returnWebmounts();
         $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
         $recursive = isset($this->thisConfig['buttons.'][$button . '.']['recursive']) ? intval($this->thisConfig['buttons.'][$button . '.']['recursive']) : 0;
         if (trim($this->thisConfig['buttons.'][$button . '.']['pages'])) {
             $pids = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->thisConfig['buttons.'][$button . '.']['pages'], 1);
             foreach ($pids as $key => $val) {
                 if (!$GLOBALS['BE_USER']->isInWebMount($val, $perms_clause)) {
                     unset($pids[$key]);
                 }
             }
         } else {
             $pids = $webMounts;
         }
         // Restoring webmounts
         if ($altMountPoints) {
             $GLOBALS['BE_USER']->groupData['webmounts'] = $savedGroupDataWebmounts;
             $GLOBALS['WEBMOUNTS'] = $GLOBALS['BE_USER']->returnWebmounts();
         }
         $queryGenerator = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Database\\QueryGenerator');
         foreach ($pids as $key => $val) {
             if ($pageTree) {
                 $pageTreePrefix = ',';
             }
             $pageTree .= $pageTreePrefix . $queryGenerator->getTreeList($val, $recursive, $begin = 0, $perms_clause);
         }
         $whereClause .= ' AND ' . $tableA . '.pid IN (' . $GLOBALS['TYPO3_DB']->fullQuoteStr($pageTree ? $pageTree : '', $tableA) . ')';
     }
     // Restrict to acronyms applicable to the language of current content element
     if ($this->htmlAreaRTE->contentLanguageUid > -1) {
         $whereClause .= ' AND (' . $tableA . '.sys_language_uid=' . $this->htmlAreaRTE->contentLanguageUid . ' OR ' . $tableA . '.sys_language_uid=-1) ';
     }
     // Restrict to acronyms in certain languages
     if (is_array($this->thisConfig['buttons.']) && is_array($this->thisConfig['buttons.']['language.']) && isset($this->thisConfig['buttons.']['language.']['restrictToItems'])) {
         $languageList = implode('\',\'', \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $GLOBALS['TYPO3_DB']->fullQuoteStr(strtoupper($this->thisConfig['buttons.']['language.']['restrictToItems']), $tableB)));
         $whereClause .= ' AND ' . $tableB . '.lg_iso_2 IN (' . $languageList . ') ';
     }
     $whereClause .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($tableA);
     $whereClause .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($tableA);
     $whereClause .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($tableB);
     $whereClause .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($tableB);
     $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, $tableAB, $whereClause);
     while ($acronymRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
         $item = array('term' => $acronymRow['term'], 'abbr' => $acronymRow['acronym'], 'language' => strtolower($acronymRow['lg_iso_2']) . ($acronymRow['lg_country_iso_2'] ? '-' . $acronymRow['lg_country_iso_2'] : ''));
         if ($acronymRow['type'] == 1) {
             $acronymArray[] = $item;
         } elseif ($acronymRow['type'] == 2) {
             $abbrArray[] = $item;
         }
     }
     $this->acronymIndex = count($acronymArray);
     $this->abbreviationIndex = count($abbrArray);
     return json_encode(array('abbr' => $abbrArray, 'acronym' => $acronymArray));
 }
开发者ID:nicksergio,项目名称:TYPO3v4-Core,代码行数:79,代码来源:Acronym.php

示例12: printContentElementColumns

 /**
  * Creates HTML for inserting/moving content elements.
  *
  * @param int $pid page id onto which to insert content element.
  * @param int $moveUid Move-uid (tt_content element uid?)
  * @param string $colPosList List of columns to show
  * @param bool $showHidden If not set, then hidden/starttime/endtime records are filtered out.
  * @param string $R_URI Request URI
  * @return string HTML
  */
 public function printContentElementColumns($pid, $moveUid, $colPosList, $showHidden, $R_URI)
 {
     $this->R_URI = $R_URI;
     $this->moveUid = $moveUid;
     $colPosArray = GeneralUtility::trimExplode(',', $colPosList, TRUE);
     $lines = array();
     foreach ($colPosArray as $kk => $vv) {
         $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tt_content', 'pid=' . (int) $pid . ($showHidden ? '' : BackendUtility::BEenableFields('tt_content')) . ' AND colPos=' . (int) $vv . ((string) $this->cur_sys_language !== '' ? ' AND sys_language_uid=' . (int) $this->cur_sys_language : '') . BackendUtility::deleteClause('tt_content') . BackendUtility::versioningPlaceholderClause('tt_content'), '', 'sorting');
         $lines[$vv] = array();
         $lines[$vv][] = $this->insertPositionIcon('', $vv, $kk, $moveUid, $pid);
         while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
             BackendUtility::workspaceOL('tt_content', $row);
             if (is_array($row)) {
                 $lines[$vv][] = $this->wrapRecordHeader($this->getRecordHeader($row), $row);
                 $lines[$vv][] = $this->insertPositionIcon($row, $vv, $kk, $moveUid, $pid);
             }
         }
         $GLOBALS['TYPO3_DB']->sql_free_result($res);
     }
     return $this->printRecordMap($lines, $colPosArray, $pid);
 }
开发者ID:plan2net,项目名称:TYPO3.CMS,代码行数:31,代码来源:PagePositionMap.php

示例13: getLanguages

 /**
  * Getting all languages into an array
  * where the key is the ISO alpha-2 code of the language
  * and where the value are the name of the language in the current language
  * Note: we exclude sacred and constructed languages
  *
  * @return array An array of names of languages
  */
 protected function getLanguages()
 {
     $databaseConnection = $this->getDatabaseConnection();
     $nameArray = array();
     if (ExtensionManagementUtility::isLoaded('static_info_tables')) {
         $where = '1=1';
         $table = 'static_languages';
         $lang = LocalizationUtility::getCurrentLanguage();
         $titleFields = LocalizationUtility::getLabelFields($table, $lang);
         $prefixedTitleFields = array();
         foreach ($titleFields as $titleField) {
             $prefixedTitleFields[] = $table . '.' . $titleField;
         }
         $labelFields = implode(',', $prefixedTitleFields);
         // Restrict to certain languages
         if (is_array($this->configuration['thisConfig']['buttons.']) && is_array($this->configuration['thisConfig']['buttons.']['language.']) && isset($this->configuration['thisConfig']['buttons.']['language.']['restrictToItems'])) {
             $languageList = implode('\',\'', GeneralUtility::trimExplode(',', $databaseConnection->fullQuoteStr(strtoupper($this->configuration['thisConfig']['buttons.']['language.']['restrictToItems']), $table)));
             $where .= ' AND ' . $table . '.lg_iso_2 IN (' . $languageList . ')';
         }
         $res = $databaseConnection->exec_SELECTquery($table . '.lg_iso_2,' . $table . '.lg_country_iso_2,' . $labelFields, $table, $where . ' AND lg_constructed = 0 ' . BackendUtility::BEenableFields($table) . BackendUtility::deleteClause($table));
         $prefixLabelWithCode = (bool) $this->configuration['thisConfig']['buttons.']['language.']['prefixLabelWithCode'];
         $postfixLabelWithCode = (bool) $this->configuration['thisConfig']['buttons.']['language.']['postfixLabelWithCode'];
         while ($row = $databaseConnection->sql_fetch_assoc($res)) {
             $code = strtolower($row['lg_iso_2']) . ($row['lg_country_iso_2'] ? '-' . strtoupper($row['lg_country_iso_2']) : '');
             foreach ($titleFields as $titleField) {
                 if ($row[$titleField]) {
                     $nameArray[$code] = $prefixLabelWithCode ? $code . ' - ' . $row[$titleField] : ($postfixLabelWithCode ? $row[$titleField] . ' - ' . $code : $row[$titleField]);
                     break;
                 }
             }
         }
         $databaseConnection->sql_free_result($res);
         uasort($nameArray, 'strcoll');
     }
     return $nameArray;
 }
开发者ID:plan2net,项目名称:TYPO3.CMS,代码行数:44,代码来源:Language.php

示例14: checkSchedulerUser

 /**
  * This method checks the status of the '_cli_scheduler' user
  * It will differentiate between a non-existing user and an existing,
  * but disabled user (as per enable fields)
  *
  * @return integer	-1	if user doesn't exist
  */
 protected function checkSchedulerUser()
 {
     $schedulerUserStatus = -1;
     // Assemble base WHERE clause
     $where = 'username = \'_cli_scheduler\' AND admin = 0' . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('be_users');
     // Check if user exists at all
     $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('1', 'be_users', $where);
     if ($GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
         $schedulerUserStatus = 0;
         // Check if user exists and is enabled
         $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('1', 'be_users', $where . \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('be_users'));
         if ($GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
             $schedulerUserStatus = 1;
         }
     }
     $GLOBALS['TYPO3_DB']->sql_free_result($res);
     return $schedulerUserStatus;
 }
开发者ID:noxludo,项目名称:TYPO3v4-Core,代码行数:25,代码来源:SchedulerModuleController.php

示例15: getRegisteredTaskGroups

 /**
  * This method fetches list of all group that have been registered with the Scheduler
  *
  * @return array List of registered groups
  */
 protected function getRegisteredTaskGroups()
 {
     $list = array();
     // Get all registered task groups
     $query = array('SELECT' => '*', 'FROM' => 'tx_scheduler_task_group', 'WHERE' => '1=1' . BackendUtility::BEenableFields('tx_scheduler_task_group') . BackendUtility::deleteClause('tx_scheduler_task_group'), 'ORDERBY' => 'sorting');
     $res = $this->getDatabaseConnection()->exec_SELECT_queryArray($query);
     while (($groupRecord = $this->getDatabaseConnection()->sql_fetch_assoc($res)) !== false) {
         $list[] = $groupRecord;
     }
     $this->getDatabaseConnection()->sql_free_result($res);
     return $list;
 }
开发者ID:dachcom-digital,项目名称:TYPO3.CMS,代码行数:17,代码来源:SchedulerModuleController.php


注:本文中的TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。