Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
d595fc8f
Commit
d595fc8f
authored
Oct 20, 2001
by
Dries
Browse files
- Started a theme.inc clean-up.
parent
8d4650c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/theme.inc
View file @
d595fc8f
<?php
class
BaseTheme
{
function
header
()
{
$output
.
=
"<html><head><title>"
.
variable_get
(
site_name
,
"drupal"
)
.
"</title></head><body>"
;
$output
.
=
"<table border=
\"
0
\"
cellspacing=
\"
4
\"
cellpadding=
\"
4
\"
><tr><td valign=
\"
top
\"
width=
\"
170
\"
>"
;
print
$output
;
$this
->
box
(
t
(
"Navigation"
),
implode
(
"<br />"
,
link_page
()));
$this
->
user
(
"all"
,
$this
);
theme_blocks
(
"all"
,
$this
);
print
"</td><td valgin=
\"
top
\"
>"
;
}
function
links
(
$links
,
$delimiter
=
" | "
)
{
return
implode
(
$delimiter
,
$links
);
}
...
...
@@ -9,7 +20,7 @@ function image($name) {
return
"misc/
$name
"
;
}
function
user
(
$region
,
&
$theme
)
{
function
user
(
$region
)
{
global
$user
;
if
(
$user
->
uid
)
{
...
...
@@ -33,7 +44,7 @@ function user($region, &$theme) {
$output
.
=
"</div>"
;
$th
eme
->
box
(
$user
->
name
,
$output
,
$region
);
$th
is
->
box
(
$user
->
name
,
$output
,
$region
);
}
else
{
$output
.
=
"<div align=
\"
center
\"
>
\n
"
;
...
...
@@ -45,10 +56,27 @@ function user($region, &$theme) {
$output
.
=
" </form>
\n
"
;
$output
.
=
"</div>
\n
"
;
$theme
->
box
(
t
(
"Log in"
),
$output
,
$region
);
$this
->
box
(
t
(
"Log in"
),
$output
,
$region
);
}
}
function
node
(
$node
,
$main
)
{
$output
.
=
"<b>"
.
check_output
(
$node
->
title
)
.
"</b> by "
.
format_name
(
$node
)
.
"<br />"
;
if
(
$main
&&
$node
->
teaser
)
{
$output
.
=
strip_tags
(
check_output
(
$node
->
teaser
,
1
));
}
else
{
$output
.
=
check_output
(
$node
->
body
,
1
);
}
if
(
$main
)
{
$output
.
=
"<br />[ "
.
$this
->
links
(
link_node
(
$node
))
.
" ]"
;
}
$output
.
=
"<hr />"
;
print
$output
;
}
function
comment_controls
(
$threshold
=
1
,
$mode
=
3
,
$order
=
1
)
{
global
$user
,
$id
;
...
...
@@ -73,6 +101,18 @@ function comment($comment, $link = 0) {
$output
.
=
"</div><br />"
;
print
$output
;
}
function
box
(
$subject
,
$content
,
$region
=
"main"
)
{
$output
.
=
"<b>"
.
check_output
(
$subject
)
.
"</b><br />"
.
check_output
(
$content
)
.
"<p />"
;
print
$output
;
}
function
footer
()
{
$output
.
=
"</td></tr></table>"
;
$output
.
=
"</body></html>"
;
print
$output
;
}
}
function
theme_init
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment