Esempio n. 1
0
 /**
  * @throws SystemLogIDMissingException
  */
 public static function detail()
 {
     if ($_GET['id']) {
         $system_log = new SystemLog($_GET['id']);
         $user = new User($system_log->get_user_id());
         $datetime_handler = new DatetimeHandler($system_log->get_datetime());
         $template = new HTMLTemplate("base/admin/system_log/detail.html");
         $template->set_var("datetime", $datetime_handler->get_datetime(false));
         if ($system_log->get_user_id()) {
             $template->set_var("username", $user->get_username() . " (" . $user->get_full_name(false) . ")");
         } else {
             $template->set_var("username", "");
         }
         if ($system_log->get_ip()) {
             $template->set_var("ip", $system_log->get_ip());
         } else {
             $template->set_var("ip", "");
         }
         if ($system_log->get_file()) {
             $template->set_var("file", $system_log->get_file());
         } else {
             $template->set_var("file", "");
         }
         if ($system_log->get_line()) {
             $template->set_var("line", $system_log->get_line());
         } else {
             $template->set_var("line", "");
         }
         if ($system_log->get_content_int()) {
             $template->set_var("content_int", $system_log->get_content_int());
         } else {
             $template->set_var("content_int", "");
         }
         if ($system_log->get_content_string()) {
             $template->set_var("content_string", $system_log->get_content_string());
         } else {
             $template->set_var("content_string", "");
         }
         if ($system_log->get_link()) {
             $unserialized_string = unserialize($system_log->get_link());
             if (is_array($unserialized_string)) {
                 if (count($unserialized_string) >= 1) {
                     $string = "";
                     foreach ($unserialized_string as $key => $value) {
                         $string .= $key . " => " . $value . "<br />";
                     }
                     $template->set_var("get", $string);
                 } else {
                     $template->set_var("get", "");
                 }
             } else {
                 $template->set_var("get", $system_log->get_link());
             }
         } else {
             $template->set_var("get", "");
         }
         $template->output();
     } else {
         throw new SystemLogIDMissingException();
     }
 }