diff --git a/core/fields/position.php b/core/fields/position.php new file mode 100644 index 0000000..5fd6515 --- /dev/null +++ b/core/fields/position.php @@ -0,0 +1,37 @@ +load('com_modules', JPATH_ADMINISTRATOR); + + $clientId = 0; + $state = 1; + $selectedPosition = $this->value; + $positions = JHtml::_('modules.positions', $clientId, $state, $selectedPosition); + + + // Add custom position to options + $customGroupText = JText::_('COM_MODULES_CUSTOM_POSITION'); + + // Build field + $attr = array( + 'id' => $this->id, + 'list.select' => $this->value, + 'list.attr' => 'class="chzn-custom-value input-xlarge" ' + . 'data-custom_group_text="' . $customGroupText . '" ' + . 'data-no_results_text="' . JText::_('COM_MODULES_ADD_CUSTOM_POSITION') . '" ' + . 'data-placeholder="' . JText::_('COM_MODULES_TYPE_OR_SELECT_POSITION') . '" ' + ); + + return JHtml::_('select.groupedlist', $positions, $this->name, $attr); + } +} \ No newline at end of file diff --git a/templateDetails.xml b/templateDetails.xml index f4e7977..1f9fc22 100644 --- a/templateDetails.xml +++ b/templateDetails.xml @@ -71,7 +71,7 @@ @@ -262,7 +262,7 @@ @@ -270,7 +270,7 @@ @@ -278,7 +278,7 @@