primo commit
This commit is contained in:
1
administrator/components/com_jem/views/source/index.html
Normal file
1
administrator/components/com_jem/views/source/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
58
administrator/components/com_jem/views/source/tmpl/edit.php
Normal file
58
administrator/components/com_jem/views/source/tmpl/edit.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
/**
|
||||
* @package JEM
|
||||
* @copyright (C) 2013-2024 joomlaeventmanager.net
|
||||
* @copyright (C) 2005-2009 Christoph Lukes
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0 GNU/GPL
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
HTMLHelper::addIncludePath(JPATH_COMPONENT.'/helpers/html');
|
||||
$app = Factory::getApplication();
|
||||
$document = $app->getDocument();
|
||||
$wa = $document->getWebAssetManager();
|
||||
$wa->useScript('keepalive')
|
||||
->useScript('form.validate')
|
||||
?>
|
||||
<script>
|
||||
Joomla.submitbutton = function(task)
|
||||
{
|
||||
if (task == 'source.cancel' || document.formvalidator.isValid(document.getElementById('source-form'))) {
|
||||
<?php //echo $this->form->getField('source')->save(); ?>
|
||||
Joomla.submitform(task, document.getElementById('source-form'));
|
||||
} else {
|
||||
alert('<?php echo $this->escape(Text::_('JGLOBAL_VALIDATION_FORM_FAILED'));?>');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<form action="<?php echo Route::_('index.php?option=com_jem&layout=edit'); ?>" method="post" name="adminForm" id="source-form" class="form-validate">
|
||||
<?php if ($this->ftp) : ?>
|
||||
<?php echo $this->loadTemplate('ftp'); ?>
|
||||
<?php endif; ?>
|
||||
<fieldset class="adminform">
|
||||
<legend><?php
|
||||
if ($this->source->custom) {
|
||||
echo Text::sprintf('COM_JEM_CSSMANAGER_FILENAME_CUSTOM', $this->source->filename);
|
||||
} else {
|
||||
echo Text::sprintf('COM_JEM_CSSMANAGER_FILENAME', $this->source->filename);
|
||||
}
|
||||
?></legend>
|
||||
|
||||
<?php echo $this->form->getLabel('source'); ?>
|
||||
<div class="clr"></div>
|
||||
<div class="editor-border">
|
||||
<?php echo $this->form->getInput('source'); ?>
|
||||
</div>
|
||||
<input type="hidden" name="task" value="" />
|
||||
<?php echo HTMLHelper::_('form.token'); ?>
|
||||
</fieldset>
|
||||
|
||||
<?php echo $this->form->getInput('filename'); ?>
|
||||
</form>
|
||||
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* @package JEM
|
||||
* @copyright (C) 2013-2024 joomlaeventmanager.net
|
||||
* @copyright (C) 2005-2009 Christoph Lukes
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0 GNU/GPL
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Language\Text;
|
||||
?>
|
||||
|
||||
<fieldset class="adminform" title="<?php echo Text::_('COM_JEM_CSSMANAGER_FTP_TITLE'); ?>">
|
||||
<legend><?php echo Text::_('COM_JEM_CSSMANAGER_FTP_TITLE'); ?></legend>
|
||||
|
||||
<?php echo Text::_('COM_JEM_CSSMANAGER_FTP_DESC'); ?>
|
||||
|
||||
<?php if ($this->ftp instanceof Exception): ?>
|
||||
<p class="error"><?php echo Text::_($this->ftp->message); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<table class="adminform">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width:120px">
|
||||
<label for="username"><?php echo Text::_('JGLOBAL_USERNAME'); ?></label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="username" name="username" class="inputbox" size="70" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:120px">
|
||||
<label for="password"><?php echo Text::_('JGLOBAL_PASSWORD'); ?></label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="password" id="password" name="password" class="inputbox" size="70" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
76
administrator/components/com_jem/views/source/view.html.php
Normal file
76
administrator/components/com_jem/views/source/view.html.php
Normal file
@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/**
|
||||
* @package JEM
|
||||
* @copyright (C) 2013-2024 joomlaeventmanager.net
|
||||
* @copyright (C) 2005-2009 Christoph Lukes
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0 GNU/GPL
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Client\ClientHelper;
|
||||
|
||||
/**
|
||||
* Source view
|
||||
*
|
||||
*/
|
||||
class JemViewSource extends JemAdminView
|
||||
{
|
||||
protected $form;
|
||||
protected $ftp;
|
||||
protected $source;
|
||||
protected $state;
|
||||
protected $template;
|
||||
|
||||
/**
|
||||
* Display the view
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
// Initialise variables.
|
||||
$this->form = $this->get('Form');
|
||||
$this->ftp = ClientHelper::setCredentialsFromRequest('ftp');
|
||||
$this->source = $this->get('Source');
|
||||
$this->state = $this->get('State');
|
||||
$this->template = $this->get('Template');
|
||||
|
||||
// Check for errors.
|
||||
$errors = $this->get('Errors');
|
||||
if (is_array($errors) && count($errors)) {
|
||||
\Factory::getApplication()->enqueueMessage(implode("\n", $errors), 'error');
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->addToolbar();
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the page title and toolbar.
|
||||
*
|
||||
*/
|
||||
protected function addToolbar()
|
||||
{
|
||||
Factory::getApplication()->input->set('hidemainmenu', true);
|
||||
|
||||
$user = JemFactory::getUser();
|
||||
$canDo = JemHelperBackend::getActions(0);
|
||||
|
||||
ToolbarHelper::title(Text::_('COM_JEM_CSSMANAGER_EDIT_FILE'), 'thememanager');
|
||||
|
||||
// Can save the item.
|
||||
if ($canDo->get('core.edit')) {
|
||||
ToolbarHelper::apply('source.apply');
|
||||
ToolbarHelper::save('source.save');
|
||||
}
|
||||
|
||||
ToolbarHelper::cancel('source.cancel', 'JTOOLBAR_CLOSE');
|
||||
ToolbarHelper::divider();
|
||||
ToolBarHelper::help('editcss', true, 'https://www.joomlaeventmanager.net/documentation/manual/backend/control-panel/css-manager/edit-file');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user