diff --git a/e107_admin/plugin.php b/e107_admin/plugin.php index cbf8e35a4..0647eadab 100644 --- a/e107_admin/plugin.php +++ b/e107_admin/plugin.php @@ -484,7 +484,7 @@ class pluginManager{ $badge = $this->compatibilityLabel($row['compatibility']);; $featured = ($row['featured']== 1) ? " ".EPL_ADLAN_91."" : ''; - $price = ($row['price'] > 0) ? "".EPL_ADLAN_92."" : "".EPL_ADLAN_93.""; + $price = (!empty($row['price'])) ? "".$row['price']." ".$row['currency']."" : "".EPL_ADLAN_93.""; $data[] = array( 'plugin_id' => $row['params']['id'], @@ -504,7 +504,7 @@ class pluginManager{ 'plugin_website' => vartrue($row['authorUrl']), 'plugin_url' => $row['urlView'], 'plugin_notes' => '', - // 'plugin_price' => $price, + 'plugin_price' => $row['price'], 'plugin_license' => $price ); @@ -600,9 +600,10 @@ class pluginManager{ // $url = e_SELF.'?action=download&src='.base64_encode($d);//$url.'&action=download'; $id = 'plug_'.$data['plugin_id']; // - + $modalCaption = (!empty($data['plugin_price'])) ? "Purchase ".$data['plugin_name']." ".$data['plugin_version'] : 'Downloading and Installing '.$data['plugin_name']." ".$data['plugin_version']; + $url = e_SELF.'?mode=download&src='.base64_encode($d); - $dicon = ''.ADMIN_INSTALLPLUGIN_ICON.''; + $dicon = ''.ADMIN_INSTALLPLUGIN_ICON.''; // Temporary Pop-up version. @@ -627,12 +628,17 @@ class pluginManager{ $string = base64_decode($_GET['src']); parse_str($string, $data); - - + + if(!empty($data['plugin_price'])) + { + e107::getRedirect()->go($data['plugin_url']); + return true; + } + $mp = $this->getMarketplace(); // $mp->generateAuthKey($e107SiteUsername, $e107SiteUserpass); - // print_a($data); + // Server flush useless. It's ajax ready state 4, we can't flush (sadly) before that (at least not for all browsers) $mes->addSuccess(EPL_ADLAN_94); diff --git a/e107_admin/theme.php b/e107_admin/theme.php index e7c2d7b08..a238eca54 100644 --- a/e107_admin/theme.php +++ b/e107_admin/theme.php @@ -36,17 +36,19 @@ e107::css("inline"," require_once(e_HANDLER."theme_handler.php"); $themec = new themeHandler; +// print_a($_GET); $mode = varset($_GET['mode'],'main'); // (e_QUERY) ? e_QUERY :"main" ; -if(e_AJAX_REQUEST) +if(!empty($_GET['action'])) { define('e_IFRAME',true); } -if(e_AJAX_REQUEST) +if(!empty($_GET['action'])) { + require_once("auth.php"); switch ($_GET['action']) { case 'login': @@ -71,10 +73,10 @@ if(e_AJAX_REQUEST) */ case 'info': - $string = base64_decode($_GET['src']); + $string = base64_decode($_GET['src']); parse_str($string,$p); echo $themec->renderThemeInfo($p); - exit; + break; case 'preview': @@ -82,7 +84,7 @@ if(e_AJAX_REQUEST) $tm = (string) $_GET['id']; $data = $themec->getThemeInfo($tm); echo $themec->renderThemeInfo($data); - exit; + // exit; break; } @@ -108,10 +110,14 @@ if(e_AJAX_REQUEST) */ // Theme Info Ajax // FIXME addd action=preview to the url, remove this block - $tm = (string) $_GET['id']; - $data = $themec->getThemeInfo($tm); - echo $themec->renderThemeInfo($data); - + if(!empty($_GET['id'])) + { + $tm = (string) $_GET['id']; + $data = $themec->getThemeInfo($tm); + echo $themec->renderThemeInfo($data); + } + + require_once(e_ADMIN."footer.php"); exit; } @@ -150,11 +156,18 @@ if($mode == 'download' && !empty($_GET['src'])) $mes = e107::getMessage(); $string = base64_decode($_GET['src']); parse_str($string, $data); + + if(!empty($data['price'])) + { + e107::getRedirect()->go($data['url']); + return true; + } + $mp = $themec->getMarketplace(); $mes->addSuccess("Connecting..."); - if($mp->download($data['id'], $data['mode'], 'theme')) + if($mp->download($data['id'], $data['mode'], 'theme')) // download and unzip theme. { // Auto install? // $text = e107::getPlugin()->install($data['plugin_folder']); diff --git a/e107_handlers/theme_handler.php b/e107_handlers/theme_handler.php index 8f66eddde..5684fcb97 100644 --- a/e107_handlers/theme_handler.php +++ b/e107_handlers/theme_handler.php @@ -584,7 +584,8 @@ class themeHandler 'price' => $r['price'], 'livedemo' => $r['livedemo'], ); - + + $text .= $this->renderTheme(FALSE, $theme); $c++; @@ -813,7 +814,7 @@ class themeHandler $preview = "".($theme['preview'] ? "" : "").""; $description = vartrue($theme['description'],''); $compat = (intval($theme['compatibility']) == 2) ? "".number_format($theme['compatibility'], 1, '.','')." Recommended!": vartrue(number_format($theme['compatibility'], 1, '.',''),'1.0'); - $price = ($theme['price'] > 0) ? " ".$theme['price']."" : "".Free.""; + $price = (!empty($theme['price'])) ? " ".$theme['price']."" : "Free"; $text = "
";
+ $text .= " ";
foreach($theme['preview'] as $pic)
{
$picFull = (substr($pic,0,4) == 'http') ? $pic : e_THEME.$theme['path']."/".$pic;
- $text .= "
-
+ $text .= " ";
// $text .= "
+
";
}
-
+
+ $text .= " |
// - - + + | "; } diff --git a/e107_themes/bootstrap3/admin_style.css b/e107_themes/bootstrap3/admin_style.css index 8cdb8f0e1..5200f7b9b 100644 --- a/e107_themes/bootstrap3/admin_style.css +++ b/e107_themes/bootstrap3/admin_style.css @@ -140,7 +140,7 @@ td.options .btn-group { display: flex; } .table .nav-tabs a, .table th a, .table td a { text-decoration: none } -.table > thead > tr > th { padding: 15px 10px; font-weight:bold; font-variant: small-caps; } +.table > thead > tr > th, tr > th { padding: 15px 10px; font-weight:bold; font-variant: small-caps; } .label, .badge { text-shadow: 1px 1px 0px #000; box-shadow: 1px 1px 0px #000; } @@ -1121,14 +1121,14 @@ li.rssRow > div { .notifications.top-left{left:10px;top:25px;} .notifications.bottom-left{left:10px;bottom:25px;} .notifications.bottom-right{right:10px;bottom:25px;} -.notifications>div{position:relative;z-index:9999;margin:5px 0px;} +.notifications>div{ position:relative;z-index:9999;margin:5px 0;} .notifications.center{top:30%;left:0;width:100%;}.notifications.center>div{margin:5px auto;width:20%;text-align:center;} /* Theme selection */ -.admin-theme-thumb { 200px; height:130px;overflow:hidden;border:1px solid black; margin:0px; margin-bottom:10px; padding:0px; } +.admin-theme-thumb { width:100%; height:130px;overflow:hidden;border:1px solid black; margin:0; margin-bottom:10px; padding:0; } .admin-theme-thumb:hover { opacity:0.4 } .admin-theme-options { @@ -1142,7 +1142,9 @@ li.rssRow > div { padding-top:50px; white-space:nowrap; background-color:black; - display:block;position:relative; text-align:center; vertical-align:middle; top:-141px;} + display:block;position:relative; + vertical-align:middle; top:-141px; + } .admin-theme-options:hover { opacity:0.85; } .admin-theme-options .fa-check { color: #FAA732 } diff --git a/e107_web/js/core/admin.jquery.js b/e107_web/js/core/admin.jquery.js index 8e179c55d..249349972 100644 --- a/e107_web/js/core/admin.jquery.js +++ b/e107_web/js/core/admin.jquery.js @@ -206,6 +206,14 @@ $(document).ready(function() { e.preventDefault(); + + if($(this).attr('data-cache') == 'false') + { + $('#uiModal').on('shown.bs.modal', function () { + $(this).removeData('bs.modal'); + }); + } + var url = $(this).attr('href'); var caption = $(this).attr('data-modal-caption'); var height = ($(window).height() * 0.7) - 50;