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


PHP BackendUtility::datetime方法代码示例

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


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

示例1: getHistoryEntry

 /**
  * Gets the human readable representation of one
  * record history entry.
  *
  * @param array $entry Record history entry
  * @return array
  * @see getHistory
  */
 protected function getHistoryEntry(array $entry)
 {
     if (!empty($entry['action'])) {
         $differences = $entry['action'];
     } else {
         $differences = $this->getDifferences($entry);
     }
     return array('datetime' => htmlspecialchars(BackendUtility::datetime($entry['tstamp'])), 'user' => htmlspecialchars($this->getUserName($entry['user'])), 'differences' => $differences);
 }
开发者ID:plan2net,项目名称:TYPO3.CMS,代码行数:17,代码来源:HistoryService.php

示例2: main

 /**
  * Find syslog
  *
  * @return array
  */
 public function main()
 {
     // Initialize result array:
     $resultArray = array('message' => $this->cli_help['name'] . LF . LF . $this->cli_help['description'], 'headers' => array('listing' => array('', '', 1), 'allDetails' => array('', '', 0)), 'listing' => array(), 'allDetails' => array());
     $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'sys_log', 'tstamp>' . ($GLOBALS['EXEC_TIME'] - 25 * 3600));
     foreach ($rows as $r) {
         $l = unserialize($r['log_data']);
         $explained = '#' . $r['uid'] . ' ' . \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($r['tstamp']) . ' USER[' . $r['userid'] . ']: ' . sprintf($r['details'], $l[0], $l[1], $l[2], $l[3], $l[4], $l[5]);
         $resultArray['listing'][$r['uid']] = $explained;
         $resultArray['allDetails'][$r['uid']] = array($explained, \TYPO3\CMS\Core\Utility\GeneralUtility::arrayToLogString($r, 'uid,userid,action,recuid,tablename,recpid,error,tstamp,type,details_nr,IP,event_pid,NEWid,workspace'));
     }
     return $resultArray;
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:18,代码来源:SyslogCommand.php

示例3: getReferenceIndexStatus

 /**
  * Checks if sys_refindex is empty.
  *
  * @return \TYPO3\CMS\Reports\Status An object representing whether the reference index is empty or not
  */
 protected function getReferenceIndexStatus()
 {
     $value = $this->getLanguageService()->getLL('status_ok');
     $message = '';
     $severity = ReportStatus::OK;
     $count = $this->getDatabaseConnection()->exec_SELECTcountRows('*', 'sys_refindex');
     $registry = GeneralUtility::makeInstance(Registry::class);
     $lastRefIndexUpdate = $registry->get('core', 'sys_refindex_lastUpdate');
     if (!$count && $lastRefIndexUpdate) {
         $value = $this->getLanguageService()->getLL('status_empty');
         $severity = ReportStatus::WARNING;
         $url = BackendUtility::getModuleUrl('system_dbint') . '&id=0&SET[function]=refindex';
         $message = sprintf($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:warning.backend_reference_index'), '<a href="' . htmlspecialchars($url) . '">', '</a>', BackendUtility::datetime($lastRefIndexUpdate));
     }
     return GeneralUtility::makeInstance(ReportStatus::class, $this->getLanguageService()->getLL('status_referenceIndex'), $value, $message, $severity);
 }
开发者ID:dachcom-digital,项目名称:TYPO3.CMS,代码行数:21,代码来源:ConfigurationStatus.php

示例4: transform

 /**
  * Transforms the rows for the deleted Records into the Array View necessary for ExtJS Ext.data.ArrayReader
  *
  * @param array     $rows   Array with table as key and array with all deleted rows
  * @param integer	$totalDeleted: Number of deleted records in total, for PagingToolbar
  * @return string   JSON Array
  */
 public function transform($deletedRowsArray, $totalDeleted)
 {
     $total = 0;
     $jsonArray = array('rows' => array());
     // iterate
     if (is_array($deletedRowsArray) && count($deletedRowsArray) > 0) {
         foreach ($deletedRowsArray as $table => $rows) {
             $total += count($deletedRowsArray[$table]);
             foreach ($rows as $row) {
                 $backendUser = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('be_users', $row[$GLOBALS['TCA'][$table]['ctrl']['cruser_id']], 'username', '', FALSE);
                 $jsonArray['rows'][] = array('uid' => $row['uid'], 'pid' => $row['pid'], 'table' => $table, 'crdate' => \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($row[$GLOBALS['TCA'][$table]['ctrl']['crdate']]), 'tstamp' => \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($row[$GLOBALS['TCA'][$table]['ctrl']['tstamp']]), 'owner' => htmlspecialchars($backendUser['username']), 'owner_uid' => $row[$GLOBALS['TCA'][$table]['ctrl']['cruser_id']], 'tableTitle' => \TYPO3\CMS\Recycler\Utility\RecyclerUtility::getUtf8String($GLOBALS['LANG']->sL($GLOBALS['TCA'][$table]['ctrl']['title'])), 'title' => htmlspecialchars(\TYPO3\CMS\Recycler\Utility\RecyclerUtility::getUtf8String(\TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle($table, $row))), 'path' => \TYPO3\CMS\Recycler\Utility\RecyclerUtility::getRecordPath($row['pid']));
             }
         }
     }
     $jsonArray['total'] = $totalDeleted;
     return json_encode($jsonArray);
 }
开发者ID:noxludo,项目名称:TYPO3v4-Core,代码行数:24,代码来源:DeletedRecordsController.php

示例5: transform

 /**
  * Transforms the rows for the deleted records
  *
  * @param array $deletedRowsArray Array with table as key and array with all deleted rows
  * @param int $totalDeleted Number of deleted records in total
  * @return string JSON array
  */
 public function transform($deletedRowsArray, $totalDeleted)
 {
     $total = 0;
     $jsonArray = array('rows' => array());
     if (is_array($deletedRowsArray)) {
         $lang = $this->getLanguageService();
         $backendUser = $this->getBackendUser();
         foreach ($deletedRowsArray as $table => $rows) {
             $total += count($deletedRowsArray[$table]);
             foreach ($rows as $row) {
                 $pageTitle = $this->getPageTitle((int) $row['pid']);
                 $backendUser = BackendUtility::getRecord('be_users', $row[$GLOBALS['TCA'][$table]['ctrl']['cruser_id']], 'username', '', FALSE);
                 $jsonArray['rows'][] = array('uid' => $row['uid'], 'pid' => $row['pid'], 'icon' => IconUtility::getSpriteIconForRecord($table, $row), 'pageTitle' => RecyclerUtility::getUtf8String($pageTitle), 'table' => $table, 'crdate' => BackendUtility::datetime($row[$GLOBALS['TCA'][$table]['ctrl']['crdate']]), 'tstamp' => BackendUtility::datetime($row[$GLOBALS['TCA'][$table]['ctrl']['tstamp']]), 'owner' => htmlspecialchars($backendUser['username']), 'owner_uid' => $row[$GLOBALS['TCA'][$table]['ctrl']['cruser_id']], 'tableTitle' => RecyclerUtility::getUtf8String($lang->sL($GLOBALS['TCA'][$table]['ctrl']['title'])), 'title' => htmlspecialchars(RecyclerUtility::getUtf8String(BackendUtility::getRecordTitle($table, $row))), 'path' => RecyclerUtility::getRecordPath($row['pid']));
             }
         }
     }
     $jsonArray['total'] = $totalDeleted;
     return $jsonArray;
 }
开发者ID:plan2net,项目名称:TYPO3.CMS,代码行数:26,代码来源:DeletedRecordsController.php

示例6: transform

 /**
  * Transforms the rows for the deleted records
  *
  * @param array $deletedRowsArray Array with table as key and array with all deleted rows
  * @param int $totalDeleted Number of deleted records in total
  * @return string JSON array
  */
 public function transform($deletedRowsArray, $totalDeleted)
 {
     $total = 0;
     $jsonArray = array('rows' => array());
     if (is_array($deletedRowsArray)) {
         $lang = $this->getLanguageService();
         $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
         foreach ($deletedRowsArray as $table => $rows) {
             $total += count($deletedRowsArray[$table]);
             foreach ($rows as $row) {
                 $pageTitle = $this->getPageTitle((int) $row['pid']);
                 $backendUser = BackendUtility::getRecord('be_users', $row[$GLOBALS['TCA'][$table]['ctrl']['cruser_id']], 'username', '', false);
                 $jsonArray['rows'][] = array('uid' => $row['uid'], 'pid' => $row['pid'], 'icon' => $iconFactory->getIconForRecord($table, $row, Icon::SIZE_SMALL)->render(), 'pageTitle' => $pageTitle, 'table' => $table, 'crdate' => BackendUtility::datetime($row[$GLOBALS['TCA'][$table]['ctrl']['crdate']]), 'tstamp' => BackendUtility::datetime($row[$GLOBALS['TCA'][$table]['ctrl']['tstamp']]), 'owner' => htmlspecialchars($backendUser['username']), 'owner_uid' => $row[$GLOBALS['TCA'][$table]['ctrl']['cruser_id']], 'tableTitle' => $lang->sL($GLOBALS['TCA'][$table]['ctrl']['title']), 'title' => htmlspecialchars(BackendUtility::getRecordTitle($table, $row)), 'path' => RecyclerUtility::getRecordPath($row['pid']));
             }
         }
     }
     $jsonArray['total'] = $totalDeleted;
     return $jsonArray;
 }
开发者ID:vip3out,项目名称:TYPO3.CMS,代码行数:26,代码来源:DeletedRecordsController.php

示例7: htmlspecialchars

 /**
  * Show the compact information of a direct mail record
  *
  * @param array $row Direct mail record
  *
  * @return string The compact infos of the direct mail record
  */
 function directMail_compactView($row)
 {
     // Render record:
     if ($row['type']) {
         $dmailData = $row['plainParams'] . ', ' . $row['HTMLParams'];
     } else {
         $page = BackendUtility::getRecord('pages', $row['page'], 'title');
         $dmailData = $row['page'] . ', ' . htmlspecialchars($page['title']);
         $dmailInfo = DirectMailUtility::fName('plainParams') . ' ' . htmlspecialchars($row['plainParams'] . LF . DirectMailUtility::fName('HTMLParams') . $row['HTMLParams']) . '; ' . LF;
     }
     $dmailInfo .= $this->getLanguageService()->getLL('view_media') . ' ' . BackendUtility::getProcessedValue('sys_dmail', 'includeMedia', $row['includeMedia']) . '; ' . LF . $this->getLanguageService()->getLL('view_flowed') . ' ' . BackendUtility::getProcessedValue('sys_dmail', 'flowedFormat', $row['flowedFormat']);
     $dmailInfo = '<span title="' . $dmailInfo . '">' . $this->iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL) . '</span>';
     $fromInfo = $this->getLanguageService()->getLL('view_replyto') . ' ' . htmlspecialchars($row['replyto_name'] . ' <' . $row['replyto_email'] . '>') . '; ' . LF . DirectMailUtility::fName('organisation') . ' ' . htmlspecialchars($row['organisation']) . '; ' . LF . DirectMailUtility::fName('return_path') . ' ' . htmlspecialchars($row['return_path']);
     $fromInfo = '<span title="' . $fromInfo . '">' . $this->iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL) . '</span>';
     $mailInfo = DirectMailUtility::fName('priority') . ' ' . BackendUtility::getProcessedValue('sys_dmail', 'priority', $row['priority']) . '; ' . LF . DirectMailUtility::fName('encoding') . ' ' . BackendUtility::getProcessedValue('sys_dmail', 'encoding', $row['encoding']) . '; ' . LF . DirectMailUtility::fName('charset') . ' ' . BackendUtility::getProcessedValue('sys_dmail', 'charset', $row['charset']);
     $mailInfo = '<span title="' . $mailInfo . '">' . $this->iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL) . '</span>';
     $delBegin = $row["scheduled_begin"] ? BackendUtility::datetime($row["scheduled_begin"]) : '-';
     $delEnd = $row["scheduled_end"] ? BackendUtility::datetime($row["scheduled_begin"]) : '-';
     // count total recipient from the query_info
     $totalRecip = 0;
     $idLists = unserialize($row['query_info']);
     foreach ($idLists['id_lists'] as $idArray) {
         $totalRecip += count($idArray);
     }
     $sentRecip = $GLOBALS['TYPO3_DB']->sql_num_rows($GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_dmail_maillog', 'mid=' . $row['uid'] . ' AND response_type = 0', '', 'rid ASC'));
     $out = '<table class="table table-striped table-hover">';
     $out .= '<tr class="t3-row-header"><td colspan="3">' . $this->iconFactory->getIconForRecord('sys_dmail', $row)->render() . htmlspecialchars($row['subject']) . '</td></tr>';
     $out .= '<tr class="db_list_normal"><td>' . $this->getLanguageService()->getLL('view_from') . '</td>' . '<td>' . htmlspecialchars($row['from_name'] . ' <' . htmlspecialchars($row['from_email']) . '>') . '</td>' . '<td>' . $fromInfo . '</td></tr>';
     $out .= '<tr class="db_list_normal"><td>' . $this->getLanguageService()->getLL('view_dmail') . '</td>' . '<td>' . BackendUtility::getProcessedValue('sys_dmail', 'type', $row['type']) . ': ' . $dmailData . '</td>' . '<td>' . $dmailInfo . '</td></tr>';
     $out .= '<tr class="db_list_normal"><td>' . $this->getLanguageService()->getLL('view_mail') . '</td>' . '<td>' . BackendUtility::getProcessedValue('sys_dmail', 'sendOptions', $row['sendOptions']) . ($row['attachment'] ? '; ' : '') . BackendUtility::getProcessedValue('sys_dmail', 'attachment', $row['attachment']) . '</td>' . '<td>' . $mailInfo . '</td></tr>';
     $out .= '<tr class="db_list_normal"><td>' . $this->getLanguageService()->getLL('view_delivery_begin_end') . '</td>' . '<td>' . $delBegin . ' / ' . $delEnd . '</td>' . '<td>&nbsp;</td></tr>';
     $out .= '<tr class="db_list_normal"><td>' . $this->getLanguageService()->getLL('view_recipient_total_sent') . '</td>' . '<td>' . $totalRecip . ' / ' . $sentRecip . '</td>' . '<td>&nbsp;</td></tr>';
     $out .= '</table>';
     $out .= '<div style="padding-top: 5px;"></div>';
     return $out;
 }
开发者ID:Teddytrombone,项目名称:direct_mail,代码行数:43,代码来源:Statistics.php

示例8: displayHistory

 /**
  * Shows the full change log
  *
  * @return string HTML for list, wrapped in a table.
  */
 public function displayHistory()
 {
     if (empty($this->changeLog)) {
         return '';
     }
     $languageService = $this->getLanguageService();
     $lines = array();
     $beUserArray = BackendUtility::getUserNames();
     $i = 0;
     // Traverse changeLog array:
     foreach ($this->changeLog as $sysLogUid => $entry) {
         // stop after maxSteps
         if ($this->maxSteps && $i > $this->maxSteps) {
             break;
         }
         // Show only marked states
         if (!$entry['snapshot'] && $this->showMarked) {
             continue;
         }
         $i++;
         // Build up single line
         $singleLine = array();
         // Get user names
         $userName = $entry['user'] ? $beUserArray[$entry['user']]['username'] : $languageService->getLL('externalChange');
         // Executed by switch-user
         if (!empty($entry['originalUser'])) {
             $userName .= ' (' . $languageService->getLL('viaUser') . ' ' . $beUserArray[$entry['originalUser']]['username'] . ')';
         }
         $singleLine['backendUserName'] = htmlspecialchars($userName);
         $singleLine['backendUserUid'] = $entry['user'];
         // add user name
         // Diff link
         $image = $this->iconFactory->getIcon('actions-document-history-open', Icon::SIZE_SMALL)->render();
         $singleLine['rollbackLink'] = $this->linkPage($image, array('diff' => $sysLogUid));
         // remove first link
         $singleLine['time'] = htmlspecialchars(BackendUtility::datetime($entry['tstamp']));
         // add time
         $singleLine['age'] = htmlspecialchars(BackendUtility::calcAge($GLOBALS['EXEC_TIME'] - $entry['tstamp'], $languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.minutesHoursDaysYears')));
         // add age
         $singleLine['tableUid'] = $this->linkPage($this->generateTitle($entry['tablename'], $entry['recuid']), array('element' => $entry['tablename'] . ':' . $entry['recuid']), '', $languageService->getLL('linkRecordHistory', true));
         // add record UID
         // Show insert/delete/diff/changed field names
         if ($entry['action']) {
             // insert or delete of element
             $singleLine['action'] = htmlspecialchars($languageService->getLL($entry['action'], true));
         } else {
             // Display field names instead of full diff
             if (!$this->showDiff) {
                 // Re-write field names with labels
                 $tmpFieldList = explode(',', $entry['fieldlist']);
                 foreach ($tmpFieldList as $key => $value) {
                     $tmp = str_replace(':', '', $languageService->sL(BackendUtility::getItemLabel($entry['tablename'], $value), true));
                     if ($tmp) {
                         $tmpFieldList[$key] = $tmp;
                     } else {
                         // remove fields if no label available
                         unset($tmpFieldList[$key]);
                     }
                 }
                 $singleLine['fieldNames'] = htmlspecialchars(implode(',', $tmpFieldList));
             } else {
                 // Display diff
                 $diff = $this->renderDiff($entry, $entry['tablename']);
                 $singleLine['differences'] = $diff;
             }
         }
         // Show link to mark/unmark state
         if (!$entry['action']) {
             if ($entry['snapshot']) {
                 $title = $languageService->getLL('unmarkState', true);
                 $image = $this->iconFactory->getIcon('actions-unmarkstate', Icon::SIZE_SMALL)->render();
             } else {
                 $title = $languageService->getLL('markState', true);
                 $image = $this->iconFactory->getIcon('actions-markstate', Icon::SIZE_SMALL)->render();
             }
             $singleLine['markState'] = $this->linkPage($image, array('highlight' => $entry['uid']), '', $title);
         } else {
             $singleLine['markState'] = '';
         }
         // put line together
         $lines[] = $singleLine;
     }
     $this->view->assign('history', $lines);
     if ($this->lastSyslogId) {
         $this->view->assign('fullViewLink', $this->linkPage($languageService->getLL('fullView', true), array('diff' => '')));
     }
 }
开发者ID:dachcom-digital,项目名称:TYPO3.CMS,代码行数:92,代码来源:RecordHistory.php

示例9: main

    /**
     * Main function creating the content for the module.
     *
     * @return string HTML content for the module, actually a "section" made through the parent object in $this->pObj
     */
    public function main()
    {
        $lang = $this->getLanguageService();
        $lang->includeLLFile('EXT:wizard_sortpages/Resources/Private/Language/locallang.xlf');
        $pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
        $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Modal');
        $out = '<h1>' . htmlspecialchars($lang->getLL('wiz_sort')) . '</h1>';
        if ($this->getBackendUser()->workspace === 0) {
            $theCode = '';
            // Check if user has modify permissions to
            $sys_pages = GeneralUtility::makeInstance(\TYPO3\CMS\Frontend\Page\PageRepository::class);
            $sortByField = GeneralUtility::_GP('sortByField');
            if ($sortByField) {
                $menuItems = array();
                if ($sortByField === 'title' || $sortByField === 'subtitle' || $sortByField === 'crdate' || $sortByField === 'tstamp') {
                    $menuItems = $sys_pages->getMenu($this->pObj->id, 'uid,pid,title', $sortByField, '', false);
                } elseif ($sortByField === 'REV') {
                    $menuItems = $sys_pages->getMenu($this->pObj->id, 'uid,pid,title', 'sorting', '', false);
                    $menuItems = array_reverse($menuItems);
                }
                if (!empty($menuItems)) {
                    $tce = GeneralUtility::makeInstance(\TYPO3\CMS\Core\DataHandling\DataHandler::class);
                    $menuItems = array_reverse($menuItems);
                    $cmd = array();
                    foreach ($menuItems as $r) {
                        $cmd['pages'][$r['uid']]['move'] = $this->pObj->id;
                    }
                    $tce->start(array(), $cmd);
                    $tce->process_cmdmap();
                    BackendUtility::setUpdateSignal('updatePageTree');
                }
            }
            $menuItems = $sys_pages->getMenu($this->pObj->id, '*', 'sorting', '', false);
            if (!empty($menuItems)) {
                $lines = array();
                $lines[] = '<thead><tr>';
                $lines[] = '<th>' . $lang->getLL('wiz_changeOrder_title') . '</th>';
                $lines[] = '<th>' . $lang->getLL('wiz_changeOrder_subtitle') . '</th>';
                $lines[] = '<th>' . $lang->getLL('wiz_changeOrder_tChange') . '</th>';
                $lines[] = '<th>' . $lang->getLL('wiz_changeOrder_tCreate') . '</th>';
                $lines[] = '</tr></thead>';
                $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
                foreach ($menuItems as $rec) {
                    $m_perms_clause = $this->getBackendUser()->getPagePermsClause(2);
                    // edit permissions for that page!
                    $pRec = BackendUtility::getRecord('pages', $rec['uid'], 'uid', ' AND ' . $m_perms_clause);
                    $lines[] = '<tr><td nowrap="nowrap">' . $iconFactory->getIconForRecord('pages', $rec, Icon::SIZE_SMALL)->render() . (!is_array($pRec) ? '<strong class="text-danger">' . $lang->getLL('wiz_W', true) . '</strong></span> ' : '') . htmlspecialchars(GeneralUtility::fixed_lgd_cs($rec['title'], $GLOBALS['BE_USER']->uc['titleLen'])) . '</td>
					<td nowrap="nowrap">' . htmlspecialchars(GeneralUtility::fixed_lgd_cs($rec['subtitle'], $this->getBackendUser()->uc['titleLen'])) . '</td>
					<td nowrap="nowrap">' . BackendUtility::datetime($rec['tstamp']) . '</td>
					<td nowrap="nowrap">' . BackendUtility::datetime($rec['crdate']) . '</td>
					</tr>';
                }
                $theCode .= '<h2>' . $lang->getLL('wiz_currentPageOrder', true) . '</h2>';
                $theCode .= '<div class="table-fit"><table class="table table-striped table-hover">' . implode('', $lines) . '</table></div>';
                // Menu:
                $lines = array();
                $lines[] = $this->wiz_linkOrder($lang->getLL('wiz_changeOrder_title'), 'title');
                $lines[] = $this->wiz_linkOrder($lang->getLL('wiz_changeOrder_subtitle'), 'subtitle');
                $lines[] = $this->wiz_linkOrder($lang->getLL('wiz_changeOrder_tChange'), 'tstamp');
                $lines[] = $this->wiz_linkOrder($lang->getLL('wiz_changeOrder_tCreate'), 'crdate');
                $lines[] = '';
                $lines[] = $this->wiz_linkOrder($lang->getLL('wiz_changeOrder_REVERSE'), 'REV');
                $theCode .= '<h4>' . $lang->getLL('wiz_changeOrder') . '</h4><p>' . implode(' ', $lines) . '</p>';
            } else {
                $flashMessage = GeneralUtility::makeInstance(FlashMessage::class, $lang->getLL('no_subpages'), '', FlashMessage::NOTICE);
                /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
                $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
                /** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
                $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
                $defaultFlashMessageQueue->enqueue($flashMessage);
            }
            // CSH:
            $theCode .= BackendUtility::cshItem('_MOD_web_func', 'tx_wizardsortpages', null, '<span class="btn btn-default btn-sm">|</span>');
            $out .= '<div>' . $theCode . '</div>';
        } else {
            $out .= '<div>Sorry, this function is not available in the current draft workspace!</div>';
        }
        return $out;
    }
开发者ID:TYPO3Incubator,项目名称:TYPO3.CMS,代码行数:84,代码来源:SortPagesWizardModuleFunction.php

示例10: calcAge

 /**
  * @param int $seconds Seconds could be the difference of a certain timestamp and time()
  * @param string $labels Labels should be something like ' min| hrs| days| yrs| min| hour| day| year'. This value is typically delivered by this function call: $GLOBALS["LANG"]->sL("LLL:EXT:lang/locallang_core.xlf:labels.minutesHoursDaysYears")
  * @return string Formatted time
  */
 public function calcAge($seconds, $labels = ' min| hrs| days| yrs| min| hour| day| year')
 {
     return BackendUtility::datetime($seconds, $labels);
 }
开发者ID:woehrlag,项目名称:Intranet,代码行数:9,代码来源:class.tx_realurl_apiwrapper_6x.php

示例11: intval

    /**
     * Shows the status of the mailer engine.
     * TODO: Should really only show some entries, or provide a browsing interface.
     *
     * @return	string		List of the mailing status
     */
    function cmd_mailerengine()
    {
        $invokeMessage = "";
        // enable manual invocation of mailer engine; enabled by default
        $enableTrigger = !(isset($this->params['menu.']['dmail_mode.']['mailengine.']['disable_trigger']) && $this->params['menu.']['dmail_mode.']['mailengine.']['disable_trigger']);
        if ($enableTrigger && GeneralUtility::_GP('invokeMailerEngine')) {
            /* @var $flashMessage FlashMessage */
            $flashMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', '<strong>' . $this->getLanguageService()->getLL('dmail_mailerengine_log') . '</strong><br />' . nl2br($this->invokeMEngine()), $this->getLanguageService()->getLL('dmail_mailerengine_invoked'), FlashMessage::INFO);
            $invokeMessage = $flashMessage->render();
        }
        // Invoke engine
        if ($enableTrigger) {
            $out = '<p>' . $this->getLanguageService()->getLL('dmail_mailerengine_manual_explain') . '<br /><br /><a class="t3-link" href="' . BackendUtility::getModuleUrl('txdirectmailM1_txdirectmailM5') . '&id=' . $this->id . '&invokeMailerEngine=1"><strong>' . $this->getLanguageService()->getLL('dmail_mailerengine_invoke_now') . '</strong></a></p>';
            $invokeMessage .= '<div style="padding-top: 20px;"></div>';
            $invokeMessage .= $this->doc->section(BackendUtility::cshItem($this->cshTable, 'mailerengine_invoke', $GLOBALS["BACK_PATH"]) . $this->getLanguageService()->getLL('dmail_mailerengine_manual_invoke'), $out, 1, 1, 0, TRUE);
            $invokeMessage .= '<div style="padding-top: 20px;"></div>';
        }
        // Display mailer engine status
        $res = $GLOBALS["TYPO3_DB"]->exec_SELECTquery('uid,pid,subject,scheduled,scheduled_begin,scheduled_end', 'sys_dmail', 'pid=' . intval($this->id) . ' AND scheduled>0' . BackendUtility::deleteClause('sys_dmail'), '', 'scheduled DESC');
        $out = '<tr class="t3-row-header">
				<td>&nbsp;</td>
				<td><b>' . $this->getLanguageService()->getLL('dmail_mailerengine_subject') . '&nbsp;&nbsp;</b></td>
				<td><b>' . $this->getLanguageService()->getLL('dmail_mailerengine_scheduled') . '&nbsp;&nbsp;</b></td>
				<td><b>' . $this->getLanguageService()->getLL('dmail_mailerengine_delivery_begun') . '&nbsp;&nbsp;</b></td>
				<td><b>' . $this->getLanguageService()->getLL('dmail_mailerengine_delivery_ended') . '&nbsp;&nbsp;</b></td>
				<td style="text-align: center;"><b>&nbsp;' . $this->getLanguageService()->getLL('dmail_mailerengine_number_sent') . '&nbsp;</b></td>
				<td style="text-align: center;"><b>&nbsp;' . $this->getLanguageService()->getLL('dmail_mailerengine_delete') . '&nbsp;</b></td>
			</tr>';
        while ($row = $GLOBALS["TYPO3_DB"]->sql_fetch_assoc($res)) {
            $countres = $GLOBALS["TYPO3_DB"]->exec_SELECTquery('count(*)', 'sys_dmail_maillog', 'mid=' . intval($row['uid']) . ' AND response_type=0' . ' AND html_sent>0');
            list($count) = $GLOBALS["TYPO3_DB"]->sql_fetch_row($countres);
            $out .= '<tr class="db_list_normal">
						<td>' . $this->iconFactory->getIconForRecord('sys_dmail', $row, Icon::SIZE_SMALL)->render() . '</td>
						<td>' . $this->linkDMail_record(htmlspecialchars(GeneralUtility::fixed_lgd_cs($row['subject'], 100)) . '&nbsp;&nbsp;', $row['uid']) . '</td>
						<td>' . BackendUtility::datetime($row['scheduled']) . '&nbsp;&nbsp;</td>
						<td>' . ($row['scheduled_begin'] ? BackendUtility::datetime($row['scheduled_begin']) : '') . '&nbsp;&nbsp;</td>
						<td>' . ($row['scheduled_end'] ? BackendUtility::datetime($row['scheduled_end']) : '') . '&nbsp;&nbsp;</td>
						<td style="text-align: center;">' . ($count ? $count : '&nbsp;') . '</td>
						<td style="text-align: center;">' . $this->deleteLink($row['uid']) . '</td>
					</tr>';
        }
        $out = $invokeMessage . '<table class="table table-striped table-hover">' . $out . '</table>';
        return $this->doc->section(BackendUtility::cshItem($this->cshTable, 'mailerengine_status', $GLOBALS["BACK_PATH"]) . $this->getLanguageService()->getLL('dmail_mailerengine_status'), $out, 1, 1, 0, TRUE);
    }
开发者ID:Teddytrombone,项目名称:direct_mail,代码行数:50,代码来源:MailerEngine.php

示例12: getPageInfoBox

    /**
     * Creates an info-box for the current page (identified by input record).
     *
     * @param array $rec Page record
     * @param boolean $edit If set, there will be shown an edit icon, linking to editing of the page properties.
     * @return string HTML for the box.
     * @deprecated and unused since 6.0, will be removed two versions later
     * @todo Define visibility
     */
    public function getPageInfoBox($rec, $edit = 0)
    {
        \TYPO3\CMS\Core\Utility\GeneralUtility::logDeprecatedFunction();
        // If editing of the page properties is allowed:
        if ($edit) {
            $params = '&edit[pages][' . $rec['uid'] . ']=edit';
            $editIcon = '<a href="#" onclick="' . htmlspecialchars(\TYPO3\CMS\Backend\Utility\BackendUtility::editOnClick($params, $this->backPath)) . '" title="' . $GLOBALS['LANG']->getLL('edit', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-open') . '</a>';
        } else {
            $editIcon = $this->noEditIcon('noEditPage');
        }
        // Setting page icon, link, title:
        $outPutContent = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord('pages', $rec, array('title' => \TYPO3\CMS\Backend\Utility\BackendUtility::titleAttribForPages($rec))) . $editIcon . '&nbsp;' . htmlspecialchars($rec['title']);
        // Init array where infomation is accumulated as label/value pairs.
        $lines = array();
        // Owner user/group:
        if ($this->pI_showUser) {
            // User:
            $users = \TYPO3\CMS\Backend\Utility\BackendUtility::getUserNames('username,usergroup,usergroup_cached_list,uid,realName');
            $groupArray = explode(',', $GLOBALS['BE_USER']->user['usergroup_cached_list']);
            $users = \TYPO3\CMS\Backend\Utility\BackendUtility::blindUserNames($users, $groupArray);
            $lines[] = array($GLOBALS['LANG']->getLL('pI_crUser') . ':', htmlspecialchars($users[$rec['cruser_id']]['username']) . ' (' . $users[$rec['cruser_id']]['realName'] . ')');
        }
        // Created:
        $lines[] = array($GLOBALS['LANG']->getLL('pI_crDate') . ':', \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($rec['crdate']) . ' (' . \TYPO3\CMS\Backend\Utility\BackendUtility::calcAge($GLOBALS['EXEC_TIME'] - $rec['crdate'], $this->agePrefixes) . ')');
        // Last change:
        $lines[] = array($GLOBALS['LANG']->getLL('pI_lastChange') . ':', \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($rec['tstamp']) . ' (' . \TYPO3\CMS\Backend\Utility\BackendUtility::calcAge($GLOBALS['EXEC_TIME'] - $rec['tstamp'], $this->agePrefixes) . ')');
        // Last change of content:
        if ($rec['SYS_LASTCHANGED']) {
            $lines[] = array($GLOBALS['LANG']->getLL('pI_lastChangeContent') . ':', \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($rec['SYS_LASTCHANGED']) . ' (' . \TYPO3\CMS\Backend\Utility\BackendUtility::calcAge($GLOBALS['EXEC_TIME'] - $rec['SYS_LASTCHANGED'], $this->agePrefixes) . ')');
        }
        // Spacer:
        $lines[] = '';
        // Display contents of certain page fields, if any value:
        $dfields = explode(',', 'alias,target,hidden,starttime,endtime,fe_group,no_cache,cache_timeout,newUntil,lastUpdated,subtitle,keywords,description,abstract,author,author_email');
        foreach ($dfields as $fV) {
            if ($rec[$fV]) {
                $lines[] = array($GLOBALS['LANG']->sL(\TYPO3\CMS\Backend\Utility\BackendUtility::getItemLabel('pages', $fV)), \TYPO3\CMS\Backend\Utility\BackendUtility::getProcessedValue('pages', $fV, $rec[$fV]));
            }
        }
        // Finally, wrap the elements in the $lines array in table cells/rows
        foreach ($lines as $fV) {
            if (is_array($fV)) {
                if (!$fV[2]) {
                    $fV[1] = htmlspecialchars($fV[1]);
                }
                $out .= '
				<tr>
					<td class="bgColor4" nowrap="nowrap"><strong>' . htmlspecialchars($fV[0]) . '&nbsp;&nbsp;</strong></td>
					<td class="bgColor4">' . $fV[1] . '</td>
				</tr>';
            } else {
                $out .= '
				<tr>
					<td colspan="2"><img src="clear.gif" width="1" height="3" alt="" /></td>
				</tr>';
            }
        }
        // Wrap table tags around...
        $outPutContent .= '



			<!--
				Page info box:
			-->
			<table border="0" cellpadding="0" cellspacing="1" id="typo3-page-info">
				' . $out . '
			</table>';
        // ... and return it.
        return $outPutContent;
    }
开发者ID:noxludo,项目名称:TYPO3v4-Core,代码行数:80,代码来源:PageLayoutView.php

示例13: getPhashExternalDocs

 /**
  * [Describe function...]
  *
  * @return 	[type]		...
  * @todo Define visibility
  */
 public function getPhashExternalDocs()
 {
     $recList[] = array($this->tableHead('Filename'), $this->tableHead('Size'), $this->tableHead('Words'), $this->tableHead('mtime'), $this->tableHead('Indexed'), $this->tableHead('Updated'), $this->tableHead('Parsetime'), $this->tableHead('#sec/gr/full'), $this->tableHead('#sub'), $this->tableHead('cHash'), $this->tableHead('phash'), $this->tableHead('Path'));
     // TYPO3 pages, unique
     $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*) AS pcount,index_phash.*', 'index_phash', 'item_type<>\'0\'', 'phash_grouping,phash,cHashParams,data_filename,data_page_id,data_page_reg1,data_page_type,data_page_mp,gr_list,item_type,item_title,item_description,item_mtime,tstamp,item_size,contentHash,crdate,parsetime,sys_language_uid,item_crdate,externalUrl,recordUid,freeIndexUid,freeIndexSetId', 'item_type');
     while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
         $cHash = count(unserialize($row['cHashParams'])) ? $this->formatCHash(unserialize($row['cHashParams'])) : '';
         $grListRec = $this->getGrlistRecord($row['phash']);
         $recList[] = array(htmlentities(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($row['item_title'], 30)), \TYPO3\CMS\Core\Utility\GeneralUtility::formatSize($row['item_size']), $this->getNumberOfWords($row['phash']), BackendUtility::datetime($row['item_mtime']), BackendUtility::datetime($row['crdate']), $row['tstamp'] != $row['crdate'] ? BackendUtility::datetime($row['tstamp']) : '', $row['parsetime'], $this->getNumberOfSections($row['phash']) . '/' . $grListRec[0]['pcount'] . '/' . $this->getNumberOfFulltext($row['phash']), $row['pcount'], $cHash, $row['phash'], htmlentities(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($row['data_filename'], 100)));
         if ($row['pcount'] > 1) {
             $res2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery('index_phash.*', 'index_phash', 'phash_grouping=' . (int) $row['phash_grouping'] . ' AND phash<>' . (int) $row['phash']);
             while ($row2 = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res2)) {
                 $cHash = count(unserialize($row2['cHashParams'])) ? $this->formatCHash(unserialize($row2['cHashParams'])) : '';
                 $grListRec = $this->getGrlistRecord($row2['phash']);
                 $recList[] = array('', '', $this->getNumberOfWords($row2['phash']), '', BackendUtility::datetime($row2['crdate']), $row2['tstamp'] != $row2['crdate'] ? BackendUtility::datetime($row2['tstamp']) : '', $row2['parsetime'], $this->getNumberOfSections($row2['phash']) . '/' . $grListRec[0]['pcount'] . '/' . $this->getNumberOfFulltext($row2['phash']), '', $cHash, $row2['phash'], '');
             }
         }
     }
     return $recList;
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:26,代码来源:ModuleController.php

示例14: getCommentsForRecord

 /**
  * Gets an array with all sys_log entries and their comments for the given record uid and table
  *
  * @param int $uid uid of changed element to search for in log
  * @param string $table Name of the record's table
  * @return array
  */
 public function getCommentsForRecord($uid, $table)
 {
     $sysLogReturnArray = array();
     $sysLogRows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('log_data,tstamp,userid', 'sys_log', 'action=6 and details_nr=30 AND tablename=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($table, 'sys_log') . ' AND recuid=' . (int) $uid, '', 'tstamp DESC');
     foreach ($sysLogRows as $sysLogRow) {
         $sysLogEntry = array();
         $data = unserialize($sysLogRow['log_data']);
         $beUserRecord = BackendUtility::getRecord('be_users', $sysLogRow['userid']);
         $sysLogEntry['stage_title'] = htmlspecialchars($this->getStagesService()->getStageTitle($data['stage']));
         $sysLogEntry['user_uid'] = (int) $sysLogRow['userid'];
         $sysLogEntry['user_username'] = is_array($beUserRecord) ? htmlspecialchars($beUserRecord['username']) : '';
         $sysLogEntry['tstamp'] = htmlspecialchars(BackendUtility::datetime($sysLogRow['tstamp']));
         $sysLogEntry['user_comment'] = nl2br(htmlspecialchars($data['comment']));
         $sysLogReturnArray[] = $sysLogEntry;
     }
     return $sysLogReturnArray;
 }
开发者ID:TYPO3Incubator,项目名称:TYPO3.CMS,代码行数:24,代码来源:ExtDirectServer.php

示例15: logView

    /**
     * View error log
     *
     * @return	string		HTML
     */
    public function logView()
    {
        $cmd = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('cmd');
        if ($cmd === 'deleteAll') {
            $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_realurl_errorlog', '');
        }
        $list = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'tx_realurl_errorlog', '', '', 'counter DESC, tstamp DESC', 100);
        if (is_array($list)) {
            $output = '';
            $cc = 0;
            foreach ($list as $rec) {
                $host = '';
                if ($rec['rootpage_id'] != 0) {
                    if (isset($hostCacheName[$rec['rootpage_id']])) {
                        $host = $hostCacheName[$rec['rootpage_id']];
                    } else {
                        $hostCacheName[$rec['rootpage_id']] = $host = $this->getHostName($rec['rootpage_id']);
                    }
                }
                // Add data:
                $tCells = array();
                $tCells[] = '<td>' . $rec['counter'] . '</td>';
                $tCells[] = '<td>' . \TYPO3\CMS\Backend\Utility\BackendUtility::dateTimeAge($rec['tstamp']) . '</td>';
                $tCells[] = '<td><a href="' . htmlspecialchars($host . '/' . $rec['url']) . '" target="_blank">' . ($host ? $host . '/' : '') . htmlspecialchars($rec['url']) . '</a>' . ' <a href="' . $this->linkSelf('&cmd=new&data[0][source]=' . rawurlencode($rec['url']) . '&SET[type]=redirects') . '">' . $this->getIcon('gfx/napshot.gif', 'width="12" height="12"', $this->pObj->doc->backPath, 'Set as redirect') . '</a>' . '</td>';
                $tCells[] = '<td>' . htmlspecialchars($rec['error']) . '</td>';
                $tCells[] = '<td>' . ($rec['last_referer'] ? '<a href="' . htmlspecialchars($rec['last_referer']) . '" target="_blank">' . htmlspecialchars($rec['last_referer']) . '</a>' : '&nbsp;') . '</td>';
                $tCells[] = '<td>' . \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($rec['cr_date']) . '</td>';
                // Compile Row:
                $output .= '
					<tr class="bgColor' . ($cc % 2 ? '-20' : '-10') . '">
						' . implode('
						', $tCells) . '
					</tr>';
                $cc++;
            }
            // Create header:
            $tCells = array();
            $tCells[] = '<td>Counter:</td>';
            $tCells[] = '<td>Last time:</td>';
            $tCells[] = '<td>URL:</td>';
            $tCells[] = '<td>Error:</td>';
            $tCells[] = '<td>Last Referer:</td>';
            $tCells[] = '<td>First time:</td>';
            $output = '
				<tr class="bgColor5 tableheader">
					' . implode('
					', $tCells) . '
				</tr>' . $output;
            // Compile final table and return:
            $output = '
			<br/>
				<a href="' . $this->linkSelf('&cmd=deleteAll') . '">' . $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $this->pObj->doc->backPath, 'Delete All') . ' Flush log</a>
				<br/>
			<table border="0" cellspacing="1" cellpadding="0" id="tx-realurl-pathcacheTable" class="lrPadding c-list">' . $output . '
			</table>';
            return $output;
        }
    }
开发者ID:helhum,项目名称:realurl,代码行数:63,代码来源:AdministrationModuleFunction.php


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