From ef51b625901fa0d57110c38af3b7f00c461061b8 Mon Sep 17 00:00:00 2001 From: Cameron Date: Mon, 4 Mar 2013 03:39:27 -0800 Subject: [PATCH] More work on the Theme and Plugin Manager download areas. --- e107_admin/plugin.php | 6 +- e107_handlers/theme_handler.php | 153 +++++++++++++++++--------------- 2 files changed, 85 insertions(+), 74 deletions(-) diff --git a/e107_admin/plugin.php b/e107_admin/plugin.php index 83dd12a54..6e70f7e7c 100644 --- a/e107_admin/plugin.php +++ b/e107_admin/plugin.php @@ -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 '
v='.$v; - $text .= "".$frm->renderValue($v, $val[$v], $this->fields[$v], $key)."\n"; + $text .= "".$frm->renderValue($v, $val[$v], $this->fields[$v], $key)."\n"; } $text .= "".$this->options($val).""; $text .= ""; diff --git a/e107_handlers/theme_handler.php b/e107_handlers/theme_handler.php index d5f94e771..2c59a4606 100644 --- a/e107_handlers/theme_handler.php +++ b/e107_handlers/theme_handler.php @@ -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 .= "
 
"; - - $amount = 20; - - - if($total > $amount) - { - $parms = $total.",".$amount.",".$from.",".e_SELF.'?mode='.$_GET['mode'].'&frm=[FROM]'; - $text .= "
".$tp->parseTemplate("{NEXTPREV=$parms}",TRUE)."
"; + [xhtmlcompliant] => + [csscompliant] => + [path] => bootstrap + + */ + + } + + $text .= "
 
"; } + 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'].'&frm=[FROM]'; + echo"
".$tp->parseTemplate("{NEXTPREV=$parms}",TRUE)."
"; + } + + } - - echo "\n\n";