class FrxSection in Forena Reports 8
Hierarchy
- class \Drupal\forena\Template\TemplateBase implements TemplateInterface uses FrxAPI
- class \Drupal\forena\Template\FrxSection
Expanded class hierarchy of FrxSection
1 string reference to 'FrxSection'
- forena_forena_controls in ./
forena.module - Self register controls with forena.
File
- src/
FrxPlugin/ Template/ FrxSection.php, line 6
Namespace
Drupal\forena\TemplateView source
class FrxSection extends TemplateBase {
public $templateName = 'Section';
public $lastClass = '';
private $template = <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE root [
<!ENTITY nbsp " ">
]>
<html xmlns:frx="urn:FrxReports">
<head>
<body>
<div class="FrxSection">
{template}
</div>
</body>
</html>
EOF;
/**
* [@inheritdoc}
*/
public function scrapeConfig(\SimpleXMLElement $xml) {
// Simple section template
$template = $this
->innerXML($xml);
$this->configuration['template'] = $template;
}
/**
* Generate configuration.
*/
public function configForm() {
$config = $this->configuration;
$form['sections'] = array(
'#theme' => 'forena_element_draggable',
'#draggable_id' => 'FrxContainer-sections',
);
if (isset($config['sections'])) {
foreach ($config['sections'] as $id => $section) {
$ctl = array();
$ctl['id'] = array(
'#type' => 'item',
'#markup' => $id,
'#title' => 'id',
);
$ctl['markup'] = array(
'#type' => 'value',
'#value' => $section['markup'],
);
$ctl['class_label'] = array(
'#type' => 'item',
'#markup' => @$section['class'],
'#title' => t('Type'),
);
$ctl['class'] = array(
'#type' => 'value',
'#value' => @$section['class'],
);
// $ctl['display'] = array('#type' => 'item', '#title' => 'html', '#markup' =>$section['markup']);
$form['sections'][$id] = $ctl;
}
}
return $form;
}
/**
* Validate the configuration
*/
public function configValidate(&$config) {
}
/**
* Build document from the existing template.
* @param $xml
* @param $config
* @return string
* Report fragment.
*/
public function generate() {
$doc = new XML();
$this
->pushData($this->configuration, '_template');
$report = new Report($this->template, $doc);
$report
->render();
$text = $doc
->flush();
$xml = new \SimpleXMLElement($text);
return $this
->innerXML($xml);
}
}
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. | |
FrxSection:: |
public | property | ||
FrxSection:: |
private | property | ||
FrxSection:: |
public | property | ||
FrxSection:: |
public | function | Generate configuration. | |
FrxSection:: |
public | function | Validate the configuration | |
FrxSection:: |
public | function |
Build document from the existing template. Overrides TemplateInterface:: |
|
FrxSection:: |
public | function |
[@inheritdoc} Overrides TemplateInterface:: |
|
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:: |