Changeset 1419

Show
Ignore:
Timestamp:
12/04/2007 08:17:52 PM (10 months ago)
Author:
Shadowhand
Message:

Changes to core:

  • Pagination now includes the query string, to allow GET-driven searches with paged results
  • ORM->delete(ALL) now respects where() calls
  • Form_Model can now be constructed like this: $form = new Form_Model($title, $action, $inputs), to bypass chained method calls.
Location:
trunk/system
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/libraries/ORM.php

    r1366 r1419  
    394394                                $this->select = TRUE; 
    395395                        } 
    396                         elseif (preg_match('/like|regex/', $method)) 
     396                        elseif (preg_match('/where|like|regex/', $method)) 
    397397                        { 
    398398                                $this->where = TRUE; 
     
    520520                { 
    521521                        // WHERE for ALL: "WHERE 1" (h4x) 
    522                         $where = TRUE; 
     522                        $where = ($this->where === TRUE) ? NULL : TRUE; 
    523523                } 
    524524                else 
  • trunk/system/libraries/Pagination.php

    r1402 r1419  
    9393                        } 
    9494 
    95                         // Create a generic base_url with {page} placeholder 
     95                        // Create a generic base_url with {page} and {query_string} placeholders 
    9696                        $this->base_url[$this->uri_segment - 1] = '{page}'; 
    97                         $this->base_url = url::site(implode('/', $this->base_url)); 
     97                        $this->base_url = url::site(implode('/', $this->base_url)).Router::$query_string; 
    9898                } 
    9999 
  • trunk/system/models/form.php

    r1417 r1419  
    77 
    88        // Title attribute 
    9         protected $title  = ''; 
     9        protected $title = ''; 
    1010 
    1111        // Input data 
     
    1818        protected $status; 
    1919 
    20         public function __construct() 
     20        public function __construct($title = NULL, $action = NULL, $inputs = NULL) 
    2121        { 
    2222                // Uncomment the following line if you want the database loaded: 
     
    2525                // Load validation 
    2626                $this->validation = new Validation(); 
     27 
     28                // Set title 
     29                is_null($title) or $this->title($title); 
     30 
     31                // Set action 
     32                is_null($action) or $this->action($action); 
     33 
     34                // Set inputs 
     35                is_array($inputs) and $this->inputs($inputs); 
    2736        } 
    2837