* The FrxData class holds all of the data contexts during the report rendering process.
* The general idea is that during the report render, data objects are pushed on the stack with the id's of the block or foreach objects that invoke them.
* Rendering controls may then get current data contexts, and push data onto the stack or pop data onto the stack. They may also use this method to get the current data
* context from the stack.
*
* The static instance function of this object acts as a factory method that allows other code in forena to always be able to operate on the current context of the class.
* @var unknown_type
*/
require_once('FrxContext.inc');
classFrxDataextendsFrxContext{
public$id;
private$cur_context;// The data of the xml;
private$cur_context_xml;//
private$data_sources=array();
private$data_stack=array();
private$id_stack=array();
/**
* Constructor to initialize drupal site specific settings.
*
*/
publicfunction__construct(){
$site=array();
global$language;
global$user;
global$theme_path;
global$base_root;
$site['base_path']=base_path();
$site['dir']=rtrim(base_path(),'/');
$site['theme_path']=base_path().$theme_path;
$site['theme_dir']=&$theme_path;
$site['base_url']=&$base_root;
$site['user_name']=$user->uid?$user->name:'';
$site['uid']=$user?$user->uid:0;
$site['language']=&$language;
$site['args']=arg();
$site['page']=base_path().$_GET['q'];
$dest=drupal_get_destination();
$site['destination']=$dest['destination'];
$this->setContext('site',$site);
}
// For backward compatibility.
publicstaticfunctioninstance(){
returnFrx::Data();
}
/**
* Return the current data context
*
*/
publicfunctioncurrentContext(){
return$this->cur_context;
}
/**
* Return current context as key value pairs
* Enter description here
*/
publicfunctioncurrentContextArray(){
$data=$this->cur_context;
if(is_array($data)){
return$data;
}
$ret=array();
if(is_object($data)){
// Get attributes
$ret=get_object_vars($data);
if(method_exists($data,'attributes')){
foreach($data->attributes()as$key=>$value){
$ret[$key]=(string)$value;
}
}
}
else{
$ret=(array)$data;
}
return$ret;
}
/**
* Provides an api to the {=xpath} syntax that can be used
* to evaluat expressions such as sum and count in a report. We
* need to use the DOM object here, because this method isn't exposed
* The FrxData class holds all of the data contexts during the report rendering process.
* The general idea is that during the report render, data objects are pushed on the stack with the id's of the block or foreach objects that invoke them.
* Rendering controls may then get current data contexts, and push data onto the stack or pop data onto the stack. They may also use this method to get the current data
* context from the stack.
*
* The static instance function of this object acts as a factory method that allows other code in forena to always be able to operate on the current context of the class.
* @var unknown_type
*/
require_once('FrxContext.inc');
classFrxDataextendsFrxContext{
public$id;
private$cur_context;// The data of the xml;
private$cur_context_xml;//
private$data_sources=array();
private$data_stack=array();
private$id_stack=array();
/**
* Constructor to initialize drupal site specific settings.
*
*/
publicfunction__construct(){
$site=array();
global$language;
global$user;
global$theme_path;
global$base_root;
$site['base_path']=base_path();
$site['dir']=rtrim(base_path(),'/');
$site['theme_path']=base_path().$theme_path;
$site['theme_dir']=&$theme_path;
$site['base_url']=&$base_root;
$site['user_name']=$user->uid?$user->name:'';
$site['uid']=$user?$user->uid:0;
$site['language']=&$language;
$site['args']=arg();
$site['page']=base_path().$_GET['q'];
$dest=drupal_get_destination();
$site['destination']=$dest['destination'];
$this->setContext('site',$site);
}
// For backward compatibility.
publicstaticfunctioninstance(){
returnFrx::Data();
}
/**
* Return the current data context
*
*/
publicfunctioncurrentContext(){
return$this->cur_context;
}
/**
* Return current context as key value pairs
* Enter description here
*/
publicfunctioncurrentContextArray(){
$data=$this->cur_context;
if(is_array($data)){
return$data;
}
$ret=array();
if(is_object($data)){
// Get attributes
$ret=get_object_vars($data);
if(method_exists($data,'attributes')){
foreach($data->attributes()as$key=>$value){
$ret[$key]=(string)$value;
}
}
}
else{
$ret=(array)$data;
}
return$ret;
}
/**
* Provides an api to the {=xpath} syntax that can be used
* to evaluat expressions such as sum and count in a report. We
* need to use the DOM object here, because this method isn't exposed