Make CSS styles configurable #222
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "Tortle/tortleib:css-config"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
Enable skins by dropping a CSS file in /css and adding the name to settings.php.
@ -628,0 +650,4 @@
if (count($tinyib_skins) > 1) {
$options = ['<option value="">' . $txt_style . '</option>'];
foreach($tinyib_skins as $display_name => $value) {
$options[] = '<option value="' . $value . '">'. $display_name . '</option>';
Escape $value with
htmlentities($var, ENT_QUOTES)
and $displayname withhtmlentities($var)
.Thanks for submitting this. Please include a default value for existing installations by adding TINYIB_DEFAULTSTYLE to inc/defines.php.
@ -43,6 +43,24 @@ function pageHeader() {
EOF;
}
function stylesheets() {
Rename to pageStylesheets.
@ -46,0 +47,4 @@
global $tinyib_skins;
$global_stylesheet = '<link rel="stylesheet" type="text/css" href="css/global.css">';
$default_stylesheet = '<link rel="stylesheet" type="text/css" href="css/' . $tinyib_skins[TINYIB_DEFAULTSKIN] . '.css" title="' . TINYIB_DEFAULTSKIN . '" id="mainStylesheet">';
Escape $tinyib_skins[TINYIB_DEFAULTSKIN] with
htmlentities($var, ENT_QUOTES)
.@ -46,0 +48,4 @@
$global_stylesheet = '<link rel="stylesheet" type="text/css" href="css/global.css">';
$default_stylesheet = '<link rel="stylesheet" type="text/css" href="css/' . $tinyib_skins[TINYIB_DEFAULTSKIN] . '.css" title="' . TINYIB_DEFAULTSKIN . '" id="mainStylesheet">';
$stylesheets = [$global_stylesheet, $default_stylesheet];
Create a string
$return
which is appended to and returned instead of an array.@ -46,0 +55,4 @@
continue;
}
$stylesheets[] = '<link rel="alternate stylesheet" type="text/css" href="css/' . $value . '.css" title="' . $display_name . '">';
Escape $value and $display_name with
htmlentities($var, ENT_QUOTES)
.@ -46,0 +58,4 @@
$stylesheets[] = '<link rel="alternate stylesheet" type="text/css" href="css/' . $value . '.css" title="' . $display_name . '">';
}
return join($stylesheets, '');
Use implode.
@ -90,2 +90,4 @@
'YouTube' => 'https://www.youtube.com/oembed?url=TINYIBEMBED&format=json');
// CSS skins
Replace with the following comment:
@ -91,1 +91,4 @@
// CSS skins
define('TINYIB_DEFAULTSKIN', 'Futaba');
Define via filename instead: 'futaba'.
Rename setting to TINYIB_DEFAULTSTYLE.
@ -92,0 +92,4 @@
// CSS skins
define('TINYIB_DEFAULTSKIN', 'Futaba');
$tinyib_skins = array('Futaba' => 'futaba',
Reverse order: 'futaba' => 'Futaba'.
Rename variable to $tinyib_stylesheets.