Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
minor cleanup, templates now support shorter default module urls
  • Loading branch information
viveleroi committed Feb 22, 2011
1 parent 4521544 commit a0a1713
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions admin/index.php
Expand Up @@ -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');
Expand All @@ -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);
}
?>
2 changes: 1 addition & 1 deletion modules/Users/Users_Admin.php
Expand Up @@ -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');
Expand Down
4 changes: 3 additions & 1 deletion system/template/Template.php
Expand Up @@ -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']) : '';
}

Expand Down
6 changes: 3 additions & 3 deletions system/user/User.php
Expand Up @@ -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;
Expand All @@ -64,7 +64,7 @@ public function signup(){
$result = $form->save();
}

app()->template->set(array('form'=>$form));
template()->set(array('form'=>$form));

return $result;

Expand Down Expand Up @@ -306,7 +306,7 @@ public function postLoginRedirect(){
$redirect = false;
}
}
return empty($redirect) ? router()->interfaceUrl() : $redirect;
return (empty($redirect) ? router()->interfaceUrl() : $redirect);
}


Expand Down

0 comments on commit a0a1713

Please sign in to comment.