class FrxEmailMerge in Forena Reports 7.4
Same name and namespace in other branches
- 6.2 templates/FrxEmailMerge.inc \FrxEmailMerge
- 7.2 templates/FrxEmailMerge.inc \FrxEmailMerge
- 7.3 templates/FrxEmailMerge.inc \FrxEmailMerge
@file FrxEmailMerge Email merge template.
Hierarchy
- class \FrxRenderer
- class \FrxEmailMerge
Expanded class hierarchy of FrxEmailMerge
1 string reference to 'FrxEmailMerge'
- forena_forena_controls in ./
forena.module - Self register controls with forena.
File
- renderers/
FrxEmailMerge.inc, line 6 - FrxEmailMerge Email merge template.
View source
class FrxEmailMerge extends FrxRenderer {
public $templateName = 'Mail Merge';
public $email_input_format;
public function __construct() {
parent::__construct();
$this->email_input_format = variable_get('forena_email_input_format', filter_default_format());
$this->doc_types = array(
'email',
);
}
public function scrapeConfig() {
$config = array();
$config['class'] = get_class($this);
$config['from'] = html_entity_decode($this
->extractXPathInnerHTML("*//*[@class='email-header-from']", $this->reportDocDomNode));
$config['to'] = html_entity_decode($this
->extractXPathInnerHTML("*//*[@class='email-header-to']", $this->reportDocDomNode));
$config['cc'] = html_entity_decode($this
->extractXPathInnerHTML("*//*[@class='email-header-cc']", $this->reportDocDomNode));
$config['bcc'] = html_entity_decode($this
->extractXPathInnerHTML("*//*[@class='email-header-bcc']", $this->reportDocDomNode));
$config['subject'] = $this
->extractXPathInnerHTML("*//*[@class='email-header-subject']", $this->reportDocDomNode);
$config['body']['value'] = $this
->extractXPathInnerHTML("*//*[@class='email-body']", $this->reportDocDomNode);
return $config;
}
public function configForm($config) {
$form_ctl['from'] = array(
'#type' => 'textfield',
'#title' => t('From'),
'#default_value' => @$config['from'],
);
$form_ctl['to'] = array(
'#type' => 'textfield',
'#title' => t('To'),
'#default_value' => @$config['to'],
);
$form_ctl['cc'] = array(
'#type' => 'textfield',
'#title' => t('Cc'),
'#default_value' => @$config['cc'],
);
$form_ctl['bcc'] = array(
'#type' => 'textfield',
'#title' => t('Bcc'),
'#default_value' => @$config['bcc'],
);
$form_ctl['subject'] = array(
'#type' => 'textfield',
'#title' => t('Subject'),
'#default_value' => @$config['subject'],
);
$form_ctl['body'] = array(
'#type' => 'text_format',
'#title' => t('Message'),
"#format" => $this->email_input_format,
'#default_value' => @$config['body']['value'],
);
return $form_ctl;
}
public function configValidate(&$config) {
$this
->validateTextFormats($config, array(
'body',
));
}
public function generate($xml, &$config) {
$from = @$config['from'];
$to = @$config['to'];
$cc = @$config['cc'];
$bcc = @$config['bcc'];
$subject = @$config['subject'];
$body = @$config['body'];
$body = $body['value'];
$config['foreach'] = "*";
$div = $this
->blockDiv($config);
$this
->removeChildren($div);
$doc = $this
->addNode($div, 4, 'div', NULL, array(
'class' => 'email-document',
));
$header = $this
->addNode($doc, 6, 'div', NULL, array(
'class' => 'email-header',
));
$table = $this
->addNode($header, 8, 'table');
$tr = $this
->addNode($table, 10, 'tr');
$td = $this
->addNode($tr, 12, 'th', 'From');
$td = $this
->addNode($tr, 12, 'td', htmlentities($from, NULL, 'UTF-8'), array(
'class' => 'email-header-from',
));
$tr = $this
->addNode($table, 10, 'tr');
$td = $this
->addNode($tr, 12, 'th', 'To');
$td = $this
->addNode($tr, 12, 'td', htmlentities($to, NULL, 'UTF-8'), array(
'class' => 'email-header-to',
));
if ($cc) {
$tr = $this
->addNode($table, 10, 'tr');
$td = $this
->addNode($tr, 12, 'th', 'Cc');
$td = $this
->addNode($tr, 12, 'td', htmlentities($cc, NULL, 'UTF-8'), array(
'class' => 'email-header-cc',
));
}
if ($bcc) {
$tr = $this
->addNode($table, 10, 'tr');
$td = $this
->addNode($tr, 12, 'th', 'Bcc');
$td = $this
->addNode($tr, 12, 'td', htmlentities($bcc, NULL, 'UTF-8'), array(
'class' => 'email-header-bcc',
));
}
$tr = $this
->addNode($table, 10, 'tr');
$td = $this
->addNode($tr, 12, 'th', 'Subject');
$td = $this
->addNode($tr, 12, 'td', $subject, array(
'class' => 'email-header-subject',
));
$email_body = $this
->addNode($doc, 6, 'div', NULL, array(
'class' => 'email-body',
));
$p = $this
->addFragment($email_body, $body);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FrxEmailMerge:: |
public | property | ||
FrxEmailMerge:: |
public | property | ||
FrxEmailMerge:: |
public | function |
Returns the section
Enter description here ... Overrides FrxRenderer:: |
|
FrxEmailMerge:: |
public | function |
Default configuration validator. Simply validates header and footer attributes. Overrides FrxRenderer:: |
|
FrxEmailMerge:: |
public | function |
Generate the template from the configuration. Overrides FrxRenderer:: |
|
FrxEmailMerge:: |
public | function |
Default method for extracting configuration information from the template.
This just scrapes teh current child html as the template. Overrides FrxRenderer:: |
|
FrxEmailMerge:: |
public | function |
Overrides FrxRenderer:: |
|
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. |