Skip to content
Permalink
Browse files

Now get_sql_sort can be called static-function-imitation style as well.

Necessary to solve SC#187 gracefully.
  • Loading branch information...
defacer
defacer committed Nov 13, 2005
1 parent 0282811 commit 9013e4ad731bf13ffbcaf00c8dd1bbded9d6ae80
Showing with 18 additions and 5 deletions.
  1. +18 −5 lib/tablelib.php
@@ -287,13 +287,26 @@ function setup() {
$this->setup = true;
}
function get_sql_sort() {
if(!$this->setup) {
return false;
function get_sql_sort($uniqueid = NULL) {
if($uniqueid === NULL) {
// "Non-static" function call
if(!$this->setup) {
return false;
}
$sess = &$this->sess;
}
if(!empty($this->sess->sortby)) {
else {
// "Static" function call
global $SESSION;
if(empty($SESSION->flextable[$uniqueid])) {
return '';
}
$sess = &$SESSION->flextable[$uniqueid];
}
if(!empty($sess->sortby)) {
$sortstring = '';
foreach($this->sess->sortby as $column => $order) {
foreach($sess->sortby as $column => $order) {
if(!empty($sortstring)) {
$sortstring .= ', ';
}

0 comments on commit 9013e4a

Please sign in to comment.
You can’t perform that action at this time.