Skip to content

Commit

Permalink
fixed: display element in details view was not using its "show label"…
Browse files Browse the repository at this point in the history
… option
  • Loading branch information
pollen8 committed Jan 24, 2014
1 parent 2a66b45 commit 81bdd48
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
13 changes: 12 additions & 1 deletion components/com_fabrik/models/element.php
Expand Up @@ -2032,6 +2032,17 @@ public function copyRow($id, $copytxt = 'Copy of %s', $groupid = null, $name = n
return $rule;
}

/**
* Get the element's raw label (used for details view, not wrapped in <label> tags
*
* @return string Label
*/

protected function getRawLabel()
{
return $this->element->label;
}

/**
* This was in the views display and _getElement code but seeing as its used
* by multiple views its safer to have it here
Expand Down Expand Up @@ -2095,7 +2106,7 @@ public function preRender($c, $elCount, $tmpl)
// Ensure that view data property contains the same html as the group's element

$model->tmplData[$elHTMLName] = $element->element;
$element->label_raw = $this->element->label;
$element->label_raw = $this->getRawLabel();

// GetLabel needs to know if the element is editable
if ($elementTable->name != $this->_foreignKey)
Expand Down
16 changes: 16 additions & 0 deletions plugins/fabrik_element/display/display.php
Expand Up @@ -65,11 +65,27 @@ public function getLabel($repeatCounter = 0, $tmpl = '')
if (!$params->get('display_showlabel', true))
{
$element->label = $this->getValue(array());
$element->label_raw = $element->label;
}

return parent::getLabel($repeatCounter, $tmpl);
}

/**
* Get the element's raw label (used for details view, not wrapped in <label> tags
*
* @return string Label
*/
protected function getRawLabel()
{
if (!$this->getParams()->get('display_showlabel', true))
{
return $this->getValue(array());;
}

return parent::getRawLabel();
}

/**
* Shows the data formatted for the list view
*
Expand Down

0 comments on commit 81bdd48

Please sign in to comment.