Skip to content

Commit

Permalink
Merge branch '5.0-dev' into document-event
Browse files Browse the repository at this point in the history
  • Loading branch information
Fedik committed May 7, 2023
2 parents 1ccfd5a + 03a4f5f commit 34024c5
Show file tree
Hide file tree
Showing 272 changed files with 2,292 additions and 911 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/create-translation-pull-request-v4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
git remote add upstream https://github.com/joomla/joomla-cms.git
git fetch upstream
git checkout --progress --force -B translation refs/remotes/origin/translation
git merge upstream/4.2-dev
git merge upstream/4.3-dev
- name: Fetch and extract translations
run: |
Expand Down Expand Up @@ -74,4 +74,4 @@ jobs:
GITHUB_TOKEN: ${{ secrets.API_TOKEN_GITHUB }}
run: |
gh pr list -R joomla/joomla-cms --state open --author joomla-translation-bot -S "Translation Update" | grep -v "No pull" || \
gh pr create --title "Translation Update" --body "Automatically created pull request based on core-translation repository changes" -R joomla/joomla-cms --base 4.2-dev
gh pr create --title "Translation Update" --body "Automatically created pull request based on core-translation repository changes" -R joomla/joomla-cms --base 4.3-dev
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
use Joomla\CMS\Mail\Exception\MailDisabledException;
use Joomla\CMS\Mail\MailTemplate;
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
use Joomla\CMS\User\UserFactoryAwareInterface;
use Joomla\CMS\User\UserFactoryAwareTrait;
use Joomla\Component\Actionlogs\Administrator\Helper\ActionlogsHelper;
use Joomla\Utilities\IpHelper;
use PHPMailer\PHPMailer\Exception as phpMailerException;
Expand All @@ -30,8 +32,10 @@
*
* @since 3.9.0
*/
class ActionlogModel extends BaseDatabaseModel
class ActionlogModel extends BaseDatabaseModel implements UserFactoryAwareInterface
{
use UserFactoryAwareTrait;

/**
* Function to add logs to the database
* This method adds a record to #__action_logs contains (message_language_key, message, date, context, user)
Expand All @@ -45,9 +49,13 @@ class ActionlogModel extends BaseDatabaseModel
*
* @since 3.9.0
*/
public function addLog($messages, $messageLanguageKey, $context, $userId = null)
public function addLog($messages, $messageLanguageKey, $context, $userId = 0)
{
$user = Factory::getUser($userId);
if (!is_numeric($userId)) {
@trigger_error(sprintf('User ID must be an integer in %s.', __METHOD__), E_USER_DEPRECATED);
}

$user = $userId ? $this->getUserFactory()->loadUserById($userId) : $this->getCurrentUser();
$db = $this->getDatabase();
$date = Factory::getDate();
$params = ComponentHelper::getComponent('com_actionlogs')->getParams();
Expand Down
7 changes: 3 additions & 4 deletions administrator/components/com_admin/src/Model/HelpModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class HelpModel extends BaseDatabaseModel
* @var array
* @since 1.6
*/
protected $toc = null;
protected $toc = [];

/**
* URL for the latest version check
Expand Down Expand Up @@ -128,7 +128,7 @@ public function getLangTag()
*/
public function &getToc()
{
if (!\is_null($this->toc)) {
if (\count($this->toc)) {
return $this->toc;
}

Expand All @@ -152,8 +152,7 @@ public function &getToc()
}

// Get Help files
$files = Folder::files(JPATH_BASE . '/help/' . $lang_tag, '\.xml$|\.html$');
$this->toc = [];
$files = Folder::files(JPATH_BASE . '/help/' . $lang_tag, '\.xml$|\.html$');

foreach ($files as $file) {
$buffer = file_get_contents(JPATH_BASE . '/help/' . $lang_tag . '/' . $file);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ class HtmlView extends BaseHtmlView
*/
private $isEmptyState = false;

/**
* The ordering list for the categories
*
* @var array
* @since __DEPLOY_VERSION__
*/
protected $ordering = [];

/**
* Display the view
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ protected function addToolbar()
$saveGroup->configure(
function (Toolbar $childBar) {
$childBar->save('category.save');
$childBar->save('category.save2new');
$childBar->save2new('category.save2new');
}
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,22 @@ class HtmlView extends BaseHtmlView
*/
private $isEmptyState = false;

/**
* Is the vote plugin enabled on the site
*
* @var boolean
* @since __DEPLOY_VERSION__
*/
protected $vote = false;

/**
* Are hits being recorded on the site?
*
* @var boolean
* @since __DEPLOY_VERSION__
*/
protected $hits = false;

/**
* Display the view
*
Expand All @@ -99,7 +115,7 @@ public function display($tpl = null)
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
$this->vote = PluginHelper::isEnabled('content', 'vote');
$this->hits = ComponentHelper::getParams('com_content')->get('record_hits', 1);
$this->hits = ComponentHelper::getParams('com_content')->get('record_hits', 1) == 1;

if (!\count($this->items) && $this->isEmptyState = $this->get('IsEmptyState')) {
$this->setLayout('emptystate');
Expand Down
6 changes: 3 additions & 3 deletions administrator/components/com_finder/src/Indexer/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public static function addContentType($title, $mime = null)
*/
public static function isCommon($token, $lang)
{
static $data, $default, $multilingual;
static $data = [], $default, $multilingual;

if (is_null($multilingual)) {
$multilingual = Multilanguage::isEnabled();
Expand Down Expand Up @@ -348,7 +348,7 @@ public static function getDefaultLanguage()
*/
public static function getPrimaryLanguage($lang)
{
static $data;
static $data = [];

// Only parse the identifier if necessary.
if (!isset($data[$lang])) {
Expand Down Expand Up @@ -390,7 +390,7 @@ public static function getContentExtras(Result $item)
*
* @param string $text The content to process.
* @param Registry $params The parameters object. [optional]
* @param Result $item The item which get prepared. [optional]
* @param ?Result $item The item which get prepared. [optional]
*
* @return string The processed content.
*
Expand Down
18 changes: 9 additions & 9 deletions administrator/components/com_finder/src/Indexer/Indexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class Indexer
/**
* Indexer constructor.
*
* @param DatabaseInterface $db The database
* @param ?DatabaseInterface $db The database
*
* @since 3.8.0
*/
Expand Down Expand Up @@ -147,7 +147,7 @@ public function __construct(DatabaseInterface $db = null)
/**
* Method to get the indexer state.
*
* @return object The indexer state object.
* @return CMSObject The indexer state object.
*
* @since 2.5
*/
Expand Down Expand Up @@ -776,7 +776,7 @@ public function optimize()
/**
* Method to get a content item's signature.
*
* @param object $item The content item to index.
* @param Result $item The content item to index.
*
* @return string The content item's signature.
*
Expand All @@ -800,12 +800,12 @@ protected static function getSignature($item)
/**
* Method to parse input, tokenize it, and then add it to the database.
*
* @param mixed $input String or resource to use as input. A resource input will automatically be chunked to conserve
* memory. Strings will be chunked if longer than 2K in size.
* @param integer $context The context of the input. See context constants.
* @param string $lang The language of the input.
* @param string $format The format of the input.
* @param integer $count Number of words indexed so far.
* @param string|resource $input String or resource to use as input. A resource input will automatically be chunked to conserve
* memory. Strings will be chunked if longer than 2K in size.
* @param integer $context The context of the input. See context constants.
* @param string $lang The language of the input.
* @param string $format The format of the input.
* @param integer $count Number of terms indexed so far.
*
* @return integer The number of tokens extracted from the input.
*
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_finder/src/Indexer/Taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ public static function removeOrphanNodes()
*
* @param integer $id Id of the taxonomy
*
* @return object|array A taxonomy object or an array of all taxonomies
* @return object|object[] A taxonomy object or an array of all taxonomies
*
* @since 4.0.0
*/
Expand Down Expand Up @@ -474,7 +474,7 @@ public static function getTaxonomy($id = 0)
*
* @param string $title Title of the branch
*
* @return object|array The object with the branch data or an array of all branches
* @return object|object[] The object with the branch data or an array of all branches
*
* @since 4.0.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ protected function loadFormData()
/**
* Method to get the total indexed items
*
* @return number the number of indexed items
* @return integer The count of indexed items
*
* @since 3.5
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class FiltersModel extends ListModel
/**
* Constructor.
*
* @param array $config An optional associative array of configuration settings.
* @param MVCFactoryInterface $factory The factory.
* @param array $config An optional associative array of configuration settings.
* @param ?MVCFactoryInterface $factory The factory.
*
* @see \Joomla\CMS\MVC\Model\BaseDatabaseModel
* @since 3.7
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_finder/src/Model/IndexModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ class IndexModel extends ListModel
/**
* Constructor.
*
* @param array $config An optional associative array of configuration settings.
* @param MVCFactoryInterface $factory The factory.
* @param array $config An optional associative array of configuration settings.
* @param ?MVCFactoryInterface $factory The factory.
*
* @see \Joomla\CMS\MVC\Model\BaseDatabaseModel
* @since 3.7
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_finder/src/Model/MapsModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class MapsModel extends ListModel
/**
* Constructor.
*
* @param array $config An optional associative array of configuration settings.
* @param MVCFactoryInterface $factory The factory.
* @param array $config An optional associative array of configuration settings.
* @param ?MVCFactoryInterface $factory The factory.
*
* @see \Joomla\CMS\MVC\Model\BaseDatabaseModel
* @since 3.7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class SearchesModel extends ListModel
/**
* Constructor.
*
* @param array $config An optional associative array of configuration settings.
* @param MVCFactoryInterface $factory The factory.
* @param array $config An optional associative array of configuration settings.
* @param ?MVCFactoryInterface $factory The factory.
*
* @see \Joomla\CMS\MVC\Model\BaseDatabaseModel
* @since 4.0.0
Expand Down
12 changes: 6 additions & 6 deletions administrator/components/com_finder/src/Service/HTML/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,10 @@ public function slider($options = [])
/**
* Method to generate filters using select box dropdown controls.
*
* @param Query $idxQuery A Query object.
* @param array $options An array of options.
* @param Query $idxQuery A Query object.
* @param Registry $options An array of options.
*
* @return mixed A rendered HTML widget on success, null otherwise.
* @return string|null A rendered HTML widget on success, null otherwise.
*
* @since 2.5
*/
Expand Down Expand Up @@ -400,10 +400,10 @@ public function select($idxQuery, $options)
/**
* Method to generate fields for filtering dates
*
* @param Query $idxQuery A Query object.
* @param array $options An array of options.
* @param Query $idxQuery A Query object.
* @param Registry $options An array of options.
*
* @return mixed A rendered HTML widget on success, null otherwise.
* @return string A rendered HTML widget.
*
* @since 2.5
*/
Expand Down
25 changes: 4 additions & 21 deletions administrator/components/com_modules/src/View/Module/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,26 +116,9 @@ function (Toolbar $childBar) {

$toolbar->cancel('module.cancel', 'JTOOLBAR_CANCEL');
} else {
$toolbarButtons = [];

// Can't save the record if it's checked out.
if (!$checkedOut) {
// Since it's an existing record, check the edit permission.
if ($canDo->get('core.edit')) {
$toolbar->apply('module.apply');

$toolbarButtons[] = ['save', 'module.save'];

// We can save this record, but check the create permission to see if we can return to make a new one.
if ($canDo->get('core.create')) {
$toolbarButtons[] = ['save2new', 'module.save2new'];
}
}
}

// If checked out, we can still save
if ($canDo->get('core.create')) {
$toolbarButtons[] = ['save2copy', 'module.save2copy'];
if (!$checkedOut && $canDo->get('core.edit')) {
$toolbar->apply('module.apply');
}

$saveGroup = $toolbar->dropdownButton('save-group');
Expand All @@ -148,13 +131,13 @@ function (Toolbar $childBar) use ($checkedOut, $canDo) {

// We can save this record, but check the create permission to see if we can return to make a new one.
if ($canDo->get('core.create')) {
$childBar->save('module.save2new');
$childBar->save2new('module.save2new');
}
}

// If checked out, we can still save
if ($canDo->get('core.create')) {
$childBar->save('module.save2copy');
$childBar->save2copy('module.save2copy');
}
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,20 @@ class HtmlView extends BaseHtmlView
*/
private $isEmptyState = false;

/**
* Form object for search filters
*
* @var \Joomla\CMS\Form\Form
*/
public $filterForm;

/**
* The active search filters
*
* @var array
*/
public $activeFilters;

/**
* Execute and display a template script.
*
Expand Down
8 changes: 8 additions & 0 deletions administrator/components/com_tags/src/View/Tags/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ class HtmlView extends BaseHtmlView
*/
private $isEmptyState = false;

/**
* The ordering list for the tags
*
* @var array
* @since __DEPLOY_VERSION__
*/
protected $ordering = [];

/**
* Execute and display a template script.
*
Expand Down

0 comments on commit 34024c5

Please sign in to comment.