<?php Part::input($control, 'Control'); Part::input($name, 'string'); Part::input($value, 'string', ''); Part::input($label, 'string', ''); Part::input($attrs, 'HtmlAttributes', new HtmlAttributes()); Part::input($classes, 'HtmlClasses', new HtmlClasses('control-submit')); $controlBlock = Part::block('html/input', 'submit', $control->getId(), $control->getFormName(), $value, $attrs, $classes); Part::draw($control->getSkin(), $controlBlock, $label);
<?php Layout::extend('layouts/code'); $title = 'Code Browser'; ?> <h1>Code Browser</h1> <?php if (count($packages) == 0) { ?> <h3><a href="<?php echo $controller->urlTo('index'); ?> ">First time here? Index your code. (Note: this can take a few, please be patient!)</a></h3> <?php } ?> <h2>By Package</h2> <?php Part::draw('code/table', $controller, $packages); ?> <h2>By Class</h2> <?php Part::draw('code/table', $controller, $classes); ?> <a href="<?php echo $controller->urlTo('index'); ?> ">Re-index your Code</a>
<?php Layout::input($title, 'string'); Layout::input($body, 'Block'); Layout::input($navigation, 'Block', new HtmlBlock()); Layout::input($style, 'Block', new HtmlBlock()); ?> <html> <head> <?php if (!$style->draw()) { Part::draw('parts/style'); } ?> <title>{{appName}} - <?php echo $title; ?> </title> </head> <body> <div class="container"> <div class="span-24"> <h1>{{appName}}</h1> </div> <div class="span-24 last"> <div class="navigation"> <?php echo $navigation; ?> </div> <?php
<?php Part::input($routes, 'RtNode'); Part::input($omit, 'string'); $fullPath = $_ENV['url.base']; if (strrpos($fullPath, '/') == strlen($fullPath) - 1) { $fullPath = substr($fullPath, 0, -1); } if (!isset($omit)) { $omit = ''; } ?> <table> <thead><td>HTTP</td><td>Route</td><td>Controller</td><td>Method</td></thead> <tbody> <?php Part::draw('routes/rows', $routes, $fullPath, $omit); ?> </tbody> </table>
<?php Layout::extend('layouts/routes'); $title = 'Home'; ?> <h2 class="bottom">Routes</h2> <?php $routes = RecessConf::getRoutes(); Part::draw('routes/table', $routes, '/recess');
<?php /*== Part Inputs ==*/ // selected: The name of the selected navigation item Part::input($selected, 'string'); /*=================*/ ?> <div class="span-19 navigation last"> <ul> <?php Part::draw('layouts/navigation-item', 'RecessToolsAppsController::home', 'Apps', $selected); ?> <?php Part::draw('layouts/navigation-item', 'RecessToolsDatabaseController::home', 'Database', $selected); ?> <?php Part::draw('layouts/navigation-item', 'RecessToolsCodeController::home', 'Code', $selected); ?> <?php Part::draw('layouts/navigation-item', 'RecessToolsRoutesController::home', 'Routes', $selected); ?> </ul> </div>
<?php Layout::extend('layouts/theme'); if (isset($theme->id)) { $title = 'Edit Theme #' . $theme->id; } else { $title = 'Create New Theme'; } $title = $title; ?> <?php Part::draw('theme/form', $_form, $title); ?> <?php echo Html::anchor(Url::action('ThemeController::index'), 'Theme List');
</div> <div class="span-5 last"> <h2 class="bottom">Views</h2> <p>Location: <?php echo $app->viewsDir; ?> </p> </div> <hr /> <h2 class="bottom">Routes</h2> <p class="bottom">Route Prefix: <?php echo $app->routingPrefix; ?> </p> <?php $routes = new RtNode(); $app->addRoutesToRouter($routes); // include_once($viewsDir . 'common/printRoutes.php'); Part::draw('routes/table', $routes, ''); ?> <hr /> <p>Trying to <a href="<?php echo $controller->urlTo('uninstall', get_class($app)); ?> ">uninstall <?php echo $app->name; ?> </a>?</p>
?> </td> <td><?php echo $fullPath; ?> </td> <td><?php echo Html::anchor(Url::action('RecessToolsCodeController::classInfo', $route->class), Library::getClassName($route->class)); ?> </td> <td><?php echo Html::anchor(Url::action('RecessToolsCodeController::classInfo', $route->class) . '#method_' . $route->function, $route->function); ?> </td> </tr> <?php } } if (!empty($staticPaths) || !empty($parametricPaths)) { ksort($staticPaths); ksort($parametricPaths); foreach ($staticPaths as $path => $node) { Part::draw('routes/rows', $node, $fullPath . '/' . $path, $omit); } foreach ($parametricPaths as $path => $node) { Part::draw('routes/rows', $node, $fullPath . '/$' . $path, $omit); } } ?>
?> </strong></h1> <h2>Source: <?php echo $sourceName; ?> </h2> <h2>Columns:</h2> <table> <thead> <tr> <td>Primary</td> <td>Column Name</td> <td>Type</td> <td>Nullable</td> <td>Default Value</td> </tr> </thead> <tbody> <?php Part::draw('each-toggle', $columns, Part::block('database/row', ''), Part::block('database/row', 'light')); ?> </tbody> </table> <hr /> <h3><a href="<?php echo $controller->urlTo('emptyTable', $sourceName, $table); ?> ">Empty Table</a> - <a href="<?php echo $controller->urlTo('dropTable', $sourceName, $table); ?> ">Drop Table</a></h3>
function testInputTypeFail() { try { Part::draw($this->optional, 1); $this->fail('Should throw InputTypeCheckException'); } catch (InputTypeCheckException $e) { $this->assertTrue(true); } catch (Exception $e) { print $e->getMessage(); $this->fail('Should throw InputTypeCheckException, Got: ' . get_class($e)); } }
<?php Part::input($id, 'string'); Part::input($name, 'string'); Part::input($value, 'array', array()); Part::input($attrs, 'HtmlAttributes', new HtmlAttributes()); Part::input($classes, 'HtmlClasses', new HtmlClasses('nmc-controls-checkbox-array')); Part::input($choices, 'array'); $i = 0; $name = $name . '[]'; foreach ($choices as $key => $choiceValue) { $i++; $boxId = $id . '_' . $choiceValue; $attrs = new HtmlAttributes(); if (in_array($choiceValue, $value)) { $attrs->set('checked', 'checked'); } Part::draw('html/input', 'checkbox', $boxId, $name, (string) $choiceValue, $attrs, $classes); echo '<label for="' . $boxId . '">' . $key . '</label><br />'; }