1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 20:30:39 +02:00

Admin skin option added to installation wizard.

This commit is contained in:
Cameron
2017-12-15 14:50:54 -08:00
parent 72351da914
commit ff2b79145e
8 changed files with 118 additions and 11 deletions

View File

@@ -607,7 +607,7 @@ class e_theme
$vars['email'] = varset($vars['author']['@attributes']['email']);
$vars['website'] = varset($vars['author']['@attributes']['url']);
$vars['author'] = varset($vars['author']['@attributes']['name']);
$vars['info'] = varset($vars['description']);
$vars['info'] = !empty($vars['description']['@value']) ? $vars['description']['@value'] : varset($vars['description']);
$vars['category'] = self::getThemeCategory(varset($vars['category']));
$vars['xhtmlcompliant'] = varset($vars['compliance']['@attributes']['xhtml']);
$vars['csscompliant'] = varset($vars['compliance']['@attributes']['css']);

View File

@@ -182,3 +182,7 @@ define("LANINS_141", "Please fill in the form below with your MySQL details. If
define("LANINS_142", "IMPORTANT: Please rename e107.htaccess to .htaccess");
define("LANINS_144", "IMPORTANT: Please copy and paste the contents of the [b]e107.htaccess[/b] into your [b].htaccess[/b] file. Please take care NOT to overwrite any existing data that may be in it.");
define("LANINS_145", "e107 v2.x requires the PHP [x] to be installed. Please contact your host or read the information at [y] before continuing.");
define("LANINS_146", "Admin Area Skin");
define("LANINS_147", "Administration");

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

View File

@@ -24,12 +24,12 @@
</libraries>
<stylesheets>
<css file="style.css" name="Default"/>
<css file="css/bootstrap-dark.min.css" name="Dark Admin" description="" thumbnail='' scope='admin' exclude='bootstrap'/>
<css file="css/kadmin.css" name="K-Admin Inspired" scope='admin' description="(experimental)" thumbnail='' url='http://themifycloud.com/demos/templates/KAdmin/KAdmin-Dark/dashboard.html' />
<css file="css/corporate.css" name="Corporate" scope='admin' exclude='bootstrap' />
<css file="css/bootstrap-dark.min.css" name="Dark Admin" description="" thumbnail='images/admin_bootstrap-dark.jpg' scope='admin' exclude='bootstrap'/>
<css file="css/kadmin.css" name="K-Admin Inspired" scope='admin' description="(experimental)" thumbnail='images/admin_kadmin.jpg' url='http://themifycloud.com/demos/templates/KAdmin/KAdmin-Dark/dashboard.html' />
<css file="css/corporate.css" name="Corporate" scope='admin' thumbnail='images/admin_corporate.jpg' exclude='bootstrap' />
<css file="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/flatly/bootstrap.min.css" name="Flatly" scope='admin' exclude='bootstrap'/>
<css file="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/sandstone/bootstrap.min.css" name="Sandstone" scope='admin' exclude='bootstrap'/>
<css file="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/superhero/bootstrap.min.css" name="Superhero" scope='admin' exclude='bootstrap'/>
<css file="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/superhero/bootstrap.min.css" name="Superhero" thumbnail='images/admin_superhero.jpg' scope='admin' exclude='bootstrap'/>
<css file="*" name="*"/>
</stylesheets>
<layouts>

View File

@@ -960,7 +960,7 @@ class e_install
$this->template->SetTag("installation_heading", LANINS_001);
$this->template->SetTag("stage_pre", LANINS_002);
$this->template->SetTag("stage_num", LANINS_046);
$this->template->SetTag("stage_title", LANINS_047);
$this->template->SetTag("stage_title", defset('LANINS_147', 'Administration'));
// $this->template->SetTag("onload", "document.getElementById('u_name').focus()");
$this->template->SetTag("percent", 60);
$this->template->SetTag("bartype", 'warning');
@@ -969,6 +969,10 @@ class e_install
$output = "
<div style='width: 100%; padding-left: auto; padding-right: auto;'>
<table class='table table-striped table-bordered'>
<colgroup>
<col style='width:35%' />
<col />
</colgroup>
<tr>
<td><label for='u_name'>".LANINS_072."</label></td>
<td>
@@ -1009,6 +1013,46 @@ class e_install
</td>
</tr>
</table>
<table class='table table-striped table-bordered'>
<colgroup>
<col style='width:35%' />
<col />
</colgroup>
<tr>
<td><label for='admincss'>".LANINS_146."</label></td>
<td>";
$d = $this->get_theme_xml('bootstrap3');
$opts = array();
foreach($d['css'] as $val)
{
$key = $val['name'];
if(empty($val['thumbnail']))
{
continue;
}
$opts[$key] = array (
'title' => $val['info'],
'preview' => e_THEME."bootstrap3/".$val['thumbnail'],
'description' =>'',
'category'=>''
);
}
$output .= $this->thumbnailSelector('admincss', $opts, 'css/bootstrap-dark.min.css');
$output .= "
</td>
</tr>
</table>
<br /><br />
</div>
\n";
@@ -1072,6 +1116,11 @@ class e_install
}
}
if(!empty($_POST['admincss']))
{
$this->previous_steps['prefs']['admincss'] = $tp->filter($_POST['admincss']);
}
// ------------- Validate Step 5 Data. --------------------------
if(!vartrue($this->previous_steps['admin']['user']) || !vartrue($this->previous_steps['admin']['password']))
{
@@ -1123,6 +1172,8 @@ class e_install
$themes = $this->get_themes();
$opts = array();
foreach($themes as $val)
{
@@ -1131,17 +1182,29 @@ class e_install
continue;
}*/
$themeInfo = $this->get_theme_xml($val);
$title = vartrue($themeInfo['@attributes']['name']);
$opts[$val] = array(
'title' =>vartrue($themeInfo['@attributes']['name']),
'category' => vartrue($themeInfo['category']),
'preview' => e_THEME.$val."/".$themeInfo['thumbnail'],
'description' => vartrue($themeInfo['info'])
);
/* $title = vartrue($themeInfo['@attributes']['name']);
$category = vartrue($themeInfo['category']);
$preview = e_THEME.$val."/".$themeInfo['thumbnail'];
$description = vartrue($themeInfo['description']);
$description = vartrue($themeInfo['info']);
if(!is_readable($preview))
{
continue;
}
$thumbnail = "<img class='img-responsive img-fluid thumbnail' src='".$preview ."' alt='".$val."' />";
@@ -1154,9 +1217,12 @@ class e_install
<h5>".$title." <small>(".$category.")</small><span class='glyphicon glyphicon-ok text-success'></span></h5>
</div>
</label>
</div>";
</div>";*/
}
$output .= $this->thumbnailSelector('sitetheme', $opts, DEFAULT_INSTALL_THEME);
$output .= "
</td>
@@ -1189,6 +1255,43 @@ class e_install
$this->logLine('Stage 6 completed');
}
private function thumbnailSelector($name, $opts, $default='')
{
$ret = '';
foreach($opts as $key=>$val)
{
if(!is_readable($val['preview']) || !is_file($val['preview']))
{
continue;
}
$thumbnail = "<img class='img-responsive img-fluid thumbnail' src='".$val['preview'] ."' alt='".$key."' />";
$selected = ($key === $default) ? " checked" : "";
$categoryInfo = !empty($val['category']) ? "<small>(".$val['category'].")</small>" : "";
$ret .= "
<div class='col-md-6 theme-cell' >
<label class='theme-selection' title=\"".$val['description']."\"><input type='radio' name='".$name."' value='{$key}' required='required' $selected />
<div>".$thumbnail."
<h5>".$val['title']." ".$categoryInfo."<span class='glyphicon glyphicon-ok text-success'></span></h5>
</div>
</label>
</div>";
}
return $ret;
}
private function stage_7()
{
global $e_forms;
@@ -1757,7 +1860,7 @@ if($this->pdo == true)
* get_theme_xml - check theme.xml file of specific theme
*
* @param string $theme_folder
* @return array $xmlArray OR boolean FALSE if result is no array
* @return array|bool $xmlArray OR boolean FALSE if result is no array
*/
function get_theme_xml($theme_folder)
{
@@ -1774,7 +1877,7 @@ if($this->pdo == true)
// require_once($this->e107->e107_dirs['HANDLERS_DIRECTORY']."theme_handler.php");
// $tm = new themeHandler;
$xmlArray = e107::getTheme($theme_folder)->get();
$xmlArray = e107::getTheme($theme_folder,true)->get();
return (is_array($xmlArray)) ? $xmlArray : false;
}