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


PHP BackendUtility::dateTimeAge方法代码示例

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


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

示例1: viewEditRecord

 /**
  * Action to edit records
  *
  * @param array $record sys_action record
  * @return string list of records
  */
 protected function viewEditRecord($record)
 {
     $content = '';
     $actionList = array();
     $dbAnalysis = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\RelationHandler::class);
     $dbAnalysis->setFetchAllFields(true);
     $dbAnalysis->start($record['t4_recordsToEdit'], '*');
     $dbAnalysis->getFromDB();
     // collect the records
     foreach ($dbAnalysis->itemArray as $el) {
         $path = BackendUtility::getRecordPath($el['id'], $this->taskObject->perms_clause, $this->getBackendUser()->uc['titleLen']);
         $record = BackendUtility::getRecord($el['table'], $dbAnalysis->results[$el['table']][$el['id']]);
         $title = BackendUtility::getRecordTitle($el['table'], $dbAnalysis->results[$el['table']][$el['id']]);
         $description = $this->getLanguageService()->sL($GLOBALS['TCA'][$el['table']]['ctrl']['title'], true);
         // @todo: which information could be needful
         if (isset($record['crdate'])) {
             $description .= ' - ' . BackendUtility::dateTimeAge($record['crdate']);
         }
         $link = BackendUtility::getModuleUrl('record_edit', array('edit[' . $el['table'] . '][' . $el['id'] . ']' => 'edit', 'returnUrl' => $this->moduleUrl), false, true);
         $actionList[$el['id']] = array('uid' => 'record-' . $el['table'] . '-' . $el['id'], 'title' => $title, 'description' => BackendUtility::getRecordTitle($el['table'], $dbAnalysis->results[$el['table']][$el['id']]), 'descriptionHtml' => $description, 'link' => $link, 'icon' => '<span title="' . htmlspecialchars($path) . '">' . $this->iconFactory->getIconForRecord($el['table'], $dbAnalysis->results[$el['table']][$el['id']], Icon::SIZE_SMALL)->render() . '</span>');
     }
     // Render the record list
     $content .= $this->taskObject->renderListMenu($actionList);
     return $content;
 }
开发者ID:dachcom-digital,项目名称:TYPO3.CMS,代码行数:31,代码来源:ActionTask.php

示例2: dateTimeAge

 /**
  * @param int $tstamp Time stamp, seconds
  * @param int $prefix 1/-1 depending on polarity of age.
  * @param string $date $date=="date" will yield "dd:mm:yy" formatting, otherwise "dd:mm:yy hh:mm
  * @return string
  */
 public function dateTimeAge($tstamp, $prefix = 1, $date = '')
 {
     return BackendUtility::dateTimeAge($tstamp, $prefix, $date);
 }
开发者ID:woehrlag,项目名称:Intranet,代码行数:10,代码来源:class.tx_realurl_apiwrapper_6x.php

示例3: generateSingleRedirectContent

 /**
  * Creates an HTML table row for a single redirect record.
  *
  * @param array $rec
  * @param int $page
  * @return string
  */
 protected function generateSingleRedirectContent(array $rec, $page)
 {
     $output = '<td>' . '<a href="' . $this->linkSelf('&cmd=edit&uid=' . rawurlencode($rec['uid'])) . '&page=' . $page . '">' . $this->getIcon('gfx/edit2.gif', 'width="11" height="12"', $this->pObj->doc->backPath, 'Edit entry') . '</a>' . '<a href="' . $this->linkSelf('&cmd=delete&uid=' . rawurlencode($rec['uid'])) . '&page=' . $page . '">' . $this->getIcon('gfx/garbage.gif', 'width="11" height="12"', $this->pObj->doc->backPath, 'Delete entry') . '</a>' . '</td>';
     $output .= sprintf('<td><a href="%s" target="_blank">/%s</a></td>', htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . $rec['url']), htmlspecialchars($rec['url']));
     $destinationURL = $this->getDestinationRedirectURL($rec['destination']);
     $output .= sprintf('<td><a href="%1$s" target="_blank" title="%1$s">%2$s</a></td>', htmlspecialchars($destinationURL), htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($destinationURL, 30)));
     $output .= '<td>' . htmlspecialchars($this->getRedirectDomain($rec['domain_limit'])) . '</td>';
     $output .= '<td align="center">' . ($rec['has_moved'] ? '+' : '&nbsp;') . '</td>';
     $output .= '<td align="center">' . $rec['counter'] . '</td>';
     if ($rec['tstamp']) {
         $output .= '<td>' . \TYPO3\CMS\Backend\Utility\BackendUtility::dateTimeAge($rec['tstamp']) . '</td>';
     } else {
         $output .= '<td align="center">&mdash;</td>';
     }
     if ($rec['last_referer']) {
         $lastRef = htmlspecialchars($rec['last_referer']);
         $output .= sprintf('<td><a href="%s" target="_blank" title="%s">%s</a></td>', $lastRef, $lastRef, strlen($rec['last_referer']) > 30 ? htmlspecialchars(substr($rec['last_referer'], 0, 30)) . '...' : $lastRef);
     } else {
         $output .= '<td>&nbsp;</td>';
     }
     // Error:
     $errorMessage = '';
     $pagesWithURL = array_keys($GLOBALS['TYPO3_DB']->exec_SELECTgetRows('page_id', 'tx_realurl_urlencodecache', 'content=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($rec['url'], 'tx_realurl_urlencodecache'), '', '', '', '', 'page_id'));
     if (count($pagesWithURL) > 0) {
         $errorMessage .= $this->pObj->doc->icons(3) . 'Also a page URL: ' . implode(',', array_unique($pagesWithURL));
     }
     $output .= '<td>' . $errorMessage . '</td>';
     return $output;
 }
开发者ID:helhum,项目名称:realurl,代码行数:36,代码来源:AdministrationModuleFunction.php

示例4: userManagement


//.........这里部分代码省略.........
         $filter = '1';
     }
     // Determine sort order. The default is "ASC" order.
     switch (strtoupper(GeneralUtility::_GP('mmforum_style'))) {
         case 'DESC':
             $orderBy = 'DESC';
             break;
         case 'ASC':
         default:
             $orderBy = 'ASC';
             break;
     }
     if (GeneralUtility::_GP('mmforum_sort') == 'username') {
         $order = 'username ' . $orderBy . '';
         $uOrder = $orderBy == 'ASC' ? 'DESC' : 'ASC';
         $aOrder = 'ASC';
     } elseif (GeneralUtility::_GP('mmforum_sort') == 'age') {
         $order = 'crdate ' . $orderBy . '';
         $aOrder = $orderBy == 'ASC' ? 'DESC' : 'ASC';
         $uOrder = 'ASC';
     } else {
         $order = 'username ' . $orderBy . '';
         $aOrder = 'ASC';
         $uOrder = 'DESC';
     }
     #$userGroup_query = "(".$this->confArr['userGroup']." IN (usergroup) OR ".$this->confArr['modGroup']." IN (usergroup) OR ".$this->confArr['adminGroup']." IN (usergroup))";
     $userGroup_query = "(FIND_IN_SET('" . $this->confArr['userGroup'] . "',usergroup) OR FIND_IN_SET('" . $this->confArr['modGroup'] . "',usergroup) OR FIND_IN_SET('" . $this->confArr['adminGroup'] . "',usergroup))";
     #$userGroup_query = "1";
     $res = $this->databaseHandle->exec_SELECTquery('count(*)', 'fe_users', "{$filter} and pid='" . $this->confArr['userPID'] . "' and " . $userGroup_query . " and deleted=0");
     $row = $this->databaseHandle->sql_fetch_row($res);
     $records = $row[0];
     $pages = ceil($records / $this->confArr['recordsPerPage']);
     $offset = intval($mmforum['offset']);
     // Page navigation
     $pb = $LANG->getLL('page.page') . ' <a href="index.php?mmforum[offset]=0' . $gp . '">[' . $LANG->getLL('page.first') . ']</a> ';
     $end = $offset + 6 >= $pages ? $pages : $offset + 6;
     $start = $offset - 5;
     if ($start < 0) {
         $start = 0;
     }
     if ($start > 0) {
         $pb .= '... ';
     }
     for ($i = $start; $i < $end; $i++) {
         $pb .= '<a href="index.php?mmforum[offset]=' . $i . $gp . '">' . ($i == $offset ? '<b>' . ($i + 1) . '</b>' : $i + 1) . '</a> ';
     }
     if ($offset + 11 < $pages) {
         $pb .= ' ... <a href="index.php?mmforum[offset]=' . ($pages - 1) . $gp . '">[' . $LANG->getLL('page.last') . ']</a> ';
     }
     // Generate header table
     if ($records < $this->confArr['recordsPerPage']) {
         $mDisp = $records;
     } else {
         $mDisp = $offset * $this->confArr['recordsPerPage'] + $this->confArr['recordsPerPage'];
     }
     $userString = sprintf($LANG->getLL('useradmin.usercount'), $offset * $this->confArr['recordsPerPage'] + 1, $mDisp, $records);
     $out = '<table width="733"><tr>';
     $out .= '<td width="420">' . $pb . '</td>';
     $out .= '<td width="120" align="center"><b>' . $userString . '</b></td>';
     $out .= '<td align="right">' . $LANG->getLL('useradmin.searchfor') . ': <input type="text" id="sword" size="20" name="mmforum[sword]" /></td>';
     $out .= '</tr></table>';
     if ($mmforum['sword'] || $mmforum['old_sword']) {
         $out .= '<p>' . $LANG->getLL('useradmin.filter') . ': ' . $mmforum['sword'] . '* <a href="index.php?mmforum[no_filter]=1&' . $this->linkParams($mmforum) . '">' . $LANG->getLL('useradmin.filter.clear') . '</a></p>';
         $out .= '<input type="hidden" name="mmforum[old_sword]" value="' . $mmforum['sword'] . '" />';
     }
     // Display userdata table
     // Execute database query
     $res = $this->databaseHandle->exec_SELECTquery('*', 'fe_users', "{$filter} and pid='" . $this->confArr['userPID'] . "' and deleted=0 AND " . $userGroup_query, '', $order, $offset * $this->confArr['recordsPerPage'] . "," . $this->confArr['recordsPerPage']);
     if ($res) {
         $marker = array('###USERS_LLL_TITLE###' => $LANG->getLL('users.title'), '###USERS_LLL_USERNAME###' => '<a href="index.php?mmforum_sort=username&mmforum_style=' . $uOrder . '">' . $LANG->getLL('useradmin.username') . '</a>', '###USERS_LLL_REGISTERED###' => '<a href="index.php?mmforum_sort=age&mmforum_style=' . $aOrder . '">' . $LANG->getLL('useradmin.age') . '</a>', '###USERS_LLL_GROUPS###' => $LANG->getLL('useradmin.usergroup'), '###USERS_LLL_OPTIONS###' => '&nbsp;');
         $i = 0;
         $uContent = '';
         while ($row = $this->databaseHandle->sql_fetch_assoc($res)) {
             // Display user groups
             $g = explode(',', $row['usergroup']);
             $outg = '';
             foreach ($g as $sg) {
                 $outg .= $ug[$sg] . ', ';
             }
             $iconAltText = BackendUtility::getRecordIconAltText($row, $table);
             $elementTitle = BackendUtility::getRecordPath($row['uid'], '1=1', 0);
             $elementTitle = GeneralUtility::fixed_lgd_cs($elementTitle, -$BE_USER->uc['titleLen']);
             $elementIcon = IconUtility::getIconImage($table, $row, $BACK_PATH, 'class="c-recicon" title="' . $iconAltText . '"');
             $params = '&edit[fe_users][' . $row['uid'] . ']=edit';
             $editOnClick = BackendUtility::editOnClick($params, $BACK_PATH);
             // Generate row item
             $class_suffix = $i++ % 2 == 0 ? '2' : '';
             $link = "index.php?mmforum[cid]=" . $row['uid'];
             $js = 'onmouseover="this.className=\'mm_forum-listrow_active\'; this.style.cursor=\'pointer\';" onmouseout="this.className=\'mm_forum-listrow' . $class_suffix . '\'" onclick="' . htmlspecialchars($editOnClick) . '"';
             $icon = '<img src="../icon_tx_mmforum_forums.gif" />';
             $hidden = $row['hidden'] == 1 ? '<span style="color:blue;">[' . $LANG->getLL('boardadmin.hidden') . ']</span> ' : '';
             $uMarker = array('###USER_USERNAME###' => htmlspecialchars($row['username']), '###USER_REGISTERED###' => BackendUtility::dateTimeAge($row['crdate'], 1), '###USER_GROUPS###' => substr($outg, -2) == ', ' ? substr($outg, 0, strlen($outg) - 2) : $outg, '###USER_OPTIONS###' => '<img src="img/edit.png" onclick="' . htmlspecialchars($editOnClick) . '" style="cursor:pointer;" />');
             $uContent .= tx_mmforum_BeTools::substituteMarkerArray($uTemplate, $uMarker);
         }
         $template = tx_mmforum_BeTools::substituteSubpart($template, '###USERS_LIST_ITEM###', $uContent);
         $template = tx_mmforum_BeTools::substituteMarkerArray($template, $marker);
         $out .= $template;
     }
     return $out;
 }
开发者ID:rabe69,项目名称:mm_forum,代码行数:101,代码来源:index.php

示例5: moduleContent


//.........这里部分代码省略.........
										<td>' . $session['num_upd'] . '</td>
									</tr>
									<tr>
										<td>' . $GLOBALS['LANG']->getLL('f2.usersDropped', 1) . '</td>
										<td width="10pt"></td>
										<td>' . $session['num_drop'] . (!empty($session['dropfile']) && is_file($session['dropfile']) ? ' [<a href="/uploads/tx_rsuserimp/' . basename($session['dropfile']) . '">' . $GLOBALS['LANG']->getLL('f1.tab5.downloadFile') . '</a>]' : '') . '</td>
									</tr>
								</table>
							</div>';
                        $previewNum = $rollbackPreviewRows < count($info) ? $rollbackPreviewRows : count($info);
                        if ($previewNum > 0) {
                            $infoBlock .= '<br><strong>' . $GLOBALS['LANG']->getLL('f2.sampleData', 1) . '</strong><br><br>';
                            for ($i = 0; $i < $previewNum; $i++) {
                                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($session['unique_identifier'], $session['db_table'], 'uid=' . $info[$i] . ' AND deleted=0');
                                $row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
                                if ($GLOBALS['TYPO3_DB']->sql_affected_rows() == 1) {
                                    $infoBlock .= $row[0] . ' [UID ' . $info[$i] . ']<br>';
                                } elseif ($GLOBALS['TYPO3_DB']->sql_affected_rows() == 0) {
                                    $infoBlock .= sprintf($GLOBALS['LANG']->getLL('f2.userAlreadyDeleted'), $info[$i]) . '<br>';
                                } else {
                                    $infoBlock .= $GLOBALS['LANG']->getLL('f2.unknownError') . '<br>';
                                }
                            }
                            $infoBlock .= '[...]<br>';
                        }
                        $infoBlock .= '<div align="right">
													<input type="submit" onclick="return confirm(\'' . $GLOBALS['LANG']->getLL('f2.rollback.sure', 1) . '\');" name="tx_rsuserimp[rollback][' . $session['uid'] . ']" value="Roll back" ' . ((mktime() < $rollbacktime || $rollbackSafetyTimespan == 0) && $session['active'] == 1 ? '' : 'disabled') . '/>
												</div>';
                        $colorcount = $colorcount == 1 ? 0 : 1;
                        $color = $colorcount == 1 ? $this->doc->bgColor5 : $this->doc->bgColor4;
                        $tr_params = ' onclick="setRowColor(this,\'' . $rowcount . '\',\'click\',\'' . $this->doc->bgColor6 . '\',\'' . $color . '\');" bgcolor="' . $color . '");"';
                        $content .= '<tr class="db_list_normal"' . $tr_params . ' id="sessionrow_' . $rowcount . '" name="sessionrow" style="cursor: pointer;">
											<td valign="top"><strong>' . $session['uid'] . '</td>
											<td valign="top">' . BackendUtility::dateTimeAge($session['crdate'], 1) . '</td>
											<td valign="top">' . $session['title'] . '</td>';
                        $now = mktime();
                        if ($now < $rollbacktime || $rollbackSafetyTimespan == 0) {
                            if ($session['active'] == 1) {
                                $content .= '<td valign="top">' . sprintf($GLOBALS['LANG']->getLL('f2.sessionRollback'), BackendUtility::dateTimeAge($rollbacktime, 1)) . '</td>';
                            }
                            if ($session['active'] == 0) {
                                $content .= '<td valign="top">' . $GLOBALS['LANG']->getLL('f2.sessionRolledBack') . '</td>';
                            }
                        } elseif ($now >= $rollbacktime) {
                            $content .= '<td valign="top">' . sprintf($GLOBALS['LANG']->getLL('f2.sessionExpired'), BackendUtility::dateTimeAge($rollbacktime, 1)) . '</td>';
                        }
                        $content .= '</tr>';
                        $content .= '<tr style="display: none;" id="rs_userimp_be_rollbacksession_' . $rowcount . '" bgcolor="' . $this->doc->bgColor6 . '">
												<td colspan="5">' . $infoBlock . '</td>
											</tr>';
                        $rowcount++;
                    }
                    //end foreach
                    $content .= '</table>';
                } else {
                    //if not empty rollbackData
                    $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('f2.noSessionFound'), '', 0, 1, 1);
                }
                $this->content .= $content;
                break;
                // import function
            // import function
            case 1:
                /***** start ********/
                /***** file upload ********/
                /**** TAB 1 data *****/
开发者ID:visol,项目名称:ext-rs_userimp,代码行数:67,代码来源:UserImporter.php

示例6: printPhashRow


//.........这里部分代码省略.........
     $titleCellAttribs = $row['count_val'] != 1 ? ' bgcolor="red"' : ($row['item_type'] === '0' ? ' class="bgColor4"' : '');
     if ($row['item_type']) {
         $arr = unserialize($row['cHashParams']);
         $page = $arr['key'] ? ' [' . $arr['key'] . ']' : '';
     } else {
         $page = '';
     }
     $elTitle = $this->linkDetails($row['item_title'] ? htmlspecialchars(GeneralUtility::fixed_lgd_cs($row['item_title'], 20) . $page) : '<em>[No Title]</em>', $row['phash']);
     $cmdLinks = $this->printRemoveIndexed($row['phash'], 'Clear phash-row') . $this->printReindex($row, 'Re-index element');
     switch ($this->pObj->MOD_SETTINGS['type']) {
         case 1:
             // Technical details:
             // Display icon:
             if (!$grouping) {
                 $lines[] = '<td>' . $this->makeItemTypeIcon($row['item_type'], $row['data_filename'] ? $row['data_filename'] : $row['item_title']) . '</td>';
             } else {
                 $lines[] = '<td>&nbsp;</td>';
             }
             // Title displayed:
             $lines[] = '<td' . $titleCellAttribs . '>' . $elTitle . '</td>';
             // Remove-indexing-link:
             $lines[] = '<td>' . $cmdLinks . '</td>';
             // Various data:
             $lines[] = '<td>' . $row['phash'] . '</td>';
             $lines[] = '<td>' . $row['contentHash'] . '</td>';
             if ($row['item_type'] === '0') {
                 $lines[] = '<td>' . ($row['data_page_id'] ? $row['data_page_id'] : '&nbsp;') . '</td>';
                 $lines[] = '<td>' . ($row['data_page_type'] ? $row['data_page_type'] : '&nbsp;') . '</td>';
                 $lines[] = '<td>' . ($row['sys_language_uid'] ? $row['sys_language_uid'] : '&nbsp;') . '</td>';
                 $lines[] = '<td>' . ($row['data_page_mp'] ? $row['data_page_mp'] : '&nbsp;') . '</td>';
             } else {
                 $lines[] = '<td colspan="4">' . htmlspecialchars($row['data_filename']) . '</td>';
             }
             $lines[] = '<td>' . $row['gr_list'] . $this->printExtraGrListRows($extraGrListRows) . '</td>';
             $lines[] = '<td>' . $this->printRootlineInfo($row) . '</td>';
             $lines[] = '<td>' . ($row['page_id'] ? $row['page_id'] : '&nbsp;') . '</td>';
             $lines[] = '<td>' . ($row['phash_t3'] != $row['phash'] ? $row['phash_t3'] : '&nbsp;') . '</td>';
             $lines[] = '<td>' . ($row['freeIndexUid'] ? $row['freeIndexUid'] . ($row['freeIndexSetId'] ? '/' . $row['freeIndexSetId'] : '') : '&nbsp;') . '</td>';
             $lines[] = '<td>' . ($row['recordUid'] ? $row['recordUid'] : '&nbsp;') . '</td>';
             // cHash parameters:
             $arr = unserialize($row['cHashParams']);
             if (!is_array($arr)) {
                 $arr = array('cHash' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_general.xlf:LGL.error', TRUE));
             }
             $theCHash = $arr['cHash'];
             unset($arr['cHash']);
             if ($row['item_type']) {
                 // pdf...
                 $lines[] = '<td>' . ($arr['key'] ? 'Page ' . $arr['key'] : '') . '&nbsp;</td>';
             } elseif ($row['item_type'] == 0) {
                 $lines[] = '<td>' . htmlspecialchars(GeneralUtility::implodeArrayForUrl('', $arr)) . '&nbsp;</td>';
             } else {
                 $lines[] = '<td class="bgColor">&nbsp;</td>';
             }
             $lines[] = '<td>' . $theCHash . '</td>';
             break;
         case 2:
             // Words and content:
             // Display icon:
             if (!$grouping) {
                 $lines[] = '<td>' . $this->makeItemTypeIcon($row['item_type'], $row['data_filename'] ? $row['data_filename'] : $row['item_title']) . '</td>';
             } else {
                 $lines[] = '<td>&nbsp;</td>';
             }
             // Title displayed:
             $lines[] = '<td' . $titleCellAttribs . '>' . $elTitle . '</td>';
             // Remove-indexing-link:
             $lines[] = '<td>' . $cmdLinks . '</td>';
             // Query:
             $ftrow = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('*', 'index_fulltext', 'phash = ' . (int) $row['phash']);
             $lines[] = '<td style="white-space: normal;">' . htmlspecialchars(GeneralUtility::fixed_lgd_cs($ftrow['fulltextdata'], 3000)) . '<hr/><em>Size: ' . strlen($ftrow['fulltextdata']) . '</em>' . '</td>';
             // Query:
             $ftrows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('index_words.baseword, index_rel.*', 'index_rel, index_words', 'index_rel.phash = ' . (int) $row['phash'] . ' AND index_words.wid = index_rel.wid', '', '', '', 'baseword');
             $wordList = '';
             if (is_array($ftrows)) {
                 $indexed_words = array_keys($ftrows);
                 sort($indexed_words);
                 $wordList = htmlspecialchars(implode(' ', $indexed_words));
                 $wordList .= '<hr/><em>Count: ' . count($indexed_words) . '</em>';
             }
             $lines[] = '<td style="white-space: normal;">' . $wordList . '</td>';
             break;
         default:
             // Overview
             // Display icon:
             if (!$grouping) {
                 $lines[] = '<td>' . $this->makeItemTypeIcon($row['item_type'], $row['data_filename'] ? $row['data_filename'] : $row['item_title']) . '</td>';
             } else {
                 $lines[] = '<td>&nbsp;</td>';
             }
             // Title displayed:
             $lines[] = '<td' . $titleCellAttribs . '>' . $elTitle . '</td>';
             // Remove-indexing-link:
             $lines[] = '<td>' . $cmdLinks . '</td>';
             $lines[] = '<td style="white-space: normal;">' . htmlspecialchars($row['item_description']) . '...</td>';
             $lines[] = '<td>' . GeneralUtility::formatSize($row['item_size']) . '</td>';
             $lines[] = '<td>' . BackendUtility::dateTimeAge($row['tstamp']) . '</td>';
     }
     return $lines;
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:101,代码来源:IndexedPagesController.php

示例7: drawLog


//.........这里部分代码省略.........
        // Show details:
        if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details')) {
            // Get entry record:
            list($q_entry) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'tx_crawler_queue', 'qid=' . intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('qid_details')));
            // Explode values:
            $resStatus = $this->getResStatus($q_entry);
            $q_entry['parameters'] = unserialize($q_entry['parameters']);
            $q_entry['result_data'] = unserialize($q_entry['result_data']);
            if (is_array($q_entry['result_data'])) {
                $q_entry['result_data']['content'] = unserialize($q_entry['result_data']['content']);
            }
            if (!$this->pObj->MOD_SETTINGS['log_resultLog']) {
                unset($q_entry['result_data']['content']['log']);
            }
            // Print rudimentary details:
            $output .= '
				<br /><br />
				<input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.back') . '" name="_back" />
				<input type="hidden" value="' . $this->pObj->id . '" name="id" />
				<input type="hidden" value="' . $showSetId . '" name="setID" />
				<br />
				Current server time: ' . date('H:i:s', time()) . '<br />' . 'Status: ' . $resStatus . '<br />' . \TYPO3\CMS\Core\Utility\DebugUtility::viewArray($q_entry);
        } else {
            // Show list:
            // If either id or set id, show list:
            if ($this->pObj->id || $showSetId) {
                if ($this->pObj->id) {
                    // Drawing tree:
                    $tree = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\View\\PageTreeView');
                    $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
                    $tree->init('AND ' . $perms_clause);
                    // Set root row:
                    $HTML = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord('pages', $this->pObj->pageinfo);
                    $HTML = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord('pages', $this->pObj->pageinfo);
                    $tree->tree[] = array('row' => $this->pObj->pageinfo, 'HTML' => $HTML);
                    // Get branch beneath:
                    if ($this->pObj->MOD_SETTINGS['depth']) {
                        $tree->getTree($this->pObj->id, $this->pObj->MOD_SETTINGS['depth'], '');
                    }
                    // Traverse page tree:
                    $code = '';
                    $count = 0;
                    foreach ($tree->tree as $data) {
                        $code .= $this->drawLog_addRows($data['row'], $data['HTML'] . \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('pages', $data['row'], TRUE), intval($this->pObj->MOD_SETTINGS['itemsPerPage']));
                        if (++$count == 1000) {
                            break;
                        }
                    }
                } else {
                    $code = '';
                    $code .= $this->drawLog_addRows($showSetId, 'Set ID: ' . $showSetId);
                }
                if ($code) {
                    $output .= '
						<br /><br />
						<input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.reloadlist') . '" name="_reload" />
						<input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.downloadcsv') . '" name="_csv" />
						<input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.flushvisiblequeue') . '" name="_flush" onclick="return confirm(\'' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.confirmyouresure') . '\');" />
						<input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.flushfullqueue') . '" name="_flush_all" onclick="return confirm(\'' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.confirmyouresure') . '\');" />
						<input type="hidden" value="' . $this->pObj->id . '" name="id" />
						<input type="hidden" value="' . $showSetId . '" name="setID" />
						<br />
						' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.curtime') . ': ' . date('H:i:s', time()) . '
						<br /><br />


						<table class="lrPadding c-list crawlerlog">' . $this->drawLog_printTableHeader() . $code . '</table>';
                }
            } else {
                // Otherwise show available sets:
                $setList = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('set_id, count(*) as count_value, scheduled', 'tx_crawler_queue', '', 'set_id, scheduled', 'scheduled DESC');
                $code = '
					<tr class="bgColor5 tableheader">
						<td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.setid') . ':</td>
						<td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.count') . 't:</td>
						<td>' . $GLOBALS['LANG']->sL('LLL:EXT:crawler/modfunc1/locallang.xml:labels.time') . ':</td>
					</tr>
				';
                $cc = 0;
                foreach ($setList as $set) {
                    $code .= '
						<tr class="bgColor' . ($cc % 2 ? '-20' : '-10') . '">
							<td><a href="' . htmlspecialchars('index.php?setID=' . $set['set_id']) . '">' . $set['set_id'] . '</a></td>
							<td>' . $set['count_value'] . '</td>
							<td>' . \TYPO3\CMS\Backend\Utility\BackendUtility::dateTimeAge($set['scheduled']) . '</td>
						</tr>
					';
                    $cc++;
                }
                $output .= '
					<br /><br />
					<table class="lrPadding c-list">' . $code . '</table>';
            }
        }
        if ($this->CSVExport) {
            $this->outputCsvFile();
        }
        // Return output
        return $output;
    }
开发者ID:nawork,项目名称:crawler,代码行数:101,代码来源:class.tx_crawler_modfunc1.php

示例8: viewEditRecord

 /**
  * Action to edit records
  *
  * @param array $record sys_action record
  * @return string list of records
  */
 protected function viewEditRecord($record)
 {
     $content = '';
     $actionList = array();
     $dbAnalysis = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Database\\RelationHandler');
     $dbAnalysis->setFetchAllFields(TRUE);
     $dbAnalysis->start($record['t4_recordsToEdit'], '*');
     $dbAnalysis->getFromDB();
     // collect the records
     foreach ($dbAnalysis->itemArray as $el) {
         $path = BackendUtility::getRecordPath($el['id'], $this->taskObject->perms_clause, $GLOBALS['BE_USER']->uc['titleLen']);
         $record = BackendUtility::getRecord($el['table'], $dbAnalysis->results[$el['table']][$el['id']]);
         $title = BackendUtility::getRecordTitle($el['table'], $dbAnalysis->results[$el['table']][$el['id']]);
         $description = $GLOBALS['LANG']->sL($GLOBALS['TCA'][$el['table']]['ctrl']['title'], TRUE);
         // @todo: which information could be needful
         if (isset($record['crdate'])) {
             $description .= ' - ' . BackendUtility::dateTimeAge($record['crdate']);
         }
         $actionList[$el['id']] = array('title' => $title, 'description' => BackendUtility::getRecordTitle($el['table'], $dbAnalysis->results[$el['table']][$el['id']]), 'descriptionHtml' => $description, 'link' => $GLOBALS['BACK_PATH'] . 'alt_doc.php?returnUrl=' . rawurlencode(GeneralUtility::getIndpEnv('REQUEST_URI')) . '&edit[' . $el['table'] . '][' . $el['id'] . ']=edit', 'icon' => \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord($el['table'], $dbAnalysis->results[$el['table']][$el['id']], array('title' => htmlspecialchars($path))));
     }
     // Render the record list
     $content .= $this->taskObject->renderListMenu($actionList);
     return $content;
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:30,代码来源:ActionTask.php

示例9: dateTimeAgeReturnsCorrectValues

 /**
  * @test
  */
 public function dateTimeAgeReturnsCorrectValues()
 {
     /** @var ObjectProphecy|LanguageService $languageServiceProphecy */
     $languageServiceProphecy = $this->prophesize(LanguageService::class);
     $languageServiceProphecy->sL(Argument::cetera())->willReturn(' min| hrs| days| yrs| min| hour| day| year');
     $GLOBALS['LANG'] = $languageServiceProphecy->reveal();
     $GLOBALS['EXEC_TIME'] = mktime(0, 0, 0, 3, 23, 2016);
     $this->assertSame('24-03-16 00:00 (-1 day)', BackendUtility::dateTimeAge($GLOBALS['EXEC_TIME'] + 86400));
     $this->assertSame('24-03-16 (-1 day)', BackendUtility::dateTimeAge($GLOBALS['EXEC_TIME'] + 86400, 1, 'date'));
 }
开发者ID:dachcom-digital,项目名称:TYPO3.CMS,代码行数:13,代码来源:BackendUtilityTest.php

示例10: getAgeLastChecked

 /**
  * Get age of last checked date, based on BackendUtility
  *
  * @return string
  */
 public function getAgeLastChecked()
 {
     if ($this->lastChecked instanceof \DateTime) {
         return BackendUtility::dateTimeAge($this->lastChecked->getTimestamp());
     }
     return null;
 }
开发者ID:Schweriner,项目名称:my_redirects,代码行数:12,代码来源:Redirect.php


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