Permalink
Browse files

First Commit

  • Loading branch information...
thoth committed Mar 8, 2012
0 parents commit 951998b1532dd771fe76508214e9c6c4e753900f
13 LICENSE
@@ -0,0 +1,13 @@
+Copyright 2012 Twitter, Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
0 README
No changes.
@@ -0,0 +1,12 @@
+ <footer>
+ <div class="row">
+ <div class="span3">
+ <p>&copy; <?php echo Configure::read('Site.title').' '.date('Y'); ?></p>
+ </div>
+ <div class="span9">
+ <?php
+ echo $layout->menu('footer', array( 'dropdownClass'=>'nav'));
+ ?>
+ </div>
+ </div>
+ </footer>
@@ -0,0 +1,36 @@
+ <div class="navbar navbar-fixed-top">
+ <div class="navbar-inner">
+ <div class="container">
+ <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
+ <span class="icon-bar"></span>
+ </a>
+ <a class="brand" href="/"><?php echo Configure::read('Site.title'); ?></a>
+ <div class="nav-collapse">
+ <?php
+ echo $layout->menu('main', array('dropdown'=>true, 'dropdownClass'=>'nav'));
+ ?>
+
+ <div class="navbar-text pull-right remove-lineheight">
+ <form id="searchform" method="post" class="form-search remove-margins search-box" action="javascript: document.location.href=''+Croogo.basePath+'search/q:'+encodeURI($('#searchform #q').val());">
+ <div class="control-group remove-margins">
+ <div class="controls">
+ <div class="input-append">
+ <input class="span2" name="q" id="iconInput" type="text" />
+ <span class="add-on" onclick="jQuery('#searchform').submit();"><i class="icon-search"></i></span>
+ </div>
+ </div>
+ </div>
+ </form>
+ </div>
+
+ <div class="social-like-links pull-right remove-lineheight">
+ <?php
+ //if you are using the way cool SEO plugin for Croogo, uncomment the following
+ //echo $this->element('google_plusone_tag', array('plugin'=>'seo'));
+ //echo $this->element('twitter_share_button', array('plugin'=>'seo'));
+ ?>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
@@ -0,0 +1,5 @@
+<div id="menu-<?php echo $menu['Menu']['id']; ?>" class="menu">
+<?php
+ echo $custom->nestedLinks($menu['threaded'], $options, 1, $this->Layout, $this->Html);
+?>
+</div>
@@ -0,0 +1,75 @@
+<?php
+class CustomHelper extends Helper {
+
+ //Have to subvert the default Croogo menuing to work with bootstrap
+ public function nestedLinks($links, $options = array(), $depth = 1, $layout, $html) {
+
+ $_options = array();
+ $options = array_merge($_options, $options);
+
+ $output = '';
+ foreach ($links AS $link) {
+ $linkAttr = array(
+ 'id' => 'link-' . $link['Link']['id'],
+ 'rel' => $link['Link']['rel'],
+ 'target' => $link['Link']['target'],
+ 'title' => $link['Link']['description'],
+ 'class' => $link['Link']['class'],
+ 'escape'=> false
+ );
+
+ foreach ($linkAttr AS $attrKey => $attrValue) {
+ if ($attrValue == null) {
+ unset($linkAttr[$attrKey]);
+ }
+ }
+
+ // if link is in the format: controller:contacts/action:view
+ if (strstr($link['Link']['link'], 'controller:')) {
+ $link['Link']['link'] = $layout->linkStringToArray($link['Link']['link']);
+ }
+
+ // Remove locale part before comparing links
+ if (!empty($layout->params['locale'])) {
+ $currentUrl = substr($layout->params['url']['url'], strlen($layout->params['locale']));
+ } else {
+ $currentUrl = $layout->params['url']['url'];
+ }
+
+ if (Router::url($link['Link']['link']) == Router::url('/' . $currentUrl)) {
+ if (!isset($linkAttr['class'])) {
+ $linkAttr['class'] = '';
+ }
+ $linkAttr['class'] .= ' ' . $options['selected'];
+ }
+ $linkAttr['escape'] = false;
+
+ $parentTag = '';
+ if (isset($link['children']) && count($link['children']) > 0) {
+ $linkAttr['class'] .= ' dropdown-toggle';
+ $linkAttr['data-toggle'] = 'dropdown';
+ $linkOutput = $html->link($link['Link']['title'].' <b class="caret"></b>', $link['Link']['link'], $linkAttr);
+ $linkOutput .= $this->nestedLinks($link['children'], $options, $depth + 1, $layout, $html);
+ $parentTag = 'dropdown';
+ } else {
+ $linkOutput = $html->link($link['Link']['title'], $link['Link']['link'], $linkAttr);
+
+ }
+ $linkOutput = $html->tag('li', $linkOutput, array('class'=>$parentTag));
+ $output .= $linkOutput;
+ }
+ if ($output != null) {
+ $tagAttr = $options['tagAttributes'];
+ if ($options['dropdown'] && $depth == 1) {
+ $tagAttr['class'] = $options['dropdownClass'];
+ }
+ if($options['dropdown'] && $depth > 1){
+ $tagAttr['class'] = " dropdown-menu";
+ }
+ $output = $html->tag($options['tag'], $output, $tagAttr);
+ }
+
+ return $output;
+ }
+}
+?>
@@ -0,0 +1,88 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title><?php echo $title_for_layout; ?> &raquo; <?php echo Configure::read('Site.title'); ?></title>
+ <?php
+ echo $this->Layout->meta();
+ echo $this->Html->css(array(
+ 'bootstrap',
+ 'theme',
+ 'bootstrap-responsive'
+ ));
+
+ echo $this->Layout->js();
+ echo $this->Html->script(array(
+ 'jquery.min',
+ 'bootstrap'
+ ));
+ echo $scripts_for_layout;
+ ?>
+
+ <!-- Should replace the following with your icons -->
+ <link rel="shortcut icon" href="/img/favicon.ico">
+ <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
+ <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
+ <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
+ </head>
+
+ <body>
+
+ <?php echo $this->element('header'); ?>
+
+ <div class="container">
+
+ <?php
+ if($this->here == '/'){
+ //Home page layout
+ ?>
+ <!-- Main hero unit for a primary marketing message or call to action -->
+ <div class="hero-unit">
+ <h1><?php echo Configure::read('Site.tagline'); ?></h1>
+ <p>&nbsp;</p>
+ <p><a class="btn btn-large"><b>Call Us To Get Started &raquo;</b></a></p>
+ </div>
+
+ <div class="row">
+ <div class="span12">
+ <?php
+ echo $this->Layout->sessionFlash();
+ ?>
+ </div>
+ </div>
+
+ <?php
+ echo $content_for_layout;
+ ?>
+ <?php
+ } else {
+ //Layout for all other pages
+ ?>
+ <div class="hero-unit subpage">
+ <h1><?php echo $title_for_layout; ?></h1>
+ </div>
+
+ <div class="row">
+ <div class="span8">
+ <?php
+ echo $this->Layout->sessionFlash();
+ echo $content_for_layout;
+ ?>
+ </div>
+ <div class="span4">
+ <div class="well sidebar-nav">
+ <?php echo $layout->blocks('right'); ?>
+ </div>
+ </div>
+ </div>
+ <?php
+ }
+ ?>
+ <hr />
+
+ <?php echo $this->element('footer'); ?>
+
+ </div>
+
+ </body>
+</html>
@@ -0,0 +1,23 @@
+<?php
+ header('Content-type: application/rss+xml');
+ echo $rss->header();
+ if (!isset($channel)) {
+ $channel = array();
+ }
+ if (!isset($channel['title'])) {
+ $channel['title'] = $title_for_layout . ' - ' . Configure::read('Site.title');
+ }
+
+ $channel['atom:link'] = array(
+ 'attrib'=>array(
+ 'href'=>'http://'.$_SERVER['SERVER_NAME'].$this->here,
+ 'rel'=>'self',
+ 'type'=>'application/rss+xml'
+ )
+ );
+?>
+<?php echo '<?'; ?>xml-stylesheet type="text/xsl" href="<?php echo $rss->webroot('css/feed.xsl') ?>" ?>
+<?php
+ $channelEl = $rss->channel(array(), $channel, $items);
+ echo $rss->document(array('xmlns:atom'=>'http://www.w3.org/2005/Atom'), $channelEl);
+?>
@@ -0,0 +1,23 @@
+<?php
+ header('Content-type: application/rss+xml');
+ echo $rss->header();
+ if (!isset($channel)) {
+ $channel = array();
+ }
+ if (!isset($channel['title'])) {
+ $channel['title'] = $title_for_layout . ' - ' . Configure::read('Site.title');
+ }
+
+ $channel['atom:link'] = array(
+ 'attrib'=>array(
+ 'href'=>'http://'.$_SERVER['SERVER_NAME'].$this->here,
+ 'rel'=>'self',
+ 'type'=>'application/rss+xml'
+ )
+ );
+?>
+<?php echo '<?'; ?>xml-stylesheet type="text/xsl" href="<?php echo $rss->webroot('css/feed.xsl') ?>" ?>
+<?php
+ $channelEl = $rss->channel(array(), $channel, $items);
+ echo $rss->document(array('xmlns:atom'=>'http://www.w3.org/2005/Atom'), $channelEl);
+?>
@@ -0,0 +1,43 @@
+<div class="nodes promoted">
+ <?php
+ if (count($nodes) == 0) {
+ __('No items found.');
+ } else {
+ foreach ($this->params['named'] AS $nn => $nv) {
+ $paginator->options['url'][$nn] = $nv;
+ }
+ }
+ ?>
+ <div class="row-fluid">
+
+ <?php
+ //keep counter and wrap after every 3
+ $block_num = 0;
+ foreach ($nodes AS $node) {
+ if($block_num % 3 == 0){
+ echo '</div><div class="row-fluid">';
+ }
+ $this->Layout->setNode($node);
+ ?>
+ <div id="node-<?php echo $this->Layout->node('id'); ?>" class="span4 node node-type-<?php echo $this->Layout->node('type'); ?>">
+ <h2><?php echo $this->Html->link($this->Layout->node('title'), $this->Layout->node('url')); ?></h2>
+ <?php
+ echo $this->Layout->nodeInfo();
+ echo $this->Layout->nodeBody();
+ echo $this->Layout->nodeMoreInfo();
+ ?>
+ </div>
+
+ <?php
+ $block_num++;
+ }
+ if($block_num % 3 == 0){
+ echo '</div><div class="row-fluid">';
+ }
+
+
+ ?>
+ <div class="span4 paging"><?php echo $paginator->numbers(); ?></div>
+ </div>
+
+ </div>
Oops, something went wrong.

0 comments on commit 951998b

Please sign in to comment.