Changeset 32 for trunk/lib/App.inc.php
- Timestamp:
- Dec 11, 2005 7:33:45 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/App.inc.php
r31 r32 81 81 82 82 // For classes that require db tables, do we check that a table exists and create if missing? 83 'db_create_tables' => null,83 'db_create_tables' => true, 84 84 85 85 // The level of error reporting. Don't set this to 0 to suppress messages, instead use display_errors to control display. … … 366 366 $this =& App::getInstance(); 367 367 } 368 369 if (!$this->running) { 368 369 $message = trim($message); 370 371 if (!$this->running || '' == $message) { 370 372 return false; 371 373 } … … 543 545 /** 544 546 * Sets which query arguments will be carried persistently between requests. 545 * Values in the _carry_queries array will be copied to URLs (via oHREF()) and547 * Values in the _carry_queries array will be copied to URLs (via App::url()) and 546 548 * to hidden input values (via printHiddenSession()). 547 549 * … … 566 568 /** 567 569 * Outputs a fully qualified URL with a query of all the used (ie: not empty) 568 * keys and values, including optional queries. This allows simple printing of569 * links without needing to know which queries to add to it. If cookies are not570 * keys and values, including optional queries. This allows mindless retention 571 * of query arguments across page requests. If cookies are not 570 572 * used, the session id will be propogated in the URL. 571 573 * 572 * @param string $url 573 * @param mixed $carry_args 574 * 575 * -array('key1', key2', key3') <-- to save these keys if in the form data.576 * -array('key1'=>'value', key2'='value') <-- to set keys to default values if not present in form data.577 * -false <-- To not carry any queries. If URL already has queries those will be retained.574 * @param string $url The initial url 575 * @param mixed $carry_args Additional url arguments to carry in the query, 576 * or FALSE to prevent carrying queries. Can be any of the following formats: 577 * array('key1', key2', key3') <-- to save these keys if in the form data. 578 * array('key1'=>'value', key2'='value') <-- to set keys to default values if not present in form data. 579 * false <-- To not carry any queries. If URL already has queries those will be retained. 578 580 * 579 581 * @param mixed $always_include_sid Always add the session id, even if using_trans_sid = true. This is required when … … 583 585 * @return string url with attached queries and, if not using cookies, the session id 584 586 */ 585 function oHREF($url='', $carry_args=null, $always_include_sid=false)587 function url($url, $carry_args=null, $always_include_sid=false) 586 588 { 587 589 if (!isset($this) || !is_a($this, 'App')) { … … 617 619 618 620 // Get the first delimiter that is needed in the url. 619 $delim = preg_match('/\?/', $url) ? ini_get('arg_separator.output') : '?'; 621 $delim = strpos($url, '?') !== false ? ini_get('arg_separator.output') : '?'; 622 620 623 621 624 $q = ''; … … 667 670 } 668 671 } 672 673 /** 674 * Returns a HTML-friendly URL processed with App::url and & replaced with & 675 * 676 * @access public 677 * @param string $url Input URL to parse. 678 * @return string URL with App::url() and htmlentities() applied. 679 * @author Quinn Comendant <quinn@strangecode.com> 680 * @since 09 Dec 2005 17:58:45 681 */ 682 function oHREF($url, $carry_args=null, $always_include_sid=false) 683 { 684 if (!isset($this) || !is_a($this, 'App')) { 685 $this =& App::getInstance(); 686 } 687 688 $url = $this->url($url, $carry_args, $always_include_sid); 689 690 // Replace any & not followed by an html or unicode entity with it's & equivalent. 691 $url = preg_replace('/&(?![\w\d#]{1,10};)/', '&', $url); 692 693 return $url; 694 } 669 695 670 696 /** … … 674 700 * @param mixed $carry_args Additional url arguments to carry in the query, 675 701 * or FALSE to prevent carrying queries. Can be any of the following formats: 676 * -array('key1', key2', key3') <-- to save these keys if in the form data.677 * -array('key1'=>'value', key2'='value') <-- to set keys to default values if not present in form data.678 * -false <-- To not carry any queries. If URL already has queries those will be retained.702 * array('key1', key2', key3') <-- to save these keys if in the form data. 703 * array('key1'=>'value', key2'='value') <-- to set keys to default values if not present in form data. 704 * false <-- To not carry any queries. If URL already has queries those will be retained. 679 705 */ 680 706 function printHiddenSession($carry_args=null) 681 { 707 { 682 708 if (!isset($this) || !is_a($this, 'App')) { 683 709 $this =& App::getInstance(); … … 762 788 } 763 789 764 $url = $this-> oHREF($url, $carry_args, $always_include_sid);790 $url = $this->url($url, $carry_args, $always_include_sid); 765 791 766 792 header(sprintf('Location: %s', $url));
Note: See TracChangeset
for help on using the changeset viewer.