primo commit
This commit is contained in:
122
administrator/components/com_newsfeeds/tmpl/newsfeed/edit.php
Normal file
122
administrator/components/com_newsfeeds/tmpl/newsfeed/edit.php
Normal file
@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_newsfeeds
|
||||
*
|
||||
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Associations;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Layout\LayoutHelper;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
/** @var \Joomla\Component\Newsfeeds\Administrator\View\Newsfeed\HtmlView $this */
|
||||
|
||||
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
|
||||
$wa = $this->getDocument()->getWebAssetManager();
|
||||
$wa->useScript('keepalive')
|
||||
->useScript('form.validate');
|
||||
|
||||
$app = Factory::getApplication();
|
||||
$input = $app->getInput();
|
||||
|
||||
$assoc = Associations::isEnabled();
|
||||
|
||||
// Fieldsets to not automatically render by /layouts/joomla/edit/params.php
|
||||
$this->ignore_fieldsets = ['images', 'jbasic', 'jmetadata', 'item_associations'];
|
||||
$this->useCoreUI = true;
|
||||
|
||||
// In case of modal
|
||||
$isModal = $input->get('layout') === 'modal';
|
||||
$layout = $isModal ? 'modal' : 'edit';
|
||||
$tmpl = $isModal || $input->get('tmpl', '', 'cmd') === 'component' ? '&tmpl=component' : '';
|
||||
?>
|
||||
|
||||
<form action="<?php echo Route::_('index.php?option=com_newsfeeds&layout=' . $layout . $tmpl . '&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="newsfeed-form" aria-label="<?php echo Text::_('COM_NEWSFEEDS_FORM_TITLE_' . ((int) $this->item->id === 0 ? 'NEW' : 'EDIT'), true); ?>" class="form-validate">
|
||||
|
||||
<?php echo LayoutHelper::render('joomla.edit.title_alias', $this); ?>
|
||||
|
||||
<div class="main-card">
|
||||
<?php echo HTMLHelper::_('uitab.startTabSet', 'myTab', ['active' => 'details', 'recall' => true, 'breakpoint' => 768]); ?>
|
||||
|
||||
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'details', empty($this->item->id) ? Text::_('COM_NEWSFEEDS_NEW_NEWSFEED') : Text::_('COM_NEWSFEEDS_EDIT_NEWSFEED')); ?>
|
||||
<div class="row">
|
||||
<div class="col-lg-9">
|
||||
<div class="form-vertical">
|
||||
<?php echo $this->form->renderField('link'); ?>
|
||||
<?php echo $this->form->renderField('description'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3">
|
||||
<?php echo LayoutHelper::render('joomla.edit.global', $this); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo HTMLHelper::_('uitab.endTab'); ?>
|
||||
|
||||
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'images', Text::_('JGLOBAL_FIELDSET_OPTIONS')); ?>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<fieldset id="fieldset-image" class="options-form">
|
||||
<legend><?php echo Text::_('JGLOBAL_FIELDSET_IMAGE_OPTIONS'); ?></legend>
|
||||
<div>
|
||||
<?php foreach ($this->form->getGroup('images') as $field) : ?>
|
||||
<?php echo $field->renderField(); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<?php echo $this->loadTemplate('display'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo HTMLHelper::_('uitab.endTab'); ?>
|
||||
|
||||
<?php echo LayoutHelper::render('joomla.edit.params', $this); ?>
|
||||
|
||||
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'publishing', Text::_('JGLOBAL_FIELDSET_PUBLISHING')); ?>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<fieldset id="fieldset-publishingdata" class="options-form">
|
||||
<legend><?php echo Text::_('JGLOBAL_FIELDSET_PUBLISHING'); ?></legend>
|
||||
<div>
|
||||
<?php echo LayoutHelper::render('joomla.edit.publishingdata', $this); ?>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<fieldset id="fieldset-metadata" class="options-form">
|
||||
<legend><?php echo Text::_('JGLOBAL_FIELDSET_METADATA_OPTIONS'); ?></legend>
|
||||
<div>
|
||||
<?php echo LayoutHelper::render('joomla.edit.metadata', $this); ?>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo HTMLHelper::_('uitab.endTab'); ?>
|
||||
|
||||
<?php if (!$isModal && $assoc) : ?>
|
||||
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'associations', Text::_('JGLOBAL_FIELDSET_ASSOCIATIONS')); ?>
|
||||
<fieldset id="fieldset-associations" class="options-form">
|
||||
<legend><?php echo Text::_('JGLOBAL_FIELDSET_ASSOCIATIONS'); ?></legend>
|
||||
<div>
|
||||
<?php echo LayoutHelper::render('joomla.edit.associations', $this); ?>
|
||||
</div>
|
||||
</fieldset>
|
||||
<?php echo HTMLHelper::_('uitab.endTab'); ?>
|
||||
<?php elseif ($isModal && $assoc) : ?>
|
||||
<div class="hidden"><?php echo LayoutHelper::render('joomla.edit.associations', $this); ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php echo HTMLHelper::_('uitab.endTabSet'); ?>
|
||||
</div>
|
||||
<input type="hidden" name="task" value="">
|
||||
<input type="hidden" name="forcedLanguage" value="<?php echo $input->get('forcedLanguage', '', 'cmd'); ?>">
|
||||
<?php echo HTMLHelper::_('form.token'); ?>
|
||||
</form>
|
||||
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_newsfeeds
|
||||
*
|
||||
* @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Layout\LayoutHelper;
|
||||
|
||||
/** @var \Joomla\Component\Newsfeeds\Administrator\View\Newsfeed\HtmlView $this */
|
||||
|
||||
$this->fieldset = 'jbasic';
|
||||
?>
|
||||
|
||||
<fieldset id="fieldset-display" class="options-form">
|
||||
<legend><?php echo Text::_('JGLOBAL_FIELDSET_DISPLAY_OPTIONS'); ?></legend>
|
||||
<div>
|
||||
<?php echo LayoutHelper::render('joomla.edit.fieldset', $this); ?>
|
||||
</div>
|
||||
</fieldset>
|
||||
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_newsfeeds
|
||||
*
|
||||
* @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
/** @var \Joomla\Component\Newsfeeds\Administrator\View\Newsfeed\HtmlView $this */
|
||||
?>
|
||||
<div class="subhead noshadow mb-3">
|
||||
<?php echo $this->getDocument()->getToolbar('toolbar')->render(); ?>
|
||||
</div>
|
||||
<div class="container-popup">
|
||||
<?php $this->setLayout('edit'); ?>
|
||||
<?php echo $this->loadTemplate(); ?>
|
||||
</div>
|
||||
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_content
|
||||
*
|
||||
* @copyright (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\Component\Newsfeeds\Site\Helper\RouteHelper;
|
||||
|
||||
/** @var \Joomla\Component\Newsfeeds\Administrator\View\Newsfeed\HtmlView $this */
|
||||
|
||||
$icon = 'icon-check';
|
||||
$title = $this->item ? $this->item->name : '';
|
||||
$content = $this->item ? $this->item->alias : '';
|
||||
$data = ['contentType' => 'com_newsfeeds.newsfeed'];
|
||||
|
||||
if ($this->item) {
|
||||
$data['id'] = $this->item->id;
|
||||
$data['title'] = $this->item->name;
|
||||
$data['catId'] = $this->item->catid;
|
||||
$data['uri'] = RouteHelper::getNewsfeedRoute($this->item->id, $this->item->catid, $this->item->language);
|
||||
}
|
||||
|
||||
// Add Content select script
|
||||
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
|
||||
$wa = $this->getDocument()->getWebAssetManager();
|
||||
$wa->useScript('modal-content-select');
|
||||
|
||||
// The data for Content select script
|
||||
$this->getDocument()->addScriptOptions('content-select-on-load', $data, false);
|
||||
|
||||
?>
|
||||
|
||||
<div class="px-4 py-5 my-5 text-center">
|
||||
<span class="fa-8x mb-4 <?php echo $icon; ?>" aria-hidden="true"></span>
|
||||
<h1 class="display-5 fw-bold"><?php echo $title; ?></h1>
|
||||
<div class="col-lg-6 mx-auto">
|
||||
<p class="lead mb-4">
|
||||
<?php echo $content; ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user