/**
  * This method renders the report
  *
  * @return    string    The status report as HTML
  */
 public function getReport()
 {
     $actionURL = tx_additionalreports_util::getBaseUrl() . '&cmd=deleteAll';
     $content = '<a href="' . $actionURL . '"><img src="' . \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_DIR') . '../typo3conf/ext/additional_reports/Resources/Public/Icons/garbage.gif"/> ' . $GLOBALS['LANG']->getLL('flushalllog') . '</a>';
     $content .= tx_additionalreports_main::displayRealUrlErrors();
     return $content;
 }
Ejemplo n.º 2
0
 /**
  * @test
  */
 public function getBaseUrl()
 {
     $this->assertFalse(filter_var(tx_additionalreports_util::getBaseUrl(), FILTER_VALIDATE_URL) === FALSE);
 }
 /**
  * Generate the log error report
  *
  * @return string HTML code
  */
 public static function displayLogErrors()
 {
     // query
     $query = array();
     $query['SELECT'] = 'COUNT(*) AS "nb",details,MAX(tstamp) as "tstamp"';
     $query['FROM'] = 'sys_log';
     $query['WHERE'] = 'error>0';
     $query['GROUPBY'] = 'details';
     $query['ORDERBY'] = 'nb DESC,tstamp DESC';
     $query['LIMIT'] = '';
     $orderby = TYPO3\CMS\Core\Utility\GeneralUtility::_GP('orderby');
     if ($orderby !== null) {
         $query['ORDERBY'] = $orderby;
     }
     $content = tx_additionalreports_util::writeInformation(self::getLl('flushalllog'), 'DELETE FROM sys_log WHERE error>0;');
     $logErrors = array();
     $view = TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Fluid\\View\\StandaloneView');
     $view->setTemplatePathAndFilename(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('additional_reports') . 'Resources/Private/Templates/logerrors-fluid.html');
     $view->assign('extconf', unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['additional_reports']));
     $view->assign('baseUrl', tx_additionalreports_util::getBaseUrl());
     $view->assign('requestDir', TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_DIR'));
     $view->assign('query', $query);
     return $content . $view->render();
 }
 /**
  * Get all the different ctypes (html select)
  *
  * @param boolean $displayHidden
  * @return array
  */
 public static function getAllDifferentCtypesSelect($displayHidden)
 {
     $where = $displayHidden === true ? '' : ' AND tt_content.hidden=0 AND pages.hidden=0 ';
     $getFiltersCat = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('filtersCat');
     $pluginsList = self::getAllDifferentCtypes($where);
     $filterCat = '';
     if ($getFiltersCat == 'all') {
         $filterCat .= '<option value="all" selected="selected">' . $GLOBALS['LANG']->getLL('all') . '</option>';
     } else {
         $filterCat .= '<option value="all">' . $GLOBALS['LANG']->getLL('all') . '</option>';
     }
     foreach ($pluginsList as $pluginsElement) {
         if ($getFiltersCat == $pluginsElement['CType'] && $getFiltersCat !== null) {
             $filterCat .= '<option value="' . $pluginsElement['CType'] . '" selected="selected">';
             $filterCat .= $pluginsElement['CType'] . '</option>';
         } else {
             $filterCat .= '<option value="' . $pluginsElement['CType'] . '">' . $pluginsElement['CType'] . '</option>';
         }
     }
     $listUrlOrig = tx_additionalreports_util::getBaseUrl() . '&display=' . tx_additionalreports_util::getPluginsDisplayMode();
     $content = '<select name="filtersCat" id="filtersCat">' . $filterCat . '</select>';
     $content .= '<a href="#"  onClick="jumpToUrl(\'' . $listUrlOrig;
     $content .= '&filtersCat=\'+document.getElementById(\'filtersCat\').value);">';
     $content .= '&nbsp;<img width="16" height="16" title="" alt="" src="' . \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_DIR');
     $content .= '../typo3conf/ext/additional_reports/Resources/Public/Icons/refresh_n.gif"></a>';
     return $content;
 }