mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-09 12:58:52 +00:00
[ticket/12769] Properly include FA
This commit is contained in:
parent
eab8a12fb8
commit
956723af0e
5 changed files with 54 additions and 7 deletions
4
phpBB/assets/css/font-awesome.min.css
vendored
Normal file
4
phpBB/assets/css/font-awesome.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -4411,6 +4411,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
|
||||||
'T_UPLOAD_PATH' => "{$web_path}{$config['upload_path']}/",
|
'T_UPLOAD_PATH' => "{$web_path}{$config['upload_path']}/",
|
||||||
'T_STYLESHEET_LINK' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme/stylesheet.css?assets_version=' . $config['assets_version'],
|
'T_STYLESHEET_LINK' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme/stylesheet.css?assets_version=' . $config['assets_version'],
|
||||||
'T_STYLESHEET_LANG_LINK'=> "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme/' . $user->lang_name . '/stylesheet.css?assets_version=' . $config['assets_version'],
|
'T_STYLESHEET_LANG_LINK'=> "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme/' . $user->lang_name . '/stylesheet.css?assets_version=' . $config['assets_version'],
|
||||||
|
'T_FONT_AWESOME_LINK' => !empty($config['allow_cdn']) && !empty($config['load_font_awesome_url']) ? $config['load_font_awesome_url'] : "{$web_path}assets/css/font-awesome.min.css?assets_version=" . $config['assets_version'],
|
||||||
'T_JQUERY_LINK' => !empty($config['allow_cdn']) && !empty($config['load_jquery_url']) ? $config['load_jquery_url'] : "{$web_path}assets/javascript/jquery.min.js?assets_version=" . $config['assets_version'],
|
'T_JQUERY_LINK' => !empty($config['allow_cdn']) && !empty($config['load_jquery_url']) ? $config['load_jquery_url'] : "{$web_path}assets/javascript/jquery.min.js?assets_version=" . $config['assets_version'],
|
||||||
'S_ALLOW_CDN' => !empty($config['allow_cdn']),
|
'S_ALLOW_CDN' => !empty($config['allow_cdn']),
|
||||||
|
|
||||||
|
|
29
phpBB/phpbb/db/migration/data/v320/font_awesome_update.php
Normal file
29
phpBB/phpbb/db/migration/data/v320/font_awesome_update.php
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* This file is part of the phpBB Forum Software package.
|
||||||
|
*
|
||||||
|
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
||||||
|
* @license GNU General Public License, version 2 (GPL-2.0)
|
||||||
|
*
|
||||||
|
* For full copyright and license information, please see
|
||||||
|
* the docs/CREDITS.txt file.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace phpbb\db\migration\data\v320;
|
||||||
|
|
||||||
|
class font_awesome_update extends \phpbb\db\migration\migration
|
||||||
|
{
|
||||||
|
public function effectively_installed()
|
||||||
|
{
|
||||||
|
return isset($this->config['load_font_awesome_url']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update_data()
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
array('config.add', array('load_font_awesome_url', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css')),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -44,6 +44,7 @@
|
||||||
})(document);
|
})(document);
|
||||||
</script>
|
</script>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
<link href="{T_FONT_AWESOME_LINK}" rel="stylesheet">
|
||||||
<link href="{T_STYLESHEET_LINK}" rel="stylesheet">
|
<link href="{T_STYLESHEET_LINK}" rel="stylesheet">
|
||||||
<link href="{T_STYLESHEET_LANG_LINK}" rel="stylesheet">
|
<link href="{T_STYLESHEET_LANG_LINK}" rel="stylesheet">
|
||||||
<link href="{T_THEME_PATH}/responsive.css?assets_version={T_ASSETS_VERSION}" rel="stylesheet" media="all and (max-width: 700px)" />
|
<link href="{T_THEME_PATH}/responsive.css?assets_version={T_ASSETS_VERSION}" rel="stylesheet" media="all and (max-width: 700px)" />
|
||||||
|
|
|
@ -16,16 +16,28 @@
|
||||||
*/
|
*/
|
||||||
class phpbb_functional_forum_style_test extends phpbb_functional_test_case
|
class phpbb_functional_forum_style_test extends phpbb_functional_test_case
|
||||||
{
|
{
|
||||||
|
public function test_font_awesome_style()
|
||||||
|
{
|
||||||
|
$crawler = self::request('GET', 'viewtopic.php?t=1&f=2');
|
||||||
|
$this->assertContains('font-awesome.min', $crawler->filter('head > link[rel=stylesheet]')->eq(0)->attr('href'));
|
||||||
|
|
||||||
|
$crawler = self::request('GET', 'viewtopic.php?t=1');
|
||||||
|
$this->assertContains('font-awesome.min', $crawler->filter('head > link[rel=stylesheet]')->eq(0)->attr('href'));
|
||||||
|
|
||||||
|
$crawler = self::request('GET', 'viewtopic.php?t=1&view=next');
|
||||||
|
$this->assertContains('font-awesome.min', $crawler->filter('head > link[rel=stylesheet]')->eq(0)->attr('href'));
|
||||||
|
}
|
||||||
|
|
||||||
public function test_default_forum_style()
|
public function test_default_forum_style()
|
||||||
{
|
{
|
||||||
$crawler = self::request('GET', 'viewtopic.php?t=1&f=2');
|
$crawler = self::request('GET', 'viewtopic.php?t=1&f=2');
|
||||||
$this->assertContains('styles/prosilver/', $crawler->filter('head > link[rel=stylesheet]')->attr('href'));
|
$this->assertContains('styles/prosilver/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href'));
|
||||||
|
|
||||||
$crawler = self::request('GET', 'viewtopic.php?t=1');
|
$crawler = self::request('GET', 'viewtopic.php?t=1');
|
||||||
$this->assertContains('styles/prosilver/', $crawler->filter('head > link[rel=stylesheet]')->attr('href'));
|
$this->assertContains('styles/prosilver/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href'));
|
||||||
|
|
||||||
$crawler = self::request('GET', 'viewtopic.php?t=1&view=next');
|
$crawler = self::request('GET', 'viewtopic.php?t=1&view=next');
|
||||||
$this->assertContains('styles/prosilver/', $crawler->filter('head > link[rel=stylesheet]')->attr('href'));
|
$this->assertContains('styles/prosilver/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_custom_forum_style()
|
public function test_custom_forum_style()
|
||||||
|
@ -35,13 +47,13 @@ class phpbb_functional_forum_style_test extends phpbb_functional_test_case
|
||||||
$db->sql_query('UPDATE ' . FORUMS_TABLE . ' SET forum_style = 2 WHERE forum_id = 2');
|
$db->sql_query('UPDATE ' . FORUMS_TABLE . ' SET forum_style = 2 WHERE forum_id = 2');
|
||||||
|
|
||||||
$crawler = self::request('GET', 'viewtopic.php?t=1&f=2');
|
$crawler = self::request('GET', 'viewtopic.php?t=1&f=2');
|
||||||
$this->assertContains('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->attr('href'));
|
$this->assertContains('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href'));
|
||||||
|
|
||||||
$crawler = self::request('GET', 'viewtopic.php?t=1');
|
$crawler = self::request('GET', 'viewtopic.php?t=1');
|
||||||
$this->assertContains('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->attr('href'));
|
$this->assertContains('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href'));
|
||||||
|
|
||||||
$crawler = self::request('GET', 'viewtopic.php?t=1&view=next');
|
$crawler = self::request('GET', 'viewtopic.php?t=1&view=next');
|
||||||
$this->assertContains('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->attr('href'));
|
$this->assertContains('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href'));
|
||||||
|
|
||||||
$db->sql_query('UPDATE ' . FORUMS_TABLE . ' SET forum_style = 0 WHERE forum_id = 2');
|
$db->sql_query('UPDATE ' . FORUMS_TABLE . ' SET forum_style = 0 WHERE forum_id = 2');
|
||||||
$this->delete_style(2, 'test_style');
|
$this->delete_style(2, 'test_style');
|
||||||
|
|
Loading…
Add table
Reference in a new issue