page templating and css management

This commit is contained in:
friendica 2012-07-21 23:17:45 -07:00
parent c1fe66bec5
commit 6d74c2c594
8 changed files with 80 additions and 35 deletions

View File

@ -358,15 +358,17 @@ if($a->module != 'install') {
$page_css = 'view/theme/' . current_theme() . '/'
. ((x($a->page,'layout')) ? $a->page['layout'] : 'layout' ) . '.css';
. ((x($a->page,'template')) ? $a->page['template'] : 'default' ) . '.css';
if(! file_exists($page_css))
$page_css = str_replace('theme/' . current_theme() . '/', '', $page_css);
$module_css = 'view/theme/' . current_theme() . '/mod_' . $a->module . '.css';
if(! file_exists($module_css))
$module_css = str_replace('theme/' . current_theme() . '/', '', $module_css);
if(! file_exists($module_css))
if(! file_exists($module_css))
$module_css = null;
$interval = ((local_user()) ? get_pconfig(local_user(),'system','update_interval') : 40000);
@ -386,7 +388,7 @@ if(! file_exists($module_css))
'$showfewer' => t('show fewer'),
'$update_interval' => $interval,
'$page_css' => $a->get_baseurl() . '/' . $page_css,
'$module_css' => $a->get_baseurl() . '/' . $module_css,
'$module_css' => (($module_css) ? $a->get_baseurl() . '/' . $module_css : null),
'$stylesheet' => current_theme_url(),
'$theme' => current_theme()
));

View File

@ -2,7 +2,7 @@
function zregister_init(&$a) {
$a->page['layout'] = 'full';
$a->page['template'] = 'full';
}

20
view/default.css Normal file
View File

@ -0,0 +1,20 @@
nav {
height: 94px;
display: block;
}
aside {
display: block;
min-height: 112px;
width: 200px;
position: absolute;
float: left;
}
section {
padding-left: 250px;
display: block;
min-height: 112px;
}

10
view/full.css Normal file
View File

@ -0,0 +1,10 @@
nav {
height: 94px;
display: block;
}
section {
display: block;
min-height: 112px;
}

14
view/full.php Normal file
View File

@ -0,0 +1,14 @@
<!DOCTYPE html >
<html>
<head>
<title><?php if(x($page,'title')) echo $page['title'] ?></title>
<script>var baseurl="<?php echo $a->get_baseurl() ?>";</script>
<?php if(x($page,'htmlhead')) echo $page['htmlhead'] ?>
</head>
<body>
<section><?php if(x($page,'content')) echo $page['content']; ?>
<div id="page-footer"></div>
</section>
</body>
</html>

View File

@ -8,8 +8,8 @@
<link rel="stylesheet" type="text/css" href="$baseurl/library/jslider/bin/jquery.slider.min.css" media="screen" />
<link rel="stylesheet" type="text/css" href="$page_css" media="all" />
{{ if $mod_css }}
<link rel="stylesheet" type="text/css" href="$mod_css" media="all" />
{{ if $module_css }}
<link rel="stylesheet" type="text/css" href="$module_css" media="all" />
{{ endif }}
<link rel="stylesheet" type="text/css" href="$stylesheet" media="all" />

27
view/mod_zregister.css Normal file
View File

@ -0,0 +1,27 @@
h2 {
margin-left: 15%;
margin-top: 15%;
}
#zregister-form {
font-size: 1.4em;
margin-left: 15%;
margin-top: 5%;
}
.zregister-label {
float: left;
width: 275px;
}
.zregister-input {
float: left;
width: 275px;
padding: 5px;
}
.zregister-field-end {
clear: both;
margin-bottom: 20px;
}

View File

@ -87,7 +87,6 @@ blockquote {
/* nav */
nav {
height: 94px;
display: block;
margin: 0px 10%;
border-bottom: 1px solid #babdb6;
@ -176,14 +175,11 @@ nav #nav-link-wrapper .nav-link {
aside {
display: block;
min-height: 112px;
width: 200px;
margin-left: 10%;
padding: 1em;
float: left;
background-image: url(border.jpg);
background-position: top left;
background-repeat: no-repeat;
position: absolute;
}
#dfrn-request-link {
@ -211,16 +207,13 @@ aside {
section {
margin: 0px 10%;
padding-top: 1em;
padding-left: 250px;
padding-right: 1em;
display: block;
background-color: #ffffff;
background-image: url(border.jpg);
background-position: top right;
background-repeat: no-repeat;
min-height: 112px;
}
.tabs {
height: 27px;
background-image: url(head.jpg);
@ -3305,24 +3298,3 @@ ul.menu-popup {
left: 5%;
width: 90%;
}
#zregister-form {
font-size: 1.4em;
}
.zregister-label {
float: left;
width: 275px;
}
.zregister-input {
float: left;
width: 275px;
padding: 5px;
}
.zregister-field-end {
clear: both;
margin-bottom: 20px;
}