Open GoogleCodeExporter opened 9 years ago
I was just thinking about something simpler at the beginning, like:
Line: 1468
<?php
if(isset($_GET['theme'])) $theme = $_GET['theme'];
else $theme = "phpliteadmin.css";
if(!file_exists($theme)) //only use the inline stylesheet if an external one
does not exist
{
?>
Line: 1779
<?php
}
else //an external stylesheet exists - import it
{
echo "<link href='".$theme."' rel='stylesheet' type='text/css' />";
}
only for one-time-viewing purpose, not to work with it
Original comment by teryaki1...@googlemail.com
on 5 Nov 2012 at 2:53
Yeah, that's a good start. I was just thinking about how we could do this even
cooler ;-)
I Think next steps could be:
- store the currently selected theme in a session-variable
- scan the folder "themes" for themes and let the user choose one of these
using a dropdown or something
So it is not only a preview, but the user can really select another theme from
the user interface.
Original comment by crazy4ch...@gmail.com
on 6 Nov 2012 at 2:54
ok i was only thinking of a quick preview for the theme before downloading it.
you want to offer an option section to save the the theme as default.
Yes, it depends on if files are writeable on the users server, then its no
problem.
I wanted to do the same idea but wanted to offer as a plugin. phpLiteAdmin
comes with no own database to save all options (theme name, rows number, header
information etc.) but a plugin can have a small sqlite database with it. Thats
why i think, that plugins integration can make phpLiteAdmin more powerful and
also stays simple as usual.
"scan the folder "themes" for themes and let the user choose one of these using a dropdown or something"
i have already such a function, in case you need it
<?php
// list all themes names from folder themes
function get_themes(){
$res = "";
$default = 'phpliteadmin.css'; //assuming this is the current used theme
if($handle = opendir('themes')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." && !is_dir('themes/'.$file)) {
$def = "";
if($file == $default) $def = ' selected="selected"';
$res .= '<option value="'.$file.'"'.$def.'>'.$file.'</option>';
}
}
closedir($handle);
}
return $res;
}
?>
<select name="themes">
<?php echo get_themes(); ?>
</select>
Original comment by teryaki1...@googlemail.com
on 6 Nov 2012 at 3:56
Original issue reported on code.google.com by
crazy4ch...@gmail.com
on 4 Nov 2012 at 6:39