class FrxSection in Forena Reports 7.4
Hierarchy
- class \FrxRenderer
- class \FrxSection
Expanded class hierarchy of FrxSection
1 string reference to 'FrxSection'
- forena_forena_controls in ./
forena.module - Self register controls with forena.
File
- renderers/
FrxSection.inc, line 2
View source
class FrxSection extends FrxRenderer {
public $templateName = 'Section';
public $lastClass = '';
/**
* oull configs.
*/
public function scrapeConfig() {
$content = array();
// Determine if we are starting from a dom node
$sec = 0;
$config['sections'] = array();
// put the divs in next
$nodes = $this->reportDocNode
->xpath('div');
if ($nodes) {
foreach ($nodes as $node) {
$dom_node = dom_import_simplexml($node);
$sec++;
$id = (string) @$node['id'] ? (string) $node['id'] : 'section-' . $sec;
$config['sections'][$id] = array(
'id' => $id,
'markup' => $node
->asXML(),
'class' => @(string) $node['class'] ? (string) $node['class'] : 'FrxMergeDocument',
'weight' => $sec,
);
}
}
return $config;
}
/**
* Generate configuration.
*/
public function configForm($config) {
$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 the template
* @param $xml
* @param $config
*/
public function generate($xml, &$config) {
if (!isset($config['sections']) || !count($config['sections'])) {
$class = @$config['class'];
$frx = '';
if (!$class || $class == 'FrxMergeDocument') {
$frx = isset($config['foreach']) ? ' frx:foreach="' . $config['foreach'] . '"' : ' frx:foreach="*"';
}
$id = isset($config['id']) ? $config['id'] : 'section-1';
$id .= '-' . strtolower(str_replace('Frx', '', $class));
$o = "<div id='{$id}' class='{$class}'{$frx}>";
foreach (array(
'header',
'content',
'footer',
) as $content) {
if (isset($config[$content]['value']) && trim($config[$content]['value'])) {
$o .= $config[$content]['value'];
}
}
$o .= '</div>';
$config['sections'][$id] = array(
'id' => $id,
'markup' => $o,
'class' => $class,
'weight' => 1,
);
}
$config['class'] = get_class($this);
$div = $this
->blockDiv($config);
$this
->removeChildren($div);
if (isset($config['sections'])) {
foreach ($config['sections'] as $id => $section) {
$this
->addFragment($div, $section['markup']);
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FrxRenderer:: |
public | property | ||
FrxRenderer:: |
public | property | ||
FrxRenderer:: |
public | property | ||
FrxRenderer:: |
public | property | ||
FrxRenderer:: |
public | property | ||
FrxRenderer:: |
public | property | ||
FrxRenderer:: |
public | property | ||
FrxRenderer:: |
public | property | ||
FrxRenderer:: |
public | property | @var FrxReport | |
FrxRenderer:: |
public | property | ||
FrxRenderer:: |
public | property | ||
FrxRenderer:: |
public | property | ||
FrxRenderer:: |
public | property | ||
FrxRenderer:: |
public | property | ||
FrxRenderer:: |
public | property | ||
FrxRenderer:: |
public | property | ||
FrxRenderer:: |
public | property | ||
FrxRenderer:: |
public | property | ||
FrxRenderer:: |
public | property | ||
FrxRenderer:: |
public static | function | Helper function for convergint methods to a standard associated array. | |
FrxRenderer:: |
function | Append a textual XHTML fragment to the dom. We do not use the DOMDocumentFragment optioin because they don't properly import namespaces. . | ||
FrxRenderer:: |
function | Add a node to the existing dom element with attributes | ||
FrxRenderer:: |
function | Add a text node to the current dom node. | ||
FrxRenderer:: |
public | function | Puts attributes back in array format prior to rendering. | |
FrxRenderer:: |
public | function | Generate generic div tag. | |
FrxRenderer:: |
public | function | Extract a list of columns from the data context. | |
FrxRenderer:: |
public | function | Generate ajax configuration attributes for use in template configurtion forms. | |
FrxRenderer:: |
public | function | Render a drupal form in a forena template | |
FrxRenderer:: |
public | function | Extract a configuration var removing it from the array | |
FrxRenderer:: |
public | function | Get the textual representations of html for the configuration engine. | |
FrxRenderer:: |
public | function | Get the textual representations of html for the configuration engine. | |
FrxRenderer:: |
public | function | Get the textual representations of html for the configuration engine. | |
FrxRenderer:: |
public | function | Extracts the inner html of all nodes that match a particular xpath expression. | |
FrxRenderer:: |
public | function | Extracts the inner html of all nodes that match a particular xpath expression. | |
FrxRenderer:: |
public | function | Simple function to get id from node. | |
FrxRenderer:: |
public | function | This function is called to give the renderer the current conetxt in report rendering. It makes sure the renderer has the current DOM nodes dom documnent, and other attributes. | |
FrxRenderer:: |
public | function | Return the inside xml of the current node | |
FrxRenderer:: |
public | function | Standard php array containing merged attributes Enter description here ... | |
FrxRenderer:: |
public | function | Rmove all the children of a dom node in the current report. | |
FrxRenderer:: |
public | function | Removes all chidren from the dome node expect those with a tagname specified by the the $tags argurment | |
FrxRenderer:: |
public | function | Default Render action, which simply does normal forena rendering. You can use renderDomNode at any time to generate the default forena rendering methods. | 9 |
FrxRenderer:: |
public | function | ||
FrxRenderer:: |
public | function | Recursive report renderer Walks the nodes rendering the report. | |
FrxRenderer:: |
public | function | Gives the token replaced attributes of a node. | |
FrxRenderer:: |
public | function | A helper function to allow replacement of tokens from inside a renderer wihout needing to understand the object | |
FrxRenderer:: |
public | function | Starting at the current report node, this function removes all child nodes. It aso removes any FRX attributes on the current as well. | |
FrxRenderer:: |
public | function | Set FRX attributes. | |
FrxRenderer:: |
public | function | Sets the first child element to a node and returns it. IF the node | |
FrxRenderer:: |
public | function | Helper funciton for validating text_format type controls. | |
FrxRenderer:: |
public | function | Sort a column list by weight. | |
FrxRenderer:: |
public static | function | ||
FrxRenderer:: |
public | function | Convert XML to key value pairs. This is used in support of graping to get specific key/value pairs in an array format suitable for passing off to php libraries. | |
FrxRenderer:: |
public | function | 2 | |
FrxSection:: |
public | property | ||
FrxSection:: |
public | property | ||
FrxSection:: |
public | function |
Generate configuration. Overrides FrxRenderer:: |
|
FrxSection:: |
public | function |
Validate the configuration Overrides FrxRenderer:: |
|
FrxSection:: |
public | function |
Build the template Overrides FrxRenderer:: |
|
FrxSection:: |
public | function |
oull configs. Overrides FrxRenderer:: |