mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-27 04:18:55 +00:00
Compare commits
14 commits
1ee152e98f
...
2f0204c203
Author | SHA1 | Date | |
---|---|---|---|
|
2f0204c203 | ||
|
3b03f3a8f9 | ||
|
e47ba9e81d | ||
|
8d016bafa2 | ||
|
35221f8ba5 | ||
|
9219c03b36 | ||
|
72c3745868 | ||
|
579b4a8287 | ||
|
2f43c1facd | ||
|
d4a3311b76 | ||
|
8411da1819 | ||
|
b6c42b3768 | ||
|
da2733a7d8 | ||
|
b8204d24f9 |
7 changed files with 41 additions and 4 deletions
|
@ -1812,6 +1812,18 @@ switch ($mode)
|
||||||
$memberrow = array_merge($memberrow, $cp_row['row']);
|
$memberrow = array_merge($memberrow, $cp_row['row']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Modify the memberrow data before template variables are assigned.
|
||||||
|
*
|
||||||
|
* @event core.memberlist_modify_memberrow
|
||||||
|
* @var int user_id The current user ID.
|
||||||
|
* @var array row Array of raw user data.
|
||||||
|
* @var array memberrow Array of member template variables.
|
||||||
|
* @since 3.3.16-RC1
|
||||||
|
*/
|
||||||
|
$vars = ['user_id', 'row', 'memberrow'];
|
||||||
|
extract($phpbb_dispatcher->trigger_event('core.memberlist_modify_memberrow', compact($vars)));
|
||||||
|
|
||||||
$template->assign_block_vars('memberrow', $memberrow);
|
$template->assign_block_vars('memberrow', $memberrow);
|
||||||
|
|
||||||
if (isset($cp_row['blockrow']) && count($cp_row['blockrow']))
|
if (isset($cp_row['blockrow']) && count($cp_row['blockrow']))
|
||||||
|
|
|
@ -339,6 +339,14 @@ class helper
|
||||||
protected function render_language_select($selected_language = null)
|
protected function render_language_select($selected_language = null)
|
||||||
{
|
{
|
||||||
$langs = $this->lang_helper->get_available_languages();
|
$langs = $this->lang_helper->get_available_languages();
|
||||||
|
|
||||||
|
// The first language will be selected by default. Unless a user has consciously included
|
||||||
|
// other languages in the installation process, it will be British English anyway.
|
||||||
|
if ($selected_language === null && count($langs))
|
||||||
|
{
|
||||||
|
$selected_language = $langs[0]['iso'];
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($langs as $lang)
|
foreach ($langs as $lang)
|
||||||
{
|
{
|
||||||
$this->template->assign_block_vars('language_select_item', array(
|
$this->template->assign_block_vars('language_select_item', array(
|
||||||
|
|
|
@ -67,6 +67,20 @@ class language_file_helper
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
usort($available_languages, [$this, 'sort_by_local_name']);
|
||||||
|
|
||||||
return $available_languages;
|
return $available_languages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sorts the languages by their name instead of iso code
|
||||||
|
*
|
||||||
|
* @param mixed $a First language data
|
||||||
|
* @param mixed $b Second language data
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
private static function sort_by_local_name($a, $b): int
|
||||||
|
{
|
||||||
|
return $a['local_name'] <=> $b['local_name'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,9 +98,12 @@ class twig extends \phpbb\template\base
|
||||||
$this->twig = $twig_environment;
|
$this->twig = $twig_environment;
|
||||||
|
|
||||||
foreach ($extensions as $extension)
|
foreach ($extensions as $extension)
|
||||||
|
{
|
||||||
|
if (!$this->twig->hasExtension(get_class($extension)))
|
||||||
{
|
{
|
||||||
$this->twig->addExtension($extension);
|
$this->twig->addExtension($extension);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Add admin namespace
|
// Add admin namespace
|
||||||
if ($this->path_helper->get_adm_relative_path() !== null && is_dir($this->phpbb_root_path . $this->path_helper->get_adm_relative_path() . 'style/'))
|
if ($this->path_helper->get_adm_relative_path() !== null && is_dir($this->phpbb_root_path . $this->path_helper->get_adm_relative_path() . 'style/'))
|
||||||
|
|
|
@ -4,4 +4,4 @@
|
||||||
to hide visually and `aria-hidden="true"` to hide from screen-readers; using
|
to hide visually and `aria-hidden="true"` to hide from screen-readers; using
|
||||||
`hidden` or `display: none` would prevent the task from running.
|
`hidden` or `display: none` would prevent the task from running.
|
||||||
#}
|
#}
|
||||||
<img class="sr-only" aria-hidden="true" src="{{ CRON_TASK_URL|e('url') }}" width="1" height="1" alt="">
|
<img class="sr-only" aria-hidden="true" src="{{ CRON_TASK_URL|e('html_attr') }}" width="1" height="1" alt="">
|
||||||
|
|
|
@ -67,7 +67,7 @@ class phpbb_cron_wrapper_test extends phpbb_template_template_test_case
|
||||||
$this->template
|
$this->template
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->assertEquals('<img class="sr-only" aria-hidden="true" src="app.php%2Fcron%2Ffoo%3Ff%3D5" width="1" height="1" alt="">', str_replace(["\n", "\t"], '', $this->wrapper->get_html_tag()));
|
$this->assertEquals('<img class="sr-only" aria-hidden="true" src="app.php/cron/foo?f=5" width="1" height="1" alt="">', str_replace(["\n", "\t"], '', $this->wrapper->get_html_tag()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_is_parametrized_false()
|
public function test_is_parametrized_false()
|
||||||
|
|
Loading…
Add table
Reference in a new issue