示例#1
0
 public static function execute($search, $pageset = 1)
 {
     if (!is_numeric($pageset) || floor($pageset) != $pageset) {
         $pageset = 1;
     }
     $result = array('entries' => array(), 'total' => ErrorHandler::getTotalFindEntries($search));
     foreach (ErrorHandler::find($search, 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;
 }
示例#3
0
 public static function initialize()
 {
     static::loadConfig();
     DateTime::setTimeZone();
     ErrorHandler::initialize();
     static::setSite();
     if (!static::siteExists(static::getSite())) {
         trigger_error('Site \'' . static::getSite() . '\' does not exist', E_USER_ERROR);
         exit;
     }
     static::setSiteApplication();
     call_user_func(array('osCommerce\\OM\\Core\\Site\\' . static::getSite() . '\\Controller', 'initialize'));
 }
示例#4
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>';
     }
 }
示例#5
0
 public static function execute()
 {
     ErrorHandler::clear();
     return true;
 }
示例#6
0
?>

<div class="infoBox">
  <h3><?php 
echo osc_icon('trash.png') . ' ' . OSCOM::getDef('title_delete_error_log');
?>
</h3>

  <form name="elDelete" class="dataForm" action="<?php 
echo OSCOM::getLink(null, null, 'Delete&Process');
?>
" method="post">

  <p><?php 
echo OSCOM::getDef('introduction_delete_error_log');
?>
</p>

  <p><?php 
echo '<b>' . sprintf(OSCOM::getDef('number_of_error_log_file_entries'), number_format(ErrorHandler::getTotalEntries())) . '</b>';
?>
</p>

  <p><?php 
echo osc_draw_button(array('priority' => 'primary', 'icon' => 'trash', 'title' => OSCOM::getDef('button_delete'))) . ' ' . osc_draw_button(array('href' => OSCOM::getLink(), 'priority' => 'secondary', 'icon' => 'close', 'title' => OSCOM::getDef('button_cancel')));
?>
</p>

  </form>
</div>