edit.php
4.79 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<?php
/**
* @package Joomla.Administrator
* @subpackage com_languages
*
* @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;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHtml::_('behavior.formvalidator');
JHtml::_('behavior.keepalive');
JHtml::_('formbehavior.chosen', 'select');
$expired = ($this->state->get('cache_expired') == 1 ) ? '1' : '';
JHtml::_('stylesheet', 'overrider/overrider.css', array('version' => 'auto', 'relative' => true));
JHtml::_('behavior.core');
JHtml::_('jquery.framework');
JHtml::_('script', 'overrider/overrider.min.js', array('version' => 'auto', 'relative' => true));
JFactory::getDocument()->addScriptDeclaration('
jQuery(document).ready(function($) {
$("#jform_searchstring").on("focus", function() {
if (!Joomla.overrider.states.refreshed)
{
var expired = "' . $expired . '";
if (expired)
{
Joomla.overrider.refreshCache();
Joomla.overrider.states.refreshed = true;
}
}
$(this).removeClass("invalid");
});
});
Joomla.submitbutton = function(task) {
if (task == "override.cancel" || document.formvalidator.isValid(document.getElementById("override-form")))
{
Joomla.submitform(task, document.getElementById("override-form"));
}
};
');
?>
<form action="<?php echo JRoute::_('index.php?option=com_languages&id=' . $this->item->key); ?>" method="post" name="adminForm" id="override-form" class="form-validate form-horizontal">
<div class="row-fluid">
<div class="span6">
<fieldset>
<legend><?php echo empty($this->item->key) ? JText::_('COM_LANGUAGES_VIEW_OVERRIDE_EDIT_NEW_OVERRIDE_LEGEND') : JText::_('COM_LANGUAGES_VIEW_OVERRIDE_EDIT_EDIT_OVERRIDE_LEGEND'); ?></legend>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('language'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('language'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('client'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('client'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('key'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('key'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('override'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('override'); ?>
</div>
</div>
<?php if ($this->state->get('filter.client') == 'administrator') : ?>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('both'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('both'); ?>
</div>
</div>
<?php endif; ?>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('file'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('file'); ?>
</div>
</div>
</fieldset>
</div>
<div class="span6">
<fieldset>
<legend><?php echo JText::_('COM_LANGUAGES_VIEW_OVERRIDE_SEARCH_LEGEND'); ?></legend>
<div class="alert alert-info"><p><?php echo JText::_('COM_LANGUAGES_VIEW_OVERRIDE_SEARCH_TIP'); ?></p></div>
<div class="control-group">
<?php echo $this->form->getInput('searchstring'); ?>
<button type="submit" class="btn btn-primary" onclick="Joomla.overrider.searchStrings();return false;" formnovalidate>
<?php echo JText::_('COM_LANGUAGES_VIEW_OVERRIDE_SEARCH_BUTTON'); ?>
</button>
<span id="refresh-status" class="overrider-spinner help-block">
<?php echo JText::_('COM_LANGUAGES_VIEW_OVERRIDE_REFRESHING'); ?>
</span>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('searchtype'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('searchtype'); ?>
</div>
</div>
</fieldset>
<fieldset id="results-container" class="adminform">
<legend><?php echo JText::_('COM_LANGUAGES_VIEW_OVERRIDE_RESULTS_LEGEND'); ?></legend>
<span id="more-results">
<a href="javascript:Joomla.overrider.searchStrings(Joomla.overrider.states.more);">
<?php echo JText::_('COM_LANGUAGES_VIEW_OVERRIDE_MORE_RESULTS'); ?></a>
</span>
</fieldset>
<input type="hidden" name="task" value="" />
<input type="hidden" name="id" value="<?php echo $this->item->key; ?>" />
<?php echo JHtml::_('form.token'); ?>
</div>
</div>
</form>