default.php
4.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?php
/**
* @package Joomla.Administrator
* @subpackage com_config
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
$app = JFactory::getApplication();
$template = $app->getTemplate();
// Load the tooltip behavior.
JHtml::_('bootstrap.tooltip');
JHtml::_('behavior.formvalidator');
JHtml::_('behavior.keepalive');
JHtml::_('formbehavior.chosen', '.chzn-custom-value', null, array('disable_search_threshold' => 0));
JHtml::_('formbehavior.chosen', 'select');
// Load JS message titles
JText::script('ERROR');
JText::script('WARNING');
JText::script('NOTICE');
JText::script('MESSAGE');
JFactory::getDocument()->addScriptDeclaration(
'
Joomla.submitbutton = function(task)
{
if (task === "config.cancel.component" || document.formvalidator.isValid(document.getElementById("component-form")))
{
jQuery("#permissions-sliders select").attr("disabled", "disabled");
Joomla.submitform(task, document.getElementById("component-form"));
}
};
// Select first tab
jQuery(document).ready(function() {
jQuery("#configTabs a:first").tab("show");
});'
);
?>
<form action="<?php echo JRoute::_('index.php?option=com_config'); ?>" id="component-form" method="post" name="adminForm" autocomplete="off" class="form-validate form-horizontal">
<div class="row-fluid">
<!-- Begin Sidebar -->
<div class="span2" id="sidebar">
<div class="sidebar-nav">
<?php echo $this->loadTemplate('navigation'); ?>
</div>
</div><!-- End Sidebar -->
<div class="span10" id="config">
<?php if ($this->fieldsets): ?>
<ul class="nav nav-tabs" id="configTabs">
<?php foreach ($this->fieldsets as $name => $fieldSet) : ?>
<?php $dataShowOn = ''; ?>
<?php if (!empty($fieldSet->showon)) : ?>
<?php JHtml::_('jquery.framework'); ?>
<?php JHtml::_('script', 'jui/cms.js', array('version' => 'auto', 'relative' => true)); ?>
<?php $dataShowOn = ' data-showon=\'' . json_encode(JFormHelper::parseShowOnConditions($fieldSet->showon, $this->formControl)) . '\''; ?>
<?php endif; ?>
<?php $label = empty($fieldSet->label) ? 'COM_CONFIG_' . $name . '_FIELDSET_LABEL' : $fieldSet->label; ?>
<li<?php echo $dataShowOn; ?>><a data-toggle="tab" href="#<?php echo $name; ?>"><?php echo JText::_($label); ?></a></li>
<?php endforeach; ?>
</ul><!-- /configTabs -->
<div class="tab-content" id="configContent">
<?php foreach ($this->fieldsets as $name => $fieldSet) : ?>
<div class="tab-pane" id="<?php echo $name; ?>">
<?php if (isset($fieldSet->description) && !empty($fieldSet->description)) : ?>
<div class="tab-description alert alert-info">
<span class="icon-info" aria-hidden="true"></span> <?php echo JText::_($fieldSet->description); ?>
</div>
<?php endif; ?>
<?php foreach ($this->form->getFieldset($name) as $field) : ?>
<?php
$dataShowOn = '';
$groupClass = $field->type === 'Spacer' ? ' field-spacer' : '';
?>
<?php if ($field->showon) : ?>
<?php JHtml::_('jquery.framework'); ?>
<?php JHtml::_('script', 'jui/cms.js', array('version' => 'auto', 'relative' => true)); ?>
<?php $dataShowOn = ' data-showon=\'' . json_encode(JFormHelper::parseShowOnConditions($field->showon, $field->formControl, $field->group)) . '\''; ?>
<?php endif; ?>
<?php if ($field->hidden) : ?>
<?php echo $field->input; ?>
<?php else : ?>
<div class="control-group<?php echo $groupClass; ?>"<?php echo $dataShowOn; ?>>
<?php if ($name != 'permissions') : ?>
<div class="control-label">
<?php echo $field->label; ?>
</div>
<?php endif; ?>
<div class="<?php if ($name != 'permissions') : ?>controls<?php endif; ?>">
<?php echo $field->input; ?>
</div>
</div>
<?php endif; ?>
<?php endforeach; ?>
</div>
<?php endforeach; ?>
</div><!-- /configContent -->
<?php else: ?>
<div class="alert alert-info"><span class="icon-info" aria-hidden="true"></span> <?php echo JText::_('COM_CONFIG_COMPONENT_NO_CONFIG_FIELDS_MESSAGE'); ?></div>
<?php endif; ?>
</div><!-- /config -->
<input type="hidden" name="id" value="<?php echo $this->component->id; ?>" />
<input type="hidden" name="component" value="<?php echo $this->component->option; ?>" />
<input type="hidden" name="return" value="<?php echo $this->return; ?>" />
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>