Skip to content

Commit

Permalink
Only show plugin options in JCar embed code popup when specific plugi…
Browse files Browse the repository at this point in the history
…n is selected for id. Style id lookup field plugin drop down to match Joomla drop down style.
  • Loading branch information
haydenyoung committed May 11, 2016
1 parent afc48f5 commit 887b909
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
defined('JPATH_BASE') or die;

JHtml::_('jquery.framework');
JHtml::_('formbehavior.chosen', 'select');

$typeahead = JUri::root().'/media/com_jcar/js/typeahead.js/typeahead.bundle.min.js';

Expand Down
10 changes: 9 additions & 1 deletion components/com_jcar/admin/views/item/tmpl/configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

<?php
foreach ($this->form->getFieldset() as $field) :
$classnames = 'control-group';
/*$classnames = 'control-group';
$rel = '';
$showon = $this->form->getFieldAttribute($field->fieldname, 'showon');
Expand All @@ -68,6 +68,8 @@
$showon = explode(':', $showon, 2);
$classnames .= ' showon_'.implode(' showon_', explode(',', $showon[1]));
$rel = ' rel="showon_'.$id.'['.$showon[0].']"';
echo $rel;
endif;
?>
Expand All @@ -82,6 +84,12 @@
</div>
<?php
*/
$html = $field->renderField();

$html = str_replace('"field":"jform[idLookupPlugin]"', '"field":"idLookupPlugin"', $html);

echo $html;
endforeach;
?>

Expand Down
6 changes: 3 additions & 3 deletions plugins/jcar/dspace/forms/configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<field
name="rest_url"
type="text"
showon="plugin:dspace"
showon="idLookupPlugin:dspace"
label="PLG_JCAR_DSPACE_REST_URL_LABEL"
description="PLG_JCAR_DSPACE_REST_URL_DESC"
filter="string"
Expand All @@ -12,7 +12,7 @@
<field
name="rest_key"
type="text"
showon="plugin:dspace"
showon="idLookupPlugin:dspace"
label="PLG_JCAR_DSPACE_REST_KEY_LABEL"
description="PLG_JCAR_DSPACE_REST_KEY_DESC"
filter="string"
Expand All @@ -21,7 +21,7 @@
<field
name="rest_secret"
type="text"
showon="plugin:dspace"
showon="idLookupPlugin:dspace"
label="PLG_JCAR_DSPACE_REST_SECRET_LABEL"
description="PLG_JCAR_DSPACE_REST_SECRET_DESC"
filter="string"
Expand Down
2 changes: 1 addition & 1 deletion plugins/jcar/oai/forms/configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<field
name="oai_url"
type="text"
showon="plugin:oai"
showon="idLookupPlugin:oai"
label="PLG_JCAR_OAI_REQUEST_URL_LABEL"
description="PLG_JCAR_OAI_REQUEST_URL_DESC"
filter="string"
Expand Down

0 comments on commit 887b909

Please sign in to comment.