Initial working version ofa consistent layout with side menu
git-svn-id: file:///svn-source/pmgr/branches/initial_20090526@38 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -35,5 +35,24 @@
|
||||
* @subpackage cake.app
|
||||
*/
|
||||
class AppController extends Controller {
|
||||
|
||||
function sideMenuStandardLinks() {
|
||||
return array(
|
||||
array('name' => 'Standard Menu', 'header' => true),
|
||||
array('name' => 'Site Map', 'url' => array('controller' => 'maps', 'action' => 'view', 1)),
|
||||
array('hr' => true),
|
||||
array('name' => 'Tenants', 'url' => array('controller' => 'contacts', 'action' => 'index')),
|
||||
array('name' => 'Units', 'url' => array('controller' => 'units', 'action' => 'index')),
|
||||
);
|
||||
}
|
||||
|
||||
function sideMenuLinks() {
|
||||
return $this->sideMenuStandardLinks();
|
||||
}
|
||||
|
||||
function beforeRender() {
|
||||
$this->set('sidemenu', $this->sideMenuLinks());
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -1,7 +1,6 @@
|
||||
<?php /* -*- mode:PHP -*- */ ?>
|
||||
|
||||
<div class="contacts view">
|
||||
<h2><?php __('Contact'); ?></h2>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
<?php /* -*- mode:PHP -*- */ ?>
|
||||
<?php /* -*- mode:PHP -*- */
|
||||
|
||||
<p>
|
||||
<?php
|
||||
if (isset($heading))
|
||||
echo $heading;
|
||||
else
|
||||
echo '<h2>'.__('Contacts',true).'</h2>';
|
||||
if (isset($heading))
|
||||
echo $heading;
|
||||
else
|
||||
echo '<h2>'.__('Contacts',true).'</h2>';
|
||||
?>
|
||||
</p>
|
||||
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
<?php /* -*- mode:PHP -*- */ ?>
|
||||
<?php /* -*- mode:PHP -*- */
|
||||
|
||||
<p>
|
||||
<?php
|
||||
if (isset($heading))
|
||||
echo $heading;
|
||||
else
|
||||
echo '<h2>'.__('Maps',true).'</h2>';
|
||||
if (isset($heading))
|
||||
echo $heading;
|
||||
else
|
||||
echo '<h2>'.__('Maps',true).'</h2>';
|
||||
?>
|
||||
</p>
|
||||
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
|
||||
|
||||
24
site/views/elements/sidemenu.ctp
Normal file
24
site/views/elements/sidemenu.ctp
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php /* -*- mode:PHP -*- */
|
||||
|
||||
/* sidemenu.ctp */
|
||||
/*
|
||||
*
|
||||
* @filesource
|
||||
* @copyright Copyright 2009, Abijah Perkins
|
||||
* @package pmgr
|
||||
*/
|
||||
|
||||
foreach ($menu AS $item) {
|
||||
if (isset($item['header']))
|
||||
echo('<DIV CLASS="header">' . $item['name'] . '</DIV>' . "\n");
|
||||
elseif (isset($item['hr']))
|
||||
echo('<HR>' . "\n");
|
||||
elseif (isset($item['url']))
|
||||
echo('<DIV CLASS="item">'
|
||||
. $html->link($item['name'], $item['url'],
|
||||
isset($item['htmlAttributes']) ? $item['htmlAttributes'] : null,
|
||||
isset($item['confirmMessage']) ? $item['confirmMessage'] : null,
|
||||
isset($item['escapeTitle']) ? $item['escapeTitle'] : null)
|
||||
|
||||
. '</DIV>' . "\n");
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
<?php /* -*- mode:PHP -*- */ ?>
|
||||
<?php /* -*- mode:PHP -*- */
|
||||
|
||||
<p>
|
||||
<?php
|
||||
if (isset($heading))
|
||||
echo $heading;
|
||||
else
|
||||
echo '<h2>'.__('Units',true).'</h2>';
|
||||
if (isset($heading))
|
||||
echo $heading;
|
||||
else
|
||||
echo '<h2>'.__('Units',true).'</h2>';
|
||||
?>
|
||||
</p>
|
||||
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
|
||||
|
||||
@@ -27,38 +27,56 @@
|
||||
<head>
|
||||
<?php echo $html->charset(); ?>
|
||||
<title>
|
||||
<?php __('CakePHP: the rapid development php framework:'); ?>
|
||||
<?php echo $title_for_layout; ?>
|
||||
Property Manager: <?php echo $title_for_layout; ?>
|
||||
</title>
|
||||
<?php
|
||||
echo $html->meta('icon');
|
||||
|
||||
echo $html->css('cake.generic');
|
||||
|
||||
echo $scripts_for_layout;
|
||||
?>
|
||||
<LINK REL="stylesheet" TYPE="text/css" HREF="<?php echo $html->url('/webroot/css/sidemenu.css') ?>" />
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<TABLE id="layout">
|
||||
<!-- LAYOUT TABLE -->
|
||||
<TR>
|
||||
<!-- LAYOUT ROW -->
|
||||
|
||||
<TD ID="sidecolumn">
|
||||
<!-- SIDE MENU COLUMN -->
|
||||
|
||||
<?php echo $this->element('sidemenu', array('menu' => $sidemenu)); ?>
|
||||
|
||||
<!-- END SIDE MENU COLUMN -->
|
||||
</TD>
|
||||
|
||||
<TD ID="pagecolumn">
|
||||
<!-- CONTENT COLUMN -->
|
||||
|
||||
<div id="container">
|
||||
<div id="header">
|
||||
<h1><?php echo $html->link(__('CakePHP: the rapid development php framework', true), 'http://cakephp.org'); ?></h1>
|
||||
</div>
|
||||
<div id="content">
|
||||
|
||||
<?php $session->flash(); ?>
|
||||
|
||||
<?php echo $content_for_layout; ?>
|
||||
|
||||
</div>
|
||||
<div id="footer">
|
||||
<?php echo $html->link(
|
||||
$html->image('cake.power.gif', array('alt'=> __("CakePHP: the rapid development php framework", true), 'border'=>"0")),
|
||||
'http://www.cakephp.org/',
|
||||
array('target'=>'_blank'), null, false
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo $cakeDebug; ?>
|
||||
|
||||
<!-- END CONTENT COLUMN -->
|
||||
</TD>
|
||||
|
||||
<!-- LAYOUT ROW -->
|
||||
</TR>
|
||||
|
||||
<!-- LAYOUT TABLE -->
|
||||
</TABLE>
|
||||
|
||||
<?php echo $cakeDebug; ?>
|
||||
<?php /* pr($this); */ ?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?php /* -*- mode:PHP -*- */ ?>
|
||||
|
||||
<div class="units view">
|
||||
<h2><?php __('Unit'); ?></h2>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
@@ -63,8 +63,7 @@ h2 {
|
||||
color: #e32;
|
||||
font-family:'Gill Sans','lucida grande',helvetica, arial, sans-serif;
|
||||
font-size: 190%;
|
||||
margin: 0.3em 0;
|
||||
padding-top: 0.8em;
|
||||
margin-bottom: 0.3em;
|
||||
}
|
||||
h3 {
|
||||
color: #993;
|
||||
@@ -109,7 +108,7 @@ ul, li {
|
||||
background: #fff;
|
||||
clear: both;
|
||||
color: #333;
|
||||
padding: 10px 20px 40px 20px;
|
||||
/* padding: 10px 20px 40px 20px; */
|
||||
overflow: auto;
|
||||
}
|
||||
#footer {
|
||||
|
||||
140
site/webroot/css/sidemenu.css
Normal file
140
site/webroot/css/sidemenu.css
Normal file
@@ -0,0 +1,140 @@
|
||||
/************************************************************
|
||||
************************************************************
|
||||
* Debug table margin/padding helper
|
||||
*/
|
||||
|
||||
/* table th, td { border: dashed 1px; } */
|
||||
|
||||
/************************************************************
|
||||
************************************************************
|
||||
* Overall page layout
|
||||
*/
|
||||
|
||||
table#layout { width: 100% }
|
||||
td#sidecolumn { width: 1%; background: lightblue; text-align: left; }
|
||||
td#pagecolumn { padding-left: 4mm; }
|
||||
td#sidecolumn ,
|
||||
td#pagecolumn { vertical-align: top; }
|
||||
|
||||
td#sidecolumn .header ,
|
||||
td#sidecolumn .item { white-space : nowrap; }
|
||||
td#sidecolumn .item { padding-left: 0.6em; }
|
||||
td#sidecolumn .item a { background: lightblue; }
|
||||
|
||||
td#sidecolumn hr { margin-top: 0.4em; margin-bottom: 0.3em; }
|
||||
|
||||
|
||||
/************************************************************
|
||||
************************************************************
|
||||
* Panel captions
|
||||
*/
|
||||
|
||||
table caption { text-align: left;
|
||||
font-size: 120%;
|
||||
font-weight: bold;
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
|
||||
|
||||
/************************************************************
|
||||
************************************************************
|
||||
* Panel headers
|
||||
*/
|
||||
|
||||
td#sidecolumn .header ,
|
||||
table.list th ,
|
||||
table.edit td.name { background: blue;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
/************************************************************
|
||||
************************************************************
|
||||
* Cell configuration
|
||||
*/
|
||||
|
||||
th, td { padding: 0.1em 0.4em 0.1em 0.4em; }
|
||||
table.item { border-spacing: 0 0; /*IE*/border-collapse: collapse; empty-cells: show }
|
||||
|
||||
|
||||
/************************************************************
|
||||
************************************************************
|
||||
* Overall text alignment
|
||||
*/
|
||||
|
||||
th, td { text-align: left; }
|
||||
|
||||
|
||||
/************************************************************
|
||||
************************************************************
|
||||
* Formatting for item listings
|
||||
*/
|
||||
|
||||
/** Item listing width and borders **/
|
||||
table.list { width: 100%; }
|
||||
table.list td { border: 1px solid #000; }
|
||||
|
||||
/* IE doesn't seem to work with first-child. this combination of
|
||||
* rules works for both IE and Firefox */
|
||||
table.list th { border-left: 1px solid #fff; border-top: 1px solid #000; }
|
||||
table.list th:first-child { border-left: 1px solid #000 }
|
||||
table.list { border: 1px solid #000; }
|
||||
|
||||
/** Column to which any extra real estate should be allocated **/
|
||||
table.list.view td#referer ,
|
||||
table.list.browser td#web_browser ,
|
||||
table.list.tracker td#url ,
|
||||
table.list.category td#comment { width: 99%; }
|
||||
|
||||
/** Text alignment exceptions **/
|
||||
table.list td#id ,
|
||||
table.list td#operation ,
|
||||
table.list td#browser ,
|
||||
table.list td#views ,
|
||||
table.list td#uniques { text-align: center; }
|
||||
|
||||
/** White spacing exceptions **/
|
||||
table.list { white-space : nowrap }
|
||||
table.list.browser td#web_browser ,
|
||||
table.list.category td#comment { white-space: normal; }
|
||||
|
||||
|
||||
/************************************************************
|
||||
************************************************************
|
||||
* Format for item editing
|
||||
*/
|
||||
|
||||
/** Item editing width and borders **/
|
||||
table.edit tr:first-child td.name { border-top: none }
|
||||
table.edit td.name { border-top: 1px solid #fff; width:1% }
|
||||
|
||||
/** Text alignment exceptions **/
|
||||
table.edit td.name { text-align: right }
|
||||
table.edit td.value { text-align: left }
|
||||
|
||||
|
||||
/************************************************************
|
||||
************************************************************
|
||||
* Form submission buttons after item tables
|
||||
*/
|
||||
|
||||
div.opbuttons { margin-top: 1.0em; text-align: left }
|
||||
|
||||
|
||||
|
||||
|
||||
/* table#unitinfo, table#tenantinfo { width: 60% } */
|
||||
/* table#unitinfo td:first-child, table#tenantinfo td:first-child { width: 30% } */
|
||||
/* table#unitinfo td, table#tenanatinfo td { width: 70% } */
|
||||
/* /\*table.detail td:first-child { width: 30% }*\/ */
|
||||
/* /\*table.detail td { width: 1% }*\/ */
|
||||
/* #unitinfo caption, #tenantinfo caption { margin-top: 0px; } */
|
||||
/* table.detail caption { margin-top: 1.5em; text-align: left; font-size: 14pt; font-weight: bold } */
|
||||
/* table.detail {width: 80% } */
|
||||
/* table.detail {border-spacing: 0 0} */
|
||||
/* table.detail {border-left: 1px solid #000; border-top: 1px solid #000} */
|
||||
/* table.detail {empty-cells: show} */
|
||||
/* table.detail td, table.detail th {padding: 0.1em 0.2em 0.1em 0.2em } */
|
||||
/* table.detail td, table.detail th {border-right: 1px solid #000; border-bottom: 1px solid #000} */
|
||||
/* table.detail td {word-wrap : normal} */
|
||||
Reference in New Issue
Block a user