- Timestamp:
- 09/26/09 09:40:51 (3 years ago)
- Location:
- trunk/trax/vendor/trax
- Files:
-
- 5 modified
-
action_mailer.php (modified) (1 diff)
-
action_view/helpers/active_record_helper.php (modified) (1 diff)
-
active_record.php (modified) (8 diffs)
-
session.php (modified) (1 diff)
-
trax.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/trax/vendor/trax/action_mailer.php
r326 r327 219 219 $this->template_path = "{$this->template_root}/".Inflector::underscore(get_class($this)); 220 220 $this->template = $this->template ? $this->template : $method_name; 221 $this->headers = $this->headers ? $this->headers : array(); 222 $this->body = $this->body ? $this->body : array(); 221 #$this->headers = $this->headers ? $this->headers : array(); 222 $this->headers = array(); 223 #$this->body = $this->body ? $this->body : array(); 224 $this->body = null; 223 225 $this->default_from = "nobody@".($_SERVER['HTTP_HOST'] ? $_SERVER['HTTP_HOST'] : 'domain.com'); 224 226 $this->head_charset = $this->head_charset ? $this->head_charset : $this->default_charset; -
trunk/trax/vendor/trax/action_view/helpers/active_record_helper.php
r316 r327 729 729 } 730 730 $end = $object->rows_per_page * $object->page; 731 $start = $end - ($object->rows_per_page - 1); 731 $start = $end - ($object->rows_per_page - 1); 732 732 if($end >= $object->pagination_count) { 733 733 $end = $object->pagination_count; 734 } 734 } 735 735 736 736 return $object->pagination_count ? sprintf($format, $start, $end, $object->pagination_count) : null; -
trunk/trax/vendor/trax/active_record.php
r315 r327 1041 1041 if(@array_key_exists("foreign_key", $parameters)) { 1042 1042 $foreign_key = $parameters['foreign_key']; 1043 } 1043 } 1044 if(@array_key_exists("primary_key", $parameters)) { 1045 $other_primary_key = $parameters['primary_key']; 1046 } 1044 1047 if(@array_key_exists("class_name", $parameters)) { 1045 1048 $other_object_name = $parameters['class_name']; … … 1052 1055 $other_class_object = new $other_class_name(); 1053 1056 1054 # This class primary key 1055 $other_primary_key = $other_class_object->primary_keys[0]; 1057 # This class primary key 1058 if(!$other_primary_key) { 1059 $other_primary_key = $other_class_object->primary_keys[0]; 1060 } 1056 1061 1057 1062 if(!$foreign_key) { … … 1118 1123 #echo "$aggregate_type sql:$sql<br>"; 1119 1124 //print_r($parameters[0]); 1120 //echo $sql; 1125 //echo $sql; 1126 #error_log("$aggregate_type:$sql"); 1121 1127 $rs = $this->query($sql, true); 1122 1128 $row = $rs->fetchRow(); … … 1455 1461 1456 1462 # Test source of SQL for query 1457 if(stristr($conditions, "SELECT ")) { 1458 # SQL completely specified in argument so use it as is 1459 $sql = $conditions; 1460 } 1461 else { 1463 if(stristr($conditions, "SELECT ")) { 1464 # SQL completely specified in argument so use it as is 1465 $sql = $conditions; 1466 } else { 1462 1467 1463 1468 # If select fields not specified just do a SELECT * … … 1483 1488 } elseif(array_key_exists('conditions', $this->default_scope) 1484 1489 && !is_null($this->default_scope['conditions'])) { 1485 $sql .= "WHERE ".$this->default_scope['conditions']." "; 1490 $conditions = $this->default_scope['conditions']; 1491 $sql .= "WHERE {$conditions} "; 1486 1492 } 1487 1493 … … 1542 1548 } 1543 1549 1544 $sql .= "LIMIT {$this->rows_per_page} OFFSET {$offset}"; 1545 # $sql .= "LIMIT $offset, $this->rows_per_page"; 1546 1547 if($paginate) { 1548 #error_log("I am going to paginate."); 1549 # Set number of total pages in result set 1550 if($count = $this->count_all($this->primary_keys[0], $conditions, $joins)) { 1550 if($paginate) { 1551 #error_log("pagination sql:$sql"); 1552 $pagination_rs = $this->query($sql); 1553 if($count = $pagination_rs->numRows()) { 1551 1554 $this->pagination_count = $count; 1552 1555 $this->pages = (($count % $this->rows_per_page) == 0) 1553 1556 ? $count / $this->rows_per_page 1554 1557 : floor($count / $this->rows_per_page) + 1; 1555 } 1556 } 1558 } 1559 /* 1560 #error_log("I am going to paginate."); 1561 # Set number of total pages in result set 1562 $count_all_params = array( 1563 'conditions' => $conditions, 1564 'joins' => $joins, 1565 'group' => $group, 1566 'having' => $having 1567 ); 1568 1569 if($count = $this->count_all($this->primary_keys[0], $count_all_params)) { 1570 $this->pagination_count = $count; 1571 $this->pages = (($count % $this->rows_per_page) == 0) 1572 ? $count / $this->rows_per_page 1573 : floor($count / $this->rows_per_page) + 1; 1574 } 1575 */ 1576 } 1577 1578 $sql .= "LIMIT {$this->rows_per_page} OFFSET {$offset}"; 1579 # $sql .= "LIMIT $offset, $this->rows_per_page"; 1580 1557 1581 } 1558 1582 } … … 1636 1660 } 1637 1661 # If callback is defined in model run it. 1638 # this will probably hurt performance... 1639 if(method_exists($object, 'after_find')) { 1662 # this will probably hurt performance... 1663 if(method_exists($object, 'after_find')) { 1640 1664 $object->after_find(); 1641 } 1665 } elseif(isset($this->after_find) && method_exists($object, $this->after_find)) { 1666 $object->{$this->after_find}(); 1667 } 1642 1668 unset($object); 1643 1669 } … … 1955 1981 $this->raise($primary_key_value->getMessage()); 1956 1982 } 1957 $this->$primary_key = $primary_key_value; 1983 $this->$primary_key = $primary_key_value; 1984 $this->new_record = false; 1958 1985 if($primary_key_value != '') { 1959 1986 if($this->auto_save_habtm) { -
trunk/trax/vendor/trax/session.php
r316 r327 98 98 Trax::$session_maxlifetime_minutes = Trax::$session_maxlifetime_minutes ? Trax::$session_maxlifetime_minutes : self::TRAX_SESSION_MAXLIFETIME_MINUTES; 99 99 100 # set the session default for this app 100 # set the session default for this app 101 101 ini_set('session.name', Trax::$session_name); 102 ini_set('session.use_cookies', 1); 102 ini_set('session.use_cookies', 1); 103 if(Trax::$session_cookie_domain) { 104 ini_set('session.cookie_domain', Trax::$session_cookie_domain); 105 } 103 106 ini_set('session.cookie_lifetime', Trax::$session_lifetime); 104 107 ini_set('session.gc_probability', 1); -
trunk/trax/vendor/trax/trax.php
r325 r327 65 65 $session_save_path = "", 66 66 $session_name = "TRAXSESSID", 67 $session_cookie_domain = null, 67 68 $session_lifetime = "0", 68 69 $session_maxlifetime_minutes = "20",
