first commit

This commit is contained in:
2026-02-08 21:16:11 +01:00
commit e17b7026fd
8881 changed files with 1160453 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
<?php
/**
* @copyright Copyright (c) 2009-2022 Ryan Demmer. All rights reserved
* @license GNU/GPL 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* JCE is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses
*/
defined('JPATH_PLATFORM') or die;
?>
<div class="row">
<?php if (!empty($this->sidebar)) : ?>
<div id="j-sidebar-container" class="j-sidebar-container span2 col-md-2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="j-main-container span10 col-md-10">
<?php else : ?>
<div id="j-main-container">
<?php endif; ?>
<div class="ui-jce row-fluid">
<iframe src="<?php echo $this->state->get('url');?>" frameborder="0" class="wf-admin-browser"></iframe>
</div>
</div>
</div>

View File

@@ -0,0 +1,56 @@
<?php
// Check to ensure this file is included in Joomla!
defined('JPATH_PLATFORM') or die;
class JceViewBrowser extends JViewLegacy
{
protected $icons;
protected $state;
/**
* Display the view.
*/
public function display($tpl = null)
{
if (!JPluginHelper::isEnabled('quickicon', 'jce')) {
JFactory::getApplication()->redirect('index.php?option=com_jce');
}
$user = JFactory::getUser();
$this->state = $this->get('State');
$this->params = JComponentHelper::getParams('com_jce');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
JHtml::_('jquery.framework');
$document = JFactory::getDocument();
$document->addStyleSheet(JURI::root(true) . '/media/com_jce/css/browser.min.css');
$this->addToolbar();
if (JFactory::getApplication()->input->getInt('sidebar', 1) == 1) {
$this->sidebar = JHtmlSidebar::render();
}
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
JToolbarHelper::title('JCE - ' . JText::_('WF_BROWSER_TITLE'), 'picture');
JHtmlSidebar::setAction('index.php?option=com_jce&view=browser');
}
}

View File

@@ -0,0 +1,32 @@
<?php
/**
* @copyright Copyright (c) 2009-2022 Ryan Demmer. All rights reserved
* @license GNU/GPL 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* JCE is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses
*/
defined('JPATH_PLATFORM') or die;
?>
<form action="index.php" method="post" name="adminForm" id="adminForm" class="form-horizontal">
<div class="ui-jce container-fluid">
<?php if (!empty($this->sidebar)) : ?>
<div id="j-sidebar-container" class="span2 col-md-2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10 col-md-10">
<?php else : ?>
<div id="j-main-container">
<?php endif; ?>
<fieldset class="adminform panelform">
<?php echo JLayoutHelper::render('joomla.content.options_default', $this, WF_ADMINISTRATOR);?>
</fieldset>
</div>
</div>
<input type="hidden" name="option" value="com_jce" />
<input type="hidden" name="view" value="config" />
<input type="hidden" name="task" value="" />
<?php echo JHTML::_('form.token'); ?>
</form>

View File

@@ -0,0 +1,62 @@
<?php
/**
* @copyright Copyright (c) 2009-2022 Ryan Demmer. All rights reserved
* @license GNU/GPL 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* JCE is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses
*/
defined('JPATH_PLATFORM') or die;
class JceViewConfig extends JViewLegacy
{
public $form;
public function display($tpl = null)
{
$document = JFactory::getDocument();
$this->form = $this->get('Form');
$this->name = JText :: _('WF_CONFIG');
$this->fieldsname = "config";
$this->formclass = 'form-horizontal options-grid-form options-grid-form-full';
$params = JComponentHelper::getParams('com_jce');
if ($params->get('inline_help', 1)) {
$this->formclass .= ' form-help-inline';
}
$this->addToolbar();
parent::display($tpl);
$document->addScript(JURI::root(true) . '/media/com_jce/js/core.min.js?' . md5(WF_VERSION));
}
/**
* Add the page title and toolbar.
*
* @since 3.0
*/
protected function addToolbar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
JToolbarHelper::title('JCE - ' . JText::_('WF_CONFIGURATION'), 'equalizer');
// If not checked out, can save the item.
if ($user->authorise('jce.config', 'com_jce')) {
JToolbarHelper::apply('config.apply');
JToolbarHelper::save('config.save');
}
JToolbarHelper::cancel('config.cancel', 'JTOOLBAR_CLOSE');
JToolbarHelper::divider();
JToolbarHelper::help('WF_CONFIG_EDIT');
}
}

View File

@@ -0,0 +1,57 @@
<?php
/**
* @copyright Copyright (c) 2009-2022 Ryan Demmer. All rights reserved
* @license GNU/GPL 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* JCE is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses
*/
defined('JPATH_PLATFORM') or die;
$user = JFactory::getUser();
$canEditPref = $user->authorise('core.admin', 'com_jce');
?>
<div class="ui-jce row row-fluid">
<div class="span12 col-md-12">
<nav id="wf-cpanel" class="quick-icons bg-transparent">
<ul class="unstyled mb-0 nav flex-wrap row-fluid">
<?php echo implode("\n", $this->icons); ?>
</ul>
</nav>
<dl class="dl-horizontal card card-body well">
<dt class="wf-tooltip" title="<?php echo JText::_('WF_CPANEL_SUPPORT') . '::' . JText::_('WF_CPANEL_SUPPORT_DESC'); ?>">
<?php echo JText::_('WF_CPANEL_SUPPORT'); ?>
</dt>
<dd><a href="https://www.joomlacontenteditor.net/support" target="_new">https://www.joomlacontenteditor.com/support</a></dd>
<dt class="wf-tooltip" title="<?php echo JText::_('WF_CPANEL_LICENCE') . '::' . JText::_('WF_CPANEL_LICENCE_DESC'); ?>">
<?php echo JText::_('WF_CPANEL_LICENCE'); ?>
</dt>
<dd><?php echo $this->state->get('licence'); ?></dd>
<dt class="wf-tooltip" title="<?php echo JText::_('WF_CPANEL_VERSION') . '::' . JText::_('WF_CPANEL_VERSION_DESC'); ?>">
<?php echo JText::_('WF_CPANEL_VERSION'); ?>
</dt>
<dd><?php echo $this->state->get('version'); ?></dd>
<?php if ($this->params->get('feed', 0) || $canEditPref): ?>
<dt class="wf-tooltip" title="<?php echo JText::_('WF_CPANEL_FEED') . '::' . JText::_('WF_CPANEL_FEED_DESC'); ?>">
<?php echo JText::_('WF_CPANEL_FEED'); ?>
</dt>
<dd>
<?php if ($this->params->get('feed', 0)): ?>
<ul class="unstyled wf-cpanel-newsfeed">
<li><?php echo JText::_('WF_CPANEL_FEED_NONE'); ?></li>
</ul>
<?php else: ?>
<?php echo JText::_('WF_CPANEL_FEED_DISABLED'); ?> :: <a id="newsfeed_enable" title="<?php echo JText::_('WF_PREFERENCES'); ?>" href="#">[<?php echo JText::_('WF_CPANEL_FEED_ENABLE'); ?>]</a>
<?php endif;?>
</dd>
<?php endif;?>
</dl>
<?php if (!WF_EDITOR_PRO):
echo JLayoutHelper::render('message.upgrade', $this);
endif;?>
</div>
</div>

View File

@@ -0,0 +1,62 @@
<?php
// Check to ensure this file is included in Joomla!
defined('JPATH_PLATFORM') or die;
jimport('joomla.application.component.view');
class JceViewCpanel extends JViewLegacy
{
protected $icons;
protected $state;
/**
* Display the view.
*/
public function display($tpl = null)
{
$user = JFactory::getUser();
$this->state = $this->get('State');
$this->icons = $this->get('Icons');
$this->params = JComponentHelper::getParams('com_jce');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
JHtml::_('jquery.framework');
$document = JFactory::getDocument();
$document->addScript(JURI::root(true) . '/media/com_jce/js/cpanel.min.js');
$document->addStyleSheet(JURI::root(true) . '/media/com_jce/css/cpanel.min.css');
$this->addToolbar();
$this->sidebar = JHtmlSidebar::render();
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$state = $this->get('State');
$user = JFactory::getUser();
JToolbarHelper::title('JCE - ' . JText::_('WF_CPANEL'), 'home');
$bar = JToolBar::getInstance('toolbar');
JHtmlSidebar::setAction('index.php?option=com_jce&view=cpanel');
if ($user->authorise('core.admin', 'com_jce')) {
JToolbarHelper::preferences('com_jce');
}
}
}

View File

@@ -0,0 +1,32 @@
<?php
/**
* @copyright Copyright (c) 2009-2022 Ryan Demmer. All rights reserved
* @license GNU/GPL 2 or later - https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* JCE is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses
*/
defined('JPATH_PLATFORM') or die;
?>
<form action="index.php" method="post" name="adminForm" id="adminForm" class="form-horizontal">
<div class="ui-jce container row-fluid">
<?php if (!empty($this->sidebar)): ?>
<div id="j-sidebar-container" class="span2 col-md-2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10 col-md-10">
<?php else: ?>
<div id="j-main-container">
<?php endif;?>
<fieldset class="adminform panelform">
<?php echo JLayoutHelper::render('joomla.content.options_default', $this);?>
</fieldset>
</div>
</div>
<input type="hidden" name="option" value="com_jce" />
<input type="hidden" name="view" value="mediabox" />
<input type="hidden" name="task" value="" />
<?php echo JHTML::_('form.token'); ?>
</form>

View File

@@ -0,0 +1,70 @@
<?php
/**
* @copyright Copyright (c) 2009-2022 Ryan Demmer. All rights reserved
* @license GNU/GPL 2 or later - https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* JCE is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses
*/
defined('JPATH_PLATFORM') or die;
class JceViewMediabox extends JViewLegacy
{
public $form;
public $data;
public function display($tpl = null)
{
$document = JFactory::getDocument();
$form = $this->get('Form');
$data = $this->get('Data');
// Bind the form to the data.
if ($form && $data) {
$form->bind($data);
}
$this->form = $form;
$this->data = $data;
$this->name = JText::_('WF_MEDIABOX');
$this->fieldsname = "";
$this->formclass = 'form-horizontal options-grid-form options-grid-form-full';
$params = JComponentHelper::getParams('com_jce');
if ($params->get('inline_help', 1)) {
$this->formclass .= ' form-help-inline';
}
$this->addToolbar();
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @since 3.0
*/
protected function addToolbar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
JToolbarHelper::title(JText::_('WF_MEDIABOX'), 'pictures');
// If not checked out, can save the item.
if ($user->authorise('jce.config', 'com_jce')) {
JToolbarHelper::apply('mediabox.apply');
JToolbarHelper::save('mediabox.save');
}
JToolbarHelper::cancel('mediabox.cancel', 'JTOOLBAR_CLOSE');
JToolbarHelper::divider();
JToolbarHelper::help('WF_MEDIABOX_EDIT');
}
}

View File

@@ -0,0 +1,61 @@
<?php
/**
* @copyright Copyright (c) 2009-2022 Ryan Demmer. All rights reserved
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU/GPL 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* JCE is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses
*/
defined('JPATH_PLATFORM') or die;
// Load tooltips behavior
JHtml::_('behavior.formvalidator');
JHtml::_('behavior.keepalive');
// Load JS message titles
JText::script('ERROR');
JText::script('WARNING');
JText::script('NOTICE');
JText::script('MESSAGE');
?>
<div class="ui-jce loading">
<div class="donut"></div>
<form action="<?php echo JRoute::_('index.php?option=com_jce'); ?>" id="adminForm" method="post" name="adminForm" class="form-validate">
<?php if (!empty( $this->sidebar)) : ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10">
<?php else : ?>
<div id="j-main-container">
<?php endif; ?>
<div class="row row-fluid">
<!-- Begin Content -->
<div class="span12 col-md-12">
<?php echo JHtml::_('bootstrap.startTabSet', 'profile', array('active' => 'profile-setup'));?>
<?php foreach(array('setup', 'features', 'editor', 'plugins') as $item) :?>
<?php echo JHtml::_('bootstrap.addTab', 'profile', 'profile-' . $item, JText::_('WF_PROFILES_' . strtoupper($item), true));?>
<div class="row-fluid">
<?php echo $this->loadTemplate($item); ?>
</div>
<?php echo JHtml::_('bootstrap.endTab');?>
<?php endforeach;?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
</div>
<!-- End Content -->
</div>
<input type="hidden" name="task" value="" />
<input type="hidden" name="id" value="<?php echo $this->item->id;?>" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>
</div>

View File

@@ -0,0 +1,30 @@
<?php
/**
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
*/
defined('JPATH_PLATFORM') or die;
?>
<div class="tabbable tabs-left flex-column">
<?php //echo JHtml::_('bootstrap.startTabSet', 'profile-editor', array('active' => 'profile-editor-setup')); ?>
<ul class="nav nav-tabs">
<?php foreach(array('setup', 'typography', 'filesystem', 'advanced') as $key => $item) : ?>
<li class="nav-item<?php echo $key === 0 ? ' active show' : '';?>"><a href="#" class="nav-link"><?php echo JText::_('WF_PROFILES_EDITOR_' . strtoupper($item), true);?></a></li>
<?php endforeach;?>
</ul>
<div class="tab-content">
<?php foreach(array('setup', 'typography', 'filesystem', 'advanced') as $key => $item) : ?>
<div class="tab-pane<?php echo $key === 0 ? ' active show' : '';?>">
<?php //echo JHtml::_('bootstrap.addTab', 'profile-editor', 'profile-editor-' . $item, JText::_('WF_PROFILES_EDITOR_' . strtoupper($item), true));?>
<div class="row-fluid">
<?php echo $this->loadTemplate('editor_' . $item); ?>
</div>
</div>
<?php //echo JHtml::_('bootstrap.endTab');?>
<?php endforeach;?>
</div>
<?php //echo JHtml::_('bootstrap.endTabSet'); ?>
</div>

View File

@@ -0,0 +1,15 @@
<?php
/**
* @copyright Copyright (c) 2009-2022 Ryan Demmer. All rights reserved
* @license GNU/GPL 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* JCE is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses
*/
defined('JPATH_PLATFORM') or die;
$this->name = JText::_('WF_PROFILES_EDITOR_ADVANCED');
$this->fieldsname = 'editor.advanced';
echo JLayoutHelper::render('joomla.content.options_default', $this);

View File

@@ -0,0 +1,15 @@
<?php
/**
* @copyright Copyright (c) 2009-2022 Ryan Demmer. All rights reserved
* @license GNU/GPL 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* JCE is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses
*/
defined('JPATH_PLATFORM') or die;
$this->name = JText::_('WF_PROFILES_EDITOR_FILESYSTEM');
$this->fieldsname = 'editor.filesystem';
echo JLayoutHelper::render('joomla.content.options_default', $this);

View File

@@ -0,0 +1,15 @@
<?php
/**
* @copyright Copyright (c) 2009-2022 Ryan Demmer. All rights reserved
* @license GNU/GPL 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* JCE is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses
*/
defined('JPATH_PLATFORM') or die;
$this->name = JText::_('WF_PROFILES_EDITOR_SETUP');
$this->fieldsname = 'editor.setup';
echo JLayoutHelper::render('joomla.content.options_default', $this);

View File

@@ -0,0 +1,15 @@
<?php
/**
* @copyright Copyright (c) 2009-2022 Ryan Demmer. All rights reserved
* @license GNU/GPL 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* JCE is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses
*/
defined('JPATH_PLATFORM') or die;
$this->name = JText::_('WF_PROFILES_EDITOR_TYPOGRAPHY');
$this->fieldsname = 'editor.typography';
echo JLayoutHelper::render('joomla.content.options_default', $this);

View File

@@ -0,0 +1,23 @@
<?php
/**
* @copyright Copyright (c) 2009-2022 Ryan Demmer. All rights reserved
* @license GNU/GPL 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* JCE is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses
*/
defined('JPATH_PLATFORM') or die;
$this->name = JText::_('WF_PROFILES_FEATURES_LAYOUT');
$this->fieldsname = 'editor.features';
echo JLayoutHelper::render('joomla.content.options_default', $this);
?>
<div class="form-horizontal">
<?php echo JLayoutHelper::render('edit.layout', $this);?>
<?php echo JLayoutHelper::render('edit.additional', $this);?>
</div>
<input type="hidden" name="jform[plugins]" value="" />
<input type="hidden" name="jform[rows]" value="" />

View File

@@ -0,0 +1,96 @@
<?php
/**
* @copyright Copyright (c) 2009-2022 Ryan Demmer. All rights reserved
* @license GNU/GPL 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* JCE is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses
*/
$plugins = array_values(array_filter($this->plugins, function($plugin) {
return $plugin->editable && !empty($plugin->form);
}));
?>
<div class="<?php echo $this->formclass;?> tabbable tabs-left flex-column">
<?php //echo JHtml::_('bootstrap.startTabSet', 'profile-plugins', array('active' => 'profile-plugins-' . $plugins[0]->name));?>
<ul class="nav nav-tabs" id="profile-plugins-tabs">
<?php
$key = 0;
foreach ($plugins as $plugin) :
$plugin->state = "hide";
if ($plugin->active) {
$plugin->state = "";
$key++;
if ($key === 1) {
$plugin->state = "active";
}
}
$icons = '';
$title = '';
$title .= '<p>' . $plugin->title . '</p>';
if (!empty($plugin->icon)) {
foreach ($plugin->icon as $icon) {
$icons .= '<div class="mce-widget mce-btn mceButton ' . $plugin->class . '" title="' . $plugin->title . '"><span class="mce-ico mce-i-' . $icon . ' mceIcon mce_' . $icon . '"></span></div>';
}
$title .= '<div class="mceEditor mceDefaultSkin"><div class="mce-container mce-toolbar mceToolbarItem">' . $icons . '</div></div>';
}
//echo JHtml::_('bootstrap.addTab', 'profile-plugins', 'profile-plugins-' . $plugin->name, $title); ?>
<li class="nav-item <?php echo $plugin->state;?>"><a href="#profile-plugins-<?php echo $plugin->name;?>" class="nav-link"><?php echo $title;?></a></li>
<?php endforeach;?>
</ul>
<div class="tab-content">
<?php foreach ($plugins as $plugin) : ?>
<div class="tab-pane <?php echo $plugin->state;?>" id="profile-plugins-<?php echo $plugin->name;?>">
<div class="row-fluid">
<?php if ($plugin->form) :
$plugin->fieldsname = "config";
$plugin->name = $plugin->title;
$plugin->description = "";
echo JLayoutHelper::render('joomla.content.options_default', $plugin);
foreach ($plugin->extensions as $type => $extensions) : ?>
<h3><?php echo JText::_('WF_EXTENSIONS_' . strtoupper($type) . '_TITLE', true); ?></h3>
<?php foreach ($extensions as $name => $extension) : ?>
<div class="row-fluid">
<?php if ($extension->form) :
$extension->fieldsname = "";
$extension->name = JText::_($extension->title, true);
$extension->description = "";
echo JLayoutHelper::render('joomla.content.options_default', $extension);
endif; ?>
</div>
<?php endforeach; ?>
<?php endforeach;
endif; ?>
</div>
<?php //echo JHtml::_('bootstrap.endTab');?>
</div>
<?php endforeach;?>
</div>
<?php //echo JHtml::_('bootstrap.endTabSet'); ?>
</div>

View File

@@ -0,0 +1,15 @@
<?php
/**
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
*/
defined('JPATH_PLATFORM') or die;
$this->name = JText::_('WF_PROFILES_DETAILS');
$this->fieldsname = 'setup';
echo JLayoutHelper::render('joomla.content.options_default', $this);
$this->name = JText::_('WF_PROFILES_ASSIGNMENT');
$this->fieldsname = 'assignment';
echo JLayoutHelper::render('joomla.content.options_default', $this);

View File

@@ -0,0 +1,110 @@
<?php
/**
* @copyright Copyright (c) 2009-2022 Ryan Demmer. All rights reserved
* @license GNU/GPL 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* JCE is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses
*/
defined('JPATH_PLATFORM') or die;
class JceViewProfile extends JViewLegacy
{
protected $state;
protected $item;
public $form;
/**
* Display the view.
*/
public function display($tpl = null)
{
$this->state = $this->get('State');
$this->item = $this->get('Item');
$this->form = $this->get('Form');
$this->formclass = 'form-horizontal options-grid-form options-grid-form-full';
$params = JComponentHelper::getParams('com_jce');
if ($params->get('inline_help', 1)) {
$this->formclass .= ' form-help-inline';
}
$this->plugins = $this->get('Plugins');
$this->rows = $this->get('Rows');
$this->available = $this->get('AvailableButtons');
$this->additional = $this->get('AdditionalPlugins');
// load language files
$language = JFactory::getLanguage();
$language->load('com_jce', JPATH_SITE);
$language->load('com_jce_pro', JPATH_SITE);
// set JLayoutHelper base path
JLayoutHelper::$defaultBasePath = JPATH_COMPONENT_ADMINISTRATOR;
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
$this->addToolbar();
parent::display($tpl);
// only in Joomla 3.x
if (version_compare(JVERSION, '4', 'lt')) {
JHtml::_('formbehavior.chosen', 'select');
}
// version hash
$hash = md5(WF_VERSION);
$document = JFactory::getDocument();
$document->addStyleSheet(JURI::root(true) . '/media/com_jce/css/profile.min.css?' . $hash);
$document->addStyleSheet(JURI::root(true) . '/components/com_jce/editor/libraries/vendor/jquery/css/jquery-ui.min.css?' . $hash);
$document->addScript(JURI::root(true) . '/components/com_jce/editor/libraries/vendor/jquery/js/jquery-ui.min.js?' . $hash);
$document->addScript(JURI::root(true) . '/media/com_jce/js/core.min.js?' . $hash);
$document->addScript(JURI::root(true) . '/media/com_jce/js/profile.min.js?' . $hash);
// default theme
$document->addStyleSheet(JURI::root(true) . '/components/com_jce/editor/tiny_mce/themes/advanced/skins/default/ui.admin.css?' . $hash);
}
/**
* Add the page title and toolbar.
*
* @since 2.7
*/
protected function addToolbar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
$canEdit = $user->authorise('core.create', 'com_jce');
JToolbarHelper::title(JText::_('WF_PROFILES_EDIT'), 'user');
// For new records, check the create permission.
if ($canEdit) {
JToolbarHelper::apply('profile.apply');
JToolbarHelper::save('profile.save');
JToolbarHelper::save2new('profile.save2new');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel('profile.cancel');
} else {
JToolbarHelper::cancel('profile.cancel', 'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help('WF_PROFILES_EDIT');
}
}

View File

@@ -0,0 +1,142 @@
<?php
/**
* @copyright Copyright (c) 2009-2022 Ryan Demmer. All rights reserved
* @license GNU/GPL 3 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* JCE is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses
*/
defined('JPATH_PLATFORM') or die;
// Include the component HTML helpers.
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHtml::_('behavior.multiselect');
$user = JFactory::getUser();
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$saveOrder = $listOrder == 'ordering';
if ($saveOrder)
{
$saveOrderingUrl = 'index.php?option=com_jce&task=profiles.saveOrderAjax&tmpl=component';
JHtml::_('sortablelist.sortable', 'profileList', 'adminForm', strtolower($listDirn), $saveOrderingUrl);
}
?>
<form action="<?php echo JRoute::_('index.php?option=com_jce&view=profiles'); ?>" method="post" enctype="multipart/form-data" name="adminForm" id="adminForm">
<div class="ui-jce row">
<?php if (!empty($this->sidebar)): ?>
<div id="j-sidebar-container" class="j-sidebar-container span2 col-md-2">
<?php echo $this->sidebar; ?>
</div>
<div class="col-md-10">
<div id="j-main-container" class="j-main-container span10">
<?php else: ?>
<div id="j-main-container" class="j-main-container span10">
<?php endif;?>
<?php echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?>
<?php if (empty($this->items)): ?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table table-striped" id="profileList">
<thead>
<tr>
<th width="1%" class="nowrap center hidden-phone text-center d-none d-md-table-cell">
<?php echo JHtml::_('searchtools.sort', '', 'ordering', $listDirn, $listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?>
</th>
<th style="width:1%" class="nowrap center text-center">
<?php echo JHtml::_('grid.checkall'); ?>
</th>
<th style="width:1%" class="nowrap center text-center">
<?php echo JHtml::_('searchtools.sort', 'JSTATUS', 'published', $listDirn, $listOrder); ?>
</th>
<th class="title">
<?php echo JHtml::_('searchtools.sort', 'JGLOBAL_TITLE', 'name', $listDirn, $listOrder); ?>
</th>
<th class="title hidden-phone">
<?php echo JText::_('JGLOBAL_DESCRIPTION'); ?>
</th>
<th style="width:5%" class="nowrap hidden-phone center d-none d-md-table-cell text-center">
<?php echo JHtml::_('searchtools.sort', 'JGRID_HEADING_ID', 'id', $listDirn, $listOrder); ?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="8">
<?php echo $this->pagination->getListFooter(); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php foreach ($this->items as $i => $item) :
$ordering = ($listOrder == 'ordering');
$canEdit = $user->authorise('core.edit', 'com_jce');
$canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->get('id') || $item->checked_out == 0;
$canChange = $user->authorise('core.edit.state', 'com_jce') && $canCheckin;
?>
<tr class="row<?php echo $i % 2; ?>">
<td class="order nowrap center hidden-phone text-center d-none d-md-table-cell">
<?php
$iconClass = '';
if (!$canChange)
{
$iconClass = ' inactive';
}
elseif (!$saveOrder)
{
$iconClass = ' inactive tip-top hasTooltip" title="' . JHtml::_('tooltipText', 'JORDERINGDISABLED');
}
?>
<span class="sortable-handler<?php echo $iconClass; ?>">
<span class="icon-menu" aria-hidden="true"></span>
</span>
<?php if ($canChange && $saveOrder) : ?>
<input type="text" style="display:none" name="order[]" size="5" value="<?php echo $item->ordering; ?>" class="width-20 text-area-order">
<?php endif; ?>
</td>
<td class="center text-center">
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
</td>
<td class="center text-center">
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'profiles.', $canChange); ?>
</td>
<td>
<?php if ($item->checked_out) : ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $item->checked_out, $item->checked_out_time, 'profiles.', $canCheckin); ?>
<?php endif; ?>
<?php if ($canEdit) : ?>
<?php $editIcon = $item->checked_out ? '' : '<span class="mr-2" aria-hidden="true"></span>'; ?>
<a class="hasTooltip" href="<?php echo JRoute::_('index.php?option=com_jce&task=profile.edit&id=' . (int) $item->id); ?>" title="<?php echo JText::_('JACTION_EDIT'); ?> <?php echo $this->escape(addslashes($item->name)); ?>">
<?php echo $editIcon; ?><?php echo $item->name; ?></a>
<?php else : ?>
<?php echo $item->name; ?>
<?php endif; ?>
</td>
<td class="nowrap hidden-phone d-none d-md-table-cell text-left">
<?php echo $this->escape($item->description); ?>
</td>
<td class="nowrap center hidden-phone d-none d-md-table-cell text-center">
<?php echo (int) $item->id; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<?php echo JHtml::_('form.token'); ?>
</div>
</div>
</div>
</form>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_JCE_PROFILES_VIEW_DEFAULT_TITLE">
<message>
<![CDATA[COM_JCE_PROFILES_VIEW_DEFAULT_DESC]]>
</message>
</layout>
</metadata>

View File

@@ -0,0 +1,120 @@
<?php
// Check to ensure this file is included in Joomla!
defined('JPATH_PLATFORM') or die;
class JceViewProfiles extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
protected function isEmpty()
{
// Create a new query object.
$db = JFactory::getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select('COUNT(id)')->from($db->quoteName('#__wf_profiles'));
$db->setQuery($query);
return $db->loadResult() == 0;
}
/**
* Display the view.
*/
public function display($tpl = null)
{
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
$this->params = JComponentHelper::getParams('com_jce');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
if ($this->isEmpty()) {
$link = JHTML::link('index.php?option=com_jce&task=profiles.repair&' . JSession::getFormToken() . '=1', JText::_('WF_DB_CREATE_RESTORE'), array('class' => 'wf-profiles-repair'));
JFactory::getApplication()->enqueueMessage(JText::_('WF_DB_PROFILES_ERROR') . ' - ' . $link, 'error');
}
JHtml::_('jquery.framework');
// only in Joomla 3.x
if (version_compare(JVERSION, '4', 'lt')) {
JHtml::_('formbehavior.chosen', 'select');
}
$document = JFactory::getDocument();
$document->addScript(JURI::root(true) . '/media/com_jce/js/profiles.min.js');
$document->addStyleSheet(JURI::root(true) . '/media/com_jce/css/profiles.min.css');
$this->addToolbar();
$this->sidebar = JHtmlSidebar::render();
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$state = $this->get('State');
$user = JFactory::getUser();
JToolbarHelper::title('JCE - ' . JText::_('WF_PROFILES'), 'users');
$bar = JToolBar::getInstance('toolbar');
if ($user->authorise('jce.profiles', 'com_jce')) {
JToolbarHelper::addNew('profile.add');
JToolbarHelper::custom('profiles.copy', 'copy', 'copy', 'WF_PROFILES_COPY', true);
// Instantiate a new JLayoutFile instance and render the layout
$layout = new JLayoutFile('toolbar.uploadprofile');
$bar->appendButton('Custom', $layout->render(array()), 'upload');
JToolbarHelper::custom('profiles.export', 'download', 'download', 'WF_PROFILES_EXPORT', true);
JToolbarHelper::publish('profiles.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish('profiles.unpublish', 'JTOOLBAR_UNPUBLISH', true);
JToolbarHelper::deleteList('', 'profiles.delete', 'JTOOLBAR_DELETE');
}
JHtmlSidebar::setAction('index.php?option=com_jce&view=profiles');
if ($user->authorise('core.admin', 'com_jce')) {
JToolbarHelper::preferences('com_jce');
}
}
/**
* Returns an array of fields the table can be sorted by.
*
* @return array Array containing the field name to sort by as the key and display text as value
*
* @since 3.0
*/
protected function getSortFields()
{
return array(
'ordering' => JText::_('JGRID_HEADING_ORDERING'),
'name' => JText::_('JGLOBAL_TITLE'),
'published' => JText::_('JSTATUS'),
'id' => JText::_('JGRID_HEADING_ID'),
);
}
}