Skip to content

Commit

Permalink
Merge branch '4.0-dev' into crowdin.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
zero-24 committed Oct 3, 2018
2 parents 3ccf396 + d1765e4 commit 7e6a579
Show file tree
Hide file tree
Showing 213 changed files with 1,621 additions and 1,109 deletions.
3 changes: 0 additions & 3 deletions administrator/components/com_admin/tmpl/profile/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
use Joomla\CMS\Router\Route;
use Joomla\CMS\HTML\HTMLHelper;

// Include the component HTML helpers.
HTMLHelper::addIncludePath(JPATH_COMPONENT . '/helpers/html');

HTMLHelper::_('behavior.formvalidator');

// Get the form fieldsets.
Expand Down
3 changes: 0 additions & 3 deletions administrator/components/com_admin/tmpl/sysinfo/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
use Joomla\CMS\Router\Route;
use Joomla\CMS\HTML\HTMLHelper;

// Add specific helper files for html generation
HTMLHelper::addIncludePath(JPATH_COMPONENT . '/helpers/html');

HTMLHelper::_('behavior.tabstate');
?>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
defined('JPATH_BASE') or die;

use Joomla\CMS\Form\FormHelper;

\JLoader::register('BannersHelper', JPATH_ADMINISTRATOR . '/components/com_banners/helpers/banners.php');
use Joomla\Component\Banners\Administrator\Helper\BannersHelper;

FormHelper::loadFieldClass('list');

Expand Down Expand Up @@ -41,6 +40,6 @@ class BannerclientField extends \JFormFieldList
*/
public function getOptions()
{
return array_merge(parent::getOptions(), \BannersHelper::getClientOptions());
return array_merge(parent::getOptions(), BannersHelper::getClientOptions());
}
}
7 changes: 3 additions & 4 deletions administrator/components/com_banners/Model/BannerModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Joomla\CMS\Table\Table;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Factory;
use Joomla\Component\Categories\Administrator\Helper\CategoriesHelper;

/**
* Banner model.
Expand Down Expand Up @@ -498,15 +499,13 @@ public function save($data)
{
$input = Factory::getApplication()->input;

\JLoader::register('CategoriesHelper', JPATH_ADMINISTRATOR . '/components/com_categories/helpers/categories.php');

// Cast catid to integer for comparison
$catid = (int) $data['catid'];

// Check if New Category exists
if ($catid > 0)
{
$catid = \CategoriesHelper::validateCategoryId($data['catid'], 'com_banners');
$catid = CategoriesHelper::validateCategoryId($data['catid'], 'com_banners');
}

// Save New Category
Expand All @@ -520,7 +519,7 @@ public function save($data)
$table['published'] = 1;

// Create new category and get catid back
$data['catid'] = \CategoriesHelper::createCategory($table);
$data['catid'] = CategoriesHelper::createCategory($table);
}

// Alter the name for save as copy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ public function display($tpl = null)

$this->addToolbar();

// Include the component HTML helpers.
HTMLHelper::addIncludePath(JPATH_COMPONENT . '/helpers/html');

$this->sidebar = \JHtmlSidebar::render();

// We do not need to filter by language when multilingual is disabled
Expand All @@ -109,8 +106,6 @@ public function display($tpl = null)
*/
protected function addToolbar()
{
\JLoader::register('BannersHelper', JPATH_ADMINISTRATOR . '/components/com_banners/helpers/banners.php');

$canDo = ContentHelper::getActions('com_banners', 'category', $this->state->get('filter.category_id'));
$user = Factory::getUser();

Expand Down
2 changes: 0 additions & 2 deletions administrator/components/com_banners/View/Client/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Factory;

\JLoader::register('BannersHelper', JPATH_ADMINISTRATOR . '/components/com_banners/helpers/banners.php');

/**
* View to edit a client.
*
Expand Down
2 changes: 0 additions & 2 deletions administrator/components/com_banners/tmpl/banner/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\HTML\HTMLHelper;

HTMLHelper::addIncludePath(JPATH_COMPONENT . '/helpers/html');

HTMLHelper::_('behavior.formvalidator');
HTMLHelper::_('formbehavior.chosen', '#jform_catid', null, array('disable_search_threshold' => 0 ));

Expand Down
2 changes: 0 additions & 2 deletions administrator/components/com_banners/tmpl/banners/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;

HTMLHelper::addIncludePath(JPATH_COMPONENT . '/helpers/html');

HTMLHelper::_('behavior.multiselect');
HTMLHelper::_('behavior.tabstate');

Expand Down
1 change: 0 additions & 1 deletion administrator/components/com_banners/tmpl/client/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\HTML\HTMLHelper;

HTMLHelper::addIncludePath(JPATH_COMPONENT . '/helpers/html');
HTMLHelper::_('behavior.formvalidator');
?>

Expand Down
2 changes: 0 additions & 2 deletions administrator/components/com_banners/tmpl/clients/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;

HTMLHelper::addIncludePath(JPATH_COMPONENT . '/helpers/html');

HTMLHelper::_('behavior.multiselect');

$purchaseTypes = array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,8 @@
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;

// Include the component HTML helpers.
HTMLHelper::addIncludePath(JPATH_COMPONENT . '/helpers/html');

HTMLHelper::_('behavior.multiselect');


$user = Factory::getUser();
$userId = $user->get('id');
$extension = $this->escape($this->state->get('filter.extension'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@

JLoader::register('ContentHelperRoute', JPATH_ROOT . '/components/com_content/helpers/route.php');

// Include the component HTML helpers.
HTMLHelper::addIncludePath(JPATH_COMPONENT . '/helpers/html');

HTMLHelper::_('behavior.core');
HTMLHelper::_('bootstrap.popover', '.hasPopover', array('placement' => 'bottom'));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;

// Include the component HTML helpers.
HTMLHelper::addIncludePath(JPATH_COMPONENT . '/helpers/html');

HTMLHelper::_('behavior.formvalidator');
HTMLHelper::_('behavior.keepalive');
HTMLHelper::_('formbehavior.chosen', '.advancedSelect');
Expand Down
7 changes: 3 additions & 4 deletions administrator/components/com_contact/Model/ContactModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Joomla\CMS\Language\Associations;
use Joomla\CMS\Language\LanguageHelper;
use Joomla\CMS\MVC\Model\AdminModel;
use Joomla\Component\Categories\Administrator\Helper\CategoriesHelper;
use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;
Expand Down Expand Up @@ -371,15 +372,13 @@ public function save($data)
{
$input = Factory::getApplication()->input;

\JLoader::register('CategoriesHelper', JPATH_ADMINISTRATOR . '/components/com_categories/helpers/categories.php');

// Cast catid to integer for comparison
$catid = (int) $data['catid'];

// Check if New Category exists
if ($catid > 0)
{
$catid = \CategoriesHelper::validateCategoryId($data['catid'], 'com_contact');
$catid = CategoriesHelper::validateCategoryId($data['catid'], 'com_contact');
}

// Save New Category
Expand All @@ -393,7 +392,7 @@ public function save($data)
$table['published'] = 1;

// Create new category and get catid back
$data['catid'] = \CategoriesHelper::createCategory($table);
$data['catid'] = CategoriesHelper::createCategory($table);
}

// Alter the name for save as copy
Expand Down
3 changes: 0 additions & 3 deletions administrator/components/com_contact/tmpl/contact/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;

// Include the component HTML helpers.
HTMLHelper::addIncludePath(JPATH_COMPONENT . '/helpers/html');

HTMLHelper::_('behavior.formvalidator');
HTMLHelper::_('behavior.keepalive');
HTMLHelper::_('formbehavior.chosen', '#jform_catid', null, array('disable_search_threshold' => 0 ));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;

HTMLHelper::addIncludePath(JPATH_COMPONENT . '/helpers/html');

HTMLHelper::_('behavior.multiselect');
HTMLHelper::_('behavior.tabstate');

Expand Down
2 changes: 0 additions & 2 deletions administrator/components/com_contact/tmpl/contacts/modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@

JLoader::register('ContactHelperRoute', JPATH_ROOT . '/components/com_contact/helpers/route.php');

HTMLHelper::addIncludePath(JPATH_COMPONENT . '/helpers/html');

HTMLHelper::_('behavior.core');
HTMLHelper::_('bootstrap.popover', '.hasPopover', array('placement' => 'bottom'));
HTMLHelper::_('script', 'com_contact/admin-contacts-modal.min.js', array('version' => 'auto', 'relative' => true));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,34 @@
use Joomla\CMS\Association\AssociationServiceInterface;
use Joomla\CMS\Categories\CategoryServiceInterface;
use Joomla\CMS\Categories\CategoryServiceTrait;
use Joomla\CMS\Component\Router\RouterServiceInterface;
use Joomla\CMS\Component\Router\RouterServiceTrait;
use Joomla\CMS\Extension\BootableExtensionInterface;
use Joomla\CMS\Extension\MVCComponent;
use Joomla\CMS\Factory;
use Joomla\CMS\Fields\FieldsServiceInterface;
use Joomla\CMS\Form\Form;
use Joomla\CMS\HTML\HTMLRegistryAwareTrait;
use Joomla\CMS\MVC\Factory\MVCFactoryServiceInterface;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Workflow\WorkflowServiceInterface;
use Joomla\CMS\Workflow\WorkflowServiceTrait;
use Joomla\Component\Content\Administrator\Helper\ContentHelper;
use Joomla\Component\Content\Administrator\Service\HTML\AdministratorService;
use Joomla\Component\Content\Administrator\Service\HTML\Icon;
use Psr\Container\ContainerInterface;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Factory;

/**
* Component class for com_content
*
* @since __DEPLOY_VERSION__
*/
class ContentComponent extends MVCComponent implements
BootableExtensionInterface, CategoryServiceInterface, FieldsServiceInterface, AssociationServiceInterface, WorkflowServiceInterface
BootableExtensionInterface, CategoryServiceInterface, FieldsServiceInterface, AssociationServiceInterface,
WorkflowServiceInterface, RouterServiceInterface
{
use CategoryServiceTrait;
use AssociationServiceTrait;
use RouterServiceTrait;
use HTMLRegistryAwareTrait;
use WorkflowServiceTrait;

Expand Down
7 changes: 3 additions & 4 deletions administrator/components/com_content/Model/ArticleModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\Component\Categories\Administrator\Helper\CategoriesHelper;
use Joomla\Component\Content\Administrator\Extension\ContentComponent;
use Joomla\Component\Content\Administrator\Helper\ContentHelper;
use Joomla\Component\Workflow\Administrator\Table\StageTable;
Expand Down Expand Up @@ -699,15 +700,13 @@ public function save($data)
$data['images'] = (string) $registry;
}

\JLoader::register('CategoriesHelper', JPATH_ADMINISTRATOR . '/components/com_categories/helpers/categories.php');

// Cast catid to integer for comparison
$catid = (int) $data['catid'];

// Check if New Category exists
if ($catid > 0)
{
$catid = \CategoriesHelper::validateCategoryId($data['catid'], 'com_content');
$catid = CategoriesHelper::validateCategoryId($data['catid'], 'com_content');
}

// Save New Category
Expand All @@ -721,7 +720,7 @@ public function save($data)
$table['published'] = 1;

// Create new category and get catid back
$data['catid'] = \CategoriesHelper::createCategory($table);
$data['catid'] = CategoriesHelper::createCategory($table);
}

if (isset($data['urls']) && is_array($data['urls']))
Expand Down
6 changes: 3 additions & 3 deletions administrator/components/com_content/Service/HTML/Icon.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;
use Joomla\Component\Mailto\Site\Helper\MailtoHelper;
use Joomla\Registry\Registry;
use Joomla\CMS\Factory;

/**
* Content Component HTML Helper
*
Expand Down Expand Up @@ -98,13 +100,11 @@ public function create($category, $params, $attribs = array(), $legacy = false)
*/
public function email($article, $params, $attribs = array(), $legacy = false)
{
\JLoader::register('MailtoHelper', JPATH_SITE . '/components/com_mailto/helpers/mailto.php');

$uri = Uri::getInstance();
$base = $uri->toString(array('scheme', 'host', 'port'));
$template = $this->application->getTemplate();
$link = $base . Route::_(\ContentHelperRoute::getArticleRoute($article->slug, $article->catid, $article->language), false);
$url = 'index.php?option=com_mailto&tmpl=component&template=' . $template . '&link=' . \MailtoHelper::addLink($link);
$url = 'index.php?option=com_mailto&tmpl=component&template=' . $template . '&link=' . MailtoHelper::addLink($link);

$status = 'width=400,height=350,menubar=yes,resizable=yes';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
use Joomla\CMS\Helper\ContentHelper;
use Joomla\CMS\Toolbar\ToolbarHelper;

\JLoader::register('ContentHelper', JPATH_ADMINISTRATOR . '/components/com_content/helpers/content.php');

/**
* View class for a list of featured articles.
*
Expand Down Expand Up @@ -86,7 +84,7 @@ class HtmlView extends BaseHtmlView
*/
public function display($tpl = null)
{
\ContentHelper::addSubmenu('featured');
\Joomla\Component\Content\Administrator\Helper\ContentHelper::addSubmenu('featured');

$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
Expand Down
4 changes: 4 additions & 0 deletions administrator/components/com_content/services/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@

use Joomla\CMS\Association\AssociationExtensionInterface;
use Joomla\CMS\Categories\CategoryFactoryInterface;
use Joomla\CMS\Component\Router\RouterFactoryInterface;
use Joomla\CMS\Dispatcher\DispatcherFactoryInterface;
use Joomla\CMS\Extension\ComponentInterface;
use Joomla\CMS\Extension\Service\Provider\CategoryFactory;
use Joomla\CMS\Extension\Service\Provider\DispatcherFactory;
use Joomla\CMS\Extension\Service\Provider\MVCFactoryFactory;
use Joomla\CMS\Extension\Service\Provider\RouterFactory;
use Joomla\CMS\HTML\Registry;
use Joomla\CMS\MVC\Factory\MVCFactoryFactoryInterface;
use Joomla\Component\Content\Administrator\Extension\ContentComponent;
Expand Down Expand Up @@ -46,6 +48,7 @@ public function register(Container $container)
$container->registerServiceProvider(new CategoryFactory('\\Joomla\\Component\\Content'));
$container->registerServiceProvider(new MVCFactoryFactory('\\Joomla\\Component\\Content'));
$container->registerServiceProvider(new DispatcherFactory('\\Joomla\\Component\\Content'));
$container->registerServiceProvider(new RouterFactory('\\Joomla\\Component\\Content'));

$container->set(
ComponentInterface::class,
Expand All @@ -57,6 +60,7 @@ function (Container $container)
$component->setMvcFactoryFactory($container->get(MVCFactoryFactoryInterface::class));
$component->setCategoryFactory($container->get(CategoryFactoryInterface::class));
$component->setAssociationExtension($container->get(AssociationExtensionInterface::class));
$component->setRouterFactory($container->get(RouterFactoryInterface::class));

return $component;
}
Expand Down
3 changes: 0 additions & 3 deletions administrator/components/com_fields/tmpl/field/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Factory;

// Include the component HTML helpers.
HTMLHelper::addIncludePath(JPATH_COMPONENT . '/helpers/html');

HTMLHelper::_('behavior.formvalidator');
HTMLHelper::_('behavior.keepalive');
HTMLHelper::_('behavior.tabstate');
Expand Down

0 comments on commit 7e6a579

Please sign in to comment.