Commit 91944338 authored by metzlerd's avatar metzlerd
Browse files

Added types to role parameters as example.

Fixed role report to not throw entity error. 
Fixed translation of roles to make sure raw keys were formatted. 
parent 679a66c6
......@@ -376,7 +376,6 @@ class FrxReport {
$class = '';
$rel = '';
if ($this->fields) {
$path = 'frx:field[@id="' . $key . '"]';
$formatters = $this->fields->xpath($path);
if ($formatters) foreach ($formatters as $formatter) {
......
......@@ -57,6 +57,7 @@ class FrxSyntaxEngine {
*/
protected function get_value( $key, $raw=FALSE) {
$context = '';
$raw_key = $key;
if ($key && strpos($key, '.')) {
@list($context, $key) = explode('.', $key, 2);
$o = Frx::Context($context);
......@@ -65,8 +66,9 @@ class FrxSyntaxEngine {
$o = Frx::Data();
}
$value = $o->getValue($key, $context);
if (!$raw && $this->formatter)
$value = trim($this->formatter->format($value, $key));
if (!$raw && $this->formatter) {
$value = trim($this->formatter->format($value, $raw_key));
}
return $value;
}
......
......@@ -55,7 +55,6 @@ class FrxDrupal extends FrxDataSource {
* loadEntitys method
*/
if (@$options['entity_type'] && @$options['entity_id'] ) {
$id_key = $options['entity_id'];
$type = $options['entity_type'];
$id = $data->$id_key;
......
--ACCESS=administer permissions
SELECT * FROM {role_permission} p
WHERE p.rid=:role
\ No newline at end of file
WHERE p.rid=:role
--INFO
type[role]=int
\ No newline at end of file
--ACCESS=administer content
SELECT * FROM node
ORDER BY sticky DESC, created
LIMIT COALESCE(CAST(:limit AS integer), 100)
\ No newline at end of file
LIMIT :limit, 100
--INFO
type[limit] = int
\ No newline at end of file
--ACCESS=access content
select name as role from {users_roles} ur JOIN role r ON r.rid = ur.rid
WHERE ur.uid = :current_user
\ No newline at end of file
WHERE ur.uid = :current_user
--INFO
type[current_user] = int
\ No newline at end of file
--ACCESS=administer users
SELECT u.uid,u.name FROM {role} r JOIN {users_roles} ur ON r.rid=ur.rid
JOIN users u ON ur.uid=u.uid
WHERE r.rid = :role
\ No newline at end of file
WHERE r.rid = :role
--INFO
type[role]=int
\ No newline at end of file
......@@ -3,7 +3,7 @@
<head>
<title>Roles</title>
<frx:category>Drupal Administration</frx:category>
<frx:options hidden="0" form="" />
<frx:options hidden="0"/>
<frx:parameters>
<frx:parm id="role" label="" require="0" value="" desc=""
data_source="drupal/roles" data_field="" type="select" />
......@@ -11,12 +11,11 @@
<frx:docgen>
</frx:docgen>
<frx:fields>
<frx:field id="name" link="user/{uid}/edit" />
<frx:field id="user.name" link="user/{uid}/edit" />
</frx:fields>
</head>
<body>
<div frx:block="drupal/roles" id="forena-1"
frx:clause="where rid=:role">
<div frx:block="drupal/roles" id="forena-1">
<table frx:foreach="*" id="forena-2">
<tbody>
<tr>
......@@ -38,8 +37,8 @@
</tr>
</thead>
<tbody>
<tr id="forena-4" frx:foreach="*">
<td>{name}</td>
<tr id="user" frx:foreach="*">
<td>{user.name}</td>
</tr>
</tbody>
</table>
......
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