Show
Ignore:
Timestamp:
01/15/06 03:21:39 (6 years ago)
Author:
john
Message:

add form option helper for selectbox stuff

Location:
trunk/trax/vendor/trax/action_view
Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/trax/vendor/trax/action_view/helpers.php

    r106 r116  
    8080            if(array_key_exists(":controller", $options)) { 
    8181                if($controller = $options[":controller"]) { 
    82                     if(stristr($this->controller_path, $controller)) { 
    83                         $url[] = $this->controller_path; 
    84                     } else { 
    85                         $url[] = $controller; 
    86                     } 
     82                    $url[] = $controller;  
    8783                } 
    8884            } else { 
    8985                $url[] = $this->controller_path; 
    9086            } 
    91             if(array_key_exists(":action", $options)) { 
    92                 if($action = $options[":action"]) { 
    93                     $url[] = $action; 
    94                 } 
     87             
     88            if(count($url)) { 
     89                if(array_key_exists(":action", $options)) { 
     90                    if($action = $options[":action"]) { 
     91                        $url[] = $action; 
     92                    } 
     93                }  
    9594            } 
    96             if(array_key_exists(":id", $options)) { 
    97                 if(is_object($options[":id"])) { 
    98                     if($id = $options[":id"]->id) { 
    99                         $url[] = $id; 
    100                     } 
    101                 } else { 
    102                     if($id = $options[":id"]) { 
    103                         $url[] = $id; 
     95            if(count($url) > 1) { 
     96                if(array_key_exists(":id", $options)) { 
     97                    if(is_object($options[":id"])) { 
     98                        if($id = $options[":id"]->id) { 
     99                            $url[] = $id; 
     100                        } 
     101                    } else { 
     102                        if($id = $options[":id"]) { 
     103                            $url[] = $id; 
     104                        } 
    104105                    } 
    105106                } 
    106107            } 
    107108        } 
     109         
     110        if(count($url) && substr($url_base,-1) != "/") { 
     111            $url_base .= "/";     
     112        }  
     113 
    108114        return $url_base . implode("/", $url); 
    109115    }