1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 12:20:44 +02:00

Theme download/unzip method reactivated.

This commit is contained in:
Cameron
2015-02-10 12:57:38 -08:00
parent fc7e563cbe
commit e745a2398a
2 changed files with 40 additions and 4 deletions

View File

@@ -72,6 +72,11 @@ h2 { text-align: right; margin-bottom: -30px; padding-right: 10px; }
require_once(e_HANDLER."theme_handler.php");
$themec = new themeHandler;
$mode = varset($_GET['mode'],'main'); // (e_QUERY) ? e_QUERY :"main" ;
if(e_AJAX_REQUEST)
{
define('e_IFRAME',true);
@@ -170,9 +175,35 @@ else
$mode = varset($_GET['mode'],'main'); // (e_QUERY) ? e_QUERY :"main" ;
if(vartrue($_POST['selectadmin']))
if($mode == 'download' && !empty($_GET['src']))
{
define('e_IFRAME', true);
$frm = e107::getForm();
$mes = e107::getMessage();
$string = base64_decode($_GET['src']);
parse_str($string, $data);
$mp = $themec->getMarketplace();
$mes->addSuccess("Connecting...");
if($mp->download($data['id'], $data['mode'], 'theme'))
{
// Auto install?
// $text = e107::getPlugin()->install($data['plugin_folder']);
// $mes->addInfo($text);
echo $mes->render('default', 'success');
}
else
{
echo $mes->addError('Unable to continue')->render('default', 'error');
}
echo $mes->render('default', 'debug');
}
elseif(vartrue($_POST['selectadmin']))
{
$mode = "admin";
}

View File

@@ -1046,7 +1046,7 @@ class themeHandler
}
*/
$downloadUrl = e_SELF.'?action='.$action.'&src='.base64_encode($d);//$url.'&action=download';
$downloadUrl = e_SELF.'?mode=download&action='.$action.'&src='.base64_encode($d);//$url.'&action=download';
$infoUrl = $url.'&action=info';
$viewUrl = $theme['url'];
@@ -1054,8 +1054,13 @@ class themeHandler
//$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 class='e-modal btn btn-small btn-inverse' data-modal-caption=\"".$theme['name']." ".$theme['version']."\" rel='external' href='{$downloadUrl}' data-cache='false' title='".$LAN_DOWNLOAD."' >".$tp->toGlyph('download',array('size'=>'2x'))."</a> ";
// Temporary Pop-up version.
$main_icon = "<a class='e-modal btn btn-small btn-inverse' data-modal-caption=\"".$theme['name']." ".$theme['version']."\" rel='external' href='{$viewUrl}' data-cache='false' title='".$LAN_DOWNLOAD."' >".$tp->toGlyph('download',array('size'=>'2x'))."</a> ";
// $main_icon = "<a class='e-modal btn btn-small btn-inverse' 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 class='btn btn-small btn-inverse' 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>";