diff --git a/e107_admin/plugin.php b/e107_admin/plugin.php index 71dff2af5..92d4444ea 100644 --- a/e107_admin/plugin.php +++ b/e107_admin/plugin.php @@ -17,101 +17,6 @@ if (!getperms("Z")) exit; } -// Only tested Locally so far. -if(e_AJAX_REQUEST && isset($_GET['src'])) // Ajax -{ - $string = base64_decode($_GET['src']); - parse_str($string,$p); - $remotefile = $p['plugin_url']; - - $localfile = md5($remotefile.time()).".zip"; - $status = "Downloading..."; - - $fl = e107::getFile(); - $fl->setAuthKey($e107SiteUsername,$e107SiteUserpass); - $fl->download($remotefile,'plugin'); - - exit; - - /* - - - - - - if(!file_exists(e_TEMP.$localfile)) - { - echo 'There was a problem retrieving the file'; - exit; - } - else - { - $contents = file_get_contents(e_TEMP.$localfile); - if($contents == 'LOGIN') - { - echo "
Connecting...\n"; flush(); // FIXME change the modal default label, default is Loading... + // download and flush + $mp->download($p['plugin_id'], $p['plugin_mode'], 'plugin'); + + echo ""; flush(); + } + /*$string = base64_decode($_GET['src']); + parse_str($string,$p); + $remotefile = $p['plugin_url']; + + $localfile = md5($remotefile.time()).".zip"; + $status = "Downloading..."; + + $fl = e107::getFile(); + $fl->setAuthKey($e107SiteUsername,$e107SiteUserpass); + $fl->download($remotefile,'plugin');*/ + exit; +} if(isset($_POST['uninstall_cancel'])) { @@ -222,11 +158,6 @@ class pluginmanager_form extends e_form } - - -$plugin = new e107plugin; -$pman = new pluginManager; -define("e_PAGETITLE",ADLAN_98." - ".$pman->pagetitle); require_once("auth.php"); $pman->pluginObserver(); $mes = e107::getMessage(); @@ -310,18 +241,6 @@ class pluginManager{ $keys = array_keys($this -> titlearray); $this->pagetitle = (in_array($this->action,$keys)) ? $this -> titlearray[$this->action] : $this -> titlearray['installed']; - - // temporary - create e_marketpalce instnace - // it'll be moved to e107::getMarketplace() soon - if($this->action == 'online') - { - // XXX force xmlrpc temporary - require_once(e_HANDLER.'e_marketplace.php'); - $this->mp = new e_marketplace('xmlrpc'); - } - - - /* if(isset($_POST['uninstall-selected'])) { foreach($_POST['checkboxes'] as $val) @@ -338,7 +257,19 @@ class pluginManager{ } - + /** + * Temporary, e107::getMarketplace() coming soon + * @return e_marketplace + */ + public function getMarketplace() + { + if(null === $this->mp) + { + require_once(e_HANDLER.'e_marketplace.php'); + $this->mp = new e_marketplace('xmlrpc'); // XXX temporary force xmplrpc + } + return $this->mp; + } @@ -479,11 +410,12 @@ class pluginManager{ $from = isset($_GET['frm']) ? intval($_GET['frm']) : 0; $srch = preg_replace('/[^\w]/','', vartrue($_GET['srch'])); + $mp = $this->getMarketplace(); // auth - $this->mp->generateAuthKey($e107SiteUsername, $e107SiteUserpass); + $mp->generateAuthKey($e107SiteUsername, $e107SiteUserpass); // do the request, retrieve and parse data - $xdata = $this->mp->call('getList', array( + $xdata = $mp->call('getList', array( 'type' => 'plugin', 'params' => array('limit' => 10, 'search' => $srch, 'from' => $from) )); @@ -511,9 +443,11 @@ class pluginManager{ $price = ($row['price'] > 0) ? "".$row['price']." credits" : "Free"; $data[] = array( - 'plugin_id' => $c, + 'plugin_id' => $row['params']['id'], + 'plugin_mode' => $row['params']['mode'], 'plugin_icon' => vartrue($row['icon'],e_IMAGE."admin_images/plugins_32.png"), - 'plugin_name' => stripslashes($row['name']).$featured, + 'plugin_name' => stripslashes($row['name']), + 'plugin_featured' => $featured, 'plugin_folder' => $row['folder'], 'plugin_date' => vartrue($row['date']), 'plugin_category' => vartrue($row['category'], 'n/a'), @@ -523,7 +457,7 @@ class pluginManager{ 'plugin_compatible' => $badge, 'plugin_website' => vartrue($row['authorUrl']), - 'plugin_url' => $row['url'], + //'plugin_url' => $row['url'], 'plugin_notes' => '', 'plugin_price' => $price ); @@ -568,8 +502,11 @@ class pluginManager{ { continue; } + + $_value = $val[$v]; + if($v == 'plugin_name') $_value .= $val['plugin_featured']; // echo '
Connecting...
"; flush(); // FIXME change the modal default label, default is Loading... + echo "Connecting...\n"; flush(); // FIXME change the modal default label, default is Loading... // download and flush $mp->download($p['id'], $p['mode'], $p['type']); echo ""; flush(); diff --git a/e107_handlers/e_marketplace.php b/e107_handlers/e_marketplace.php index 54fe2f2e2..56552b36d 100644 --- a/e107_handlers/e_marketplace.php +++ b/e107_handlers/e_marketplace.php @@ -223,7 +223,7 @@ abstract class e_marketplace_adapter_abstract if($dir && is_dir($destpath.$dir)) { - echo "(".ucfirst($type).") Already Installed".$destpath.$dir; flush(); + echo "(".ucfirst($type).") Already Downloaded - ".basename($destpath).'/'.$dir; flush(); @unlink(e_TEMP.$localfile); return; } diff --git a/e107_handlers/theme_handler.php b/e107_handlers/theme_handler.php index cffc8c889..1a59f1a54 100644 --- a/e107_handlers/theme_handler.php +++ b/e107_handlers/theme_handler.php @@ -555,7 +555,7 @@ class themeHandler 'date' => $r['date'], 'version' => $r['version'], 'thumbnail' => $r['thumbnail'], - 'url' => $r['url'], + //'url' => $r['url'], 'author' => $r['author'], 'website' => $r['authorUrl'], 'compatibility' => $r['compatibility'], @@ -1034,7 +1034,7 @@ class themeHandler $id = $frm->name2id($theme['name']); $LAN_DOWNLOAD = ($theme['price'] > 0) ? "Buy/Download" : "Download"; - $downloadUrl = e_SELF.'?'.(e_QUERY ? e_QUERY.'&' : '').'&action=download&src='.base64_encode($d);//$url.'&action=download'; + $downloadUrl = e_SELF.'?action=download&src='.base64_encode($d);//$url.'&action=download'; $infoUrl = $url.'&action=info'; //$main_icon = "";