Permalink
Browse files

minor cleanup, templates now support shorter default module urls

  • Loading branch information...
1 parent 4521544 commit a0a1713291a970e1baf7c9011da95c8b684ef2a4 @viveleroi committed Feb 22, 2011
Showing with 9 additions and 7 deletions.
  1. +2 −2 admin/index.php
  2. +1 −1 modules/Users/Users_Admin.php
  3. +3 −1 system/template/Template.php
  4. +3 −3 system/user/User.php
View
@@ -25,7 +25,7 @@
define('PLUGINS_PATH', APPLICATION_PATH . DIRECTORY_SEPARATOR . 'plugins');
// here we'll quicly check for absolute minimal php5 support
-if(version_compare(phpversion(), "5.1.0", 'ge')){
+if(version_compare(phpversion(), "5.3.0", 'ge')){
// include the bootstrap file
include(SYSTEM_PATH . DIRECTORY_SEPARATOR . 'bootstrap.php');
@@ -50,6 +50,6 @@
$application = new App($config);
} else {
- trigger_error('This application requires PHP 5.1+. Please upgrade your version of PHP.', E_USER_ERROR);
+ trigger_error('This application requires PHP 5.3+. Please upgrade your version of PHP.', E_USER_ERROR);
}
?>
@@ -34,7 +34,7 @@ public function view(){
* @access public
*/
public function signup(){
- if($user_id = app()->user->signup()){
+ if($user_id = user()->signup()){
$_SESSION['user_id'] = $user_id;
sml()->say(text('signup:account_success'), true);
router()->redirect('login');
@@ -642,7 +642,9 @@ public function url($path = false, $bits = false){
// Otherwise, just build it as normal
if(!$route_mask){
- $url .= sprintf('/%s', $r['module']);
+ if($r['module'] != strtolower(app()->config('default_module'))){
+ $url .= sprintf('/%s', $r['module']);
+ }
$url .= $r['method'] != app()->config('default_method') || is_array($bits) ? sprintf('/%s', $r['method']) : '';
}
View
@@ -50,7 +50,7 @@ public function signup(){
// if the user is logged in, send to interface
if($this->isLoggedIn()){
- app()->router->redirectToUrl( app()->router->interfaceUrl() );
+ router()->redirectToUrl( app()->router->interfaceUrl() );
}
$result = false;
@@ -64,7 +64,7 @@ public function signup(){
$result = $form->save();
}
- app()->template->set(array('form'=>$form));
+ template()->set(array('form'=>$form));
return $result;
@@ -306,7 +306,7 @@ public function postLoginRedirect(){
$redirect = false;
}
}
- return empty($redirect) ? router()->interfaceUrl() : $redirect;
+ return (empty($redirect) ? router()->interfaceUrl() : $redirect);
}

0 comments on commit a0a1713

Please sign in to comment.