Skip to content

Commit

Permalink
fixed: cdd join rendered as radio list or checkbox list. Any HTML in …
Browse files Browse the repository at this point in the history
…the concat label option was being inserted as text
  • Loading branch information
pollen8 committed Mar 23, 2015
1 parent 5165a5f commit 5b4e5c7
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 51 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 4 additions & 17 deletions plugins/fabrik_element/cascadingdropdown/cascadingdropdown.php
Expand Up @@ -50,7 +50,6 @@ public function elementJavascript($repeatCounter)
$app = JFactory::getApplication();
$input = $app->input;
$id = $this->getHTMLId($repeatCounter);
$app = JFactory::getApplication();
$params = $this->getParams();

if ($this->getDisplayType() === 'auto-complete')
Expand Down Expand Up @@ -183,12 +182,9 @@ protected function _resetCache()

public function render($data, $repeatCounter = 0)
{
$app = JFactory::getApplication();
$input = $app->input;
$db = $this->getDb();
$app = JFactory::getApplication();
$params = $this->getParams();
$element = $this->getElement();
$name = $this->getHTMLName($repeatCounter);
$opts = array('raw' => 1);
$default = (array) $this->getValue($data, $repeatCounter, $opts);
Expand Down Expand Up @@ -350,8 +346,6 @@ protected function renderDescription(&$html, $default)

public function isJoin()
{
$params = $this->getParams();

if (in_array($this->getDisplayType(), array('checkbox', 'multilist')))
{
return true;
Expand Down Expand Up @@ -406,7 +400,6 @@ public function onAjax_getOptions()
$input = $app->input;
$filterview = $app->input->get('filterview', '');
$this->loadMeForAjax();
$params = $this->getParams();

/**
* $$$ hugh -added test for $filterview, and only do filtery stuff if we are being
Expand Down Expand Up @@ -480,7 +473,6 @@ protected function _replaceAjaxOptsWithDbJoinOpts(&$opts)

if ($fullName == $watch)
{
$element = $elementModel->getElement();
/**
* $$$ hugh - not sure what this is for, but changed class name to 3.x name,
* as it was still set to the old 2.1 naming.
Expand Down Expand Up @@ -652,7 +644,6 @@ protected function showPleaseSelect()

protected function getWatchFullName()
{
$listModel = $this->getlistModel();
$elementModel = $this->getWatchElement();

return $elementModel->getFullName();
Expand All @@ -668,7 +659,6 @@ protected function getWatchFullName()

protected function getWatchId($repeatCounter = 0)
{
$listModel = $this->getlistModel();
$elementModel = $this->getWatchElement();

return $elementModel->getHTMLId($repeatCounter);
Expand Down Expand Up @@ -740,7 +730,6 @@ protected function buildQuery($data = array(), $incWhere = true, $opts = array()
}

$params = $this->getParams();
$element = $this->getElement();
$watch = $this->getWatchFullName();
$whereval = null;
$groups = $this->getForm()->getGroupsHiarachy();
Expand Down Expand Up @@ -1059,7 +1048,7 @@ protected function getDbName()

if ($id == '')
{
JError::raiseWarning(500, 'Unable to get table for cascading dropdown (ignore if creating a new element)');
throw new RuntimeException('Unable to get table for cascading dropdown (ignore if creating a new element)');

return false;
}
Expand All @@ -1086,7 +1075,6 @@ protected function getDbName()

public function filterJS($normal, $container)
{
$params = $this->getParams();
$element = $this->getElement();
$observerid = $this->getWatchId();
$observerid .= 'value';
Expand All @@ -1097,7 +1085,6 @@ public function filterJS($normal, $container)
if ($element->filter_type == 'dropdown')
{
$default = $this->getDefaultFilterVal($normal);
$observed = $this->_getObserverElement();
$filterid = $this->getHTMLId() . 'value';
FabrikHelperHTML::script('plugins/fabrik_element/cascadingdropdown/filter.js');
$opts = new stdClass;
Expand Down Expand Up @@ -1221,6 +1208,8 @@ public function getValidationWatchElements($repeatCounter)
*
* @param array $elementMap copied element ids (keyed on original element id)
*
* @throws RuntimeException
*
* @return mixed JError:void
*/

Expand All @@ -1233,7 +1222,7 @@ public function finalCopyCheck($elementMap)

if (!array_key_exists($oldObeserveId, $elementMap))
{
JError::raiseWarning(E_ERROR, 'cascade dropdown: no id ' . $oldObeserveId . ' found in ' . implode(",", array_keys($elementMap)));
throw new RuntimeException('cascade dropdown: no id ' . $oldObeserveId . ' found in ' . implode(",", array_keys($elementMap)));
}

$newObserveId = $elementMap[$oldObeserveId];
Expand Down Expand Up @@ -1272,7 +1261,6 @@ public function getFixedChildParameters()

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

Expand Down Expand Up @@ -1315,7 +1303,6 @@ protected function quoteLabel()

protected function buildFilterJoin()
{
$params = $this->getParams();
$joinTable = FabrikString::safeColName($this->getDbName());
$join = $this->getJoin();
$joinTableName = FabrikString::safeColName($join->table_join_alias);
Expand Down
3 changes: 2 additions & 1 deletion plugins/fabrik_element/cascadingdropdown/filter-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5b4e5c7

Please sign in to comment.