abstract class TemplateBase in Forena Reports 8
Hierarchy
- class \Drupal\forena\Template\TemplateBase implements TemplateInterface uses FrxAPI
Expanded class hierarchy of TemplateBase
1 file declares its use of TemplateBase
- ReportEditor.php in src/
Editor/ ReportEditor.php - ReportEditor.inc Wrapper XML class for working with DOM object. It provides helper Enter description here ... @author metzlerd
File
- src/
FrxPlugin/ Template/ TemplateBase.php, line 16 - FrxRenderer.php Base class for FrxAPI custom Renderer @author davidmetzler
Namespace
Drupal\forena\TemplateView source
abstract class TemplateBase implements TemplateInterface {
use FrxAPI;
/** @var array Confiuration of template */
public $configuration;
public $name;
public $id;
public $columns;
public $numeric_columns;
public $xmlns = 'urn:FrxReports';
public function configure($config) {
$this->configuration = $config;
}
/**
* Return the inside xml of the current node
* @param \SimpleXMLElement $xml
* XML Node of report containing block.
* @return string
* String representation of node children.
*/
public function innerXML(\SimpleXMLElement $xml) {
$tag = $xml
->getName();
$text = '';
if (is_object($xml) && is_object($xml->{$tag})) {
$text = $xml
->asXML();
$text = preg_replace("/<\\/?" . $tag . "(.|\\s)*?>/", "", $text);
}
return $text;
}
/**
* Extract a list of columns from the data context.
* @param \SimpleXMLElement $xml The xml data
* @param string $path
* Xpath used to determine the columns
* @return array
* Data columns or fields found in data.
*/
public function columns(\SimpleXMLElement $xml, $path = '/*/*') {
//create an array of columns
if (!is_object($xml)) {
return array();
}
// Use xpath if possible otherwise iterate.
if (method_exists($xml, 'xpath')) {
$rows = $xml
->xpath($path);
}
else {
$rows = $xml;
}
$column_array = array();
$numeric_columns = array();
foreach ($rows as $columns) {
foreach ($columns as $name => $value) {
$label = str_replace('_', ' ', $name);
$column_array[$name] = $label;
if (is_numeric((string) $value)) {
$numeric_columns[$name] = $label;
}
else {
if (isset($numeric_columns[$name])) {
unset($numeric_columns[$name]);
}
}
}
if (is_object($xml) && method_exists($xml, 'attributes')) {
foreach ($xml
->attributes() as $name => $value) {
$column_array['@' . $name] = '@' . $name;
}
}
}
$this->columns = $column_array;
$this->numeric_columns = $numeric_columns;
return $column_array;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FrxAPI:: |
public | function | Returns containing application service | |
FrxAPI:: |
public | function | Get the current data context. | |
FrxAPI:: |
public | function | ||
FrxAPI:: |
public | function | Returns the data manager service | |
FrxAPI:: |
public | function | Return Data Service | |
FrxAPI:: |
public | function | Returns the fornea document manager | |
FrxAPI:: |
public | function | Report an error | |
FrxAPI:: |
public | function | Get the context of a specific id. | |
FrxAPI:: |
public | function | Get the current document | |
FrxAPI:: |
public | function | Load the contents of a file in the report file system. | |
FrxAPI:: |
public | function | Pop data off of the stack. | |
FrxAPI:: |
public | function | Push data onto the Stack | |
FrxAPI:: |
public | function | Run a report with a particular format. | 1 |
FrxAPI:: |
public | function | Get the current report file system. | |
FrxAPI:: |
public | function | Set Data context by id. | |
FrxAPI:: |
public | function | Change to a specific document type. | |
FrxAPI:: |
public | function | Get list of skins. | |
TemplateBase:: |
public | property | ||
TemplateBase:: |
public | property | @var array Confiuration of template | |
TemplateBase:: |
public | property | ||
TemplateBase:: |
public | property | ||
TemplateBase:: |
public | property | ||
TemplateBase:: |
public | property | ||
TemplateBase:: |
public | function | Extract a list of columns from the data context. | |
TemplateBase:: |
public | function |
Overrides TemplateInterface:: |
|
TemplateBase:: |
public | function |
Return the inside xml of the current node Overrides FrxAPI:: |
|
TemplateInterface:: |
public | function | 8 | |
TemplateInterface:: |
public | function | 8 |