1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-30 09:18:09 +02:00

Theme Manager GUI fixes.

This commit is contained in:
Cameron 2012-11-29 22:03:36 -08:00
parent e299bb7fd4
commit 5be772191a
9 changed files with 181 additions and 48 deletions

View File

@ -25,8 +25,8 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
$e_sub_cat = 'theme_manage';
e107::css("inline","
.admin-theme-thumb { }
.hide { display: none }
.admin-theme-thumb { height:130px;overflow:hidden;border:1px solid black;margin-bottom:10px }
.admin-theme-thumb:hover { opacity:0.4 }
.admin-theme-options { transition: opacity .20s ease-in-out;
@ -42,29 +42,47 @@ e107::css("inline","
.admin-theme-options:hover { opacity:0.8; }
.admin-theme-title { font-size: 15px; overflow:hidden; white-space:no-wrap; width:200px; position:relative; top:-130px; }
.admin-theme-title { font-size: 15px; overflow:hidden; padding-left:5px; white-space:no-wrap; width:200px; position:relative; top:-132px; }
.admin-theme-select {border:1px dotted silver;background-color:#DDDDDD;float:left }
.admin-theme-select-active { background-color:red;float:left }
.admin-theme-cell { width:202px; height:160px; -moz-border-radius: 5px; border-radius: 5px; }
.admin-theme-cell { width:202px; height:160px; padding:10px; -moz-border-radius: 5px; border-radius: 5px; margin:5px}
.admin-theme-cell-default { border:1px dotted silver; background-color:#DDDDDD }
.admin-theme-cell-site { background-color: #d9edf7; border: 1px solid #bce8f1; }
.admin-theme-cell-admin { background-color:#FFFFD5; border: 1px solid #FFCC00; }
");
require_once(e_HANDLER."theme_handler.php");
$themec = new themeHandler;
if(e_AJAX_REQUEST)
{
define('e_IFRAME',true);
}
if(e_AJAX_REQUEST)
{
{
$data = $themec->getThemeInfo('jayya');
echo $themec->renderThemeInfo($data);
exit;
}
else {
require_once("auth.php");
echo '
echo '
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
@ -78,8 +96,9 @@ echo '
<a href="#" data-dismiss="modal" class="btn btn-primary">Close</a>
</div>
</div>';
require_once("auth.php");
}
$mode = (e_QUERY) ? e_QUERY :"main" ;

View File

@ -2002,6 +2002,7 @@ class e107
return FALSE;
}
$path = str_replace(e_LANGUAGE, 'English', $path);
self::getMessage()->addDebug("Couldn't load language file: ".$path);
}
$ret = ($force) ? include($path) : include_once($path);
return (isset($ret)) ? $ret : "";
@ -2068,11 +2069,24 @@ class e107
$plugin = preg_replace('/[^\w]/', '', $plugin);
if($fname) $fname = e_LANGUAGE.($flat ? '_' : '/').preg_replace('#[^\w/]#', '', $fname);
else $fname = e_LANGUAGE;
if($fname && is_string($fname))
{
$fname = e_LANGUAGE.($flat ? '_' : '/').preg_replace('#[^\w/]#', '', $fname);
}
if($fname === true) // admin file.
{
$fname = "admin/".e_LANGUAGE;
}
else
{
$fname = e_LANGUAGE;
}
$path = e_PLUGIN.$plugin.'/languages/'.$fname.'.php';
// echo "path = ".$path;
e107::setRegistry($cstring, true);
self::includeLan($path, false);
}

View File

@ -202,6 +202,7 @@ class e_form
$url = e_ADMIN_ABS."image.php?mode={$mode}&amp;action={$action}".$cat;
$url .= "&amp;iframe=1";
$title = "Media Manager : ".$category;
$ret = "<a title=\"{$title}\" rel='external' class='e-dialog' href='".$url."'>".$label."</a>";

View File

@ -38,6 +38,9 @@ class themeHandler
var $fl;
var $themeConfigObj = null;
var $noLog = FALSE;
private $approvedAdminThemes = array('bootstrap','jayya');
public $allowedCategories = array('generic',
'adult',
'blog',
@ -612,11 +615,12 @@ class themeHandler
function loadThemeConfig()
{
$mes = e107::getMessage();
$confile = e_THEME.$this->id."/".$this->id."_config.php";
if(($this->themeConfigObj === null) && is_readable($confile))
{
$mes->addDebug("Loading : ".$confile);
include ($confile);
$className = 'theme_'.$this->id;
if(class_exists($className))
@ -634,7 +638,10 @@ class themeHandler
// TODO process custom theme configuration - .
function renderThemeConfig()
{
global $frm;
$mes = e107::getMessage();
$mes->addDebug("Rendering Theme Config");
$this->loadThemeConfig();
@ -692,32 +699,44 @@ class themeHandler
$info_icon = "<a data-toggle='modal' href='".e_SELF."' data-target='#myModal' class='e-tip' title='".TPVLAN_7."'><img src='".e_IMAGE_ABS."admin_images/info_32.png' alt='info' class='icon S32' /></a>";
$preview_icon = "<a title='Preview : ".$theme['name']."' rel='external' class='e-tip e-dialog' href='".e_BASE."index.php?themepreview.".$theme['id']."'><img src='".e_IMAGE_ABS."admin_images/search_32.png' alt='Preview' /></a>";
$preview_icon = "<input class='middle e-tip e-modal-iframe' href='".e_BASE."index.php?themepreview.".$theme['id']."' type='image' src='".e_IMAGE_ABS."admin_images/search_32.png' name=\"preview[".$theme['id']."]\" title='".TPVLAN_9." #".$theme['id']."' />";
// $preview_icon = "<a class='middle' title='".TPVLAN_9." #".$theme['id']."' data-toggle='modal' data-target='#myModal' href='".e_BASE."index.php?themepreview.".$theme['id']."'><img src='".e_IMAGE_ABS."admin_images/search_32.png' alt='Preview' /></a>";
$admin_icon = ($pref['admintheme'] != $theme['path'] ) ? "<input class='top e-tip' type='image' src='".e_IMAGE_ABS."e107_icon_32.png' name='selectadmin[".$theme['id']."]' alt=\"".TPVLAN_32."\" title=\"".TPVLAN_32."\" />\n" : "<img src='".ADMIN_TRUE_ICON_PATH."' alt='' title='' class='icon S32' />";
// $preview_icon = "<a data-toggle='modal' href='".e_BASE."index.php?themepreview.".$theme['id']."' data-target='#myModal' >".($theme['preview'] ? "<img src='".$theme['preview']."' style='border: 1px solid #000;width:200px' alt='' />" : "<img src='".e_IMAGE_ABS."admin_images/nopreview.png' title='".TPVLAN_12."' alt='' />")."</a>";
if(!in_array($theme['path'], $this->approvedAdminThemes))
{
$admin_icon = "";
}
$admin_icon = ($pref['admintheme'] != $theme['path']) ? "<input class='top e-tip' type='image' src='".e_IMAGE_ABS."e107_icon_32.png' name='selectadmin[".$theme['id']."]' alt=\"".TPVLAN_32."\" title=\"".TPVLAN_32."\" />\n" : "<img src='".ADMIN_TRUE_ICON_PATH."' alt='' title='' class='icon S32' />";
$newpreview = "<a href='".e_BASE."news.php?themepreview.".$theme['id']."' title='".TPVLAN_9."' >".($theme['preview'] ? "<img class='admin-theme-thumb' src='".$theme['preview']."' style='width:200px; height:160px;' alt='' />" : "<img class='admin-theme-thumb' src='".e_IMAGE_ABS."admin_images/nopreview.png' style='width:200px;height:160px;' title='".TPVLAN_12."' alt='' />")."</a>";
$newpreview = "<a href='".e_BASE."news.php?themepreview.".$theme['id']."' title='".TPVLAN_9."' >".($theme['preview'] ? "<img src='".$theme['preview']."' style='width:200px; height:160px;' alt='' />" : "<img class='admin-theme-thumb' src='".e_IMAGE_ABS."admin_images/nopreview.png' style='width:200px;height:160px;' title='".TPVLAN_12."' alt='' />")."</a>";
// Choose a Theme to Install.
if(!$mode)
{
// styles NEED to be put into style.css
$borderStyle = (($pref['sitetheme'] == $theme['path']) || ($pref['admintheme'] == $theme['path'])) ? "border:1px solid black" : "border:1px dotted silver;background-color:#DDDDDD";
$text = "<div class='f-left block-text admin-theme-cell' style='margin:5px;".$borderStyle.";'>
<div style='height:130px;overflow:hidden;border:1px solid black;margin-bottom:10px'>".$newpreview."</div>";
$text .= "<div class='admin-theme-options'>".$main_icon.$admin_icon.$info_icon.$preview_icon."</div>";
$text .= "<div class='admin-theme-title'>".$theme['name']." ".$theme['version']."</div>";
// $text .= "<div class='f-right right' style='width:45%;height:16px'>\n\n\n".$main_icon.$admin_icon.$info_icon.$preview_icon."\n\n</div>";
// $text .= "<div id='themeInfo_".$theme['id']."' class='e-hideme col-selection' style='background-color:white;position:relative;top:-130px;width:480px'>\n".$this->renderThemeInfo($theme)."</div>\n";
$text .= "</div>";
if($pref['sitetheme'] == $theme['path'])
{
$borderStyle = "admin-theme-cell-site";
}
elseif($pref['admintheme'] == $theme['path'])
{
$borderStyle = "admin-theme-cell-admin";
}
else
{
$borderStyle = "admin-theme-cell-default";
}
$text = "
<div class='f-left block-text admin-theme-cell ".$borderStyle."'>
<div class='admin-theme-thumb'>".$newpreview."</div>
<div class='admin-theme-options'>".$main_icon.$admin_icon.$info_icon.$preview_icon."</div>
<div class='admin-theme-title'>".$theme['name']." ".$theme['version']."</div>
</div>";
return $text;
}
@ -728,19 +747,17 @@ class themeHandler
$text = "
<h2 class='caption'>".$theme['name']."</h2>
<div class='admintabs' id='tab-container'>";
<div id='tab-container' class='e-tabs'>
<ul id='core-thememanager-tabs'>
<li><a href='#core-thememanager-configure'>".LAN_CONFIGURE."</a></li>";
if($this->themeConfigObj && call_user_func(array(&$this->themeConfigObj, 'help')))
{
$text .= "
<ul class='e-tabs e-hideme' id='core-thememanager-tabs'>
<li id='tab-thememanager-configure'><a href='#core-thememanager-configure'>".LAN_CONFIGURE."</a></li>
<li id='tab-thememanager-help'><a href='#core-thememanager-help'>".LAN_HELP."</a></li>
</ul>";
$text .= "<li><a href='#core-thememanager-help'>".LAN_HELP."</a></li>";
}
$text .= "
<div id='core-thememanager-configure'>
$text .= "</ul>
<fieldset id='core-thememanager-configure'>
<table class='table adminform'>
<colgroup>
<col class='col-label' />
@ -1000,10 +1017,10 @@ class themeHandler
</div>
</fieldset>
<div id='core-thememanager-help' >".$this->renderThemeHelp()."</div>
<fieldset><div class='tab-border' id='core-thememanager-help'>".$this->renderThemeHelp()."</div></fieldset>
</div>
\n";

View File

@ -25,10 +25,11 @@
.nowrap { white-space:nowrap; }
.e-tabs { padding:0px }
e-tabs fieldset { padding:0px ; padding-left:3px; border-top:0px;}
#tab-container fieldset { padding:0px ; padding-left:3px; border-top:0px;}
#tab-container table { border-top:0px;}
#tab-container td { border-top:0px; border-bottom:1px solid rgb(221, 221, 221) }
.tab-border { border-left: 1px solid #ddd; }
.core-mainpanel-block { text-align:center; width:100px; float:left; height:48px; display:block;margin:15px; }
.core-mainpanel-link-text { font-weight:bold; text-decoration: none; padding:3px }
@ -38,6 +39,11 @@ td.center, th.center { text-align:center }
.col-label { width:30%; }
.sidebar-nav { padding: 9px 0; font-size:11px; min-width:150px; }
#cboxTitle { font-weight:bold; color: black }
.chzn-container { border: 1px solid #ddd; }
/*
a.brand:hover img {
filter: blur(13px);

View File

@ -0,0 +1,70 @@
<?php
if (!defined('e107_INIT')) { exit; }
// Dummy Theme Configuration File.
class theme_bootstrap implements e_theme_config
{
function process()
{
$pref = e107::getConfig();
$theme_pref = array();
$theme_pref['example'] = $_POST['_blank_example'];
$theme_pref['fb_tabs_cols'] = intval($_POST['fb_tabs_cols']);
$pref->set('sitetheme_pref', $theme_pref);
return $pref->dataHasChanged();
}
function config()
{
$var[0]['caption'] = "Sample configuration field";
$var[0]['html'] = "<input type='text' name='boostrap_example' value='".e107::getThemePref('example', 'default')."' />";
$var[1]['caption'] = "Featurebox Tab Category - number of items per tab";
$var[1]['html'] = "<input type='text' name='fb_tabs_cols' value='".e107::getThemePref('fb_tabs_cols', 1)."' />";
return $var;
}
function help()
{
$text = "Need reasons to love <a href='http://twitter.github.com/bootstrap'>Bootstrap</a>? Look no further.
<h3>By nerds, for nerds.</h3>Built at Twitter by @mdo and @fat, Bootstrap utilizes LESS CSS, is compiled via Node, and is managed through GitHub to help nerds do awesome stuff on the web.
<h3>Made for everyone.</h3>Bootstrap was made to not only look and behave great in the latest desktop browsers (as well as IE7!), but in tablet and smartphone browsers via responsive CSS as well.
<h3>Packed with features.</h3>A 12-column responsive grid, dozens of components, JavaScript plugins, typography, form controls, and even a web-based Customizer to make Bootstrap your own.
";
return $text;
return "
<div class='block-text'>
<a href='http://e107.org'>All the HTML that you want</a>.<br /><br />
Mauris sit amet arcu arcu. Curabitur ultrices, felis ac sagittis elementum, justo dolor posuere eros, eu sollicitudin eros mi nec leo. Quisque sapien justo, ultricies at sollicitudin non; rhoncus vel nisi. Fusce egestas orci a diam vestibulum ut gravida ipsum tristique. Nullam et turpis nibh; eu dapibus ligula. Fusce ornare massa ac ante tincidunt euismod varius augue volutpat? Suspendisse potenti. Morbi eget velit in nulla tristique ultricies suscipit consequat ligula. Integer quis arcu vel sem scelerisque gravida vitae vel tortor! Suspendisse tincidunt scelerisque nibh, quis consectetur mauris varius sit amet! Pellentesque et urna vel est rutrum viverra?
<br /><br />
<ul>
<li>Curabitur ultrices</li>
<li>Ollicitudin eros</li>
<li>Felis ac sagittis</li>
<li>Quisque sapien</li>
</ul>
</div>
";
}
}
?>

View File

@ -3,7 +3,7 @@
<author name ="e107 Inc" email="e107inc@something.com" url="http://e107.org" />
<description>Bootstrap e107 admin theme</description>
<layouts>
<layout name='default' title='2 Columns' preview='preview.jpg' default='true' previewFull='preview_full.png' >
<layout name='default' title='2 Columns' preview='preview.jpg' default='true' previewFull='fullpreview.png' >
<custompages>usersettings.php</custompages>
</layout>
</layouts>

File diff suppressed because one or more lines are too long

View File

@ -298,11 +298,16 @@ $(document).ready(function()
// Dialog
$("a.e-dialog").colorbox({
iframe:true,
iframe:true,
width:"60%",
height:"70%",
speed:10,
opacity: 0.7
initialWidth: "60%",
initialHeight: "70%",
preloading: false
// ,
// speed:10,
// opacity: 0.7
});
@ -316,9 +321,10 @@ $(document).ready(function()
/*
$("a.e-dialog").live('click',function() {
var link = $(this).attr("href");
$("input.e-dialog").live('click',function() {
var link = $(this).attr("data-target");
$(this).dialog({
modal: true,
open: function ()