mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 12:48:26 +02:00
Remove login requirement from plugin and theme browsers. (ie. 'Find Plugins' and 'Find Themes')
This commit is contained in:
@@ -39,8 +39,13 @@ if(e_AJAX_REQUEST && isset($_GET['action'])) // Ajax
|
|||||||
$string = base64_decode($_GET['src']);
|
$string = base64_decode($_GET['src']);
|
||||||
parse_str($string, $p);
|
parse_str($string, $p);
|
||||||
|
|
||||||
$mp = $pman->getMarketplace();
|
print_a($p);
|
||||||
$mp->generateAuthKey($e107SiteUsername, $e107SiteUserpass);
|
|
||||||
|
// $mp = $pman->getMarketplace();
|
||||||
|
// $mp->generateAuthKey($e107SiteUsername, $e107SiteUserpass);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Server flush useless. It's ajax ready state 4, we can't flush (sadly) before that (at least not for all browsers)
|
// Server flush useless. It's ajax ready state 4, we can't flush (sadly) before that (at least not for all browsers)
|
||||||
echo "<pre>Connecting...\n"; flush(); // FIXME change the modal default label, default is Loading...
|
echo "<pre>Connecting...\n"; flush(); // FIXME change the modal default label, default is Loading...
|
||||||
// download and flush
|
// download and flush
|
||||||
@@ -206,7 +211,8 @@ class pluginManager{
|
|||||||
"plugin_folder" => array("title" => EPL_ADLAN_64, "type"=>"text", "width" => "10%", "thclass" => "middle"),
|
"plugin_folder" => array("title" => EPL_ADLAN_64, "type"=>"text", "width" => "10%", "thclass" => "middle"),
|
||||||
"plugin_category" => array("title" => LAN_CATEGORY, "type"=>"text", "width" => "auto", "thclass" => "middle"),
|
"plugin_category" => array("title" => LAN_CATEGORY, "type"=>"text", "width" => "auto", "thclass" => "middle"),
|
||||||
"plugin_author" => array("title" => EPL_ADLAN_12, "type"=>"text", "width" => "10%", "thclass" => "middle"),
|
"plugin_author" => array("title" => EPL_ADLAN_12, "type"=>"text", "width" => "10%", "thclass" => "middle"),
|
||||||
"plugin_price" => array("title" => "Price", 'nolist'=>true, "forced"=>true, "type"=>"text", "width" => "5%", "thclass" => "left"),
|
"plugin_license" => array("title" => "License", 'nolist'=>true, "forced"=>true, "type"=>"text", "width" => "5%", "thclass" => "left"),
|
||||||
|
// "plugin_price" => array("title" => "Price", 'nolist'=>true, "forced"=>true, "type"=>"text", "width" => "5%", "thclass" => "left"),
|
||||||
"plugin_compatible" => array("title" => EPL_ADLAN_13, "type"=>"text", "width" => "5%", "thclass" => "middle"),
|
"plugin_compatible" => array("title" => EPL_ADLAN_13, "type"=>"text", "width" => "5%", "thclass" => "middle"),
|
||||||
"plugin_description" => array("title" => EPL_ADLAN_14, "type"=>"bbarea", "width" => "30%", "thclass" => "middle center", 'readParms' => 'expand=1&truncate=180&bb=1'),
|
"plugin_description" => array("title" => EPL_ADLAN_14, "type"=>"bbarea", "width" => "30%", "thclass" => "middle center", 'readParms' => 'expand=1&truncate=180&bb=1'),
|
||||||
"plugin_compliant" => array("title" => EPL_ADLAN_81, "type"=>"text", "width" => "5%", "thclass" => "middle center", "url" => ""),
|
"plugin_compliant" => array("title" => EPL_ADLAN_81, "type"=>"text", "width" => "5%", "thclass" => "middle center", "url" => ""),
|
||||||
@@ -235,7 +241,8 @@ class pluginManager{
|
|||||||
|
|
||||||
if($this->action == 'online')
|
if($this->action == 'online')
|
||||||
{
|
{
|
||||||
$this->fields["plugin_price"]['nolist'] = false; // = array("title" => "Price", "forced"=>true, "type"=>"text", "width" => "5%", "thclass" => "middle center");
|
// $this->fields["plugin_price"]['nolist'] = false; // = array("title" => "Price", "forced"=>true, "type"=>"text", "width" => "5%", "thclass" => "middle center");
|
||||||
|
$this->fields["plugin_license"]['nolist'] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$keys = array_keys($this -> titlearray);
|
$keys = array_keys($this -> titlearray);
|
||||||
@@ -410,6 +417,7 @@ class pluginManager{
|
|||||||
$from = isset($_GET['frm']) ? intval($_GET['frm']) : 0;
|
$from = isset($_GET['frm']) ? intval($_GET['frm']) : 0;
|
||||||
$srch = preg_replace('/[^\w]/','', vartrue($_GET['srch']));
|
$srch = preg_replace('/[^\w]/','', vartrue($_GET['srch']));
|
||||||
|
|
||||||
|
|
||||||
$mp = $this->getMarketplace();
|
$mp = $this->getMarketplace();
|
||||||
// auth
|
// auth
|
||||||
$mp->generateAuthKey($e107SiteUsername, $e107SiteUserpass);
|
$mp->generateAuthKey($e107SiteUsername, $e107SiteUserpass);
|
||||||
@@ -420,27 +428,38 @@ class pluginManager{
|
|||||||
'params' => array('limit' => 10, 'search' => $srch, 'from' => $from)
|
'params' => array('limit' => 10, 'search' => $srch, 'from' => $from)
|
||||||
));
|
));
|
||||||
$total = $xdata['params']['count'];
|
$total = $xdata['params']['count'];
|
||||||
|
|
||||||
|
|
||||||
// OLD BIT OF CODE ------------------------------->
|
// OLD BIT OF CODE ------------------------------->
|
||||||
/*
|
/*
|
||||||
// $file = SITEURLBASE.e_PLUGIN_ABS."release/release.php"; // temporary testing
|
// $file = SITEURLBASE.e_PLUGIN_ABS."release/release.php"; // temporary testing
|
||||||
$file = "http://e107.org/feed?type=plugin&frm=".$from."&srch=".$srch."&limit=10";
|
$file = "http://e107.org/feed?type=plugin&frm=".$from."&srch=".$srch."&limit=10";
|
||||||
|
|
||||||
$xml->setOptArrayTags('plugin'); // make sure 'plugin' tag always returns an array
|
$xml->setOptArrayTags('plugin'); // make sure 'plugin' tag always returns an array
|
||||||
$xdata = $xml->loadXMLfile($file,'advanced');
|
$xdata = $xml->loadXMLfile($file,'advanced');
|
||||||
|
|
||||||
$total = $xdata['@attributes']['total'];*/
|
$total = $xdata['@attributes']['total'];
|
||||||
|
|
||||||
|
echo 'file='.$file;
|
||||||
|
// print_a($xdata);
|
||||||
|
|
||||||
|
$xdata['data'] = $xdata['plugin'];
|
||||||
|
*/
|
||||||
// OLD BIT OF CODE END ------------------------------->
|
// OLD BIT OF CODE END ------------------------------->
|
||||||
|
|
||||||
|
|
||||||
|
// print_a($xdata);
|
||||||
|
|
||||||
$c = 1;
|
$c = 1;
|
||||||
foreach($xdata['data'] as $row)
|
foreach($xdata['data'] as $row)
|
||||||
{
|
{
|
||||||
//$row = $r['@attributes'];
|
//$row = $r['@attributes'];
|
||||||
|
|
||||||
|
// print_a($row);
|
||||||
|
|
||||||
$badge = $this->compatibilityLabel($row['compatibility']);;
|
$badge = $this->compatibilityLabel($row['compatibility']);;
|
||||||
$featured = ($row['featured']== 1) ? " <span class='label label-info'>Featured</span>" : '';
|
$featured = ($row['featured']== 1) ? " <span class='label label-info'>Featured</span>" : '';
|
||||||
$price = ($row['price'] > 0) ? "<span class='label label-success'>".$row['price']." credits</span>" : "<span class='label label-success'>Free</span>";
|
$price = ($row['price'] > 0) ? "<span class='label label-info'>Buy</span>" : "<span class='label label-success'>Free</span>";
|
||||||
|
|
||||||
$data[] = array(
|
$data[] = array(
|
||||||
'plugin_id' => $row['params']['id'],
|
'plugin_id' => $row['params']['id'],
|
||||||
@@ -448,6 +467,7 @@ class pluginManager{
|
|||||||
'plugin_icon' => vartrue($row['icon'],'e-plugins-32'),
|
'plugin_icon' => vartrue($row['icon'],'e-plugins-32'),
|
||||||
'plugin_name' => stripslashes($row['name']),
|
'plugin_name' => stripslashes($row['name']),
|
||||||
'plugin_featured' => $featured,
|
'plugin_featured' => $featured,
|
||||||
|
'plugin_sef' => '',
|
||||||
'plugin_folder' => $row['folder'],
|
'plugin_folder' => $row['folder'],
|
||||||
'plugin_date' => vartrue($row['date']),
|
'plugin_date' => vartrue($row['date']),
|
||||||
'plugin_category' => vartrue($row['category'], 'n/a'),
|
'plugin_category' => vartrue($row['category'], 'n/a'),
|
||||||
@@ -457,9 +477,10 @@ class pluginManager{
|
|||||||
'plugin_compatible' => $badge,
|
'plugin_compatible' => $badge,
|
||||||
|
|
||||||
'plugin_website' => vartrue($row['authorUrl']),
|
'plugin_website' => vartrue($row['authorUrl']),
|
||||||
//'plugin_url' => $row['url'],
|
'plugin_url' => $row['urlView'],
|
||||||
'plugin_notes' => '',
|
'plugin_notes' => '',
|
||||||
'plugin_price' => $price
|
// 'plugin_price' => $price,
|
||||||
|
'plugin_license' => $price
|
||||||
);
|
);
|
||||||
|
|
||||||
$c++;
|
$c++;
|
||||||
@@ -508,7 +529,7 @@ class pluginManager{
|
|||||||
// echo '<br />v='.$v;
|
// echo '<br />v='.$v;
|
||||||
$text .= "<td style='height: 40px' class='".vartrue($this->fields[$v]['class'],'left')."'>".$frm->renderValue($v, $_value, $this->fields[$v], $key)."</td>\n";
|
$text .= "<td style='height: 40px' class='".vartrue($this->fields[$v]['class'],'left')."'>".$frm->renderValue($v, $_value, $this->fields[$v], $key)."</td>\n";
|
||||||
}
|
}
|
||||||
$text .= "<td class='center'>".$this->options($val)."</td>";
|
$text .= "<td class='right'>".$this->options($val)."</td>";
|
||||||
$text .= "</tr>";
|
$text .= "</tr>";
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -554,8 +575,13 @@ class pluginManager{
|
|||||||
$url = e_SELF.'?action=download&src='.base64_encode($d);//$url.'&action=download';
|
$url = e_SELF.'?action=download&src='.base64_encode($d);//$url.'&action=download';
|
||||||
$id = 'plug_'.$data['plugin_id'];
|
$id = 'plug_'.$data['plugin_id'];
|
||||||
//<button type='button' data-target='{$id}' data-loading='".e_IMAGE."/generic/loading_32.gif' class='btn btn-primary e-ajax middle' value='Download and Install' data-src='".$url."' ><span>Download and Install</span></button>
|
//<button type='button' data-target='{$id}' data-loading='".e_IMAGE."/generic/loading_32.gif' class='btn btn-primary e-ajax middle' value='Download and Install' data-src='".$url."' ><span>Download and Install</span></button>
|
||||||
$dicon = "<a data-toggle='modal' data-modal-caption=\"Downloading ".$data['plugin_name']." ".$data['plugin_version']."\" href='{$url}' data-cache='false' data-target='#uiModal' title='".$LAN_DOWNLOAD."' ><img class='top' src='".e_IMAGE_ABS."icons/download_32.png' alt='' /></a> ";
|
|
||||||
return "<div id='{$id}' style='vertical-align:middle'>
|
// Temporary Pop-up version.
|
||||||
|
$dicon = '<a class="e-modal" href="'.$data['plugin_url'].'" rel="external" data-modal-caption="'.$data['plugin_name']." ".$data['plugin_version'].'" target="_blank" ><img class="top" src="'.e_IMAGE_ABS.'icons/download_32.png" alt="" /></a>';
|
||||||
|
|
||||||
|
// $dicon = "<a data-toggle='modal' data-modal-caption=\"Downloading ".$data['plugin_name']." ".$data['plugin_version']."\" href='{$url}' data-cache='false' data-target='#uiModal' title='".$LAN_DOWNLOAD."' ><img class='top' src='".e_IMAGE_ABS."icons/download_32.png' alt='' /></a> ";
|
||||||
|
|
||||||
|
return "<div id='{$id}' class='right' >
|
||||||
{$dicon}
|
{$dicon}
|
||||||
</div>";
|
</div>";
|
||||||
}
|
}
|
||||||
|
@@ -39,6 +39,7 @@ class e_marketplace
|
|||||||
{
|
{
|
||||||
$this->_adapter_name = 'wsdl';
|
$this->_adapter_name = 'wsdl';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -533,7 +533,7 @@ class themeHandler
|
|||||||
'date' => $r['date'],
|
'date' => $r['date'],
|
||||||
'version' => $r['version'],
|
'version' => $r['version'],
|
||||||
'thumbnail' => $r['thumbnail'],
|
'thumbnail' => $r['thumbnail'],
|
||||||
//'url' => $r['url'],
|
'url' => $r['urlView'],
|
||||||
'author' => $r['author'],
|
'author' => $r['author'],
|
||||||
'website' => $r['authorUrl'],
|
'website' => $r['authorUrl'],
|
||||||
'compatibility' => $r['compatibility'],
|
'compatibility' => $r['compatibility'],
|
||||||
@@ -1028,6 +1028,7 @@ class themeHandler
|
|||||||
$id = $frm->name2id($theme['name']);
|
$id = $frm->name2id($theme['name']);
|
||||||
$LAN_DOWNLOAD = ($theme['price'] > 0) ? "Buy/Download" : "Download";
|
$LAN_DOWNLOAD = ($theme['price'] > 0) ? "Buy/Download" : "Download";
|
||||||
|
|
||||||
|
/*
|
||||||
if($this->mp->hasAuthKey())
|
if($this->mp->hasAuthKey())
|
||||||
{
|
{
|
||||||
$action = 'download';
|
$action = 'download';
|
||||||
@@ -1038,13 +1039,20 @@ class themeHandler
|
|||||||
$action = 'login';
|
$action = 'login';
|
||||||
$caption = "Please login to your e107.org account to proceed..";
|
$caption = "Please login to your e107.org account to proceed..";
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
$downloadUrl = e_SELF.'?action='.$action.'&src='.base64_encode($d);//$url.'&action=download';
|
$downloadUrl = e_SELF.'?action='.$action.'&src='.base64_encode($d);//$url.'&action=download';
|
||||||
$infoUrl = $url.'&action=info';
|
$infoUrl = $url.'&action=info';
|
||||||
|
|
||||||
|
$viewUrl = $theme['url'];
|
||||||
|
|
||||||
//$main_icon = "<a data-src='".$downloadUrl."' href='{$downloadUrl}' data-target='{$id}' data-loading='".e_IMAGE."/generic/loading_32.gif' class='-e-ajax' title='".$LAN_DOWNLOAD."' ><img class='top' src='".e_IMAGE_ABS."icons/download_32.png' alt='' /></a> ";
|
//$main_icon = "<a data-src='".$downloadUrl."' href='{$downloadUrl}' data-target='{$id}' data-loading='".e_IMAGE."/generic/loading_32.gif' class='-e-ajax' title='".$LAN_DOWNLOAD."' ><img class='top' src='".e_IMAGE_ABS."icons/download_32.png' alt='' /></a> ";
|
||||||
$main_icon = "<a data-toggle='modal' data-modal-caption=\"".$caption."\" href='{$downloadUrl}' data-cache='false' data-target='#uiModal' title='".$LAN_DOWNLOAD."' >".$tp->toGlyph('download',array('size'=>'2x'))."</a> ";
|
// $main_icon = "<a data-toggle='modal' data-modal-caption=\"".$caption."\" href='{$downloadUrl}' data-cache='false' data-target='#uiModal' title='".$LAN_DOWNLOAD."' >".$tp->toGlyph('download',array('size'=>'2x'))."</a> ";
|
||||||
|
|
||||||
|
// Temporary Pop-up version.
|
||||||
|
$main_icon = "<a class='e-modal' data-modal-caption=\"".$theme['name']." ".$theme['version']."\" rel='external' href='{$viewUrl}' data-cache='false' title='".$LAN_DOWNLOAD."' >".$tp->toGlyph('download',array('size'=>'2x'))."</a> ";
|
||||||
|
|
||||||
|
|
||||||
$info_icon = "<a data-toggle='modal' data-modal-caption=\"".$theme['name']." ".$theme['version']."\" href='".$infoUrl."' data-cache='false' data-target='#uiModal' title='".TPVLAN_7."'>".$tp->toGlyph('fa-info-circle',array('size'=>'2x'))."</a>";
|
$info_icon = "<a data-toggle='modal' data-modal-caption=\"".$theme['name']." ".$theme['version']."\" href='".$infoUrl."' data-cache='false' data-target='#uiModal' title='".TPVLAN_7."'>".$tp->toGlyph('fa-info-circle',array('size'=>'2x'))."</a>";
|
||||||
|
|
||||||
if($theme['livedemo'])
|
if($theme['livedemo'])
|
||||||
|
Reference in New Issue
Block a user