[svn r18273] minor - logic changes - allow show data correctly with ajax - (partial FS#3383)

skala
Isaac Flores 16 years ago
parent b85c168ee6
commit 52f1378a35
  1. 7
      main/inc/lib/main_api.lib.php
  2. 9
      main/inc/lib/sortabletable.class.php

@ -3121,3 +3121,10 @@ if ( !function_exists('sys_get_temp_dir') )
}
}
}
function api_is_xml_http_request() {
if ($_SERVER['HTTP_X_REQUESTED_WITH']=='XMLHttpRequest') {
return true;
} else {
return false;
}
}

@ -24,6 +24,7 @@
require_once "HTML/Table.php"; //See http://pear.php.net/package/HTML_Table
require_once "Pager/Pager.php"; //See http://pear.php.net/package/Pager
require_once 'tablesort.lib.php';
require_once 'main_api.lib.php';
/**
* This class allows you to display a sortable data-table. It is possible to
* split the data in several pages.
@ -201,7 +202,13 @@ class SortableTable extends HTML_Table
{
$cols = $this->getColCount();
$this->setCellAttributes(1, 0, 'style="font-style: italic;text-align:center;" colspan='.$cols);
$this->setCellContents(1, 0, get_lang('TheListIsEmpty'));
if (api_is_xml_http_request()===true) {
$message_empty=utf8_encode(get_lang('TheListIsEmpty'));
} else {
$message_empty=get_lang('TheListIsEmpty');
}
$this->setCellContents(1, 0,$message_empty);
$empty_table = true;
}
$html='';

Loading…
Cancel
Save