Popup form in CDD field

rha2000

Member
Hello

Need to add a popup form in a cdd field.

The "databasejoin" field allows you to add pop-up form; but not for the "cdd" field.

Then, take the file code "databasejoin.php"; and modify the "cascadedropdown.php" file and adapting it I run; fails but the form is displayed in a popup window.

Add this code at line 288 of cascadedropdown.php:
// code add
JText::script('PLG_ELEMENT_DBJOIN_ADD');
$popupform = (int) $params->get('cascadingdropdown_table');
$addURL = 'index.php?option=com_fabrik';
$addURL .= $app->isAdmin() ? '&task=form.view' : '&view=form';
$addURL .= '&tmpl=component&ajax=1&formid=' . $popupform;
$html[] = '<a href="' . $addURL . '" title="' . FText::_('COM_FABRIK_ADD') . '" class="toggle-addoption btn">';
$html[] = FabrikHelperHTML::image('plus.png', 'form', @$this->tmpl, array('alt' => FText::_('COM_FABRIK_SELECT'))) . '</a>';

Any idea why the form does not open in a popup window?

Thanks
 
hi,

1) If you are directly copying from one form PHP file to another.. your changes will be wiped out on the next Fabrik update. You should use overrides if you really need to do that.
2) You say "...but the form is displayed in a popup window" and then say it is not - which is it?
3) Are you trying to get a popup when adding options to one or more of the cascading dropdowns? If so I believe those are only in the front end and your code is saying backend ($app->isAdmin())
 
Hello

1) Ok.
2) I mean that if the field is "databasejoin" yes popup form opens; but "cascadingdropbox" fields no way to open popup form.
3) Yes. In principle, I am interested in finding a solution to the backend.

To be more clear:
consulta.png

"Area" is databasejoin and I add the button to pop-up forms. But for "Discipline" and "subdiscipline" how do I add the button to pop forms?
The following code allows me to show the button to pop-up form:
JText::script('PLG_ELEMENT_DBJOIN_ADD');
$popupform = (int) $params->get('cascadingdropdown_table');
$addURL = 'index.php?option=com_fabrik';
$addURL .= $app->isAdmin() ? '&amp;task=form.view' : '&amp;view=form';
$addURL .= '&amp;tmpl=component&amp;ajax=1&amp;formid=' . $popupform;
$html[] = '<a href="' . $addURL . '" title="' . FText::_('COM_FABRIK_ADD') . '" class="toggle-addoption btn">';
$html[] = FabrikHelperHTML::image('plus.png', 'form', @$this->tmpl, array('alt' => FText::_('COM_FABRIK_SELECT'))) . '</a>';
The code was taken from databasejoin.php, and modify the following line of code
$popupform = (int) $params->get('databasejoin_popupform');
was replaced by
$popupform = (int) $params->get('cascadingdropdown_table');
this way I get to the table field cdd.
Add this code at line 288 of cascadedropdown.php.
In short, with this code the "+" button to "Discipline" and "subdiscipline" is displayed; but does not open the pop-up form.
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top