Exemple #1
0
 public static function getAll($pageset = 1)
 {
     if (!is_numeric($pageset) || floor($pageset) != $pageset) {
         $pageset = 1;
     }
     $result = array('entries' => array(), 'total' => ErrorHandler::getTotalEntries());
     foreach (ErrorHandler::getAll(MAX_DISPLAY_SEARCH_RESULTS, $pageset) as $row) {
         $result['entries'][] = array('date' => DateTime::getShort(DateTime::fromUnixTimestamp($row['timestamp']), true), 'message' => $row['message']);
     }
     return $result;
 }
 public static function execute($datetime)
 {
     $errors = ErrorHandler::getAll(100);
     $from_timestamp = DateTime::getTimestamp($datetime, 'Y-m-d H:i:s');
     $result = 0;
     foreach ($errors as $error) {
         if ($error['timestamp'] > $from_timestamp) {
             $result++;
         }
     }
     return $result;
 }
Exemple #3
0
 public function __construct()
 {
     Registry::get('Language')->loadIniFile('modules/IndexModules/ErrorLog.php');
     $this->_title = OSCOM::getDef('admin_indexmodules_errorlog_title');
     $this->_title_link = OSCOM::getLink(null, 'ErrorLog');
     if (Access::hasAccess(OSCOM::getSite(), 'ErrorLog')) {
         $this->_data = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">' . '  <thead>' . '    <tr>' . '      <th>' . OSCOM::getDef('admin_indexmodules_errorlog_table_heading_date') . '</th>' . '      <th>' . OSCOM::getDef('admin_indexmodules_errorlog_table_heading_message') . '</th>' . '    </tr>' . '  </thead>' . '  <tbody>';
         if (ErrorHandler::getTotalEntries() > 0) {
             $counter = 0;
             foreach (ErrorHandler::getAll(6) as $row) {
                 $this->_data .= '    <tr onmouseover="$(this).addClass(\'mouseOver\');" onmouseout="$(this).removeClass(\'mouseOver\');"' . ($counter % 2 ? ' class="alt"' : '') . '>' . '      <td style="white-space: nowrap;">' . Registry::get('Template')->getIcon(16, 'errorlog.png') . '&nbsp;' . DateTime::getShort(DateTime::fromUnixTimestamp($row['timestamp']), true) . '</td>' . '      <td>' . osc_output_string_protected(substr($row['message'], 0, 60)) . '..</td>' . '    </tr>';
                 $counter++;
             }
         } else {
             $this->_data .= '    <tr onmouseover="$(this).addClass(\'mouseOver\');" onmouseout="$(this).removeClass(\'mouseOver\');">' . '      <td colspan="2">' . osc_icon('tick.png') . '&nbsp;' . OSCOM::getDef('admin_indexmodules_errorlog_no_errors_found') . '</td>' . '    </tr>';
         }
         $this->_data .= '  </tbody>' . '</table>';
     }
 }