Skip to content

Commit

Permalink
Fix for form view of new alt text for Please Select in filter view.
Browse files Browse the repository at this point in the history
  • Loading branch information
cheesegrits committed May 23, 2014
1 parent 5151c41 commit a6faae3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 11 deletions.
18 changes: 15 additions & 3 deletions plugins/fabrik_element/cascadingdropdown/cascadingdropdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -1234,12 +1234,24 @@ public function getFixedChildParameters()
/**
* Get select option label
*
* @param bool $filter get alt label for filter, if present using :: splitter
*
* @return string
*/

protected function _getSelectLabel()
protected function _getSelectLabel($filter = false)
{
return FText::_($this->getParams()->get('cascadingdropdown_noselectionlabel', FText::_('COM_FABRIK_PLEASE_SELECT')));
//return FText::_($this->getParams()->get('cascadingdropdown_noselectionlabel', FText::_('COM_FABRIK_PLEASE_SELECT')));
$params = $this->getParams();
$label = $params->get('cascadingdropdown_noselectionlabel');

if (strstr($label, '::'))
{
$labels = explode('::', $label);
$label = $filter ? $labels[1] : $labels[0];
}

return FText::_($label, FText::_('COM_FABRIK_PLEASE_SELECT'));
}

/**
Expand Down Expand Up @@ -1308,7 +1320,7 @@ public function dataIsNull($data, $val)
protected function filterSelectLabel()
{
$params = $this->getParams();
$label = $params->get('cascadingdropdown_noselectionlabel', '');
$label = $this->_getSelectLabel(true);

if (empty($label))
{
Expand Down
21 changes: 13 additions & 8 deletions plugins/fabrik_element/databasejoin/databasejoin.php
Original file line number Diff line number Diff line change
Expand Up @@ -725,12 +725,22 @@ protected function _getOptions($data = array(), $repeatCounter = 0, $incWhere =
/**
* Get select option label
*
* @param bool $filter get alt label for filter, if present using :: splitter
*
* @return string
*/

protected function _getSelectLabel()
protected function _getSelectLabel($filter = false)
{
return FText::_($this->getParams()->get('database_join_noselectionlabel', FText::_('COM_FABRIK_PLEASE_SELECT')));
$params = $this->getParams();
$label = $params->get('database_join_noselectionlabel');

if (strstr($label, '::'))
{
$labels = explode('::', $label);
$label = $filter ? $labels[1] : $labels[0];
}
return FText::_($label, FText::_('COM_FABRIK_PLEASE_SELECT'));
}

/**
Expand Down Expand Up @@ -2117,13 +2127,8 @@ protected function filterHiddenFields()
protected function filterSelectLabel()
{
$params = $this->getParams();
$label = $params->get('database_join_noselectionlabel');

if (strstr($label, '::'))
{
$labels = explode('::', $label);
$label = FText::_(array_pop($labels));
}
$label = $this->_getSelectLabel(true);

if ($label == '')
{
Expand Down

0 comments on commit a6faae3

Please sign in to comment.