Skip to content

Commit

Permalink
Recess Tools - Application Generation
Browse files Browse the repository at this point in the history
  • Loading branch information
KrisJordan committed Dec 1, 2008
1 parent 7b322ee commit 67f4302
Show file tree
Hide file tree
Showing 39 changed files with 860 additions and 53 deletions.
21 changes: 21 additions & 0 deletions apps/backend/BackendApplication.class.php
@@ -0,0 +1,21 @@
<?php
Library::import('recess.framework.Application');

class BackendApplication extends Application {
public function __construct() {

$this->name = 'New Media Engine';

$this->viewsDir = $_ENV['dir.apps'] . 'backend/views/';

$this->modelsPrefix = 'backend.models.';

$this->controllersPrefix = 'backend.controllers.';

$this->modelsPrefix = 'backend.models.';

$this->routingPrefix = 'control/';

}
}
?>
17 changes: 17 additions & 0 deletions apps/backend/controllers/BackendHomeController.class.php
@@ -0,0 +1,17 @@
<?php
Library::import('recess.framework.controllers.Controller');

/**
* !View Native, Prefix: home/
*/
class BackendHomeController extends Controller {

/** !Route GET */
function home() {

$this->flash = 'Welcome to your application!';

}

}
?>
21 changes: 21 additions & 0 deletions apps/backend/views/common/footer.php
@@ -0,0 +1,21 @@
</div>
<div class="span-5 last infobar">
<h3><span>Resources</span></h3>
<ul>
<li><a href="http://www.recessframework.com/">RecessFramework.com</a></li>
<li><a href="http://www.recessframework.com/docs/">Documentation</a></li>
<li><a href="http://www.recessframework.com/blog/">Recess! Blog</a></li>
<li><a href="http://www.krisjordan.com/">Kris' Blog</a></li>
<li><a href="http://groups.google.com/group/recess-framework">Mailing Group</a></li>
<li><a href="http://recess.lighthouseapp.com/">Report Bugs</a></li>
<li><a href="https://github.com/KrisJordan/recess/tree/master">Recess! Source</a></li>
</ul>
</div>
<div class="span-24 footer">
<p class="quiet bottom"><a href="http://<?php echo $_SERVER['SERVER_NAME'] . $_ENV['url.base'] . 'control/'; ?>">New Media Engine</a> is &copy; <?php echo date('Y'); ?>
{Insert Kick-ass App Developer Here}. All rights reserved.
</p>
</div>
</div>
</body>
</html>
20 changes: 20 additions & 0 deletions apps/backend/views/common/header.php
@@ -0,0 +1,20 @@
<html>
<head>
<!-- Blue Print -->
<link rel="stylesheet" href="<?php echo $_ENV['url.content']; ?>css/blueprint/screen.css" type="text/css" media="screen, projection" />
<link rel="stylesheet" href="<?php echo $_ENV['url.content']; ?>css/blueprint/print.css" type="text/css" media="print" />
<!--[if IE]>
<link rel="stylesheet" href="/css/blueprint/ie.css" type="text/css" media="screen, projection" />
<![endif]-->
<link rel="stylesheet" href="<?php echo $_ENV['url.content']; ?>css/recess.css" />
<!-- Syntax Highlighter -->
<link type="text/css" rel="stylesheet" href="<?php echo $_ENV['url.content']; ?>css/SyntaxHighlighter.css"></link>
<title><?php if(isset($title)) echo $title; else echo 'Recess!'; ?></title>
</head>
<body>
<div class="container">
<div class="span-24">
<h1>New Media Engine</h1>
</div>
<div class="span-19">
<?php include_once($viewsDir . 'common/navigation.php'); ?>
8 changes: 8 additions & 0 deletions apps/backend/views/common/navigation.php
@@ -0,0 +1,8 @@
<div class="span-19 navigation last">
<ul>
<a href="">Navigation</a>
<a href="">Could</a>
<a href="">Go</a>
<a href="">Here</a>
</ul>
</div>
11 changes: 11 additions & 0 deletions apps/backend/views/home/home.php
@@ -0,0 +1,11 @@
<?php
$title = 'New Media Engine';
include_once($viewsDir . 'common/header.php');
?>
<h2>Welcome!</h2>

<h2>Next Steps</h2>

<h2>Need Help?</h2>

<?php include_once($viewsDir . 'common/footer.php'); ?>
4 changes: 4 additions & 0 deletions apps/blog/BlogApplication.class.php
Expand Up @@ -4,6 +4,10 @@

class BlogApplication extends Application {

public $name = 'Blog';

public $modelsPrefix = 'blog.models.';

public $controllersPrefix = 'blog.controllers.';

public $viewsDir = 'blog/views/';
Expand Down
5 changes: 4 additions & 1 deletion content/css/recess.css
@@ -1,6 +1,9 @@
body { margin: 1em 0 0 0; }

h3 { }
thead { background-color: #eef; font-size: 1.2em; }

.input-flash { background: yellow; padding: 0 0 0 1em; }

.header { background-image: url('/content/images/recess/logo.gif'); background-repeat: no-repeat; background-position: -5px -5px;}
.header h1 { visibility: hidden; }
Expand All @@ -26,6 +29,6 @@ h3 { }

.footer { background: #eef; margin: 10em 0; text-align: center;}

.highlight { background: #0b2c9e; color: white; }
.navigation .highlight { background: #0b2c9e; color: white; }
.highlight li { }
.highlight a { color: white; margin: 1em; text-decoration: none;}
21 changes: 14 additions & 7 deletions recess-config.php
Expand Up @@ -17,15 +17,16 @@

Config::$cacheProviders
= array( // 'Apc',
// 'Memcache',
// 'Memcache'
// 'Disk'
);

Config::$useTurboSpeed = false; // I wanna go FAST!
Config::$useTurboSpeed = false; // I wanna go FAST! (Note: Experimental feature.)

Config::$applications
= array( 'recess.apps.tools.RecessToolsApplication',
'blog.BlogApplication'
'blog.BlogApplication',
'backend.BackendApplication'
);

//Config::$plugins
Expand Down Expand Up @@ -79,6 +80,8 @@ static function init() {

date_default_timezone_set(self::$defaultTimeZone);

require_once(self::$recessDir . 'lib/recess/Recess.php');

if(self::$useTurboSpeed) {
Library::$useNamedRuns = true;
$cacheProvidersReversed = array_reverse(self::$cacheProviders);
Expand All @@ -88,16 +91,20 @@ static function init() {
}
}

require_once(self::$recessDir . 'lib/recess/Recess.php');

Library::init();
Library::beginNamedRun('recess');

Library::addClassPath(self::$appsDir);

// TODO: GET RID OF THIS
Library::import('recess.framework.Application');
self::$applications = array_map(create_function('$class','return Library::importAndInstantiate($class);'),Config::$applications);
foreach(self::$applications as $key => $app) {
if(!Library::classExists($app)) {
die('Application "' . $app . '" does not exist. Remove it from recess-config.php, Config::$applications array.');
} else {
$app = Library::getClassName($app);
self::$applications[$key] = new $app;
}
}

Library::import('recess.sources.db.DbSources');
Library::import('recess.sources.db.orm.ModelDataSource');
Expand Down
24 changes: 17 additions & 7 deletions recess/lib/recess/apps/tools/RecessToolsApplication.class.php
Expand Up @@ -2,16 +2,26 @@
Library::import('recess.framework.Application');

class RecessToolsApplication extends Application {

public $controllersPrefix = 'recess.apps.tools.controllers.';

public $viewsDir = '';

public $routingPrefix = 'recess/';
public $codeTemplatesDir;

public function __construct() {
$this->viewsDir = $_ENV['dir.recess'] . '/apps/tools/views/';
}

$this->name = 'Recess Tools';

$this->viewsDir = $_ENV['dir.recess'] . 'apps/tools/views/';

$this->codeTemplatesDir = $_ENV['dir.recess'] . 'apps/tools/templates/';

$this->modelsPrefix = 'recess.apps.tools.models.';

$this->controllersPrefix = 'recess.apps.tools.controllers.';

$this->modelsPrefix = 'recess.apps.tools.models.';

$this->routingPrefix = 'recess/';

}
}

?>

0 comments on commit 67f4302

Please sign in to comment.