Permalink
Browse files

modify controller route default theme.css and add my pic

  • Loading branch information...
s3265176 committed Jul 2, 2013
1 parent ea3ace0 commit c6858eca2467dedcae429ce1a23a79014c9475b9
@@ -132,6 +132,7 @@ public function admin_delete($id = null) {
* @access public
*/
public function view($alias = null) {
+ $this->layout="foundation_contact";
if (!$alias) {
$this->redirect('/');
}
@@ -1,6 +1,6 @@
/**
* Basic
- */
+
body { font-family: Georgia, serif; color: #444; }
a { color: #000; text-decoration: underline; }
@@ -22,121 +22,129 @@ blockquote p cite { text-align: right; display: block; }
div.paging { text-align: center; margin: 30px; }
#wrapper { border-top: 10px solid #444; }
+*/
+body{
+ background-image:url('../img/bg1.png');
+ background-repeat:repeat;
+}
/**
* Form
*/
-form { margin: 10px 0px 0px 0px; }
-form label { display: block; font-weight: bold; }
-form .input { margin: 0px 0px 10px 0px; }
-form .text input,
-form .password input,
-form .textarea textarea { width: 300px; }
-form .error-message { color: #ee4b33; }
-
-
+ form { margin: 10px 0px 0px 0px; }
+ form label { display: block; font-weight: bold; }
+ form .input { margin: 0px 0px 10px 0px; }
+ form .text input,
+ form .password input,
+ form .textarea textarea { width: 300px; }
+ form .error-message { color: #ee4b33; }
+
+ #header {height:150px;background-image: url("../img/footer.png");}
+ #header .site-tagline { color: #666; font-style: italic; font-size: 13px; }
+ #header h1 a { text-decoration: none; }
/**
* Header
- */
#header h1 { margin: 50px 0px 10px 0px; }
#header h1 a { text-decoration: none; }
-#header .site-tagline { color: #666; font-style: italic; font-size: 13px; }
-
+*/
/**
* Navigation (with dropdown)
*/
-#nav { border-bottom: 1px solid #ccc; margin-bottom: 40px; margin-top: 50px; height: 37px; }
-#nav ul li,
-#nav ul li a { float: left; display: block; background: #fff; }
-#nav ul li:first-child a { border-left: 1px solid #ccc; }
-#nav ul li a { color: #666; padding: 10px; border-top: 1px solid #ccc; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; text-decoration: none; }
-#nav ul li a:hover { background: #f7f7f7; }
-#nav ul li a.selected { border-bottom: 1px solid #fff; }
-#nav ul li a.selected:hover { background: #f7f7f7; border-bottom: 1px solid #ccc; }
-
-.sf-menu, .sf-menu * { margin:0; padding:0; list-style:none; }
-.sf-menu { line-height:1.0; }
-.sf-menu ul { position:absolute; top:-999em; width:10em; }
-.sf-menu ul li { width:100%; }
-.sf-menu li:hover { visibility:inherit; }
-.sf-menu li { float:left; position:relative; }
-.sf-menu a { display:block; position:relative; }
-.sf-menu li:hover ul,
-.sf-menu li.sfHover ul { left:0; top:2.5em; z-index:99; }
-ul.sf-menu li:hover li ul,
-ul.sf-menu li.sfHover li ul { top:-999em; }
-ul.sf-menu li li:hover ul,
-ul.sf-menu li li.sfHover ul { left:10em; top:0; }
-ul.sf-menu li li:hover li ul,
-ul.sf-menu li li.sfHover li ul { top:-999em; }
-ul.sf-menu li li li:hover ul,
-ul.sf-menu li li li.sfHover ul { left:10em; top:0; }
-
-#nav ul li:first-child ul { margin: -3px 0px 0px 0px; }
-#nav ul li ul { margin: -3px 0px 0px -1px; }
-#nav li li:first-child a { border-top: 1px solid #ccc; }
-#nav li li a { background: #f7f7f7; border-top: 0px solid #ccc; border-bottom: 1px solid #ccc; border-left: 1px solid #ccc; }
-#nav li li a:hover { color: #ff4b33; }
-
-#nav li li li:first-child { margin: 2px 0px 0px -1px; border-left: 0px solid #ccc; }
-#nav li li li { margin: 0px 0px 0px -1px; }
+ #nav { border-bottom: 1px solid #ccc; margin-bottom: 40px; height: 37px; }
+ #nav ul li,
+ #nav ul li a { float: left; display: block; background: #fff; }
+ #nav ul li:first-child a { border-left: 1px solid #ccc; }
+ #nav ul li a { color: #666; padding: 10px; border-top: 1px solid #ccc; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; text-decoration: none; }
+ #nav ul li a:hover { background: #f7f7f7; }
+ #nav ul li a.selected { border-bottom: 1px solid #fff; }
+ #nav ul li a.selected:hover { background: #f7f7f7; border-bottom: 1px solid #ccc; }
+
+ .sf-menu, .sf-menu * { margin:0; padding:0; list-style:none; }
+ .sf-menu { line-height:1.0; }
+ .sf-menu ul { position:absolute; top:-999em; width:10em; }
+ .sf-menu ul li { width:100%; }
+ .sf-menu li:hover { visibility:inherit; }
+ .sf-menu li { float:left; position:relative; }
+ .sf-menu a { display:block; position:relative; }
+ .sf-menu li:hover ul,
+ .sf-menu li.sfHover ul { left:0; top:2.5em; z-index:99; }
+ ul.sf-menu li:hover li ul,
+ ul.sf-menu li.sfHover li ul { top:-999em; }
+ ul.sf-menu li li:hover ul,
+ ul.sf-menu li li.sfHover ul { left:10em; top:0; }
+ ul.sf-menu li li:hover li ul,
+ ul.sf-menu li li.sfHover li ul { top:-999em; }
+ ul.sf-menu li li li:hover ul,
+ ul.sf-menu li li li.sfHover ul { left:10em; top:0; }
+
+ #nav ul li:first-child ul { margin: -3px 0px 0px 0px; }
+ #nav ul li ul { margin: -3px 0px 0px -1px; }
+ #nav li li:first-child a { border-top: 1px solid #ccc; }
+ #nav li li a { background: #f7f7f7; border-top: 0px solid #ccc; border-bottom: 1px solid #ccc; border-left: 1px solid #ccc; }
+ #nav li li a:hover { color: #ff4b33; }
+
+ #nav li li li:first-child { margin: 2px 0px 0px -1px; border-left: 0px solid #ccc; }
+ #nav li li li { margin: 0px 0px 0px -1px; }
/**
* Main
*/
-.message { border: 2px dashed #eee; padding: 10px; margin: 0px 0px 10px 0px; }
-
-.nodes .node h2 { font-size: 26px; }
-
-.node { margin: 0px 0px 50px 0px; }
-.node h2 a { text-decoration: none; display: block; }
-.node h3 { margin: 15px 0px 10px 0px; }
-.node .node-info,
-.node .node-more-info { font-size: 13px; color: #666; font-style: italic; display: block; }
-.node .node-info a,
-.node .node-more-info a { font-style: normal; }
-.node .node-body { margin: 20px 0px 15px 0px; }
-.node .node-body ul,
-.node .node-body ol { margin: 10px; }
-.node .node-body ul li { list-style-type: disc; margin: 0px 0px 0px 25px; }
-.node .node-body ol li { list-style-type: decimal; margin: 0px 0px 0px 25px; }
-
-.comments h3 { margin: 50px 0px 10px 0px; }
-.comments .comment { border-top: 1px solid #f7f7f7; }
-.comments .comment .comment { margin: 0px 0px 0px 40px; }
-.comments .comment .comment-body { line-height: 20px; }
-
-.comment .comment-info { border-top: 1px solid #fff; background: #f7f7f7; display: block; height: 39px; }
-.comment .avatar { float: left; }
-.comment .avatar img { padding: 3px; }
-.comment .name { float: left; padding: 8px 0px 8px 10px; font-weight: bold; color: #000; }
-.comment .date { float: left; padding: 8px; color: #666; }
-.comment .comment-body { clear: both; font-size: 13px; padding: 10px 0px 3px 0px; }
-.comment .comment-reply { padding: 10px 5px 10px 0px; }
-.comment .comment-reply a { font-size: 11px; text-transform: lowercase; color: #000; background: #f7f7f7; padding: 5px; text-decoration: none; }
-.comment .comment-reply a:hover { background: #464646; color: #fff; }
-
-.comment-form h3 { margin: 50px 0px 10px 0px; }
-.form .comment-form h3 { margin: 0px 0px 10px 0px; }
-.comment-form p { padding: 10px 0px 20px 0px; }
-.comment-form #recaptcha_widget_div { margin: 0px 0px 10px 0px; }
-
-.block { margin: 0px 0px 30px 0px; font-size: 13px; }
-.block h3 { margin: 0px 0px 10px 0px; font-size: 20px; }
-.block .block-body { line-height: 25px; }
-.block ul li { list-style-type: disc; margin: 0px 0px 0px 25px; }
-
-.block-search input[type=text] { width: 200px; float: left; margin: 2px; }
-
+ .message { border: 2px dashed #eee; padding: 10px; margin: 0px 0px 10px 0px; }
+
+ .nodes .node h2 { font-size: 26px; }
+
+ .node { margin: 0px 0px 50px 0px; }
+ .node h2 a { text-decoration: none; display: block; }
+ .node h3 { margin: 15px 0px 10px 0px; }
+ .node .node-info,
+ .node .node-more-info { font-size: 13px; color: #666; font-style: italic; display: block; }
+ .node .node-info a,
+ .node .node-more-info a { font-style: normal; }
+ .node .node-body { margin: 20px 0px 15px 0px; }
+ .node .node-body ul,
+ .node .node-body ol { margin: 10px; }
+ .node .node-body ul li { list-style-type: disc; margin: 0px 0px 0px 25px; }
+ .node .node-body ol li { list-style-type: decimal; margin: 0px 0px 0px 25px; }
+
+ .comments h3 { margin: 50px 0px 10px 0px; }
+ .comments .comment { border-top: 1px solid #f7f7f7; }
+ .comments .comment .comment { margin: 0px 0px 0px 40px; }
+ .comments .comment .comment-body { line-height: 20px; }
+
+ .comment .comment-info { border-top: 1px solid #fff; background: #f7f7f7; display: block; height: 39px; }
+ .comment .avatar { float: left; }
+ .comment .avatar img { padding: 3px; }
+ .comment .name { float: left; padding: 8px 0px 8px 10px; font-weight: bold; color: #000; }
+ .comment .date { float: left; padding: 8px; color: #666; }
+ .comment .comment-body { clear: both; font-size: 13px; padding: 10px 0px 3px 0px; }
+ .comment .comment-reply { padding: 10px 5px 10px 0px; }
+ .comment .comment-reply a { font-size: 11px; text-transform: lowercase; color: #000; background: #f7f7f7; padding: 5px; text-decoration: none; }
+ .comment .comment-reply a:hover { background: #464646; color: #fff; }
+
+ .comment-form h3 { margin: 50px 0px 10px 0px; }
+ .form .comment-form h3 { margin: 0px 0px 10px 0px; }
+ .comment-form p { padding: 10px 0px 20px 0px; }
+ .comment-form #recaptcha_widget_div { margin: 0px 0px 10px 0px; }
+
+ .block { margin: 0px 0px 30px 0px; font-size: 13px; }
+ .block h3 { margin: 0px 0px 10px 0px; font-size: 20px; }
+ .block .block-body { line-height: 25px; }
+ .block ul li { list-style-type: disc; margin: 0px 0px 0px 25px; }
+
+ .block-search input[type=text] { width: 200px; float: left; margin: 2px; }
+ */
/**
* Footer
*/
-#footer { border-top: 1px solid #ccc; margin-top: 50px; padding: 20px 0px 20px 0px; font-size: 11px; }
-#footer .right { text-align: right; }
-#debug-kit-toolbar ul li.panel-tab { display: none; }
-#debug-kit-toolbar ul li.icon { display: inline; }
+
+ #footer {}
+ footer { height: 300px; background-image: url("../img/footer.png");}
+
+
+ #debug-kit-toolbar ul li.panel-tab { display: none; }
+ #debug-kit-toolbar ul li.icon { display: inline; }
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -29,3 +29,17 @@
'plugin' => 'nodes', 'controller' => 'nodes', 'action' => 'view',
'type' => 'page'
));
+
+
+//my add on
+CroogoRouter::connect('/home', array(
+ 'plugin' => 'nodes', 'controller' => 'nodes', 'action' => 'home'
+));
+
+CroogoRouter::connect('/news', array(
+ 'plugin' => 'nodes', 'controller' => 'nodes', 'action' => 'news'
+));
+
+CroogoRouter::connect('/products', array(
+ 'plugin' => 'nodes', 'controller' => 'nodes', 'action' => 'products'
+));
@@ -424,6 +424,7 @@ public function index() {
* @access public
*/
public function term() {
+ $this->layout = 'foundation_news';
$term = $this->Node->Taxonomy->Term->find('first', array(
'conditions' => array(
'Term.slug' => $this->request->params['named']['slug'],
@@ -574,6 +575,7 @@ public function promoted() {
* @access public
*/
public function search($typeAlias = null) {
+ $this->layout = 'foundation_news';
if (!isset($this->request->params['named']['q'])) {
$this->redirect('/');
}
@@ -639,6 +641,7 @@ public function search($typeAlias = null) {
* @access public
*/
public function view($id = null) {
+ $this->layout = 'foundation_news';
if (isset($this->request->params['named']['slug']) && isset($this->params['named']['type'])) {
$this->Node->type = $this->request->params['named']['type'];
$type = $this->Node->Taxonomy->Vocabulary->Type->find('first', array(
@@ -811,4 +814,72 @@ protected function _setCommonVariables($type) {
$this->set(compact('typeAlias', 'type', 'nodes', 'roles', 'vocabularies', 'taxonomy', 'users'));
}
+
+ /**
+ * My work starts from here
+ * front end page Home, news and porducts
+ */
+
+ public function home(){
+ $this->layout = 'foundation';
+ }
+
+ public function news(){
+ $this->layout = 'foundation_news';
+
+ $this->set('title_for_layout', __d('croogo', 'Nodes'));
+
+ $this->paginate['Node']['type'] = 'promoted';
+ $this->paginate['Node']['conditions'] = array(
+ 'OR' => array(
+ 'Node.visibility_roles' => '',
+ 'Node.visibility_roles LIKE' => '%"' . $this->Croogo->roleId . '"%',
+ ),
+ );
+
+ if (isset($this->request->params['named']['type'])) {
+ $type = $this->Node->Taxonomy->Vocabulary->Type->findByAlias($this->request->params['named']['type']);
+ if (!isset($type['Type']['id'])) {
+ $this->Session->setFlash(__d('croogo', 'Invalid content type.'), 'default', array('class' => 'error'));
+ $this->redirect('/');
+ }
+ if (isset($type['Params']['nodes_per_page'])) {
+ $this->paginate['Node']['limit'] = $type['Params']['nodes_per_page'];
+ }
+ $this->paginate['Node']['conditions']['Node.type'] = $type['Type']['alias'];
+ $this->set('title_for_layout', $type['Type']['title']);
+ $this->set(compact('type'));
+ }
+
+ if ($this->usePaginationCache) {
+ $limit = !empty($this->paginate['Node']['limit']) ? $this->paginate['Node']['limit'] : Configure::read('Reading.nodes_per_page');
+ $cacheNamePrefix = 'nodes_promoted_' . $this->Croogo->roleId . '_' . Configure::read('Config.language');
+ if (isset($type)) {
+ $cacheNamePrefix .= '_' . $type['Type']['alias'];
+ }
+ $this->paginate['page'] = isset($this->request->params['named']['page']) ? $this->params['named']['page'] : 1;
+ $cacheName = $cacheNamePrefix . '_' . $this->paginate['page'] . '_' . $limit;
+ $cacheNamePaging = $cacheNamePrefix . '_' . $this->paginate['page'] . '_' . $limit . '_paging';
+ $cacheConfig = 'nodes_promoted';
+ $nodes = Cache::read($cacheName, $cacheConfig);
+ if (!$nodes) {
+ $nodes = $this->paginate('Node');
+ Cache::write($cacheName, $nodes, $cacheConfig);
+ Cache::write($cacheNamePaging, $this->request->params['paging'], $cacheConfig);
+ } else {
+ $paging = Cache::read($cacheNamePaging, $cacheConfig);
+ $this->request->params['paging'] = $paging;
+ }
+ } else {
+ $nodes = $this->paginate('Node');
+ }
+ $this->set(compact('nodes'));
+
+
+
+ }
+
+ public function products(){
+ $this->layout = 'foundation';
+ }
}

0 comments on commit c6858ec

Please sign in to comment.