Permalink
Browse files

# [#29569] *Implementing accordeons for Modules Options

  • Loading branch information...
1 parent 23c6a24 commit 410d7eaeee8291fa796277e4e02886515bafee9b @infograf768 infograf768 committed Nov 11, 2012
@@ -41,37 +41,21 @@
<form action="<?php echo JRoute::_('index.php?option=com_modules&layout=edit&id='.(int) $this->item->id); ?>" method="post" name="adminForm" id="module-form" class="form-validate form-horizontal">
<fieldset>
<ul class="nav nav-tabs">
- <li class="active"><a href="#details" data-toggle="tab"><?php echo JText::_('JDETAILS');?></a></li>
-
- <?php if (count($this->fieldsets)) : ?>
- <?php foreach ($this->fieldsets as $fieldset) : ?>
- <?php $label = !empty($fieldset->label) ? JText::_($fieldset->label) : JText::_('COM_MODULES_'.$fieldset->name.'_FIELDSET_LABEL');?>
- <li><a href="#options-<?php echo $fieldset->name; ?>" data-toggle="tab"><?php echo $label ?></a></li>
- <?php endforeach; ?>
- <?php endif; ?>
+ <li class="active"><a href="#details" data-toggle="tab"><?php echo JText::_('JDETAILS'); ?></a></li>
+ <li><a href="#options" data-toggle="tab"><?php echo JText::_('JOPTIONS'); ?></a></li>
<?php if ($hasContent) : ?>
- <li><a href="#custom" data-toggle="tab"><?php echo JText::_('COM_MODULES_CUSTOM_OUTPUT');?></a></li>
+ <li><a href="#custom" data-toggle="tab"><?php echo JText::_('COM_MODULES_CUSTOM_OUTPUT'); ?></a></li>
<?php endif; ?>
- <?php if ($this->item->client_id == 0) :?>
- <li><a href="#assignment" data-toggle="tab"><?php echo JText::_('COM_MODULES_MENU_ASSIGNMENT');?></a></li>
+ <?php if ($this->item->client_id == 0) : ?>
+ <li><a href="#assignment" data-toggle="tab"><?php echo JText::_('COM_MODULES_MENU_ASSIGNMENT'); ?></a></li>
<?php endif; ?>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="details">
<div class="row-fluid">
<div class="span6">
- <?php if ((string) $this->item->xml->name != 'Login Form'): ?>
- <div class="control-group">
- <div class="control-label">
- <?php echo $this->form->getLabel('published'); ?>
- </div>
- <div class="controls">
- <?php echo $this->form->getInput('published'); ?>
- </div>
- </div>
- <?php endif; ?>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('title'); ?>
@@ -96,6 +80,17 @@
<?php echo $this->loadTemplate('positions'); ?>
</div>
</div>
+ <hr />
+ <?php if ((string) $this->item->xml->name != 'Login Form') : ?>
+ <div class="control-group">
+ <div class="control-label">
+ <?php echo $this->form->getLabel('published'); ?>
+ </div>
+ <div class="controls">
+ <?php echo $this->form->getInput('published'); ?>
+ </div>
+ </div>
+ <?php endif; ?>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('access'); ?>
@@ -112,7 +107,7 @@
<?php echo $this->form->getInput('ordering'); ?>
</div>
</div>
- <?php if ((string) $this->item->xml->name != 'Login Form'): ?>
+ <?php if ((string) $this->item->xml->name != 'Login Form') : ?>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('publish_up'); ?>
@@ -155,7 +150,7 @@
<h4>
<?php echo JText::_('COM_MODULES_MODULE_DESCRIPTION'); ?>
<?php if ($this->item->id) : ?>
- <span class="label label-info"><?php echo JText::_('JGRID_HEADING_ID');?> : <?php echo $this->item->id; ?></span>
+ <span class="label label-info"><?php echo JText::_('JGRID_HEADING_ID'); ?> : <?php echo $this->item->id; ?></span>
<?php endif; ?>
</h4>
<hr />
@@ -174,15 +169,16 @@
</div>
</div>
</div>
-
- <?php echo $this->loadTemplate('options'); ?>
+ <div class="tab-pane" id="options">
+ <?php echo $this->loadTemplate('options'); ?>
+ </div>
<?php if ($hasContent) : ?>
<div class="tab-pane" id="custom">
<?php echo $this->form->getInput('content'); ?>
</div>
<?php endif; ?>
- <?php if ($this->item->client_id == 0) :?>
+ <?php if ($this->item->client_id == 0) : ?>
<div class="tab-pane" id="assignment">
<?php echo $this->loadTemplate('assignment'); ?>
</div>
@@ -8,32 +8,29 @@
*/
defined('_JEXEC') or die;
+?>
+<?php
+ echo JHtml::_('bootstrap.startAccordion', 'moduleOptions', array('active' => 'collapse0'));
+ $fieldSets = $this->form->getFieldsets('params');
+ $i = 0;
- foreach ($this->fieldsets as $name => $fieldset) :
-
- echo '<div class="tab-pane" id="options-'.$name.'">';
-
- $label = !empty($fieldset->label) ? $fieldset->label : 'COM_MODULES_'.$name.'_FIELDSET_LABEL';
- if (isset($fieldset->description) && trim($fieldset->description)) :
- echo '<p class="tip">'.$this->escape(JText::_($fieldset->description)).'</p>';
+ foreach ($fieldSets as $name => $fieldSet) :
+ $label = !empty($fieldSet->label) ? $fieldSet->label : 'COM_MODULES_'.$name.'_FIELDSET_LABEL';
+ echo JHtml::_('bootstrap.addSlide', 'moduleOptions', JText::_($label), 'collapse' . $i++);
+ if (isset($fieldSet->description) && trim($fieldSet->description)) :
+ echo '<p class="tip">'.$this->escape(JText::_($fieldSet->description)).'</p>';
endif;
?>
- <?php $hidden_fields = ''; ?>
- <?php foreach ($this->form->getFieldset($name) as $field) : ?>
- <?php if (!$field->hidden) : ?>
- <div class="control-group">
- <div class="control-label">
- <?php echo $field->label; ?>
- </div>
- <div class="controls">
- <?php echo $field->input; ?>
- </div>
- </div>
- <?php else :?>
- <?php $hidden_fields .= $field->input; ?>
- <?php endif; ?>
- <?php endforeach; ?>
- <?php echo $hidden_fields; ?>
-
- <?php echo '</div>'; // .tab-pane div ?>
- <?php endforeach; ?>
+ <?php foreach ($this->form->getFieldset($name) as $field) : ?>
+ <div class="control-group">
+ <div class="control-label">
+ <?php echo $field->label; ?>
+ </div>
+ <div class="controls">
+ <?php echo $field->input; ?>
+ </div>
+ </div>
+ <?php endforeach;
+ echo JHtml::_('bootstrap.endSlide');
+ endforeach;
+echo JHtml::_('bootstrap.endAccordion');
@@ -26,6 +26,9 @@ $ -> Language fix or change
- -> Removed
! -> Note
+11-Nov-2012 Jean-Marie Simonet
+ # [#29569] *Implementing accordeons for Modules Options
+
10-Nov-2012 Mark Dexter
# Remove trashed categories from sample data
# [#29621] The root asset has the wrong lft value in 3 files. Thanks Elin.

0 comments on commit 410d7ea

Please sign in to comment.