Commit 3ca21381 authored by metzlerd's avatar metzlerd
Browse files

Added support for frx:invalid_link. Which will validate links and

render them as not text, remove them or otherwise. 
parent dbbeba40
......@@ -186,7 +186,7 @@ class FrxEditor {
$tnode = $dom->createTextNode("\n");
$pnode->appendChild($tnode);
foreach ($element_array as $element_data) {
$id = $element_data[$id_field];
$id = @$element_data[$id_field];
$path = '//frx:' . $parent . '/frx:' . $element . '[@' . $id_field . '="' . $id . '"]';
$nodes = $xpq->query($path);
$value = NULL;
......
......@@ -30,7 +30,7 @@ class FrxReport {
public $missing_parms = FALSE;
private $dom;
private $format;
private $link_mode = 'remove';
private $link_mode = '';
public function __construct($xhtml, $data=array()) {
......@@ -343,17 +343,21 @@ class FrxReport {
$l = '';
break;
case 'no-link':
case 'text':
$l = $valid ? l($title, $path, $options) : $title;
break;
case 'disable':
dpm($options);
$options['attributes']['class'][] = 'disabled';
$l = '<a '. drupal_attributes($options['attributes']) . '>' . check_plain($title) . '</a>';
break;
default:
$l = l($title, $path, $options);
}
}
else {
$l = l($title, $path, $options);
}
return $l;
}
/*
......@@ -432,7 +436,7 @@ class FrxReport {
unset($parms['q']);
$data = array_merge($parms, $data);
}
if (trim($url)) $value = FrxReportGenerator::instance()->link(
if (trim($url)) $value = $this->link(
htmlspecialchars_decode($value),
$url,
array('fragment' => $fragment, 'query' => $data, 'attributes' => $attributes, 'absolute' => TRUE)
......
......@@ -71,6 +71,24 @@
This is most commonly used when you want the frx:foreach to not render the node
containing the frx:foreach attribute.
</p>
<p id="invalid-link"><strong>frx:invalid_link attribute</strong>- To cause forena to validate
links prior to presenting them. Supports the following values: </p>
<table >
<tbody>
<tr>
<th>remove</th><td>Remove the feild (do not render it)</td>
</tr>
<tr>
<th>text</th><td>Render the text without the link</td>
</tr>
<tr>
<th>disable</th><td>Disable the link by removeing its href attribute.
This will also add a class="disabled" on the link for css styling.</td>
</tr>
</tbody>
</table>
<h2>Report fields</h2>
<p>Each field in the report is referenced by an xpath expression
enclosed by curly braces. In its simplest form the xpath xpression can
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment