Changeset 39 in ExiteCMS8
- Timestamp:
- 04/03/11 14:37:36 (14 months ago)
- Location:
- trunk/fuel/packages
- Files:
-
- 17 added
- 6 deleted
- 27 edited
-
activerecord (deleted)
-
auth/bootstrap.php (modified) (1 diff)
-
auth/classes/auth.php (modified) (1 diff)
-
auth/classes/auth/acl/driver.php (modified) (2 diffs)
-
auth/classes/auth/acl/simpleacl.php (modified) (4 diffs)
-
auth/classes/auth/driver.php (modified) (1 diff)
-
auth/classes/auth/exception.php (modified) (1 diff)
-
auth/classes/auth/group/driver.php (modified) (2 diffs)
-
auth/classes/auth/group/simplegroup.php (modified) (1 diff)
-
auth/classes/auth/login/driver.php (modified) (2 diffs)
-
auth/classes/auth/login/simpleauth.php (modified) (1 diff)
-
auth/config/simpleauth.php (modified) (1 diff)
-
octane (deleted)
-
oil/bootstrap.php (modified) (1 diff)
-
oil/classes/cli.php (deleted)
-
oil/classes/command.php (added)
-
oil/classes/console.php (modified) (11 diffs)
-
oil/classes/exception.php (modified) (1 diff)
-
oil/classes/generate.php (modified) (13 diffs)
-
oil/classes/generate/migration/actions.php (modified) (1 diff)
-
oil/classes/package.php (modified) (4 diffs)
-
oil/classes/refine.php (modified) (2 diffs)
-
oil/classes/scaffold.php (modified) (6 diffs)
-
oil/views/default/scaffold/actions/create.php (modified) (1 diff)
-
oil/views/default/scaffold/actions/delete.php (modified) (1 diff)
-
oil/views/default/scaffold/actions/edit.php (modified) (1 diff)
-
oil/views/default/scaffold/views/create.php (modified) (1 diff)
-
oil/views/default/scaffold/views/edit.php (modified) (1 diff)
-
oil/views/default/scaffold/views/index.php (modified) (2 diffs)
-
oil/views/default/scaffold/views/view.php (modified) (1 diff)
-
oil/views/default/template.php (modified) (1 diff)
-
oil/views/scaffold (deleted)
-
oil/views/template.php (deleted)
-
orm/bootstrap.php (added)
-
orm/classes/belongsto.php (added)
-
orm/classes/exception.php (deleted)
-
orm/classes/exceptions.php (added)
-
orm/classes/hasmany.php (added)
-
orm/classes/hasone.php (added)
-
orm/classes/manymany.php (added)
-
orm/classes/manythrough.php (added)
-
orm/classes/model.php (added)
-
orm/classes/observer (added)
-
orm/classes/observer.php (added)
-
orm/classes/observer/createdat.php (added)
-
orm/classes/observer/typing.php (added)
-
orm/classes/observer/updatedat.php (added)
-
orm/classes/observer/validation.php (added)
-
orm/classes/query.php (added)
-
orm/classes/relation.php (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/fuel/packages/auth/bootstrap.php
r36 r39 5 5 * Fuel is a fast, lightweight, community driven PHP5 framework. 6 6 * 7 * @package Fuel8 * @version 1.09 * @author Fuel Development Team10 * @license MIT License11 * @copyright 2010 - 2011 Fuel Development Team12 * @link http://fuelphp.com7 * @package Fuel 8 * @version 1.0 9 * @author Fuel Development Team 10 * @license MIT License 11 * @copyright 2010 - 2011 Fuel Development Team 12 * @link http://fuelphp.com 13 13 */ 14 14 -
trunk/fuel/packages/auth/classes/auth.php
r2 r39 5 5 * Fuel is a fast, lightweight, community driven PHP5 framework. 6 6 * 7 * @package Fuel8 * @version 1.09 * @author Fuel Development Team10 * @license MIT License11 * @copyright 2010 - 2011 Fuel Development Team12 * @link http://fuelphp.com7 * @package Fuel 8 * @version 1.0 9 * @author Fuel Development Team 10 * @license MIT License 11 * @copyright 2010 - 2011 Fuel Development Team 12 * @link http://fuelphp.com 13 13 */ 14 14 -
trunk/fuel/packages/auth/classes/auth/acl/driver.php
r2 r39 5 5 * Fuel is a fast, lightweight, community driven PHP5 framework. 6 6 * 7 * @package Fuel8 * @version 1.09 * @author Fuel Development Team10 * @license MIT License11 * @copyright 2010 - 2011 Fuel Development Team12 * @link http://fuelphp.com7 * @package Fuel 8 * @version 1.0 9 * @author Fuel Development Team 10 * @license MIT License 11 * @copyright 2010 - 2011 Fuel Development Team 12 * @link http://fuelphp.com 13 13 */ 14 14 … … 33 33 ! array_key_exists('id', $config) && $config['id'] = $config['driver']; 34 34 35 $class = 'Auth_Acl_'.ucfirst($config['driver']);35 $class = \Inflector::get_namespace($config['driver']).'Auth_Acl_'.ucfirst(\Inflector::denamespace($config['driver'])); 36 36 $driver = new $class($config); 37 37 static::$_instances[$driver->get_id()] = $driver; -
trunk/fuel/packages/auth/classes/auth/acl/simpleacl.php
r2 r39 5 5 * Fuel is a fast, lightweight, community driven PHP5 framework. 6 6 * 7 * @package Fuel8 * @version 1.09 * @author Fuel Development Team10 * @license MIT License11 * @copyright 2010 - 2011 Fuel Development Team12 * @link http://fuelphp.com7 * @package Fuel 8 * @version 1.0 9 * @author Fuel Development Team 10 * @license MIT License 11 * @copyright 2010 - 2011 Fuel Development Team 12 * @link http://fuelphp.com 13 13 */ 14 14 … … 33 33 } 34 34 35 $area = $condition[0];36 $rights = $condition[1];37 $current_roles = $group->get_roles($entity[1]);35 $area = $condition[0]; 36 $rights = $condition[1]; 37 $current_roles = $group->get_roles($entity[1]); 38 38 $current_rights = ''; 39 39 if (is_array($current_roles)) … … 43 43 foreach ($current_roles as $r_role) 44 44 { 45 if ( ! array_key_exists($r_role, $roles) || ($r_rights = $roles[$r_role]) === false) 45 // continue if the role wasn't found 46 if ( ! array_key_exists($r_role, $roles)) 47 { 48 continue; 49 } 50 $r_rights = $roles[$r_role]; 51 52 // if one of the roles has a negative wildcard (false) return it 53 if ($r_rights === false) 46 54 { 47 55 return false; 48 56 } 49 50 if (array_key_exists($area, $r_rights))57 // if one of the roles has a positive wildecard (true) return it 58 elseif ($r_rights === true) 51 59 { 52 $current_rights = ($r_rights === true || $current_rights === true) 53 ? true 54 : $current_rights . $r_rights[$area]; 60 return true; 61 } 62 // if there are roles for the current area, merge them with earlier fetched roles 63 elseif (array_key_exists($area, $r_rights)) 64 { 65 $current_rights = array_unique(array_merge($current_rights, $r_rights[$area])); 55 66 } 56 67 } 57 68 } 58 69 59 // start checking rights, terminate false when character not found 60 $rights = array_unique(preg_split('//', $rights, -1, PREG_SPLIT_NO_EMPTY)); 70 // start checking rights, terminate false when right not found 61 71 foreach ($rights as $right) 62 72 { 63 if ( strpos($current_rights, $right) === false)73 if ( ! in_array($right, $current_rights)) 64 74 { 65 75 return false; … … 67 77 } 68 78 79 // all necessary rights were found, return true 69 80 return true; 70 81 } -
trunk/fuel/packages/auth/classes/auth/driver.php
r2 r39 5 5 * Fuel is a fast, lightweight, community driven PHP5 framework. 6 6 * 7 * @package Fuel8 * @version 1.09 * @author Fuel Development Team10 * @license MIT License11 * @copyright 2010 - 2011 Fuel Development Team12 * @link http://fuelphp.com7 * @package Fuel 8 * @version 1.0 9 * @author Fuel Development Team 10 * @license MIT License 11 * @copyright 2010 - 2011 Fuel Development Team 12 * @link http://fuelphp.com 13 13 */ 14 14 -
trunk/fuel/packages/auth/classes/auth/exception.php
r2 r39 5 5 * Fuel is a fast, lightweight, community driven PHP5 framework. 6 6 * 7 * @package Fuel8 * @version 1.09 * @author Fuel Development Team10 * @license MIT License11 * @copyright 2010 - 2011 Fuel Development Team12 * @link http://fuelphp.com7 * @package Fuel 8 * @version 1.0 9 * @author Fuel Development Team 10 * @license MIT License 11 * @copyright 2010 - 2011 Fuel Development Team 12 * @link http://fuelphp.com 13 13 */ 14 14 -
trunk/fuel/packages/auth/classes/auth/group/driver.php
r2 r39 5 5 * Fuel is a fast, lightweight, community driven PHP5 framework. 6 6 * 7 * @package Fuel8 * @version 1.09 * @author Fuel Development Team10 * @license MIT License11 * @copyright 2010 - 2011 Fuel Development Team12 * @link http://fuelphp.com7 * @package Fuel 8 * @version 1.0 9 * @author Fuel Development Team 10 * @license MIT License 11 * @copyright 2010 - 2011 Fuel Development Team 12 * @link http://fuelphp.com 13 13 */ 14 14 … … 33 33 ! array_key_exists('id', $config) && $config['id'] = $config['driver']; 34 34 35 $class = 'Auth_Group_'.ucfirst($config['driver']);35 $class = \Inflector::get_namespace($config['driver']).'Auth_Group_'.ucfirst(\Inflector::denamespace($config['driver'])); 36 36 $driver = new $class($config); 37 37 static::$_instances[$driver->get_id()] = $driver; -
trunk/fuel/packages/auth/classes/auth/group/simplegroup.php
r2 r39 5 5 * Fuel is a fast, lightweight, community driven PHP5 framework. 6 6 * 7 * @package Fuel8 * @version 1.09 * @author Fuel Development Team10 * @license MIT License11 * @copyright 2010 - 2011 Fuel Development Team12 * @link http://fuelphp.com7 * @package Fuel 8 * @version 1.0 9 * @author Fuel Development Team 10 * @license MIT License 11 * @copyright 2010 - 2011 Fuel Development Team 12 * @link http://fuelphp.com 13 13 */ 14 14 -
trunk/fuel/packages/auth/classes/auth/login/driver.php
r2 r39 5 5 * Fuel is a fast, lightweight, community driven PHP5 framework. 6 6 * 7 * @package Fuel8 * @version 1.09 * @author Fuel Development Team10 * @license MIT License11 * @copyright 2010 - 2011 Fuel Development Team12 * @link http://fuelphp.com7 * @package Fuel 8 * @version 1.0 9 * @author Fuel Development Team 10 * @license MIT License 11 * @copyright 2010 - 2011 Fuel Development Team 12 * @link http://fuelphp.com 13 13 */ 14 14 … … 33 33 ! array_key_exists('id', $config) && $config['id'] = $config['driver']; 34 34 35 $class = 'Auth_Login_'.ucfirst($config['driver']);35 $class = \Inflector::get_namespace($config['driver']).'Auth_Login_'.ucfirst(\Inflector::denamespace($config['driver'])); 36 36 $driver = new $class($config); 37 37 static::$_instances[$driver->get_id()] = $driver; -
trunk/fuel/packages/auth/classes/auth/login/simpleauth.php
r18 r39 5 5 * Fuel is a fast, lightweight, community driven PHP5 framework. 6 6 * 7 * @package Fuel8 * @version 1.09 * @author Fuel Development Team10 * @license MIT License11 * @copyright 2010 - 2011 Fuel Development Team12 * @link http://fuelphp.com7 * @package Fuel 8 * @version 1.0 9 * @author Fuel Development Team 10 * @license MIT License 11 * @copyright 2010 - 2011 Fuel Development Team 12 * @link http://fuelphp.com 13 13 */ 14 14 -
trunk/fuel/packages/auth/config/simpleauth.php
r18 r39 11 11 12 12 'roles' => array( 13 '#' => array('website' => 'r'), // default rights 14 'banned' => false, 15 'user' => array('comments' => 'cr'), 16 'moderator' => array('comments' => 'ud'), 17 'admin' => array('website' => 'cud', 'admin' => 'crud'), 18 'super' => true, 13 '#' => array('website' => array('read')), // default rights 14 'banned' => false, 15 'user' => array('comments' => array('create', 'read')), 16 'moderator' => array('comments' => array('update', 'delete')), 17 'admin' => array( 18 'website' => array('create', 'update', 'delete'), 19 'admin' => array('create', 'read', 'update', 'delete'), 20 ), 21 'super' => true, 19 22 ), 20 23 -
trunk/fuel/packages/oil/bootstrap.php
r36 r39 5 5 * Fuel is a fast, lightweight, community driven PHP5 framework. 6 6 * 7 * @package Fuel8 * @version 1.09 * @author Fuel Development Team10 * @license MIT License11 * @copyright 2010 - 2011 Fuel Development Team12 * @link http://fuelphp.com7 * @package Fuel 8 * @version 1.0 9 * @author Fuel Development Team 10 * @license MIT License 11 * @copyright 2010 - 2011 Fuel Development Team 12 * @link http://fuelphp.com 13 13 */ 14 14 15 15 16 16 Autoloader::add_classes(array( 17 'Oil\\C li' => __DIR__.'/classes/cli.php',17 'Oil\\Command' => __DIR__.'/classes/command.php', 18 18 'Oil\\Console' => __DIR__.'/classes/console.php', 19 19 'Oil\\Exception' => __DIR__.'/classes/exception.php', -
trunk/fuel/packages/oil/classes/console.php
r6 r39 5 5 * Fuel is a fast, lightweight, community driven PHP5 framework. 6 6 * 7 * @package Fuel8 * @version 1.09 * @author Phil Sturgeon10 * @license MIT License11 * @copyright 2010 - 2011 Fuel Development Team12 * @link http://fuelphp.com7 * @package Fuel 8 * @version 1.0 9 * @author Fuel Development Team 10 * @license MIT License 11 * @copyright 2010 - 2011 Fuel Development Team 12 * @link http://fuelphp.com 13 13 */ 14 14 … … 37 37 while (ob_get_level ()) 38 38 { 39 ob_end_clean();40 } 41 39 ob_end_clean(); 40 } 41 42 42 ob_implicit_flush(true); 43 43 … … 48 48 private function main() 49 49 { 50 echosprintf(50 \Cli::write(sprintf( 51 51 'Fuel %s - PHP %s (%s) (%s) [%s]', 52 52 \Fuel::VERSION, … … 55 55 self::build_date(), 56 56 PHP_OS 57 ) . PHP_EOL;57 )); 58 58 59 59 // Loop until they break it 60 60 while (TRUE) 61 61 { 62 echo ">>> "; 63 64 if ( ! $__line = rtrim(trim(trim(fgets(STDIN)), PHP_EOL), ';')) 62 if (\Cli::$readline_support) 63 { 64 readline_completion_function(array(__CLASS__, 'tab_complete')); 65 } 66 67 if ( ! $__line = rtrim(trim(trim(\Cli::input('>>> ')), PHP_EOL), ';')) 65 68 { 66 69 continue; … … 70 73 { 71 74 break; 75 } 76 77 // Add this line to history 78 //$this->history[] = array_slice($this->history, 0, -99) + array($line); 79 if (\Cli::$readline_support) 80 { 81 readline_add_history($__line); 72 82 } 73 83 … … 85 95 if ($ret === false) 86 96 { 87 \Cli:: write(\Cli::color('Parse Error - ' . $__line, 'light_red'));97 \Cli::error('Parse Error - ' . $__line); 88 98 \Cli::beep(); 89 99 } … … 93 103 if (is_bool($ret)) 94 104 { 95 echo ($ret ? "true" : "false");96 } 97 else if (is_string($ret))105 echo $ret ? 'true' : 'false'; 106 } 107 elseif (is_string($ret)) 98 108 { 99 109 echo addcslashes($ret, "\0..\37\177..\377"); 100 110 } 101 else if ( ! is_null($ret))111 elseif ( ! is_null($ret)) 102 112 { 103 113 var_export($ret); … … 119 129 } 120 130 121 private function is_immediate($line)131 private static function is_immediate($line) 122 132 { 123 133 $skip = array( … … 141 151 $sq = !$sq; 142 152 } 143 else if ($c == '"')153 elseif ($c == '"') 144 154 { 145 155 $dq = !$dq; 146 156 } 147 157 148 else if ( ($sq) || ($dq) && $c == "\\")158 elseif ( ($sq) || ($dq) && $c == "\\") 149 159 { 150 160 ++$i; … … 162 172 } 163 173 164 $kw = preg_split("[^ A-Za-z0-9_]", $code);174 $kw = preg_split("[^a-z0-9_]i", $code); 165 175 foreach ($kw as $i) 166 176 { … … 174 184 } 175 185 176 private function build_date() 186 public static function tab_complete($line, $pos, $cursor) 187 { 188 $const = array_keys(get_defined_constants()); 189 $var = array_keys($GLOBALS); 190 $func = get_defined_functions(); 191 192 foreach ($func["user"] as $i) 193 { 194 $func["internal"][] = $i; 195 } 196 $func = $func["internal"]; 197 198 return array_merge($const, $var, $func); 199 } 200 201 private static function build_date() 177 202 { 178 203 ob_start(); -
trunk/fuel/packages/oil/classes/exception.php
r2 r39 5 5 * Fuel is a fast, lightweight, community driven PHP5 framework. 6 6 * 7 * @package Fuel8 * @version 1.09 * @author Fuel Development Team10 * @license MIT License11 * @copyright 2010 - 2011 Fuel Development Team12 * @link http://fuelphp.com7 * @package Fuel 8 * @version 1.0 9 * @author Fuel Development Team 10 * @license MIT License 11 * @copyright 2010 - 2011 Fuel Development Team 12 * @link http://fuelphp.com 13 13 */ 14 14 -
trunk/fuel/packages/oil/classes/generate.php
r31 r39 5 5 * Fuel is a fast, lightweight, community driven PHP5 framework. 6 6 * 7 * @package Fuel8 * @version 1.09 * @author Fuel Development Team10 * @license MIT License11 * @copyright 2010 - 2011 Fuel Development Team12 * @link http://fuelphp.com7 * @package Fuel 8 * @version 1.0 9 * @author Fuel Development Team 10 * @license MIT License 11 * @copyright 2010 - 2011 Fuel Development Team 12 * @link http://fuelphp.com 13 13 */ 14 14 … … 25 25 class Generate 26 26 { 27 public static $create_folders = array(); 28 public static $create_files = array(); 29 30 public static $scaffolding = false; 31 27 32 private static $_default_constraints = array( 28 33 'varchar' => 255, 34 'char' => 255, 29 35 'int' => 11 30 36 ); 31 37 32 public function controller($args)38 public static function controller($args, $build = true) 33 39 { 34 40 $args = self::_clear_args($args); … … 38 44 $filepath = APPPATH . 'classes/controller/' . $singular .'.php'; 39 45 40 $class_name = ucfirst($singular); 46 // Uppercase each part of the class name and remove hyphens 47 $class_name = static::class_name($singular); 41 48 42 49 // Stick "blogs" to the start of the array … … 44 51 45 52 // Create views folder and each view file 46 static::views($args); 47 48 if (empty($actions)) 49 { 50 $actions = array('index'); 51 } 52 53 static::views($args, false); 54 55 $actions or $actions = array('index'); 56 53 57 $action_str = ''; 54 58 foreach ($actions as $action) … … 57 61 public function action_'.$action.'() 58 62 { 59 $this->template->title = \'' . \Inflector::humanize($singular) .' » ' . \Inflector::humanize($action) . '\';63 $this->template->title = \'' . \Inflector::humanize($singular) .' » ' . \Inflector::humanize($action) . '\'; 60 64 $this->template->content = View::factory(\''.$singular .'/' . $action .'\'); 61 65 }'.PHP_EOL; … … 74 78 75 79 // Write controller 76 if (self::write($filepath, $controller)) 77 { 78 \Cli::write("\t".'Created controller: ' . \Fuel::clean_path($filepath)); 79 } 80 } 81 82 83 public function model($args) 80 static::create($filepath, $controller, 'controller'); 81 $build and static::build(); 82 } 83 84 85 public static function model($args, $build = true) 84 86 { 85 87 $singular = strtolower(array_shift($args)); … … 92 94 $plural = \Inflector::pluralize($singular); 93 95 94 $filepath = APPPATH . 'classes/model/' . $singular .'.php'; 95 96 $class_name = ucfirst($singular); 96 $filepath = APPPATH . 'classes/model/' . str_replace('_', '/', $singular) .'.php'; 97 98 // Uppercase each part of the class name and remove hyphens 99 $class_name = static::class_name($singular); 97 100 98 101 $model = <<<MODEL 99 102 <?php 100 103 101 class Model_{$class_name} extends ActiveRecord\Model { }104 class Model_{$class_name} extends Orm\Model { } 102 105 103 106 /* End of file $singular.php */ 104 107 MODEL; 105 108 106 if (self::write($filepath, $model)) 107 { 108 \Cli::write("\t".'Created model: ' . \Fuel::clean_path($filepath)); 109 } 109 // Build the model 110 static::create($filepath, $model, 'model'); 110 111 111 112 if ( ! empty($args)) 112 113 { 113 114 array_unshift($args, 'create_'.$plural); 114 static::migration($args); 115 } 116 } 117 118 119 public function views($args) 115 static::migration($args, false); 116 } 117 118 else 119 { 120 throw new Exception('Not enough arguments to create this migration.'); 121 } 122 123 $build and static::build(); 124 } 125 126 127 public static function views($args, $build = true) 120 128 { 121 129 $args = self::_clear_args($args); 122 $folder = array_shift($args); 123 $controller_title = \Inflector::humanize($folder); 124 125 empty($args) and $args = array('index'); 130 $controller = strtolower(array_shift($args)); 131 $controller_title = \Inflector::humanize($controller); 132 133 $view_dir = APPPATH.'views/'.trim(str_replace(array('_', '-'), DS, $controller), DS).DS; 134 135 $args or $args = array('index'); 126 136 127 137 // Make the directory for these views to be store in 128 if ( ! is_dir($view_dir = APPPATH . 'views/'.$folder.'/')) 129 { 130 mkdir($view_dir, 0777); 131 } 138 is_dir($view_dir) or static::$create_folders[] = $view_dir; 132 139 133 140 // Add the default template if it doesnt exist 134 if ( ! file_exists($app_template = APPPATH . 'views/template.php')) 135 { 136 copy(PKGPATH . 'oil/views/default/template.php', $app_template); 137 chmod($app_template, 0666); 138 } 139 unset($app_template); 141 if ( ! file_exists($app_template = APPPATH.'views/template.php')) 142 { 143 static::create($app_template, file_get_contents(PKGPATH.'oil/views/default/template.php'), 'view'); 144 } 140 145 141 146 foreach ($args as $action) 142 147 { 143 148 $view_title = \Inflector::humanize($action); 144 // $view_filepath = \Fuel::clean_path($view_file = $view_dir . $action . '.php');145 $view_filepath = $view_file = $view_dir . $action . '.php';146 147 149 $view = <<<VIEW 148 <p> Edit this content in {$view_filepath}</p>150 <p>{$view_title}</p> 149 151 VIEW; 150 152 151 if (self::write($view_file, $view)) 152 { 153 \Cli::write("\t".'Created view: ' . \Fuel::clean_path($view_file)); 154 } 155 } 156 } 157 158 159 public function migration($args) 160 { 161 153 // Create this view 154 static::create($view_dir.$action.'.php', $view, 'view'); 155 } 156 157 $build and static::build(); 158 } 159 160 161 public static function migration($args, $build = true) 162 { 162 163 // Get the migration name 163 $migration_name = strtolower(array_shift($args)); 164 164 $migration_name = strtolower(str_replace('-', '_', array_shift($args))); 165 166 // Check if a migration with this name already exists 167 if (count($duplicates = glob(APPPATH."migrations/*_{$migration_name}*")) > 0) 168 { 169 // Don't override a file 170 if (\Cli::option('s', \Cli::option('skip')) === true) 171 { 172 return; 173 } 174 175 // Tear up the file path and name to get the last duplicate 176 $file_name = pathinfo(end($duplicates), PATHINFO_FILENAME); 177 178 // Override the (most recent) migration with the same name by using its number 179 if (\Cli::option('f', \Cli::option('force')) === true) 180 { 181 list($number) = explode('_', $file_name); 182 } 183 184 // Name clashes but this is done by hand. Assume they know what they're doing and just increment the file 185 elseif (static::$scaffolding === false) 186 { 187 // Increment the name of this 188 $migration_name = \Str::increment(substr($file_name, 4), 2); 189 } 190 } 191 165 192 // See if the action exists 166 193 $methods = get_class_methods(__NAMESPACE__ . '\Generate_Migration_Actions'); 167 194 168 195 // For empty migrations that dont have actions 169 196 $migration = array('', ''); 170 197 171 198 // Loop through the actions and act on a matching action appropriately 172 foreach ($methods as $method_name)173 { 199 foreach ($methods as $method_name) 200 { 174 201 // If the miration name starts with the name of the action method 175 if(substr($migration_name, 0, strlen($method_name)) === $method_name) 176 { 177 202 if (substr($migration_name, 0, strlen($method_name)) === $method_name) 203 { 178 204 /** 179 205 * Create an array of the subject the migration is about … … 190 216 $subjects = array(false, false); 191 217 $matches = explode('_', str_replace($method_name . '_', '', $migration_name)); 192 193 if(count($matches) == 1) { // create_{table} 218 219 // create_{table} 220 if (count($matches) == 1) 221 { 194 222 $subjects = array(false, $matches[0]); 195 223 } 196 else if(count($matches) == 3) // add_{field}_to_{table} 224 225 // add_{field}_to_{table} 226 else if (count($matches) == 3 && $matches[1] == 'to') 197 227 { 198 228 $subjects = array($matches[0], $matches[2]); 199 229 } 230 231 // create_{table} (with underscores in table name) 232 else if (count($matches) !== 0) 233 { 234 $subjects = array(false, implode('_', $matches)); 235 } 236 237 // There is no subject here so just carry on with a normal empty migration 200 238 else 201 239 { 202 // There is no subject here so just carry on with a normal empty migration203 240 break; 204 241 } 205 242 206 243 // We always pass in fields to a migration, so lets sort them out here. 207 244 $fields = array(); 208 foreach ($args as $field)245 foreach ($args as $field) 209 246 { 210 247 $field_array = array(); 211 248 212 249 // Each paramater for a field is seperated by the : character 213 250 $parts = explode(":", $field); 214 251 215 252 // We must have the 'name:type' if nothing else! 216 if (count($parts) >= 2)253 if (count($parts) >= 2) 217 254 { 218 255 $field_array['name'] = array_shift($parts); 219 foreach ($parts as $part_i => $part)256 foreach ($parts as $part_i => $part) 220 257 { 221 258 preg_match('/([a-z0-9_-]+)(?:\[([a-z0-9]+)\])?/i', $part, $part_matches); 222 259 array_shift($part_matches); 223 224 if (count($part_matches) < 1)260 261 if (count($part_matches) < 1) 225 262 { 226 263 // Move onto the next part, something is wrong here... 227 264 continue; 228 265 } 229 266 230 267 $option_name = ''; // This is the name of the option to be passed to the action in a field 231 268 $option = $part_matches; 232 269 233 270 // The first option always has to be the field type 234 if ($part_i == 0)271 if ($part_i == 0) 235 272 { 236 273 $option_name = 'type'; 237 274 $type = $option[0]; 238 if ($type === 'string')275 if ($type === 'string') 239 276 { 240 277 $type = 'varchar'; 241 278 } 242 else if ($type === 'integer')279 else if ($type === 'integer') 243 280 { 244 281 $type = 'int'; 245 282 } 246 283 247 if (!in_array($type, array('text', 'blob', 'datetime', 'date', 'timestamp', 'time')))284 if ( ! in_array($type, array('text', 'blob', 'datetime', 'date', 'timestamp', 'time'))) 248 285 { 249 if (!isset($option[1]) || $option[1] == NULL)286 if ( ! isset($option[1]) || $option[1] == NULL) 250 287 { 251 if (isset(self::$_default_constraints[$type]))288 if (isset(self::$_default_constraints[$type])) 252 289 { 253 290 $field_array['constraint'] = self::$_default_constraints[$type]; … … 266 303 // ... always be passed through to the action making it really easy to add extra options for a field 267 304 $option_name = array_shift($option); 268 if (count($option) > 0)305 if (count($option) > 0) 269 306 { 270 307 $option = $option[0]; … … 274 311 $option = true; 275 312 } 276 } 277 313 } 314 278 315 $field_array[$option_name] = $option; 279 316 280 317 } 281 318 $fields[] = $field_array; … … 287 324 } 288 325 } 289 326 290 327 // Call the magic action which returns an array($up, $down) for the migration 291 \Cli::write("\tBuilding magic migration:" . $method_name);292 328 $migration = call_user_func(__NAMESPACE__ . "\Generate_Migration_Actions::{$method_name}", $subjects, $fields); 293 294 } 295 else 296 { 297 // No magic action for this migration... 298 } 299 } 300 329 } 330 } 331 301 332 // Build the migration 302 if ($filepath = static::_build_migration($migration_name, $migration[0], $migration[1])) 303 { 304 \Cli::write("\tCreated migration: " . \Fuel::clean_path($filepath), 'green'); 305 } 306 } 307 308 309 public function help() 333 list($up, $down)=$migration; 334 335 $migration_name = ucfirst(strtolower($migration_name)); 336 337 $migration = <<<MIGRATION 338 <?php 339 340 namespace Fuel\Migrations; 341 342 class {$migration_name} { 343 344 public function up() 345 { 346 {$up} 347 } 348 349 public function down() 350 { 351 {$down} 352 } 353 } 354 MIGRATION; 355 356 $number = isset($number) ? $number : static::_find_migration_number(); 357 $filepath = APPPATH . 'migrations/'.$number.'_' . strtolower($migration_name) . '.php'; 358 359 static::create($filepath, $migration, 'migration'); 360 361 $build and static::build(); 362 } 363 364 365 public static function help() 310 366 { 311 367 $output = <<<HELP … … 328 384 php oil g scaffold/template_subfolder <modelname> [<fieldname1>:<type1> |<fieldname2>:<type2> |..] 329 385 330 Note that the next two lines are equivalent: 386 Note that the next two lines are equivalent: 331 387 php oil g scaffold <modelname> ... 332 388 php oil g scaffold/default <modelname> ... 333 389 334 390 Documentation: 335 391 http://fuelphp.com/docs/packages/oil/generate.html … … 340 396 341 397 342 // Helper functions 343 344 345 private function write($filepath, $data) 346 { 347 if ( ! $handle = @fopen($filepath, 'w+')) 348 { 349 throw new Exception('Cannot open file: '. $filepath); 350 } 351 352 $result = @fwrite($handle, $data); 353 354 // Write $somecontent to our opened file. 355 if ($result === FALSE) 356 { 357 throw new Exception('Cannot write to file: '. $filepath); 358 } 359 360 @fclose($handle); 361 362 chmod($filepath, 0666); 398 public static function create($filepath, $contents, $type = 'file') 399 { 400 // Final check for stupid characters 401 if (in_array($type, array('controller', 'model'))) 402 { 403 $filepath = str_replace(array('_', '-'), '/', $filepath); 404 } 405 406 $directory = dirname($filepath); 407 is_dir($directory) or static::$create_folders[] = $directory; 408 409 // Check if a file exists then work out how to react 410 if (file_exists($filepath)) 411 { 412 // Don't override a file 413 if (\Cli::option('s', \Cli::option('skip')) === true) 414 { 415 // Don't bother trying to make this, carry on camping 416 return; 417 } 418 419 // If we aren't skipping it, tell em to use -f 420 if (\Cli::option('f', \Cli::option('force')) === null) 421 { 422 throw new Exception($filepath .' already exists, use -f or --force to override.'); 423 exit; 424 } 425 } 426 427 static::$create_files[] = array( 428 'path' => $filepath, 429 'contents' => $contents, 430 'type' => $type 431 ); 432 } 433 434 435 public static function build() 436 { 437 foreach (static::$create_folders as $folder) 438 { 439 is_dir($folder) or mkdir($folder, 0755, TRUE); 440 } 441 442 foreach (static::$create_files as $file) 443 { 444 \Cli::write("\tCreating {$file['type']}: {$file['path']}", 'green'); 445 446 if ( ! $handle = @fopen($file['path'], 'w+')) 447 { 448 throw new Exception('Cannot open file: '. $file['path']); 449 } 450 451 $result = @fwrite($handle, $file['contents']); 452 453 // Write $somecontent to our opened file. 454 if ($result === FALSE) 455 { 456 throw new Exception('Cannot write to file: '. $file['path']); 457 } 458 459 @fclose($handle); 460 461 @chmod($file['path'], 0666); 462 } 363 463 364 464 return $result; 365 465 } 366 367 private function _build_migration($migration_name, $up, $down) 368 { 369 $migration_name = ucfirst(strtolower($migration_name)); 370 371 $migration = <<<MIGRATION 372 <?php 373 374 namespace Fuel\Migrations; 375 376 class {$migration_name} { 377 378 function up() 379 { 380 {$up} 381 } 382 383 function down() 384 { 385 {$down} 466 467 public static function class_name($name) 468 { 469 return str_replace(array(' ', '-'), '_', ucwords(str_replace('_', ' ', $name))); 470 } 471 472 // Helper methods 473 474 private static function _find_migration_number() 475 { 476 $glob = glob(APPPATH .'migrations/*_*.php'); 477 list($last) = explode('_', basename(end($glob))); 478 479 return str_pad($last + 1, 3, '0', STR_PAD_LEFT); 480 } 481 482 private static function _update_current_version($version) 483 { 484 if (file_exists($app_path = APPPATH.'config'.DS.'migrations.php')) 485 { 486 $contents = file_get_contents($app_path); 487 } 488 elseif (file_exists($core_path = COREPATH.'config'.DS.'migrations.php')) 489 { 490 $contents = file_get_contents($core_path); 491 } 492 else 493 { 494 throw new Exception('Config file core/config/migrations.php'); 495 exit; 496 } 497 498 $contents = preg_replace("#('version'[ \t]+=>)[ \t]+([0-9]+),#i", "$1 $version,", $contents); 499 500 static::create($app_path, $contents, 'config'); 501 } 502 503 private static function _clear_args($actions = array()) 504 { 505 foreach ($actions as $key => $action) 506 { 507 if (substr($action, 0, 1) === '-') 508 { 509 unset($actions[$key]); 510 } 511 } 512 513 return $actions; 386 514 } 387 515 } 388 MIGRATION;389 390 $number = self::_find_migration_number();391 $filepath = APPPATH . 'migrations/'.$number.'_' . strtolower($migration_name) . '.php';392 393 if (glob(APPPATH . 'migrations/*_' . strtolower($migration_name) . '.php'))394 {395 throw new Exception('A migration with this name already exists.');396 }397 398 if (self::write($filepath, $migration))399 {400 self::_update_current_version(intval($number));401 return $filepath;402 }403 404 return false;405 }406 407 private function _find_migration_number()408 {409 list($last) = explode('_', basename(end(glob(APPPATH .'migrations/*_*.php'))));410 411 return str_pad($last + 1, 3, '0', STR_PAD_LEFT);412 }413 414 private function _update_current_version($version)415 {416 $contents = '';417 $path = '';418 if (file_exists($path = APPPATH.'config'.DS.'migration.php'))419 {420 $contents = file_get_contents($path);421 }422 elseif (file_exists($path = COREPATH.'config'.DS.'migration.php'))423 {424 $contents = file_get_contents($path );425 }426 427 $contents = preg_replace("#('version'[ \t]+=>)[ \t]+([0-9]+),#i", "$1 $version,", $contents);428 429 self::write($path, $contents);430 }431 432 private function _clear_args($actions = array())433 {434 foreach ($actions as $key => $action)435 {436 if (substr($action, 0, 1) === '-')437 {438 unset($actions[$key]);439 }440 }441 442 return $actions;443 }444 }445 516 446 517 /* End of file oil/classes/generate.php */ -
trunk/fuel/packages/oil/classes/generate/migration/actions.php
r17 r39 5 5 * Fuel is a fast, lightweight, community driven PHP5 framework. 6 6 * 7 * @package Fuel8 * @version 1.09 * @author Fuel Development Team10 * @license MIT License11 * @copyright 2010 - 2011 Fuel Development Team12 * @link http://fuelphp.com7 * @package Fuel 8 * @version 1.0 9 * @author Fuel Development Team 10 * @license MIT License 11 * @copyright 2010 - 2011 Fuel Development Team 12 * @link http://fuelphp.com 13 13 */ 14 14 -
trunk/fuel/packages/oil/classes/package.php
r8 r39 5 5 * Fuel is a fast, lightweight, community driven PHP5 framework. 6 6 * 7 * @package Fuel8 * @version 1.09 * @author Fuel Development Team10 * @license MIT License11 * @copyright 2010 - 2011 Fuel Development Team12 * @link http://fuelphp.com7 * @package Fuel 8 * @version 1.0 9 * @author Fuel Development Team 10 * @license MIT License 11 * @copyright 2010 - 2011 Fuel Development Team 12 * @link http://fuelphp.com 13 13 */ 14 14 … … 25 25 class Package 26 26 { 27 protected static $protected = array('auth', 'activerecord', 'o ctane', 'oil');27 protected static $protected = array('auth', 'activerecord', 'oil', 'orm'); 28 28 29 29 protected static $git = 'git'; … … 53 53 $zip_url = 'http://' . rtrim($source, '/').'/fuel-'.$package.'/zipball/'.$version; 54 54 55 if ($fp = @fopen($zip_url, 'r'))55 if ($fp = fopen($zip_url, 'r')) 56 56 { 57 57 // We don't actually need this, just checking the file is there … … 178 178 $path = str_replace($tmp_package_folder, $package_folder, $file); 179 179 chmod($path, octdec(755)); 180 \Cli::write("\t" . \Fuel::clean_path($path));180 \Cli::write("\t" . $path); 181 181 } 182 182 } -
trunk/fuel/packages/oil/classes/refine.php
r6 r39 5 5 * Fuel is a fast, lightweight, community driven PHP5 framework. 6 6 * 7 * @package Fuel8 * @version 1.09 * @author Fuel Development Team10 * @license MIT License11 * @copyright 2010 - 2011 Fuel Development Team12 * @link http://fuelphp.com7 * @package Fuel 8 * @version 1.0 9 * @author Fuel Development Team 10 * @license MIT License 11 * @copyright 2010 - 2011 Fuel Development Team 12 * @link http://fuelphp.com 13 13 */ 14 14 … … 42 42 if ( ! $file = \Fuel::find_file('tasks', $task)) 43 43 { 44 throw new Exception(sprintf('Task "%s" does not exist.', $task)); 44 $files = \Fuel::list_files('tasks'); 45 $possibilities = array(); 46 foreach($files as $file) 47 { 48 $possible_task = pathinfo($file, \PATHINFO_FILENAME); 49 $difference = levenshtein($possible_task, $task); 50 $possibilities[$difference] = $possible_task; 51 } 52 53 ksort($possibilities); 54 55 if ($possibilities and current($possibilities) <= 5) 56 { 57 throw new Exception(sprintf('Task "%s" does not exist. Did you mean "%s"?', strtolower($task), current($possibilities))); 58 } 59 else 60 { 61 throw new Exception(sprintf('Task "%s" does not exist.', strtolower($task))); 62 } 63 45 64 return; 46 65 } -
trunk/fuel/packages/oil/classes/scaffold.php
r12 r39 5 5 * Fuel is a fast, lightweight, community driven PHP5 framework. 6 6 * 7 * @package Fuel8 * @version 1.09 * @author Fuel Development Team10 * @license MIT License11 * @copyright 2010 - 2011 Fuel Development Team12 * @link http://fuelphp.com7 * @package Fuel 8 * @version 1.0 9 * @author Fuel Development Team 10 * @license MIT License 11 * @copyright 2010 - 2011 Fuel Development Team 12 * @link http://fuelphp.com 13 13 */ 14 14 … … 25 25 class Scaffold 26 26 { 27 public function generate($args, $subfolder = 'default') 27 public static function _init() 28 { 29 Generate::$scaffolding = true; 30 } 31 32 public static function generate($args, $subfolder = 'default') 28 33 { 29 34 $subfolder = trim($subfolder, '/'); 30 if ( ! is_dir( PKGPATH.'oil/views/'.$subfolder))35 if ( ! is_dir( PKGPATH.'oil/views/'.$subfolder)) 31 36 { 32 37 throw new Exception('The subfolder for scaffolding templates doesn\'t exist or is spelled wrong: '.$subfolder.' '); 33 38 } 34 39 35 40 // Do this first as there is the largest chance of error here 36 Generate::model($args );37 41 Generate::model($args, false); 42 38 43 // Go through all arguments after the first and make them into field arrays 39 44 $fields = array(); … … 45 50 $fields[] = array( 46 51 'name' => strtolower($matches[1]), 47 'type' => $matches[2],52 'type' => isset($matches[2]) ? $matches[2] : 'string', 48 53 'constraint' => isset($matches[4]) ? $matches[4] : null 49 54 ); … … 51 56 52 57 $data['singular'] = $singular = strtolower(array_shift($args)); 53 $data['model'] = $model_name = 'Model_' . ucfirst($singular);58 $data['model'] = $model_name = 'Model_'.Generate::class_name($singular); 54 59 $data['plural'] = $plural = \Inflector::pluralize($singular); 55 60 $data['fields'] = $fields; 56 61 57 $filepath = APPPATH . 'classes/controller/' . $plural .'.php';62 $filepath = APPPATH.'classes/controller/'.$plural.'.php'; 58 63 $controller = \View::factory($subfolder.'/scaffold/controller', $data); 59 64 … … 87 92 88 93 // Write controller 89 if (self::write($filepath, $controller)) 94 Generate::create($filepath, $controller, 'controller'); 95 96 // Create each of the views 97 foreach (array('index', 'view', 'create', 'edit', '_form') as $view) 90 98 { 91 \Cli::write('Created controller: ' . \Fuel::clean_path($filepath));99 Generate::create(APPPATH.'views/'.$plural.'/'.$view.'.php', \View::factory($subfolder.'/scaffold/views/'.$view, $data), 'view'); 92 100 } 93 101 … … 95 103 if ( ! file_exists($app_template = APPPATH . 'views/template.php')) 96 104 { 97 copy(PKGPATH . 'oil/views/'.$subfolder.'/template.php', $app_template); 98 chmod($app_template, 0666); 99 } 100 101 // Create view folder if not already there 102 if ( ! is_dir($view_folder = APPPATH . 'views/' . $plural . '/')) 103 { 104 mkdir(APPPATH . 'views/' . $plural, 0755); 105 Generate::create($app_template, file_get_contents(PKGPATH . 'oil/views/default/template.php'), 'view'); 105 106 } 106 107 107 // Create each of the views 108 foreach (array('index', 'view', 'create', 'edit', '_form') as $view) 109 { 110 static::write($view_file = $view_folder . $view . '.php', \View::factory($subfolder.'/scaffold/views/'.$view, $data)); 111 112 \Cli::write('Created view: ' . \Fuel::clean_path($view_file)); 113 } 114 } 115 116 private function write($filepath, $data) 117 { 118 if ( ! $handle = fopen($filepath, 'w+')) 119 { 120 throw new Exception('Cannot open file: '. \Fuel::clean_path($filepath)); 121 } 122 123 $result = @fwrite($handle, $data); 124 125 // Write $somecontent to our opened file. 126 if ($result === FALSE) 127 { 128 throw new Exception('Cannot write to file: '. \Fuel::clean_path($filepath)); 129 } 130 131 @fclose($handle); 132 133 chmod($filepath, 0666); 134 135 return $result; 108 Generate::build(); 136 109 } 137 110 -
trunk/fuel/packages/oil/views/default/scaffold/actions/create.php
r12 r39 9 9 if ($<?php echo $singular; ?> and $<?php echo $singular; ?>->save()) 10 10 { 11 Session::set_flash('notice', 'Added ' . $<?php echo $singular; ?> . '#' . $<?php echo $singular; ?>->id . '.');11 Session::set_flash('notice', 'Added <?php echo $singular; ?> #' . $<?php echo $singular; ?>->id . '.'); 12 12 13 Output::redirect('<?php echo $plural; ?>');13 Response::redirect('<?php echo $plural; ?>'); 14 14 } 15 15 -
trunk/fuel/packages/oil/views/default/scaffold/actions/delete.php
r12 r39 11 11 } 12 12 13 Output::redirect('<?php echo $plural; ?>');13 Response::redirect('<?php echo $plural; ?>'); -
trunk/fuel/packages/oil/views/default/scaffold/actions/edit.php
r12 r39 9 9 if ($<?php echo $singular; ?>->save()) 10 10 { 11 Session::set_flash('notice', 'Updated ' . $<?php echo $singular; ?> . '#' . $<?php echo $singular; ?>->id);11 Session::set_flash('notice', 'Updated <?php echo $singular; ?> #' . $<?php echo $singular; ?>->id); 12 12 13 Output::redirect('<?php echo $plural; ?>');13 Response::redirect('<?php echo $plural; ?>'); 14 14 } 15 15 16 16 else 17 17 { 18 Session::set_flash('notice', 'Could not update ' . $<?php echo $singular; ?> . '#' . $id);18 Session::set_flash('notice', 'Could not update <?php echo $singular; ?> #' . $id); 19 19 } 20 20 } -
trunk/fuel/packages/oil/views/default/scaffold/views/create.php
r12 r39 3 3 <?php echo '<?php'; ?> echo render('<?php echo $plural; ?>/_form'); ?> 4 4 5 <?php echo '<?php'; ?> echo H TML::anchor('<?php echo $plural; ?>', 'Back'); <?php echo '?>'; ?>5 <?php echo '<?php'; ?> echo Html::anchor('<?php echo $plural; ?>', 'Back'); <?php echo '?>'; ?> -
trunk/fuel/packages/oil/views/default/scaffold/views/edit.php
r12 r39 3 3 <?php echo '<?php'; ?> echo render('<?php echo $plural; ?>/_form'); ?> 4 4 5 <?php echo '<?php'; ?> echo H TML::anchor('<?php echo $plural; ?>/view/'.$<?php echo $singular; ?>->id, 'View'); <?php echo '?>'; ?> |6 <?php echo '<?php'; ?> echo H TML::anchor('<?php echo $plural; ?>', 'Back'); <?php echo '?>'; ?>5 <?php echo '<?php'; ?> echo Html::anchor('<?php echo $plural; ?>/view/'.$<?php echo $singular; ?>->id, 'View'); <?php echo '?>'; ?> | 6 <?php echo '<?php'; ?> echo Html::anchor('<?php echo $plural; ?>', 'Back'); <?php echo '?>'; ?> -
trunk/fuel/packages/oil/views/default/scaffold/views/index.php
r12 r39 17 17 <td><?php echo '<?php'; ?> echo $<?php echo $singular.'->'.$field['name']; ?>; <?php echo '?>'; ?></td> 18 18 <?php endforeach; ?> 19 <td><?php echo '<?php'; ?> echo H TML::anchor('<?php echo $plural; ?>/view/'.$<?php echo $singular; ?>->id, 'View'); <?php echo '?>'; ?></td>20 <td><?php echo '<?php'; ?> echo H TML::anchor('<?php echo $plural; ?>/edit/'.$<?php echo $singular; ?>->id, 'Edit'); <?php echo '?>'; ?></td>21 <td><?php echo '<?php'; ?> echo H TML::anchor('<?php echo $plural; ?>/delete/'.$<?php echo $singular; ?>->id, 'Delete', array('onclick' => "return confirm('Are you sure?')")); <?php echo '?>'; ?></td>19 <td><?php echo '<?php'; ?> echo Html::anchor('<?php echo $plural; ?>/view/'.$<?php echo $singular; ?>->id, 'View'); <?php echo '?>'; ?></td> 20 <td><?php echo '<?php'; ?> echo Html::anchor('<?php echo $plural; ?>/edit/'.$<?php echo $singular; ?>->id, 'Edit'); <?php echo '?>'; ?></td> 21 <td><?php echo '<?php'; ?> echo Html::anchor('<?php echo $plural; ?>/delete/'.$<?php echo $singular; ?>->id, 'Delete', array('onclick' => "return confirm('Are you sure?')")); <?php echo '?>'; ?></td> 22 22 </tr> 23 23 <?php echo '<?php endforeach; ?>'; ?> … … 26 26 <br /> 27 27 28 <?php echo '<?php'; ?> echo H TML::anchor('<?php echo $plural; ?>/create', 'Add new <?php echo \Inflector::humanize($singular); ?>'); <?php echo '?>'; ?>28 <?php echo '<?php'; ?> echo Html::anchor('<?php echo $plural; ?>/create', 'Add new <?php echo \Inflector::humanize($singular); ?>'); <?php echo '?>'; ?> -
trunk/fuel/packages/oil/views/default/scaffold/views/view.php
r12 r39 6 6 <?php endforeach; ?> 7 7 8 <?php echo '<?php'; ?> echo H TML::anchor('<?php echo $plural; ?>/edit/'.$<?php echo $singular; ?>->id, 'Edit'); <?php echo '?>'; ?> |9 <?php echo '<?php'; ?> echo H TML::anchor('<?php echo $plural; ?>', 'Back'); <?php echo '?>'; ?>8 <?php echo '<?php'; ?> echo Html::anchor('<?php echo $plural; ?>/edit/'.$<?php echo $singular; ?>->id, 'Edit'); <?php echo '?>'; ?> | 9 <?php echo '<?php'; ?> echo Html::anchor('<?php echo $plural; ?>', 'Back'); <?php echo '?>'; ?> -
trunk/fuel/packages/oil/views/default/template.php
r12 r39 5 5 <title><?php echo $title; ?></title> 6 6 <style type="text/css"> 7 body { background-color: #F2F2F2; margin: 45px 0 0 0; font-family: ‘Palatino Linotype’, ‘Book Antiqua’, Palatino, serif; font-size: 18px }7 body { background-color: #F2F2F2; margin: 45px 0 0 0; font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif; font-size: 18px } 8 8 #wrapper { width: 740px; margin: 0 auto; } 9 9 h1 { color: #333333; font: normal normal normal 62px/1em Impact, Charcoal, sans-serif; margin: 0 0 15px 0; }
Note: See TracChangeset
for help on using the changeset viewer.
