+
+ get('admin_menus') != '0') : ?>
+
+
+
+
+
+
+
+
+
+
+
+
+ get('admin_menus') != '0') : ?>
+
+
+
+
+
+ menumodules = JModuleHelper::getModules('menu'); ?>
+ menumodules as $menumodule) : ?>
+ 'none')); ?>
+ params); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+ getInstance()->countModules('status'))) : ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ error->getCode(); ?> error->getMessage(), ENT_QUOTES, 'UTF-8');?>
+
+
+
+
+
+
+
+
+
+
diff --git a/libraries/joomla/form/fields/list.php b/libraries/joomla/form/fields/list.php
index d28832dacffa9..05b46c9b1868e 100644
--- a/libraries/joomla/form/fields/list.php
+++ b/libraries/joomla/form/fields/list.php
@@ -83,7 +83,16 @@ protected function getInput()
else
// Create a regular list.
{
- $html[] = JHtml::_('select.genericlist', $options, $this->name, trim($attr), 'value', 'text', $this->value, $this->id);
+ $listoptions = array();
+ $listoptions['option.key'] = 'value';
+ $listoptions['option.text'] = 'text';
+ $listoptions['list.select'] = $this->value;
+ $listoptions['id'] = $this->id;
+ $listoptions['list.translate'] = false;
+ $listoptions['option.attr'] = 'optionattr';
+ $listoptions['list.attr'] = trim($attr);
+
+ $html[] = JHtml::_('select.genericlist', $options, $this->name, $listoptions);
}
return implode($html);
@@ -144,7 +153,10 @@ protected function getOptions()
// Set some event handler attributes. But really, should be using unobtrusive js.
$tmp['onclick'] = (string) $option['onclick'];
$tmp['onchange'] = (string) $option['onchange'];
-
+
+ if ((string) $option['showon']){
+ $tmp['optionattr'] = " data-showon = '".json_encode(JFormHelper::parseShowOnConditions((string) $option['showon'], $this->formControl, $this->group))."'";
+ }
// Add the option object to the result set.
$options[] = (object) $tmp;
}
diff --git a/media/jui/js/cms-uncompressed.js b/media/jui/js/cms-uncompressed.js
index 5b50f85b33749..f15bbce3514a6 100644
--- a/media/jui/js/cms-uncompressed.js
+++ b/media/jui/js/cms-uncompressed.js
@@ -155,9 +155,18 @@ if (!Array.prototype.indexOf)
}
// If conditions are satisfied show the target field(s), else hide
- if (animate) {
+ // Note that we cannot animate select list options anywhere other than chrome so disable this
+ if (animate && !target.is('option')) {
(showfield) ? target.slideDown() : target.slideUp();
- } else {
+ } else if (target.is('option')) {
+ target.toggle(showfield);
+ target.attr('disabled' ,showfield? false : true);
+ // if chosen active for the target select list then update it
+ if ($('#'+target.parent().attr('id')+'_chzn').length){
+ target.parent().trigger("liszt:updated");
+ target.parent().trigger("chosen:updated");
+ }
+ } else {
target.toggle(showfield);
}
}
diff --git a/media/jui/js/cms.js b/media/jui/js/cms.js
index ef2014994a49b..5bd720ce6a8f5 100644
--- a/media/jui/js/cms.js
+++ b/media/jui/js/cms.js
@@ -1 +1 @@
-if("undefined"==typeof Joomla)var Joomla={};!function(e,a){"use strict";a.setcollapse=function(a,n,o){e.getElementById("collapse-"+n)||(e.getElementById("container-collapse").innerHTML='
')},Array.prototype.indexOf||(Array.prototype.indexOf=function(e){var a=this.length>>>0,n=Number(arguments[1])||0;for(n=0>n?Math.ceil(n):Math.floor(n),0>n&&(n+=a);a>n;n++)if(n in this&&this[n]===e)return n;return-1}),window.jQuery&&function(a){function n(e,n){for(var o,t,i,r,l=!0,d=e.data("showon")||[],f=0,s=d.length;s>f;f++)t=d[f]||{},i=t.field,r=a('[name="'+i+'"], [name="'+i+'[]"]'),t.valid=0,r.each(function(){var e=a(this);if(-1!==["checkbox","radio"].indexOf(e.attr("type"))){if(!e.prop("checked"))return;o=e.val()}else o=e.val(),null==o&&"select"==e.prop("tagName").toLowerCase()&&(o=[]);"object"!=typeof o&&(o=JSON.parse('["'+o+'"]'));for(var n in o)o.propertyIsEnumerable(n)&&("="==d[f].sign&&-1!==d[f].values.indexOf(o[n])&&(d[f].valid=1),"!="==d[f].sign&&-1===d[f].values.indexOf(o[n])&&(d[f].valid=1))}),""===t.op?0===t.valid&&(l=!1):("AND"===t.op&&t.valid+d[f-1].valid<2&&(l=!1),"OR"===t.op&&t.valid+d[f-1].valid>0&&(l=!0));n?l?e.slideDown():e.slideUp():e.toggle(l)}function o(o){o=o||e;for(var t=a(o).find("[data-showon]"),i=0,r=t.length;r>i;i++)!function(){for(var e,o=a(t[i]),r=o.data("showon")||[],l=a(),d=0,f=r.length;f>d;d++)e=r[d].field,l=l.add(a('[name="'+e+'"], [name="'+e+'[]"]'));n(o),l.on("change",function(){n(o,!0)})}()}a(e).ready(function(){o(),a(e).on("subform-row-add",function(e,n){for(var t,i,r=a(n),l=r.find("[data-showon]"),d=r.data("baseName"),f=r.data("group"),s=new RegExp("\\["+d+"\\]\\["+d+"X\\]","g"),c="["+d+"]["+f+"]",u=0,p=l.length;p>u;u++)t=a(l[u]),i=t.attr("data-showon").replace(s,c),t.attr("data-showon",i);o(n)})})}(jQuery)}(document,Joomla);
\ No newline at end of file
+if("undefined"==typeof Joomla)var Joomla={};!function(e,a){"use strict";a.setcollapse=function(a,t,n){e.getElementById("collapse-"+t)||(e.getElementById("container-collapse").innerHTML='
')},Array.prototype.indexOf||(Array.prototype.indexOf=function(e){var a=this.length>>>0,t=Number(arguments[1])||0;for(t=0>t?Math.ceil(t):Math.floor(t),0>t&&(t+=a);a>t;t++)if(t in this&&this[t]===e)return t;return-1}),window.jQuery&&function(a){function t(e,t){for(var n,o,i,r,d=!0,l=e.data("showon")||[],s=0,f=l.length;f>s;s++)o=l[s]||{},i=o.field,r=a('[name="'+i+'"], [name="'+i+'[]"]'),o.valid=0,r.each(function(){var e=a(this);if(-1!==["checkbox","radio"].indexOf(e.attr("type"))){if(!e.prop("checked"))return;n=e.val()}else n=e.val(),null==n&&"select"==e.prop("tagName").toLowerCase()&&(n=[]);"object"!=typeof n&&(n=JSON.parse('["'+n+'"]'));for(var t in n)n.propertyIsEnumerable(t)&&("="==l[s].sign&&-1!==l[s].values.indexOf(n[t])&&(l[s].valid=1),"!="==l[s].sign&&-1===l[s].values.indexOf(n[t])&&(l[s].valid=1))}),""===o.op?0===o.valid&&(d=!1):("AND"===o.op&&o.valid+l[s-1].valid<2&&(d=!1),"OR"===o.op&&o.valid+l[s-1].valid>0&&(d=!0));t&&!e.is("option")?d?e.slideDown():e.slideUp():e.is("option")?(e.toggle(d),e.attr("disabled",d?!1:!0),a("#"+e.parent().attr("id")+"_chzn").length&&(e.parent().trigger("liszt:updated"),e.parent().trigger("chosen:updated"))):e.toggle(d)}function n(n){n=n||e;for(var o=a(n).find("[data-showon]"),i=0,r=o.length;r>i;i++)!function(){for(var e,n=a(o[i]),r=n.data("showon")||[],d=a(),l=0,s=r.length;s>l;l++)e=r[l].field,d=d.add(a('[name="'+e+'"], [name="'+e+'[]"]'));t(n),d.on("change",function(){t(n,!0)})}()}a(e).ready(function(){n(),a(e).on("subform-row-add",function(e,t){for(var o,i,r=a(t),d=r.find("[data-showon]"),l=r.data("baseName"),s=r.data("group"),f=new RegExp("\\["+l+"\\]\\["+l+"X\\]","g"),c="["+l+"]["+s+"]",p=0,u=d.length;u>p;p++)o=a(d[p]),i=o.attr("data-showon").replace(f,c),o.attr("data-showon",i);n(t)})})}(jQuery)}(document,Joomla);
\ No newline at end of file
diff --git a/templates/protostar/html/layouts/gwe-com_content/fields/render.php b/templates/protostar/html/layouts/gwe-com_content/fields/render.php
new file mode 100644
index 0000000000000..fc71b9a01cea1
--- /dev/null
+++ b/templates/protostar/html/layouts/gwe-com_content/fields/render.php
@@ -0,0 +1,71 @@
+fields ?: FieldsHelper::getFields($context, $item, true);
+}
+
+if (!$fields)
+{
+ return;
+}
+
+// Print the container tag
+echo '
';
+
+// Loop through the fields and print them
+foreach ($fields as $field)
+{
+ // If the value is empty do nothing
+ if (!isset($field->value) || $field->value == '')
+ {
+ continue;
+ }
+
+ echo FieldsHelper::render($context, 'field.render', array('field' => $field));
+}
+
+// Close the container
+echo '
';
+
+echo "
com_content template override of layout";
diff --git a/templates/protostar/html/layouts/gwe-com_fields/fields/render.php b/templates/protostar/html/layouts/gwe-com_fields/fields/render.php
new file mode 100644
index 0000000000000..8ca4e3907decc
--- /dev/null
+++ b/templates/protostar/html/layouts/gwe-com_fields/fields/render.php
@@ -0,0 +1,70 @@
+fields ?: FieldsHelper::getFields($context, $item, true);
+}
+
+if (!$fields)
+{
+ return;
+}
+
+// Print the container tag
+echo '
';
+
+// Loop through the fields and print them
+foreach ($fields as $field)
+{
+ // If the value is empty do nothing
+ if (!isset($field->value) || $field->value == '')
+ {
+ continue;
+ }
+
+ echo FieldsHelper::render($context, 'field.render', array('field' => $field));
+}
+
+// Close the container
+echo '
';
+
+echo "
com_fields template override of layout";