Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-2835545
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupal-2835545
Commits
af438864
Commit
af438864
authored
19 years ago
by
Dries Buytaert
Browse files
Options
Downloads
Patches
Plain Diff
- Patch
#33861
by Morbus et al: clean up the watchdog view.
parent
100db625
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
includes/path.inc
+2
-1
2 additions, 1 deletion
includes/path.inc
misc/drupal.css
+3
-0
3 additions, 0 deletions
misc/drupal.css
modules/watchdog.module
+17
-10
17 additions, 10 deletions
modules/watchdog.module
modules/watchdog/watchdog.module
+17
-10
17 additions, 10 deletions
modules/watchdog/watchdog.module
with
39 additions
and
21 deletions
includes/path.inc
+
2
−
1
View file @
af438864
<?
<?php
// $Id$
/**
* @file
...
...
This diff is collapsed.
Click to expand it.
misc/drupal.css
+
3
−
0
View file @
af438864
...
...
@@ -459,6 +459,9 @@ img.screenshot {
font-size
:
0.85em
;
text-align
:
right
;
}
table
.watchdog-event
th
{
border-bottom
:
1px
solid
#ccc
;
}
tr
.watchdog-user
{
background
:
#ffd
;
}
...
...
This diff is collapsed.
Click to expand it.
modules/watchdog.module
+
17
−
10
View file @
af438864
...
...
@@ -156,20 +156,27 @@ function watchdog_event($id) {
$output
=
''
;
$result
=
db_query
(
'SELECT w.*, u.name, u.uid FROM {watchdog} w INNER JOIN {users} u ON w.uid = u.uid WHERE w.wid = %d'
,
$id
);
if
(
$watchdog
=
db_fetch_object
(
$result
))
{
$output
.
=
'<table border="1" cellpadding="2" cellspacing="2">'
;
$output
.
=
' <tr><th>'
.
t
(
'Type'
)
.
'</th><td>'
.
t
(
$watchdog
->
type
)
.
'</td></tr>'
;
$output
.
=
' <tr><th>'
.
t
(
'Date'
)
.
'</th><td>'
.
format_date
(
$watchdog
->
timestamp
,
'large'
)
.
'</td></tr>'
;
$output
.
=
' <tr><th>'
.
t
(
'User'
)
.
'</th><td>'
.
theme
(
'username'
,
$watchdog
)
.
'</td></tr>'
;
$output
.
=
' <tr><th>'
.
t
(
'Location'
)
.
"</th><td>"
.
l
(
$watchdog
->
location
,
$watchdog
->
location
)
.
"</td></tr>"
;
$output
.
=
' <tr><th>'
.
t
(
'Referrer'
)
.
"</th><td>"
.
l
(
$watchdog
->
referer
,
$watchdog
->
referer
)
.
"</td></tr>"
;
$output
.
=
' <tr><th>'
.
t
(
'Message'
)
.
"</th><td>
$watchdog->message
</td></tr>"
;
$output
.
=
' <tr><th>'
.
t
(
'Severity'
)
.
'</th><td>'
.
$severity
[
$watchdog
->
severity
]
.
'</td></tr>'
;
$output
.
=
' <tr><th>'
.
t
(
'Hostname'
)
.
"</th><td>
$watchdog->hostname
</td></tr>"
;
$output
.
=
'</table>'
;
$header
=
array
(
t
(
'Type'
),
t
(
'Date'
),
t
(
'User'
),
t
(
'Location'
),
t
(
'Referrer'
),
t
(
'Message'
),
t
(
'Severity'
),
t
(
'Hostname'
));
$data
=
array
(
t
(
$watchdog
->
type
),
format_date
(
$watchdog
->
timestamp
,
'large'
),
theme
(
'username'
,
$watchdog
),
l
(
$watchdog
->
location
,
$watchdog
->
location
),
l
(
$watchdog
->
referer
,
$watchdog
->
referer
),
$watchdog
->
message
,
$severity
[
$watchdog
->
severity
],
$watchdog
->
hostname
);
$output
=
theme
(
'watchdog_event'
,
$header
,
$data
);
}
return
$output
;
}
function
theme_watchdog_event
(
$header
,
$data
)
{
$output
=
''
;
$output
.
=
'<table class="watchdog-event">'
;
$n
=
count
(
$header
);
for
(
$i
=
0
;
$i
<
$n
;
$i
++
)
{
$output
.
=
'<tr class="'
.
(
$i
%
2
==
0
?
'even'
:
'odd'
)
.
'"><th>'
.
$header
[
$i
]
.
'</th><td>'
.
$data
[
$i
]
.
'</td></tr>'
;
}
$output
.
=
'</table>'
;
return
$output
;
}
function
_watchdog_get_message_types
()
{
$types
=
array
();
...
...
This diff is collapsed.
Click to expand it.
modules/watchdog/watchdog.module
+
17
−
10
View file @
af438864
...
...
@@ -156,20 +156,27 @@ function watchdog_event($id) {
$output
=
''
;
$result
=
db_query
(
'SELECT w.*, u.name, u.uid FROM {watchdog} w INNER JOIN {users} u ON w.uid = u.uid WHERE w.wid = %d'
,
$id
);
if
(
$watchdog
=
db_fetch_object
(
$result
))
{
$output
.
=
'<table border="1" cellpadding="2" cellspacing="2">'
;
$output
.
=
' <tr><th>'
.
t
(
'Type'
)
.
'</th><td>'
.
t
(
$watchdog
->
type
)
.
'</td></tr>'
;
$output
.
=
' <tr><th>'
.
t
(
'Date'
)
.
'</th><td>'
.
format_date
(
$watchdog
->
timestamp
,
'large'
)
.
'</td></tr>'
;
$output
.
=
' <tr><th>'
.
t
(
'User'
)
.
'</th><td>'
.
theme
(
'username'
,
$watchdog
)
.
'</td></tr>'
;
$output
.
=
' <tr><th>'
.
t
(
'Location'
)
.
"</th><td>"
.
l
(
$watchdog
->
location
,
$watchdog
->
location
)
.
"</td></tr>"
;
$output
.
=
' <tr><th>'
.
t
(
'Referrer'
)
.
"</th><td>"
.
l
(
$watchdog
->
referer
,
$watchdog
->
referer
)
.
"</td></tr>"
;
$output
.
=
' <tr><th>'
.
t
(
'Message'
)
.
"</th><td>
$watchdog->message
</td></tr>"
;
$output
.
=
' <tr><th>'
.
t
(
'Severity'
)
.
'</th><td>'
.
$severity
[
$watchdog
->
severity
]
.
'</td></tr>'
;
$output
.
=
' <tr><th>'
.
t
(
'Hostname'
)
.
"</th><td>
$watchdog->hostname
</td></tr>"
;
$output
.
=
'</table>'
;
$header
=
array
(
t
(
'Type'
),
t
(
'Date'
),
t
(
'User'
),
t
(
'Location'
),
t
(
'Referrer'
),
t
(
'Message'
),
t
(
'Severity'
),
t
(
'Hostname'
));
$data
=
array
(
t
(
$watchdog
->
type
),
format_date
(
$watchdog
->
timestamp
,
'large'
),
theme
(
'username'
,
$watchdog
),
l
(
$watchdog
->
location
,
$watchdog
->
location
),
l
(
$watchdog
->
referer
,
$watchdog
->
referer
),
$watchdog
->
message
,
$severity
[
$watchdog
->
severity
],
$watchdog
->
hostname
);
$output
=
theme
(
'watchdog_event'
,
$header
,
$data
);
}
return
$output
;
}
function
theme_watchdog_event
(
$header
,
$data
)
{
$output
=
''
;
$output
.
=
'<table class="watchdog-event">'
;
$n
=
count
(
$header
);
for
(
$i
=
0
;
$i
<
$n
;
$i
++
)
{
$output
.
=
'<tr class="'
.
(
$i
%
2
==
0
?
'even'
:
'odd'
)
.
'"><th>'
.
$header
[
$i
]
.
'</th><td>'
.
$data
[
$i
]
.
'</td></tr>'
;
}
$output
.
=
'</table>'
;
return
$output
;
}
function
_watchdog_get_message_types
()
{
$types
=
array
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment