summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormetzlerd2013-05-31 23:42:43 (GMT)
committer metzlerd2013-05-31 23:42:43 (GMT)
commit3ca213811b07caa49e0239387244a74b4b3f9889 (patch)
tree9e0936df377879c32f888419359a6019f3f2cdaa
parentdbbeba40366ef5a52f09ecb026b4ccba709341be (diff)
Added support for frx:invalid_link. Which will validate links and
render them as not text, remove them or otherwise.
-rwxr-xr-xFrxEditor.inc2
-rwxr-xr-xFrxReport.inc12
-rw-r--r--repos/reports/help/design.frx18
3 files changed, 27 insertions, 5 deletions
diff --git a/FrxEditor.inc b/FrxEditor.inc
index 1941662..7ef0fbb 100755
--- a/FrxEditor.inc
+++ b/FrxEditor.inc
@@ -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;
diff --git a/FrxReport.inc b/FrxReport.inc
index d1ee3f9..5667159 100755
--- a/FrxReport.inc
+++ b/FrxReport.inc
@@ -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)
diff --git a/repos/reports/help/design.frx b/repos/reports/help/design.frx
index 860bd53..866ff33 100644
--- a/repos/reports/help/design.frx
+++ b/repos/reports/help/design.frx
@@ -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