diff --git a/recess/recess/apps/tools/views/apps/app.php b/recess/recess/apps/tools/views/apps/app.php index 947134a..9bfa73e 100644 --- a/recess/recess/apps/tools/views/apps/app.php +++ b/recess/recess/apps/tools/views/apps/app.php @@ -1,7 +1,6 @@ name; -$selectedNav = 'apps'; -include_once($viewsDir . 'common/header.php'); +Layout::extend('layouts/apps'); +Layout::blockAssign('title', $app->name); Library::import('recess.apps.tools.controllers.RecessToolsCodeController'); $codeController = new RecessToolsCodeController($response->request->meta->app); @@ -52,11 +51,9 @@ function printClassesInNamespace($namespace, $codeController) { addRoutesToRouter($routes); -include_once($viewsDir . 'common/printRoutes.php'); -printRoutes($routes, $codeController); +// include_once($viewsDir . 'common/printRoutes.php'); +Part::render('routes/table', $routes, $codeController, ''); ?>
-

Trying to uninstall name; ?>?

- - \ No newline at end of file +

Trying to uninstall name; ?>?

\ No newline at end of file diff --git a/recess/recess/apps/tools/views/apps/createModel.php b/recess/recess/apps/tools/views/apps/createModel.php index 8f09480..705f1cc 100644 --- a/recess/recess/apps/tools/views/apps/createModel.php +++ b/recess/recess/apps/tools/views/apps/createModel.php @@ -1,9 +1,12 @@ +

New Model Helper

The purpose of this helper is to help speed the process of creating Recess Models. Please note this form is not child proof!

@@ -192,7 +195,4 @@ -
- \ No newline at end of file + \ No newline at end of file diff --git a/recess/recess/apps/tools/views/apps/createModelComplete.php b/recess/recess/apps/tools/views/apps/createModelComplete.php index 22e42c1..3244e5e 100644 --- a/recess/recess/apps/tools/views/apps/createModelComplete.php +++ b/recess/recess/apps/tools/views/apps/createModelComplete.php @@ -1,7 +1,6 @@

Creating Model...

@@ -36,8 +35,4 @@

Next Steps

-

Generate Scaffolding | Back to Code

- - \ No newline at end of file +

Generate Scaffolding | Back to Code

\ No newline at end of file diff --git a/recess/recess/apps/tools/views/apps/genController.php b/recess/recess/apps/tools/views/apps/genController.php index 79efff4..b9e65d1 100644 --- a/recess/recess/apps/tools/views/apps/genController.php +++ b/recess/recess/apps/tools/views/apps/genController.php @@ -1,7 +1,6 @@

Select the Model to Generate Scaffolding for:

@@ -22,6 +21,4 @@ function printClassesInNamespace($namespace, $controller, $app) {
-

Back to Application

- - \ No newline at end of file +

Back to Application

\ No newline at end of file diff --git a/recess/recess/apps/tools/views/apps/generateScaffolding.php b/recess/recess/apps/tools/views/apps/generateScaffolding.php index 0e82987..c75210a 100644 --- a/recess/recess/apps/tools/views/apps/generateScaffolding.php +++ b/recess/recess/apps/tools/views/apps/generateScaffolding.php @@ -1,7 +1,6 @@

Generating Scaffolding for ...

@@ -14,6 +13,4 @@ ?> -

Back to Application

- - \ No newline at end of file +

Back to Application

\ No newline at end of file diff --git a/recess/recess/apps/tools/views/apps/home.php b/recess/recess/apps/tools/views/apps/home.php index 4bad434..2515dae 100644 --- a/recess/recess/apps/tools/views/apps/home.php +++ b/recess/recess/apps/tools/views/apps/home.php @@ -1,10 +1,9 @@ -

Applications

+

Applications

' . $flash . '

'; @@ -26,6 +25,4 @@ } ?>
-

Start a New Application

- - \ No newline at end of file +

Start a New Application

\ No newline at end of file diff --git a/recess/recess/apps/tools/views/apps/newAppInstructions.php b/recess/recess/apps/tools/views/apps/newAppInstructions.php index b7fbac1..26d929d 100644 --- a/recess/recess/apps/tools/views/apps/newAppInstructions.php +++ b/recess/recess/apps/tools/views/apps/newAppInstructions.php @@ -1,13 +1,8 @@

Your apps dir isn't writeable...

Please make: writeable and try again.

- - \ No newline at end of file diff --git a/recess/recess/apps/tools/views/apps/newAppWizard.php b/recess/recess/apps/tools/views/apps/newAppWizard.php index 56cd3ea..97f73c4 100644 --- a/recess/recess/apps/tools/views/apps/newAppWizard.php +++ b/recess/recess/apps/tools/views/apps/newAppWizard.php @@ -1,10 +1,9 @@ +

New Application Walkthrough

Ready to start a new application? Great! This walkthrough is designed to step you through the process.

@@ -21,8 +20,4 @@

-end(); ?> - - \ No newline at end of file +end(); ?> \ No newline at end of file diff --git a/recess/recess/apps/tools/views/apps/newAppWizardComplete.php b/recess/recess/apps/tools/views/apps/newAppWizardComplete.php index 72f65ad..c573b55 100644 --- a/recess/recess/apps/tools/views/apps/newAppWizardComplete.php +++ b/recess/recess/apps/tools/views/apps/newAppWizardComplete.php @@ -1,9 +1,8 @@ +

Creating New Application...

@@ -25,8 +24,4 @@
        );
 
-

Did you add that line? Great! Have fun building !

- - \ No newline at end of file +

Did you add that line? Great! Have fun building !

\ No newline at end of file diff --git a/recess/recess/apps/tools/views/apps/newAppWizardStep2.php b/recess/recess/apps/tools/views/apps/newAppWizardStep2.php index 29aca2d..bc01144 100644 --- a/recess/recess/apps/tools/views/apps/newAppWizardStep2.php +++ b/recess/recess/apps/tools/views/apps/newAppWizardStep2.php @@ -1,10 +1,9 @@ +

New Application Walkthrough - Step 2

begin(); ?> @@ -19,8 +18,4 @@

-end(); ?> - - \ No newline at end of file +end(); ?> \ No newline at end of file diff --git a/recess/recess/apps/tools/views/apps/newModelComplete.php b/recess/recess/apps/tools/views/apps/newModelComplete.php index 46849de..15cfd58 100644 --- a/recess/recess/apps/tools/views/apps/newModelComplete.php +++ b/recess/recess/apps/tools/views/apps/newModelComplete.php @@ -1,8 +1,8 @@ +

Creating Model...

Code Gen Done'; } else { echo 'Almost Done'; } ?>

@@ -29,9 +29,4 @@ } ?> - -

Next Steps

- - \ No newline at end of file +

Next Steps

\ No newline at end of file diff --git a/recess/recess/apps/tools/views/apps/newModelJQuery.php b/recess/recess/apps/tools/views/apps/newModelJQuery.php index 242e530..9345ae9 100644 --- a/recess/recess/apps/tools/views/apps/newModelJQuery.php +++ b/recess/recess/apps/tools/views/apps/newModelJQuery.php @@ -219,4 +219,4 @@ function(data) { } - \ No newline at end of file + \ No newline at end of file diff --git a/recess/recess/apps/tools/views/apps/uninstall.php b/recess/recess/apps/tools/views/apps/uninstall.php index 8cee22b..9a7f465 100644 --- a/recess/recess/apps/tools/views/apps/uninstall.php +++ b/recess/recess/apps/tools/views/apps/uninstall.php @@ -1,8 +1,8 @@ +

To Uninstall name; ?>...

  1. Open recess-conf.php
  2. @@ -13,5 +13,4 @@
  3. Remove the string ''
  4. [Optional] Delete the directory
-

Th-Th-Th-Th-That's all folks. Head back to apps.

- \ No newline at end of file +

That's all folks. Head back to apps.

\ No newline at end of file diff --git a/recess/recess/apps/tools/views/code/byClass.php b/recess/recess/apps/tools/views/code/byClass.php index 535afe9..ec8dd4b 100644 --- a/recess/recess/apps/tools/views/code/byClass.php +++ b/recess/recess/apps/tools/views/code/byClass.php @@ -1,8 +1,8 @@ +

Browse Code by Class

@@ -24,5 +24,4 @@ echo ''; } ?> -
- \ No newline at end of file + \ No newline at end of file diff --git a/recess/recess/apps/tools/views/code/byPackage.php b/recess/recess/apps/tools/views/code/byPackage.php index 1c29d21..0b4ffa7 100644 --- a/recess/recess/apps/tools/views/code/byPackage.php +++ b/recess/recess/apps/tools/views/code/byPackage.php @@ -1,7 +1,6 @@

Browse Code by Package

@@ -10,6 +9,4 @@
  • name; ?>
  • - - - \ No newline at end of file + \ No newline at end of file diff --git a/recess/recess/apps/tools/views/code/classInfo.php b/recess/recess/apps/tools/views/code/classInfo.php index 259107a..de16645 100644 --- a/recess/recess/apps/tools/views/code/classInfo.php +++ b/recess/recess/apps/tools/views/code/classInfo.php @@ -1,7 +1,6 @@ name; -$selectedNav = 'code'; -include_once($viewsDir . 'common/header.php'); +Layout::extend('layouts/code'); +Layout::blockAssign('title', 'Class ' . $reflection->name); ?> - -

    Code Browser

    @@ -35,5 +34,4 @@ function printTable($controller, $objects, $columns = 4) { } ?> -Re-index your Code - \ No newline at end of file +Re-index your Code \ No newline at end of file diff --git a/recess/recess/apps/tools/views/code/packageInfo.php b/recess/recess/apps/tools/views/code/packageInfo.php index 9628e97..7edd66c 100644 --- a/recess/recess/apps/tools/views/code/packageInfo.php +++ b/recess/recess/apps/tools/views/code/packageInfo.php @@ -1,7 +1,6 @@ name; -$selectedNav = 'code'; -include_once($viewsDir . 'common/header.php'); +Layout::extend('layouts/code'); +Layout::blockAssign('title', $package->name); ?> "Give us the tools, and we'll finish the job." ~Churchill

    - \ No newline at end of file + \ No newline at end of file diff --git a/recess/recess/apps/tools/views/database/dropTable.php b/recess/recess/apps/tools/views/database/dropTable.php index d00119a..a73761c 100644 --- a/recess/recess/apps/tools/views/database/dropTable.php +++ b/recess/recess/apps/tools/views/database/dropTable.php @@ -1,15 +1,11 @@ -

    Drop "" table?

    No, Just Kidding, Take Me Back

    This action cannot be undone.

    - - - \ No newline at end of file + \ No newline at end of file diff --git a/recess/recess/apps/tools/views/database/emptyTable.php b/recess/recess/apps/tools/views/database/emptyTable.php index cc83685..2d5a88f 100644 --- a/recess/recess/apps/tools/views/database/emptyTable.php +++ b/recess/recess/apps/tools/views/database/emptyTable.php @@ -1,7 +1,6 @@

    Empty "" table?

    @@ -10,6 +9,4 @@

    This action cannot be undone.

    -
    - - \ No newline at end of file + \ No newline at end of file diff --git a/recess/recess/apps/tools/views/database/home.php b/recess/recess/apps/tools/views/database/home.php index b55d526..395d83f 100644 --- a/recess/recess/apps/tools/views/database/home.php +++ b/recess/recess/apps/tools/views/database/home.php @@ -1,7 +1,6 @@

    Data Sources


    @@ -19,5 +18,4 @@

    -

    Add another Data Source

    - \ No newline at end of file +

    Add another Data Source

    \ No newline at end of file diff --git a/recess/recess/apps/tools/views/database/newSource.php b/recess/recess/apps/tools/views/database/newSource.php index 439e377..3e54c88 100644 --- a/recess/recess/apps/tools/views/database/newSource.php +++ b/recess/recess/apps/tools/views/database/newSource.php @@ -1,7 +1,6 @@

    Adding a New Named Data Source

    Recess allows for multiple named data sources. Currently only MySQL and Sqlite are supported.

    @@ -34,10 +33,5 @@
  • Save.
  • - - - -
    -

    Return to Data Sources

    - \ No newline at end of file +

    Return to Data Sources

    \ No newline at end of file diff --git a/recess/recess/apps/tools/views/database/showTable.php b/recess/recess/apps/tools/views/database/showTable.php index 58e2916..5460f66 100644 --- a/recess/recess/apps/tools/views/database/showTable.php +++ b/recess/recess/apps/tools/views/database/showTable.php @@ -1,9 +1,7 @@ -

    Table:

    Source:

    Columns:

    @@ -39,5 +37,4 @@
    -

    Empty Table - Drop Table

    - \ No newline at end of file +

    Empty Table - Drop Table

    \ No newline at end of file diff --git a/recess/recess/apps/tools/views/home/home.php b/recess/recess/apps/tools/views/home/home.php index 2422458..8c37c4e 100644 --- a/recess/recess/apps/tools/views/home/home.php +++ b/recess/recess/apps/tools/views/home/home.php @@ -1,8 +1,5 @@ - + +

    Welcome to Recess

    @@ -32,6 +29,4 @@ As Recess matures the tool set will need to grow too. Have ideas for other useful tools? Perhaps you've built additional useful tools? Get involved over at RecessFramework.org.

    -

    Enjoy!
    -Kris

    - - \ No newline at end of file +

    Enjoy!
    -Kris

    \ No newline at end of file diff --git a/recess/recess/apps/tools/views/layouts/apps.php b/recess/recess/apps/tools/views/layouts/apps.php new file mode 100644 index 0000000..961cd50 --- /dev/null +++ b/recess/recess/apps/tools/views/layouts/apps.php @@ -0,0 +1,9 @@ + Apps > '); + +Layout::block('navigation'); + Part::render('layouts/navigation', 'Apps'); +Layout::blockEnd() ; +?> \ No newline at end of file diff --git a/recess/recess/apps/tools/views/layouts/code.php b/recess/recess/apps/tools/views/layouts/code.php new file mode 100644 index 0000000..0a4924e --- /dev/null +++ b/recess/recess/apps/tools/views/layouts/code.php @@ -0,0 +1,9 @@ + Code > '); + +Layout::block('navigation'); + Part::render('layouts/navigation', 'Code'); +Layout::blockEnd() ; +?> \ No newline at end of file diff --git a/recess/recess/apps/tools/views/layouts/database.php b/recess/recess/apps/tools/views/layouts/database.php new file mode 100644 index 0000000..68c38c0 --- /dev/null +++ b/recess/recess/apps/tools/views/layouts/database.php @@ -0,0 +1,9 @@ + Database > '); + +Layout::block('navigation'); + Part::render('layouts/navigation', 'Database'); +Layout::blockEnd() ; +?> \ No newline at end of file diff --git a/recess/recess/apps/tools/views/layouts/home.php b/recess/recess/apps/tools/views/layouts/home.php new file mode 100644 index 0000000..3c01746 --- /dev/null +++ b/recess/recess/apps/tools/views/layouts/home.php @@ -0,0 +1,7 @@ + Home > '); +Layout::block('navigation'); + Part::render('layouts/navigation', ''); +Layout::blockEnd() ; +?> \ No newline at end of file diff --git a/recess/recess/apps/tools/views/layouts/master.php b/recess/recess/apps/tools/views/layouts/master.php new file mode 100644 index 0000000..8e9c697 --- /dev/null +++ b/recess/recess/apps/tools/views/layouts/master.php @@ -0,0 +1,56 @@ + + + + + + + + + + + + Recess Tools!<?php Layout::slot('title') ?><?php Layout::slotEnd() ?> + + +
    +
    +

    Recess Tools

    +
    +
    +

    "Give us the tools, and we'll finish the job." ~Churchill

    +
    +
    + + + + +
    +
    +

    Recess Resources

    + +
    + +
    + + \ No newline at end of file diff --git a/recess/recess/apps/tools/views/layouts/navigation.part.php b/recess/recess/apps/tools/views/layouts/navigation.part.php new file mode 100644 index 0000000..248a0a0 --- /dev/null +++ b/recess/recess/apps/tools/views/layouts/navigation.part.php @@ -0,0 +1,20 @@ +' . Html::anchor(Url::action($action),$display) . ''; +} +?> + \ No newline at end of file diff --git a/recess/recess/apps/tools/views/layouts/routes.php b/recess/recess/apps/tools/views/layouts/routes.php new file mode 100644 index 0000000..45b4849 --- /dev/null +++ b/recess/recess/apps/tools/views/layouts/routes.php @@ -0,0 +1,9 @@ + Routes > '); + +Layout::block('navigation'); + Part::render('layouts/navigation', 'Routes'); +Layout::blockEnd() ; +?> \ No newline at end of file diff --git a/recess/recess/apps/tools/views/routes/home.php b/recess/recess/apps/tools/views/routes/home.php index 741d0ed..406b325 100644 --- a/recess/recess/apps/tools/views/routes/home.php +++ b/recess/recess/apps/tools/views/routes/home.php @@ -1,16 +1,15 @@

    Routes

    request->meta->app); -printRoutes($routes, $codeController, '/recess'); -?> - \ No newline at end of file +// printRoutes($routes, $codeController, '/recess'); +Part::render('routes/table', $routes, $codeController, '/recess'); +?> \ No newline at end of file diff --git a/recess/recess/apps/tools/views/routes/rows.part.php b/recess/recess/apps/tools/views/routes/rows.part.php new file mode 100644 index 0000000..b877eb1 --- /dev/null +++ b/recess/recess/apps/tools/views/routes/rows.part.php @@ -0,0 +1,40 @@ +getStaticPaths(); +$parametricPaths = $routingNode->getParametricPaths(); +$methods = $routingNode->getMethods(); +if(!empty($methods)) { + foreach($methods as $method => $rt): + $route = $rt->toRoute(); + ?> + + + + class), Library::getClassName($route->class)); ?> + class) . '#method_' . $route->function, $route->function) ?> + + $node) { + Part::render('routes/rows', $node, $codeController, $fullPath . '/' . $path, $omit); + } + foreach($parametricPaths as $path => $node) { + Part::render('routes/rows', $node, $codeController, $fullPath . '/$' . $path, $omit); + } +} +?> + diff --git a/recess/recess/apps/tools/views/routes/table.part.php b/recess/recess/apps/tools/views/routes/table.part.php new file mode 100644 index 0000000..980d8a8 --- /dev/null +++ b/recess/recess/apps/tools/views/routes/table.part.php @@ -0,0 +1,15 @@ + + + + + + +
    HTTPRouteControllerMethod
    \ No newline at end of file diff --git a/recess/recess/framework/helpers/Layout.class.php b/recess/recess/framework/helpers/Layout.class.php index bfd114d..66f942c 100644 --- a/recess/recess/framework/helpers/Layout.class.php +++ b/recess/recess/framework/helpers/Layout.class.php @@ -54,6 +54,12 @@ public static function blockEnd() { } } + public static function blockAssign($title, $value) { + self::block($title); + echo $value; + self::blockEnd(); + } + public static function slot($title) { if(!empty(self::$slotStack)) { die('can\'t nest slots'); @@ -78,6 +84,14 @@ public static function slotEnd() { } } + public static function slotAppend($title, $value) { + self::block($title); + echo $value; + self::slot($title); + self::slotEnd(); + self::blockEnd(); + } + public static function extendEnd() { if(!empty(self::$extendStack)) { if(!isset(self::$blockMap[Layout::DEFAULT_BLOCK])) { diff --git a/recess/recess/framework/helpers/Part.class.php b/recess/recess/framework/helpers/Part.class.php new file mode 100644 index 0000000..ff98f4d --- /dev/null +++ b/recess/recess/framework/helpers/Part.class.php @@ -0,0 +1,50 @@ +getResponse(); + self::$app = $response->meta->app; + } + + public static function render() { + $args = func_get_args(); + $templateFile = self::$app->getViewsDir() . $args[0] . '.part.php'; + + if(!isset(self::$loaded[$templateFile])) { + $template = file_get_contents($templateFile); + + preg_match_all("/assert(?:\W*)\\((?:\W*)(?:is_(.*?)(?:\W*)\\((?:\W*)\\$(.*?)(?:\W*)\\)|\\$(\\w*?)(?:\W*)instanceof(?:\W*)(\\w*?))(?:\W*)\\)(?:\W*);/", + $template, + $matches); + + $parameters = array(); + foreach($matches[0] as $key => $value) { + if(isset($matches[1][$key]) && $matches[1][$key] != '') { + $parameters[$matches[2][$key]] = $matches[1][$key]; + } else if (isset($matches[3][$key])) { + $parameters[$matches[3][$key]] = $matches[4][$key]; + } + } + + self::$loaded[$templateFile] = $parameters; + } + + $parameters = self::$loaded[$templateFile]; + $keys = array_keys($parameters); + array_unshift($keys, ''); + $params = array_combine($keys, $args); + extract($params); + include($templateFile); + } + +} +?> \ No newline at end of file diff --git a/recess/recess/framework/views/RecessView.class.php b/recess/recess/framework/views/RecessView.class.php index e787770..e609eef 100644 --- a/recess/recess/framework/views/RecessView.class.php +++ b/recess/recess/framework/views/RecessView.class.php @@ -17,6 +17,7 @@ class RecessView extends NativeView { protected function render(Response $response) { $this->loadHelper( 'recess.framework.helpers.Layout', + 'recess.framework.helpers.Part', 'recess.framework.helpers.Url', 'recess.framework.helpers.Html'); parent::render($response);