mirror of
https://github.com/e107inc/e107.git
synced 2025-03-14 01:19:44 +01:00
Online theme selection integrated into admin area. "Find Themes". Incomplete.
This commit is contained in:
parent
53c13a643f
commit
0116b9ff64
@ -302,7 +302,7 @@ class pluginManager{
|
||||
$from = intval(varset($_GET['frm']));
|
||||
|
||||
// $file = SITEURLBASE.e_PLUGIN_ABS."release/release.php"; // temporary testing
|
||||
$file = "http://e107.org/feed?frm=".$from;
|
||||
$file = "http://e107.org/feed?type=plugin&frm=".$from;
|
||||
|
||||
$xml->setOptArrayTags('plugin'); // make sure 'plugin' tag always returns an array
|
||||
$xdata = $xml->loadXMLfile($file,'advanced');
|
||||
|
@ -142,6 +142,9 @@ function theme_adminmenu()
|
||||
|
||||
$var['choose']['text'] = TPVLAN_51;
|
||||
$var['choose']['link'] = e_SELF."?choose";
|
||||
|
||||
$var['online']['text'] = "Find Themes";
|
||||
$var['online']['link'] = e_SELF."?online";
|
||||
|
||||
$var['upload']['text'] = TPVLAN_38;
|
||||
$var['upload']['link'] = e_SELF."?upload";
|
||||
|
@ -462,12 +462,101 @@ class themeHandler
|
||||
foreach ($this->themeArray as $key=>$theme)
|
||||
{
|
||||
$text .= $this->renderTheme(FALSE, $theme);
|
||||
// print_a($theme);
|
||||
}
|
||||
$text .= "<div class='clear'> </div>";
|
||||
$ns->tablerender(TPVLAN_26." :: ".TPVLAN_39, $mes->render().$text);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
if($mode == "online")
|
||||
{
|
||||
$e107 = e107::getInstance();
|
||||
$xml = e107::getXml();
|
||||
$mes = e107::getMessage();
|
||||
|
||||
$mes->addWarning("This area is experimental, incomplete and may produce unpredictable results.");
|
||||
|
||||
$from = intval(varset($_GET['frm']));
|
||||
|
||||
// $file = SITEURLBASE.e_PLUGIN_ABS."release/release.php"; // temporary testing
|
||||
$file = "http://e107.org/feed?type=theme&frm=".$from;
|
||||
|
||||
$xml->setOptArrayTags('theme'); // make sure 'theme' tag always returns an array
|
||||
$xdata = $xml->loadXMLfile($file,'advanced');
|
||||
|
||||
$total = $xdata['@attributes']['total'];
|
||||
|
||||
|
||||
// print_a($xdata);
|
||||
//TODO use admin_ui including filter capabilities by sending search queries back to the xml script.
|
||||
|
||||
// XML data array.
|
||||
$c = 1;
|
||||
$text = "";
|
||||
foreach($xdata['theme'] as $r)
|
||||
{
|
||||
$mes->addDebug(print_a($r,true));
|
||||
|
||||
$theme = array(
|
||||
'name' => $r['@attributes']['name'],
|
||||
'summary' => $r['description'][0],
|
||||
'preview' => array($r['@attributes']['screenshot']),
|
||||
'date' => $r['@attributes']['date'],
|
||||
'version' => $r['@attributes']['version']
|
||||
);
|
||||
|
||||
$text .= $this->renderTheme(FALSE, $theme);
|
||||
/*
|
||||
|
||||
[author] => e107 Inc
|
||||
[summary] => Bootstrap e107 admin theme
|
||||
[category] => generic
|
||||
[keywords] => Array
|
||||
(
|
||||
[word] => Array
|
||||
(
|
||||
[0] => bootstrap
|
||||
[1] => clean
|
||||
)
|
||||
|
||||
)
|
||||
[name] => bootstrap
|
||||
[version] => 1.0
|
||||
[date] => 2012-12-01
|
||||
[compatibility] => 2.0
|
||||
[releaseUrl] =>
|
||||
[email] => e107inc@something.com
|
||||
[website] => http://e107.org
|
||||
[info] => Bootstrap e107 admin theme
|
||||
[compliance] => Array
|
||||
(
|
||||
[@attributes] => Array
|
||||
(
|
||||
[xhtml] =>
|
||||
[css] =>
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
[xhtmlcompliant] =>
|
||||
[csscompliant] =>
|
||||
[path] => bootstrap
|
||||
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
$text .= "<div class='clear'> </div>";
|
||||
$ns->tablerender(TPVLAN_26." :: Available for Download", $mes->render().$text);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
echo "</form>\n</div>\n";
|
||||
@ -714,8 +803,8 @@ class themeHandler
|
||||
// print_a($theme);
|
||||
}
|
||||
//
|
||||
|
||||
$newpreview = "<a href='".e_BASE."news.php?themepreview.".$theme['id']."' title='".TPVLAN_9."' >".(vartrue($theme['preview'][0]) ? "<img src='".e_THEME.$theme['path'] ."/".$theme['preview'][0]."' 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>";
|
||||
$previewPath = (substr($theme['preview'][0],0,4) == 'http') ? $theme['preview'][0] : e_THEME.$theme['path'] ."/".$theme['preview'][0];
|
||||
$newpreview = "<a href='".e_BASE."news.php?themepreview.".$theme['id']."' title='".TPVLAN_9."' >".(vartrue($theme['preview'][0]) ? "<img src='".$previewPath."' 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)
|
||||
|
@ -3,13 +3,14 @@
|
||||
<author name ="e107 Inc" email="e107inc@something.com" url="http://e107.org" />
|
||||
<summary>Bootstrap e107 admin theme</summary>
|
||||
<description>Bootstrap e107 admin theme</description>
|
||||
<category>generic</category>
|
||||
<keywords>
|
||||
<word>bootstrap</word>
|
||||
<word>clean</word>
|
||||
</keywords>
|
||||
<screenshots>
|
||||
<image>preview.jpg</image>
|
||||
<image>fullpreview.png</image>
|
||||
<image>fullpreview.jpg</image>
|
||||
</screenshots>
|
||||
<layouts>
|
||||
<layout name='default' title='Default' default='true' />
|
||||
|
Loading…
x
Reference in New Issue
Block a user