-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathedit.php
More file actions
115 lines (103 loc) · 3.85 KB
/
edit.php
File metadata and controls
115 lines (103 loc) · 3.85 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
<?php
/**
* @version SVN: <svn_id>
* @package Api
* @author Techjoomla <extensions@techjoomla.com>
* @copyright Copyright (C) 2009-2014 Techjoomla, Tekdi Technologies Pvt. Ltd. All rights reserved.
* @license GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
* @link http://techjoomla.com
* Work derived from the original RESTful API by Techjoomla (https://github.com/techjoomla/Joomla-REST-API)
* and the com_api extension by Brian Edgerton (http://www.edgewebworks.com)
*/
// No direct access.
defined('_JEXEC') or die();
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
HTMLHelper::addIncludePath(JPATH_COMPONENT . '/helpers/html');
if (version_compare(JVERSION, "3.0.0", "ge"))
{
HTMLHelper::_('behavior.formvalidator');
}
HTMLHelper::_('behavior.keepalive');
// Import CSS
HTMLHelper::_('stylesheet','components/com_api/assets/css/api.css');
Factory::getDocument()->addScriptDeclaration(
"
js = jQuery.noConflict();
js(document).ready(function()
{
});
Joomla.submitbutton = function(task)
{
if (task == 'key.cancel')
{
Joomla.submitform(task, document.getElementById('key-form'));
}
else
{
if (task != 'key.cancel' && document.formvalidator.isValid(document.getElementById('key-form')))
{
Joomla.submitform(task, document.getElementById('key-form'));
}
else
{
alert('".$this->escape(Text::_('JGLOBAL_VALIDATION_FORM_FAILED'))."');
}
}
}
");
?>
<div class="<?php echo COM_APIS_WRAPPER_CLASS; ?> api-key">
<form action="<?php echo Route::_('index.php?option=com_api&layout=edit&id=' . (int) $this->item->id); ?>" method="post" enctype="multipart/form-data" name="adminForm" id="key-form" class="form-validate">
<div class="form-horizontal">
<div class="row-fluid">
<div class="span10 form-horizontal">
<fieldset class="adminform">
<div class="control-group">
<div class="control-label"><?php echo $this->form->getLabel('id'); ?></div>
<div class="controls"><?php echo $this->form->getInput('id'); ?></div>
</div>
<div class="control-group">
<div class="control-label"><?php echo $this->form->getLabel('userid'); ?></div>
<div class="controls"><?php echo $this->form->getInput('userid'); ?></div>
</div>
<div class="control-group">
<div class="control-label"><?php echo $this->form->getLabel('hash'); ?></div>
<div class="controls"><?php echo $this->form->getInput('hash'); ?></div>
</div>
<div class="control-group">
<div class="control-label"><?php echo $this->form->getLabel('domain'); ?></div>
<div class="controls"><?php echo $this->form->getInput('domain'); ?></div>
</div>
<div class="control-group">
<div class="control-label"><?php echo $this->form->getLabel('per_hour'); ?></div>
<div class="controls"><?php echo $this->form->getInput('per_hour'); ?></div>
</div>
<input type="hidden" name="jform[state]" value="<?php echo $this->item->state; ?>" />
<input type="hidden" name="jform[checked_out]" value="<?php echo $this->item->checked_out; ?>" />
<input type="hidden" name="jform[checked_out_time]" value="<?php echo $this->item->checked_out_time; ?>" />
<?php
if(empty($this->item->created_by))
{
?>
<input type="hidden" name="jform[created_by]" value="<?php echo Factory::getUser()->id; ?>" />
<?php
}
else
{
?>
<input type="hidden" name="jform[created_by]" value="<?php echo $this->item->created_by; ?>" />
<?php
}
?>
<input type="hidden" name="jform[last_used]" value="<?php echo $this->item->last_used; ?>" />
</fieldset>
</div>
</div>
<input type="hidden" name="task" value="" />
<?php echo HTMLHelper::_('form.token'); ?>
</div>
</form>
</div>