1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 04:38:27 +01:00

More work on the Theme and Plugin Manager download areas.

This commit is contained in:
Cameron 2013-03-04 03:39:27 -08:00
parent 474a7df566
commit ef51b62590
2 changed files with 85 additions and 74 deletions

View File

@ -293,13 +293,13 @@ class pluginManager{
$xml = e107::getXml();
$mes = e107::getMessage();
$mes->addWarning("Some older plugins may produce unpredictable results.");
// $mes->addWarning("Some older plugins may produce unpredictable results.");
$from = intval(varset($_GET['frm']));
$srch = preg_replace('/[^\w]/','', vartrue($_GET['srch']));
// $file = SITEURLBASE.e_PLUGIN_ABS."release/release.php"; // temporary testing
$file = "http://e107.org/feed?type=plugin&frm=".$from."&srch=".$srch;
$file = "http://e107.org/feed?type=plugin&frm=".$from."&srch=".$srch."&limit=10";
$xml->setOptArrayTags('plugin'); // make sure 'plugin' tag always returns an array
$xdata = $xml->loadXMLfile($file,'advanced');
@ -380,7 +380,7 @@ class pluginManager{
continue;
}
// echo '<br />v='.$v;
$text .= "<td style='height: 80px' class='".vartrue($this->fields[$v]['class'],'left')."'>".$frm->renderValue($v, $val[$v], $this->fields[$v], $key)."</td>\n";
$text .= "<td style='height: 40px' class='".vartrue($this->fields[$v]['class'],'left')."'>".$frm->renderValue($v, $val[$v], $this->fields[$v], $key)."</td>\n";
}
$text .= "<td class='center'>".$this->options($val)."</td>";
$text .= "</tr>";

View File

@ -484,10 +484,12 @@ class themeHandler
// $mes->addWarning("This area is experimental.");
$from = intval(varset($_GET['frm']));
$limit = 18;
// $file = SITEURLBASE.e_PLUGIN_ABS."release/release.php"; // temporary testing
$file = "http://e107.org/feed?type=theme&frm=".$from."&srch=".$srch;
$file = "http://e107.org/feed?type=theme&frm=".$from."&srch=".$srch."&limit=".$limit;
$mes->addDebug("File = ".$file);
$xml->setOptArrayTags('theme,screenshots/image'); // make sure 'theme' tag always returns an array
// $xdata = $xml->loadXMLfile($file,'advanced',true);
@ -506,86 +508,95 @@ class themeHandler
// XML data array.
$c = 1;
foreach($xdata['theme'] as $r)
if(is_array($xdata['theme'] ))
{
if(E107_DBG_PATH)
foreach($xdata['theme'] as $r)
{
$mes->addDebug(print_a($r,true));
}
if(E107_DBG_PATH)
{
$mes->addDebug(print_a($r,true));
}
$theme = array(
'name' => stripslashes($r['@attributes']['name']),
'category' => $r['category'],
'preview' => $r['screenshots']['image'],
'date' => $r['@attributes']['date'],
'version' => $r['@attributes']['version'],
'thumbnail' => $r['@attributes']['thumbnail'],
'url' => $r['@attributes']['url'],
'author' => $r['@attributes']['author'],
'website' => $r['@attributes']['authorUrl'],
'compatibility' => $r['@attributes']['compatibility'],
'description' => varset($r['description']),
);
$text .= $this->renderTheme(FALSE, $theme);
/*
[author] => e107 Inc
[summary] => Bootstrap e107 admin theme
[category] => generic
[keywords] => Array
(
[word] => Array
(
[0] => bootstrap
[1] => clean
)
$theme = array(
'name' => $r['@attributes']['name'],
'category' => $r['category'],
'preview' => $r['screenshots']['image'],
'date' => $r['@attributes']['date'],
'version' => $r['@attributes']['version'],
'thumbnail' => $r['@attributes']['thumbnail'],
'url' => $r['@attributes']['url'],
'author' => $r['@attributes']['author'],
'website' => $r['@attributes']['authorUrl'],
'compatibility' => $r['@attributes']['compatibility'],
'description' => varset($r['description']),
);
)
[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] =>
)
$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'>&nbsp;</div>";
$amount = 20;
if($total > $amount)
{
$parms = $total.",".$amount.",".$from.",".e_SELF.'?mode='.$_GET['mode'].'&amp;frm=[FROM]';
$text .= "<div style='text-align:center;margin-top:10px'>".$tp->parseTemplate("{NEXTPREV=$parms}",TRUE)."</div>";
[xhtmlcompliant] =>
[csscompliant] =>
[path] => bootstrap
*/
}
$text .= "<div class='clear'>&nbsp;</div>";
}
else
{
$mes->addInfo("No Themes found which match your search criteria");
}
$amount =$limit;
$ns->tablerender(TPVLAN_26.SEP."Available for Download", $mes->render().$text);
$ns->tablerender(TPVLAN_26.SEP."Available for Download", $text. $mes->render());
if($total > $amount)
{
$parms = $total.",".$amount.",".$from.",".e_SELF.'?mode='.$_GET['mode'].'&amp;frm=[FROM]';
echo"<div class='center'>".$tp->parseTemplate("{NEXTPREV=$parms}",TRUE)."</div>";
}
}
echo "</form>\n</div>\n";