Пример #1
0
function js_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error, $scripts, $allcatwise;
    global $software, $soft, $info, $settings, $init_tab, $overwrite_option, $dbs, $installed, $__settings, $setupcontinue, $installations, $notes, $show_installtype, $protocols, $nopackage, $ajaxhttpsexists, $ajaxhttps, $new_insid;
    if (optGET('ajaxdownload') && !empty($nopackage)) {
        // Try to download the package
        if (method_exists($softpanel, 'updatesoftwares')) {
            $softpanel->updatesoftwares($soft, 0, 0, 1);
            echo 1;
            return true;
        }
        // False call
        echo 0;
        return false;
    }
    // Give the staus
    if (optGET('ajaxstatus')) {
        $_status = soft_progress(optGET('ajaxstatus'));
        $tmp_status = unserialize($_status[1]);
        $_status[1] = $tmp_status['current_status'];
        if (!empty($_status)) {
            echo implode('|', $_status);
            return true;
        }
        // False call
        echo 0;
        return false;
    }
    if (!empty($ajaxhttps)) {
        echo $ajaxhttpsexists;
        return true;
    }
    // Auto Installation responses
    if (isset($_GET['autoinstall'])) {
        // Installed successfully
        if (!empty($installed)) {
            echo 'installed';
            return true;
        }
        // Are there errors
        if (!empty($error)) {
            echo serialize($error);
            return false;
        }
    }
    //First add the installation info
    if (empty($installed)) {
        $info['install'] = '<div id="fadeout_div"><form accept-charset="' . $globals['charset'] . '" name="installsoftware" method="post" action="" onsubmit="return checkform();" id="installsoftware" class="form-horizontal">';
        if (empty($globals['lictype']) && !empty($scripts[$soft]['force_scripts'])) {
            $info['install'] .= '
	<div class="alert alert-warning">
		<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
		<center>' . lang_vars($l['not_in_free'], array($software['name'])) . (!webuzo() ? '&nbsp;&nbsp;' . $l['notify_admin'] : '') . '</center>
	</div>';
        }
        $info['install'] .= error_handle($error, "100%", 0, 1) . '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[

function checkform(dosubmit){
	try{
		if(!formcheck()){
			return false;
		}
	}catch(e){
		//Do nothing
	}
	$_("softsubmitbut").disabled = true;
	
	if(!get_package()){
		return false;
	}
	
	if(useprog){
		
		// Send a request to check the status
		progressbar.start();
		
		// Return false so that the form is not submitted
		return false;
	
	// This is OLD School !
	}else{		
		if(dosubmit == 1){			
			$_("installsoftware").submit();	
		}
		show_msg("' . $l['installing'] . '");
	}
	
	return true;
	
};

function toggle_advoptions(){
	if ($("#advoptions").is(":hidden")){
		$("#advoptions").slideDown("slow");
		$("#plus").attr("src", "' . $theme['images'] . 'minus_new.gif");
	}
	else{
		$("#advoptions").slideUp("slow");
		$("#plus").attr("src", "' . $theme['images'] . 'plus_new.gif");
	}
}

function plus_onmouseover(){
	$("#plus").attr("src", "' . $theme['images'] . 'plus_hover.gif");
}

function plus_onmouseout(){
	$("#plus").attr("src", "' . $theme['images'] . 'plus.gif");
}

var progressbar = {
	timer: 0,
	total_width: 0,	
	status_key: "",
	synctimer: 0,
	fadeout_div: "#fadeout_div",
	win_div: "#install_win",
	progress_div: "#progress_bar",
	formid: "#installsoftware",
	frequency: 8000,
	
	current: function(){
		try{
			var tmp_cur = Math.round(parseInt($_("progress_color").width)/parseInt($_("table_progress").width)*100);
			if(tmp_cur > 100){
				tmp_cur = 99;
			}
			return tmp_cur;
		}catch(e){
			return -1;	
		}
	},
	
	reset: function(){ try{
		clearTimeout(this.timer);
		$_("progress_color").width = 1;
	}catch(e){ }},
	
	move: function(dest, speed, todo){ try{
		var cur = this.current();
		if(cur < 0){
			clearTimeout(this.timer);
			return false;
		}
		var cent = cur + 1;
		var new_width = cent/100*this.total_width;
		if(new_width < 1){
			new_width = 1;
		}
		//alert(new_width+" "+dest+" "+cent);
		
		$_("progress_color").width = new_width;
		$_("progress_percent").innerHTML = "("+cent+" %)";
		
		if(cent < dest){
			this.timer = setTimeout("progressbar.move("+dest+", "+speed+")", speed);
		}else{
			eval(todo);	
		}
	}catch(e){ }},
	
	text: function(txt){ try{
		$_("progress_txt").innerHTML = txt;
	}catch(e){ }},
	
	sync: function(){
		if(progressbar.status_key.length < 2){
			return false;
		}
		$.ajax({
			url: window.location+"&ajaxstatus="+progressbar.status_key+"&random="+Math.random(),
			type: "GET",
			success: function(data){
				if(data == 0) return false;
				var tmp = data.split("|");
				var cur = progressbar.current();
				tmp[2] = (3000/(tmp[0]-cur));
				//alert(tmp);
				if(tmp[0] > cur){
					if(parseInt(tmp[2]) == 0){
						tmp[2] = 800;
					}
					progressbar.move(tmp[0], tmp[2]);
				}
				progressbar.text(tmp[1]);
				progressbar.synctimer = setTimeout("progressbar.sync()", progressbar.frequency);
			}
		});
	},
	
	sync_abort: function(){
		clearTimeout(this.synctimer);
	},
	
	start: function(){ try{
		this.post();
		this.reset();
		this.total_width = parseInt($_("table_progress").width);
		this.move(95, 800);
		this.status_key = $("#soft_status_key").attr("value");
		this.sync();
	}catch(e){ }},
	
	post: function(){
		
		// Scroll to the Top and show the progress bar
		goto_top();
		$(progressbar.fadeout_div).fadeOut(500, 
			function(){
				$(progressbar.progress_div).fadeOut(1);
				$(progressbar.progress_div).fadeIn(500);
			}
		);
		
		$.ajax({
			url: window.location+"&jsnohf=1",
			type: "POST",
			data: $(progressbar.formid).serialize(),
			complete: function( jqXHR, status, responseText ) {
				
				progressbar.sync_abort();
				
				// Store the response as specified by the jqXHR object
				responseText = jqXHR.responseText;
				
				try{
					//alert(responseText);
					if(responseText.match(/\\<\\!\\-\\-PROC_DONE\\-\\-\\>/gi)){
						progressbar.text("' . addslashes($l['finishing_process']) . '");
						progressbar.move(99, 10, "$(progressbar.progress_div).fadeOut(1)");
					}else{
						progressbar.reset();
					}
				}catch(e){ }
				
				if ( jqXHR.isResolved() ) {
				
					// #4825: Get the actual response in case
					// a dataFilter is present in ajaxSettings
					jqXHR.done(function( r ) {
						responseText = r;
					});
			
					// Create a dummy div to hold the results
					// inject the contents of the document in, removing the scripts
					// to avoid any "Permission Denied" errors in IE
					var newhtml = jQuery("<div>").append(responseText).find(progressbar.win_div).html();
					
					$(progressbar.win_div).animate({opacity: 0}, 1000, "", function(){
						$(progressbar.win_div).html(newhtml);
						show_backup();
						new_theme_funcs_init();
					}).delay(50).animate({opacity: 1}, 500);
					
					//alert(newhtml);
					
				}else{
					alert("Oops ... the connection was lost");
				}
			}
		});
	}
};

function show_msg(msg){	
	$_("show_txt").innerHTML = "<br /><br /> &nbsp; "+msg+" &nbsp; <img src=\\"' . $theme['images'] . 'progress.gif\\" />";
	$_("show_txt").style.display = "";
}

// Is the package there ?
var nopackage = ' . (empty($nopackage) ? 0 : 1) . ';

// Use the Progress Bar ?
var useprog = 1;
try{
	if(BrowserDetect.browser.toLowerCase() == "safari" && BrowserDetect.version.toString().substr(0, 1) == "3"){
		useprog = 0;
	}
}catch(e){ }

function get_package(){	
	if(nopackage){
		
		show_msg("' . $l['downloading'] . '");
		
		try{		
			AJAX("' . $globals['index'] . 'act=js&soft=' . $soft . '&ajaxdownload=1&random="+Math.random(), "get_package_handle(re)");
		}catch(e){ }
		
		return false;
	}else{
		$_("show_txt").style.display = "none";
		return true;
	}
};

function get_package_handle(resp){
	nopackage = 0;
	show_msg("' . $l['installing'] . '");
	checkform(1);
};

softemail = new Object();
function softmail(){
	try{
		var sofdom = "softdomain";
		for(x in softemail){
			if(softemail[x] == true) continue;
			var temp = $_(x).value.split("@");
			if($_(sofdom).value.indexOf("/") > 0){
				var dom_value = $_(sofdom).value.substring(0, $_(sofdom).value.indexOf("/"));
			}else{
				var dom_value = $_(sofdom).value;
			}
			$_(x).value = temp[0] + "@" + dom_value;
		}
	}catch(e){
		return false;
	}
};

function checkhttps(proto_id, softdomain_id, alrt){
	try{
		var id = $_(proto_id);
		var proto = id.options[id.selectedIndex].text;
	
		$("#checkhttps_wait").css("display","inline-block");
		if(proto.indexOf("https") !== -1){
		
			 $.ajax({
				type: "POST",
				url: "' . $globals['index'] . 'act=js&soft=' . $soft . '&checkhttps="+encodeURIComponent(proto+$_(softdomain_id).value),
				timeout:10000,
				// Checking for error
				success: function(data){
					$("#checkhttps_wait").css("display","none");
					is_https(data);
				},
				error: function(jqXHR, status, e) {
					$("#checkhttps_wait").css("display","none");
					is_https(e);
					return false;
				}
			}); 
			
			//AJAX("' . $globals['index'] . 'act=software&soft=' . $soft . '&checkhttps="+id.options[id.selectedIndex].text+$_(softdomain_id).value, "is_https(re)");
		}else{
			$("#checkhttps_wait").css("display","none");
			is_https("true");
		}
		if(alrt == true){
			alert(proto+$_(softdomain_id).value);
		}
	}catch(e){
		//
	}
	return true;
};

function is_https(re){
	try{
		httpserror = "";
		
		//Check if it exists
		if(re !== "true"){
			httpserror = "' . $l['no_https'] . '";
		}
		if(httpserror != ""){
			$_("httpserror").style.display = "block";
			$_("httpserror").innerHTML = httpserror;
			return false;
		}else{
			$_("httpserror").style.display = "none";
		}
		
	}catch(e){
		//
	}
	return true;
};
  
// show/hide backup options
function show_backup(){

	var auto_backup = $("#auto_backup").val();
	
	if(auto_backup == 0){
		$("#auto_backup_rotation").attr("disabled", true);
	}else{
		$("#auto_backup_rotation").attr("disabled", false);
	}
	
	return true;
};

' . (!empty($_POST) ? '' : 'addonload(\'softmail();show_backup();\');');
        $info['install'] .= '// ]]></script>';
        $info['install'] .= '

<div class="bg">
	<div class="sai_sub_head">' . $l['setup'] . '</div><hr>';
        if (empty($globals['hide_protocol'])) {
            $info['install'] .= '
		<div class="row">
			<div class="col-sm-5">
				<label for="softproto" class="sai_head">' . $l['choose_protocol'] . '</label><br />
				<span class="sai_exp2">' . $l['choose_protocol_exp'] . '</span>
			</div>
			<div class="col-sm-7">
				<select name="softproto" class="form-control" id="softproto" onblur="checkhttps(\'softproto\', \'softdomain\', false)">';
            foreach ($protocols as $k => $v) {
                $info['install'] .= '<option value="' . $k . '" ' . (optPOST('softproto') == $k || $globals['default_protocol'] == $k && empty($_POST['softproto']) ? 'selected="selected"' : '') . '>' . $v . '</option>';
            }
            $info['install'] .= '</select><div style="display:none;" id="checkhttps_wait">&nbsp;&nbsp;<img src="' . $theme['images'] . 'progress.gif" alt="please wait.."></div><br />
				<div class="row">
					<span id="httpserror" style="display:none; padding:10px;" class="alert alert-danger"></span>
				</div>
			</div>
		</div>';
        }
        $info['install'] .= '
	<div class="row">
		<div class="col-sm-5">';
        $info['install'] .= '
			<label for="softdomain" class="sai_head">' . $l['choose_domain'] . '</label><br />
			<span class="sai_exp2">' . $l['choose_domain_exp'] . '</span>
		</div>
		<div class="col-sm-7">
			<select name="softdomain" class="form-control" id="softdomain" onchange="softmail();" onblur="checkhttps(\'softproto\', \'softdomain\', false)">';
        if (!empty($globals['blank_domain'])) {
            $info['install'] .= '<option value="" ' . (empty($_POST['softdomain']) ? 'selected="selected"' : '') . '>(' . $l['select_domain'] . ')</option>';
        }
        foreach ($softpanel->domainroots as $domain => $dompath) {
            $info['install'] .= '<option value="' . $domain . '" ' . (!empty($_POST['softdomain']) && $_POST['softdomain'] == $domain ? 'selected="selected"' : '') . '>' . $domain . '</option>';
        }
        $info['install'] .= '
			</select>
		</div>
	</div><br />
	
	<div class="row">
		<div class="col-sm-5">
			<label for="softdirectory" class="sai_head">' . $l['in_directory'] . '</label><br />
			<span class="sai_exp2">' . $l['in_directory_exp'] . '</span>
		</div>
		<div class="col-sm-7">	
			<input type="text" name="softdirectory" class="form-control" id="softdirectory" size="30" value="' . POSTval('softdirectory', $software['softname']) . '" />
		</div>
	</div><br />';
        if (!empty($show_installtype)) {
            $info['install'] .= '
		<div class="row">
			<div class="col-sm-5">
				<label for="jsinstalltype" class="sai_head">' . $l['ins_type'] . '</label><br />
				<span class="sai_exp2">' . $l['ins_type_exp'] . '</span>
			</div>
			<div class="col-sm-7">
				<select name="jsinstalltype" id="jsinstalltype" class="form-control">
					<option value="0" ' . POSTselect('jsinstalltype', 0) . '>' . $l['ori_pack'] . '</option>
					<option value="1" ' . POSTselect('jsinstalltype', 1, 1) . '>' . $l['just_lib'] . '</option>
				</select>
			</div>
		</div><br />';
        }
        if (!empty($overwrite_option)) {
            $info['install'] .= '
		<div class="row">
			<div class="col-sm-5">
				<span class="sai_head">' . $l['overwrite'] . '</span>
			</div>
			<div class="col-sm-7">
				<input type="checkbox" name="overwrite_existing" id="overwrite_existing" />
			</div>
		</div>';
        }
        $info['install'] .= '
</div><br /><!--end of bg class-->';
        if (!empty($settings)) {
            if (file_exists($software['path'] . '/install.js')) {
                $info['install'] .= '<script language="javascript" type="text/javascript"><!--// --><![CDATA[';
                $info['install'] .= @parselanguages(str_replace('$(', '$_(', implode('', file($software['path'] . '/install.js'))));
                $info['install'] .= '// ]]></script>';
            }
            foreach ($settings as $group => $sets) {
                if ($group == 'hidden' || empty($sets)) {
                    continue;
                }
                $info['install'] .= '
		<div class="bg">
			<div class="sai_sub_head">' . $group . '</div><hr>';
                foreach ($sets as $sk => $sv) {
                    //Adding class form-control to input
                    if (preg_match('/type="text"/is', $sv['tag'])) {
                        $sv['tag'] = preg_replace('/>/is', ' class="form-control">', $sv['tag']);
                    }
                    if (preg_match('/<select/is', $sv['tag'])) {
                        $sv['tag'] = preg_replace('/<select/is', '<select class="form-control"', $sv['tag']);
                    }
                    $info['install'] .= '
			<div class="row">
				<div class="col-sm-5">
					<label for=' . $sk . ' class="sai_head" id="sai_head">' . $sv['head'] . '</label>
						' . (empty($sv['exp']) ? '' : '<span class="sai_exp">' . $sv['exp'] . '</span>') . '	
				</div>
					<div class="col-sm-7 ">' . $sv['tag'] . '</div>
						' . (preg_match('/softmail/is', $sv['tag']) ? '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
						softemail["' . $sk . '"] = false;
						//Add an event handler
						$_("' . $sk . '").onkeydown = function(){
							softemail["' . $sk . '"] = true;
						}
						// ]]></script>
						' : '') . '
						' . (preg_match('/admin_pass|softpass/is', $sv['tag']) ? '
						<div class="col-sm-1">
							<a href="javascript: void(0);"  onclick="$_(\'' . $sk . '\').value=randstr(10, 1, ' . (!empty($globals['pass_strength']) ? $globals['pass_strength'] : 0) . ');return false;" title="' . $l['randpass'] . '"><img src="' . $theme['images'] . 'randpass.gif" /></a>
						</div>
						' : '') . '							
			</div><br />';
                }
                $info['install'] .= '</div><br /><!--end of bg class-->';
            }
            //The Hidden groups
            if (!empty($settings['hidden'])) {
                foreach ($settings['hidden'] as $sk => $sv) {
                    $info['install'] .= $sv['tag'] . '
			' . (preg_match('/softmail/is', $sv['tag']) ? '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
			softemail["' . $sk . '"] = false;
			//Add an event handler
			$_("' . $sk . '").onkeydown = function(){
				softemail["' . $sk . '"] = true;
			}
			// ]]></script>
			' : '');
                }
            }
        }
        //End of if($settings)
        // Advance option
        $info['install'] .= '
	<div class="bg">
		<div class="sai_sub_head" id="advoptions_toggle" onclick="toggle_advoptions(\'advoptions\');" style="cursor:pointer"><img id="advoptions_toggle_plus"  src="' . $theme['images'] . 'plus_new.gif" style="margin-top:-4px;"/>&nbsp;&nbsp;' . $l['adv_option'] . '</div>
			<div id="advoptions" style="display:none;"><hr>
				<div class="row">
					<div class="col-sm-5">
						<label class="sai_head">' . $l['disable_notify_update'] . '</label>
						<span class="sai_exp">' . $l['exp_disable_notify_update'] . '</span>
					</div>
					<div class="col-sm-7">
						<input type="checkbox" name="disable_notify_update" id="disable_notify_update" ' . POSTchecked('disable_notify_update') . ' />
					</div>	
				</div><br />';
        // Auto backups option only if backups is not disabled and panel is not remote
        if (empty($globals['disable_backup_restore']) && empty($globals['disable_auto_backup']) && !aefer() && empty($softpanel->disable_auto_backup)) {
            $info['install'] .= '
					<div class="row">
						<div class="col-sm-5">
							<label for="auto_backup" class="sai_head">' . $l['auto_backup'] . '</label>
							<span class="sai_exp">' . $l['exp_auto_backup'] . '</span>
						</div>
						<div class="col-sm-7">
							<select name="auto_backup" class="form-control" id="auto_backup" onchange="show_backup();">
								<option value="0" ' . POSTselect('auto_backup', '0', 1) . '>' . $l['no_backup'] . '</option>' . (empty($globals['disable_auto_backup_daily']) ? '<option value="daily" ' . POSTselect('auto_backup', 'daily') . '>' . $l['daily'] . '</option>' : '') . (empty($globals['disable_auto_backup_weekly']) ? '<option value="weekly" ' . POSTselect('auto_backup', 'weekly') . '>' . $l['weekly'] . '</option>' : '') . (empty($globals['disable_auto_backup_monthly']) ? '<option value="monthly" ' . POSTselect('auto_backup', 'monthly') . '>' . $l['monthly'] . '</option>' : '') . '
							</select>
						</div>		
					</div><br />
					
					<div class="row">
						<div class="col-sm-5">
							<label class="sai_head">' . $l['auto_backup_rotation'] . '</label>
							<span class="sai_exp">' . $l['exp_auto_backup_rotation'] . '</span>
						</div>
						<div class="col-sm-7"> 
							<select name="auto_backup_rotation" class="form-control" id="auto_backup_rotation">';
            for ($i = 0; $i <= 10; $i++) {
                // Do we have a limit from admin ?
                if (!empty($globals['auto_backup_limit']) && ($i > $globals['auto_backup_limit'] || $i == 0) || !empty($globals['max_backups']) && ($i > $globals['max_backups'] || $i == 0)) {
                    continue;
                }
                $info['install'] .= '<option value="' . $i . '" ' . POSTselect('auto_backup_rotation', $i, $i == 4 ? '1' : '0') . '>' . (empty($i) ? $l['unlimited'] : $i) . '</option>';
            }
            $info['install'] .= '</select>
						</div>	
					</div><br />';
        }
        $info['install'] .= '
			</div>
	</div><br /><!--end of bg-->';
        $info['install'] .= '
<p align="center">
	<input type="hidden" name="softsubmit" id="softsubmit" value="' . $l['softsubmit'] . '" />
	<input type="submit" name="softsubmitbut" id="softsubmitbut" value="' . $l['softsubmit'] . '" class="flat-butt" /><span id="show_txt" style="display:none;"></span>
	<br /><br /><br />
	' . (empty($globals['off_email_link']) && empty($globals['off_install_mail']) ? '<span class="sai_head">' . $l['ins_emailto'] . '</span> : <input type="text" name="emailto" id="emailto" size="20" value="' . POSTval('emailto', '') . '" />' : '') . '
</p>
<input type="hidden" name="soft_status_key" id="soft_status_key" value="' . POSTval('soft_status_key', generateRandStr(32)) . '" />
</form></div>

<div id="progress_bar" style="height:125px; width:100%; display: none;">
	<br />
	<center>
		<font size="4" color="#222222" id="progress_txt" style="width:100%;">' . $l['checking_data'] . '</font>
		<font style="font-size: 18px;font-weight: 400;color: #444444; width:100%;" id="progress_percent">(0 %)</font><br /><br />
	</center>
	<table width="500" cellpadding="0" cellspacing="0" id="table_progress" border="0" align="center" height="28" style="border:1px solid #CCC; -moz-border-radius: 5px;
	-webkit-border-radius: 5px; border-radius: 5px; width:50%;">
		<tr>
			<td id="progress_color" width="1" style="background-image: url(' . $theme['images'] . 'bar.gif); -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px;"></td>
			<td id="progress_nocolor">&nbsp;</td>
		</tr>
	</table>
	<br /><center>' . $l['wait_note'] . '</center>
</div>
<br /><br /><br />';
    } elseif (!empty($installed)) {
        $info['install'] = '
	<div class="bg2">
		<h4>' . $l['congrats'] . '</h4><br />
		' . $software['name'] . ' ' . $l['succesful'] . ' : <br />
		<a href="' . $__settings['softurl'] . '" target="_blank">' . $__settings['softurl'] . '</a>
		<br /><br />
		' . $l['enjoy'] . '<br /><br />
		' . (!empty($notes) ? $l['install_notes'] . ' : <br />
		<div class="sai_notes">' . softparse($notes, $soft) . '</div><br /><br />' : '') . '
		' . $l['please_note'] . '<br /><br />
		' . (!empty($globals['ampps_enabled']) && empty($globals['no_ampps']) && $globals['softpanel'] != 'ampps' ? lang_vars($l['ampps_download'], array($software['name'])) . '<br /><br />' : '') . '
		' . $l['regards'] . ',<br />
		' . $l['softinstaller'] . '<br /><br />
		<center><b><a href="' . script_link($soft) . '&highlight=' . $new_insid . '&postact=install">' . $l['return'] . '</a></b></center><br /><br />';
        if (empty($globals['install_tweet_off']) || empty($globals['lictype'])) {
            $info['install'] .= '<form method="get" action="http://twitter.com/intent/tweet" id="tweet" onsubmit="return dotweet(this);">
				<div class="panel panel-info" style="width:55%; margin:0 auto;">
					<div class="panel-heading" style="padding:5px; font-size:15px;">
						<font><b>' . $l['install_tweet_sub'] . ' :</b></font>
					</div>
					<div class="panel-body">
						<div class="row">
							<div class="col-sm-10">
								<textarea name="text" cols="80" row="3" style="resize:none; width:100%;">' . loadtweetdata('install_tweet', $l['install_tweet']) . '</textarea>
							</div>
							<div class="col-sm-2">
								<input type="submit" value="Tweet!" class="btn btn-info" onsubmit="return false;" id="twitter-btn" style="margin-top:20px;"/>
							</div>
						</div>
					</div>
				</div>
				</form>';
        }
        $info['install'] .= '
	</div><!--end of bg class--><!--PROC_DONE-->
	<br /><br />';
    }
    softheader($l['<title>'] . $software['name']);
    $loadedinfo = array('install', 'overview', 'features', 'reviews', 'ratings');
    $url = $theme['images'];
    $ratings = array();
    $deduct = 1;
    $r = $scripts[$k]['ratings'];
    for ($i_r = 1; $i_r <= 5; $i_r++) {
        if ($r >= 1) {
            $ratings[$i_r] = '<img src="' . $url . 'star.png' . '" alt="(' . number_format($scripts[$k]['ratings'], 2) . ' out of 5)" />';
        } elseif ($r > 0) {
            $ratings[$i_r] = '<img src="' . $url . 'halfstar.png' . '" alt="(' . number_format($scripts[$k]['ratings'], 2) . ' out of 5)" />';
        } else {
            $ratings[$i_r] = '<img src="' . $url . 'nostar.png' . '" alt="(' . number_format($scripts[$k]['ratings'], 2) . ' out of 5)" />';
        }
        $r = $r - $deduct;
    }
    ?>
<script language="JavaScript" src="<?php 
    echo $theme['url'] . '/js/tabber.js';
    ?>
" type="text/javascript">
</script>
<script language="JavaScript" id="ratings_js_file" type="text/javascript"></script>
<script language="JavaScript" id="review_js_file"  type="text/javascript"></script>
<script language="JavaScript" id="reviews_js_file"  type="text/javascript"></script>
<script type="text/javascript">
tabs = new tabber;
tabs.tabs = new Array('<?php 
    echo implode('\', \'', $loadedinfo);
    ?>
');
tabs.tabwindows = new Array('<?php 
    echo implode('_win\', \'', $loadedinfo);
    ?>
_win');
tabs.inittab = <?php 
    echo '\'' . $init_tab . '\';';
    ?>
addonload('tabs.init();loadraterev();');

function loadraterev(){
<?php 
    if (empty($globals['off_rating_link']) && $soft < 10000) {
        echo '$_(\'ratings_js_file\').src = "https://www.softaculous.com/ratings.js?soft=' . $soft . '&user='******'name'] . '&ip=' . $_SERVER['SERVER_ADDR'] . '";';
    }
    if (empty($globals['off_review_link']) && $soft < 10000) {
        echo '$_(\'review_js_file\').src =  "https://www.softaculous.com/review.js?soft=' . $soft . '&user='******'name'] . '&ip=' . $_SERVER['SERVER_ADDR'] . '";';
        echo '$_(\'reviews_js_file\').src =  "https://www.softaculous.com/reviews.js?soft=' . $soft . '&user='******'name'] . '&ip=' . $_SERVER['SERVER_ADDR'] . '";';
    }
    ?>
};
</script>
<?php 
    // For custom themes
    if ($soft > 10000) {
        if (file_exists($globals['euthemes'] . '/' . $globals['theme_folder'] . '/images/topscripts/48/' . $iscripts[$soft]['softname'] . '.png')) {
            $custom_48 = $theme['images'] . 'topscripts/48/' . $iscripts[$soft]['softname'] . '.png';
        } else {
            $custom_48 = $theme['images'] . '/custom.png';
        }
    }
    echo '
<div class="bg">
	<div id="currentrating" style="display:none"></div>
	<div class="row" style="margin-left:10px;">
		' . (!empty($custom_48) ? '<img src="' . $custom_48 . '" alt="">' : '<img src="' . $globals['mirror_images'] . 'top15/48/' . $scripts[$soft]['softname'] . '.png" >') . '
		<span class="sai_process_heading" style="margin-left:20px;">' . $software['name'] . '</span>
	</div><br />
	<div class="row">
		<div class="col-sm-2">
			' . ($soft > 10000 ? '' : '<div class="someclass" title="' . $scripts[$soft]['ratings'] . '">' . implode('', $ratings) . '</div>') . '
		</div>
		<div class="col-sm-5 ver_style">
			' . $l['software_ver'] . ' : <font size="2"><b>' . (!empty($tmp_ver) ? $tmp_ver : $software['ver']) . '</b></font> &nbsp; &nbsp; <a href="javascript" onclick="notifyversion(); return false;" ><img src="' . $theme['images'] . 'notify.gif" name="notifyver" title="' . $l['notify_ver'] . '" alt="' . $l['notify_ver'] . '"></a>
		</div>
		<div class="col-sm-3 release_style">
			' . (!empty($info['release_date']) ? $l['release_date'] . ' : <font size="1"><b>' . $info['release_date'] . '</b></font>' : '') . '
		</div>
		<div class="col-sm-2 change_style" style="margin-top:0px;">
			' . (!empty($info['changelog']) ? '&nbsp;&nbsp;<a href="javascript" data-toggle="modal" data-target="#changelog_div" class="sai_changelogbut" style="text-decoration:none;">' . $l['changelog'] . '</a>' : '') . '
		</div>
	</div><br />
	
	<script type=text/javascript>';
    if (!empty($softpanel->pheader)) {
        if (substr_count($_SERVER['REQUEST_URI'], 'x3') > 0) {
            echo '
			$(document).ready(function(){
				$(".ver_style").css("margin-left","0px");
				$(".release_style").css("margin-left","0px");
				$(".change_style").css({"margin-left":"0px", "margin-top":"-15px"});
			});';
        } else {
            echo '
			$(document).ready(function(){
				$(".ver_style").css("margin-left","0px");
				$(".release_style").css("margin-left","0px");
				$(".change_style").css({"margin-left":"0px", "margin-top":"-10px"});
			});';
        }
    }
    echo '
	</script>
	
	<div class="old_tab">
		<table width="100%" cellpadding="0" cellspacing="0" border="0" class="sai_tabs">
			<tr>
				<td><a href="javascript:tabs.tab(\'install\')" id="install" class="sai_insbut">' . $l['install'] . '</a></td>
				<td><a href="javascript:tabs.tab(\'overview\')" class="sai_tab" id="overview">' . $l['overview'] . '</a></td>
				<td><a href="javascript:tabs.tab(\'features\')" class="sai_tab" id="features">' . $l['features'] . '</a></td>
					' . (empty($globals['off_demo_link']) ? '<td><a href="' . ($soft >= 10000 && !empty($info['demo']) ? $info['demo'] : $globals['ind'] . 'act=demos&soft=' . $soft) . '" class="sai_tab" id="demo" target="_blank">' . $l['demo'] . '</a></td>' : '') . '
					' . (empty($globals['off_rating_link']) && $soft < 10000 ? '<td><a href="javascript:tabs.tab(\'ratings\')" class="sai_tab" id="ratings">' . $l['ratings'] . '</a></td>' : '') . '
					' . (empty($globals['off_review_link']) && $soft < 10000 ? '<td><a href="javascript:tabs.tab(\'reviews\')" class="sai_tab" id="reviews">' . $l['reviews'] . '</a></td>' : '') . '
			</tr>
		</table><br />
	</div>
	<div class="new_tab">
		<nav class="navbar navbar-default">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>                        
				</button>
				<ul class="nav">
					<li class="active" style="width:80px;"><a href="javascript:tabs.tab(\'install\')" id="install" class="sai_tab2" style="text-decoration:none; height:40px; top:5px;" data-toggle="collapse" data-target="#myNavbar">' . $l['install'] . '</a></li>
				</ul>
			</div>
			<div class="collapse navbar-collapse" id="myNavbar" style="position:absolute; z-index:1000; width:100%; background:#F8F8F8;">
				<ul class="nav navbar-nav">
					<li><a href="javascript:tabs.tab(\'overview\')"  id="overview" class="sai_tab2" style="text-decoration:none;" data-toggle="collapse" data-target="#myNavbar">' . $l['overview'] . '</a></li>
					<li><a href="javascript:tabs.tab(\'features\')"  id="features" class="sai_tab2" style="text-decoration:none;" data-toggle="collapse" data-target="#myNavbar">' . $l['features'] . '</a></li>
					<li>' . (empty($globals['off_demo_link']) ? '<a href="' . ($soft >= 10000 && !empty($info['demo']) ? $info['demo'] : $globals['ind'] . 'act=demos&soft=' . $soft) . '" class="sai_tab2" id="demo" target="_blank" style="text-decoration:none;" data-toggle="collapse" data-target="#myNavbar">' . $l['demo'] . '</a>' : '') . '</li>
					<li>' . (empty($globals['off_rating_link']) && $soft < 10000 ? '<a href="javascript:tabs.tab(\'ratings\')" class="sai_tab2" id="ratings" style="text-decoration:none;" data-toggle="collapse" data-target="#myNavbar">' . $l['ratings'] . '</a>' : '') . '</li>
					<li>' . (empty($globals['off_review_link']) && $soft < 10000 ? '<a href="javascript:tabs.tab(\'reviews\')" class="sai_tab2" id="reviews" style="text-decoration:none;" data-toggle="collapse" data-target="#myNavbar">' . $l['reviews'] . '</a>' : '') . '</li>
				</ul>
			</div>
		</nav>
	</div>';
    ?>
	<script type="text/javascript">
	$_(tabs.inittab).className = tabs.tabbedclass;
	var softid = <?php 
    echo $soft;
    ?>
;

	tabs.override = function(id){
		if(id == 'install'){
			$_('install').className = 'sai_insbutclicked';
		}else{		
			$_('install').className = 'sai_insbut';
		}
	};
	</script>
	<?php 
    //Parse and take care of images
    $info['overview'] = (!empty($info['changelog']) ? '
	<div class="modal fade" id="changelog_div" role="dialog" >
		<div class="modal-dialog modal-lg" style="margin-top:80px;">
		  <!-- Modal content-->
		  <div class="modal-content">
			<div class="modal-header" style="background:#F0F0F0;">
			  <button type="button" class="close" data-dismiss="modal">&times;</button>
			  <h4 class="modal-title">Changelog</h4>
			</div>
			<div class="modal-body" style="height: 350px; overflow-y: auto;">
			  ' . $info['changelog'] . '
			</div>
			<div class="modal-footer" style="padding-top:10px; height:50px;">
			  <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">Close</button>
			</div>
		  </div>
		</div>
	</div>' : '') . '
	<div class="bg2">
		<div class="row">
			<div class="col-sm-12">
				' . softparse($info['overview'], $soft) . '<br /><br />
			</div>
			<div class="col-sm-6">
				<div class="row">
					<div class="col-sm-1"><font color="#447edf"><i class="fa sai-disk fa-3x"></i></font></div>
					<div class="col-sm-5">
						<span class="sai_head">' . $l['space_req'] . '</span><br />
						<span class="sai_exp2">' . $l['available_space'] . ' : ' . (is_numeric($softpanel->spaceremain) ? number_format($softpanel->spaceremain / 1024 / 1024, 2) : $softpanel->spaceremain) . ' ' . $l['mb'] . '<br />
						' . $l['req_space'] . ' : ' . number_format($software['spacereq'] / 1024 / 1024, 2) . ' ' . $l['mb'] . '</span>
					</div>
				</div><br />
				<div class="row">
					<div class="col-sm-1"><a href="' . $info['support'] . '"><font color="#447edf"><i class="fa sai-question fa-3x"></i></font></a></div>
					<div class="col-sm-5">
						<span class="sai_head">' . $l['software_support'] . '</span><br />
						<span class="sai_exp2"><a href="' . $info['support'] . '" target="_blank">' . $l['support_link'] . '</a><br />
						' . $l['support_note'] . '</span>
					</div>
				</div>	
			</div>
		</div><br />
	</div><!--end of bg class-->';
    if (!empty($installations[$soft])) {
        $is_cloneable = is_cloneable($soft);
        $highlight = optGET('highlight');
        $action = optGET('postact');
        $info['overview'] .= '<br /><br />
		<center><span class="sai_newhead">' . $l['current_ins'] . '</span><br /></center><hr>';
        $info['overview'] .= '
		<div class="bg2">
			<table class="table table-hover">
			<thead style="background:#EFEFEF;" class="sai_head2">
			<tr>
				<th>' . $l['link'] . '</th>
				<th>' . $l['ins_time'] . '</th>
				<th>' . $l['version'] . '</th>
				<th width="130">' . $l['options'] . '</th>
				<th><input type="checkbox" id="check_all"></th>
			</tr>
			</thead>';
        foreach ($installations[$soft] as $ik => $iv) {
            $info['overview'] .= '<tr id="trid' . $ik . '">
				<td class="endurl"><a href="' . $iv['softurl'] . '" target="_blank" id="insurl' . $ik . '">' . $iv['softurl'] . '</a>' . ($highlight == $ik && !empty($action) ? '<span id="highlight">&nbsp;&nbsp;<b class="sai_highlight">' . $l['act_' . $action] . '</b></span>' : '') . '</td>
		
				<td>' . datify($iv['itime']) . '</td>
				<td>' . $iv['ver'] . ($software['ver'] != $iv['ver'] && file_exists($software['path'] . '/upgrade.xml') ? ' <a href="' . $globals['ind'] . 'act=upgrade&insid=' . $ik . '"><img src="' . $theme['images'] . 'updates.gif" alt="' . $l['upd_to'] . ' ' . $scripts[$soft]['ver'] . '" class="someclass" /></a>' : '') . '</td>
				<td>' . (!empty($is_cloneable) ? '<a href="' . $globals['ind'] . 'act=sclone&insid=' . $ik . '" title="' . $l['clone'] . '" class="someclass"><img src="' . $theme['images'] . 'clone.gif" /></a>&nbsp;' : '') . '&nbsp;<a href="' . $globals['ind'] . 'act=remove&insid=' . $ik . '" title="' . $l['remove'] . '" class="someclass"><img src="' . $theme['images'] . 'remove.gif" /></a></td>
				<td>
					<input type="checkbox" name="insids[]" id="' . $iv['softurl'] . '" value="' . $ik . '" class="soft_inslist">
				</td>
			</tr>';
        }
        $info['overview'] .= '</table><br />
			<p align="right" style="width:100%;">
				<span class="sai_head">' . $l['with_selected'] . ':</span>
				<select name="multi_options" id="multi_options">
					<option name="todo" id="todo" value="0">---</option>
					<option name="todo" id="todo" value="mult_rem">' . $l['remove'] . '</option>
				</select>
				<input type="button" value="' . $l['go'] . '" onclick="show_confirm()" class="sai_graybluebut">
				<br />
			</p>
			<div id="rem_div"></div>
		</div><!--end of bg2 class-->
		
		<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
		insids = new Array();
		removed = new Object();

		function show_confirm(){
			
			insids = new Array();
			removed = new Object();
			
			if($_("multi_options").value != "mult_rem"){
				return false;
			}

			// Build the list of Installations to remove
			var field = document.getElementsByName(\'insids[]\');
				insids = new Array();
				var c = 0;
				for(i = 0; i < field.length; i++){
					if(field[i].checked == true){
						insids[c] = field[i].value;
						c++;
					}
				
			}
			//alert(c);
			
			if(c == 0){
				alert("' . $l['no_sel_inst'] . '");
				return false;
			}
			
			var r = confirm("' . $l['del_insid'] . '");
			if(r != true){
				return false;
			}
			
			remove_by_id(insids[0], "", 0);
		}
		
		function remove_by_id(insid, re, oldinsid){

			removed[insid] = false;
			
			if(re.length > 0 && oldinsid > 0){
				if(re == "removed"){
					removed[insid] = true;
				}
			}
			
			nextinsid = 0;
			
			// Find the next INSTALLATION to remove
			for(i = 0; i < insids.length; i++){
				if(typeof(removed[insids[i]]) != "undefined"){
					continue;
				}
				nextinsid = insids[i];
				break;
			}
			
			// If there is something left to be removed
			if(insid != 0){
				try{		
					AJAX("' . $globals['index'] . 'act=remove&insid="+insid+"&ajax=1&ssk="+randomstring(32)+"&random="+Math.random(), "remove_by_id(\'"+nextinsid+"\', re, \'"+insid+"\')");
					$_("rem_div").innerHTML = "<br /><br /><p align=\\"center\\"><img src=\\"' . $theme['images'] . 'ajax_remove.gif\\"> <br />' . $l['rem_inst_id'] . ' ID: " +insid+ ", URL: " + $_("insurl"+insid)+"<br /></p>";
					return true;
				}catch(e){
					return false;
				}
			}
			$_("rem_div").innerHTML = "";
			alert("' . $l['inst_remvd'] . '");
			location.reload(true);
			return true;
		}
		
		$(document).ready(function(){
			$("#check_all").on("click", function(event){
				if(this.checked == true){
					$(".soft_inslist").prop("checked", true);
				}else{
					$(".soft_inslist").prop("checked", false);
				}
			});
		
			$(".sai_altrowstable tr").mouseover(function(){
				var old_class = $(this).attr("class");
				//alert(old_class);
				$(this).attr("class", "sai_tr_bgcolor");
				
				$(this).mouseout(function(){
					$(this).attr("class", old_class);
				});
			});';
        // If we get anything in $highlight than only we have to call this JS function other wise it will cause the JS error.
        if (!empty($highlight)) {
            $info['overview'] .= 'goto_id("insurl' . $highlight . '");
		$("#highlight").fadeOut(10000);';
        }
        $info['overview'] .= '});

		// ]]></script>';
    }
    if (count($allcatwise[$software['type']][$software['cat']]) > 2 && $software['cat'] != 'others') {
        $info['overview'] .= '<br /><br /><div class="bg2">
			<table width="100%" class="table table-hover">
				<tr>
					<th style="background:#EFEFEF" class="sai_head2">' . $l['related_scripts'] . '</th>
				</tr>
			</table>';
        $i = 0;
        foreach ($allcatwise[$software['type']][$software['cat']] as $k => $v) {
            if ($k == $soft || !empty($scripts[$k]['parent']) && !empty($iscripts[$scripts[$k]['parent']])) {
                continue;
            }
            // Show only 5 scripts
            if ($i == 5) {
                break;
            }
            $info['overview'] .= '
			<div style="text-decoration:none;display:inline-block;text-align:center;margin-top:10px;">
				<a href="' . script_link($k) . '"  title="' . $v['desc'] . '"  width="80" alt="" class="someclass" style="text-decoration:none;margin-top:5px;">
					<div class="sai_blog_script" style="margin-left:11%;">
						<div class="sai_demo_script_logo">
							<img src="' . $globals['mirror_images'] . 'top15/48/' . $v['softname'] . '.png" >	
						</div>
						<div class="sai_script_name">' . $v['name'] . '</div>
					</div>
				</a>
			</div>';
            $i++;
        }
        $info['overview'] .= '</div><!--end of bg class-->';
    }
    //Parse and take care of images
    $info['features'] = '<div class="bg2"><br />' . softparse($info['features'], $soft) . '</div><!--end of bg2 class-->';
    $info['ratings'] = '';
    $info['reviews'] = '<div class="bg2"><div id="allreviews"></div></div><!--end of bg2 class-->';
    foreach ($info as $k => $v) {
        if (in_array($k, array('demo', 'support', 'changelog'))) {
            continue;
        }
        echo '<div id="' . $k . '_win" style="display: ' . ($init_tab == $k ? "block" : "none") . '; width:100%;"><br />
		' . $v . '
		</div>';
    }
    echo '</div><!--End of bg-->';
    softfooter();
}
Пример #2
0
function showconf()
{
    global $theme, $globals, $user, $l, $langs, $skins, $error, $saved, $list, $done, $apps, $ext_list, $softpanel;
    echo '<form accept-charset="' . $globals['charset'] . '" name="php_extensions" method="post" action="" id="editphpext">';
    $default_php = $softpanel->getConf('WU_DEFAULT_PHP');
    if (!empty($default_php)) {
        $php = $softpanel->get_app_record($default_php);
    }
    echo '<br />
	<center><span class="sai_tit">' . lang_vars($l['php_version'], array($apps[$php]['name'])) . '</span><center><br /><br /><br />
		<div style="width:700px; margin:0px auto; ">
			<table border="0" cellpadding="8" cellspacing="0" width="700px" align="center" class="sai_divroundshad">
				<tr>
					<th class="sai_summaryTitle" align="left">' . $l['extensions_head'] . '</th>
					<th class="sai_summaryTitle" align="left"><input type="checkbox" onclick="checkall(this);" />' . $l['extensions_all'] . '</th>
				</tr><tr>';
    $counter = 0;
    foreach ($ext_list['php_ext'] as $k => $v) {
        $counter++;
        echo '
						<td><div style="float:left;">' . $k . '</div><div style="text-align: right;"><input type="checkbox" name="extlist[' . $k . ']" id="extlist[' . $k . ']" value="1" ' . POSTchecked($k, $v) . '/></div></td>';
        if ($counter % 2 == 0) {
            echo '</tr>
						<tr>';
        }
    }
    echo '
			</tr>
			</table>
		</div><br />
		<p align="center">			
			<input type="submit" value="' . $l['save'] . '" name="save_ext" class="sai_graybluebut" id="savephpext" /> &nbsp;<img id="progress_img" src="' . $theme['images'] . 'progress.gif" style="display:none">
		</p>
	</form>
	
	<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
	
		// Function for checkbox check all
		ids = new Array("' . implode('", "', array_keys($ext_list['php_ext'])) . '");
		function checkall(checker){
			for(x in ids){
				$_("extlist["+ids[x]+"]").checked = checker.checked;
			}
		};
		
		var message_box = function(){			
			return {
				show_message: function(title, body , image) {			
					var okbutton = \'<input  style="width:75px" class="sai_submit" type="button" onclick="message_box.close_message();" value="OK" />\';
					if(image == "1"){
						var img = \'<img src="' . $theme['images'] . 'error.gif" />\';
					}else{
						var img = \'<img src="' . $theme['images'] . 'confirm.gif" />\';			
					}
										
					if(jQuery(\'.sai_message_box\').html() === null) {
						var message = \'<div class="sai_message_box"><table border="0" cellpadding="8" width="100%" height="100%"><tr ><td rowspan="2" width="40%" > \'+ img + \'</td><td width="60%" class ="msg_tr1">\' +  title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3">\' + okbutton + \'</td></tr></table></div>\';
						jQuery(document.body).append( message );								
						jQuery(".sai_message_box").css("top", jQuery("html, body").scrollTop() + 150);
						jQuery(\'.sai_message_box\').show(\'slow\');
					}else{
						var message =\' <table border="0" width="100%" cellpadding="8" height="100%"><tr ><td rowspan="2" width="40%">\'+ img +  \'</td><td widt="60%" class ="msg_tr1">\' + title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3">\' + okbutton + \'</td></tr></table>\';				
						jQuery(\'.sai_message_box\').css(\'top\', jQuery($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150);
						jQuery(\'.sai_message_box\').show(\'slow\');
						jQuery(\'.sai_message_box\').html( message );
					}
				},
				close_message: function() {				
					jQuery(\'.sai_message_box\').hide(\'fast\');
					window.location=window.location;
				}
			}
		}();
	// ]]></script>';
}
Пример #3
0
function userindex_theme()
{
    global $theme, $globals, $softpanel, $user, $l, $updates_available, $iscripts, $scripts, $info, $cscripts;
    if ($globals['softpanel'] == 'webuzo') {
        $usage = array();
        $usage['cpu'] = $softpanel->cpu();
        $usage['ram'] = $softpanel->ram();
        $usage['disk'] = $softpanel->disk();
        $usage['bandwidth'] = $softpanel->bandwidth();
        if (optGET('ajax')) {
            echo 'var server_cpu = [
				{ label: "Used",  data: ' . $usage['cpu']['percent'] . '},
				{ label: "Free",  data: ' . $usage['cpu']['percent_free'] . '}
			];
			
			var server_ram = [
				{ label: "Used",  data: ' . $usage['ram']['used'] . '},
				{ label: "Free",  data: ' . $usage['ram']['free'] . '}
			];
			
			var server_disk = [
				{ label: "Used",  data: ' . $usage['disk']['total']['used_gb'] . '},
				{ label: "Free",  data: ' . $usage['disk']['total']['free_gb'] . '}
			];
			
			var server_bandwidth = [
				{ label: "Used",  data: ' . (empty($usage['bandwidth']['used_gb']) ? 0.01 : $usage['bandwidth']['used_gb']) . '},
				{ label: "Free",  data: ' . (empty($usage['bandwidth']['free_gb']) ? $usage['bandwidth']['used_gb'] * 100 : $usage['bandwidth']['free_gb']) . '}
			];';
            return true;
        }
    }
    $__tmp = explode(':', !empty($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost');
    $globals['HTTP_HOST'] = $__tmp[0];
    softheader($l['<title>'], 'js');
    /*For native UI support*/
    if (!empty($softpanel->pheader)) {
        if (substr_count($_SERVER['REQUEST_URI'], 'paper_lantern') > 0) {
            echo '
			<style>
				.row_usi {
				padding-left: 100px;
				padding-right: 5px;
				}
				
				.row_usi_warn {
				padding-left: 110px;
				padding-right: 30px;
				}
				
				.sai_inputs_cls input{
				width:280px;
				}
				
				.sai_suggestions_cls{
				width:280px;
				}
				
				.row_usi_cls {
				padding-left: 50px;
				}
				
				@media screen and (min-width: 980px) and (max-width: 1279px){
					.row_usi{
					padding-left: 35px;
					padding-right: 0;
					}
					
					.row_usi_warn{
					padding-left: 55px;
					padding-right: 0;
					}
				}
				
				@media screen and (min-width: 800px) and (max-width: 980px){
					.row_usi{
					padding: 0 20px;
					}
					
					.row_usi_warn{
					padding-left: 30px;
					padding-right: 5px;
					}
					
					.sai_inputs_cls input{
					width:250px;
					}
					
					.sai_suggestions_cls{
					width:250px;
					}
				}
				
				@media screen and (min-width: 768px) and (max-width: 799px){
					.row_usi{
					padding: 0 115px;
					}
					
					.row_usi_warn{
					padding-left: 130px;
					padding-right: 120px;
					}
					
					.sai_inputs_cls{
					padding-left:70px;	
					}
					
					.sai_inputs_cls input{
					width:300px;
					}
					
					.sai_suggestions_cls{
					width:300px;
					}
					
					.row_usi_cls {
					padding-left: 180px;
					}
				}
				
				@media screen and (min-width: 360px) and (max-width: 767px){
					.row_usi{
					padding: 0 10px;
					}
					
					.row_usi_warn{
					padding-left: 25px;
					padding-right: 80px;
					}
					
					.sai_inputs_cls input{
					width:130px;
					}
					
					.sai_suggestions_cls{
					width:130px;
					}
					
					.row_usi_cls {
					padding-left: 0;
					}
					
					.sai_classes_boxgrid{
					width:250px;
					}
					
					.sai_classes_boxgrid2{
					width:250px;
					}
				}
				
				@media screen and (min-width: 320px) and (max-width: 359px){
					.row_usi{
					padding: 0 10px;
					}
					
					.row_usi_warn{
					padding-left: 20px;
					padding-right: 40px;
					}
					
					.sai_inputs_cls input{
					width:130px;
					}
					
					.sai_suggestions_cls{
					width:130px;
					}
					
					.row_usi_cls {
					padding-left: 0;
					}
					
					.sai_classes_boxgrid{
					width:250px;
					}
					
					.sai_classes_boxgrid2{
					width:250px;
					}
				}
			</style>';
        } else {
            echo '
			<style>
				.row_usi {
				padding: 0 35px;
				}
				
				.row_usi_warn {
				padding-left: 45px;
				padding-right: 40px;
				}
				
				.sai_inputs_cls input{
				width:190px;
				}
				
				.sai_suggestions_cls{
				width:190px;
				}
				
				.row_usi_cls {
				padding-left: 80px;
				}
				
				@media screen and (min-width: 1280px) and (max-width: 1300px){
					.row_usi{
					padding: 0 35px;
					}
					
					.row_usi_warn{
					padding-left: 50px;
					padding-right: 40px;
					}
				}
				
				@media screen and (min-width: 980px) and (max-width: 1279px){
					.row_usi{
					padding: 0 40px;
					}
					
					.row_usi_warn{
					padding-left: 55px;
					padding-right: 40px;
					}
				}
				
				@media screen and (min-width: 800px) and (max-width: 979px){					
					.row_usi_warn{
					padding-left: 40px;
					padding-right: 40px;
					}
				}
				
				@media screen and (min-width: 768px) and (max-width: 799px){
					.row_usi {
					padding: 0 120px;
					}
					
					.row_usi_warn{
					padding-left: 130px;
					padding-right: 135px;
					}
					
					.sai_inputs_cls{
					padding-left:70px;	
					}
					
					.sai_inputs_cls input{
					width:300px;
					}
					
					.sai_suggestions_cls{
					width:300px;
					}
					
					.row_usi_cls {
					padding-left: 180px;
					}
				}
			</style>';
        }
    }
    echo '<script>
	$(document).ready(function(){
		
		var this_theme = "' . $theme['this_theme'] . '";
		
		if(this_theme == "modern"){
			$("body").css("background-color", "#F8F8F8");
		}
		
		$(".sai_boxgrid").hover(function(){
			$(this).stop().animate({top:"-200px"},{queue:false,duration:200});
			
			}, function() {
				$(this).stop().animate({top:"0px"},{queue:true,duration:200});
		});
		
		$(".about").click(function(){
			$(".right_panel_two").fadeOut(1); 
			$(".right_panel_one").fadeIn(500);
		});
		$(".topscripts").click(function(){
			$(".right_panel_one").fadeOut(1); 
			$(".right_panel_two").fadeIn(500);
		});
		
		$("#news").attr("src", "https://www.softaculous.com/news.js");
		
		$("#inputs_searchs").bind("keyup",function(){
			
			var selfVal = $(this).val().toLowerCase();
							
			var compareDivs = $("td"); 		
			
			compareDivs.each(function(i, item){
		
				var id_tmp = item.id.toString();
				
				var search = id_tmp.substring(0,12);	 
						
				if(trim(search) == "webuzo_icons" && typeof $("#"+item.id).attr("value") != "undefined") {
					
					var divVal = $("#"+item.id).attr("value").toString().toLowerCase();				
					
					console.log(divVal);
					 
					if (divVal.indexOf(selfVal) < 0){
						
						if(selfVal == "") return;
						
						$("#"+item.id).hide();
						
					}else{
											
						$("#"+item.id).show();
					}			
				}
							
			});
			remove_unnecessary_tables_webuzo();
		});
		
	});
	
	function remove_unnecessary_tables_webuzo(){
		var no_script = 0;	
		
		for(var i = 1; i<=12;i++){
			
			var hide_chk = 0;
			var id = $($("#main_table"+i).find("tr").children());
			
			var td_length = $("#main_table"+i+" tr td").length;
			var tmp_td_length = $("#main_table"+i+" tr").children();
			
			tmp_td_length.each(function(i, item){
				
				if(trim($("#"+item.id).text()) == ""){
					td_length -= 1;
				}
			});	
			
			var tds = $("#main_table"+i+" tr").children();
			tds.each(function(i, item){
				if(typeof $("#"+item.id).attr("value") != "undefined"){
				
					var disp = $("#"+item.id).css("display");
					var disp_val = $("#"+item.id).attr("value").toString();			
					
					if(disp == "none"){
						hide_chk += 1;						
					}
				}
				
			});	
				
			if(hide_chk == td_length){			
				$("#main_div"+i).hide();			
				no_script += 1;			
			}else{
				$("#main_div"+i).show();
			}
		}
		
		if(no_script == 12){
			$("#show_none").show();		
		}else{
			$("#show_none").hide();
		}
	}
	</script>
	
	<script>
	function show_desc(element){
		var eid = (element.id).split("_");
		$("#saihover_"+eid[1]).css("opacity", 1);
	}
	
	function hide_desc(element){
		var eid = (element.id).split("_");
		$("#saihover_"+eid[1]).css("opacity", 0);
	}
	</script>';
    // top 10 scripts based on the rating formula
    foreach ($scripts as $k => $v) {
        if (empty($iscripts[$k]) || !empty($scripts[$k]['parent']) && !empty($iscripts[$scripts[$k]['parent']])) {
            continue;
        }
        $top[$k] = $v['ratings'] * $v['votes'];
    }
    arsort($top);
    if (file_exists($globals['path'] . '/conf/top_scripts.php') && !empty($globals['lictype'])) {
        $top = unserialize(file_get_contents($globals['path'] . '/conf/top_scripts.php'));
    }
    //r_print($globals);
    if (!empty($globals['show_cscript_in_top'])) {
        //r_print($top_custom_list);
        foreach ($cscripts as $ck => $cv) {
            if (array_key_exists($ck, $iscripts)) {
                $top_custom[$ck] = $ck;
            }
        }
        $tmp_top = $top;
        // Do we need to add any other default scripts ?
        if (!empty($top_custom)) {
            $top = $top_custom;
        }
        if (!empty($tmp_top)) {
            $top += $tmp_top;
        }
    }
    foreach ($scripts as $k => $v) {
        // We have to remove the scripts which are not enabled AND yet coming from top_scripts.php (i.e. Admin have saved it from top scripts)
        if (!array_key_exists($k, $iscripts) && !empty($top[$k])) {
            unset($top[$k]);
        }
        if (empty($iscripts[$k]) || !empty($scripts[$k]['parent']) && !empty($iscripts[$scripts[$k]['parent']])) {
            continue;
        }
        $top[$k] = $v['ratings'] * $v['votes'];
    }
    $ts_head1 = !empty($softpanel->pheader) ? substr_count($_SERVER['REQUEST_URI'], 'paper_lantern') > 0 ? 'col-sm-11 col-xs-10' : 'col-sm-10 col-xs-10' : 'col-sm-11 col-xs-10';
    $ts_head2 = !empty($softpanel->pheader) ? substr_count($_SERVER['REQUEST_URI'], 'paper_lantern') > 0 ? 'col-sm-1 col-xs-2' : 'col-sm-2 col-xs-2' : 'col-sm-1 col-xs-2';
    echo '
	<div>
		<div class="right_panel_two" ' . ($globals['softpanel'] == 'ampps' || $globals['softpanel'] == 'webuzo' ? 'style="display:none"' : '') . '>
			<br />
			<div class="row">
				<div class="' . $ts_head1 . '" style="text-align:center;">
					<span class="sai_main_head">' . $l['top_scrip'] . '</span>
				</div>
					
				<div class="' . $ts_head2 . '">
					<div class="about">
						<img src="' . $theme['images'] . 'info_star.png" width="30" height="30" class="someclass" title="About" style="border:none;"/>&nbsp;&nbsp;							
					</div>
				</div>
			</div>
			<hr>';
    if (!empty($updates_available)) {
        echo '
				<div class="row row_usi_warn">
				<div class="alert alert-warning" style="width:99%;">
					<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
					<center>
						<a href="' . $globals['ind'] . 'act=installations&showupdates=true" alt="" style="text-decoration:none;"><img src="' . $theme['images'] . 'notice.gif" /> &nbsp; ' . lang_vars($l['updates_available'], array($updates_available)) . '</a>
					</center>
				</div>
				</div>';
    }
    echo '
			<div class="row row_usi">
				<div class="col-md-1"></div>
				<div class="col-md-10">';
    $i = 0;
    $j = 1;
    $url = $globals['mirror_images'];
    $url_i = $globals['mirror_images'] . 'top15/';
    foreach ($top as $k => $v) {
        $demo_scriptname = str_replace(' ', '_', $scripts[$k]['name']);
        $ratings = array();
        $deduct = 1;
        $r = $scripts[$k]['ratings'];
        if ($k > 10000) {
            if (file_exists($globals['euthemes'] . '/' . $globals['theme_folder'] . '/images/topscripts/' . $iscripts[$k]['softname'] . '.png')) {
                $url_i = $theme['images'] . 'topscripts/' . $iscripts[$k]['softname'] . '.png';
                $url_i32 = $theme['images'] . 'topscripts/32/' . $k . '__logo.gif';
            } else {
                $url_i = $theme['images'] . 'custom_script.png';
            }
            $image_name = $url_i;
        } else {
            $url_i = $globals['mirror_images'] . 'top15/';
            $url_i32 = $globals['mirror_images'] . 'softimages/32/' . $k . '__logo.gif';
            $image_name = $url_i . $iscripts[$k]['softname'] . '.png';
        }
        for ($i_r = 1; $i_r <= 5; $i_r++) {
            if ($r >= 1) {
                $ratings[$i_r] = '<img src="' . $theme['images'] . 'star_ts.png' . '" width="11" height="12" alt="(' . number_format($scripts[$k]['ratings'], 2) . ' out of 5)" />';
            } elseif ($r > 0) {
                $ratings[$i_r] = '<img src="' . $theme['images'] . 'halfstar_ts.png' . '" width="11" height="12" alt="(' . number_format($scripts[$k]['ratings'], 2) . ' out of 5)" />';
            } else {
                $ratings[$i_r] = '<img src="' . $theme['images'] . 'nostar_ts.png' . '" width="11" height="12" alt="(' . number_format($scripts[$k]['ratings'], 2) . ' out of 5)" />';
            }
            $r = $r - $deduct;
        }
        $ts_class = !empty($softpanel->pheader) ? substr_count($_SERVER['REQUEST_URI'], 'paper_lantern') > 0 ? 'col-lg-4 col-md-6 col-sm-6 col-xs-12' : 'col-lg-6 col-md-6 col-sm-6 col-xs-12' : 'col-lg-4 col-md-4 col-sm-6 col-xs-12';
        echo '
					<div class="' . $ts_class . '" style="padding-bottom: 20px;">
						<div class="sai_boxgrid2_ts">
							<div class="row" id="row_' . $j . '" style="height:80%; padding-top:5px;" onmouseover="show_desc(this);" onmouseout="hide_desc(this);">
								<div class="sai_block" id="saiblock_' . $j . '">
									<center>	
										<img class="cover" src="' . $image_name . '" class="img-responsive" /><br />
									</center>
								</div>
								
								<div class="sai_hover" id="saihover_' . $j . '">
									<a href="' . script_link($k, 1) . '&tab=overview"><p style="height:75%;">' . (strlen($iscripts[$k]['desc']) > 120 ? substr($iscripts[$k]['desc'], 0, 116) . '<br /><font size="2" color="#FFF">[' . $l['more'] . ']</font>' : $iscripts[$k]['desc']) . '</p></a>
									
									<div class="row">
										<div class="col-sm-4 col-xs-4">
											<a href="' . script_link($k, 1) . '&tab=install" class="sai_insbut sai_insbutpad" style="text-decoration:none; padding:4px; vertical-align:bottom;">' . $l['install_button'] . '</a>
										</div>
										
										<div class="col-sm-3 col-xs-3">
											<span>' . (empty($globals['off_demo_link']) ? '<a href="' . $globals['ind'] . 'act=demos&soft=' . $k . '" target="_blank" class="sai_insbut_ts" style="vertical-align:bottom;"><b>' . $l['demo_button'] . '</b></a>' : '') . '</span>
										</div>
										
										<div class="col-sm-3 col-xs-3">
											<span><a href="' . script_link($k, 1) . '&tab=overview" class="sai_insbut_ts" style="vertical-align:bottom;"><b>' . $l['overview_button'] . '</b></a></span>
										</div>
									</div>
									
								</div>
							</div>
					
							<a href="' . script_link($k, 1) . '&tab=overview" style="text-decoration:none;">
							<div class="row" id="row_ts_' . $j . '" style="height:20%; text-align:center; padding-top:3px; background-color:#ECECEC;">
								<font size="2" style="color:#717276;"><strong>' . $iscripts[$k]['name'] . '</strong></font><br />
								' . (empty($globals['off_rating_link']) && $k < 10000 ? '<div class="sai_coverstars" style="margin-left:0;">' . implode('', $ratings) . '</div>' : '') . '
							</div>
							</a>
						</div>
					</div>';
        if ($j == (!empty($softpanel->pheader) ? substr_count($_SERVER['REQUEST_URI'], 'paper_lantern') > 0 ? 15 : 8 : 15)) {
            break;
        }
        $j++;
        $i++;
    }
    echo '	
				</div>
				<div class="col-md-1"></div>
			</div>
		</div>';
    echo '
		<div class="right_panel_one" ' . ($globals['softpanel'] == 'ampps' || $globals['softpanel'] == 'webuzo' ? '' : 'style="display:none"') . '>
			<br /><br />';
    if ($globals['softpanel'] == 'webuzo') {
        global $apps;
        $ins_apps = $softpanel->loadinsapps();
        $def_mysql = $softpanel->getConf('WU_DEFAULT_MYSQL');
        $mysql = !empty($def_mysql) ? $softpanel->get_app_record($def_mysql) : 16;
        $def_web_server = $softpanel->getConf('WU_DEFAULT_SERVER');
        $web_server = !empty($def_web_server) ? $softpanel->get_app_record($def_web_server) : 3;
        $onlyapache = $softpanel->current_apache_id();
        $onlyapache = !empty($onlyapache) ? $onlyapache : 3;
        $disable_sysapps = $softpanel->is_sysapps_disable();
        echo '
				<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="' . $theme['url'] . '/js/excanvas.min.js"></script><![endif]-->
				
				<script language="javascript" src="' . $theme['url'] . '/js/jquery.flot.min.js" type="text/javascript"></script>
				<script language="javascript" src="' . $theme['url'] . '/js/jquery.flot.pie.min.js" type="text/javascript"></script>
				<link rel="stylesheet" type="text/css" href="https://images.softaculous.com/webuzo/sprites/32.css" />
				<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
				
				function getusage(){
					if(AJAX("' . $globals['index'] . 'ajax=true", "server_graph_data(re)")){
						return false;
					}else{
						return true;	
					}
				};
				
				function startusage(){
					ajaxtimer = setInterval("getusage()", 5000);
				};	
				
				function server_graph_data(re){		
				
					var server_cpu = [
						{ label: "Used",  data: ' . $usage['cpu']['percent'] . '},
						{ label: "Free",  data: ' . $usage['cpu']['percent_free'] . '}
					];
					
					var server_ram = [
						{ label: "Used",  data: ' . $usage['ram']['used'] . '},
						{ label: "Free",  data: ' . $usage['ram']['free'] . '}
					];
					
					var server_disk = [
						{ label: "Used",  data: ' . $usage['disk']['total']['used_gb'] . '},
						{ label: "Free",  data: ' . $usage['disk']['total']['free_gb'] . '}
					];
					
					var server_bandwidth = [
						{ label: "Used",  data: ' . (empty($usage['bandwidth']['used_gb']) ? 0.01 : $usage['bandwidth']['used_gb']) . '},
						{ label: "Free",  data: ' . (empty($usage['bandwidth']['free_gb']) ? $usage['bandwidth']['used_gb'] * 100 : $usage['bandwidth']['free_gb']) . '}
					];
					
					if(re.length > 0){
						try{
							eval(re);
						}catch(e){ }
					}
					
					// Fill in the Text
					$_("server_cpu_text").innerHTML = server_cpu[0].data+"% / 100%";
					$_("server_ram_text").innerHTML = server_ram[0].data+" MB / "+(server_ram[0].data+server_ram[1].data)+" MB";
					$_("server_disk_text").innerHTML = server_disk[0].data+" GB / "+Math.round((server_disk[0].data+server_disk[1].data)*100)/100+" GB";
					$_("server_bandwidth_text").innerHTML = server_bandwidth[0].data+" GB / ' . (empty($usage['bandwidth']['limit_gb']) ? $l['webuzo_unlimited'] : $usage['bandwidth']['limit_gb'] . " GB") . '";
					
					// CPU
					server_graph("server_cpu", server_cpu);
					
					// RAM
					server_graph("server_ram", server_ram);
					
					// DISK
					server_graph("server_disk", server_disk);
					
					// Bandwidth
					server_graph("server_bandwidth", server_bandwidth);
				};	
				
				// Draw a Server Resource Graph
				function server_graph(id, data){		
				
					$.plot($("#"+id), data, 
					{
						series: {
							pie: { 
								innerRadius: 0.7,
								radius: 1,
								show: true,
								label: {
									show: true,
									radius: 0,
									formatter: function(label, series){
										if(label != "Used") return "";
										return \'<div style="font-size:13px;"><b>\'+Math.round(series.percent)+\'%</b></div><div style="font-size:9px;">\'+label+\'</div>\';	
									}
								}
							}
						},
						legend: {
							show: false
						}
					});
				}
				ids = ["' . implode('", "', array_keys($ins_apps)) . '"];
				tools = ["phpmyadmin","rockmongo","squirrel", "tomcat", "monsta"];
				//alert(ids);
				
				function in_array(val, arr){
					
					for (var i in arr) {
						var tmp_val = arr[i].split("_");
						if(tmp_val[0] == val){
							return true;
						}
					}
					return false;
				}
				
				function is_app_inst(app_id, act){
					
					if(in_array(app_id, ids)){
						if(in_array(act, tools)){
							if(act == "tomcat"){
								window.open("http://' . $softpanel->getConf('WU_PRIMARY_DOMAIN') . ':8080/manager/", "_blank");
							}else{
								window.open(act+"/", "_blank");
							}
						}else{
							window.location = "index.php?act="+act;
						}
					}else{
						var r = confirm("' . $l['webuzo_install_utility'] . '")
						if(r==true){
							' . (empty($disable_sysapps) ? 'window.location = "index.php?act=apps&app="+app_id;' : 'alert("' . $l['webuzo_sysapps_disabled'] . '")') . '
						}else{
							return true;
						}
					}
					
				}
					
				addonload("server_graph_data(\'void(0);\'); startusage();");
				// ]]></script>';
        echo '<center><span class="sai_newhead">' . (empty($globals['sn']) ? $l['webuzo'] : $globals['sn']) . '</span>
				<br /><br />
					<form accept-charset="' . $globals['charset'] . '" name="classsearch" method="post" action=""  id="classsearchform" class="sai_inputs">
						<input id="inputs_searchs" type="text" name="searchFeature" class="sai_inputs" autofocus placeholder="Search" autocomplete="off"><br />			
					</form><br /><br />
					<div id="show_none" class="sai_notice" style="text-align:center; display:none; width:500px;">' . $l['webuzo_no_search'] . '</div></center>
			<table cellpadding="8" cellspacing="1" width="700px" align="center" border="0" id="main_table">	
				<tr id="main_div1">
					<td>
						<div margin:0px auto; >
							<table width="100%" cellpadding="5" cellspacing="1" class="sai_divroundshad">			
								<tr>
									<td class="sai_heading_full" align="center" >
										<b>' . $l['webuzo_domain'] . '</b>
									</td>
								</tr>		
								<tr>
									<td width="100%" valign="top">
										<table cellpadding="5" cellspacing="5" border="0" id="main_table1">
											<tr align="center">
												
													<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons11" value="' . $l['webuzo_mandom'] . '">
														<a href="' . $globals['ind'] . 'act=domainmanage" ><img src="' . $theme['a_images'] . 'domains.gif" alt="" /><br />' . $l['webuzo_mandom'] . '</a>
													</td>
													<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons12" value="' . $l['webuzo_adddom'] . '">
														<a href="javascript:void(0)" onclick="is_app_inst(34, \'domainadd\'); return;"><img src="' . $theme['a_images'] . 'adddomain.gif" alt="" /><br />' . $l['webuzo_adddom'] . '</a>	
													</td>					
													<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons13" value="' . $l['webuzo_advance_dns'] . '">
														<a href="javascript:void(0)" onclick="is_app_inst(34, \'advancedns\'); return;"><img src="' . $theme['a_images'] . 'advancedns.gif" alt="" /><br />' . $l['webuzo_advance_dns'] . '</a>	
													</td>									
													<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons14" value="' . $l['webuzo_network_tools'] . '">
														<a href="' . $globals['ind'] . 'act=network_tools"><img src="' . $theme['a_images'] . 'network_tools.gif" alt="" /><br />' . $l['webuzo_network_tools'] . '</a>	
													</td>								
													<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons15" value="' . $l['webuzo_extra_conf'] . '">
														<a href="' . $globals['ind'] . 'act=extra_conf"><img src="' . $theme['a_images'] . 'extra_conf.gif" alt="" /><br />' . $l['webuzo_extra_conf'] . '</a>	
													</td>												
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>
				<tr id="main_div2">
					<td>
						<div margin:0px auto; >
							<table width="100%" cellpadding="5" cellspacing="1" class="sai_divroundshad">			
								<tr>
									<td class="sai_heading_full" align="center" >
										<b>' . $l['webuzo_mysql'] . '</b>
									</td>
								</tr>		
								<tr>
									<td width="100%"  valign="top">
										<table cellpadding="5" cellspacing="5" border="0" id="main_table2">
											<tr align="center">
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons21" value="' . $l['webuzo_mandb'] . '">
													<a href="javascript:void(0)" onclick="is_app_inst(' . $mysql . ', \'dbmanage\'); return;"><img src="' . $theme['a_images'] . 'database.gif" alt="" /><br />' . $l['webuzo_mandb'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons22" value="' . $l['webuzo_adddb'] . '">
													<a href="javascript:void(0)" onclick="is_app_inst(' . $mysql . ', \'dbmanage#adddb\'); return;"><img src="' . $theme['a_images'] . 'adddb.gif" alt="" /><br />' . $l['webuzo_adddb'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons23" value="' . $l['webuzo_phpmyadmin'] . '">
													<a href="javascript:void(0)" onclick="is_app_inst(' . $mysql . ', \'phpmyadmin\'); return;"><img src="' . $theme['a_images'] . 'phpmyadmin.gif" alt="" /><br />' . $l['webuzo_phpmyadmin'] . '</a>
												</td>	
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons24" value="' . $l['ampps_rockmongo'] . '">
													<a href="javascript:void(0)" onclick="is_app_inst(39, \'rockmongo\'); return;"><img src="' . $theme['a_images'] . 'rockmongo.gif" alt="RockMongo" /><br />' . $l['ampps_rockmongo'] . '</a>
												</td>									
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons25">										
												</td>																									
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>	
				<tr id="main_div3">
					<td>
						<div margin:0px auto;>
							<table width="100%" cellpadding="5" cellspacing="1" class="sai_divroundshad">	
								<tr>
									<td class="sai_heading_full" align="center" >
										<b>' . $l['webuzo_cat_ftp'] . '</b>
									</td>
								</tr>		
								<tr>
									<td width="100%"  valign="top" >
										<table cellpadding="5" cellspacing="5" border="0" id="main_table3">
											<tr align="center">																	
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons31" value="' . $l['webuzo_ftp'] . '">
													<a href="javascript:void(0)" onclick="is_app_inst(31, \'ftp\'); return;"><img src="' . $theme['a_images'] . 'ftp.gif" alt="" /><br />' . $l['webuzo_ftp'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons32" value="' . $l['webuzo_ftp_account'] . '">		
													<a href="javascript:void(0)" onclick="is_app_inst(31, \'ftp_account\'); return;"><img src="' . $theme['a_images'] . 'addftp.gif" alt="" /><br />' . $l['webuzo_ftp_account'] . '</a>
												</td>	
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons33" value="' . $l['webuzo_web_ftp'] . '">		
													<a href="javascript:void(0)" onclick="is_app_inst(31, \'monsta\'); return;"><img src="' . $theme['a_images'] . 'web_ftp.gif" alt="" /><br />' . $l['webuzo_web_ftp'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons34" value="' . $l['webuzo_ftp_connections'] . '">
													<a href="javascript:void(0)" onclick="is_app_inst(31, \'ftp_connections\'); return;"><img src="' . $theme['a_images'] . 'ftp_connections.gif" alt="" /><br />' . $l['webuzo_ftp_connections'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons35">
												</td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>';
        $tmpapps = $apps;
        foreach ($tmpapps as $key => $val) {
            if (array_key_exists($key . '_1', $ins_apps) || $val['type'] == 'library') {
                unset($tmpapps[$key]);
            }
        }
        // Hope all the apps are not installed !!!
        if (!empty($tmpapps) && empty($disable_sysapps)) {
            shuffle($tmpapps);
            echo '
				<tr id="main_div4">
					<td>
						<div margin:0px auto;>
							<table width="100%" cellpadding="5" cellspacing="1" class="sai_divroundshad">	
								<tr>
									<td class="sai_heading_full" align="center" >
										<b>' . $l['webuzo_install_sysapps'] . '</b>
									</td>
								</tr>		
								<tr>
									<td width="100%"  valign="top" >
										<table cellpadding="5" cellspacing="5" border="0" id="main_table4">
											<tr align="center">';
            $cnt = 0;
            while ($cnt < 5) {
                // Blank fields - If any !!!
                if (empty($tmpapps[$cnt]['aid'])) {
                    echo '
														<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons4' . $cnt . '">
														</td>';
                    $cnt++;
                    continue;
                }
                echo '
														<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons4' . $cnt . '" value="' . $tmpapps[$cnt]['name'] . '">
															<a href="?act=apps&app=' . $tmpapps[$cnt]['aid'] . '"><div class="sp32_' . $tmpapps[$cnt]['softname'] . '"></div><br />' . $tmpapps[$cnt]['name'] . '</a>
														</td>';
                $cnt++;
            }
            echo '
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>';
        }
        echo '
				<tr id="main_div5">
					<td>
						<div margin:0px auto;>
							<table width="100%" cellpadding="5" cellspacing="1" class="sai_divroundshad">	
								<tr>
									<td class="sai_heading_full" align="center" >
										<b>' . $l['webuzo_ssl'] . '</b>
									</td>
								</tr>		
								<tr>
									<td width="100%"  valign="top" >
										<table cellpadding="5" cellspacing="5" border="0" id="main_table5">
											<tr>
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons51" value="' . $l['webuzo_key'] . '">
													<a href="javascript:void(0)" onclick="is_app_inst(4, \'sslkey\'); return;"><img src="' . $theme['a_images'] . 'sslkey.gif" alt="" /><br />' . $l['webuzo_key'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons52" value="' . $l['webuzo_csr'] . '">
													<a href="javascript:void(0)" onclick="is_app_inst(4, \'sslcsr\'); return;"><img src="' . $theme['a_images'] . 'sslcsr.gif" alt="" /><br />' . $l['webuzo_csr'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons53" value="' . $l['webuzo_crt'] . '">
													<a href="javascript:void(0)" onclick="is_app_inst(4, \'sslcrt\'); return;"><img src="' . $theme['a_images'] . 'sslcrt.gif" alt="" /><br />' . $l['webuzo_crt'] . '</a>
												</td>	
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons54" value="' . $l['webuzo_install_cert'] . '">
													<a href="javascript:void(0)" onclick="is_app_inst(' . $web_server . ', \'install_cert\'); return;"><img src="' . $theme['a_images'] . 'install_cert.gif" alt="" /><br />' . $l['webuzo_install_cert'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons55">
												</td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>
				<tr id="main_div6">
					<td>
						<div margin:0px auto;>
							<table width="100%" cellpadding="5" cellspacing="1" class="sai_divroundshad">	
								<tr>
									<td class="sai_heading_full" align="center" >
										<b>' . $l['webuzo_cat_email'] . '</b>
									</td>
								</tr>		
								<tr>
									<td width="100%"  valign="top" >
										<table cellpadding="5" cellspacing="5" border="0" id="main_table6">
											<tr>
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons61" value="' . $l['webuzo_email_acc'] . '">
													<a href="javascript:void(0)" onclick="is_app_inst(35, \'email_account\'); return;"><img src="' . $theme['a_images'] . 'email_account.gif" alt="" /><br />' . $l['webuzo_email_acc'] . '</a>
												</td>	
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons62" value="' . $l['webuzo_email_forward'] . '">
													<a href="javascript:void(0)" onclick="is_app_inst(35, \'email_forward\'); return;"><img src="' . $theme['a_images'] . 'email_forward.gif" alt="" /><br />' . $l['webuzo_email_forward'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons63" value="' . $l['webuzo_mx_entry'] . '">
													<a href="javascript:void(0)" onclick="is_app_inst(34, \'mxentry\'); return;"><img src="' . $theme['a_images'] . 'mx_entry.gif" alt="" /><br />' . $l['webuzo_mx_entry'] . '</a>
												</td>	
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons64" value="' . $l['webuzo_squirrel'] . '">		
													<a href="javascript:void(0)" onclick="is_app_inst(35, \'squirrel\'); return;"><img src="' . $theme['a_images'] . 'squirrel.gif" alt="" /><br />' . $l['webuzo_squirrel'] . '</a><br />
												</td>	
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons65" value="' . $l['webuzo_email'] . '">		
													<a href="' . $globals['ind'] . 'act=email"><img src="' . $theme['a_images'] . 'emails.gif" alt="" /><br />' . $l['webuzo_email'] . '</a>
												</td>	
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>';
        if (empty($disable_sysapps)) {
            echo '
				<tr id="main_div7">
					<td>
						<div margin:0px auto;>
							<table width="100%" cellpadding="5" cellspacing="1" class="sai_divroundshad">	
								<tr>
									<td class="sai_heading_full" align="center" >
										<b>' . $l['webuzo_configuration'] . '</b>
									</td>
								</tr>		
								<tr>
									<td width="100%"  valign="top" >
										<table cellpadding="5" cellspacing="5" border="0" id="main_table7">
											<tr>
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons71" value="' . $l['webuzo_php'] . '">
													<a href="' . $globals['ind'] . 'act=editini"><img src="' . $theme['a_images'] . 'php_conf.gif" alt="" /><br />' . $l['webuzo_php'] . '</a>
												</td>									
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons72" value="' . ($softpanel->getConf('WU_DEFAULT_SERVER') == 'nginx' ? $l['webuzo_nginx'] : ($softpanel->getConf('WU_DEFAULT_SERVER') == 'lighttpd' ? $l['webuzo_lighttpd'] : $l['webuzo_apache'])) . '">
											' . ($softpanel->getConf('WU_DEFAULT_SERVER') == 'nginx' ? '<a href="javascript:void(0)" onclick="is_app_inst(18, \'apache_conf\'); return;"><img src="' . $theme['a_images'] . 'nginx_conf.gif" alt="" /><br />' . $l['webuzo_nginx'] . '</a>' : ($softpanel->getConf('WU_DEFAULT_SERVER') == 'lighttpd' ? '<a href="javascript:void(0)" onclick="is_app_inst(60, \'apache_conf\'); return;"><img src="' . $theme['a_images'] . 'lighttpd_conf.gif" alt="" /><br />' . $l['webuzo_lighttpd'] . '</a>' : '<a href="javascript:void(0)" onclick="is_app_inst(' . $onlyapache . ', \'apache_conf\'); return;"><img src="' . $theme['a_images'] . 'apache_conf.gif" alt="" /><br />' . $l['webuzo_apache'] . '</a>')) . '										
												</td>
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons73" value="' . $ins_apps[$mysql . '_1']['name'] . '">
													<a href="javascript:void(0)" onclick="is_app_inst(' . $mysql . ', \'mysql_conf\'); return;"><img src="' . $theme['a_images'] . $mysql . '_icon.gif" alt="" /><br />' . $ins_apps[$mysql . '_1']['name'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons74" value="' . $l['webuzo_php_ext'] . '">
													<a href="' . $globals['ind'] . 'act=php_ext"><img src="' . $theme['a_images'] . 'php_ext.gif" alt="" /><br />' . $l['webuzo_php_ext'] . '</a>
												</td>
												';
            if ($softpanel->getConf('WU_DEFAULT_SERVER') == 'httpd') {
                echo '<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons75" value="' . $l['apache_settings'] . '">
														<a href="javascript:void(0)" onclick="is_app_inst(3, \'apache_settings\'); return;"><img src="' . $theme['a_images'] . 'apache_settings.gif" alt="" /><br />' . $l['apache_settings'] . '</a>
													</td>';
            } elseif ($softpanel->getConf('WU_DEFAULT_SERVER') == 'nginx') {
                echo '<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons75" value="' . $l['nginx_settings'] . '">
														<a href="javascript:void(0)" onclick="is_app_inst(18, \'apache_settings\'); return;"><img src="' . $theme['a_images'] . 'nginx_settings.gif" alt="" /><br />' . $l['nginx_settings'] . '</a>
													</td>';
            } else {
                echo '<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons75">
													</td>	';
            }
            echo '									
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>';
        }
        echo '
				<tr id="main_div8">
					<td>
						<div margin:0px auto;>
							<table width="100%" cellpadding="5" cellspacing="1" class="sai_divroundshad">	
								<tr>
									<td class="sai_heading_full" align="center" >
										<b>' . $l['webuzo_cat_security'] . '</b>
									</td>
								</tr>		
								<tr>
									<td width="100%"  valign="top" >
										<table cellpadding="5" cellspacing="5" border="0" id="main_table8">
											<tr>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons81" value="' . $l['webuzo_pass'] . '">
													<a href="' . $globals['ind'] . 'act=changepassword"><img src="' . $theme['a_images'] . 'changepassword.gif" alt="" /><br />' . $l['webuzo_pass'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons82" value="' . $l['webuzo_ip_block'] . '">
													<a href="' . $globals['ind'] . 'act=ipblock"><img src="' . $theme['a_images'] . 'ip_block.gif" alt="" /><br />' . $l['webuzo_ip_block'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons83" value="' . $l['webuzo_csf'] . '">	
													<a href="javascript:void(0)" onclick="is_app_inst(62, \'csf_conf\'); return;"><img src="' . $theme['a_images'] . 'firewall.gif" alt="" /><br />' . $l['webuzo_csf'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons84" value="' . $l['webuzo_ssh_access'] . '">
													<a href="' . $globals['ind'] . 'act=ssh_access"><img src="' . $theme['a_images'] . 'ssh_login.gif" alt="" /><br />' . $l['webuzo_ssh_access'] . '</a>
												</td>';
        if ($softpanel->getConf('WU_DEFAULT_SERVER') == 'httpd' || $softpanel->getConf('WU_DEFAULT_SERVER') == 'httpd2') {
            echo '										
													<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons85" value="' . $l['webuzo_pass_protect_dir'] . '">
														<a href="' . $globals['ind'] . 'act=pass_protect_dir"><img src="' . $theme['a_images'] . 'pass_protect_dir.gif" alt="" /><br />' . $l['webuzo_pass_protect_dir'] . '</a>
												</td>';
        } else {
            echo '
													<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons85">										
													</td>';
        }
        echo '</tr>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>
				<tr id="main_div9">
					<td>
						<div margin:0px auto;>
							<table width="100%" cellpadding="5" cellspacing="1" class="sai_divroundshad">	
								<tr>
									<td class="sai_heading_full" align="center" >
										<b>' . $l['webuzo_advance_setting'] . '</b>
									</td>
								</tr>		
								<tr>
									<td width="100%"  valign="top" >
										<table cellpadding="5" cellspacing="5" border="0" id="main_table9">
											<tr>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons91" value="' . $l['webuzo_apps_updates'] . '">
													<a href="' . $globals['ind'] . 'act=apps_updates"><img src="' . $theme['a_images'] . 'apps_updates.gif" alt="" /><br />' . $l['webuzo_apps_updates'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons92" value="' . $l['webuzo_settings'] . '">
													<a href="' . $globals['ind'] . 'act=settings"><img src="' . $theme['a_images'] . 'settings.gif" alt="" /><br />' . $l['webuzo_settings'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons93" value="' . $l['webuzo_cron'] . '">
													<a href="' . $globals['ind'] . 'act=cronjob"><img src="' . $theme['a_images'] . 'cronjob.gif" alt="" /><br />' . $l['webuzo_cron'] . '</a>
												</td>	
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons94" value="' . $l['webuzo_system_utilities'] . '">
													<a href="' . $globals['ind'] . 'act=service_manager"><img src="' . $theme['a_images'] . 'service_manager.gif" alt="" /><br />' . $l['webuzo_system_utilities'] . '</a>
												</td>
												';
        if (empty($disable_sysapps)) {
            echo '
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons95" value="' . $l['webuzo_services'] . '">		
													<a href="' . $globals['ind'] . 'act=services"><img src="' . $theme['a_images'] . 'services.gif" alt="" /><br />' . $l['webuzo_services'] . '</a>
												</td>';
        } else {
            echo '
													<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons95">										
													</td>';
        }
        echo '	
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>
				<tr id="main_div10">
					<td>
						<div margin:0px auto;>
							<table width="100%" cellpadding="5" cellspacing="1" class="sai_divroundshad">	
								<tr>
									<td class="sai_heading_full" align="center" >
										<b>' . $l['webuzo_server_setting'] . '</b>
									</td>
								</tr>		
								<tr>
									<td width="100%"  valign="top" >
										<table cellpadding="5" cellspacing="5" border="0" id="main_table10">
											<tr>									
												</td>
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons101" value="' . $l['webuzo_filemanager'] . '">
													<a href="filemanager/" target="_blank"><img src="' . $theme['a_images'] . 'filemanager.gif" alt="" /><br />' . $l['webuzo_filemanager'] . '</a>
												</td>									
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons102" value="' . $l['webuzo_awstats'] . '">
													<a href="javascript:void(0)" onclick="is_app_inst(38, \'awstats\'); return;"><img src="' . $theme['a_images'] . 'awstats.gif" alt="" /><br />' . $l['webuzo_awstats'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons103" value="' . $l['webuzo_login_logs'] . '">
													<a href="' . $globals['ind'] . 'act=login_logs"><img src="' . $theme['a_images'] . 'login_logs.gif" alt="" /><br />' . $l['webuzo_login_logs'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons104" value="' . $l['webuzo_import_cpanel'] . '">
													<a href="' . $globals['ind'] . 'act=import_cpanel"><img src="' . $theme['a_images'] . 'import_cpanel.gif" alt="" /><br />' . $l['webuzo_import_cpanel'] . '</a>
												</td>';
        // Hide it if tomcat is not installed and DISABLED_SYSAPPS
        if (!empty($disable_sysapps) && empty($ins_apps['37_1'])) {
            echo '
													<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons105">										
													</td>';
        } else {
            echo '
													<td class="webuzo_icons" align="center" valign="top"  width="140px" id="webuzo_icons105" value="' . $l['webuzo_apache_tomcat'] . '">
														<a href="javascript:void(0)" onclick="is_app_inst(37, \'tomcat\'); return;"><img src="' . $theme['a_images'] . 'apache_tomcat.gif" alt="" /><br />' . $l['webuzo_apache_tomcat'] . '</a>										
													</td>';
        }
        echo '
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>
				<tr id="main_div11">
					<td>
						<div margin:0px auto;>
							<table width="100%" cellpadding="5" cellspacing="1" class="sai_divroundshad">	
								<tr>
									<td class="sai_heading_full" align="center" >
										<b>' . $l['webuzo_server_info'] . '</b>
									</td>
								</tr>		
								<tr>
									<td width="100%"  valign="top" >
										<table cellpadding="5" cellspacing="5" border="0" id="main_table11">
											<tr>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons111" value="' . $l['webuzo_cpu'] . '">
													<a href="' . $globals['ind'] . 'act=cpu"><img src="' . $theme['a_images'] . 'cpu.gif" alt=""/><br />' . $l['webuzo_cpu'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons112" value="' . $l['webuzo_ram'] . '">	
													<a href="' . $globals['ind'] . 'act=ram"><img src="' . $theme['a_images'] . 'ram.gif" alt=""/><br />' . $l['webuzo_ram'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons113" value="' . $l['webuzo_disk'] . '">
													<a href="' . $globals['ind'] . 'act=disk"><img src="' . $theme['a_images'] . 'disk.gif" alt=""/><br />' . $l['webuzo_disk'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons114" value="' . $l['webuzo_bandwidth'] . '">
													<a href="' . $globals['ind'] . 'act=bandwidth"><img src="' . $theme['a_images'] . 'bandwidth.gif" alt=""/><br />' . $l['webuzo_bandwidth'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons115" value="' . $l['webuzo_error_log'] . '">
													<a href="' . $globals['ind'] . 'act=errorlog"><img src="' . $theme['a_images'] . 'error_log.gif" alt=""/><br />' . $l['webuzo_error_log'] . '</a>
												</td>	
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>
				<tr>
					<td id="main_div12">
						<div margin:0px auto;>
							<table width="100%" cellpadding="5" cellspacing="1" class="sai_divroundshad">	
								<tr>
									<td class="sai_heading_full" align="center" >
										<b>' . $l['webuzo_scripts'] . '</b>
									</td>
								</tr>		
								<tr>
									<td width="100%"  valign="top">
										<table cellpadding="5" cellspacing="5" border="0" id="main_table12">
											<tr>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons121" value="' . $l['webuzo_demos'] . '">
													<a href="' . $globals['ind'] . 'act=demos"><img src="' . $theme['a_images'] . 'demos.gif" alt="" /><br />' . $l['webuzo_demos'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons122" value="' . $l['webuzo_ratings'] . '">
													<a href="' . $globals['ind'] . 'act=ratings"><img src="' . $theme['a_images'] . 'ratings.gif" alt="" /><br />' . $l['webuzo_ratings'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons123" value="' . $l['webuzo_installations'] . '">
													<a href="' . $globals['ind'] . 'act=installations"><img src="' . $theme['a_images'] . 'installations.gif" alt="" /><br />' . $l['webuzo_installations'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons124" value="' . $l['webuzo_backups'] . '">
													<a href="' . $globals['ind'] . 'act=backups"><img src="' . $theme['a_images'] . 'backups.gif" alt="" /><br />' . $l['webuzo_backups'] . '</a>
												</td>
												<td class="webuzo_icons" align="center" valign="top" width="140px" id="webuzo_icons125">
												</td>	
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>
				<tr>
					<td>
						<div margin:0px auto;>
							<table width="100%" cellpadding="5" cellspacing="1" class="sai_divroundshad">	
								<tr class="sai_heading_full">
									<th align="center" width="25%" style="height:25px">' . $l['webuzo_cpuinfo'] . '</th>
									<th align="center" width="25%">' . $l['webuzo_raminfo'] . '</th>
									<th align="center" width="25%">' . $l['webuzo_diskinfo'] . '</th>
									<th align="center" width="25%">' . $l['webuzo_bandwidthinfo'] . '</th>
								</tr>
								<tr>
									<td align="center" valign="top"><br />
										<div id="server_cpu" class="server_graph"></div>
										<br /><div id="server_cpu_text">&nbsp;</div>
									</td>
									<td align="center"  valign="top"><br />
										<div id="server_ram" class="server_graph"></div>
										<br /><div id="server_ram_text">&nbsp;</div>
									</td>				
									<td align="center" valign="top"><br />
										<div id="server_disk" class="server_graph"></div>
										<br /><div id="server_disk_text">&nbsp;</div>
									</td>
									<td align="center" valign="top"><br />
										<div id="server_bandwidth" class="server_graph"></div>
										<br /><div id="server_bandwidth_text">&nbsp;</div><br />
									</td>
								</tr>					
							</table>
						</div>
					</td>
				</tr>	
			</table>
			<br /><br /><br />';
    } elseif ($globals['softpanel'] == 'ampps') {
        $BinVer = $softpanel->currentBinary();
        echo '<center><span class="sai_newhead">' . $l['ampps'] . '</span></center><br />
			<table cellpadding="8" cellspacing="1" border="0">
			<tr>
				<td colspan="20">	
					<span class="sai_newhead">' . $l['ampps_config'] . '</span>
					<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" /><br /><br />	
				</td>
			</tr>
			<tr>
				<td class="ampps_icons" align="center" valign="top">
					<a href="' . $globals['ind'] . 'act=secure"><img src="' . $theme['a_images'] . 'secure.gif" alt="" /><br />' . $l['ampps_secure'] . '</a>
				</td>
				<td class="ampps_icons" align="center" valign="top">
					<a href="' . $globals['ind'] . 'act=security"><img src="' . $theme['a_images'] . 'security.gif" alt="" /><br />' . $l['ampps_security'] . '</a>
				</td>
				<td class="ampps_icons" align="center" valign="top">
					<a href="' . $globals['ind'] . 'act=status"><img src="' . $theme['a_images'] . 'status.gif" alt="" /><br />' . $l['ampps_status'] . '</a>
				</td>
				<td class="ampps_icons" align="center" valign="top">
					<a href="' . $globals['ind'] . 'act=ampps_domainmanage"><img src="' . $theme['a_images'] . 'domains.gif" alt="" /><br />' . $l['ampps_mandom'] . '</a>
				</td>
				<td class="ampps_icons" align="center" valign="top">
					<a href="' . $globals['ind'] . 'act=ampps_domainadd"><img src="' . $theme['a_images'] . 'adddomain.gif" alt="" /><br />' . $l['ampps_adddom'] . '</a>
				</td>
			</tr>
			
			<tr>
				<td colspan="20">	
					<span class="sai_newhead">' . $l['ampps_mysql'] . '</span>
					<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" /><br /><br />	
				</td>
			</tr>
			<tr>
				<td class="ampps_icons" align="center" valign="top">
					<a href="http://' . $globals['HTTP_HOST'] . '/sqlite" target="_blank"><img src="' . $theme['a_images'] . 'sqlite.gif" alt="" /><br />' . $l['ampps_sqlite'] . '</a>
				</td>
				<td class="ampps_icons" align="center" valign="top">
					<a href="http://' . $globals['HTTP_HOST'] . '/phpmyadmin/index.php?server=1&target=server_databases.php" target="_blank"><img src="' . $theme['a_images'] . 'adddb.gif" alt="" /><br />' . $l['ampps_adddb'] . '</a>
				</td>
				<td class="ampps_icons" align="center" valign="top">
					<a href="http://' . $globals['HTTP_HOST'] . '/phpmyadmin" target="_blank"><img src="' . $theme['a_images'] . 'phpmyadmin.gif" alt="phpMyAdmin" /><br />' . $l['ampps_phpmyadmin'] . '</a>
				</td>
				<td class="ampps_icons" align="center" valign="top">
					<a href="' . $globals['ind'] . 'act=mysqlsettings"><img src="' . $theme['a_images'] . 'mysqlsettings.gif" alt="Change Password" /><br />' . $l['ampps_mysqlsettings'] . '</a>
				</td>';
        if ($BinVer > 15) {
            echo '<td class="ampps_icons" align="center" valign="top">
						<a href="http://' . $globals['HTTP_HOST'] . '/rockmongo" target="_blank"><img src="' . $theme['a_images'] . 'rockmongo.gif" alt="RockMongo" /><br />' . $l['ampps_rockmongo'] . '</a>
					</td>';
        }
        echo '</tr>
			
			<tr>
				<td colspan="20">	
					<span class="sai_newhead">' . $l['ampps_features'] . '</span>
					<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" /><br /><br />	
				</td>
			</tr>
			<tr>';
        if ($BinVer > 15) {
            echo '<td class="ampps_icons" align="center" valign="top">
						<a href="' . $globals['ind'] . 'act=alias"><img src="' . $theme['a_images'] . 'alias.gif" alt="" /><br />' . $l['ampps_alias'] . '</a>
					</td>';
        }
        if ($BinVer > 16) {
            echo '<td class="webuzo_icons" align="center" valign="top">
						<a href="' . $globals['ind'] . 'act=ftpmanage"><img src="' . $theme['images'] . 'ftp.gif" alt="" /><br />' . $l['ampps_ftp'] . '</a>
					</td>
					<td class="webuzo_icons" align="center" valign="top">
						<a href="' . $globals['ind'] . 'act=ftpadd"><img src="' . $theme['a_images'] . 'addftp.gif" alt="" /><br />' . $l['ampps_ftp_account'] . '</a>
					</td>';
        }
        echo '</tr>
			
			<tr>
				<td colspan="20">	
					<span class="sai_newhead">' . $l['ampps_info'] . '</span>
					<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" /><br /><br />	
				</td>
			</tr>
			<tr>
				<td class="ampps_icons" align="center" valign="top">
					<a href="' . ($BinVer < 21 ? $globals['ind'] . 'act=phpinfo' : 'http://' . $globals['HTTP_HOST'] . '/cgi-bin/phpinfo.cgi') . '"><img src="' . $theme['a_images'] . 'phpinfo.gif" alt="" /><br />' . $l['ampps_phpinfo'] . '</a>
				</td>
				<td class="ampps_icons" align="center" valign="top">
					<a href="http://' . $globals['HTTP_HOST'] . '/cgi-bin/perlinfo.pl"><img src="' . $theme['a_images'] . 'perlinfo.gif" alt="" /><br />' . $l['ampps_perlinfo'] . '</a>
				</td>
			</tr>
			
			<tr>
				<td colspan="20">	
					<span class="sai_newhead">' . $l['ampps_quick_conf'] . '</span>
					<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" /><br /><br />	
				</td>
			</tr>
			
			<tr>
				<td class="ampps_icons" align="center" valign="top">
					<a href="' . $globals['ind'] . 'act=editini"><img src="' . $theme['a_images'] . 'php_conf.gif" alt="" /><br />' . $l['ampps_php'] . '</a>
				</td>
				<td class="ampps_icons" align="center" valign="top"  width="140px">
					<a href="' . $globals['ind'] . 'act=apache_conf"><img src="' . $theme['a_images'] . 'apache_conf.gif" alt="" /><br />' . $l['ampps_apache'] . '</a>
				</td>
			</tr>
			
			
			<tr>
				<td colspan="20">	
					<span class="sai_newhead">' . $l['ampps_scripts'] . '</span>
					<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" /><br /><br />	
				</td>
			</tr>
			
			<tr>
				<td class="ampps_icons" align="center" valign="top">
					<a href="' . $globals['ind'] . 'act=demos"><img src="' . $theme['images'] . 'demos.gif" alt="" /><br />' . $l['ampps_demos'] . '</a>
				</td>
				<td class="ampps_icons" align="center" valign="top">
					<a href="' . $globals['ind'] . 'act=ratings"><img src="' . $theme['images'] . 'ratings.gif" alt="" /><br />' . $l['ampps_ratings'] . '</a>
				</td>
				<td class="ampps_icons" align="center" valign="top">
					<a href="' . $globals['ind'] . 'act=installations"><img src="' . $theme['images'] . 'installations.gif" alt="" /><br />' . $l['ampps_installations'] . '</a>
				</td>
				<td class="ampps_icons" align="center" valign="top">
					<a href="' . $globals['ind'] . 'act=backups"><img src="' . $theme['images'] . 'backups.gif" alt="" /><br />' . $l['ampps_backups'] . '</a>
				</td>
				<td class="ampps_icons" align="center" valign="top">		
					<a href="' . $globals['ind'] . 'act=email"><img src="' . $theme['images'] . 'emails.gif" alt="" /><br />' . $l['ampps_email'] . '</a>
				</td>
			</tr>
			</table>
			<br /><br /><br />';
    } else {
        $info_head1 = !empty($softpanel->pheader) ? substr_count($_SERVER['REQUEST_URI'], 'paper_lantern') > 0 ? 'col-md-11 col-sm-10 col-xs-9' : 'col-md-10 col-sm-10 col-xs-9' : 'col-md-11 col-sm-10 col-xs-9';
        echo '<div class="bg bg_usi"><br />
					<div class="row">
						<div class="' . $info_head1 . '" style="text-align:center;">
							<span class="sai_newhead">' . $globals['sn'] . '</span>
						</div>
							
						<div class="topscripts">
							<img src="' . $theme['images'] . 'top_star.png" width="30" height="30" class="someclass" title="Top Scripts" style="border:none;"/>&nbsp;&nbsp;							
						</div>
					</div>
					
					<hr><br />
				
					<div class="row">
						<div style="width:20%; float:left;">
							<img src="' . $theme['images'] . 'autoinstaller.jpg" alt="" class="img-responsive"/>
						</div>
						<div style="width:80%; float:right; padding:0 20px;">
							<font class="sai_newhead">' . $l['auto_installer'] . '</font>
							<br /><br />
							<font class="sai_feature_exp">' . $l['auto_installer_exp'] . '</font>
						</div>
					</div>
					
					<br /><br />
				
					<div class="row">
						<div style="width:80%; float:left; padding-right:50px;">		
							<font class="sai_newhead">' . $l['view_demos'] . '</font>
							<br /><br />
							<font class="sai_feature_exp">' . $l['view_demos_exp'] . '</font>
						</div>
						<div style="width:20%; float:right;">	
							<a href="' . $globals['ind'] . 'act=demos"><img src="' . $theme['images'] . 'exp_demos.gif" alt="" class="img-responsive"/></a>
						</div>
					</div>
					
					<br /><br />
				
					<div class="row">
						<div style="width:20%; float:left;">	
							<a href="' . $globals['ind'] . 'act=ratings"><img src="' . $theme['images'] . 'rate_it.jpg" alt="" class="img-responsive"/></a>
						</div>
						<div style="width:80%; float:right; padding:0 20px;">	
							<font class="sai_newhead">' . $l['rate_it'] . '</font>
							<br /><br />
							<font class="sai_feature_exp">' . $l['rate_it_exp'] . '</font>
						</div>
					</div>
					
					<br /><br />
				
					<div class="row">
						<div style="width:80%; float:left; padding-right:50px;">
							<font class="sai_newhead">' . $l['build_sites'] . '</font>
							<br /><br />
							<font class="sai_feature_exp">' . $l['build_sites_exp'] . '</font>
						</div>
						<div style="width:20%; float:right;">	
							<img src="' . $theme['images'] . 'build.jpg" alt="" class="img-responsive"/>
						</div>
					</div><br /><br />
				</div><!--end of bg class-->';
    }
    //THIS IS THE CLOSING OF TAB2 DIV
    echo '
		</div>
	</div>';
    // news updates box
    if (empty($globals['eu_news_off'])) {
        echo '<script language="javascript" type="text/javascript"  id="news"></script>
		
		<script type="text/javascript">
		function load_soft_info(){
			if(!$_("softnews")){ // Is the news DIV there ?
				return true;
			}
			$_("softnews").style.width = $_("softnewsholder").offsetWidth;
			
			//The news
			
			if(typeof(soft_news) == "undefined"){
				$_("softnews").innerHTML = "' . $l['conect_to_soft'] . '";
			}else{
				var newsstr = "";
				for(x in soft_news){
					newsstr = newsstr+\'<div class="softnewshead">\'+soft_news[x][0]+\'</div>\'+\'<div class="softnewsblock">\'+soft_news[x][1]+\'</div><br />\';
				}
				$_("softnews").innerHTML = newsstr;
			}
		}
		addonload(\'load_soft_info();\');
		
		</script>
		<table width="100%" border="0" cellspacing="0" cellpadding="0" >	
			<tr>
				<td style="padding-top:40px;" colspan="3">
					<table width="90%" align="center" border="0" cellspacing="0" cellpadding="0" >
						<tr>
							<td class="news_content_header">
								' . $l['news'] . '
							</td>
						</tr>
						<tr>
							<td id="softnewsholder">
								<div class="news_content">
									<div class="softnews" id="softnews"' . (!empty($softpanel->pheader) ? 'style="overflow: auto;width:auto"' : '') . '></div>
								</div>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>';
    }
    softfooter();
}
Пример #4
0
function showdetail()
{
    global $user, $globals, $l, $theme, $softpanel, $error, $done, $domain, $lookup, $action;
    echo '<table border="0" cellpadding="8" cellspacing="0" width="100%" style="padding:15px;">
	<tr>
		<td> 
			<span class="sai_head" style="text-align:center">' . lang_vars($l['action_for'], array(ucfirst($action))) . ' ' . $domain . '</span><br /><br />	
			<textarea  name="kpaste" rows="18" readonly="readonly" style="overflow:auto; resize: none; width:100%;" wrap="off">' . $lookup[$action] . '</textarea>
	</tr>
	<tr>
		<td colspan="2">
			<center ><div class="dclose" style="cursor:pointer"><b><u>' . $l['close_detail'] . '</u></b></div></center>
		</td>
	</tr>	
</table>

<script language="javascript" type="text/javascript"><!-- // --><![CDATA[

	$(document).ready(function(){	
		
		// For close details
		$(".dclose").click(function() {	
			$("#domain_lookup_tab").slideUp(\'slide\',\'\',1000);			
		});	
	});		
// ]]></script>';
}
Пример #5
0
function upgrade_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error, $scripts;
    global $software, $soft, $info, $settings, $softins, $dbtype, $dbs, $upgraded, $__settings, $setupcontinue, $installations, $notes, $upgradableto;
    // Give the staus
    if (optGET('ajaxstatus')) {
        $_status = soft_progress(optGET('ajaxstatus'));
        $tmp_status = unserialize($_status[1]);
        $_status[1] = $tmp_status['current_status'];
        if (!empty($_status)) {
            echo implode('|', $_status);
            return true;
        }
        // False call
        echo 0;
        return false;
    }
    softheader($l['<title>'] . $software['name']);
    echo '
	<div id="install_win">';
    //First add the installation info
    if (empty($upgraded)) {
        if (!empty($GLOBALS['alreadyupdated'])) {
            echo '
				<form accept-charset="' . $globals['charset'] . '" method="post" name="uprec" id="uprec" action="">
					<input type="hidden" name="updaterecord" value="1" />
					
					<div class="alert alert-warning">
						<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
						<center><a href="javascript:$_(\'uprec\').submit();" style="text-decoration:none;"><img src="' . $theme['images'] . 'notice.gif" /> &nbsp;  ' . lang_vars($l['alreadyupdated'], array($GLOBALS['alreadyupdated'], $softins['ver'])) . '</a></center>
					</div>
					
				</form><br />';
        }
        // You may not need an upgrade anymore.
        if (!empty($GLOBALS['no_update_required'])) {
            echo '
				<div class="alert alert-warning">
					<center><img src="' . $theme['images'] . 'notice.gif" /> &nbsp; ' . $l['no_update_required'] . '<center>
				</div>
				<br />';
        } else {
            echo '
				<div id="fadeout_div">
					<form accept-charset="' . $globals['charset'] . '" name="installsoftware" method="post" action="" onsubmit="return checkform();" id="installsoftware">
					
						<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
						
						function checkform(dosubmit){
							try{
								if(!formcheck() || !checkdbname(\'softdb\', true)){
									return false;
								}
							}catch(e){
								//Do nothing
							}
							$_("softsubmitbut").disabled = true;
							
							if(useprog){
								
								// Send a request to check the status
								progressbar.start();
								
								// Return false so that the form is not submitted
								return false;
							
							// This is OLD School !
							}else{		
								if(dosubmit == 1){			
									$_("installsoftware").submit();	
								}
								show_msg("' . $l['upgrading'] . '");
							}
							return true;
						};
						
						var progressbar = {
							timer: 0,
							total_width: 0,	
							status_key: "",
							synctimer: 0,
							fadeout_div: "#fadeout_div",
							win_div: "#install_win",
							progress_div: "#progress_bar",
							formid: "#installsoftware",
							frequency: 8000,
							
							current: function(){
								try{
									var tmp_cur = Math.round(parseInt($_("progress_color").width)/parseInt($_("table_progress").width)*100);
									if(tmp_cur > 100){
										tmp_cur = 99;
									}
									return tmp_cur;
								}catch(e){
									return -1;	
								}
							},
							
							reset: function(){ try{
								clearTimeout(this.timer);
								$_("progress_color").width = 1;
							}catch(e){ }},
							
							move: function(dest, speed, todo){ try{
								var cur = this.current();
								if(cur < 0){
									clearTimeout(this.timer);
									return false;
								}
								var cent = cur + 1;
								var new_width = cent/100*this.total_width;
								if(new_width < 1){
									new_width = 1;
								}
								//alert(new_width+" "+dest+" "+cent);
								
								$_("progress_color").width = new_width;
								$_("progress_percent").innerHTML = "("+cent+" %)";
								
								if(cent < dest){
									this.timer = setTimeout("progressbar.move("+dest+", "+speed+")", speed);
								}else{
									eval(todo);	
								}
							}catch(e){ }},
							
							text: function(txt){ try{
								$_("progress_txt").innerHTML = txt;
							}catch(e){ }},
							
							sync: function(){
								if(progressbar.status_key.length < 2){
									return false;
								}
								$.ajax({
									url: window.location+"&ajaxstatus="+progressbar.status_key+"&random="+Math.random(),
									type: "GET",
									success: function(data){
										if(data == 0) return false;
										var tmp = data.split("|");
										var cur = progressbar.current();
										tmp[2] = (3000/(tmp[0]-cur));
										//alert(tmp);
										if(tmp[0] > cur){
											if(parseInt(tmp[2]) == 0){
												tmp[2] = 800;
											}
											progressbar.move(tmp[0], tmp[2]);
										}
										progressbar.text(tmp[1]);
										progressbar.synctimer = setTimeout("progressbar.sync()", progressbar.frequency);
									}
								});
							},
							
							sync_abort: function(){
								clearTimeout(this.synctimer);
							},
							
							start: function(){ try{
								this.post();
								this.reset();
								this.total_width = parseInt($_("table_progress").width);
								this.move(95, 800);
								this.status_key = $("#soft_status_key").attr("value");
								this.sync();
							}catch(e){ }},
							
							post: function(){
								
								// Scroll to the Top and show the progress bar
								goto_top();
								$(progressbar.fadeout_div).fadeOut(500, 
									function(){
										$(progressbar.progress_div).fadeOut(1);
										$(progressbar.progress_div).fadeIn(500);
									}
								);
								
								
								try{
									var sid = 0;
									sid = $_("softbranch").value;
								}catch(e){ 
									var sid = 0;
								}
								
								$.ajax({
									url: window.location+"&jsnohf=1&softbranch="+sid,
									type: "POST",
									data: $(progressbar.formid).serialize(),
									complete: function( jqXHR, status, responseText ) {
										
										progressbar.sync_abort();
										
										// Store the response as specified by the jqXHR object
										responseText = jqXHR.responseText;
										
										try{
											//alert(responseText);
											if(responseText.match(/\\<\\!\\-\\-PROC_DONE\\-\\-\\>/gi)){
												progressbar.text("' . addslashes($l['finishing_process']) . '");
												progressbar.move(99, 10, "$(progressbar.progress_div).fadeOut(1)");
											}else{
												progressbar.reset();
											}
										}catch(e){ }
										
										if ( jqXHR.isResolved() ) {
										
											// #4825: Get the actual response in case
											// a dataFilter is present in ajaxSettings
											jqXHR.done(function( r ) {
												responseText = r;
											});
											//alert(responseText);
											// Create a dummy div to hold the results
											// inject the contents of the document in, removing the scripts
											// to avoid any "Permission Denied" errors in IE
											var newhtml = jQuery("<div>").append(responseText).find(progressbar.win_div).html();
											
											$(progressbar.win_div).animate({opacity: 0}, 1000, "", function(){
												$(progressbar.win_div).html(newhtml);
												new_theme_funcs_init();
											}).delay(50).animate({opacity: 1}, 500,function(){
												if($("#setupcontinue_url").length > 0){
													$(".third_url").css({"border": "2px solid #FBDB0C", "width":"55%", "padding":"5px"});
													alert("' . $l['setup_partial'] . '");
													$(".third_url").css({"border-color": "#fff", "transition":"60s"});
												}				
											});
											
											//alert(newhtml);
											
										}else{
											alert("Oops ... the connection was lost");
										}
									}
								});
							}
						};
						
						function show_msg(msg){	
							$_("show_txt").innerHTML = "<br /><br /> &nbsp; "+msg+" &nbsp; <img src=\\"' . $theme['images'] . 'progress.gif\\" />";
							$_("show_txt").style.display = "";
						}
						
						// Use the Progress Bar ?
						var useprog = 1;
						
						softemail = new Array();
						function softmail(){
							try{
								var sofdom = "softdomain";
								for(x in softemail){
									if(softemail[x] == true) continue;
									var temp = $_(x).value.split("@");
									$_(x).value = temp[0] + "@" + $_(sofdom).value;
								}
							}catch(e){
								return false;
							}
						};
						
						' . (!empty($_POST) ? '' : 'addonload(\'softmail();\');');
            echo '
						// ]]></script>';
            $array_keys = array_keys($upgradableto);
            echo '
						<div class="bg"><br />
							<div class="row sai_main_head" style="width:100%;" align="center">
								<div class="col-sm-5 col-xs-5" style="padding:0 10px 0 0; text-align:right;">
									<i class="fa sai-sync fa-2x" style="color:#00A0D2;"></i>
								</div>
								<div class="col-sm-7 col-xs-7" style="padding-top:10px; padding-left:0; text-align:left;">' . $l['prog_upgrading'] . $scripts[$array_keys[0]]['name'] . '</div>
							</div><hr>';
            if (empty($globals['lictype']) && !empty($scripts[$soft]['force_scripts'])) {
                echo '<br />
								<div class="alert alert-warning">
									<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
									<center>' . lang_vars($l['not_in_free'], array($software['name'])) . (!webuzo() ? '&nbsp;&nbsp;' . $l['notify_admin'] : '') . '</center>
								</div>';
            }
            echo error_handle($error, "100%", 0, 1);
            echo '
							<div class="row">
								<div class="col-sm-5 col-xs-5">
									<span class="sai_head">' . $l['softins_url'] . '</span>
								</div>
								<div class="col-sm-6 col-xs-6">
									<span class="sai_info"><a href="' . $softins['softurl'] . '" target="_blank">' . $softins['softurl'] . '</a></span>
								</div>
							</div><br />
								
							<div class="row">
								<div class="col-sm-5 col-xs-5">
									<span class="sai_head">' . $l['softins_path'] . '</span>
								</div>
								<div class="col-sm-6 col-xs-6">
									<span class="sai_info">' . $softins['softpath'] . '</span>
								</div>
							</div><br />';
            if (!empty($scripts[$softins['sid']]['parent']) && count($array_keys) >= 2) {
                echo '
								<div class="row">
									<div class="col-sm-5">
										<label for="softbranch" class="sai_head">' . $l['select_version'] . '</label>
									</div>
									<div class="col-sm-7">
										<select name="softbranch" id="softbranch" class="form-control" onblur="checkhttps(\'softproto\', \'softdomain\', false)">';
                foreach ($upgradableto as $uk => $uv) {
                    echo '<option value=' . $uk . '>' . $uv . '</option>';
                }
                echo '
										</select>
									</div>
								</div>';
            }
            if (empty($globals['disable_backup_upgrade'])) {
                echo '
								<div class="row">
									<div class="col-sm-5">
										<label class="sai_head">' . $l['create_backup'] . '</label>
										<span class="sai_exp2">' . $l['create_backup_exp'] . '</span>
									</div>
									<div class="col-sm-7">
										<input type="checkbox" name="create_backup" id="create_backup" ' . POSTchecked('create_backup') . ' />
									</div>
								</div>';
            }
            if (!empty($settings)) {
                if (file_exists($software['path'] . '/upgrade.js')) {
                    echo '<script language="javascript" type="text/javascript"><!--// --><![CDATA[';
                    echo @parselanguages(str_replace('$(', '$_(', implode('', file($software['path'] . '/upgrade.js'))));
                    echo '// ]]></script>';
                }
                foreach ($settings as $group => $sets) {
                    if ($group == 'hidden') {
                        continue;
                    }
                    echo '<br /><br />
									<div class="bg">
										<div class="sai_sub_head">' . $group . '</div><hr>';
                    foreach ($sets as $sk => $sv) {
                        // Add class form-control
                        if (preg_match('/type="text"/is', $sv['tag'])) {
                            $sv['tag'] = preg_replace('/>/is', ' class="form-control">', $sv['tag']);
                        }
                        if (preg_match('/<select/is', $sv['tag'])) {
                            $sv['tag'] = preg_replace('/<select/is', '<select class="form-control"', $sv['tag']);
                        }
                        echo '
											<div class="row">
												<div class="col-sm-5">
													<label for="dbusername" class="sai_head">' . $sv['head'] . '</label>
													' . (empty($sv['exp']) ? '' : '<br /><span class="sai_exp">' . $sv['exp'] . '</span>') . '
												</div>
												<div class="col-sm-7">
													' . $sv['tag'] . '
													' . (preg_match('/softmail/is', $sv['tag']) ? '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
													softemail["' . $sk . '"] = false;
													//Add an event handler
													$_("' . $sk . '").onkeydown = function(){
														softemail["' . $sk . '"] = true;
													}
													// ]]></script>
													' : '') . '
												</div>
											</div>';
                    }
                    echo '
									</div><br /><!---end of bg class--->';
                }
                //The Hidden groups
                if (!empty($settings['hidden'])) {
                    foreach ($settings['hidden'] as $sk => $sv) {
                        echo $sv['tag'] . '
										' . (preg_match('/softmail/is', $sv['tag']) ? '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
										softemail["' . $sk . '"] = false;
										//Add an event handler
										$_("' . $sk . '").onkeydown = function(){
											softemail["' . $sk . '"] = true;
										}
										// ]]></script>
										' : '');
                    }
                }
            }
            //End of if($settings)
            //Is it a SOFTCOPY, then Leave a NOTE
            if (!empty($setupcontinue)) {
                echo '<br /><br />
								<div class="row" style="padding-left:15px;">
									<span class="sai_info">' . $l['softcopy_note'] . '</span>
								</div><br />';
            }
            echo '
							<div class="row" style="padding-left:15px;">
								<span class="sai_info">' . lang_vars($l['note_backup'], array($softins['insid'])) . '</span>
							</div><br />';
            if (count($array_keys) < 2) {
                echo '
								<div class="row" style="padding-left:15px;">
									<span class="sai_info">' . $l['upgrading_to'] . '<b>' . (!empty($scripts[$array_keys[0]]['name']) ? $scripts[$array_keys[0]]['name'] : $iscripts[$array_keys[0]]['name']) . '</b>, ' . $l['version'] . ' : <b>' . (!empty($scripts[$array_keys[0]]['version']) ? $scripts[$array_keys[0]]['version'] : $iscripts[$array_keys[0]]['ver']) . '</b></span>
								</div><br />';
            }
            echo '
							<p align="center">
								<input type="hidden" name="softsubmit" id="softsubmit" value="' . $l['softsubmit'] . '" />
								<input type="submit" name="softsubmitbut" class="flat-butt" id="softsubmitbut" value="' . $l['softsubmit'] . '" /><span id="show_txt" style="display:none;"></span>
							</p><br /><br />
									
							<input type="hidden" name="soft_status_key" id="soft_status_key" value="' . POSTval('soft_status_key', generateRandStr(32)) . '" />
							
							<center><b><a href="' . script_link($soft) . '" class="sai_head">' . $l['return'] . '</a></b></center><br /><br />
							
						</div><br /><!--end of bg class-->
					</form>
				</div>
				
				<div id="progress_bar" style="display: none; width: 100%;">
					<br />
					<div class="bg">
						<center>
							<div class="row sai_main_head" style="width:100%;" align="center">
								<div class="col-sm-5 col-xs-5" style="padding:0 10px 0 0; text-align:right;">
									<i class="fa sai-sync fa-2x" style="color:#00A0D2;"></i>
								</div>
								<div class="col-sm-7 col-xs-7" style="padding-top:10px; padding-left:0; text-align:left;">' . $l['prog_upgrading'] . $scripts[$array_keys[0]]['name'] . '</div>
							</div>
							<br />
							<font size="4" color="#222222" id="progress_txt" style="width: 100%;">' . $l['checking_data'] . '</font>
							<font style="font-size: 18px;font-weight: 400;color: #444444; width: 100%;" id="progress_percent">(0 %)</font><br /><br />
						</center>
						<table width="500" cellpadding="0" cellspacing="0" id="table_progress" border="0" align="center" height="28" style="border:1px solid #CCC; -moz-border-radius: 5px;
					-webkit-border-radius: 5px; border-radius: 5px;background-color:#efefef; width: 50%;">
							<tr>
								<td id="progress_color" width="1" style="background-image: url(' . $theme['images'] . 'bar.gif); -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px;"></td>
								<td id="progress_nocolor">&nbsp;</td>
							</tr>
						</table>
						<br /><center>' . $l['wait_note'] . '</center>
						<br /><br />
					</div><!--end of bg class-->
				</div><br /><br />';
        }
    } elseif (!empty($upgraded)) {
        $tmp_admiurl = $__settings['softurl'] . '/' . (!empty($softins['admin_folder']) ? $softins['admin_folder'] : $software['adminurl']);
        echo '
			<div class="bg">
				<div class="third_url"><h4>' . (!empty($setupcontinue) ? $l['setup_partial'] . '</h4><div id="setupcontinue_url" style="display:none;"></div>
				' . $l['finish_update'] . '<br />
				<a href="' . $__settings['softurl'] . '/' . $setupcontinue . '" target="_blank">' . $__settings['softurl'] . '/' . $setupcontinue . '</a></div><br />' : $l['congrats'] . '</h4>') . '<br />
				' . (!empty($setupcontinue) ? lang_vars($l['finish_up_sucess'], array($software['name'])) : $software['name'] . ' ' . $l['succesful']) . ' : <br />
				<a href="' . $__settings['softurl'] . '" target="_blank">' . $__settings['softurl'] . '</a>
				' . (!empty($software['adminurl']) ? '<br />' . $l['admin_url'] . ' : <a href="' . $tmp_admiurl . '" target="_blank">' . $tmp_admiurl . '</a>' : '') . '<br /><br />
				' . $l['enjoy'] . '<br /><br />
				' . (!empty($notes) ? $l['upgrade_notes'] . ' : <br /> 
				<div class="sai_notes">' . softparse($notes, $soft) . '</div><br /><br />' : '') . '
				' . $l['please_note'] . '<br /><br />
				' . $l['regards'] . ',<br />
				' . $l['softinstaller'] . '<br /><br />
				<center><b><a href="' . script_link($soft) . '&highlight=' . $softins['insid'] . '&postact=upgrade">' . $l['return'] . '</a></b></center><br /><br />';
        if (empty($globals['upgrade_tweet_off']) || empty($globals['lictype'])) {
            echo '
					<form method="get" action="http://twitter.com/intent/tweet" id="tweet" onsubmit="return dotweet(this);">
						<div class="panel panel-info" style="width:55%; margin:0 auto;">
							<div class="panel-heading" style="padding:5px;">
								<font size="+1"><b>' . $l['upgrade_tweet_sub'] . ' :</b></font>
							</div>
							<div class="panel-body">
								<div class="row">
									<div class="col-sm-10">
										<textarea name="text" cols="80" row="3" style="resize:none; width:100%;">' . loadtweetdata('upgrade_tweet', $l['upgrade_tweet']) . '</textarea>
									</div>
									<div class="col-sm-2 col-xs-2">
										<input type="submit" value="Tweet!" class="btn btn-info" onsubmit="return false;" id="twitter-btn" style="margin-top:20px;"/>
									</div>
								</div>
							</div>
						</div>
					</form>';
        }
        echo '
			</div><!--end of bg class--><!--PROC_DONE-->
			<br /><br /><br /><br />';
    }
    echo '
	</div>';
    softfooter();
}
Пример #6
0
function top14_theme()
{
    global $theme, $globals, $user, $l, $langs, $skins, $error, $saved, $categories, $iscripts, $updates_available, $allcatwise, $scripts, $cscripts;
    $top = array();
    foreach ($scripts as $k => $v) {
        if (empty($iscripts[$k])) {
            continue;
        }
        $top[$k] = $v['ratings'] * $v['votes'];
    }
    // Sorting according to top ratings
    arsort($top);
    //To fill up the scripts if less than 7 are selected by admin
    $ext_fill = array();
    $ext_fill = $top;
    if (file_exists($globals['path'] . '/conf/top_scripts.php')) {
        $top = unserialize(file_get_contents($globals['path'] . '/conf/top_scripts.php'));
    }
    // If Admin has checked Append scripts than only append the scripts. Otherwise Only Selected Scripts will be displayed.
    if (count($top) < 7 && !empty($globals['append_apps'])) {
        foreach ($ext_fill as $k => $v) {
            $top[$k] = $k;
        }
        array_unique($top);
    }
    //r_print($globals);
    if (!empty($globals['show_cscript_in_top'])) {
        //r_print($top_custom_list);
        foreach ($cscripts as $ck => $cv) {
            if (array_key_exists($ck, $iscripts)) {
                $top_custom[$ck] = $ck;
            }
        }
        $tmp_top = $top;
        // Do we need to add any other default scripts ?
        if (!empty($top_custom)) {
            $top = $top_custom;
        }
        if (!empty($tmp_top)) {
            $top += $tmp_top;
        }
    }
    foreach ($scripts as $k => $v) {
        // We have to remove the scripts which are not enabled AND yet coming from top_scripts.php (i.e. Admin have saved it from top scripts)
        if (!array_key_exists($k, $iscripts) && !empty($top[$k])) {
            unset($top[$k]);
        }
        if (empty($iscripts[$k]) || !empty($scripts[$k]['parent']) && !empty($iscripts[$scripts[$k]['parent']])) {
            continue;
        }
        $top[$k] = $v['ratings'] * $v['votes'];
    }
    //r_print($top);
    $updates_available = 0;
    foreach ($user['ins'] as $insid => $soft) {
        if (!empty($iscripts[$soft['sid']])) {
            if (is_upgradable($insid)) {
                $updates_available++;
            }
        }
    }
    $cat_image_path = 'themes/default/images/cats/';
    if ($globals['softpanel'] == 'directadmin') {
        $fullurl = 'CMD_PLUGINS/softaculous';
        $cat_image_path = 'images/themes/default/images/cats/';
    } elseif ($globals['softpanel'] == 'cpanel') {
        $fullurl = 'softaculous';
    } elseif ($globals['softpanel'] == 'plesk') {
        $fullurl = '/modules/softaculous';
    } else {
        $fullurl = 'http://localhost/ampps';
    }
    $cat_width = 24;
    $cat_height = 40;
    if ($globals['theme'] != 'default' && substr_count($_SERVER['REQUEST_URI'], 'paper_lantern') > 0) {
        $cat_image_path = 'themes/default/';
        if ($globals['softpanel'] == 'directadmin') {
            $fullurl = 'CMD_PLUGINS/softaculous';
            $cat_image_path = 'images/themes/default/';
        } elseif ($globals['softpanel'] == 'cpanel') {
            $fullurl = 'softaculous';
        } elseif ($globals['softpanel'] == 'plesk') {
            $fullurl = '/modules/softaculous';
        } else {
            $fullurl = 'http://localhost/ampps';
        }
        $cat_width = 90;
        $cat_height = 40;
    }
    $custome_width = optGET('width');
    $no_cat = !empty($globals['disable_cats']) ? $globals['disable_cats'] : optGET('nocat');
    $my_ins = !empty($globals['enable_myins']) ? $globals['enable_myins'] : optGET('noins');
    if ($globals['softpanel'] == 'plesk') {
        $width = '450px';
        $s_width = '455px';
    } else {
        $width = 'auto';
        $s_width = 'auto';
    }
    if (!empty($custome_width) && is_numeric($custome_width)) {
        $width = $custome_width . 'px';
        $s_width = $custome_width + 5 . 'px';
    }
    $str = '
<link rel="stylesheet" type="text/css" href="' . $fullurl . '/' . $cat_image_path . 'font-awesome.css?' . $GLOBALS['globals']['version'] . '" />
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="' . $fullurl . '/' . $cat_image_path . 'ie7.css?' . $GLOBALS['globals']['version'] . '">
<![endif]-->
<style type="text/css">
.top14catbg{
width:' . $cat_width . 'px;
height:' . $cat_height . 'px;
padding:5px;
margin-top:5px;
font-size:19px;
color:#348AC4;
}

#soft_div1{
font-size: 11px;
padding: 0px;
width:500px;
font-family: Verdana, Tahoma, Arial, "Trebuchet MS", "Times New Roman", Georgia, sans-serif, serif;
}

.softac_cat {
  vertical-align:middle;padding:5px;text-align:left;background-color: #DDD;
}

   
</style>';
    $url = $globals['mirror_images'];
    if ($globals['softpanel'] == 'directadmin') {
        $str .= '<img src="' . $fullurl . '/' . $theme['images'] . 'da.gif" align="left"/><br /><br /><br />
	<div style="margin-left:70px;margin-right:15px"><br /><br />';
    }
    if ($globals['softpanel'] == 'plesk') {
        $str .= '<center><img src="' . $fullurl . '/' . $theme['images'] . 'plesk.gif" /></center>';
    }
    if (!empty($updates_available)) {
        $str .= '<div style="background-color:#FAFBD9;width:auto;padding:7px;"><center>
	<a href="' . $fullurl . '/' . $globals['ind'] . 'act=installations&showupdates=true" alt="Updates" style="background-color: #FAFBD9;font-size:13px;padding:8px;text-decoration:none;"><img src="' . $fullurl . '/' . $theme['images'] . 'notice.gif" border="0" align="middle" /> &nbsp; ' . lang_vars($l['updates_available'], array($updates_available)) . '</a></center></div>';
    }
    // For Users installations
    if (!empty($my_ins)) {
        $str .= '<div class="softac_ins" style="vertical-align:middle;padding:5px;text-align:left;background-color: #EEE;width:' . $width . ';"><b>' . $l['my_installations'] . ' :</b></div>
		<table border="0" cellpadding="0" cellspacing="0" style="table-layout: fixed;" width="100%"><tr>
		<td width="15px" onmouseover="mousemove(\'softins_div\', event);" onmouseout="softstop(\'softins_div\', event);" align="center">
			<img src="' . $fullurl . '/' . $theme['images'] . 'move_left.png" alt="Left" border="0"/>
		</td>
		<td>
		<div style="overflow:hidden;display: block;width:' . $s_width . ';" id="softins_div" onclick="softstop(this.id, event);">
		<table border="0" cellpadding="7" cellspacing="3" style="table-layout:fixed;" width="100%"><tr>';
        // We want the new installations first
        $user_ins = array_reverse($user['ins']);
        foreach ($user_ins as $uk => $uv) {
            // We have to make some chnages as per the theme (i.e for x3 and paper_lantern)
            if (substr_count($_SERVER['REQUEST_URI'], 'paper_lantern') > 0) {
                $img_path = 'top15/48/' . $scripts[$uv['sid']]['softname'] . '.png';
                $td_width = 100;
                $td_height = 80;
            } else {
                $img_path = 'softimages/32/' . $uv['sid'] . '__logo.gif';
                $td_width = 50;
                $td_height = 50;
            }
            // custom scripts logos path
            if ($uv['sid'] > 10000) {
                if (substr_count($_SERVER['REQUEST_URI'], 'paper_lantern') > 0 && file_exists($theme['images'] . 'topscripts/48/' . $uv['sid'] . '__logo.gif')) {
                    $cscript_img_path = 'softaculous/' . $theme['images'] . 'topscripts/48/' . $uv['sid'] . '__logo.gif"';
                } elseif (file_exists($theme['images'] . 'topscripts/32/' . $uv['sid'] . '__logo.gif')) {
                    $cscript_img_path = 'softaculous/' . $theme['images'] . 'topscripts/32/' . $uv['sid'] . '__logo.gif"';
                } else {
                    $cscript_img_path = $fullurl . '/' . $theme['images'] . 'top14_custom_script.png"';
                }
            }
            $_site_name = @unserialize($uv['site_name']);
            $str .= '<td width="' . $td_width . '" valign="middle" align="center" height="' . $td_height . '"><a href="' . $fullurl . '/' . $globals['ind'] . 'act=' . ($iscripts[$uv['sid']]['type'] == 'perl' ? 'perl' : ($iscripts[$uv['sid']]['type'] == 'js' ? 'js' : 'software')) . '&soft=' . $uv['sid'] . '" style="text-decoration:none;"><img src="' . ($uv['sid'] > 10000 ? $cscript_img_path : $url . $img_path . '"') . ' border="0" /><br />' . (!empty($uv['site_name']) ? !empty($_site_name) ? $_site_name : $uv['site_name'] : $iscripts[$uv['sid']]['name']) . '</a></td>';
        }
        $str .= '</tr></table></div></td>
		<td width="15px" onmouseover="mousemove(\'softins_div\', event);" onmouseout="softstop(\'softins_div\', event);" align="center">
		<img src="' . $fullurl . '/' . $theme['images'] . 'move_right.png" alt="Right" border="0"/>
		</td>
		</tr></table>';
    }
    // End of $my_ins
    if (empty($no_cat) || !empty($my_ins)) {
        $str .= '<div class="softac_cat" style="vertical-align:middle;padding:5px;text-align:left;background-color: #EEE;width:' . $width . ';"><b>' . $l['script'] . ':</b></div>';
    }
    $str .= '<table border="0" cellpadding="0" cellspacing="0" style="table-layout: fixed;" width="100%"><tr>
		<td width="15px" onmouseover="mousemove(\'script_div\', event);" onmouseout="softstop(\'script_div\', event);" align="center">
			<img src="' . $fullurl . '/' . $theme['images'] . 'move_left.png" alt="Left" border="0"/>
		</td>
		<td>
		<div style="overflow:hidden;display: block;width:' . $s_width . ';" id="script_div" onclick="softstop(this.id, event);">
		<table border="0" cellpadding="7" cellspacing="3" id="script_table" style="table-layout: fixed;" width="100%"><tr>';
    $i = 1;
    foreach ($top as $k => $v) {
        if (empty($iscripts[$k])) {
            continue;
        }
        // We have to make some chnages as per the theme (i.e for x3 and paper_lantern)
        if (substr_count($_SERVER['REQUEST_URI'], 'paper_lantern') > 0) {
            $img_path = 'top15/48/' . $scripts[$k]['softname'] . '.png';
            $td_width = 100;
            $td_height = 80;
        } else {
            $img_path = 'softimages/32/' . $k . '__logo.gif';
            $td_width = 50;
            $td_height = 50;
        }
        // custom scripts logos path
        if ($k > 10000) {
            if (substr_count($_SERVER['REQUEST_URI'], 'paper_lantern') > 0 && file_exists($theme['images'] . 'topscripts/48/' . $k . '__logo.gif')) {
                $cscript_img_path = 'softaculous/' . $theme['images'] . 'topscripts/48/' . $k . '__logo.gif"';
            } elseif (file_exists($theme['images'] . 'topscripts/32/' . $k . '__logo.gif')) {
                $cscript_img_path = 'softaculous/' . $theme['images'] . 'topscripts/32/' . $k . '__logo.gif"';
            } else {
                $cscript_img_path = $fullurl . '/' . $theme['images'] . 'top14_custom_script.png"';
            }
        }
        $str .= '<td width="' . $td_width . '" valign="middle" align="center" height="' . $td_height . '"><a href="' . $fullurl . '/' . $globals['ind'] . 'act=' . ($iscripts[$k]['type'] == 'perl' ? 'perl' : ($iscripts[$v]['type'] == 'js' ? 'js' : 'software')) . '&soft=' . $k . '" style="text-decoration:none;"><img src="' . ($k > 10000 ? $cscript_img_path : $url . $img_path . '"') . ' border="0" /><br />' . $iscripts[$k]['name'] . '</a></td>';
        $i++;
        if ($i == 15 && !empty($globals['append_apps'])) {
            break;
        } elseif (!file_exists($globals['path'] . '/conf/top_scripts.php') && empty($globals['append_apps']) && $i == 15) {
            // This is the DEFAULT case if scripts are not selected AND append_apps is not checked then display 14 scripts by default.
            break;
        }
    }
    $str .= '</tr></table></div></td>
		<td width="15px" onmouseover="mousemove(\'script_div\', event);" onmouseout="softstop(\'script_div\', event);" align="center">
		<img src="' . $fullurl . '/' . $theme['images'] . 'move_right.png" alt="Right" border="0"/>
		</td>
		</tr></table>';
    // Disable category
    if (empty($no_cat)) {
        $str .= '<div class="softac_cat" style="vertical-align:middle;padding:5px;text-align:left;background-color: #EEE;width:' . $width . ';"><b>' . $l['category'] . ' :</b></div>
		<table border="0" cellpadding="0" cellspacing="0" style="table-layout: fixed;" width="100%"><tr>
		<td width="15px" onmouseover="mousemove(\'softcat_div\', event);" onmouseout="softstop(\'softcat_div\', event);" align="center">
			<img src="' . $fullurl . '/' . $theme['images'] . 'move_left.png" alt="Left" border="0"/>
		</td>
		<td>
		<div style="overflow:hidden;display: block;width:' . $s_width . ';" id="softcat_div" onclick="softstop(this.id, event);">
		<table border="0" cellpadding="7" cellspacing="0" style="table-layout:fixed;"><tr>';
        foreach ($allcatwise as $type => $cats) {
            foreach ($cats as $k => $v) {
                $str .= ' <td width="' . $td_width . '" valign="top" align="center"><a href="' . $fullurl . '/' . $globals['index'] . 'act=listsoftwares&cat=' . $k . '" style="text-decoration:none;" class="desc">' . (substr_count($_SERVER['REQUEST_URI'], 'paper_lantern') > 0 ? '<div class="top14catbg"><i class="fa sai-' . $k . ' fa-2x"></i></div>' : '<img src="' . $fullurl . '/' . $cat_image_path . $type . '_' . $k . '.gif" title="' . strtoupper($type) . ' ' . strtoupper($k) . '" border="0" >') . '<br />' . $l['cat_' . $type . '_' . $k] . '</a></td>';
            }
        }
        $str .= '</tr></table></div></td>
		<td width="15px" onmouseover="mousemove(\'softcat_div\', event);" onmouseout="softstop(\'softcat_div\', event);" align="center">
		<img src="' . $fullurl . '/' . $theme['images'] . 'move_right.png" alt="Right" border="0"/>
		</td>
		</tr></table>';
    }
    // End of $no_cat
    // If its Dirctadmin than Closing the DIV
    if ($globals['softpanel'] == 'directadmin') {
        $str .= '</div>';
    }
    echo 'var softOffsets = function(e){
	e = e || window.event;
	 
	var
	//cache document variables
	_d = document, _dBody = _d.body, _dDocEl = _d.documentElement, _o = null,
	 
	//calculate scroll values
	_scroll_left = _dDocEl.scrollLeft ? _dDocEl.scrollLeft : 0 + _dBody.scrollLeft ? _dBody.scrollLeft : 0,
	_scroll_top = _dDocEl.scrollTop ? _dDocEl.scrollTop : 0 + _dBody.scrollTop ? _dBody.scrollTop : 0,
	 
	
	window_pos = {
	_x: (e.pageX || e.clientX) + _scroll_left, _y: (e.pageY || e.clientY) + _scroll_top
	},
	 
	
	viewport_pos = {
	_x: (e.pageX || e.clientX), _y: (e.pageY || e.clientY)
	},
	 
	
	_console = function(o, type) {
	o = (typeof o === "object") ? o : _d.getElementById(o);
	o.innerHTML = type + " = [ " +
	" X: " + ((type === "viewport") ? viewport_pos._x : window_pos._x) +
	" Y: " + ((type === "viewport") ? viewport_pos._y : window_pos._y) +
	" ] Foo: " + Math.random()
	};
	 
	return {
	ViewPortX: viewport_pos._x,
	ViewPortY: viewport_pos._y,
	 
	WindowX: window_pos._x,
	WindowY: window_pos._y,
	 
	ViewPort: [viewport_pos._x, viewport_pos._y],
	Window: [window_pos._x, window_pos._y],
	 
	ToString: _console
	};
};

//Finds the position of the element
function findelpos(ele){
	var curleft = 0;
	var curtop = 0;
	if(ele.offsetParent){
		while(1){
			curleft += ele.offsetLeft;
			curtop += ele.offsetTop;
			if(!ele.offsetParent){
				break;
			}
			ele = ele.offsetParent;
		}
	}else if(ele.x){
		curleft += ele.x;
		curtop += ele.y;
	}
	return [curleft,curtop];
};

function mousemove(id, e){

	if(typeof softac[id+"left"] == "undefined"){
		softac[id+"right"] = "";
		softac[id+"left"] = "";
		softac[id+"entered"] = false;
	}
	
	if(softac[id+"entered"] == true){
		return false;
	}
	
	softac[id+"entered"] = true;
	
	var ele = document.getElementById(id);
	var mouse = softOffsets(e);
	mouse[0] = mouse.ViewPortX;	
	softac[id+"elpos"] = findelpos(ele);	
	softac[id+"menuwidth"] = ele.offsetWidth;	
	softac[id+"leftbound"] =((softac[id+"menuwidth"]-20)/2) + softac[id+"elpos"][0];
	softac[id+"rightbound"] =((softac[id+"menuwidth"]+20)/2) + softac[id+"elpos"][0];
	
	//alert(softac[id+"leftbound"]+" "+softac[id+"rightbound"]+" "+mouse[0]);	
	//document.getElementById("aaa").innerHTML = mouse[0]+"<br />"+document.getElementById("aaa").innerHTML;
	
	if (mouse[0]>softac[id+"rightbound"]){
		softLeft(id);
	}else if (mouse[0]<softac[id+"leftbound"]){
		softRight(id);
	}else{
		softstop(id, e);
	}
}
	
var softac = new Object();

function softLeft(id){
	clearTimeout(softac[id+"right"]);
	document.getElementById(id).scrollLeft += 1;
	softac[id+"right"] = setTimeout("softLeft(\'"+id+"\')",10);
};

function softRight(id){	
	clearTimeout(softac[id+"left"]);
	document.getElementById(id).scrollLeft -= 1;//alert(document.getElementById(id).scrollLeft);return;
	softac[id+"left"] = setTimeout("softRight(\'"+id+"\')",10);
};

function softstop(id, e){	
	clearTimeout(softac[id+"right"]); 
	clearTimeout(softac[id+"left"]);
	softac[id+"entered"] = false;
};';
    // cPanels Notice section code
    $notice = '<div style="width:195px;padding:7px;height:50px"><center>
			<a href="' . $fullurl . '/' . $globals['ind'] . 'act=installations&showupdates=true" alt="Updates" style="font-size:13px;padding:3px;text-decoration:none;"><img src="' . $fullurl . '/' . $theme['images'] . 'softaculous.gif" border="0" align="middle" height="30px" width="100px"/> <br />
&nbsp; ' . lang_vars($l['updates_available_notice'], array($updates_available)) . '</a></center></div>';
    echo 'var soft_html = \'' . str_replace(array('\'', "\n", "\r"), array('\\\'', '\'+"\\n"+\'', '\'+"\\n"+\''), $str) . '\';
';
    if ($globals['softpanel'] == 'directadmin') {
        echo 'document.getElementById("soft_div1").innerHTML = soft_html;';
    } elseif ($globals['softpanel'] == 'plesk') {
        echo 'document.getElementById("secondary").innerHTML = "<div class=\'applications-dashboard-box\'>" + soft_html+ "</div>"+document.getElementById("secondary").innerHTML;';
    } else {
        if (!empty($globals['show_top_scripts'])) {
            echo 'document.getElementById("soft_div-body").innerHTML = soft_html;';
        }
        if (!empty($globals['show_in_notice']) && $updates_available > 0) {
            echo 'var soft_notice = \'' . str_replace(array('\'', "\n", "\r"), array('\\\'', '\'+"\\n"+\'', '\'+"\\n"+\''), $notice) . '\';
			document.getElementById("noticeboard").innerHTML += soft_notice;';
        }
    }
}
Пример #7
0
function java_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error, $scripts, $allcatwise;
    global $software, $soft, $info, $settings, $init_tab, $dbtype, $dbs, $installed, $__settings, $setupcontinue, $installations, $notes, $cron, $datadir, $ajaxdb, $ajaxdbexists, $overwrite_option, $protocols, $nopackage, $www, $ajaxhttpsexists, $ajaxhttps, $new_insid;
    if (optGET('notify')) {
        get_softaculous_file('http://www.softaculous.com/notifyversion.php?softid="' . $soft . '"');
        echo 1;
        return true;
    }
    if (optGET('ajaxdownload') && !empty($nopackage)) {
        // Try to download the package
        if (method_exists($softpanel, 'updatesoftwares')) {
            $softpanel->updatesoftwares($soft, 0, 0, 1);
            echo 1;
            return true;
        }
        // False call
        echo 0;
        return false;
    }
    // Give the staus
    if (optGET('ajaxstatus')) {
        $_status = soft_progress(optGET('ajaxstatus'));
        $tmp_status = unserialize($_status[1]);
        $_status[1] = $tmp_status['current_status'];
        if (!empty($_status)) {
            echo implode('|', $_status);
            return true;
        }
        // False call
        echo 0;
        return false;
    }
    if (!empty($ajaxdb)) {
        echo $ajaxdbexists;
        return true;
    }
    if (!empty($ajaxhttps)) {
        echo $ajaxhttpsexists;
        return true;
    }
    // Auto Installation responses
    if (isset($_GET['autoinstall'])) {
        // Installed successfully
        if (!empty($installed)) {
            echo 'installed';
            return true;
        }
        // Are there errors
        if (!empty($error)) {
            echo serialize($error);
            return false;
        }
    }
    //First add the installation info
    if (empty($installed)) {
        $random_username = true;
        // This is to see if a script has predefined username and cannot be changed
        foreach ($settings as $ik => $iv) {
            if ($ik == 'hidden') {
                continue;
            }
            foreach ($iv as $ikk => $ivv) {
                if ($ikk == 'admin_username' && preg_match('/disabled=\\"disabled\\"/ie', $ivv['tag'])) {
                    $random_username = false;
                }
            }
        }
        $info['install'] = '<div id="fadeout_div"><form accept-charset="' . $globals['charset'] . '" name="installsoftware" method="post" action="" onsubmit="return checkform();" id="installsoftware">

' . error_handle($error, "100%", 0, 1) . '

<script language="javascript" type="text/javascript"><!-- // --><![CDATA[

function toggle_advoptions(){
	if ($("#advoptions").is(":hidden")){
		$("#advoptions").slideDown("slow");
		$("#advoptions_toggle_plus").attr("src", "' . $theme['images'] . 'minus_new.gif");
	}
	else{
		$("#advoptions").slideUp("slow");
		$("#advoptions_toggle_plus").attr("src", "' . $theme['images'] . 'plus_new.gif");
	}
}

function plus_onmouseover(){
	$("#plus").attr("src", "' . $theme['images'] . 'plus_hover.gif");
}

function plus_onmouseout(){
	$("#plus").attr("src", "' . $theme['images'] . 'plus.gif");
}

function display_pass_strength(score, per){
	
	var lang;
	//disp_per = $("#pass-strength-hidden").val();
	
	if(typeof per == "undefined") per = 0;
	
	if(score == "bad") lang = "' . $l['bad'] . '";
	if(score == "good") lang = "' . $l['good'] . '";
	if(score == "strong") lang = "' . $l['strong'] . '";
	if(score == "short") lang = "' . $l['short'] . '";
	if(score == "strength_indicator") lang = "' . $l['strength_indicator'] . '";
	
	$("#pass-strength-result").addClass(score).html( lang+" ("+per+"/100)" );
}

function checkform(dosubmit){
	
	// If admin has set the password strength than only we will check for it.
	' . (!empty($globals['pass_strength']) ? '
	//alert($("#pass-strength-hidden").val());
	if(parseInt($("#pass-strength-hidden").val()) < ' . $globals['pass_strength'] . '){
		alert("' . $l['err_pass_strength'] . '"+' . $globals['pass_strength'] . ');
		return false;
	}' : '') . '
	
	try{
		if(!formcheck()){
			return false;
		}
	}catch(e){
		//Do nothing
	}
	$_("softsubmitbut").disabled = true;	
	
	if(!get_package()){
		return false;
	}
	
	if(useprog){
		
		// Send a request to check the status
		progressbar.start();
		
		// Return false so that the form is not submitted
		return false;
	
	// This is OLD School !
	}else{		
		if(dosubmit == 1){			
			$_("installsoftware").submit();	
		}
		show_msg("' . $l['installing'] . '");
	}
	
	return true;
	
};

var progressbar = {
	timer: 0,
	total_width: 0,	
	status_key: "",
	synctimer: 0,
	fadeout_div: "#fadeout_div",
	win_div: "#install_win",
	progress_div: "#progress_bar",
	formid: "#installsoftware",
	frequency: 8000,
	
	current: function(){
		try{
			var tmp_cur = Math.round(parseInt($_("progress_color").width)/parseInt($_("table_progress").width)*100);
			if(tmp_cur > 100){
				tmp_cur = 99;
			}
			return tmp_cur;
		}catch(e){
			return -1;	
		}
	},
	
	reset: function(){ try{
		clearTimeout(this.timer);
		$_("progress_color").width = 1;
	}catch(e){ }},
	
	move: function(dest, speed, todo){ try{
		var cur = this.current();
		if(cur < 0){
			clearTimeout(this.timer);
			return false;
		}
		var cent = cur + 1;
		var new_width = cent/100*this.total_width;
		if(new_width < 1){
			new_width = 1;
		}
		//alert(new_width+" "+dest+" "+cent);
		
		$_("progress_color").width = new_width;
		$_("progress_percent").innerHTML = "("+cent+" %)";
		
		if(cent < dest){
			this.timer = setTimeout("progressbar.move("+dest+", "+speed+")", speed);
		}else{
			eval(todo);	
		}
	}catch(e){ }},
	
	text: function(txt){ try{
		$_("progress_txt").innerHTML = txt;
	}catch(e){ }},
	
	sync: function(){
		if(progressbar.status_key.length < 2){
			return false;
		}
		$.ajax({
			url: window.location+"&ajaxstatus="+progressbar.status_key+"&random="+Math.random(),
			type: "GET",
			success: function(data){
				if(data == 0) return false;
				var tmp = data.split("|");
				var cur = progressbar.current();
				tmp[2] = (3000/(tmp[0]-cur));
				//alert(tmp);
				if(tmp[0] > cur){
					if(parseInt(tmp[2]) == 0){
						tmp[2] = 800;
					}
					progressbar.move(tmp[0], tmp[2]);
				}
				progressbar.text(tmp[1]);
				progressbar.synctimer = setTimeout("progressbar.sync()", progressbar.frequency);
			}
		});
	},
	
	sync_abort: function(){
		clearTimeout(this.synctimer);
	},
	
	start: function(){ try{
		this.post();
		this.reset();
		this.total_width = parseInt($_("table_progress").width);
		this.move(95, 800);
		this.status_key = $("#soft_status_key").attr("value");
		this.sync();
	}catch(e){ }},
	
	post: function(){
		
		// Scroll to the Top and show the progress bar
		goto_top();
		$(progressbar.fadeout_div).fadeOut(500, 
			function(){
				$(progressbar.progress_div).fadeOut(1);
				$(progressbar.progress_div).fadeIn(500);
			}
		);
		
		$.ajax({
			url: window.location+"&jsnohf=1",
			type: "POST",
			data: $(progressbar.formid).serialize(),
			complete: function( jqXHR, status, responseText ) {
				
				progressbar.sync_abort();
				
				// Store the response as specified by the jqXHR object
				responseText = jqXHR.responseText;
				
				try{
					//alert(responseText);
					if(responseText.match(/\\<\\!\\-\\-PROC_DONE\\-\\-\\>/gi)){
						progressbar.text("' . addslashes($l['finishing_process']) . '");
						progressbar.move(99, 10, "$(progressbar.progress_div).fadeOut(1)");
					}else{
						progressbar.reset();
					}
				}catch(e){ }
				
				if ( jqXHR.isResolved() ) {
				
					// #4825: Get the actual response in case
					// a dataFilter is present in ajaxSettings
					jqXHR.done(function( r ) {
						responseText = r;
					});
			
					// Create a dummy div to hold the results
					// inject the contents of the document in, removing the scripts
					// to avoid any "Permission Denied" errors in IE
					var newhtml = jQuery("<div>").append(responseText).find(progressbar.win_div).html();
					
					$(progressbar.win_div).animate({opacity: 0}, 1000, "", function(){
						$(progressbar.win_div).html(newhtml);
						show_backup();
						check_pass_strength();
					}).delay(50).animate({opacity: 1}, 500);
					
					//alert(newhtml);
					
				}else{
					alert("Oops ... the connection was lost");
				}
			}
		});
	}
};

function show_msg(msg){	
	$_("show_txt").innerHTML = "<br /><br /> &nbsp; "+msg+" &nbsp; <img src=\\"' . $theme['images'] . 'progress.gif\\" />";
	$_("show_txt").style.display = "";
}

// Is the package there ?
var nopackage = ' . (empty($nopackage) ? 0 : 1) . ';

// Use the Progress Bar ?
var useprog = 1;
try{
	if(BrowserDetect.browser.toLowerCase() == "safari" && BrowserDetect.version.toString().substr(0, 1) == "3"){
		useprog = 0;
	}
}catch(e){ }

function get_package(){	
	if(nopackage){
		
		show_msg("' . $l['downloading'] . '");
		
		try{		
			AJAX("' . $globals['index'] . 'act=java&soft=' . $soft . '&ajaxdownload=1&random="+Math.random(), "get_package_handle(re)");
		}catch(e){ }
		
		return false;
	}else{
		$_("show_txt").style.display = "none";
		return true;
	}
};

function get_package_handle(resp){
	nopackage = 0;
	show_msg("' . $l['installing'] . '");
	checkform(1);
};

softemail = new Object();
function softmail(){
	try{
		var sofdom = "softdomain";
		for(x in softemail){
			if(softemail[x] == true) continue;
			var temp = $_(x).value.split("@");
			if($_(sofdom).value.indexOf("/") > 0){
				var dom_value = $_(sofdom).value.substring(0, $_(sofdom).value.indexOf("/"));
			}else{
				var dom_value = $_(sofdom).value;
			}
			$_(x).value = temp[0] + "@" + dom_value;
		}
	}catch(e){
		return false;
	}
};

function checkhttps(proto_id, softdomain_id, alrt){
	try{
		var id = $_(proto_id);
		var proto = id.options[id.selectedIndex].text;
	
		$("#checkhttps_wait").css("display","inline-block");
		if(proto.indexOf("https") !== -1){
		
			 $.ajax({
				type: "POST",
				url: "' . $globals['index'] . 'act=java&soft=' . $soft . '&checkhttps="+encodeURIComponent(proto+$_(softdomain_id).value),
				timeout:10000,
				// Checking for error
				success: function(data){
					$("#checkhttps_wait").css("display","none");
					is_https(data);
				},
				error: function(jqXHR, status, e) {
					$("#checkhttps_wait").css("display","none");
					is_https(e);
					return false;
				}
			}); 
			
			//AJAX("' . $globals['index'] . 'act=software&soft=' . $soft . '&checkhttps="+id.options[id.selectedIndex].text+$_(softdomain_id).value, "is_https(re)");
		}else{
			$("#checkhttps_wait").css("display","none");
			is_https("true");
		}
		if(alrt == true){
			alert(proto+$_(softdomain_id).value);
		}
	}catch(e){
		//
	}
	return true;
};

function is_https(re){
	try{
		httpserror = "";
		
		//Check if it exists
		if(re !== "true"){
			httpserror = "' . $l['no_https'] . '";
		}
		if(httpserror != ""){
			$_("httpserror").style.display = "block";
			$_("httpserror").innerHTML = httpserror;
			return false;
		}else{
			$_("httpserror").style.display = "none";
		}
		
	}catch(e){
		//
	}
	return true;
};

function prepend_prefix(prefix){
	
	// Decide prefix USERNAME, DOMAIN OR USER DEFINED
	if(prefix != "" && prefix == "username") prefix = "' . $softpanel->user['name'] . '";
	if(prefix != "" && prefix == "domain") prefix = "' . current(array_keys($softpanel->domainroots)) . '";
	if(prefix != "" && prefix != "domain" && prefix != "username");
	
	// APPEND OLD USERNAME OR DEFAULT USERNAME
	var old = $_("admin_username").value
	temp = $_("admin_username").value.split("-");
	if (typeof temp[1] == \'string\' || temp[1] instanceof String){
		$_("admin_username").value = prefix+"-"+temp[1];
	}else{
		$_("admin_username").value = prefix+"-"+old;
	}
}

function change_admin_prefix(domain){
	var admin_prefix = \'' . $globals['admin_prefix'] . '\';
	var random_username = \'' . (!empty($random_username) ? 'true' : '') . '\';
	var empty_username = \'' . (empty($globals['empty_username']) ? 'true' : '') . '\';
	var gl_random_username = \'' . (empty($globals['random_username']) ? 'true' : '') . '\';
	if(admin_prefix == "domain" && random_username == "true" && empty_username == "true" && gl_random_username == "true"){
		prepend_prefix(domain);
	}
}
  
// show/hide backup options
function show_backup(){

	var auto_backup = $("#auto_backup").val();
	
	if(auto_backup == 0){
		$("#auto_backup_rotation").attr("disabled", true);
	}else{
		$("#auto_backup_rotation").attr("disabled", false);
	}
	
	return true;
};

' . (!empty($_POST) ? '' : 'addonload(\'softmail();show_backup();\');');
        if (!empty($dbtype)) {
            $info['install'] .= 'function checkdbname(id, alrt){
	try{		
		AJAX("' . $globals['index'] . 'act=java&soft=' . $soft . '&checkdbexists="+$_(id).value, "dbexists(\'"+id+"\', "+alrt+", re)");	
	}catch(e){
		//
	}
	return true;
};

function dbexists(id, alrt, re){
	try{
		
		dberror = "";
		
		//Is the length fine
		if($_(id).value.length > 7){
			dberror = "' . $l['db_name_long'] . '";
		}
		
		//There should be only alphanumeric characters
		if(/[^a-zA-Z0-9]/.test($_(id).value)){
			dberror = "' . $l['db_alpha_num'] . '";
		}
		
		//Check if it exists
		if(re == "true"){
			dberror = "' . $l['database_exists'] . '";
		}
		
		if(dberror != ""){
			$_(id+"error").style.display = "block";
			$_(id+"error").innerHTML = dberror;
			if(alrt == true){
				alert(dberror);
			}
			return false;
		}else{
			$_(id+"error").style.display = "none";
		}
		
	}catch(e){
		//
	}
	return true;
};';
        }
        //End of if($dbtype)
        $info['install'] .= '// ]]></script>';
        if (empty($globals['lictype']) && !empty($scripts[$soft]['force_scripts'])) {
            $info['install'] .= '<center class="sai_anotice">' . lang_vars($l['not_in_free'], array($software['name'])) . (!webuzo() ? '&nbsp;&nbsp;' . $l['notify_admin'] : '') . '</center><br />';
        }
        $info['install'] .= '
<table width="100%" cellpadding="8" cellspacing="0" border="0" class="sai_divroundshad">
<tr>
<td class="sai_heading_full" colspan="2">' . $l['setup'] . '</td>
</tr>';
        if (empty($softpanel->noprotocol) && empty($globals['hide_protocol'])) {
            $info['install'] .= '<tr>
<td>
<span class="sai_head">' . $l['choose_protocol'] . '</span><br />
<span class="sai_exp">' . $l['choose_protocol_exp'] . '</span>
</td>
<td valign="top">
<select name="softproto" id="softproto" onblur="checkhttps(\'softproto\', \'softdomain\', false)">';
            foreach ($protocols as $k => $v) {
                $info['install'] .= '<option value="' . $k . '" ' . (!empty($_POST['softproto']) && $_POST['softproto'] == $k ? 'selected="selected"' : '') . '>' . $v . '</option>';
            }
            $info['install'] .= '</select><div style="display:none;" id="checkhttps_wait">&nbsp;&nbsp;<img src="' . $theme['images'] . 'progress.gif" alt="please wait.."></div><br />
<span id="httpserror" style="background: #FDB3B3; display:none; width:200px;"></span>
</td>
</tr>';
        }
        $info['install'] .= '<tr>
<td width="50%">
<span class="sai_head">' . $l['choose_domain'] . '</span><br />
<span class="sai_exp">' . $l['choose_domain_exp'] . '</span>
</td>
<td>
<select name="softdomain" id="softdomain" onchange="softmail();change_admin_prefix(this.value);" onblur="checkhttps(\'softproto\', \'softdomain\', false)">';
        if (!empty($globals['blank_domain'])) {
            $info['install'] .= '<option value="" ' . (empty($_POST['softdomain']) ? 'selected="selected"' : '') . '>(' . $l['select_domain'] . ')</option>';
        }
        foreach ($softpanel->webroots as $domain => $dompath) {
            $info['install'] .= '<option value="' . $domain . '" ' . (!empty($_POST['softdomain']) && $_POST['softdomain'] == $domain ? 'selected="selected"' : '') . '>' . $domain . '</option>';
        }
        $info['install'] .= '</select>
</td>
</tr>
<tr>
<td>
<span class="sai_head">' . $l['in_directory'] . '</span><br />
<span class="sai_exp">' . $l['in_directory_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="softdirectory" id="softdirectory" size="30" value="' . POSTval('softdirectory', !empty($globals['no_prefill']) ? '' : $software['softname']) . '" />
</td>
</tr>';
        // A data Directory ?
        if (!empty($datadir)) {
            $info['install'] .= '<tr>
<td>
<span class="sai_head">' . $l['datadir'] . '</span><br />
<span class="sai_exp">' . $l['datadir_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="datadir" id="datadir" size="30" value="' . POSTval('datadir', $datadir) . '" />
</td>
</tr>';
        }
        if (!empty($dbtype)) {
            $dbname = mysqldbname($software['softname']);
            if (method_exists($softpanel, 'mysqldbname')) {
                $dbname = $softpanel->mysqldbname();
            }
            if (empty($dbtype) || aefer()) {
                $info['install'] .= '
<tr>
<td>
<span class="sai_head">' . $l['database_name'] . '</span><br />
<span class="sai_exp">' . $l['database_name_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="softdb" id="softdb" size="30" value="' . POSTval('softdb', $dbname) . '" onblur="checkdbname(\'softdb\', false)" /><br />
<span id="softdberror" style="background: #FDB3B3; display:none; width:200px;"></span>
</td>
</tr>';
            }
        }
        // Are there any cron jobs
        if (!empty($cron)) {
            $info['install'] .= '<tr>
<td>
<span class="sai_head">' . $l['cron_job'] . '</span><br />
<span class="sai_exp">' . $l['cron_job_exp'] . '</span>
</td>
<td valign="top">
	<table width="100%" cellpadding="2" cellspacing="1">
		<tr>
			<td>' . $l['cron_min'] . '</td>
			<td>' . $l['cron_hour'] . '</td>
			<td>' . $l['cron_day'] . '</td>
			<td>' . $l['cron_month'] . '</td>
			<td>' . $l['cron_weekday'] . '</td>
		</tr>
		<tr>
			<td><input type="text" name="cron_min" id="cron_min" size="2" value="' . POSTval('cron_min', $cron['min']) . '" /></td>
			<td><input type="text" name="cron_hour" id="cron_hour" size="2" value="' . POSTval('cron_hour', $cron['hour']) . '" /></td>
			<td><input type="text" name="cron_day" id="cron_day" size="2" value="' . POSTval('cron_day', $cron['day']) . '" /></td>
			<td><input type="text" name="cron_month" id="cron_month" size="2" value="' . POSTval('cron_month', $cron['month']) . '" /></td>
			<td><input type="text" name="cron_weekday" id="cron_weekday" size="2" value="' . POSTval('cron_weekday', $cron['weekday']) . '" /></td>
		</tr>
	</table>
</td>
</tr>';
        }
        if (!empty($overwrite_option)) {
            $info['install'] .= '<tr>
<td>
<span class="sai_head">' . $l['overwrite'] . '</span>
</td>
<td valign="top">
	<input type="checkbox" name="overwrite_existing" id="overwrite_existing" />
</td>
</tr>';
        }
        $info['install'] .= '</table>';
        if (!empty($settings)) {
            if (file_exists($software['path'] . '/install.js')) {
                $info['install'] .= '<script language="javascript" type="text/javascript"><!--// --><![CDATA[';
                $info['install'] .= @parselanguages(str_replace('$(', '$_(', implode('', file($software['path'] . '/install.js'))));
                $info['install'] .= '// ]]></script>';
            }
            foreach ($settings as $group => $sets) {
                if ($group == 'hidden' || empty($sets)) {
                    continue;
                }
                $info['install'] .= '<br />
<table width="100%" cellpadding="8" cellspacing="0" border="0" class="sai_divroundshad">
<tr>
<td class="sai_heading_full" colspan="2">' . $group . '</td>
</tr>';
                foreach ($sets as $sk => $sv) {
                    $info['install'] .= '<tr>
<td width="50%">
<span class="sai_head">' . $sv['head'] . '</span>
' . (empty($sv['exp']) ? '' : '<br /><span class="sai_exp">' . $sv['exp'] . '</span>') . '
</td>
<td valign="top">
' . (preg_match('/admin_pass|softpass/is', $sv['tag']) ? preg_replace('/>|\\/>/is', ' onkeyup="check_pass_strength();">', $sv['tag']) : $sv['tag']) . '
' . (preg_match('/softmail/is', $sv['tag']) ? '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
softemail["' . $sk . '"] = false;
//Add an event handler
$_("' . $sk . '").onkeydown = function(){
	softemail["' . $sk . '"] = true;
}
// ]]></script>
' : '') . '
' . (preg_match('/admin_pass|softpass/is', $sv['tag']) ? '
<a href="javascript: void(0);" onclick="$_(\'' . $sk . '\').value=randstr(10, 1, ' . (!empty($globals['pass_strength']) ? $globals['pass_strength'] : 0) . ');check_pass_strength();return false;" title="' . $l['randpass'] . '"><img src="' . $theme['images'] . 'randpass.gif" /></a>
<div id="pass-strength-result" class="">' . $l['strength_indicator'] . '</div>' : '') . '
' . (preg_match('/admin_pass|softpass/is', $sv['tag']) && (!empty($softpanel->securepass) || !empty($globals['random_pass'])) ? '
<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
addonload(\'$_("' . $sk . '").value=randstr(10, 1, ' . (!empty($globals['pass_strength']) ? $globals['pass_strength'] : 0) . ');check_pass_strength();\');
// ]]></script>
' : '') . '
' . (preg_match('/admin_pass|softpass/is', $sv['tag']) && !empty($globals['empty_pass']) ? '
<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
addonload(\'$_("' . $sk . '").value="";\');
// ]]></script>
' : '') . '
' . (preg_match('/dbprefix/is', $sv['tag']) && !empty($globals['random_dbprefix']) ? '
<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
addonload(\'$_("' . $sk . '").value=randstr(3)+"_";\');
// ]]></script>
' : '') . '
' . (preg_match('/admin_username/is', $sv['tag']) && !empty($globals['random_username']) && !empty($random_username) ? '
<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
addonload(\'$_("' . $sk . '").value=randstr(5);\');
// ]]></script>
' : '') . '
' . (preg_match('/admin_username/is', $sv['tag']) && !empty($globals['empty_username']) && !empty($random_username) ? '
<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
addonload(\'$_("' . $sk . '").value="";\');
// ]]></script>
' : '') . '
' . (preg_match('/admin_username/is', $sv['tag']) && !empty($globals['admin_prefix']) && empty($globals['empty_username']) && empty($globals['random_username']) && !empty($random_username) ? '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
addonload(\'prepend_prefix("' . $globals['admin_prefix'] . '");\');
	// ]]></script>
' : '') . '
</td>
</tr>';
                }
                $info['install'] .= '</table>';
            }
            //The Hidden groups
            if (!empty($settings['hidden'])) {
                foreach ($settings['hidden'] as $sk => $sv) {
                    $info['install'] .= $sv['tag'] . '
' . (preg_match('/softmail/is', $sv['tag']) ? '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
softemail["' . $sk . '"] = false;
//Add an event handler
$_("' . $sk . '").onkeydown = function(){
	softemail["' . $sk . '"] = true;
}
// ]]></script>
' : '');
                }
            }
        }
        //End of if($settings)
        //Is it a SOFTCOPY, then Leave a NOTE
        if (!empty($setupcontinue)) {
            $info['install'] .= '<br />' . $l['softcopy_note'] . '<br /><br />';
        }
        // Advance option
        $info['install'] .= '
<br /><br />
<table width="100%" cellpadding="8" cellspacing="1" border="0" class="sai_divroundshad">
	<tr class="nohover">
		<td class="sai_heading_full" colspan="5" id="advoptions_toggle" onclick="toggle_advoptions(\'advoptions\');" class="sai_heading_full" style="cursor:pointer" ><img id="advoptions_toggle_plus" src="' . $theme['images'] . 'plus_new.gif" />&nbsp;&nbsp;' . $l['adv_option'] . '</td>
	</tr>
	<tr>
		<td>
			<div id="advoptions" style="display:none;">
			<table border="0" cellpadding="5" cellspacing="0" width="100%">
			' . (aefer() ? "" : '<tr>
					<td>
						<span class="sai_head">' . $l['database_name'] . '</span><br />
						<span class="sai_exp">' . $l['database_name_exp'] . '</span>
					</td>
					<td valign="top">
						<input type="text" name="softdb" id="softdb" size="30" value="' . POSTval('softdb', $dbname) . '" onblur="checkdbname(\'softdb\', false)" /><br />
						<span id="softdberror" style="background: #FDB3B3; display:none; width:200px;"></span>
					</td>
				</tr>') . '

				<tr>
					<td width="50%">
						<span class="sai_head">' . $l['disable_notify_update'] . '</span><br />
						<span class="sai_exp">' . $l['exp_disable_notify_update'] . '</span>
					</td>
					<td>
						<input type="checkbox" name="disable_notify_update" id="disable_notify_update" ' . POSTchecked('disable_notify_update') . ' />
					</td>	
				</tr>';
        // Auto backups option only if backups is not disabled and panel is not remote
        if (empty($globals['disable_backup_restore']) && empty($globals['disable_auto_backup']) && !aefer() && empty($softpanel->disable_auto_backup)) {
            $info['install'] .= '<tr>
		<td width="50%">
			<span class="sai_head">' . $l['auto_backup'] . '</span><br />
			<span class="sai_exp">' . $l['exp_auto_backup'] . '</span>
		</td>
		<td>
			<select name="auto_backup" id="auto_backup" onchange="show_backup();">
				<option value="0" ' . POSTselect('auto_backup', '0', 1) . '>' . $l['no_backup'] . '</option>' . (empty($globals['disable_auto_backup_daily']) ? '<option value="daily" ' . POSTselect('auto_backup', 'daily') . '>' . $l['daily'] . '</option>' : '') . (empty($globals['disable_auto_backup_weekly']) ? '<option value="weekly" ' . POSTselect('auto_backup', 'weekly') . '>' . $l['weekly'] . '</option>' : '') . (empty($globals['disable_auto_backup_monthly']) ? '<option value="monthly" ' . POSTselect('auto_backup', 'monthly') . '>' . $l['monthly'] . '</option>' : '') . '
			</select>
		</td>	
	</tr>
	<tr>
		<td width="50%">
			<span class="sai_head">' . $l['auto_backup_rotation'] . '</span><br />
			<span class="sai_exp">' . $l['exp_auto_backup_rotation'] . '</span>
		</td>
		<td>
			<select name="auto_backup_rotation" id="auto_backup_rotation">';
            for ($i = 0; $i <= 10; $i++) {
                // Do we have a limit from admin ?
                if (!empty($globals['auto_backup_limit']) && ($i > $globals['auto_backup_limit'] || $i == 0) || !empty($globals['max_backups']) && ($i > $globals['max_backups'] || $i == 0)) {
                    continue;
                }
                $info['install'] .= '<option value="' . $i . '" ' . POSTselect('auto_backup_rotation', $i, $i == 4 ? '1' : '0') . '>' . (empty($i) ? $l['unlimited'] : $i) . '</option>';
            }
            $info['install'] .= '</select>
		</td>	
	</tr>';
        }
        $info['install'] .= '</table>
</div>
</td>
</tr>
</table>';
        $info['install'] .= '<p align="center">
<input type="hidden" name="softsubmit" id="softsubmit" value="' . $l['softsubmit'] . '" />
<input type="hidden" name="pass-strength-hidden" id="pass-strength-hidden" value="" />
<input type="submit" name="softsubmitbut" id="softsubmitbut" value="' . $l['softsubmit'] . '" class="sai_graybluebut" /><span id="show_txt" style="display:none;"></span>
<br /><br /><br />
' . (empty($globals['off_email_link']) && empty($globals['off_install_mail']) ? $l['ins_emailto'] . ' : <input type="text" name="emailto" id="emailto" size="20" value="' . POSTval('emailto', '') . '" />' : '') . '
</p>
<input type="hidden" name="soft_status_key" id="soft_status_key" value="' . POSTval('soft_status_key', generateRandStr(32)) . '" />
</form></div>

<div id="progress_bar" style="height:125px; display: none;">
	<br />
	<center>
	<font size="4" color="#222222" id="progress_txt">' . $l['checking_data'] . '</font>
	<font style="font-size: 18px;font-weight: 400;color: #444444;" id="progress_percent">(0 %)</font><br /><br />
	</center>
	<table width="500" cellpadding="0" cellspacing="0" id="table_progress" border="0" align="center" height="28" style="border:1px solid #CCC; -moz-border-radius: 5px;
-webkit-border-radius: 5px; border-radius: 5px;background-color:#efefef;">
		<tr>
			<td id="progress_color" width="1" style="background-image: url(' . $theme['images'] . 'bar.gif); -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px;"></td>
			<td id="progress_nocolor">&nbsp;</td>
		</tr>
	</table>
<br /><center>' . $l['wait_note'] . '</center>
</div>
<br /><br /><br />';
    } elseif (!empty($installed)) {
        $info['install'] = '<h3>' . $l['congrats'] . '</h3><br />
' . $software['name'] . ' ' . $l['succesful'] . ' : <br />
<a href="' . $__settings['softurl'] . '" target="_blank">' . $__settings['softurl'] . '</a>
' . (!empty($software['adminurl']) ? '<br />' . $l['admin_url'] . ' : <a href="' . $__settings['softurl'] . '/' . $software['adminurl'] . '" target="_blank">' . $__settings['softurl'] . '/' . $software['adminurl'] . '</a>' : '') . '<br /><br />
' . (!empty($setupcontinue) ? $l['setup_continue'] . ' : <br />
<a href="' . $__settings['softurl'] . '/' . $setupcontinue . '" target="_blank">' . $__settings['softurl'] . '/' . $setupcontinue . '</a><br /><br />' : '') . '
' . $l['enjoy'] . '<br /><br />
' . (!empty($notes) ? $l['install_notes'] . ' : <br />
<div class="sai_notes">' . softparse($notes, $soft) . '</div><br /><br />' : '') . '
' . $l['please_note'] . '<br /><br />
' . $l['regards'] . ',<br />
' . $l['softinstaller'] . '<br /><br />
<center><b><a href="' . script_link($soft) . '&highlight=' . $new_insid . '&postact=install">' . $l['return'] . '</a></b></center><br /><br />';
        if (empty($globals['install_tweet_off']) || empty($globals['lictype'])) {
            $info['install'] .= '<form method="get" action="http://twitter.com/intent/tweet" id="tweet" onsubmit="return dotweet(this);">
		<table border="0" cellpadding="5" cellspacing="1" align="center" class="sai_divroundshad">
			<tr>
				<td colspan="2">
					<font size="+1"><b>' . $l['install_tweet_sub'] . ' :</b></font>
				</td>
			</tr>
			<tr>
				<td valign="middle">
				<textarea name="text" cols="60" row="3" style="resize:none">' . loadtweetdata('install_tweet', $l['install_tweet']) . '</textarea>
				</td>
				<td valign="middle">
				<input type="submit" value="Tweet!" class="sai_twitter-btn" onsubmit="return false;" id="twitter-btn"/>
				</td>
			</tr>
		</table>
		</form>';
        }
        $info['install'] .= '<!--PROC_DONE-->
	<br /><br />';
    }
    softheader($l['<title>'] . $software['name']);
    $loadedinfo = array('install', 'overview', 'features', 'reviews', 'screenshots', 'ratings');
    ?>
<script language="JavaScript" src="<?php 
    echo $theme['url'] . '/js/tabber.js';
    ?>
" type="text/javascript">
</script>
<script language="JavaScript" id="ratings_js_file" type="text/javascript"></script>
<script language="JavaScript" id="review_js_file"  type="text/javascript"></script>
<script language="JavaScript" id="reviews_js_file"  type="text/javascript"></script>
<script type="text/javascript">
tabs = new tabber;
tabs.tabs = new Array('<?php 
    echo implode('\', \'', $loadedinfo);
    ?>
');
tabs.tabwindows = new Array('<?php 
    echo implode('_win\', \'', $loadedinfo);
    ?>
_win');
tabs.inittab = <?php 
    echo '\'' . $init_tab . '\';';
    ?>
addonload('tabs.init();loadraterev();check_pass_strength();');

function loadraterev(){
<?php 
    if (empty($globals['off_rating_link']) && $soft < 10000) {
        echo '$_(\'ratings_js_file\').src = "https://www.softaculous.com/ratings.js?soft=' . $soft . '&user='******'name'] . '&ip=' . $_SERVER['SERVER_ADDR'] . '";';
    }
    if (empty($globals['off_review_link']) && $soft < 10000) {
        echo '$_(\'review_js_file\').src =  "https://www.softaculous.com/review.js?soft=' . $soft . '&user='******'name'] . '&ip=' . $_SERVER['SERVER_ADDR'] . '";';
        echo '$_(\'reviews_js_file\').src =  "https://www.softaculous.com/reviews.js?soft=' . $soft . '&user='******'name'] . '&timezone=' . $globals['timezone'] . '&ip=' . $_SERVER['SERVER_ADDR'] . '";';
    }
    ?>
};

function notifyversion(){
	if(AJAX(window.location+"&notify=true", "notified(re)")){
		return false;
	}else{
		return true;	
	}
};

function notified(re){
	if(re == 1){
		alert('<?php 
    echo $l['notifyversion'];
    ?>
');
	}
};

function loadScreenshots(){
	$_('screenshots_iframe').src = '<?php 
    echo 'https://www.softaculous.com/screenshots/screenshots1.php?sid=' . $soft;
    ?>
';
};

</script>
<?php 
    $url = $theme['images'];
    $ratings = array();
    $deduct = 1;
    $r = $scripts[$soft]['ratings'];
    for ($i_r = 1; $i_r <= 5; $i_r++) {
        if ($r >= 1) {
            $ratings[$i_r] = '<td><img src="' . $url . 'star.png' . '" alt="(' . number_format($scripts[$soft]['ratings'], 2) . ' out of 5)" /></td>';
        } elseif ($r > 0) {
            $ratings[$i_r] = '<td><img src="' . $url . 'halfstar.png' . '" alt="(' . number_format($scripts[$soft]['ratings'], 2) . ' out of 5)" /></td>';
        } else {
            $ratings[$i_r] = '<td><img src="' . $url . 'nostar.png' . '" alt="(' . number_format($scripts[$soft]['ratings'], 2) . ' out of 5)" /></td>';
        }
        $r = $r - $deduct;
    }
    // For custom themes
    if ($soft > 10000) {
        if (file_exists($globals['euthemes'] . '/' . $globals['theme_folder'] . '/images/topscripts/48/' . $iscripts[$soft]['softname'] . '.png')) {
            $custom_48 = $theme['images'] . 'topscripts/48/' . $iscripts[$soft]['softname'] . '.png';
        } else {
            $custom_48 = $theme['images'] . '/custom.png';
        }
    }
    echo '<div id="currentrating" style="display:none"></div>
<table width="100%" cellpadding="4" cellspacing="1" border="0">
	<tr>
		<td width="10%" align="center">' . (!empty($custom_48) ? '<img src="' . $custom_48 . '" alt="">' : '<img src="' . $globals['mirror_images'] . 'top15/48/' . $scripts[$soft]['softname'] . '.png" >') . '</td>
		<td width="90%" class="sai_process_heading" colspan="4">' . $software['name'] . '</td>
	</tr>
	<tr>
		<td align="center" width="10%">' . ($soft > 10000 ? '' : '<div class="someclass" title="' . $scripts[$soft]['ratings'] . '"><table><tr>' . implode('', $ratings) . '</tr></table></div>') . '</td>
		<td valign="top" align="left" width="20%">
			' . $l['software_ver'] . ' : <font size="2"><b>' . (!empty($tmp_ver) ? $tmp_ver : $software['ver']) . '</b></font> &nbsp; &nbsp; <a href="javascript" onclick="notifyversion(); return false;" ><img src="' . $theme['images'] . 'notify.gif" name="notifyver" title="' . $l['notify_ver'] . '" alt="' . $l['notify_ver'] . '"></a>
		</td>
		<td align="left" width="60%">
			' . (!empty($info['release_date']) ? $l['release_date'] . ' : <font size="1"><b>' . $info['release_date'] . '</b></font>' : '') . '
		</td>
		<td width="10%">
			' . (!empty($info['changelog']) ? '&nbsp;&nbsp;<a href="javascript" onclick="$(\'#changelog_div\').bPopup(); return false;" class="sai_changelogbut" style="text-decoration:none;">' . $l['changelog'] . '</a>' : '') . '
		</td>
	</tr>
</table><br />

<table width="100%" cellpadding="0" cellspacing="0" border="0" class="sai_tabs">
	<tr>
		<td><a href="javascript:tabs.tab(\'install\')" id="install" class="sai_insbut">' . $l['install'] . '</a></td>
		<td><a href="javascript:tabs.tab(\'overview\')" class="sai_tab" id="overview">' . $l['overview'] . '</a></td>
		<td><a href="javascript:tabs.tab(\'features\')" class="sai_tab" id="features">' . $l['features'] . '</a></td>
			' . (empty($globals['off_screenshot_link']) ? '<td><a href="javascript:tabs.tab(\'screenshots\'); loadScreenshots();" class="sai_tab" id="screenshots">' . $l['screenshots'] . '</a></td>' : '') . '
			' . (empty($globals['off_demo_link']) ? '<td><a href="' . ($soft >= 10000 && !empty($info['demo']) ? $info['demo'] : $globals['ind'] . 'act=demos&soft=' . $soft) . '" class="sai_tab" id="demo" target="_blank">' . $l['demo'] . '</a></td>' : '') . '
			' . (empty($globals['off_rating_link']) && $soft < 10000 ? '<td><a href="javascript:tabs.tab(\'ratings\')" class="sai_tab" id="ratings">' . $l['ratings'] . '</a></td>' : '') . '
			' . (empty($globals['off_review_link']) && $soft < 10000 ? '<td><a href="javascript:tabs.tab(\'reviews\')" class="sai_tab" id="reviews">' . $l['reviews'] . '</a></td>' : '') . (empty($info['import']) ? '' : '<td><a href="' . $globals['ind'] . 'act=import&soft=' . $soft . '" class="sai_tab" id="ratings">' . $l['import'] . '</a></td>') . '
	</tr>
</table><br />

<script type="text/javascript">
$_(tabs.inittab).className = tabs.tabbedclass;

var softid = ' . $soft . '

tabs.override = function(id){
	if(id == \'install\'){
		$_(\'install\').className = \'sai_insbutclicked\';
	}else{
		$_(\'install\').className = \'sai_insbut\';
	}
};
</script>';
    //Parse and take care of images
    $info['overview'] = (!empty($info['changelog']) ? '<div id="changelog_div" class="sai_popup" style="display:none;"><span class="sai_clogbutton b-close"><span>X</span></span><div class="sai_changelog">' . $info['changelog'] . '</div></div>' : '') . '

<table width="100%" cellpadding="8" cellspacing="1" border="0">
<tr>
	' . (!empty($scripts[$soft]['screenshots']) && empty($globals['panel_hf']) ? '
	<td width="20%" valign="top">
		<div id="overview_img"> <img src="' . $globals['mirror_images'] . 'softimages/screenshots/' . $soft . '_screenshot1.gif" width="500" alt="" > </div>
	</td>' : '') . '
	
	<td valign="top" style="padding:10px;">
		' . softparse($info['overview'], $soft) . '<br /><br />
		<table width="100%" cellpadding="4" cellspacing="1" border="0">
			<tr>
				<td width="52" valign="top" align="center"><font color="#447edf"><i class="fa sai-disk fa-3x"></i></font></td>
				<td valign="top">
					<span class="sai_head">' . $l['space_req'] . '</span><br />
					<span class="sai_exp">' . $l['available_space'] . ' : ' . (is_numeric($softpanel->spaceremain) ? number_format($softpanel->spaceremain / 1024 / 1024, 2) : $softpanel->spaceremain) . ' ' . $l['mb'] . '<br />
					' . $l['req_space'] . ' : ' . number_format($software['spacereq'] / 1024 / 1024, 2) . ' ' . $l['mb'] . '</span>
				</td>
			</tr>
			<tr>
				<td valign="top" align="center"><a href="' . $info['support'] . '"><font color="#447edf"><i class="fa sai-question fa-3x"></i></font></a></td>
				<td valign="top">
					<span class="sai_head">' . $l['software_support'] . '</span><br />
					<span class="sai_exp"><a href="' . $info['support'] . '" target="_blank">' . $l['support_link'] . '</a><br />
					' . $l['support_note'] . '</span>
				</td>
			</tr>
		</table>
	</td>
</tr>
</table>';
    if (!empty($installations[$soft])) {
        $is_cloneable = is_cloneable($soft);
        $highlight = optGET('highlight');
        $action = optGET('postact');
        $info['overview'] .= '<br /><br />
<center>
	<span class="sai_newhead">' . $l['current_ins'] . '</span><br />
</center>
<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" style="margin:8px 0px;" />';
        $info['overview'] .= '<table border="0" cellpadding="5" cellspacing="0" width="100%" class="sai_altrowstable">
<tr>
	<th class="sai_exp">' . $l['link'] . '</th>
	<th width="50" class="sai_exp" >' . $l['admin'] . '</th>
	<th width="180" class="sai_exp">' . $l['ins_time'] . '</th>
	<th width="80" class="sai_exp">' . $l['version'] . '</th>
	<th width="145" class="sai_exp" style="text-align:center">' . $l['options'] . '</th>
</tr>';
        $i = 1;
        foreach ($installations[$soft] as $ik => $iv) {
            $info['overview'] .= '<tr id="trid' . $ik . '" class="' . ($i % 2 == 0 ? "sai_evenrowcolor" : "sai_oddrowcolor") . '">
		<td><a href="' . $iv['softurl'] . '" target="_blank" id="insurl' . $ik . '">' . $iv['softurl'] . '</a>' . ($highlight == $ik && !empty($action) ? '<span id="highlight">&nbsp;&nbsp;<b class="sai_highlight">' . $l['act_' . $action] . '</b></span>' : '') . '</td>
		<td><a href="' . $iv['softurl'] . '/' . (!empty($iv['admin_folder']) ? $iv['admin_folder'] : admin_folder($iv['sid'])) . '" target="_blank"><img src="' . $theme['images'] . '/admin.gif" /></a></td>
		<td>' . datify($iv['itime']) . '</td>
		<td>' . $iv['ver'] . ($software['ver'] != $iv['ver'] && file_exists($software['path'] . '/upgrade.xml') ? ' <a href="' . $globals['ind'] . 'act=upgrade&insid=' . $ik . '"><img src="' . $theme['images'] . 'updates.gif" alt="' . $l['upd_to'] . ' ' . $scripts[$soft]['ver'] . '" /></a>' : '') . '</td>
		<td>' . (!empty($is_cloneable) ? '<a href="' . $globals['ind'] . 'act=sclone&insid=' . $ik . '" title="' . $l['clone'] . '"><img src="' . $theme['images'] . 'clone.gif" /></a>&nbsp;' : '') . (empty($globals['disable_backup_restore']) ? '<a href="' . $globals['ind'] . 'act=backup&insid=' . $ik . '" title="' . $l['backup'] . '"><img src="' . $theme['images'] . 'backup.gif" /></a>' : '') . ' &nbsp;<a href="' . $globals['ind'] . 'act=editdetail&insid=' . $ik . '" title="' . $l['editdetail'] . '"><img src="' . $theme['images'] . 'editdetail.gif" /></a> &nbsp;<a href="' . $globals['ind'] . 'act=remove&insid=' . $ik . '"><img src="' . $theme['images'] . 'remove.gif" /></a>&nbsp;<input type="checkbox" name="insids[]" id="' . $iv['softurl'] . '" value="' . $ik . '"></td>
	</tr>';
            $i++;
        }
        $info['overview'] .= '</table>
	<p align="right">
		' . $l['with_selected'] . ': 
		<select name="multi_options" id="multi_options">
			<option name="todo" id="todo" value="0">---</option>
			<option name="todo" id="todo" value="mult_rem">' . $l['remove'] . '</option>
		</select>
		<input type="button" value="' . $l['go'] . '" onclick="show_confirm()">
		<br />
	</p>
	<div id="rem_div"></div>
	
<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
insids = new Array();
removed = new Object();

function show_confirm(){
	
	insids = new Array();
	removed = new Object();
	
	if($_("multi_options").value != "mult_rem"){
		return false;
	}

	// Build the list of Installations to remove
	var field = document.getElementsByName(\'insids[]\');
		insids = new Array();
		var c = 0;
		for(i = 0; i < field.length; i++){
			if(field[i].checked == true){
				insids[c] = field[i].value;
				c++;
			}
		
	}
	//alert(insids);
	
	if(c == 0){
		alert("' . $l['no_sel_inst'] . '");
		return false;
	}
	
	var r = confirm("' . $l['del_insid'] . '");
	if(r != true){
		return false;
	}
	
	remove_by_id(insids[0], "", 0);
}

function remove_by_id(insid, re, oldinsid){

	removed[insid] = false;
	
	if(re.length > 0 && oldinsid > 0){
		if(re == "removed"){
			removed[insid] = true;
		}
	}
	
	nextinsid = 0;
	
	// Find the next INSTALLATION to remove
	for(i = 0; i < insids.length; i++){
		if(typeof(removed[insids[i]]) != "undefined"){
			continue;
		}
		nextinsid = insids[i];
		break;
	}
	
	// If there is something left to be removed
	if(insid != 0){
		try{		
			AJAX("' . $globals['index'] . 'act=remove&insid="+insid+"&ajax=1&ssk="+randomstring(32)+"&random="+Math.random(), "remove_by_id(\'"+nextinsid+"\', re, \'"+insid+"\')");
			$_("rem_div").innerHTML = "<br /><br /><p align=\\"center\\"><img src=\\"' . $theme['images'] . 'ajax_remove.gif\\"> <br />' . $l['rem_inst_id'] . ' ID: " +insid+ ", URL: " + $_("insurl"+insid)+"<br /></p>";
			return true;
		}catch(e){
			return false;
		}
	}
	$_("rem_div").innerHTML = "";
	alert("' . $l['inst_remvd'] . '");
	location.reload(true);
	return true;
}

$(document).ready(function(){
	
	$(".sai_altrowstable tr").mouseover(function(){
		var old_class = $(this).attr("class");
		//alert(old_class);
		$(this).attr("class", "sai_tr_bgcolor");
		
		$(this).mouseout(function(){
			$(this).attr("class", old_class);
		});
	});';
        // If we get anything in $highlight than only we have to call this JS function other wise it will cause the JS error.
        if (!empty($highlight)) {
            $info['overview'] .= 'goto_id("insurl' . $highlight . '");
	$("#highlight").fadeOut(10000);';
        }
        $info['overview'] .= '});

// ]]></script>';
    }
    if (count($allcatwise[$software['type']][$software['cat']]) > 2 && $software['cat'] != 'others') {
        $info['overview'] .= '<br /><br /><br /><br />
		<table width="100%" cellpadding="8" cellspacing="0" border="0" class="sai_divroundshad">
			<tr>
				<td class="sai_heading_full" colspan="2">' . $l['related_scripts'] . '</td>
			</tr>
		</table>';
        $i = 0;
        foreach ($allcatwise[$software['type']][$software['cat']] as $k => $v) {
            if ($k == $soft || !empty($scripts[$k]['parent']) && !empty($iscripts[$scripts[$k]['parent']])) {
                continue;
            }
            // Show only 5 scripts
            if ($i == 5) {
                break;
            }
            $info['overview'] .= '
		<div style="text-decoration:none;display:inline-block;text-align:center;margin-top:10px;">
			<a href="' . script_link($k) . '"  title="' . $v['desc'] . '"  width="80" alt="" class="someclass" style="text-decoration:none;margin-top:5px;">
				<div class="sai_blog_script" style="margin-left:11%;">
					<div class="sai_demo_script_logo">
						<img src="' . $globals['mirror_images'] . 'top15/48/' . $v['softname'] . '.png" >	
					</div>
					<div class="sai_script_name">' . $v['name'] . '</div>
				</div>
		</a></div>';
            $i++;
        }
    }
    //Parse and take care of images
    $info['features'] = softparse($info['features'], $soft);
    $info['ratings'] = '';
    $info['screenshots'] = '<iframe src="" id="screenshots_iframe" style="width:100%;height:600px;" frameborder="0" scrolling="no"></iframe>';
    $info['reviews'] = '<div id="allreviews"></div>';
    foreach ($info as $k => $v) {
        if (in_array($k, array('demo', 'support', 'import', 'changelog'))) {
            continue;
        }
        echo '<div id="' . $k . '_win" style="display: ' . ($init_tab == $k ? "block" : "none") . ';">
	' . $v . '
	</div>';
    }
    softfooter();
}
Пример #8
0
function classes_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error, $scripts;
    global $software, $cid, $info, $settings, $init_tab, $overwrite_option, $dbs, $installed, $__settings, $setupcontinue, $installations, $notes, $show_installtype, $protocols, $nopackage;
    // Give the staus
    if (optGET('ajaxstatus')) {
        $_status = soft_progress(optGET('ajaxstatus'));
        $tmp_status = unserialize($_status[1]);
        $_status[1] = $tmp_status['current_status'];
        if (!empty($_status)) {
            echo implode('|', $_status);
            return true;
        }
        // False call
        echo 0;
        return false;
    }
    //First add the installation info
    if (empty($installed)) {
        $info['install'] = '<div id="fadeout_div"><form accept-charset="' . $globals['charset'] . '" name="installsoftware" method="post" action="" onsubmit="return checkform();" id="installsoftware" class="form-horizontal">
						' . error_handle($error, "100%", 0, 1) . '
						
<script language="javascript" src="' . $theme['url'] . '/js/jquery-ui-custom.js?' . $GLOBALS['globals']['version'] . '" type="text/javascript"></script>
<script language="javascript" type="text/javascript"><!-- // --><![CDATA[

function checkform(dosubmit){
	try{
		if(!formcheck()){
			return false;
		}
	}catch(e){
		//Do nothing
	}
	$_("softsubmitbut").disabled = true;
	
	if(!get_package()){
		return false;
	}
	
	if(useprog){
		
		// Send a request to check the status
		progressbar.start();
		
		// Return false so that the form is not submitted
		return false;
	
	// This is OLD School !
	}else{		
		if(dosubmit == 1){			
			$_("installsoftware").submit();	
		}
		show_msg("' . $l['installing'] . '");
	}
	
	return true;
	
};

function toggle_advoptions(){
	if ($("#advoptions").is(":hidden")){
		$("#advoptions").slideDown("slow");
		$("#advoptions_toggle_plus").attr("src", "' . $theme['images'] . 'minus_new.gif");
	}
	else{
		$("#advoptions").slideUp("slow");
		$("#advoptions_toggle_plus").attr("src", "' . $theme['images'] . 'plus_new.gif");
	}
}

function plus_onmouseover(){
	$("#plus").attr("src", "' . $theme['images'] . 'plus_hover.gif");
}

function plus_onmouseout(){
	$("#plus").attr("src", "' . $theme['images'] . 'plus.gif");
}

var progressbar = {
	timer: 0,
	total_width: 0,	
	status_key: "",
	synctimer: 0,
	fadeout_div: "#fadeout_div",
	win_div: "#install_win",
	progress_div: "#progress_bar",
	formid: "#installsoftware",
	frequency: 8000,
	
	current: function(){
		try{
			var tmp_cur = Math.round(parseInt($_("progress_color").width)/parseInt($_("table_progress").width)*100);
			if(tmp_cur > 100){
				tmp_cur = 99;
			}
			return tmp_cur;
		}catch(e){
			return -1;	
		}
	},
	
	reset: function(){ try{
		clearTimeout(this.timer);
		$_("progress_color").width = 1;
	}catch(e){ }},
	
	move: function(dest, speed, todo){ try{
		var cur = this.current();
		if(cur < 0){
			clearTimeout(this.timer);
			return false;
		}
		var cent = cur + 1;
		var new_width = cent/100*this.total_width;
		if(new_width < 1){
			new_width = 1;
		}
		//alert(new_width+" "+dest+" "+cent);
		
		$_("progress_color").width = new_width;
		$_("progress_percent").innerHTML = "("+cent+" %)";
		
		if(cent < dest){
			this.timer = setTimeout("progressbar.move("+dest+", "+speed+")", speed);
		}else{
			eval(todo);	
		}
	}catch(e){ }},
	
	text: function(txt){ try{
		$_("progress_txt").innerHTML = txt;
	}catch(e){ }},
	
	sync: function(){
		if(progressbar.status_key.length < 2){
			return false;
		}
		$.ajax({
			url: window.location+"&ajaxstatus="+progressbar.status_key+"&random="+Math.random(),
			type: "GET",
			success: function(data){
				if(data == 0) return false;
				var tmp = data.split("|");
				var cur = progressbar.current();
				tmp[2] = (3000/(tmp[0]-cur));
				//alert(tmp);
				if(tmp[0] > cur){
					if(parseInt(tmp[2]) == 0){
						tmp[2] = 800;
					}
					progressbar.move(tmp[0], tmp[2]);
				}
				progressbar.text(tmp[1]);
				progressbar.synctimer = setTimeout("progressbar.sync()", progressbar.frequency);
			}
		});
	},
	
	sync_abort: function(){
		clearTimeout(this.synctimer);
	},
	
	start: function(){ try{
		this.post();
		this.reset();
		this.total_width = parseInt($_("table_progress").width);
		this.move(95, 800);
		this.status_key = $("#soft_status_key").attr("value");
		this.sync();
	}catch(e){ }},
	
	post: function(){
		
		// Scroll to the Top and show the progress bar
		goto_top();
		$(progressbar.fadeout_div).fadeOut(500, 
			function(){
				$(progressbar.progress_div).fadeOut(1);
				$(progressbar.progress_div).fadeIn(500);
			}
		);
		
		$.ajax({
			url: window.location+"&jsnohf=1",
			type: "POST",
			data: $(progressbar.formid).serialize(),
			complete: function( jqXHR, status, responseText ) {
				
				progressbar.sync_abort();
				
				// Store the response as specified by the jqXHR object
				responseText = jqXHR.responseText;
				
				try{
					//alert(responseText);
					if(responseText.match(/\\<\\!\\-\\-PROC_DONE\\-\\-\\>/gi)){
						progressbar.text("' . addslashes($l['finishing_process']) . '");
						progressbar.move(99, 10, "$(progressbar.progress_div).fadeOut(1)");
					}else{
						progressbar.reset();
					}
				}catch(e){ }
				
				if ( jqXHR.isResolved() ) {
				
					// #4825: Get the actual response in case
					// a dataFilter is present in ajaxSettings
					jqXHR.done(function( r ) {
						responseText = r;
					});
			
					// Create a dummy div to hold the results
					// inject the contents of the document in, removing the scripts
					// to avoid any "Permission Denied" errors in IE
					var newhtml = jQuery("<div>").append(responseText).find(progressbar.win_div).html();
					
					$(progressbar.win_div).animate({opacity: 0}, 1000, "", function(){
						$(progressbar.win_div).html(newhtml);
						new_theme_funcs_init();
					}).delay(50).animate({opacity: 1}, 500);
					
					//alert(newhtml);
					
				}else{
					alert("Oops ... the connection was lost");
				}
			}
		});
	}
};

function show_msg(msg){	
	$_("show_txt").innerHTML = "<br /><br /> &nbsp; "+msg+" &nbsp; <img src=\\"' . $theme['images'] . 'progress.gif\\" />";
	$_("show_txt").style.display = "";
}

// Is the package there ?
var nopackage = ' . (empty($nopackage) ? 0 : 1) . ';

// Use the Progress Bar ?
var useprog = 1;
try{
	if(BrowserDetect.browser.toLowerCase() == "safari" && BrowserDetect.version.toString().substr(0, 1) == "3"){
		useprog = 0;
	}
}catch(e){ }

function get_package(){	
	if(nopackage){
		
		show_msg("' . $l['downloading'] . '");
		
		try{		
			AJAX("' . $globals['index'] . 'act=js&soft=' . $cid . '&ajaxdownload=1&random="+Math.random(), "get_package_handle(re)");
		}catch(e){ }
		
		return false;
	}else{
		$_("show_txt").style.display = "none";
		return true;
	}
};

function get_package_handle(resp){
	nopackage = 0;
	show_msg("' . $l['installing'] . '");
	checkform(1);
};

softemail = new Object();
function softmail(){
	try{
		var sofdom = "softdomain";
		for(x in softemail){
			if(softemail[x] == true) continue;
			var temp = $_(x).value.split("@");
			$_(x).value = temp[0] + "@" + $_(sofdom).value;
		}
	}catch(e){
		return false;
	}
};

function change_aefer_path(){
	try{
		var str = $_("softdomain").value;
		var apath = ' . json_encode($softpanel->domains) . ';
		$_("aef_path").innerHTML = $_("aef_span_lang").innerHTML = $_("aef_span_lang_a").innerHTML = apath[str]["path"]+"/";
	}catch(e){
		return false;
	}
};

$(document).ready(function(){
	$("#check_all_classes").on("click", function(event){
		if(this.checked == true){
			$(".check_all_classes").prop("checked", true);
		}else{
			$(".check_all_classes").prop("checked", false);
		}
	});
	change_aefer_path();
});

' . (!empty($_POST) ? '' : 'addonload(\'softmail();\');');
        $info['install'] .= '// ]]></script>';
        $info['install'] .= '
	<div class="bg">
		<div class="sai_sub_head">' . $l['setup'] . '</div><hr>';
        if (aefer() || ent()) {
            $info['install'] .= '
				<div class="row">
						<div class="col-sm-5">
							<label for="softdomain" class="sai_head">' . $l['choose_domain'] . '</span><br />
							<span class="sai_exp">' . $l['choose_domain_exp'] . '</span>
						</div>
						<div class="col-sm-7">
							<select name="softdomain" id="softdomain" onchange="change_aefer_path();" class="form-control">';
            if (!empty($globals['blank_domain'])) {
                $info['install'] .= '<option value="" ' . (empty($_POST['softdomain']) ? 'selected="selected"' : '') . '>(' . $l['select_domain'] . ')</option>';
            }
            foreach ($softpanel->domainroots as $domain => $dompath) {
                $info['install'] .= '<option value="' . $domain . '" ' . (!empty($_POST['softdomain']) && $_POST['softdomain'] == $domain ? 'selected="selected"' : '') . '>' . $domain . '</option>';
            }
            $info['install'] .= '</select>
						</div>
				</div>';
        }
        $info['install'] .= '
			<div class="row">
				<div class="col-sm-5">
					<label for="softdirectory" class="sai_head">' . $l['in_directory'] . '</label><br />
					<span class="sai_exp2">' . lang_vars(aefer() || ent() ? $l['aef_in_directory_exp'] : $l['in_directory_exp'], array($softpanel->user['homedir'])) . '</span>
				</div>
				<div class="col-sm-7">
					<span id="aef_path">' . $softpanel->user['homedir'] . '/</span><br><input type="text" name="softdirectory" id="softdirectory" class="form-control" size="30" value="' . POSTval('softdirectory', $software['softname']) . '" />
				</div>
			</div>';
        if (!empty($overwrite_option)) {
            $info['install'] .= '
				<div class="row">
					<div class="col-sm-5">
						<span class="sai_head">' . $l['overwrite'] . '</span>
					</div>
					<div class="col-sm-7">
						<input type="checkbox" name="overwrite_existing" id="overwrite_existing" />
					</div>
				</div>';
        }
        $info['install'] .= '
	</div><br /><!--end of bg class-->';
        if (!empty($settings)) {
            if (file_exists($software['path'] . '/install.js')) {
                $info['install'] .= '<script language="javascript" type="text/javascript"><!--// --><![CDATA[';
                $info['install'] .= @parselanguages(str_replace('$(', '$_(', implode('', file($software['path'] . '/install.js'))));
                $info['install'] .= '// ]]></script>';
            }
            foreach ($settings as $group => $sets) {
                if ($group == 'hidden') {
                    continue;
                }
                $info['install'] .= '
			<div class="bg">
				<div class="sai_sub_head">' . $group . '</div><hr>';
                foreach ($sets as $sk => $sv) {
                    //Adding class to input
                    if (preg_match('/type="text"/is', $sv['tag'])) {
                        $sv['tag'] = preg_replace('/>/is', ' class="form-control">', $sv['tag']);
                    }
                    if (preg_match('/<select/is', $sv['tag'])) {
                        $sv['tag'] = preg_replace('/<select/is', '<select class="form-control"', $sv['tag']);
                    }
                    $info['install'] .= '
					<div class="row">
						<div class="col-sm-5">
							<label for=' . $sk . ' class="sai_head" id="sai_head">' . $sv['head'] . '</label>
								' . (empty($sv['exp']) ? '' : '<span class="sai_exp">' . $sv['exp'] . '</span>') . '	
						</div>
							' . (preg_match('/admin_pass|softpass/is', $sv['tag']) ? preg_replace('/>|\\/>/is', ' onkeyup="check_pass_strength();" >', '
								<div class="col-sm-6">' . $sv['tag'] . '</div>') : '<div class="col-sm-7 ">' . $sv['tag'] . '</div>') . '
								' . (preg_match('/softmail/is', $sv['tag']) ? '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
								softemail["' . $sk . '"] = false;
								//Add an event handler
								$_("' . $sk . '").onkeydown = function(){
									softemail["' . $sk . '"] = true;
								}
								// ]]></script>
								' : '') . '
								
								' . (preg_match('/admin_pass|softpass/is', $sv['tag']) && (!empty($softpanel->securepass) || !empty($globals['random_pass'])) ? '
								<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
								addonload(\'$_("' . $sk . '").value=randstr(10, 1, ' . (!empty($globals['pass_strength']) ? $globals['pass_strength'] : 0) . ');check_pass_strength();\');
								// ]]></script>
								' : '') . '
								' . (preg_match('/admin_pass|softpass/is', $sv['tag']) && !empty($globals['empty_pass']) ? '
								<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
								addonload(\'$_("' . $sk . '").value="";check_pass_strength();\');
								// ]]></script>
								' : '') . '
								' . (preg_match('/admin_username/is', $sv['tag']) && !empty($globals['random_username']) && !empty($random_username) ? '
								<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
								addonload(\'$_("' . $sk . '").value=randstr(5);\');
								// ]]></script>
								' : '') . '
								' . (preg_match('/admin_username/is', $sv['tag']) && !empty($globals['empty_username']) && !empty($random_username) ? '
								<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
								addonload(\'$_("' . $sk . '").value="";\');
								// ]]></script>
								' : '') . '
								' . (preg_match('/admin_username/is', $sv['tag']) && !empty($globals['admin_prefix']) && empty($globals['empty_username']) && empty($globals['random_username']) && !empty($random_username) ? '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
								addonload(\'prepend_prefix("' . $globals['admin_prefix'] . '");\');
									// ]]></script>
								' : '') . '
						</div><br />';
                }
                $info['install'] .= '
			</div><br /><!--end of bg class-->';
            }
            //The Hidden groups
            if (!empty($settings['hidden'])) {
                foreach ($settings['hidden'] as $sk => $sv) {
                    $info['install'] .= $sv['tag'] . '
		' . (preg_match('/softmail/is', $sv['tag']) ? '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
		softemail["' . $sk . '"] = false;
		//Add an event handler
		$_("' . $sk . '").onkeydown = function(){
			softemail["' . $sk . '"] = true;
		}
		// ]]></script>
		' : '');
                }
            }
        }
        //End of if($settings)
        // Advance option
        $info['install'] .= '
	<div class="bg">
		<div class="sai_sub_head" id="advoptions_toggle" onclick="toggle_advoptions(\'advoptions\');" style="cursor:pointer"><img id="advoptions_toggle_plus"  src="' . $theme['images'] . 'plus_new.gif" style="margin-top:-4px;"/>&nbsp;&nbsp;' . $l['adv_option'] . '</div>
		<div id="advoptions" style="display:none;"><hr>
			<div class="row">
				<div class="col-sm-5">
					<label class="sai_head">' . $l['disable_notify_update'] . '</label>
					<span class="sai_exp">' . $l['exp_disable_notify_update'] . '</span>
				</div>
				<div class="col-sm-7">
					<input type="checkbox" name="disable_notify_update" id="disable_notify_update" ' . POSTchecked('disable_notify_update') . ' />
				</div>	
			</div>	
		</div>	
	</div><!--end of bg--><br /><br />';
        $info['install'] .= '
	<p align="center" class="sai_head">
		<input type="hidden" name="softsubmit" id="softsubmit" value="' . $l['softsubmit'] . '" />
		<input type="submit" name="softsubmitbut" id="softsubmitbut" value="' . $l['softsubmit'] . '" class="flat-butt" /><span id="show_txt" style="display:none;"></span>
		<br /><br /><br />
		' . (empty($globals['off_email_link']) ? $l['ins_emailto'] . ' : <input type="text" name="emailto" id="emailto" size="20" value="' . POSTval('emailto', '') . '" />' : '') . '
	</p>
	<input type="hidden" name="soft_status_key" id="soft_status_key" value="' . POSTval('soft_status_key', generateRandStr(32)) . '" />
	</form></div>

<div id="progress_bar" style="height:125px; display: none; width:100%;">
	<br /><br />
	<center>
		<font size="4" color="#222222" id="progress_txt" style="width:100%;">' . $l['checking_data'] . '</font>
		<font style="font-size: 18px;font-weight: 400;color: #444444;" width:100%;" id="progress_percent">(0 %)</font><br /><br />
	</center>
	<table width="500" cellpadding="0" cellspacing="0" id="table_progress" border="0" align="center" height="28" style="border:1px solid #CCC; -moz-border-radius: 5px;
	-webkit-border-radius: 5px; border-radius: 5px; width:50%;"">
	<tr>
		<td id="progress_color" width="1" style="background-image: url(' . $theme['images'] . 'bar.gif); -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px;"></td>
		<td id="progress_nocolor">&nbsp;</td>
	</tr>
	</table>
</div>
<br />';
    } elseif (!empty($installed)) {
        $info['install'] = '
	<div class="bg2">
		<h4>' . $l['congrats'] . '</h4><br />
		' . $software['name'] . ' ' . $l['succesful'] . ' : <br />
		<b>' . $__settings['softpath'] . '</b>
		<br /><br />
		' . $l['enjoy'] . '<br /><br />
		' . (!empty($notes) ? $l['install_notes'] . ' : <br />
		<div class="sai_notes">' . softparse($notes, $cid) . '</div><br /><br />' : '') . '
		' . $l['please_note'] . '<br /><br />
		' . $l['regards'] . ',<br />
		' . $l['softinstaller'] . '<br /><br />
		<center><b><a href="' . $globals['ind'] . 'act=classes&cid=' . $cid . '">' . $l['return'] . '</a></b></center><br /><br />';
        if (empty($globals['install_tweet_off']) || empty($globals['lictype'])) {
            $info['install'] .= '<form method="get" action="http://twitter.com/intent/tweet" id="tweet" onsubmit="return dotweet(this);">
			<div class="panel panel-info" style="width:55%; margin:0 auto;">
				<div class="panel-heading" style="padding:5px; font-size:15px;">
					<font><b>' . $l['install_tweet_sub'] . ' :</b></font>
				</div>
				<div class="panel-body">
					<div class="row">
						<div class="col-sm-10">
							<textarea name="text" cols="80" row="3" style="resize:none; width:100%;">' . loadtweetdata('install_tweet', $l['install_tweet_classes']) . '</textarea>
						</div>
						<div class="col-sm-2">
							<input type="submit" value="Tweet!" class="btn btn-info" onsubmit="return false;" id="twitter-btn" style="margin-top:20px;"/>
						</div>
					</div>
				</div>
			</div>
			</form>';
        }
        $info['install'] .= '
	</div><!--end of bg class--><!--PROC_DONE-->
	<br /><br /><br /><br />
';
    }
    softheader($l['<title>'] . $software['name']);
    $loadedinfo = array('install', 'overview', 'file', 'reviews', 'ratings');
    ?>
<script language="JavaScript" src="<?php 
    echo $theme['url'] . '/js/tabber.js';
    ?>
" type="text/javascript">
</script>
<script language="JavaScript" id="ratings_js_file" type="text/javascript"></script>
<script language="JavaScript" id="review_js_file"  type="text/javascript"></script>
<script language="JavaScript" id="reviews_js_file"  type="text/javascript"></script>
<script language="JavaScript" id="file_js_file"  type="text/javascript"></script>
<script type="text/javascript">
tabs = new tabber;
tabs.tabs = new Array('<?php 
    echo implode('\', \'', $loadedinfo);
    ?>
');
tabs.tabwindows = new Array('<?php 
    echo implode('_win\', \'', $loadedinfo);
    ?>
_win');
tabs.inittab = <?php 
    echo '\'' . $init_tab . '\';';
    ?>

addonload('tabs.init();loadraterev();');

function loadraterev(){
	$_('ratings_js_file').src = '<?php 
    echo $globals['api_nuphp2'] . 'rating.php?cid=' . $cid . '&user='******'name'] . '&ip=' . $_SERVER['SERVER_ADDR'] . '&rating=1';
    ?>
';
	$_('review_js_file').src = '<?php 
    echo $globals['api_nuphp2'] . 'review.php?cid=' . $cid . '&user='******'name'] . '&ip=' . $_SERVER['SERVER_ADDR'] . '&review=1';
    ?>
';
	$_('reviews_js_file').src = '<?php 
    echo $globals['api_nuphp2'] . 'reviews.php?cid=' . $cid . '&user='******'name'] . '&timezone=' . $globals['timezone'] . '&ip=' . $_SERVER['SERVER_ADDR'] . '&reviews=1';
    ?>
';
	if(tabs.inittab == 'file'){
	filecodeview.loadDirStruct();
}

}
</script>
<?php 
    $url = $theme['images'];
    $ratings = array();
    $deduct = 1;
    $r = $software['ratings'];
    for ($i_r = 1; $i_r <= 5; $i_r++) {
        if ($r >= 1) {
            $ratings[$i_r] = '<img src="' . $url . 'star.png' . '" alt="(' . number_format($software['ratings'], 2) . ' out of 5)" />';
        } elseif ($r > 0) {
            $ratings[$i_r] = '<img src="' . $url . 'halfstar.png' . '" alt="(' . number_format($software['ratings'], 2) . ' out of 5)" />';
        } else {
            $ratings[$i_r] = '<img src="' . $url . 'nostar.png' . '" alt="(' . number_format($software['ratings'], 2) . ' out of 5)" />';
        }
        $r = $r - $deduct;
    }
    echo '
<div class="bg">
	<div id="currentrating" style="display:none"></div>
	
	<div class="row" style="margin-left:-5px;">
		<span class="sai_process_heading" colspan="4">' . $software['name'] . '</span>
	</div><br />
	<div class="row">
		<div class="col-sm-3"><div class="someclass" title="' . $scripts[$k]['ratings'] . '">' . implode('', $ratings) . '</div></div>
		<div class="col-sm-4">
			' . $l['software_ver'] . ' : <span class="sai_head"><font size="4">' . $software['version'] . '</font></span> &nbsp; &nbsp; <a href="javascript" onclick="notifyversion(); return false;" ><img src="' . $theme['images'] . 'notify.gif" name="notifyver" title="' . $l['notify_ver'] . '" alt="' . $l['notify_ver'] . '"></a>
		</div>
		<div class="col-sm-3">
			' . $l['software_category'] . ' : <span class="sai_head"><font size="4">' . $l['classes_' . $software['category']] . '</font></span>
		</div>
	</div><br />
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="sai_tabs">
		<tr>
			<td><a href="javascript:tabs.tab(\'install\')" id="install" class="sai_insbut">' . $l['install'] . '</a></td>
			<td><a href="javascript:tabs.tab(\'overview\')" class="sai_tab" id="overview">' . $l['overview'] . '</a></td>
			<td><a href="javascript:tabs.tab(\'file\'); filecodeview.loadDirStruct();" class="sai_tab" id="file">' . $l['file'] . '</a></td>
			' . (empty($globals['off_rating_link']) ? '<td><a href="javascript:tabs.tab(\'ratings\')" class="sai_tab" id="ratings">' . $l['ratings'] . '</a></td>' : '') . '
			' . (empty($globals['off_review_link']) ? '<td><a href="javascript:tabs.tab(\'reviews\')" class="sai_tab" id="reviews">' . $l['reviews'] . '</a></td>' : '') . '
		</tr>
	</table><br />';
    ?>
	<script type="text/javascript">
	$_(tabs.inittab).className = tabs.tabbedclass;
	var softid = <?php 
    echo $cid;
    ?>
;

	tabs.override = function(id){
		if(id == 'install'){
			$_('install').className = 'sai_insbutclicked';
		}else{		
			$_('install').className = 'sai_insbut';
		}
	};
	</script>
	<?php 
    //Parse and take care of images
    $info['overview'] = '<table width="100%" cellpadding="8" cellspacing="1" border="0">
	<tr>
		<td valign="top" style="padding:10px;">
			' . softparse($info['overview'], $cid) . '<br /><br />
			<table width="100%" cellpadding="4" cellspacing="1" border="0">
				<tr>
					<td width="52" valign="top" align="center"><font color="#447edf"><i class="fa sai-disk fa-3x"></i></font></td>
					<td valign="top">
						<span class="sai_head">' . $l['space_req'] . '</span><br />
						<span class="sai_exp2">' . $l['available_space'] . ' : ' . (is_numeric($softpanel->spaceremain) ? number_format($softpanel->spaceremain / 1024 / 1024, 2) : $softpanel->spaceremain) . ' ' . $l['mb'] . '<br />
						' . $l['req_space'] . ' : ' . number_format($software['spacereq'] / 1024 / 1024, 2) . ' ' . $l['mb'] . '</span>
					</td>
				</tr>
				<tr>
					<td valign="top" align="center"><a href="' . $info['support'] . '"><font color="#447edf"><i class="fa sai-question fa-3x"></i></font></a></td>
					<td valign="top">
						<span class="sai_head">' . $l['software_support'] . '</span><br />
						<span class="sai_exp2"><a href="' . $info['support'] . '" target="_blank">' . $l['support_link'] . '</a><br />
						' . $l['support_note'] . '</span>
					</td>
				</tr>
			</table>
		</td>
	</tr>
	</table>';
    if (!empty($installations)) {
        $info['overview'] .= '<br /><br />
			<div class="sai_sub_head" align="center">' . $l['current_ins'] . '</div><hr>';
        $info['overview'] .= '<table border="0" cellpadding="5" cellspacing="0" width="100%" class="table table-hover">
			<tr>
				<thead class="sai_head2" style="background:#333; color:#fff;">
					<th><b>' . $l['link'] . '</b></th>
					<th width="180"><b>' . $l['ins_time'] . '</b></th>
					<th width="80"><b>' . $l['version'] . '</b></th>
					<th width="120"><b>' . $l['remove'] . '</b></th>
					<th width="50"><input type="checkbox" id="check_all_classes"></th>
				<thead>
			</tr>';
        foreach ($installations as $ik => $iv) {
            $info['overview'] .= '<tr>
				<td>' . $iv['softpath'] . '</td>
				<td width="180">' . datify($iv['itime']) . '</td>
				<td width="80">' . $iv['ver'] . ($software['ver'] != $iv['ver'] && file_exists($software['path'] . '/upgrade.xml') ? ' <a href="' . $globals['ind'] . 'act=upgrade&cinsid=' . $ik . '"><img src="' . $theme['images'] . 'updates.gif" alt="' . $l['upd_to'] . ' ' . $scripts[$cid]['ver'] . '" /></a>' : '') . '</td>
				<td width="120"><a href="' . $globals['ind'] . 'act=classes_remove&cinsid=' . $ik . '" title="' . $l['remove'] . '"><img src="' . $theme['images'] . 'remove.gif" /></a></td>
				<td width="50"><input type="checkbox" class="check_all_classes" name="insids[]" value="' . $ik . '"></td>
			</tr>';
        }
        $info['overview'] .= '</table><br />
			<p align="right">
				' . $l['with_selected'] . ': 
				<select name="multi_options" id="multi_options">
					<option name="todo" id="todo" value="0">---</option>
					<option name="todo" id="todo" value="mult_rem">' . $l['remove'] . '</option>
				</select>
				<input type="button" class="sai_graybluebut" value="' . $l['go'] . '" onclick="show_confirm()">
				<br />
			</p>
			<div id="rem_div"></div>
		
	<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
	insids = new Array();
	removed = new Object();

	function show_confirm(){
		
		insids = new Array();
		removed = new Object();
		
		if($_("multi_options").value != "mult_rem"){
			return false;
		}

		// Build the list of Installations to remove
		var field = document.getElementsByName(\'insids[]\');
			insids = new Array();
			var c = 0;
			for(i = 0; i < field.length; i++){
				if(field[i].checked == true){
					insids[c] = field[i].value;
					c++;
				}
			
		}
		//alert(insids);
		
		if(c == 0){
			alert("' . $l['no_sel_inst'] . '");
			return false;
		}
		
		var r = confirm("' . $l['del_insid'] . '");
		if(r != true){
			return false;
		}
		
		remove_by_id(insids[0], "", 0);
	}

	function remove_by_id(insid, re, oldinsid){

		removed[insid] = false;
		
		if(re.length > 0 && oldinsid > 0){
			if(re == "removed"){
				removed[insid] = true;
			}
		}
		
		nextinsid = 0;
		
		// Find the next INSTALLATION to remove
		for(i = 0; i < insids.length; i++){
			if(typeof(removed[insids[i]]) != "undefined"){
				continue;
			}
			nextinsid = insids[i];
			break;
		}

		// If there is something left to be removed
		if(insid != 0){
			try{	
				AJAX("' . $globals['index'] . 'act=classes_remove&cinsid="+insid+"&ajax=1&ssk="+randomstring(32)+"&random="+Math.random(), "remove_by_id(\'"+nextinsid+"\', re, \'"+insid+"\')");
				$_("rem_div").innerHTML = "<br /><br /><p align=\\"center\\"><img src=\\"' . $theme['images'] . 'ajax_remove.gif\\"> <br />' . $l['rem_inst_id'] . ' ID: " +insid+ "<br /></p>";
				return true;
			}catch(e){
				return false;
			}
		}
		$_("rem_div").innerHTML = "";
		alert("' . $l['inst_remvd'] . '");
		location.reload(true);
		return true;
	}
	$(document).ready(function(){

		$(".sai_altrowstable tr").mouseover(function(){
			var old_class = $(this).attr("class");
			//alert(old_class);
			$(this).attr("class", "sai_tr_bgcolor");
			
			$(this).mouseout(function(){
				$(this).attr("class", old_class);
			});
		});

	});

	// ]]></script>';
    }
    $info['file'] = '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[

	var filecodeview = {
		dir : "",
		data_obj : ' . $software['dirstruct'] . ',
		
		loadDirStruct : function(direction){
				var size = new Number((' . $software['zip_size'] . '/1024)+"").toFixed(parseInt(2));
				size = size+" kb";
				var right = "right";
				var back_path_div = \'<table border="0" width="100%"><tr><td><a href="javascript:void(0);" onclick="filecodeview.loadDirStruct(\\\'\'+right+\'\\\');" style="font-size:15px;color:#09F;text-decoration:none;">' . $software['name'] . '</a>&nbsp;&nbsp;/&nbsp;&nbsp;<div id="back_path" style="display:inline;"></div></td><td align="right" width="33%"><a href="' . $globals['api_nuphp'] . 'download.php?cid=' . $cid . '&file=package" taget="_blank" style="text-decoration:none">' . $l['download_zip'] . '&nbsp;(\'+size+\')&nbsp;<img src="' . $theme['images'] . 'zip.gif" alt="Download" title="Download" height="35px" width="30px"></a></td></tr></table><div id="soft_dir"></div>\';
				 $("#file_win").html(back_path_div);
				 var soft_dirs = \'<table border="0" cellpadding="10" cellspacing="0" width="100%" class="table table-hover"><th width="50%" class="sai_exp2">' . $l['files'] . '</th><th width="25%" class="sai_exp2">' . $l['size'] . '</th><th width="25%" class="sai_exp2" colspan="2">' . $l['modified_time'] . '</th>\';
				var tr_i = 1;
				 $.each(filecodeview.data_obj, function (i, item) {
					 
					if(tr_i % 2 == 0){
						tr_class = "sai_evenrowcolor";
					}else{
						tr_class = "sai_oddrowcolor";
					}
					
					var download_td = "<td></td>";
					
					if(item.is_dir == 1){
						var file_ext_ico = "dir.png";
					}else{
						var file_ext_ico = "txt.png";
						download_td = \'<td><a href="' . $globals['api_nuphp'] . 'download.php?cid=' . $cid . '&file=\'+i+\'" taget="_blank" style="text_decoration:none";><img src="' . $theme['images'] . 'downloadbutton.png" alt="Download" title="Download" height="20px" width="20px"></a></td>\';
					}
					var size = new Number((item.size/1024)+"").toFixed(parseInt(2));
					size = size+" kb";
					if(item.modified == "" || typeof(item.modified) == "undefined"){
						var m_time = "--";
					}else{
						var m_time = filecodeview.timeConverter(item.modified);
					}
					
					if(i.search("/") <= 0){
						var right = "right";
						soft_dirs += \'<tr class=\'+tr_class+\'><td><img src="' . $theme['images'] . '\'+file_ext_ico+\'" width="20px" height="20px"/>&nbsp;&nbsp;<a href="javascript:void(0)" onclick="filecodeview.show_tree(\\\'\'+i+\'\\\', \\\'\'+right+\'\\\');" style="text-decoration:none;">\'+i+\'</td><td>\'+size+\'</td><td>\'+m_time+\'</td>\'+download_td+\'</tr>\';
						tr_i += 1;
					}
										
				 });// end of each loop

			soft_dirs += "</table>";
			
			$("#soft_dir").css("display", "none");
			$("#soft_dir").html(soft_dirs);
			$("#soft_dir").show("slide", {direction : "left"}, 700);
		
			$(".sai_altrowstable tr").mouseover(function(){
				var old_class = $(this).attr("class");
				//alert(old_class);
				$(this).attr("class", "sai_tr_bgcolor");
				
				$(this).mouseout(function(){
					$(this).attr("class", old_class);
				});
			});
			 
		}, // End of loadDirStruct

		show_tree : function(current, direction){
		//alert(current);
			if(filecodeview.data_obj[current].is_dir == 0){
				var size = new Number((filecodeview.data_obj[current].size/1024)+"").toFixed(parseInt(2));
				size = size+" kb";
				download_td = \'<a href="' . $globals['api_nuphp'] . 'download.php?cid=' . $cid . '&file=\'+current+\'" taget="_blank" style="text_decoration:none";><img src="' . $theme['images'] . 'downloadbutton.png" alt="Download" title="Download" height="20px" width="20px"></a>\';
				var soft_file = \'<div style="height:600px;width:100%;"><div style="background-color:#E8E8E8;box-shadow: 0 5px 5px 0 #CCCCCC;text-shadow: 2px 2px 2px #FFFFFF;padding:10px;font-size:13px;">\'+current.substr((current.lastIndexOf("/")+1))+\'&nbsp;&nbsp;<img src="' . $theme['images'] . 'action_separator.png">&nbsp;&nbsp;\'+size+\'&nbsp;&nbsp;<img src="' . $theme['images'] . 'action_separator.png">&nbsp;&nbsp;\'+download_td+\'</div><iframe src="' . $globals['api_nuphp'] . 'file_giver.php?cid=' . $cid . '&giveinfo=codeview&file=\'+current+\'" width="100%" height="100%" frameborder="0" class="sai_iframe_class" id="filecode"></iframe></div>\';
				//$("#soft_dir").css("display", "none");
				$("#soft_dir").html(soft_file);
				$("#soft_dir").show("slide", {direction : "right"}, 700);
				
			}else{
				
				var soft_dirs = \'<div id="back_path" ></div><table border="0" cellpadding="10" cellspacing="0" width="100%" class="table table-hover"><tr><th width="50%" class="sai_exp2">' . $l['files'] . '</th><th width="25%" class="sai_exp2">' . $l['size'] . '</th><th width="25%" class="sai_exp2" colspan="2">' . $l['modified_time'] . '</th></tr>\';
			 var tr_i = 1;
			 $.each(filecodeview.data_obj, function (i, item) {
				 
				if(tr_i % 2 == 0){
					tr_class = "sai_evenrowcolor";
				}else{
					tr_class = "sai_oddrowcolor";
				}
				
				var download_td = "<td></td>";
				if(item.is_dir == 1){
					var file_ext_ico = "dir.png";
				}else{
					var file_ext_ico = "txt.png";
					download_td = \'<td><a href="' . $globals['api_nuphp'] . 'download.php?cid=' . $cid . '&file=\'+i+\'"><img src="' . $theme['images'] . 'downloadbutton.png" alt="Download" title="Download" height="20px" width="20px"></a></td>\';
				}

				var rgxp = new RegExp("^"+current, "i");
				var rgxpnot = new RegExp("^"+current+"/(.*)/(.*)", "gi");
				if(i.match(rgxpnot)){
					return;
				}
				
				if(i.match(rgxp)){
					// This new_i is defined because we are changing the value of i for display purpose
					var new_i = i;
					// We are adding / to i bcoz same filename as folder should not be replaced otherwise only extension will be displayed
					if(item.is_dir == 1){
						i = i + "/";
					}
					
					// If we are not in the directory why should we go ahead right !!
					if(!i.match(current+"/")) return;
					
					i = i.replace(current+"/","");
					
					var size = new Number((item.size/1024)+"").toFixed(parseInt(2));
					size = size+" kb";
					if(item.modified == "" || typeof(item.modified) == "undefined"){
						var m_time = "--";
					}else{
						var m_time = filecodeview.timeConverter(item.modified);
					}
					
					// Now count the / occured bcoz only the current folder we have to display
					var count_i = i.split("/");
					// For checking the right file to be displayed
					if((count_i.length) <= 2 && i.length > 0){
						
						var right = "right";
						soft_dirs += \'<tr class=\'+tr_class+\'><td><img src="' . $theme['images'] . '\'+file_ext_ico+\'" width="20px" height="20px"/>&nbsp;<a href="javascript:void(0)" onclick="filecodeview.show_tree(\\\'\'+new_i+\'\\\', \\\'\'+right+\'\\\');" style="text-decoration:none;">\'+i+\'</td><td>\'+size+\'</td><td>\'+m_time+\'</td>\'+download_td+\'</tr>\';
						tr_i += 1;
					}
				}
									
			 });// end of each loop
		
				soft_dirs += "</table>";
				var seperated_path = new Array();
				var new_joined_path = "";
				var final_path = "";
				if(current.search("/") >= 0){
					
					var new_back_path = current.substr(current.lastIndexOf("/"));
					seperated_path = current.split("/");
					for(var i = 0; i < (seperated_path.length); i++){
						if(i>0){
							var seperator = "/";
						}else{
							var seperator = "";
						}
						var left = "left";
						new_joined_path += seperator+seperated_path[i]; 
						final_path += \'<a href="javascript:void(0);" onclick="filecodeview.show_tree(\\\'\'+new_joined_path+\'\\\', \\\'\'+left+\'\\\');" style="font-size:16px;color:#09F;text-decoration:none;">\'+seperated_path[i]+\'</a>&nbsp;&nbsp;/&nbsp;&nbsp;\';
					}
					
				}else{
					var left = "left";
					var new_back_path = current;
					final_path += \'<a href="javascript:void(0);" onclick="filecodeview.show_tree(\\\'\'+current+\'\\\', \\\'\'+left+\'\\\');" style="font-size:16px;color:#09F;text-decoration:none;">\'+current+\' </a>\';	
				}
				
				
				
				
				$("#back_path").html(final_path);
				$("#soft_dir").css("display", "none");
				$("#soft_dir").html(soft_dirs);
				$("#soft_dir").show("slide", {direction : direction}, 700);
				
				
			}// End of else
			$(".sai_altrowstable tr").mouseover(function(){
					var old_class = $(this).attr("class");
					//alert(old_class);
					$(this).attr("class", "sai_tr_bgcolor");
					
					$(this).mouseout(function(){
						$(this).attr("class", old_class);
					});
				});
		}, //End of show_tree
		
		timeConverter : function(timestamp){
			
			 var a = new Date(timestamp*1000);
			 var months = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
			 var year = a.getFullYear();
			 var month = months[a.getMonth()];
			 var date = a.getDate();
			 var hour = a.getHours();
			 var min = a.getMinutes();
			 var sec = a.getSeconds();
			 var time = date+","+month+" "+year+" "+hour+":"+min+":"+sec ;
			 return time;
		 }
		 
	};// end of filecodeview

	// ]]></script>';
    $info['ratings'] = '';
    $info['reviews'] = '<div id="allreviews"></div>';
    foreach ($info as $k => $v) {
        if (in_array($k, array('demo', 'support'))) {
            continue;
        }
        echo '<div id="' . $k . '_win" style="display: ' . ($init_tab == $k ? "block" : "none") . ';">
		' . $v . '
		</div>';
    }
    echo '</div><!--end of bg class-->';
    softfooter();
}
Пример #9
0
function software_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error, $scripts, $allcatwise;
    global $software, $soft, $info, $settings, $init_tab, $dbtype, $dbs, $installed, $__settings, $setupcontinue, $installations, $notes, $cron, $datadir, $ajaxdb, $ajaxdbexists, $overwrite_option, $protocols, $nopackage, $can_publish, $not_default, $child, $install_option, $multi_ver, $child_sids, $installation_keys, $no_autoupgrade, $ajaxhttpsexists, $ajaxhttps, $new_insid, $pfx_error, $owned_themes;
    if (optGET('notify')) {
        get_softaculous_file('http://www.softaculous.com/notifyversion.php?softid="' . $soft . '"');
        echo 1;
        return true;
    }
    if (optGET('ajaxdownload') && !empty($nopackage)) {
        // Try to download the package
        if (method_exists($softpanel, 'updatesoftwares')) {
            $softpanel->updatesoftwares($soft, 0, 0, 1);
            echo 1;
            return true;
        }
        // False call
        echo 0;
        return false;
    }
    // Give the staus
    if (optGET('ajaxstatus')) {
        $_status = soft_progress(optGET('ajaxstatus'));
        $tmp_status = unserialize($_status[1]);
        $_status[1] = $tmp_status['current_status'];
        if (!empty($_status)) {
            echo implode('|', $_status);
            return true;
        }
        // False call
        echo 0;
        return false;
    }
    // If generate order call
    if (optGET('generate_order')) {
        $order_id = get_softaculous_file($globals['apipfx'] . 'fetch.php?apikey=' . $user['pfxapi_key'] . '&email=' . $user['email'] . '&pid=' . optGET('theme_id') . '&giveinfo=generate_order&index=' . rawurlencode($globals['index']));
        echo json_encode($order_id);
        return true;
    }
    if (!empty($ajaxdb)) {
        echo $ajaxdbexists;
        return true;
    }
    if (!empty($ajaxhttps)) {
        echo $ajaxhttpsexists;
        return true;
    }
    // Auto Installation responses
    if (isset($_GET['autoinstall'])) {
        // Installed successfully
        if (!empty($installed)) {
            echo 'installed';
            return true;
        }
        // Are there errors
        if (!empty($error)) {
            echo serialize($error);
            return false;
        }
    }
    $multi_ver = optGET('multi_ver');
    if (!empty($multi_ver)) {
        $init_tab = "install";
    }
    //First add the installation info
    if (empty($installed)) {
        $random_username = true;
        // This is to see if a script has predefined username and cannot be changed
        foreach ($settings as $ik => $iv) {
            if ($ik == 'hidden') {
                continue;
            }
            foreach ($iv as $ikk => $ivv) {
                if ($ikk == 'admin_username' && preg_match('/disabled=\\"disabled\\"/ie', $ivv['tag'])) {
                    $random_username = false;
                }
            }
        }
        $info['install'] = '<div id="fadeout_div"><form accept-charset="' . $globals['charset'] . '" name="installsoftware" method="post" action="" onsubmit="return checkform();" id="installsoftware" class="form-horizontal">';
        if (empty($globals['lictype']) && !empty($scripts[$soft]['force_scripts'])) {
            $info['install'] .= '<center class="alert alert-warning">' . lang_vars($l['not_in_free'], array($software['name'])) . (!webuzo() ? '&nbsp;&nbsp;' . $l['notify_admin'] : '') . '</center>';
        }
        $info['install'] .= error_handle($error, "100%", 0, 1) . '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[


function selectversion(){
	var v = 0;
	v = $_("softbranch").value;
	
	$("#multiver_wait").css("display","");
	
	 $.ajax({
		type: "POST",
		url: "' . $globals['index'] . 'act=software&soft="+v+"&tab=install&multi_ver=1&jsnohf=1",
		// Checking for error
		success: function(data){
			$("#multiver_wait").css("display","none");
			var $response=$(data);
			//query the jq object for the values
			var output = $response.find("#install_win").html();
			$("#install_win").html(output);
			softmail();
			show_backup();
			check_pass_strength();
			' . (!empty($globals['random_pass']) ? '$("#admin_pass").val(randstr(10, 1, ' . (!empty($globals['pass_strength']) ? $globals['pass_strength'] : 0) . '));check_pass_strength();' : '') . (!empty($globals['random_username']) && !empty($random_username) ? '$("#admin_username").val(randstr(5));' : '') . (!empty($globals['empty_username']) && !empty($random_username) ? '$("#admin_username").val("");' : '') . (!empty($globals['admin_prefix']) && !empty($random_username) && empty($globals['random_username']) && empty($globals['empty_username']) ? 'prepend_prefix(\'' . $globals['admin_prefix'] . '\');' : '') . (!empty($globals['empty_pass']) ? '$("#admin_pass").val("");check_pass_strength();' : '') . '
		},
		error: function(data) {
			//alert(data.description);
			return false;
		}
	}); 
}

function toggle_advoptions(ele){
	//alert("#"+ele);
	if ($("#"+ele).is(":hidden")){
		$("#"+ele).slideDown("slow");
		$("#"+ele+"_toggle_plus").attr("src", "' . $theme['images'] . 'minus_new.gif");
	}
	else{
		$("#"+ele).slideUp("slow");
		$("#"+ele+"_toggle_plus").attr("src", "' . $theme['images'] . 'plus_new.gif");
	}
}

function plus_onmouseover(ele){
	$("#"+ele.id+"_plus").attr("src", "' . $theme['images'] . 'plus_hover.gif");
}

function plus_onmouseout(ele){
	$("#"+ele.id+"_plus").attr("src", "' . $theme['images'] . 'plus.gif");
}

function display_pass_strength(score, per){
	
	var lang;
	//disp_per = $("#pass-strength-hidden").val();
	
	if(typeof per == "undefined") per = 0;
	
	if(score == "bad") lang = "' . $l['bad'] . '";
	if(score == "good") lang = "' . $l['good'] . '";
	if(score == "strong") lang = "' . $l['strong'] . '";
	if(score == "short") lang = "' . $l['short'] . '";
	if(score == "strength_indicator") lang = "' . $l['strength_indicator'] . '";
	
	$("#pass-strength-result").addClass(score).html( lang+" ("+per+"/100)" );
}

function checkform(dosubmit){
	
	// If admin has set the password strength than only we will check for it.
	' . (!empty($globals['pass_strength']) ? '
	//alert($("#pass-strength-hidden").val());
	if(parseInt($("#pass-strength-hidden").val()) < ' . $globals['pass_strength'] . '){
		alert("' . $l['err_pass_strength'] . '"+' . $globals['pass_strength'] . ');
		return false;
	}' : '') . '
	
	try{
		if(!formcheck()){
			return false;
		}
	}catch(e){
		//Do nothing
	}
	$_("softsubmitbut").disabled = true;	
	
	if(!get_package()){
		return false;
	}
	
	if(useprog){
		
		// Send a request to check the status
		progressbar.start();
		
		// Return false so that the form is not submitted
		return false;
	
	// This is OLD School !
	}else{		
		if(dosubmit == 1){			
			$_("installsoftware").submit();	
		}
		show_msg("' . $l['installing'] . '");
	}
	
	return true;
	
};

var progressbar = {
	timer: 0,
	total_width: 0,	
	status_key: "",
	synctimer: 0,
	fadeout_div: "#fadeout_div",
	win_div: "#install_win",
	progress_div: "#progress_bar",
	formid: "#installsoftware",
	frequency: 8000,
	
	current: function(){
		try{
			var tmp_cur = Math.round(parseInt($_("progress_color").width)/parseInt($_("table_progress").width)*100);
			if(tmp_cur > 100){
				tmp_cur = 99;
			}
			return tmp_cur;
		}catch(e){
			return -1;	
		}
	},
	
	reset: function(){ try{
		clearTimeout(this.timer);
		$_("progress_color").width = 1;
	}catch(e){ }},
	
	move: function(dest, speed, todo){ try{
		var cur = this.current();
		if(cur < 0){
			clearTimeout(this.timer);
			return false;
		}
		var cent = cur + 1;
		var new_width = cent/100*this.total_width;
		if(new_width < 1){
			new_width = 1;
		}
		//alert(new_width+" "+dest+" "+cent);
		$_("progress_color").width = new_width;
		$_("progress_percent").innerHTML = "("+cent+" %)";
		
		if(cent < dest){
			this.timer = setTimeout("progressbar.move("+dest+", "+speed+")", speed);
		}else{
			eval(todo);	
		}
	}catch(e){ }},
	
	text: function(txt){ try{
		$_("progress_txt").innerHTML = txt;
	}catch(e){ }},
	
	sync: function(){
		if(progressbar.status_key.length < 2){
			return false;
		}
		$.ajax({
			url: window.location+"&ajaxstatus="+progressbar.status_key+"&random="+Math.random(),
			type: "GET",
			success: function(data){
				if(data == 0) return false;
				var tmp = data.split("|");
				var cur = progressbar.current();
				tmp[2] = (3000/(tmp[0]-cur));
				//alert(tmp);
				if(tmp[0] > cur){
					if(parseInt(tmp[2]) == 0){
						tmp[2] = 800;
					}
					progressbar.move(tmp[0], tmp[2]);
				}
				progressbar.text(tmp[1]);
				progressbar.synctimer = setTimeout("progressbar.sync()", progressbar.frequency);
			}
		});
	},
	
	sync_abort: function(){
		clearTimeout(this.synctimer);
	},
	
	start: function(){ try{
		this.post();
		this.reset();
		this.total_width = parseInt($_("table_progress").width);
		this.move(95, 800);
		this.status_key = $("#soft_status_key").attr("value");
		this.sync();
	}catch(e){ }},
	
	post: function(){
		
		// Scroll to the Top and show the progress bar
		goto_top();
		$(progressbar.fadeout_div).fadeOut(500, 
			function(){
				$(progressbar.progress_div).fadeOut(1);
				$(progressbar.progress_div).fadeIn(500);
			}
		);
		
		try{
			var sid = $_("softbranch").value;
		}catch(e){
			var sid = ' . $soft . '
		}
		
		$.ajax({
			url: window.location+"&jsnohf=1&soft="+sid+"&multi_ver=1",
			type: "POST",
			data: $(progressbar.formid).serialize(),
			complete: function( jqXHR, status, responseText ) {
				
				progressbar.sync_abort();
				
				// Store the response as specified by the jqXHR object
				responseText = jqXHR.responseText;
				
				try{
					//alert(responseText);
					if(responseText.match(/\\<\\!\\-\\-PROC_DONE\\-\\-\\>/gi)){
						progressbar.text("' . addslashes($l['finishing_process']) . '");
						progressbar.move(99, 10, "$(progressbar.progress_div).fadeOut(1)");
					}else{
						progressbar.reset();
					}
				}catch(e){ }
				
				if ( jqXHR.isResolved() ) {
				
					// #4825: Get the actual response in case
					// a dataFilter is present in ajaxSettings
					jqXHR.done(function( r ) {
						responseText = r;
					});
			
					// Create a dummy div to hold the results
					// inject the contents of the document in, removing the scripts
					// to avoid any "Permission Denied" errors in IE
					var newhtml = jQuery("<div>").append(responseText).find(progressbar.win_div).html();
					
					$(progressbar.win_div).animate({opacity: 0}, 1000, "", function(){
						$(progressbar.win_div).html(newhtml);
						show_backup();
						check_pass_strength();
						new_theme_funcs_init();
						if($("#theme_div").length != 0){
							theme_init();
						}
					}).delay(50).animate({opacity: 1}, 500);
					//alert(newhtml);
					
				}else{
					alert("Oops ... the connection was lost");
				}
			}
		});
	}
};

function show_msg(msg){	
	$_("show_txt").innerHTML = "<br /><br /> &nbsp; "+msg+" &nbsp; <img src=\\"' . $theme['images'] . 'progress.gif\\" />";
	$_("show_txt").style.display = "";
}

// Is the package there ?
var nopackage = ' . (empty($nopackage) ? 0 : 1) . ';

// Use the Progress Bar ?
var useprog = 1; 
try{
	if(BrowserDetect.browser.toLowerCase() == "safari" && BrowserDetect.version.toString().substr(0, 1) == "3"){
		useprog = 0;
	}
}catch(e){ }

function get_package(){	
	if(nopackage){
		
		show_msg("' . $l['downloading'] . '");
		
		try{		
			AJAX("' . $globals['index'] . 'act=software&soft=' . $soft . '&ajaxdownload=1&random="+Math.random(), "get_package_handle(re)");
		}catch(e){ }
		
		return false;
	}else{
		$_("show_txt").style.display = "none";
		return true;
	}
};

function get_package_handle(resp){
	nopackage = 0;
	show_msg("' . $l['installing'] . '");
	checkform(1);
};

softemail = new Object();
function softmail(){
	try{
		var sofdom = "softdomain";
		for(x in softemail){
			if(softemail[x] == true) continue;
			var temp = $_(x).value.split("@");
			if($_(sofdom).value.indexOf("/") > 0){
				var dom_value = $_(sofdom).value.substring(0, $_(sofdom).value.indexOf("/"));
			}else{
				var dom_value = $_(sofdom).value;
			}
			$_(x).value = temp[0] + "@" + dom_value;
		}
	}catch(e){
		return false;
	}
};

function checkhttps(proto_id, softdomain_id, alrt){
	try{
		var id = $_(proto_id);
		var proto = id.options[id.selectedIndex].text;
	
		$("#checkhttps_wait").css("display","inline-block");
		if(proto.indexOf("https") !== -1){
		
			 $.ajax({
				type: "POST",
				url: "' . $globals['index'] . 'act=software&soft=' . $soft . '&checkhttps="+encodeURIComponent(proto+$_(softdomain_id).value),
				timeout:10000,
				// Checking for error
				success: function(data){
					$("#checkhttps_wait").css("display","none");
					is_https(data);
				},
				error: function(jqXHR, status, e) {
					$("#checkhttps_wait").css("display","none");
					is_https(e);
					return false;
				}
			}); 
			
			//AJAX("' . $globals['index'] . 'act=software&soft=' . $soft . '&checkhttps="+id.options[id.selectedIndex].text+$_(softdomain_id).value, "is_https(re)");
		}else{
			$("#checkhttps_wait").css("display","none");
			is_https("true");
		}
		if(alrt == true){
			alert(proto+$_(softdomain_id).value);
		}
	}catch(e){
		//
	}
	return true;
};

function is_https(re){
	try{
		httpserror = "";
		
		//Check if it exists
		if(re !== "true"){
			httpserror = "' . $l['no_https'] . '";
		}
		if(httpserror != ""){
			$_("httpserror").style.display = "block";
			$_("httpserror").innerHTML = httpserror;
			return false;
		}else{
			$_("httpserror").style.display = "none";
		}
		
	}catch(e){
		//
	}
	return true;
};

function prepend_prefix(prefix){
	
	// Decide prefix USERNAME, DOMAIN OR USER DEFINED
	if(prefix != "" && prefix == "username") prefix = "' . $softpanel->user['name'] . '";
	if(prefix != "" && prefix == "domain") prefix = "' . current(array_keys($softpanel->domainroots)) . '";
	if(prefix != "" && prefix != "domain" && prefix != "username");
	
	// APPEND OLD USERNAME OR DEFAULT USERNAME
	var old = $_("admin_username").value
	temp = $_("admin_username").value.split("-");
	if (typeof temp[1] == \'string\' || temp[1] instanceof String){
		$_("admin_username").value = prefix+"-"+temp[1];
	}else{
		$_("admin_username").value = prefix+"-"+old;
	}
}

function change_admin_prefix(domain){
	var admin_prefix = \'' . $globals['admin_prefix'] . '\';
	var random_username = \'' . (!empty($random_username) ? 'true' : '') . '\';
	var empty_username = \'' . (empty($globals['empty_username']) ? 'true' : '') . '\';
	var gl_random_username = \'' . (empty($globals['random_username']) ? 'true' : '') . '\';
	if(admin_prefix == "domain" && random_username == "true" && empty_username == "true" && gl_random_username == "true"){
		prepend_prefix(domain);
	}
}
  
// show/hide backup options
function show_backup(){

	var auto_backup = $("#auto_backup").val();
	
	if(auto_backup == 0){
		$("#auto_backup_rotation").attr("disabled", true);
	}else{
		$("#auto_backup_rotation").attr("disabled", false);
	}
	
	return true;
};

' . (!empty($_POST) ? '' : 'addonload(\'softmail();show_backup();\');');
        if (!empty($dbtype)) {
            $info['install'] .= 'function checkdbname(id, alrt){
	try{		
		AJAX("' . $globals['index'] . 'act=software&soft=' . $soft . '&checkdbexists="+$_(id).value, "dbexists(\'"+id+"\', "+alrt+", re)");	
	}catch(e){
		//
	}
	return true;
};

function dbexists(id, alrt, re){
	try{
		
		dberror = "";
		
		//Is the length fine
		if($_(id).value.length > ' . (empty($softpanel->maxdblen) ? 7 : $softpanel->maxdblen) . '){
			dberror = "' . $l['db_name_long'] . '";
		}
		
		//There should be only alphanumeric characters
		if(/[^a-zA-Z0-9]/.test($_(id).value) && !' . aefer() . '0){
			dberror = "' . $l['db_alpha_num'] . '";
		}
		
		//Check if it exists
		if(re == "true"){
			dberror = "' . $l['database_exists'] . '";
		}
		
		if(dberror != ""){
			$_(id+"error").style.display = "block";
			$_(id+"error").innerHTML = dberror;
			if(alrt == true){
				alert(dberror);
			}
			return false;
		}else{
			$_(id+"error").style.display = "none";
		}
		
	}catch(e){
		//
	}
	return true;
};';
        }
        //End of if($dbtype)
        $info['install'] .= '// ]]></script>';
        $info['install'] .= '
<div class="bg">
	<div class="sai_sub_head">' . $l['setup'] . '</div><hr>';
        if (count($software['branch']) > 1) {
            $info['install'] .= '
		<div class="row">
			<div class="col-sm-5">
				<label for="softbranch" class="sai_head">' . $l['choose_version'] . '</label><br />
				<span class="sai_exp2">' . $l['choose_version_exp'] . '</span>
			</div>
			<div class="col-sm-7">
				<select name="softbranch" class="form-control" id="softbranch" onchange="selectversion()" style="display:inline-block;">';
            foreach ($software['branch'] as $ck => $cv) {
                $info['install'] .= '<option value=' . $ck . ' ' . ($cv['ver'] == $software['ver'] ? 'selected="selected"' : '') . '>' . $cv['ver'] . '</option>';
            }
            $info['install'] .= '
				</select><div style="display:none;" id="multiver_wait"><img src="' . $theme['images'] . 'progress.gif" alt="please wait.."></div>
			</div>
		</div><br />';
        }
        if (empty($softpanel->noprotocol) && empty($globals['hide_protocol'])) {
            $info['install'] .= '
		<div class="row">
			<div class="col-sm-5">
				<label for="softproto" class="sai_head">' . $l['choose_protocol'] . '</label><br />
				<span class="sai_exp2">' . $l['choose_protocol_exp'] . '</span>
			</div>
			<div class="col-sm-7">
				<select name="softproto" class="form-control" id="softproto" onblur="checkhttps(\'softproto\', \'softdomain\', false)">';
            foreach ($protocols as $k => $v) {
                $info['install'] .= '<option value="' . $k . '" ' . (optPOST('softproto') == $k || $globals['default_protocol'] == $k && empty($_POST['softproto']) ? 'selected="selected"' : '') . '>' . $v . '</option>';
            }
            $info['install'] .= '</select><div style="display:none;" id="checkhttps_wait">&nbsp;&nbsp;<img src="' . $theme['images'] . 'progress.gif" alt="please wait.."></div><br />
				<div class="row">
					<span id="httpserror" style="display:none; padding:10px;" class="alert alert-danger"></span>
				</div>
			</div>
		</div>';
        }
        $info['install'] .= '
		<div class="row">
			<div class="col-sm-5">';
        $info['install'] .= '
				<label for="softdomain" class="sai_head">' . $l['choose_domain'] . '</label><br />
				<span class="sai_exp2">' . $l['choose_domain_exp'] . '</span>
			</div>
			<div class="col-sm-7">
				<select name="softdomain" class="form-control" id="softdomain" onchange="softmail();change_admin_prefix(this.value);" onblur="checkhttps(\'softproto\', \'softdomain\', false)">';
        if (!empty($globals['blank_domain'])) {
            $info['install'] .= '<option value="" ' . (empty($_POST['softdomain']) ? 'selected="selected"' : '') . '>(' . $l['select_domain'] . ')</option>';
        }
        foreach ($softpanel->domainroots as $domain => $dompath) {
            $info['install'] .= '<option value="' . $domain . '" ' . (!empty($_POST['softdomain']) && $_POST['softdomain'] == $domain ? 'selected="selected"' : '') . '>' . $domain . '</option>';
        }
        $info['install'] .= '
				</select>
			</div>
		</div><br />
		
		<div class="row">
			<div class="col-sm-5">
				<label for="softdirectory" class="sai_head">' . $l['in_directory'] . '</label><br />
				<span class="sai_exp2">' . $l['in_directory_exp'] . '</span>
			</div>
			<div class="col-sm-7">	
				<input type="text" name="softdirectory" class="form-control" id="softdirectory" size="30" value="' . POSTval('softdirectory', !empty($globals['no_prefill']) ? '' : $software['softname']) . '" />
			</div>
		</div><br />';
        if (!empty($datadir)) {
            $info['install'] .= '
		<div class="row">
			<div class="col-sm-5">
				<label for="datadir" class="sai_head">' . $l['datadir'] . '</label><br />
				<span class="sai_exp2">' . $l['datadir_exp'] . '</span>
			</div>
			<div class="col-sm-7">
				<input type="text" name="datadir" class="form-control" id="datadir" size="30" value="' . POSTval('datadir', $datadir) . '" />		
			</div>
		</div><br />';
        }
        if (!empty($dbtype)) {
            $dbname = mysqldbname($software['softname']);
            if (method_exists($softpanel, 'mysqldbname')) {
                $dbname = $softpanel->mysqldbname();
            }
            // This is default
            $dbhost = 'localhost';
            // Don't prefill database details
            if (!empty($globals['no_prefill_db'])) {
                $dbname = '';
                $dbhost = '';
            }
            if (aefer()) {
                $info['install'] .= '
		<div class="row">
			<div class="col-sm-5">
				<label for="softdb" class="sai_head">' . $l['database_name'] . '</label><br />
				<span class="sai_exp2">' . $l['database_name_exp_aefer'] . '</span>
			</div>
			<div class="col-sm-7">
				<input type="text" name="softdb" class="form-control" id="softdb" size="30" value="' . POSTval('softdb', $dbname) . '" onblur="checkdbname(\'softdb\', false)" />
				<span id="softdberror" style="background: #FDB3B3; display:none; width:200px;"></span>
			</div>
		</div><br />';
            }
            if (!empty($softpanel->no_db_create)) {
                // Database Username
                $info['install'] .= '
		<div class="row">
			<div class="col-sm-5">
				<label class="sai_head">' . $l['dbusername'] . '</label><br />
				<span class="sai_exp2">' . $l['dbusername_exp'] . '</span>
			</div>
			<div class="col-sm-7">
				<input type="text" name="dbusername" class="form-control" id="dbusername" size="30" value="' . POSTval('dbusername', '') . '" />
			</div>
		</div><br />';
                // Database Password
                $info['install'] .= '
		<div class="row">
			<div class="col-sm-5">
				<label class="sai_head">' . $l['dbuserpass'] . '</label><br />
				<span class="sai_exp2">' . $l['dbuserpass_exp'] . '</span>
			</div>	
			<div class="col-sm-7"> 	
				<input type="text" name="dbuserpass" class="form-control" id="dbuserpass" size="30" value="' . POSTval('dbuserpass', '') . '" />
			</div>
		</div><br />';
                //Database Host Name
                $info['install'] .= '
		<div class="row">
			<div class="col-sm-5">
				<label for="hostname" class="sai_head">' . $l['hostname'] . '</label><br />
				<span class="sai_exp2">' . $l['hostname_exp'] . '</span>
			</div>	
			<div class="col-sm-7">	
				<input type="text" name="hostname" class="form-control" id="hostname" size="30" value="' . POSTval('hostname', $dbhost) . '" />
			</div>	
		</div><br />
		';
            }
        }
        // Are there any cron jobs
        if (!empty($cron)) {
            $info['install'] .= '
		<div class="row">
			<div class="col-sm-5">
				<span class="sai_head">' . $l['cron_job'] . '</span><br />
				<span class="sai_exp2">' . $l['cron_job_exp'] . '</span>
			</div>
			<div class="col-sm-7">
					<div class="row">
						<div class="col-sm-2">
							<span>' . $l['cron_min'] . '</span>	
							<input type="text" class="form-control" name="cron_min" id="cron_min" size="2" value="' . POSTval('cron_min', $cron['min']) . '" />
						</div>
						<div class="col-sm-2">
							<span>' . $l['cron_hour'] . '</span>
							<input type="text" class="form-control" name="cron_hour" id="cron_hour" size="2" value="' . POSTval('cron_hour', $cron['hour']) . '" />
						</div>
						<div class="col-sm-2">
							<span>' . $l['cron_day'] . '</span>
							<input type="text" class="form-control" name="cron_day" id="cron_day" size="2" value="' . POSTval('cron_day', $cron['day']) . '" />
						</div>
						<div class="col-sm-2">
							<span>' . $l['cron_month'] . '</span>
							<input type="text" class="form-control" name="cron_month" id="cron_month" size="2" value="' . POSTval('cron_month', $cron['month']) . '" />
						</div>
						<div class="col-sm-2">
							<span>' . $l['cron_weekday'] . '</span>
							<input type="text" class="form-control" name="cron_weekday" id="cron_weekday" size="2" value="' . POSTval('cron_weekday', $cron['weekday']) . '" />
						</div>
					</div>
			</div>
		</div><br />';
        }
        if (!empty($overwrite_option)) {
            $info['install'] .= '
		<div class="row">
			<div class="col-sm-5">
				<span class="sai_head">' . $l['overwrite'] . '</span>
			</div>
			<div class="col-sm-7">
				<input type="checkbox" name="overwrite_existing" id="overwrite_existing" />
			</div>
		</div>';
        }
        $info['install'] .= '</div><br /><!--end of bg class-->';
        if (!empty($settings)) {
            if (file_exists($software['path'] . '/install.js')) {
                $info['install'] .= '<script language="javascript" type="text/javascript"><!--// --><![CDATA[';
                $info['install'] .= @parselanguages(str_replace('$(', '$_(', implode('', file($software['path'] . '/install.js'))));
                $info['install'] .= '// ]]></script>';
            }
            foreach ($settings as $group => $sets) {
                if ($group == 'hidden' || empty($sets)) {
                    continue;
                }
                $info['install'] .= '
					<div class="bg">
						<div class="sai_sub_head">' . $group . '</div><hr>';
                foreach ($sets as $sk => $sv) {
                    //Adding class to input
                    if (preg_match('/type="text"/is', $sv['tag'])) {
                        $sv['tag'] = preg_replace('/>/is', ' class="form-control">', $sv['tag']);
                    }
                    if (preg_match('/<select/is', $sv['tag'])) {
                        $sv['tag'] = preg_replace('/<select/is', '<select class="form-control"', $sv['tag']);
                    }
                    $info['install'] .= '
								<div class="row">
									<div class="col-sm-5">
										<label for=' . $sk . ' class="sai_head" id="sai_head">' . $sv['head'] . '</label>
											' . (empty($sv['exp']) ? '' : '<span class="sai_exp">' . $sv['exp'] . '</span>') . '	
									</div>
									' . (preg_match('/admin_pass|softpass/is', $sv['tag']) ? preg_replace('/>|\\/>/is', ' onkeyup="check_pass_strength();" >', '
										<div class="col-sm-6">' . $sv['tag'] . '<div id="pass-strength-result" style="border-radius:3px;">' . $l['strength_indicator'] . '</div></div>') : '<div class="col-sm-7 ">' . $sv['tag'] . '</div>') . '
										' . (preg_match('/softmail/is', $sv['tag']) ? '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
										softemail["' . $sk . '"] = false;
										//Add an event handler
										$_("' . $sk . '").onkeydown = function(){
											softemail["' . $sk . '"] = true;
										}
										// ]]></script>
										' : '') . '
										' . (preg_match('/admin_pass|softpass/is', $sv['tag']) ? '
										<div class="col-sm-1">
											<a href="javascript: void(0);"  onclick="$_(\'' . $sk . '\').value=randstr(10, 1, ' . (!empty($globals['pass_strength']) ? $globals['pass_strength'] : 0) . ');check_pass_strength();return false;" title="' . $l['randpass'] . '"><img src="' . $theme['images'] . 'randpass.gif" /></a>
										</div>
										<div class="clearfix"></div>
										' : '') . '
										
										' . (preg_match('/admin_pass|softpass/is', $sv['tag']) && (!empty($softpanel->securepass) || !empty($globals['random_pass'])) ? '
										<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
										addonload(\'$_("' . $sk . '").value=randstr(10, 1, ' . (!empty($globals['pass_strength']) ? $globals['pass_strength'] : 0) . ');check_pass_strength();\');
										// ]]></script>
										' : '') . '
										' . (preg_match('/admin_pass|softpass/is', $sv['tag']) && !empty($globals['empty_pass']) ? '
										<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
										addonload(\'$_("' . $sk . '").value="";check_pass_strength();\');
										// ]]></script>
										' : '') . '
										' . (preg_match('/dbprefix/is', $sv['tag']) && !empty($globals['random_dbprefix']) ? '
										<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
										addonload(\'$_("' . $sk . '").value=randstr(3)+"_";\');
										// ]]></script>
										' : '') . '
										' . (preg_match('/admin_username/is', $sv['tag']) && !empty($globals['random_username']) && !empty($random_username) ? '
										<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
										addonload(\'$_("' . $sk . '").value=randstr(5);\');
										// ]]></script>
										' : '') . '
										' . (preg_match('/admin_username/is', $sv['tag']) && !empty($globals['empty_username']) && !empty($random_username) ? '
										<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
										addonload(\'$_("' . $sk . '").value="";\');
										// ]]></script>
										' : '') . '
										' . (preg_match('/admin_username/is', $sv['tag']) && !empty($globals['admin_prefix']) && empty($globals['empty_username']) && empty($globals['random_username']) && !empty($random_username) ? '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
										addonload(\'prepend_prefix("' . $globals['admin_prefix'] . '");\');
											// ]]></script>
										' : '') . '
								</div><br />';
                }
                $info['install'] .= '
					</div><br /><!--end of bg class-->';
            }
            //The Hidden groups
            if (!empty($settings['hidden'])) {
                foreach ($settings['hidden'] as $sk => $sv) {
                    $info['install'] .= $sv['tag'] . '
				' . (preg_match('/softmail/is', $sv['tag']) ? '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
				softemail["' . $sk . '"] = false;
				//Add an event handler
				$_("' . $sk . '").onkeydown = function(){
					softemail["' . $sk . '"] = true;
				}
				// ]]></script>
				' : '');
                }
            }
        }
        //End of if($settings)
        //Is it a SOFTCOPY, then Leave a NOTE
        if (!empty($setupcontinue)) {
            $info['install'] .= '
		' . $l['softcopy_note'] . '
		';
        }
        // Advance option
        $info['install'] .= '
	<div class="bg">
		<div class="sai_sub_head" id="advoptions_toggle" onclick="toggle_advoptions(\'advoptions\');" style="cursor:pointer"><img id="advoptions_toggle_plus"  src="' . $theme['images'] . 'plus_new.gif" style="margin-top:-4px;"/>&nbsp;&nbsp;' . $l['adv_option'] . '</div>
			<div id="advoptions" style="display:none;"><hr>
				' . (empty($dbtype) || aefer() ? "" : '<div class="row">
					<div class="col-sm-5">
						<label for="softdb" class="sai_head">' . $l['database_name'] . '</label><br />
						<span class="sai_exp2">' . $l['database_name_exp'] . '</span>
					</div>
					<div class="col-sm-7">
						<input type="text" name="softdb" class="form-control" id="softdb" size="30" value="' . POSTval('softdb', $dbname) . '" onblur="checkdbname(\'softdb\', false)" /><br />
						<span id="softdberror" style="background: #FDB3B3; display:none; width:200px;"></span>
					</div>
				</div>') . '

				<div class="row">
					<div class="col-sm-5">
						<label class="sai_head">' . $l['disable_notify_update'] . '</label>
						<span class="sai_exp">' . $l['exp_disable_notify_update'] . '</span>
					</div>
					<div class="col-sm-7">
						<input type="checkbox" name="disable_notify_update" id="disable_notify_update" ' . POSTchecked('disable_notify_update') . ' />
					</div>	
				</div><br />';
        // Auto upgrade is not available in AMPPS
        if ($globals['softpanel'] != 'ampps' && !empty($scripts[$soft]['auto_upgrade']) && empty($no_autoupgrade['disable_autoupgrade']) && empty($no_autoupgrade['scripts'][$soft])) {
            $info['install'] .= '
					<div class="row">
						<div class="col-sm-5">
							<label class="sai_head">' . $l['eu_auto_upgrade'] . '</label>
							<span class="sai_exp">' . $l['exp_eu_auto_upgrade'] . '</span>
						</div>
						<div class="col-sm-7">
							<input type="checkbox" name="eu_auto_upgrade" id="eu_auto_upgrade" ' . POSTchecked('eu_auto_upgrade', $globals['enable_auto_upgrade']) . (!empty($globals['force_auto_upgrade']) ? ' checked="checked" disabled' : '') . '/>
						</div>	
					</div><br />';
        }
        // Auto upgrade plugins
        if (empty($globals['off_upgrade_plugins']) && !empty($software['update_plugins'])) {
            $info['install'] .= '
					<div class="row">
						<div class="col-sm-5">
							<label class="sai_head">' . lang_vars($l['auto_upgrade_plugins'], array($software['name'])) . '</label>
							<span class="sai_exp">' . lang_vars($l['exp_auto_upgrade_plugins'], array($software['name'])) . '</span>
						</div>
						<div class="col-sm-7">
							<input type="checkbox" name="auto_upgrade_plugins" id="auto_upgrade_plugins" ' . POSTchecked('auto_upgrade_plugins') . ' />
						</div>	
					</div><br />';
        }
        // Auto upgrade themes
        if (empty($globals['off_upgrade_themes']) && !empty($software['update_themes'])) {
            $info['install'] .= '
					<div class="row">
						<div class="col-sm-5">
							<label class="sai_head">' . lang_vars($l['auto_upgrade_themes'], array($software['name'])) . '</label>
							<span class="sai_exp">' . lang_vars($l['exp_auto_upgrade_themes'], array($software['name'])) . '</span>
						</div>
						<div class="col-sm-7">
							<input type="checkbox" name="auto_upgrade_themes" id="auto_upgrade_themes" ' . POSTchecked('auto_upgrade_themes') . ' />
						</div>	
					</div><br />';
        }
        // Auto backups option only if backups is not disabled and panel is not remote
        if (empty($globals['disable_backup_restore']) && empty($globals['disable_auto_backup']) && !aefer() && empty($softpanel->disable_auto_backup)) {
            $info['install'] .= '
					<div class="row">
						<div class="col-sm-5">
							<label for="auto_backup" class="sai_head">' . $l['auto_backup'] . '</label>
							<span class="sai_exp">' . $l['exp_auto_backup'] . '</span>
						</div>
						<div class="col-sm-7">
							<select name="auto_backup" class="form-control" id="auto_backup" onchange="show_backup();">
								<option value="0" ' . POSTselect('auto_backup', '0', 1) . '>' . $l['no_backup'] . '</option>' . (empty($globals['disable_auto_backup_daily']) ? '<option value="daily" ' . POSTselect('auto_backup', 'daily') . '>' . $l['daily'] . '</option>' : '') . (empty($globals['disable_auto_backup_weekly']) ? '<option value="weekly" ' . POSTselect('auto_backup', 'weekly') . '>' . $l['weekly'] . '</option>' : '') . (empty($globals['disable_auto_backup_monthly']) ? '<option value="monthly" ' . POSTselect('auto_backup', 'monthly') . '>' . $l['monthly'] . '</option>' : '') . '
							</select>
						</div>	
					</div><br />
					
					<div class="row">
						<div class="col-sm-5">
							<label class="sai_head">' . $l['auto_backup_rotation'] . '</label>
							<span class="sai_exp">' . $l['exp_auto_backup_rotation'] . '</span>
						</div>
						<div class="col-sm-7"> 
							<select name="auto_backup_rotation" class="form-control" id="auto_backup_rotation">';
            for ($i = 0; $i <= 10; $i++) {
                // Do we have a limit from admin ?
                if (!empty($globals['auto_backup_limit']) && ($i > $globals['auto_backup_limit'] || $i == 0) || !empty($globals['max_backups']) && ($i > $globals['max_backups'] || $i == 0)) {
                    continue;
                }
                $info['install'] .= '<option value="' . $i . '" ' . POSTselect('auto_backup_rotation', $i, $i == 4 ? '1' : '0') . '>' . (empty($i) ? $l['unlimited'] : $i) . '</option>';
            }
            $info['install'] .= '</select>
						</div>	
					</div><br />';
        }
        $info['install'] .= '
			</div>
	</div><br /><!--end of bg-->';
        // Do we have to display the theme
        if (!empty($globals['eu_enable_themes']) && !empty($software['has_theme'])) {
            $info['install'] .= '
		<div class="bg">
			<div id="pfx_div" style="display:none"></div>
		</div><br /><!--end of bg class-->
		<script id="paypal_js" language="javascript" type="text/javascript"></script>
		<script language="javascript" type="text/javascript"><!-- // --><![CDATA[

		var pfx_div = \'' . str_replace(array("\n", "'"), array('', "\\'"), '<style>
		@import url(https://fonts.googleapis.com/css?family=Open+Sans:300light,400light,700light,400,400,700); 
		</style>
		<div id="themesearch" class="sai_popupc" style="display:none;">
			<div class="sai_themesearch_div sai_popuptitle" align="center" style="padding-left:20px;">
					<fieldset class="sai_inputs">
						<div class="row">
							<input type="text"  name="themesearchstring" class="col-sm-10" id="themesearchstring"  class="sai_inputs" autofocus placeholder="Search Themes" autocomplete="off">
							<div class="col-sm-6" style="text-align:right; margin-top:8px;">
								<a href="javascript:void(0);" class="sai_popupclose b-close">Close</a>
							</div>
						</div>
						<div class="row">
							<h4 id="results-text" style="display:none;">Showing results for: <b id="search-string"></b></h4>
							<ul id="results"></ul><br />
						</div>
					</fieldset>
			</div>
			<div id="searchsuggestions"></div>
		</div>
		<div class="sai_sub_head" id="theme_toggle" onclick="toggle_advoptions(\'theme\');" class="sai_heading_full" style="cursor:pointer"><img id="theme_toggle_plus" src="' . $theme['images'] . 'minus_new.gif" />&nbsp;&nbsp;' . $l['choose_theme'] . '</div>
		<div class="row">
			<div id="theme" style="display:block;" class="col-sm-12"><hr>
				<div id="theme_div" style="display:block;">
					<div class="row">
						<div class="col-sm-2">
							<a class="btn btn-default" id="search_theme">' . $l['search'] . '</a>
						</div>
						<div class="col-sm-8">		
							<center>' . $l['theme_is_optional'] . '</center>
						</div>
						<div class="col-sm-2">
							<a class="btn btn-default pull-right" id="refresh_theme">' . $l['refresh'] . '</a>
							<div id="sloading" style="display:none;">
								<center><img src="' . $theme['images'] . 'loading.gif" alt="Loading..." /></center>
							</div>
						</div>
					</div><br />
					
					<div class="row">
						<div style="height:280;">
							<div id="loading" style="display:block;z-index:99;">
								<center><img src="' . $theme['images'] . 'loading.gif" alt="Loading..." /></center>
							</div>
							<center><div id="display_theme" style="height:auto;"></div></center>
						</div>
					</div>
					
					<div class="row">
						<div class="col-sm-1">
							<span id="prevBtn"><a href="javascript:void(0);"></a></span>
						</div>
						<div class="col-sm-10">
							<center><div id="clear_theme" name="clear_theme" class="sai_searchbox_button" onclick="clear_theme();" style="display:none;">' . $l['clear_theme'] . '</div></center>
						</div>
						<div class="col-sm-1">
							<span id="nextBtn"><a href="javascript:void(0);"></a></span>
						</div>	
					</div>
				</div>
			</div>
		</div>') . '\';
			
		var length;
		var deduct;
		var payment_timer;
		var dg;

		' . (!empty($owned_themes) ? 'owned_theme = new Array("' . implode('", "', array_values($owned_themes)) . '");' : 'var owned_theme = new Array();') . '

		var screen_width = $(window).width();

		if(screen_width < 1282 && screen_width > 982){
			length = 3;
			deduct = 3;
		}else if(screen_width < 982 && screen_width >802){
			length = 2;
			deduct = 2;
		}else if(screen_width < 802 && screen_width >770){
			length = 1;
			deduct = 1;
		}else if(screen_width < 770 && screen_width > 362){
			length = 2;
			deduct = 2;
		}else if(screen_width < 363 && screen_width > 200){
			length = 1;
			deduct = 1;
		}else{
			length = 4;
			deduct = 4;
		}

		' . (!empty($softpanel->pheader) ? 'length = 2;deduct = 2;' : '') . '

		' . (empty($user['pfxapi_key']) ? 'var api_key = 0;' : 'var api_key = 1;') . '
		' . (empty($globals['eu_themes_premium']) ? 'var premium = 0;' : 'var premium = "' . $globals['eu_themes_premium'] . '";') . '

		function sleep(milliseconds) {
		  var start = new Date().getTime();
		  for (var i = 0; i < 1e7; i++) {
			if ((new Date().getTime() - start) > milliseconds){
			  break;
			}
		  }
		}

		if(api_key == 0){
		 $.ajax({
			type: "POST",
			data: "generate_apikey=1&ajax=1",
			url: "' . $globals['index'] . 'act=my_themes&jsnohf=1",
			// Checking for error
			success: function(data){
				// Do nothing :)
			}
		 });
		}

		function show_pfx_div(){
			var current_html = $("#pfx_div").html();
			if(current_html == ""){
				$("#pfx_div").html(pfx_div);
				$("#pfx_div").show();
				theme_init();
			}
		}

		function show_pay(){
			
			//alert(arguments[0] +" -- "+arguments[1]+" -- "+arguments[2]+" -- "+arguments[3]);
			//alert($("#paypal_js").attr("src"))
			
			$("#display_theme").fadeOut(100);
			$("#loading").show();
			
			// We will have to create an order now
			$.ajax({
				type: "GET",
				url: window.location+"&generate_order=1&ajax=1&jsnohf=1&theme_id="+arguments[1],
				success: function(data){
					//alert(data)
					var order_id = $.parseJSON(data);
					$("#custom").val(order_id);
					$("#loading").hide();
					$("#display_theme").fadeIn(100);
					//$("#pfxpay").bPopup();			
				}	
			});
			
			$.getScript("https://www.paypalobjects.com/js/external/dg.js", function( data, textStatus, jqxhr ) {
				//alert(data +" -- "+textStatus+" -- "+jqxhr)
				
				if(textStatus == "success"){
					dg = new PAYPAL.apps.DGFlow({
						// HTML ID of form submit buttons that call setEC
						trigger:"submit_pay",
						expType:"instant"
					});
				}
			});
			
			// Now set the variable for sending the data
			$("#item_name").val(arguments[0]);
			$("#item_number").val(arguments[1]);
			$("#amount").val(arguments[2]);
			$("#item_price").html(arguments[2]);
			select_theme(arguments[3]);
			
			$("#submit_pay").click(function(){
				
				/*var timer = setInterval(function() {   
					if(dg.isOpen() !== true) {  
						clearInterval(timer);  
						alert("closed");
					}  
				}, 30000);*/
				$("#pfxpay").bPopup().close();
			});
			
			$(".b-close").click(function(){
				
			});
		}

		function show_selected_theme(){
			
			var th_name = $("#theme_name").val();
			var th_id = $("#theme_id").val();
			
			//alert("' . $globals['s2api_pfx'] . 'theme_search.php?in=json&cversion=' . $software['ver'] . '&cat=' . (!is_int($software['has_theme']) ? $software['has_theme'] : $iscripts[$soft]['name']) . '&q="+th_name+"&start=0&length=1&premium="+premium+"&callback=?")
			
			$.getJSON("' . $globals['s2api_pfx'] . 'theme_search.php?in=json&cversion=' . $software['ver'] . '&cat=' . (!is_int($software['has_theme']) ? $software['has_theme'] : $iscripts[$soft]['name']) . '&q="+th_name+"&start=0&length=1&premium="+premium+"&callback=?",
				function (data) {
					
					var soft_themes = \'<div id="slider"><div class="row">\';
					var new_li = 0;
					$.each(data.data, function (i, item) {
						
						if(item.name != undefined){
							soft_themes += \'<div class="row"><div class="sai_image_container" id="img_\'+new_li+\'" onmouseover="onthemeover(\'+new_li+\');" onmouseout="onthemeout(\'+new_li+\');" value="\'+item.pid+\'" theme_name="\'+item.softname+\'"><div class="sai_theme_header">\'+item.name+\'</div><img src="\'+data.img_url+item.pid+\'/\'+item.pid+\'_200.png" width="100%" height="100" class="img-responsive"><div class="sai_navigation" id="nav_\'+new_li+\'" style="display:none;"><span class="sai_demo"><a href="\'+item.demo_url+\'" target="_blank">' . addslashes($l['demo']) . '</a></span></div></div></div>\';
							soft_themes += \'</div><div class="row"><input type="hidden" name="theme_id" id="theme_id" value="\'+item.pid+\'"><input type="hidden" name="theme_name" id="theme_name" value="\'+item.softname+\'"></div></div>\';
						}
						new_li += 1;
					});// end of each loop
			
					
					$("#display_theme").html(soft_themes);
					$(".sai_image_container").removeClass("sai_theme_selected");
					$(".sai_image_container").addClass("sai_theme_selected");
					$(function(){
						$(".sai_image_container, #select_this_theme").click(function(){
							$(".sai_image_container").removeClass("sai_theme_selected");
							if(this.id == "select_this_theme"){
								$("#"+$(this).attr("val")).addClass("sai_theme_selected");
								$("#theme_id").val($("#"+$(this).attr("val")).attr("value"));
								$("#theme_name").val($("#"+$(this).attr("val")).attr("theme_name"));
							}else{
								$(this).addClass("sai_theme_selected");
								$("#theme_id").val($(this).attr("value"));
								$("#theme_name").val($(this).attr("theme_name"));
							}						
						 })
					});
					
					$("#themesearch").bPopup().close();
				});
		}

		function clear_theme(){
			$(".sai_image_container").removeClass("sai_theme_selected");
			$("#theme_id").val("");
			$("#theme_name").val("");
			$("#clear_theme").hide();
			show_list($("#prevBtn").val(), length);
		}

		function onthemeover(id_no){
			$("#nav_"+id_no).show();
		}

		function onthemeout(id_no){
			$("#nav_"+id_no).hide();
		}

		var startpt;
		function search() {
			
			var query_value = $("input#themesearchstring").val();
			$("b#search-string").html(query_value);
			
			if(startpt == undefined || startpt == ""){
				startpt = 0;
			}
			var top = 0;
			if(query_value === ""){
				top = 1;
			}
			
			$.getJSON("' . $globals['s2api_pfx'] . 'theme_search.php?in=json&cversion=' . $software['ver'] . '&cat=' . (!is_int($software['has_theme']) ? $software['has_theme'] : $iscripts[$soft]['name']) . '&start="+startpt+"&length=20&q="+query_value+"&top="+top+"&premium="+premium+"&callback=?",
			function (data) {
				var search_themes = \'<div id="slider"><table border="0" width="100%" height="200" cellspacing="5" cellpadding="3">\';
				var new_li = 0;
				$.each(data.data, function (i, item) {
					var you_own = "";
					if(item.name != undefined){
					
						var params = new Array();
						params[0] = "\'"+item.name+" - "+item.desc+"\'";
						params[1] = item.pid;
						params[2] = item.price;
						params[3] = "\'simg_"+new_li+"\'";
						
						//alert(item.pid+" -- "+ owned_theme+ " -- "+ $.inArray(item.pid, owned_theme) + " -- "+val_count(owned_theme, item.pid))
						if($.inArray(item.pid, owned_theme) !== -1){
							you_own = \'<img src="' . $theme['images'] . 'success.png" class="someclass" title="' . addslashes($l['your_purchased']) . '(\'+val_count(owned_theme, item.pid)+\')' . addslashes($l['your_purchased_times']) . '" alt="" height="22" width="22">\';
						}else{
							you_own = "&nbsp;";
						}
						
						if(item.price > 0){
							var price_lable = \'<td align="center" width="200"><table border="0" width="100%" cellpadding="0" cellspacing="0"><tr><td width="30%"><div class="sai_searchbox_button" onclick="show_pay(\'+params+\');"><span style="margin-right:20px">\'+you_own+\'</span><a href="javascript:void(0);" >' . addslashes($l['purchase']) . '&nbsp;&nbsp;$\'+item.price+\'</a></div></td></tr></table></td>\';
						}else{
							var price_lable = \'<td align="center" width="20">&nbsp</td>\';
						}
						
						search_themes += \'<tr class="sai_tr_color"><td align="center" style="padding-left:10px;"><table border="0" width="100%" cellspacing="0" cellpadding="3"><tr><td width="180"><div class="sai_image_container" id="simg_\'+new_li+\'" value="\'+item.pid+\'" theme_name="\'+item.softname+\'" style="width:160px;height:175px;"><img src="\'+data.img_url+item.pid+\'/\'+item.pid+\'_200.png" width="150" height="150" ><div class="sai_navigation" id="snav_\'+new_li+\'" style="display:none;"><span class="sai_demo"><a href="\'+item.demo_url+\'" target="_blank">' . addslashes($l['demo']) . '</a></span></div></div></td><td><table border="0" cellpadding="5" cellspacing="0" width="100%"><tr><td colspan="3"><b>\'+item.name+\'</b></td></tr><tr><td colspan="3" class="sai_search_description">\'+item.desc+\'</td></tr><tr><td colspan="3" class="sai_search_description">\'+item.overview+\'</td></tr><tr><td width="200"><div class="sai_searchbox_button" id="select_this_theme" val="simg_\'+new_li+\'">' . addslashes($l['use_this_theme']) . '</div></td><td width="200"><a href="\'+item.demo_url+\'" target="_blank" style="text-decoration:none;"><div class="sai_searchbox_button">' . addslashes($l['demo']) . '</div></a></td>\'+price_lable+\'</tr></table></td><td></td></tr><br /></table></td></tr>\';
					}
					new_li += 1;
				});// end of each loop

				search_themes += \'<tr><td><input type="hidden" name="theme_id" id="theme_id"><input type="hidden" name="theme_name" id="theme_name"></td></tr></table></div>\';
				$("#searchsuggestions").animate(0, "", function(){
					$("#searchsuggestions").html(search_themes);
						$(function(){
							$(".sai_image_container, #select_this_theme").click(function(){
								$(".sai_image_container").removeClass("sai_theme_selected");
								if(this.id == "select_this_theme"){
									$("#"+$(this).attr("val")).addClass("sai_theme_selected");
									$("#theme_id").val($("#"+$(this).attr("val")).attr("value"));
									$("#theme_name").val($("#"+$(this).attr("val")).attr("theme_name"));
									show_selected_theme();
									$("#clear_theme").css("display", "block");
								}else{
									$(this).addClass("sai_theme_selected");
									$("#theme_id").val($(this).attr("value"));
									$("#theme_name").val($(this).attr("theme_name"));
								}						
							 })
						});
				}).delay(0).animate({opacity: 1}, 300);
				
			}); // End of getJSON
		}

		var search_timer;

		$("#themesearchstring").live("keyup", function(e) {
			
			//clearTimeout($.data(this, "timer"));
			var search_string = $(this).val();
			clearTimeout(search_timer);

			if (search_string == "") {
				$("ul#results").fadeOut();
				$("h4#results-text").fadeOut();
				$("#searchsuggestions").html("");
			}else{
				$("ul#results").fadeIn();
				$("h4#results-text").fadeIn();
				search_timer = setTimeout("search();", 200);
			};
		});

		function in_array(val, array){
																
			for (i=0; i <= array.length; i++){
				if (array[i] == val) {
					return true;
					// {alert(i +" -- "+ids[i]+" -- "+val);return i;}
				}
			}
			return false;
		}

		//function to display list of Themes
		function show_list(start, length){
			
			//alert("' . $globals['s2api_pfx'] . 'category.php?in=json&cversion=' . $software['ver'] . '&cat=' . (!is_int($software['has_theme']) ? $software['has_theme'] : $iscripts[$soft]['name']) . '&start="+start+"&length="+length+"&premium="+premium+"&callback=?");
			$.getJSON("' . $globals['s2api_pfx'] . 'category.php?in=json&cversion=' . $software['ver'] . '&cat=' . (!is_int($software['has_theme']) ? $software['has_theme'] : $iscripts[$soft]['name']) . '&start="+start+"&length="+length+"&premium="+premium+"&callback=?", 
			function (data) {
				
				if (typeof(data.data)!="object" || typeof data.data == "undefined"){
					$("#display_theme").html("<center><span class=\'sai_newhead\'>' . $l['classes_con_failed'] . '</span></center>");	
					$("#loading").hide();
					$("#display_theme").fadeIn(300);
					$("#nextBtn").css("display", "none");
					$("#prevBtn").css("display", "none");
				}
				$("#clear_theme").css("display", "none");
				$("#nextBtn").css("display", "block");
				$("#prevBtn").css("display", "block");
				
				var soft_themes = \'<div id="slider"><table border="0" width="100%" height="200" cellspacing="0" cellpadding="3"><tr>\';
				var new_li = 0;
				
				$.each(data.data, function (i, item) {
					
					soft_themes += \'<td align="center"><div class="sai_image_container" id="img_\'+new_li+\'" onmouseover="onthemeover(\'+new_li+\');" onmouseout="onthemeout(\'+new_li+\');" value="\'+item.pid+\'" theme_name="\'+item.softname+\'"><div class="sai_theme_header">\'+item.name+\'</div><img src="\'+data.img_url+item.pid+\'/\'+item.pid+\'_200.png" width="230" height="200" ><div class="sai_navigation" id="nav_\'+new_li+\'" style="display:none;"><span class="sai_demo"><a href="\'+item.demo_url+\'" target="_blank">' . addslashes($l['demo']) . '</a></span></div></div></td>\';
					
					new_li += 1;
					
				});// end of each loop
				
				soft_themes += \'</tr><tr>\';
				var new_li = 0;
				
				$.each(data.data, function (i, item) {
					var you_own = "";
					if(item.name != undefined){
						var params = new Array();
						params[0] = "\'"+item.name+" - "+item.desc+"\'";
						params[1] = item.pid;
						params[2] = item.price;
						params[3] = "\'img_"+new_li+"\'";
						
						//alert(item.pid+" -- "+ owned_theme+ " -- "+ $.inArray(item.pid, owned_theme) + " -- "+val_count(owned_theme, item.pid))
						
						if($.inArray(item.pid, owned_theme) !== -1){
							you_own = \'<img src="' . $theme['images'] . 'success.png" class="someclass" title="' . addslashes($l['your_purchased']) . '(\'+val_count(owned_theme, item.pid)+\')' . addslashes($l['your_purchased_times']) . '" alt="" height="24" width="24">\';
						}else{
							you_own = "&nbsp;";
						}
						
						if(item.price > 0){
							soft_themes += \'<td align="center"><div class="sai_purchased blue" onclick="show_pay(\'+params+\');" data-toggle="modal" data-target="#pfxpay"><table border="0" width="95%"><tr><td width="25%">\'+you_own+\'</td><td width="60%"><a href="javascript:void(0);" >' . addslashes($l['purchase']) . '&nbsp;&nbsp;$\'+item.price+\'</a></td></tr></table></div><br /></td>\';
						}else{
							soft_themes += \'<td align="center"><div class="sai_purchased blue"><table border="0" width="95%"><tr><td align="center" onclick="select_theme(\\\'img_\'+new_li+\'\\\');"><a href="javascript:void(0);"   id="select_theme">' . (!empty($globals['eu_themes_premium']) ? addslashes($l['free']) : addslashes($l['select'])) . '</a></td></tr></table></div><br /></td>\';
						}
					}
					new_li += 1;
				});// end of each loop

				soft_themes += \'</tr><tr><td><input type="hidden" name="theme_id" id="theme_id"><input type="hidden" name="theme_name" id="theme_name"></td></tr></table></div>\';
				
				$("#loading").hide();
				
				$("#display_theme").animate(0, "", function(){
					$("#display_theme").html(soft_themes);
					$(function(){
						$(".sai_image_container").click(function(){
							$(".sai_image_container").removeClass("sai_theme_selected");
							$(this).addClass("sai_theme_selected");
							$("#theme_id").val($(this).attr("value"));
							$("#theme_name").val($(this).attr("theme_name"));
							$("#clear_theme").css("display", "block");
						 })
					});
				}).delay(0).animate({opacity: 1}, 300);
				
				
				
				$("#prevBtn").val(start);
				start = parseInt(start) + length;
				$("#nextBtn").val(start);
				
				if($("#prevBtn").val() <= 0){
					$("#prevBtn").css("display", "none");
				}else{
					$("#prevBtn").css("display", "block");
				}
				
				if(start == (data.count)){
					$("#nextBtn").css("display", "none");
				}
				
				// If we get the last data
				if(data.is_last == 1){
					$("#nextBtn").css("display", "none");
					$("#nextBtn").hide();
				}
				
				$("#display_theme").fadeIn(300);
				
				
			}); // end of get json function
			
			// If we dont get the api key for this user we will generate one !
			if(api_key == 0){
				
				/* $.ajax({
					type: "POST",
					data: "generate_apikey=1",
					url: "' . $globals['index'] . 'act=my_themes&jsnohf=1",
					// Checking for error
					success: function(data){
						// At the moment nothing to do !
					}
				 });*/
			}
		}//end of show list

		function get_purchased(){
			
			$("#refresh_theme").hide();
			$("#sloading").show();
			
			$.ajax({
				type: "POST",
				data: "get_owned_theme=1&ajax=1",
				url: "' . $globals['index'] . 'act=my_themes&jsnohf=1",
				// Checking for error
				success: function(data){
					owned_theme = data.split(",");
					//alert(owned_theme)
					$("#sloading").hide();
					$("#refresh_theme").show();
					show_list(0, length);
				}
			 });
		}

		function select_theme(id){
			$(".sai_image_container").removeClass("sai_theme_selected");
			$("#"+id).addClass("sai_theme_selected");
			$("#theme_id").val($("#"+id).attr("value"));
			$("#theme_name").val($("#"+id).attr("theme_name"));
			$("#clear_theme").css("display", "block");
		}

		function theme_init(){
			
			//get_purchased();
			
			show_list(0, length);
			
			$("#prevBtn").click(function(){
				var tmp = parseInt($("#prevBtn").val());
				$("#nextBtn").val(tmp);
				tmp = tmp - deduct;
				$("#prevBtn").val(tmp);
				$("#display_theme").fadeOut(100);
				$("#loading").show();
				show_list($("#prevBtn").val(), length);
			});
			
			$("#nextBtn").click(function(){
				var tmp = parseInt($("#nextBtn").val());
				$("#prevBtn").val(tmp);
				tmp = tmp + deduct;
				$("#nextBtn").val(tmp);
				$("#display_theme").fadeOut(100);
				$("#loading").show();
				show_list($("#prevBtn").val(), length);
			});
			
			$("#search_theme").click(function(){
				$("#themesearch").bPopup();
				search();
			});
			$(".b-close").click(function(){
				$("#themesearchstring").val("");
			});
			
			$("#refresh_theme").click(function(){
				get_purchased();
			});
			
			$(".someclass").tipTip();
		}

		$(document).ready(function(){

			if($("#install_win").is(":visible")){
				show_pfx_div();
			}
		});

		$("#install").click(function(){
			show_pfx_div();
		});

		// ]]></script>
	';
        }
        $info['install'] .= '
	<p align="center">
		<input type="hidden" name="softsubmit" id="softsubmit" value="' . $l['softsubmit'] . '" />
		<input type="hidden" name="pass-strength-hidden" id="pass-strength-hidden" value="" />
		<input type="submit" name="softsubmitbut" id="softsubmitbut" value="' . $l['softsubmit'] . '" class="flat-butt" /><span id="show_txt" style="display:none;"></span>
		<br /><br /><br />
		' . (empty($globals['off_email_link']) && empty($globals['off_install_mail']) ? '<span class="sai_head">' . $l['ins_emailto'] . '</span> : <input type="text" name="emailto" id="emailto" size="20" value="' . POSTval('emailto', '') . '" />' : '') . '
	</p>
	<input type="hidden" name="soft_status_key" id="soft_status_key" value="' . POSTval('soft_status_key', generateRandStr(32)) . '" />
	</form></div>
';
        if (!empty($globals['eu_enable_themes']) && !empty($software['has_theme'])) {
            $info['install'] .= '
		<div class="modal fade" id="pfxpay" role="dialog">
			<div class="modal-dialog modal-sm">
				<!-- Modal content-->
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal">&times;</button>
						<h4 class="modal-title">' . $l['payment_heading'] . '</h4>
					</div>
					<div class="modal-body" align="middle">
						<form action="' . $globals['paypal_url'] . '" method="post" name="pay" id="pay">
							' . $l['payment_redirect'] . '$<span id="item_price"></span><br /><br />
							<input type="hidden" name="cmd" value="_xclick">
							<input type="hidden" name="business" id="business" value="' . $globals['paypal_business'] . '">
							<input type="hidden" name="return" id="return" value="' . $globals['paypal_return'] . '">
							<input type="hidden" name="cancel_return" id="cancel_return" value="' . $globals['paypal_return'] . '">
							<input type="hidden" name="notify_url" id="notify_url" value="' . $globals['paypal_return'] . '">
							<input type="hidden" name="item_name" id="item_name" value="">
							<input type="hidden" name="item_number" id="item_number" value="">
							<input type="hidden" name="amount" id="amount" value="">
							<input type="hidden" name="custom" id="custom" value="">
							<input type="hidden" name="paymentaction" id="paymentaction" value="sale">
							<!--<input type="submit" class="tiny radius button" value="Buy now">-->
							<button type="submit" name="submit" style="border: 0; background: transparent; cursor:pointer" id="submit_pay">
								<img src="https://www.paypal.com/en_US/i/bnr/horizontal_solution_PPeCheck.gif" border="0" alt="Accepted Cards" style="width:100%;">
							</button>
						</form>
					</div>
					<div class="modal-footer">
					  <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
					</div>
				</div>	
			</div>
		</div>';
        }
        $info['install'] .= '
	<div id="progress_bar" style="height:125px; width:100%; display: none;">
		<br />
		<center>
		<font size="4" color="#222222" id="progress_txt" style="width:100%;">' . $l['checking_data'] . '</font>
		<font style="font-size: 18px;font-weight: 400;color: #444444; width:100%;" id="progress_percent">(0 %)</font><br /><br />
		</center>
		<table width="500" cellpadding="0" cellspacing="0" id="table_progress" border="0" align="center" height="28" style="border:1px solid #CCC; -moz-border-radius: 5px;
		-webkit-border-radius: 5px; border-radius: 5px; width:50%">
			<tr>
				<td id="progress_color" width="1" style="background-image: url(' . $theme['images'] . 'bar.gif); -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px;"></td>
				<td id="progress_nocolor">&nbsp;</td>
			</tr>
		</table><br />
		<center>' . $l['wait_note'] . '</center>
	</div>
	<br /><br /><br />';
    } elseif (!empty($installed)) {
        $info['install'] = '
	<div class="bg2">
	<h4>' . $l['congrats'] . '</h4><br />
	' . $software['name'] . ' ' . $l['succesful'] . ' : <br />
	<a href="' . $__settings['softurl'] . '" target="_blank">' . $__settings['softurl'] . '</a>
	' . (!empty($software['adminurl']) ? '<br />' . $l['admin_url'] . ' : <a href="' . $__settings['softurl'] . '/' . $software['adminurl'] . '" target="_blank">' . $__settings['softurl'] . '/' . $software['adminurl'] . '</a>' : '') . '<br /><br />
	' . (!empty($setupcontinue) ? $l['setup_continue'] . ' : <br />
	<a href="' . $__settings['softurl'] . '/' . $setupcontinue . '" target="_blank">' . $__settings['softurl'] . '/' . $setupcontinue . '</a><br /><br />' : '') . '
	' . $l['enjoy'] . '<br /><br />
	' . (!empty($pfx_error) ? error_handle($pfx_error, "100%", 0, 1) : '') . (!empty($notes) ? $l['install_notes'] . ' : <br />
	<div class="sai_notes">' . softparse($notes, $soft) . '</div><br /><br />' : '') . '
	' . $l['please_note'] . '<br /><br />
	' . (!empty($globals['ampps_enabled']) && empty($globals['no_ampps']) && $globals['softpanel'] != 'ampps' ? lang_vars($l['ampps_download'], array($software['name'])) . '<br /><br />' : '') . '
	' . $l['regards'] . ',<br />
	' . $l['softinstaller'] . '<br /><br />
	<center><b><a href="' . script_link($soft) . '&highlight=' . $new_insid . '&postact=install">' . $l['return'] . '</a></b></center><br /><br />';
        if (empty($globals['install_tweet_off']) || empty($globals['lictype'])) {
            $info['install'] .= '<form method="get" action="http://twitter.com/intent/tweet" id="tweet" onsubmit="return dotweet(this);">
		<div class="panel panel-info" style="width:55%; margin:0 auto;">
			<div class="panel-heading" style="padding:5px; font-size:15px;">
				<font><b>' . $l['install_tweet_sub'] . ' :</b></font>
			</div>
			<div class="panel-body">
				<div class="row">
					<div class="col-sm-10">
						<textarea name="text" cols="80" row="3" style="resize:none; width:100%;">' . loadtweetdata('install_tweet', $l['install_tweet_classes']) . '</textarea>
					</div>
					<div class="col-sm-2">
						<input type="submit" value="Tweet!" class="btn btn-info" onsubmit="return false;" id="twitter-btn" style="margin-top:20px;"/>
					</div>
				</div>
			</div>
		</div>
		</form>';
        }
        $info['install'] .= '<br /></div><!--end of bg2 class--><!--PROC_DONE-->
	<br /><br />';
    }
    softheader($l['<title>'] . $software['name']);
    $loadedinfo = array('install', 'overview', 'features', 'reviews', 'screenshots', 'ratings');
    ?>
<script language="JavaScript" src="<?php 
    echo $theme['url'] . '/js/tabber.js';
    ?>
" type="text/javascript">
</script>
<script language="JavaScript" id="ratings_js_file" type="text/javascript"></script>
<script language="JavaScript" id="review_js_file"  type="text/javascript"></script>
<script language="JavaScript" id="reviews_js_file"  type="text/javascript"></script>
<script type="text/javascript">
tabs = new tabber;
tabs.tabs = new Array('<?php 
    echo implode('\', \'', $loadedinfo);
    ?>
');
tabs.tabwindows = new Array('<?php 
    echo implode('_win\', \'', $loadedinfo);
    ?>
_win');
tabs.inittab = <?php 
    echo '\'' . $init_tab . '\';';
    ?>
addonload('tabs.init();loadraterev();check_pass_strength();');

function loadraterev(){
<?php 
    if (empty($globals['off_rating_link']) && $soft < 10000) {
        echo '$_(\'ratings_js_file\').src = "https://www.softaculous.com/ratings.js?soft=' . $soft . '&user='******'name'] . '&ip=' . $_SERVER['SERVER_ADDR'] . '";';
    }
    if (empty($globals['off_review_link']) && $soft < 10000) {
        echo '$_(\'review_js_file\').src =  "https://www.softaculous.com/review.js?soft=' . $soft . '&user='******'name'] . '&ip=' . $_SERVER['SERVER_ADDR'] . '";';
        echo '$_(\'reviews_js_file\').src =  "https://www.softaculous.com/reviews.js?soft=' . $soft . '&user='******'name'] . '&ip=' . $_SERVER['SERVER_ADDR'] . '";';
    }
    ?>
};

function notifyversion(){
	if(AJAX(window.location+"&notify=true", "notified(re)")){
		return false;
	}else{
		return true;	
	}
};

function notified(re){
	if(re == 1){
		alert('<?php 
    echo $l['notifyversion'];
    ?>
');
	}
};

function loadScreenshots(){
	$_('screenshots_iframe').src = '<?php 
    echo 'https://www.softaculous.com/screenshots/screenshots1.php?sid=' . $soft;
    ?>
';
};

</script>
<?php 
    $tmp_ver1 = array();
    // Just to show the multiple versions if a script have any branch.
    if (!empty($software['branch'])) {
        foreach ($software['branch'] as $kver => $vver) {
            $tmp_ver1[] = $vver['ver'];
        }
        $tmp_ver = implode(', ', $tmp_ver1);
    }
    $url = $theme['images'];
    $ratings = array();
    $deduct = 1;
    $r = $scripts[$soft]['ratings'];
    for ($i_r = 1; $i_r <= 5; $i_r++) {
        if ($r >= 1) {
            $ratings[$i_r] = '<img src="' . $url . 'star.png' . '" alt="(' . number_format($scripts[$soft]['ratings'], 2) . ' out of 5)" />';
        } elseif ($r > 0) {
            $ratings[$i_r] = '<img src="' . $url . 'halfstar.png' . '" alt="(' . number_format($scripts[$soft]['ratings'], 2) . ' out of 5)" />';
        } else {
            $ratings[$i_r] = '<img src="' . $url . 'nostar.png' . '" alt="(' . number_format($scripts[$soft]['ratings'], 2) . ' out of 5)" />';
        }
        $r = $r - $deduct;
    }
    // For custom themes
    if ($soft > 10000) {
        if (file_exists($globals['euthemes'] . '/' . $globals['theme_folder'] . '/images/topscripts/48/' . $iscripts[$soft]['softname'] . '.png')) {
            $custom_48 = $theme['images'] . 'topscripts/48/' . $iscripts[$soft]['softname'] . '.png';
        } else {
            $custom_48 = $theme['images'] . '/custom.png';
        }
    }
    echo '<div class="bg">
	<div id="currentrating" style="display:none"></div>
	<div class="row" style="margin-left:10px;">
		' . (!empty($custom_48) ? '<img src="' . $custom_48 . '" alt="">' : '<img src="' . $globals['mirror_images'] . 'top15/48/' . $scripts[$soft]['softname'] . '.png" >') . '
			<span class="sai_process_heading" style="margin-left:20px;">' . $software['name'] . '</span>
	</div><br />
	<div class="row">
		<div class="col-sm-2">
			' . ($soft > 10000 ? '' : '<div class="someclass" title="' . $scripts[$soft]['ratings'] . '">' . implode('', $ratings) . '</div>') . '
		</div>
		<div class="col-sm-5 ver_style">
			' . $l['software_ver'] . ' : <font size="2"><b>' . (!empty($tmp_ver) ? $tmp_ver : $software['ver']) . '</b></font> &nbsp; &nbsp; <a href="javascript" onclick="notifyversion(); return false;" ><img src="' . $theme['images'] . 'notify.gif" name="notifyver" title="' . $l['notify_ver'] . '" alt="' . $l['notify_ver'] . '"></a>
		</div>
		<div class="col-sm-3 release_style">
			' . (!empty($info['release_date']) ? $l['release_date'] . ' : <font size="1"><b>' . $info['release_date'] . '</b></font>' : '') . '
		</div>
		<div class="col-sm-2 change_style">
			' . (!empty($info['changelog']) ? '&nbsp;&nbsp;<a href="javascript" data-toggle="modal" data-target="#changelog_div" class="sai_changelogbut pull-right" style="text-decoration:none;">' . $l['changelog'] . '</a>' : '') . '
		</div>
	</div><br />
	
	<script type=text/javascript>';
    if (!empty($softpanel->pheader)) {
        if (substr_count($_SERVER['REQUEST_URI'], 'x3') > 0) {
            echo '
			$(document).ready(function(){
				$(".ver_style").css("margin-left","0px");
				$(".release_style").css("margin-left","0px");
				$(".change_style").css({"margin-left":"0px", "margin-top":"-15px"});
			});';
        } else {
            echo '
			$(document).ready(function(){
				$(".ver_style").css("margin-left","0px");
				$(".release_style").css("margin-left","0px");
				$(".change_style").css({"margin-left":"0px", "margin-top":"-10px"});
			});';
        }
    }
    echo '
	</script>
	
	<div class="old_tab">
		<table width="100%" cellpadding="0" cellspacing="0" border="0" class="sai_tabs">
			<tr>
				<td><a href="javascript:tabs.tab(\'install\')" id="install" class="sai_insbut">' . $l['install'] . '</a></td>
				<td><a href="javascript:tabs.tab(\'overview\')" class="sai_tab" id="overview">' . $l['overview'] . '</a></td>
				<td><a href="javascript:tabs.tab(\'features\')" class="sai_tab" id="features">' . $l['features'] . '</a></td>
					' . (empty($globals['off_screenshot_link']) ? '<td><a href="javascript:tabs.tab(\'screenshots\'); loadScreenshots();" class="sai_tab" id="screenshots">' . $l['screenshots'] . '</a></td>' : '') . '
					' . (empty($globals['off_demo_link']) ? '<td><a href="' . ($soft >= 10000 && !empty($info['demo']) ? $info['demo'] : $globals['ind'] . 'act=demos&soft=' . $soft) . '" class="sai_tab" id="demo" target="_blank">' . $l['demo'] . '</a></td>' : '') . '
					' . (empty($globals['off_rating_link']) && $soft < 10000 ? '<td><a href="javascript:tabs.tab(\'ratings\')" class="sai_tab" id="ratings">' . $l['ratings'] . '</a></td>' : '') . '
					' . (empty($globals['off_review_link']) && $soft < 10000 ? '<td><a href="javascript:tabs.tab(\'reviews\')" class="sai_tab" id="reviews">' . $l['reviews'] . '</a></td>' : '') . (empty($info['import']) ? '' : '<td><a href="' . $globals['ind'] . 'act=import&soft=' . $soft . '" class="sai_tab" id="ratings">' . $l['import'] . '</a></td>') . '
			</tr>
		</table><br />
	</div>
	<div class="new_tab">
		<nav class="navbar navbar-default">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>                        
				</button>
				<ul class="nav">
					<li class="active" style="width:80px;"><a href="javascript:tabs.tab(\'install\')" id="install" class="sai_tab2" style="text-decoration:none; height:40px; top:5px;" data-toggle="collapse" data-target="#myNavbar">' . $l['install'] . '</a></li>
				</ul>
			</div>
			<div class="collapse navbar-collapse" id="myNavbar" style="position:absolute; z-index:1000; width:100%; background:#F8F8F8;">
				<ul class="nav navbar-nav">
					<li><a href="javascript:tabs.tab(\'overview\')"  id="overview" class="sai_tab2" style="text-decoration:none;" data-toggle="collapse" data-target="#myNavbar">' . $l['overview'] . '</a></li>
					<li><a href="javascript:tabs.tab(\'features\')"  id="features" class="sai_tab2" style="text-decoration:none;" data-toggle="collapse" data-target="#myNavbar">' . $l['features'] . '</a></li>
					<li>' . (empty($globals['off_screenshot_link']) ? '<a href="javascript:tabs.tab(\'screenshots\'); loadScreenshots();" class="sai_tab2" id="screenshots" style="text-decoration:none;" data-toggle="collapse" data-target="#myNavbar">' . $l['screenshots'] . '</a>' : '') . '</li>
					<li>' . (empty($globals['off_demo_link']) ? '<a href="' . ($soft >= 10000 && !empty($info['demo']) ? $info['demo'] : $globals['ind'] . 'act=demos&soft=' . $soft) . '" class="sai_tab2" id="demo" target="_blank" style="text-decoration:none;" data-toggle="collapse" data-target="#myNavbar">' . $l['demo'] . '</a>' : '') . '</li>
					<li>' . (empty($globals['off_rating_link']) && $soft < 10000 ? '<a href="javascript:tabs.tab(\'ratings\')" class="sai_tab2" id="ratings" style="text-decoration:none;" data-toggle="collapse" data-target="#myNavbar">' . $l['ratings'] . '</a>' : '') . '</li>
					<li>' . (empty($globals['off_review_link']) && $soft < 10000 ? '<a href="javascript:tabs.tab(\'reviews\')" class="sai_tab2" id="reviews" style="text-decoration:none;" data-toggle="collapse" data-target="#myNavbar">' . $l['reviews'] . '</a>' : '') . '</li>
					<li>' . (empty($info['import']) ? '' : '<a href="' . $globals['ind'] . 'act=import&soft=' . $soft . '" class="sai_tab2" id="ratings" style="text-decoration:none;" data-toggle="collapse" data-target="#myNavbar">' . $l['import'] . '</a>') . '</li>
				</ul>
			</div>
		</nav>
	</div>

<script type="text/javascript">
$_(tabs.inittab).className = tabs.tabbedclass;
var softid = ' . $soft . '

tabs.override = function(id){
	if(id == \'install\'){
		$_(\'install\').className = \'sai_insbutclicked\';
	}else{
		$_(\'install\').className = \'sai_insbut\';
	}
};
</script>';
    //Parse and take care of images
    $info['overview'] = (!empty($info['changelog']) ? '
<div class="modal fade" id="changelog_div" role="dialog">
    <div class="modal-dialog modal-lg" style="margin-top:80px;">
      <!-- Modal content-->
      <div class="modal-content">
        <div class="modal-header" style="background:#F0F0F0;">
          <button type="button" class="close" data-dismiss="modal">&times;</button>
          <h4 class="modal-title">Changelog</h4>
        </div>
        <div class="modal-body" style="height: 350px; overflow-y: auto;">
          ' . $info['changelog'] . '
        </div>
        <div class="modal-footer" style="padding-top:10px; height:50px;">
          <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">Close</button>
        </div>
      </div>
    </div>
</div>' : '') . '
<div class="bg2">
	<div class="row">
		' . (!empty($scripts[$soft]['screenshots']) && empty($globals['panel_hf']) ? '
		<div class="col-sm-6">
			<div id="overview_img" style="padding:10px;" style="width:100%;"> <img src="' . $globals['mirror_images'] . 'softimages/screenshots/' . $soft . '_screenshot1.gif" class="img-responsive" alt=""> </div>	
		</div>
		<div class="col-sm-6 col-xs-6">' : '<div class="col-sm-12 col-xs-12">') . '
			' . softparse($info['overview'], $soft) . '<br /><br />
			<div class="row">
				<div class="col-sm-1 col-xs-1"><font color="#447edf"><i class="fa sai-disk fa-3x"></i></font></div>
				<div class="col-sm-5 col-xs-5">
					<span class="sai_head">' . $l['space_req'] . '</span><br />
					<span class="sai_exp2">' . $l['available_space'] . ' : ' . (is_numeric($softpanel->spaceremain) ? number_format($softpanel->spaceremain / 1024 / 1024, 2) : $softpanel->spaceremain) . ' ' . $l['mb'] . '<br />
					' . $l['req_space'] . ' : ' . number_format($software['spacereq'] / 1024 / 1024, 2) . ' ' . $l['mb'] . '</span>
				</div>
			</div><br />
			<div class="row">
				<div class="col-sm-1 col-xs-1"><a href="' . $info['support'] . '"><font color="#447edf"><i class="fa sai-question fa-3x"></i></font></a></div>
				<div class="col-sm-5 col-xs-5">
					<span class="sai_head">' . $l['software_support'] . '</span><br />
					<span class="sai_exp2"><a href="' . $info['support'] . '" target="_blank">' . $l['support_link'] . '</a><br />
					' . $l['support_note'] . '</span>
				</div>
			</div>	
		</div>
	</div><br />
</div><!--end of bg2 class-->';
    if (!empty($installations[$soft]) || array_intersect(array_keys($installations), array_keys($software['branch']))) {
        $info['overview'] .= '<br /><br />
	<center>
		<span class="sai_newhead">' . $l['current_ins'] . '</span><br />
	</center><hr>';
        $info['overview'] .= '
	<div class="bg2">
		<table class="table table-hover">
		<thead  style="background:#EFEFEF;" class="sai_head2">
			<tr>
				<th>' . $l['link'] . '</th>
				<th>' . $l['admin'] . '</th>
				<th>' . $l['ins_time'] . '</th>
				<th>' . $l['version'] . '</th>
				<th width="50" colspan="5" style="text-align:center;">' . $l['options'] . '</th>
				<th><input type="checkbox" id="check_all"></th>
			</tr>
		</thead>';
        $i = 1;
        $highlight = optGET('highlight');
        $action = optGET('postact');
        //r_print($software['branch']);
        //r_print($no_autoupgrade);
        foreach ($software['branch'] as $csid => $cver) {
            $is_cloneable = is_cloneable($csid);
            // We use this count to create empty <td> for features not available for this app
            $ccount = 0;
            if (empty($is_cloneable)) {
                $ccount++;
            }
            if (!empty($globals['disable_backup_restore'])) {
                $ccount++;
            }
            if (!asperapp(0, 0, 1) || empty($can_publish)) {
                $ccount++;
            }
            //Child List of Installations
            foreach ($installations[$csid] as $ik => $iv) {
                $is_upgradable = is_upgradable($ik);
                $info['overview'] .= '<tr id="trid' . $ik . '">
				<td class="endurl"><a href="' . $iv['softurl'] . '" target="_blank" id="insurl' . $ik . '">' . $iv['softurl'] . '</a>' . ($highlight == $ik && !empty($action) ? '<span id="highlight">&nbsp;&nbsp;<b class="sai_highlight">' . $l['act_' . $action] . '</b></span>' : '') . '</td>
				<td><a href="' . $iv['softurl'] . '/' . (!empty($iv['admin_folder']) ? $iv['admin_folder'] : admin_folder($iv['sid'])) . '" target="_blank"><img src="' . $theme['images'] . '/admin.gif" /></a></td>
				<td>' . datify($iv['itime']) . '</td>
				<td>' . $iv['ver'] . ($software['ver'] != $iv['ver'] && $is_upgradable ? ' <a href="' . $globals['ind'] . 'act=upgrade&insid=' . $ik . '"><img src="' . $theme['images'] . 'updates.gif" alt="' . $l['upd_to'] . ' ' . implode(' or ', $is_upgradable) . '" title="' . $l['upd_to'] . ' ' . implode(' or ', $is_upgradable) . '" class="someclass"/></a>' : '') . (!empty($iv['eu_auto_upgrade']) && empty($no_autoupgrade['disable_autoupgrade']) && empty($no_autoupgrade['scripts'][$csid]) ? '<img src="' . $theme['images'] . 'auto_upgrade.png"  title="' . $l['auto_upgrade_enabled'] . '" style="cursor:pointer"/>' : '') . '</td>' . (!empty($is_cloneable) ? '<td width="25" class="someclass" title="' . $l['clone'] . '"><a href="' . $globals['ind'] . 'act=sclone&insid=' . $ik . '" ><img src="' . $theme['images'] . 'clone.gif" /></td></a>&nbsp;' : '') . (empty($globals['disable_backup_restore']) ? '<td width="25" title="' . $l['backup'] . '" class="someclass"><a href="' . $globals['ind'] . 'act=backup&insid=' . $ik . '"><img src="' . $theme['images'] . 'backup.gif" /></td></a>' : '') . '
				&nbsp;<td width="25" title="' . $l['editdetail'] . '" class="someclass"><a href="' . $globals['ind'] . 'act=editdetail&insid=' . $ik . '"><img src="' . $theme['images'] . 'editdetail.gif" /></td></a>
				' . (asperapp(0, 0, 1) && !empty($can_publish) ? ' &nbsp;<td><a href="' . $globals['ind'] . 'act=publish&insid=' . $ik . '" title="' . $l['publish'] . '"><img src="' . $theme['images'] . 'publish.gif" /></td></a>' : '') . ' 
				&nbsp;<td width="25" title="' . $l['remove'] . '" class="someclass"><a href="' . $globals['ind'] . 'act=remove&insid=' . $ik . '"><img src="' . $theme['images'] . 'remove.gif" /></a></td>' . (!empty($ccount) ? '<td colspan="' . $ccount . '"></td>' : '') . '
				<td width="25">
					<input type="checkbox" name="insids[]" id="' . $iv['softurl'] . '" value="' . $ik . '" class="soft_inslist">
				</td>
				</tr>';
                $i++;
            }
        }
        $info['overview'] .= '</table><br />
		<p align="right" style="width:100%;">
			<span class="sai_head">' . $l['with_selected'] . ':</span>
			<select name="multi_options" id="multi_options">
				<option name="todo" id="todo" value="0">---</option>
				<option name="todo" id="todo" value="mult_rem">' . $l['remove'] . '</option>
			</select>
			<input type="button" value="' . $l['go'] . '" onclick="show_confirm()" class="sai_graybluebut">
			<br />
		</p>
		<div id="rem_div"></div>
	</div><!--end of bg2 class-->
<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
insids = new Array();
removed = new Object();

function show_confirm(){
	
	insids = new Array();
	removed = new Object();
	
	if($_("multi_options").value != "mult_rem"){
		return false;
	}

	// Build the list of Installations to remove
	var field = document.getElementsByName(\'insids[]\');
		insids = new Array();
		var c = 0;
		for(i = 0; i < field.length; i++){
			if(field[i].checked == true){
				insids[c] = field[i].value;
				c++;
			}
		
	}
	//alert(insids);
	
	if(c == 0){
		alert("' . $l['no_sel_inst'] . '");
		return false;
	}
	
	var r = confirm("' . $l['del_insid'] . '");
	if(r != true){
		return false;
	}
	
	remove_by_id(insids[0], "", 0);
}

function remove_by_id(insid, re, oldinsid){

	removed[insid] = false;
	
	if(re.length > 0 && oldinsid > 0){
		if(re == "removed"){
			removed[insid] = true;
		}
	}
	
	nextinsid = 0;
	
	// Find the next INSTALLATION to remove
	for(i = 0; i < insids.length; i++){
		if(typeof(removed[insids[i]]) != "undefined"){
			continue;
		}
		nextinsid = insids[i];
		break;
	}
	
	// If there is something left to be removed
	if(insid != 0){
		try{		
			AJAX("' . $globals['index'] . 'act=remove&insid="+insid+"&ajax=1&ssk="+randomstring(32)+"&random="+Math.random(), "remove_by_id(\'"+nextinsid+"\', re, \'"+insid+"\')");
			$_("rem_div").innerHTML = "<br /><br /><p align=\\"center\\"><img src=\\"' . $theme['images'] . 'ajax_remove.gif\\"> <br />' . $l['rem_inst_id'] . ' ID: " +insid+ ", URL: " + $_("insurl"+insid)+"<br /></p>";
			return true;
		}catch(e){
			return false;
		}
	}
	$_("rem_div").innerHTML = "";
	alert("' . $l['inst_remvd'] . '");
	location.reload(true);
	return true;
}

$(document).ready(function(){
	$("#check_all").on("click", function(event){
		if(this.checked == true){
			$(".soft_inslist").prop("checked", true);
		}else{
			$(".soft_inslist").prop("checked", false);
		}
	});
	
	$(".sai_altrowstable tr").mouseover(function(){
		var old_class = $(this).attr("class");
		
		if(old_class == "nohover") return;
		
		//alert(old_class);
		$(this).attr("class", "sai_tr_bgcolor");
		
		$(this).mouseout(function(){
			$(this).attr("class", old_class);
		});
		
	});';
        // If we get anything in $highlight than only we have to call this JS function other wise it will cause the JS error.
        if (!empty($highlight)) {
            $info['overview'] .= 'goto_id("insurl' . $highlight . '");
	$("#highlight").fadeOut(10000);';
        }
        $info['overview'] .= '});

// ]]></script>';
    }
    if (count($allcatwise[$software['type']][$software['cat']]) > 2 && $software['cat'] != 'others') {
        $info['overview'] .= '<br /><br />
	<div class="bg2">
		<table width="100%" class="table table-hover">
			<tr>
				<th style="background:#EFEFEF" class="sai_head2">' . $l['related_scripts'] . '</th>
			</tr>
		</table>';
        $i = 0;
        foreach ($allcatwise[$software['type']][$software['cat']] as $k => $v) {
            if ($k == $soft || !empty($scripts[$k]['parent']) && !empty($iscripts[$scripts[$k]['parent']])) {
                continue;
            }
            // Show only 5 scripts
            if ($i == 5) {
                break;
            }
            $info['overview'] .= '
			<div style="text-decoration:none;display:inline-block;text-align:center;margin-top:10px;">
				<a href="' . script_link($k) . '"  title="' . $v['desc'] . '"  width="80" alt="" class="someclass" style="text-decoration:none;margin-top:5px;">
					<div class="sai_blog_script" style="margin-left:11%;">
						<div class="sai_demo_script_logo">
							<img src="' . $globals['mirror_images'] . 'top15/48/' . $v['softname'] . '.png" >	
						</div>
						<div class="sai_script_name">' . $v['name'] . '</div>
					</div>
				</a>
			</div>';
            $i++;
        }
        $info['overview'] .= '</div><!--end of bg2 class-->';
    }
    //Parse and take care of images
    $info['features'] = '<div class="bg2"><br />' . softparse($info['features'], $soft) . '</div><!--end of bg2 class-->';
    $info['ratings'] = '';
    $info['screenshots'] = '<div class="bg2"><iframe src="" id="screenshots_iframe" style="width:100%;height:500px;" frameborder="0" scrolling="no"></iframe></div><!--end of bg class-->';
    $info['reviews'] = '<div class="bg2"><div id="allreviews"></div></div><!--end of bg2 class-->';
    foreach ($info as $k => $v) {
        if (in_array($k, array('demo', 'support', 'import', 'changelog'))) {
            continue;
        }
        echo '<div id="' . $k . '_win" style="display: ' . ($init_tab == $k ? "block" : "none") . '; width:100%;"><br />
				' . $v . '
			</div>';
    }
    echo '</div>';
    softfooter();
}
Пример #10
0
function publish_theme()
{
    global $theme, $globals, $softpanel, $user, $l, $error, $iscripts, $scripts, $insid, $software, $p, $configure, $_chmod, $done, $soft;
    // Give the staus
    if (optGET('ajaxstatus')) {
        $_status = soft_progress(optGET('ajaxstatus'));
        if (is_array($_status)) {
            echo implode('|', $_status);
            return true;
        }
        // False call
        echo 0;
        return false;
    }
    softheader($l['<title>']);
    echo '<center class="sai_tit"><img src="' . $theme['images'] . 'publish_dp.gif" />&nbsp; &nbsp;' . $l['header'] . '</center>
<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" /><br /><br />

<div id="entire_win">';
    if (!empty($done)) {
        echo '<div class="sai_notice"><img src="' . $theme['images'] . 'success.gif" /> &nbsp; ' . $l['done'] . '</div><br />
' . lang_vars($l['succesful'], array($software['name'])) . ' : <br />
<a href="' . $p->settings['new_softurl'] . '" target="_blank">' . $p->settings['new_softurl'] . '</a>
' . (!empty($software['adminurl']) ? '<br />' . $l['admin_url'] . ' : <a href="' . $p->settings['new_softurl'] . '/' . $software['adminurl'] . '" target="_blank">' . $p->settings['new_softurl'] . '/' . $software['adminurl'] . '</a>' : '') . '<br /><br />
' . $l['enjoy'] . '<br /><br />
' . (!empty($notes) ? $l['publish_notes'] . ' : <br />
<div class="sai_notes">' . softparse($notes, $soft) . '</div><br /><br />' : '') . '
' . $l['please_note'] . '<br /><br />
' . $l['regards'] . ',<br />
' . $l['softinstaller'] . '<!--PROC_DONE-->';
    } else {
        echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[

function checkform(dosubmit){
	
	$_("softsubmitbut").disabled = true;	
	//return true;
	
	// Send a request to check the status
	progressbar.start();
	
	// Return false so that the form is not submitted directly
	return false;
	
};

var progressbar = {
	timer: 0,
	total_width: 0,	
	status_key: "",
	synctimer: 0,
	fadeout_div: "#fadeout_div",
	win_div: "#entire_win",
	progress_div: "#progress_bar",
	formid: "#publishins",
	frequency: 3000,
	
	current: function(){
		try{
			return Math.round(parseInt($_("progress_color").width)/parseInt($_("table_progress").width)*100);
		}catch(e){
			return -1;	
		}
	},
	
	reset: function(){ try{
		clearTimeout(this.timer);
		$_("progress_color").width = 1;
	}catch(e){ }},
	
	move: function(dest, speed, todo){ try{
		var cur = this.current();
		if(cur < 0){
			clearTimeout(this.timer);
			return false;
		}
		var cent = cur + 1;
		var new_width = cent/100*this.total_width;
		if(new_width < 1){
			new_width = 1;
		}
		//alert(new_width+" "+dest+" "+cent);
		
		$_("progress_color").width = new_width;
		$_("progress_percent").innerHTML = "("+cent+" %)";
		
		if(cent < dest){
			this.timer = setTimeout("progressbar.move("+dest+", "+speed+")", speed);
		}else{
			eval(todo);	
		}
	}catch(e){ }},
	
	text: function(txt){ try{
		$_("progress_txt").innerHTML = txt;
	}catch(e){ }},
	
	sync: function(){
		if(progressbar.status_key.length < 2){
			return false;
		}
		$.ajax({
			url: window.location+"&ajaxstatus="+progressbar.status_key+"&random="+Math.random(),
			type: "GET",
			success: function(data){
				if(data == 0) return false;
				var tmp = data.split("|");
				var cur = progressbar.current();
				tmp[2] = (3000/(tmp[0]-cur));
				//alert(tmp);
				if(tmp[0] > cur){
					if(parseInt(tmp[2]) == 0){
						tmp[2] = 800;
					}
					progressbar.move(tmp[0], tmp[2]);
				}
				progressbar.text(tmp[1]);
				progressbar.synctimer = setTimeout("progressbar.sync()", progressbar.frequency);
			}
		});
	},
	
	sync_abort: function(){
		clearTimeout(this.synctimer);
	},
	
	start: function(){ try{
		this.post();
		this.reset();
		this.total_width = parseInt($_("table_progress").width);
		this.move(3, 800);
		this.status_key = $("#soft_status_key").attr("value");
		this.sync();
	}catch(e){ }},
	
	post: function(){
		
		// Scroll to the Top and show the progress bar
		goto_top();
		$(progressbar.fadeout_div).fadeOut(500, 
			function(){
				$(progressbar.progress_div).fadeOut(1);
				$(progressbar.progress_div).fadeIn(500);
			}
		);
		
		$.ajax({
			url: window.location+"&jsnohf=1",
			type: "POST",
			data: $(progressbar.formid).serialize(),
			complete: function( jqXHR, status, responseText ) {
				
				progressbar.sync_abort();
				
				// Store the response as specified by the jqXHR object
				responseText = jqXHR.responseText;
				
				try{
					//alert(responseText);
					if(responseText.match(/\\<\\!\\-\\-PROC_DONE\\-\\-\\>/gi)){
						progressbar.text("' . addslashes($l['finishing_process']) . '");
						progressbar.move(99, 10, "$(progressbar.progress_div).fadeOut(1)");
					}else{
						progressbar.reset();
					}
				}catch(e){ }
				
				if ( jqXHR.isResolved() ) {
				
					// #4825: Get the actual response in case
					// a dataFilter is present in ajaxSettings
					jqXHR.done(function( r ) {
						responseText = r;
					});
			
					// Create a dummy div to hold the results
					// inject the contents of the document in, removing the scripts
					// to avoid any "Permission Denied" errors in IE
					var newhtml = jQuery("<div>").append(responseText).find(progressbar.win_div).html();
					
					$(progressbar.win_div).animate({opacity: 0}, 1000, "", function(){
						$(progressbar.win_div).html(newhtml);
					}).delay(50).animate({opacity: 1}, 500);
					
					//alert(newhtml);
					
				}else{
					alert("Oops ... the connection was lost");
				}
			}
		});
	}
};

// ]]></script>

<div id="progress_bar" style="height:125px; display: none;">
	<br /><br />
	<center>
	<font size="4" color="#222222" id="progress_txt">' . $l['checking_data'] . '</font>
	<font style="font-size: 18px;font-weight: 400;color: #444444;" id="progress_percent">(0 %)</font><br /><br />
	</center>
	<table width="500" cellpadding="0" cellspacing="0" id="table_progress" border="0" align="center" height="28" style="border:1px solid #CCC; -moz-border-radius: 5px;
-webkit-border-radius: 5px; border-radius: 5px;">
		<tr>
			<td id="progress_color" width="1" style="background-image: url(' . $theme['images'] . 'bar.gif); -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px;"></td>
			<td id="progress_nocolor">&nbsp;</td>
		</tr>
	</table>
</div>

<div id="fadeout_div">';
        error_handle($error, '100%');
        echo '<form accept-charset="' . $globals['charset'] . '" name="publishins" id="publishins" method="post" action="" onsubmit="return checkform();">

<table border="0" cellpadding="8" cellspacing="0" width="100%">
	<tr>
		<td width="40%">
			<span class="sai_head">' . $l['choose_account'] . '</span><br />
			<span class="sai_exp">' . $l['choose_account_exp'] . '</span>
		</td>
		<td>
			<select name="remid" id="remid">';
        foreach ($user['remote'] as $k => $v) {
            echo '<option value="' . $k . '" ' . POSTselect('remid', $k) . '>' . $v['domain_name'] . '</option>';
        }
        echo '</select>
		</td>
	</tr>';
        $defaultdir = basename($user['ins'][$insid]['softpath']);
        // Is it the home folder of a domain ?
        foreach ($softpanel->domainroots as $k => $v) {
            if (strtolower(cleanpath($user['ins'][$insid]['softpath'])) == strtolower(cleanpath($v))) {
                $defaultdir = '';
            }
        }
        echo '<tr>
		<td>
			<span class="sai_head">' . $l['dir'] . '</span><br />
			<span class="sai_exp">' . $l['dir_exp'] . '</span>
		</td>
		<td>
			<input type="text" name="dir" id="dir" size="30" value="' . POSTval('dir', $defaultdir) . '" />
		</td>
	</tr>
	
	<tr>
		<td>
			<span class="sai_head">' . $l['password'] . '</span><br />
			<span class="sai_exp">' . $l['password_exp'] . '</span>
		</td>
		<td>
			<input type="password" name="password" id="password" size="30" value="' . POSTval('password', '') . '" />
		</td>
	</tr>
</table>

<p align="center">
<input type="hidden" name="publishins" id="publishins" value="' . $l['publishins'] . '" />
<input type="submit" name="softsubmitbut" id="softsubmitbut" value="' . $l['publishins'] . '" class="sai_graybluebut" />
</p>
<input type="hidden" name="soft_status_key" id="soft_status_key" value="' . POSTval('soft_status_key', generateRandStr(32)) . '" />
</form>
</div>';
    }
    echo '</div>
<br /><br /><br />
<center><b><a href="' . script_link($soft) . '">' . $l['return'] . '</a></b></center>';
    softfooter();
}
Пример #11
0
function backup_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error;
    global $insid, $backing, $software, $soft, $completed;
    // Give the staus
    if (optGET('ajaxstatus')) {
        $_status = soft_progress(optGET('ajaxstatus'));
        $tmp_status = unserialize($_status[1]);
        $_status[1] = $tmp_status['current_status'];
        if (!empty($_status)) {
            echo implode('|', $_status);
            return true;
        }
        // False call
        echo 0;
        return false;
    }
    softheader($l['<title>']);
    echo '<div id="install_win">';
    if (!empty($completed)) {
        echo '<div class="bg"><br />
			<div class="alert alert-warning">
				<center><img src="' . $theme['images'] . 'notice.gif" /> &nbsp; ' . lang_vars($l['backedup'], array($user['ins'][$insid]['softurl'])) . '
				<center><b><a href="' . script_link($soft) . '&highlight=' . $insid . '&postact=backup"></a></b></center></center>
			</div>
			<br />
			<center><b><a href="' . script_link($soft) . '" class="sai_head">' . $l['return'] . '</a></b></center><br /><br />
		</div>
<!--PROC_DONE-->';
    } else {
        echo '<div id="fadeout_div">
<form accept-charset="' . $globals['charset'] . '" name="editsettings" method="post" action="" class="form-horizontal" onsubmit="return checkform();" id="editsettings">

<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
	function checkform(dosubmit){
		$_("softsubmitbut").disabled = true;
		if(useprog){
	
			// Send a request to check the status
			progressbar.start();
			
			// Return false so that the form is not submitted
			return false;
		
			// This is OLD School !
		}
		return true;
	}
	
var progressbar = {
	timer: 0,
	total_width: 0,	
	status_key: "",
	synctimer: 0,
	fadeout_div: "#fadeout_div",
	win_div: "#install_win",
	progress_div: "#progress_bar",
	formid: "#editsettings",
	frequency: 8000,
	got_resp: 0,
	
	current: function(){
		try{
			var tmp_cur = Math.round(parseInt($_("progress_color").width)/parseInt($_("table_progress").width)*100);
			if(tmp_cur > 100){
				tmp_cur = 99;
			}
			return tmp_cur;
		}catch(e){
			return -1;	
		}
	},
	
	reset: function(){ try{
		clearTimeout(this.timer);
		$_("progress_color").width = 1;
		progressbar.got_resp = 0;
	}catch(e){ }},
	
	move: function(dest, speed, todo){ try{
		var cur = this.current();
		if(cur < 0){
			clearTimeout(this.timer);
			return false;
		}
		var cent = cur + 1;
		var new_width = cent/100*this.total_width;
		if(new_width < 1){
			new_width = 1;
		}
		//alert(new_width+" "+dest+" "+cent);
		
		$_("progress_color").width = new_width;
		$_("progress_percent").innerHTML = "("+cent+" %)";
		
		if(cent < dest){
			this.timer = setTimeout("progressbar.move("+dest+", "+speed+", \\""+todo+"\\")", speed);
		}else{
			eval(todo);	
		}
	}catch(e){ }},
	
	text: function(txt){ try{
		$_("progress_txt").innerHTML = txt;
	}catch(e){ }},
	
	sync: function(){
		if(progressbar.status_key.length < 2){
			return false;
		}
		$.ajax({
			url: window.location+"&ajaxstatus="+progressbar.status_key+"&random="+Math.random(),
			type: "GET",
			success: function(data){
				if(data == 0) return false;			
				var tmp = data.split("|");
				var cur = progressbar.current();
				tmp[2] = (3000/(tmp[0]-cur));
				//alert(tmp);
				if(tmp[0] > cur){
					if(parseInt(tmp[2]) == 0){
						tmp[2] = 800;
					}
					progressbar.move(tmp[0], tmp[2]);
				}
				progressbar.text(tmp[1]);
				progressbar.synctimer = setTimeout("progressbar.sync()", progressbar.frequency);
			}
		});
	},
	
	sync_abort: function(){
		clearTimeout(this.synctimer);
	},
	
	start: function(){ try{
		this.post();
		this.reset();
		this.total_width = parseInt($_("table_progress").width);
		this.move(95, 800);
		this.status_key = $("#soft_status_key").attr("value");
		this.sync();
	}catch(e){ }},
	
	post: function(){
		
		// Scroll to the Top and show the progress bar
		goto_top();
		$(progressbar.fadeout_div).fadeOut(500, 
			function(){
				$(progressbar.progress_div).fadeOut(1);
				$(progressbar.progress_div).fadeIn(500);
			}
		);
		
		$.ajax({
			url: window.location+"&jsnohf=1",
			type: "POST",
			data: $(progressbar.formid).serialize(),
			complete: function( jqXHR, status, responseText ) {
				
				progressbar.sync_abort();
				
				// Store the response as specified by the jqXHR object
				responseText = jqXHR.responseText;
				
				try{
					//alert(responseText);
					if(responseText.match(/\\<\\!\\-\\-PROC_DONE\\-\\-\\>/gi)){
						progressbar.text("' . addslashes($l['finishing_process']) . '");
						progressbar.move(99, 10, "$(progressbar.progress_div).fadeOut(1)");
					}else{
						progressbar.reset();
					}
				}catch(e){ }
				
				if ( jqXHR.isResolved() ) {
				
					// #4825: Get the actual response in case
					// a dataFilter is present in ajaxSettings
					jqXHR.done(function( r ) {
						responseText = r;
					});
					//alert(responseText);
					// Create a dummy div to hold the results
					// inject the contents of the document in, removing the scripts
					// to avoid any "Permission Denied" errors in IE
					var newhtml = jQuery("<div>").append(responseText).find(progressbar.win_div).html();
					
					$(progressbar.win_div).animate({opacity: 0}, 1000, "", function(){
						$(progressbar.win_div).html(newhtml);
						new_theme_funcs_init();
					}).delay(50).animate({opacity: 1}, 500);
					
					//alert(newhtml);
					
				}else{
					//alert("Oops ... the connection was lost");
				}
			}
		});
	}
};
	
// Use the Progress Bar ?
var useprog = 1;
try{
	if(BrowserDetect.browser.toLowerCase() == "safari" && BrowserDetect.version.toString().substr(0, 1) == "3"){
		useprog = 0;
	}
}catch(e){ }


// ]]></script>';
        echo '<div class="bg"><br />
		<div class="row sai_main_head" style="width:100%;" align="center">
			<div class="col-sm-6 col-xs-5" style="padding:0 10px 0 0; text-align:right;">
				<i class="fa sai-backup fa-2x" style="color:#00A0D2;"></i>
			</div>
			<div class="col-sm-6 col-xs-7" style="padding-top:10px; padding-left:0; text-align:left;">' . $l['prog_backingup'] . $software['name'] . '</div>
		</div><br />';
        if (!empty($globals['backups_expire'])) {
            echo '<br /><div class="alert alert-warning">
					<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
					<center>' . lang_vars($l['backups_expire'], array($globals['backups_expire'])) . '</center>
				</div>';
        }
        echo error_handle($error, "100%", 0, 1);
        echo '
		<div style="padding-left:20px; padding-right:20px;">
			<div class="sai_sub_head">' . $l['backup_operation'] . '</div><hr>
			<div class="row">
				<div class="col-sm-5">
					<label class="sai_head">' . $l['backup_dir'] . '</label>
					<span class="sai_exp">' . $l['backup_dir_exp'] . '</span>
				</div>
				<div class="col-sm-7">
					<input type="checkbox" name="backup_dir" ' . POSTchecked('backup_dir', true) . ' />
				</div>
			</div><br />';
        // Web Directory (For Perl) @since 3.5
        if (!empty($user['ins'][$insid]['wwwdir'])) {
            echo '
				<div class="row">
					<div class="col-sm-5">
						<label class="sai_head">' . $l['backup_wwwdir'] . '</label>
						<span class="sai_exp">' . $l['backup_wwwdir_exp'] . '</span>
					</div>
					<div class="col-sm-7">
						<input type="checkbox" name="backup_wwwdir" ' . POSTchecked('backup_wwwdir', true) . ' />
					</div>
				</div><br />';
        }
        // Data directory ?
        if (!empty($user['ins'][$insid]['softdatadir'])) {
            echo '
				<div class="row">
					<div class="col-sm-5">
						<label class="sai_head">' . $l['backup_datadir'] . '</label>
						<span class="sai_exp">' . $l['backup_datadir_exp'] . '</span>
					</div>
					<div class="col-sm-7">
						<input type="checkbox" name="backup_datadir" ' . POSTchecked('backup_datadir', true) . ' />
					</div>
				</div><br />';
        }
        if (!empty($user['ins'][$insid]['softdb'])) {
            echo '
				<div class="row">
					<div class="col-sm-5">
						<label class="sai_head">' . $l['backup_db'] . '</label>
						<span class="sai_exp">' . $l['backup_db_exp'] . '</span>
					</div>
					<div class="col-sm-7">
						<input type="checkbox" name="backup_db" ' . POSTchecked('backup_db', true) . ' />
					</div>
				</div><br />';
        }
        // Backup note
        echo '<div class="row">
					<div class="col-sm-5">
						<label for="backup_note" class="sai_head">' . $l['backup_note'] . '</label>
						<span class="sai_exp">' . $l['backup_note_exp'] . '</span>
					</div>
					<div class="col-sm-7">
						<input type="text" name="backup_note" id="backup_note" class="form-control" ' . POSTval('backup_note', '') . ' size="50" maxlength="255"/>
					</div>
				</div><br />
		</div>
		
		<div class="bg info_block">
			<div class="sai_sub_head">' . $l['info'] . '</div><hr style="border-color: #D1D2D3;">
			<div class="row">
				<div class="col-sm-5">
					<span class="sai_head">' . $l['ins_softname'] . '</span>
				</div>
				<div class="col-sm-6">
					<span class="sai_info">' . $software['name'] . '</span>
				</div>
			</div><br />
			
			<div class="row">
				<div class="col-sm-5">
					<span class="sai_head">' . $l['ins_num'] . '</span>
				</div>
				<div class="col-sm-6">
					<span class="sai_info">' . $user['ins'][$insid]['insid'] . '</span>
				</div>
			</div><br />
			
			<div class="row">
				<div class="col-sm-5">
					<span class="sai_head">' . $l['ins_ver'] . '</span>
				</div>
				<div class="col-sm-6">
					<span class="sai_info">' . $user['ins'][$insid]['ver'] . '</span>
				</div>
			</div><br />
			
			<div class="row">
				<div class="col-sm-5">
					<span class="sai_head">' . $l['ins_time'] . '</span>
				</div>
				<div class="col-sm-6">
					<span class="sai_info">' . datify($user['ins'][$insid]['itime']) . '</span>
				</div>
			</div><br />
			
			<div class="row">
				<div class="col-sm-5">
					<span class="sai_head">' . $l['ins_path'] . '</span>
				</div>
				<div class="col-sm-6">
					<span class="sai_info">' . $user['ins'][$insid]['softpath'] . '</span>
				</div>
			</div><br />
			
			<div class="row">
				<div class="col-sm-5">
					<span class="sai_head">' . $l['ins_url'] . '</span>
				</div>
				<div class="col-sm-6">
					<span class="sai_info"><a href="' . $user['ins'][$insid]['softurl'] . '" target="_blank">' . $user['ins'][$insid]['softurl'] . '</a></span>
				</div>
			</div><br />
			' . (empty($user['ins'][$insid]['wwwdir']) ? '' : '
				<div class="row">
					<div class="col-sm-5">
						<span class="sai_head">' . $l['ins_wwwdir'] . '</span>
					</div>
					<div class="col-sm-6">
						<span class="sai_info">' . $user['ins'][$insid]['wwwdir'] . '</span>
					</div>
				</div><br />
			') . '
			
			' . (empty($user['ins'][$insid]['softdatadir']) ? '' : '
				<div class="row">
					<div class="col-sm-5">
						<span class="sai_head">' . $l['ins_datadir'] . '</span>
					</div>
					<div class="=col-sm-6">
						<span class="sai_info">' . $user['ins'][$insid]['softdatadir'] . '</span>
					</div>
				</div><br />
			') . '	
			
			' . (empty($user['ins'][$insid]['softdb']) ? '' : '
				<div class="row">
					<div class="col-sm-5">
						<span class="sai_head">' . $l['ins_db'] . '</span>
					</div>
					<div class="col-sm-6">
						<span class="sai_info">' . $user['ins'][$insid]['softdb'] . '</span>
					</div>
				</div><br />
			') . '	
			
			' . (empty($user['ins'][$insid]['softdbuser']) ? '' : '
				<div class="row">
					<div class="col-sm-5">
						<span class="sai_head">' . $l['ins_dbuser'] . '</span>
					</div>
					<div class="col-sm-6">
						<span class="sai_info">' . $user['ins'][$insid]['softdbuser'] . '</span>
					</div>
				</div><br />
			') . '	
			
			' . (empty($user['ins'][$insid]['softdbhost']) ? '' : '
				<div class="row">
					<div class="col-sm-5">
						<span class="sai_head">' . $l['ins_dbhost'] . '</span>
					</div>
					<div class="col-sm-6">
						<span class="sai_info">' . $user['ins'][$insid]['softdbhost'] . '</span>
					</div>
				</div><br />
			') . '	
			
			' . (empty($user['ins'][$insid]['cron_command']) ? '' : '
				<div class="row">
					<div class="col-sm-5">
						<span class="sai_head">' . $l['ins_cron_command'] . '</span>
					</div>
					<div class="col-sm-6">
						<span class="sai_info">' . base64_decode($user['ins'][$insid]['cron_command']) . '</span>
					</div>
				</div><br />			
			') . '
		</div><!--end of bg class-->
	
		<br /><br />
		<p align="center">
			<input type="hidden" name="backupins" id="backupins" value="' . $l['backup_ins'] . '" />
			<input type="submit" name="softsubmitbut" class="flat-butt" id="softsubmitbut" value="' . $l['backup_ins'] . '"  />
		</p>
		<br /><br />
		<center><b><a href="' . script_link($soft) . '" class="sai_head">' . $l['return'] . '</a></b></center><br /><br />

	</div><br /><!--end of bg class-->
</form></div>

<div id="progress_bar" style="display: none; width: 100%;">
	<br />
	<div class="bg">
	
		<div class="row sai_main_head" style="width:100%;" align="center">
			<div class="col-sm-5 col-xs-5" style="padding:0 10px 0 0; text-align:right;">
				<i class="fa sai-backup fa-2x" style="color:#00A0D2;"></i>
			</div>
			<div class="col-sm-7 col-xs-7" style="padding-top:10px; padding-left:0; text-align:left;">' . $l['prog_backingup'] . $software['name'] . '</div>
		</div><br />
		
		<div class="alert alert-warning" id="stat_txt">
			<center><img src="' . $theme['images'] . 'notice.gif" /> &nbsp; ' . lang_vars($l['backingup'], array($user['ins'][$insid]['softurl'])) . '</center>
		</div>
		
		<br /><br />
		<center>
		<font size="4" color="#222222" id="progress_txt" style="width: 100%;">' . $l['checking_data'] . '</font>
		<font style="font-size: 18px;font-weight: 400;color: #444444; width: 100%;" id="progress_percent">(0 %)</font><br /><br />
		</center>
		<table width="500" cellpadding="0" cellspacing="0" id="table_progress" border="0" align="center" height="28" style="border:1px solid #CCC; -moz-border-radius: 5px;
		-webkit-border-radius: 5px; border-radius: 5px; width: 50%;">
			<tr>
				<td id="progress_color" width="1" style="background-image: url(' . $theme['images'] . 'bar.gif); -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px;"></td>
				<td id="progress_nocolor">&nbsp;</td>
			</tr>
		</table>
		<br /><center>' . $l['wait_note'] . '</center><br /><br />
	</div>
</div><br /><br />';
    }
    echo '</div>';
    softfooter();
}
Пример #12
0
function apps_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $apps, $iapps, $error;
    global $software, $soft, $info, $settings, $init_tab, $installed, $removed, $__settings, $notes, $cron, $overwrite_option, $nopackage, $install;
    if (optGET('notify')) {
        get_softaculous_file('http://api.softaculous.com/notifyappsversion.php?softid="' . $soft . '"');
        echo 1;
        return true;
    }
    if (optGET('ajaxdownload') && !empty($nopackage)) {
        // Try to download the package
        if (method_exists($softpanel, 'updatesoftwares')) {
            $softpanel->downloadapp($soft, 0, 0, 1);
            echo 1;
            return true;
        }
        // False call
        echo 0;
        return false;
    }
    // Give the staus
    if (optGET('ajaxstatus')) {
        $_status = soft_progress(optGET('ajaxstatus'));
        $tmp_status = unserialize($_status[1]);
        $_status[1] = $tmp_status['current_status'];
        if (!empty($_status)) {
            echo implode('|', $_status);
            return true;
        }
        // False call
        echo 0;
        return false;
    }
    softheader($l['<title>'] . $software['name']);
    $loadedinfo = array('overview', 'notes', 'features', 'reviews', 'ratings');
    ?>
<script language="JavaScript" src="<?php 
    echo $theme['url'] . '/js/tabber.js';
    ?>
" type="text/javascript">
</script>
<script language="JavaScript" id="ratings_js_file" type="text/javascript"></script>
<script language="JavaScript" id="review_js_file"  type="text/javascript"></script>
<script language="JavaScript" id="reviews_js_file"  type="text/javascript"></script>
<script type="text/javascript">
tabs = new tabber;
tabs.tabs = new Array('<?php 
    echo implode('\', \'', $loadedinfo);
    ?>
');
tabs.tabwindows = new Array('<?php 
    echo implode('_win\', \'', $loadedinfo);
    ?>
_win');
tabs.inittab = <?php 
    echo '\'' . $init_tab . '\';';
    ?>
addonload('tabs.init();loadraterev();');

function loadraterev(){
<?php 
    if (empty($globals['off_rating_link'])) {
        echo '$_(\'ratings_js_file\').src = "http://api.webuzo.com/ratingsjs.php?soft=' . $soft . '&user='******'name'] . '&ip=' . $_SERVER['SERVER_ADDR'] . '";';
    }
    if (empty($globals['off_review_link'])) {
        echo '$_(\'review_js_file\').src =  "http://api.webuzo.com/reviewjs.php?soft=' . $soft . '&user='******'name'] . '&ip=' . $_SERVER['SERVER_ADDR'] . '";';
        echo '$_(\'reviews_js_file\').src =  "http://api.webuzo.com/reviewsjs.php?soft=' . $soft . '&user='******'name'] . '&ip=' . $_SERVER['SERVER_ADDR'] . '";';
    }
    ?>
};

function notifyversion(){
	if(AJAX(window.location+"&notify=true", "notified(re)")){
		return false;
	}else{
		return true;
	}
};

function notified(re){
	if(re == 1){
		alert('<?php 
    echo $l['notifyversion'];
    ?>
');
	}
};

</script>
<?php 
    $url = $theme['images'];
    $ratings = array();
    $deduct = 1;
    $r = $apps[$soft]['ratings'];
    for ($i_r = 1; $i_r <= 5; $i_r++) {
        if ($r >= 1) {
            $ratings[$i_r] = '<td><img src="' . $url . 'star.png' . '" alt="(' . number_format($apps[$soft]['ratings'], 2) . ' out of 5)" /></td>';
        } elseif ($r > 0) {
            $ratings[$i_r] = '<td><img src="' . $url . 'halfstar.png' . '" alt="(' . number_format($apps[$soft]['ratings'], 2) . ' out of 5)" /></td>';
        } else {
            $ratings[$i_r] = '<td><img src="' . $url . 'nostar.png' . '" alt="(' . number_format($apps[$soft]['ratings'], 2) . ' out of 5)" /></td>';
        }
        $r = $r - $deduct;
    }
    // For custom themes
    if ($soft > 10000) {
        if (file_exists($globals['euthemes'] . '/' . $globals['theme_folder'] . '/images/topscripts/48/' . $iscripts[$soft]['softname'] . '.png')) {
            $custom_48 = $theme['images'] . 'topscripts/48/' . $iscripts[$soft]['softname'] . '.png';
        } else {
            $custom_48 = $theme['images'] . '/custom.png';
        }
    }
    echo '<div id="currentrating" style="display:none"></div>
<table width="100%" cellpadding="4" cellspacing="1" border="0">
	<tr>
		<td width="10%" align="center">' . (!empty($custom_48) ? '<img src="' . $custom_48 . '" alt="">' : '<img src="' . $globals['mirror_images'] . 'webuzo/softimages/' . $soft . '__logo.gif" >') . '</td>
		<td width="90%" class="sai_process_heading" colspan="4">' . $software['name'] . '</td>
	</tr>
	<tr>
		<td align="center" width="10%">' . ($soft > 10000 ? '' : '<div class="someclass" title="' . $apps[$soft]['ratings'] . '"><table><tr>' . implode('', $ratings) . '</tr></table></div>') . '</td>
		<td valign="top" align="left" width="20%">
			' . $l['software_ver'] . ' : <font size="2"><b>' . (!empty($info['version']) ? $info['version'] : 'NA') . '</b></font>
		</td>
		<td align="left" width="60%">
			' . (!empty($info['release_date']) ? $l['release_date'] . ' : <font size="1"><b>' . $info['release_date'] . '</b></font>' : '') . '
		</td>
		<td width="10%">
			' . (!empty($info['changelog']) ? '&nbsp;&nbsp;<a href="javascript" onclick="$(\'#changelog_div\').bPopup(); return false;" class="sai_changelogbut" style="text-decoration:none;">' . $l['changelog'] . '</a>' : '') . '
		</td>
	</tr>
</table><br />

<table width="100%" cellpadding="0" cellspacing="0" border="0" class="sai_tabs">
	<tr>
		<td><a href="javascript:tabs.tab(\'overview\')" class="sai_tab" id="overview">' . $l['overview'] . '</a></td>
		<td><a href="javascript:tabs.tab(\'notes\')" class="sai_tab" id="notes">' . $l['notes'] . '</a></td>
		<td><a href="javascript:tabs.tab(\'features\')" class="sai_tab" id="features">' . $l['features'] . '</a></td>
		' . (empty($globals['off_rating_link']) && $soft < 10000 ? '<td><a href="javascript:tabs.tab(\'ratings\')" class="sai_tab" id="ratings">' . $l['ratings'] . '</a></td>' : '') . '
		' . (empty($globals['off_review_link']) && $soft < 10000 ? '<td><a href="javascript:tabs.tab(\'reviews\')" class="sai_tab" id="reviews">' . $l['reviews'] . '</a></td>' : '') . '
	</tr>
</table><br />';
    // Parse and take care of images
    $info['overview'] = '<div id="fadeout_div">' . (!empty($info['changelog']) ? '<div id="changelog_div" class="sai_popup" style="display:none;"><span class="sai_clogbutton b-close"><span>X</span></span><div class="sai_changelog">' . $info['changelog'] . '</div></div>' : '') . '

<table width="100%" cellpadding="8" cellspacing="1" border="0">
<tr>
	' . (!empty($scripts[$soft]['screenshots']) && empty($globals['panel_hf']) ? '
	<td width="20%" valign="top">
		<div id="overview_img"> <img src="' . $globals['mirror_images'] . 'softimages/screenshots/' . $soft . '_screenshot1.gif" width="500" alt="" > </div>
	</td>' : '') . '
	
	<td valign="top" style="padding:10px;">
		' . softparse($info['overview'], $soft) . '<br /><br />
		<table width="100%" cellpadding="4" cellspacing="1" border="0">
			<tr>
				<td width="10%" valign="top" align="center"><font color="#447edf"><i class="fa sai-disk fa-3x"></i></font></td>
				<td valign="top" width="40%">
					<span class="sai_head">' . $l['space_req'] . '</span><br />
					<span class="sai_exp">' . $l['available_space'] . ' : ' . (is_numeric($softpanel->spaceremain) ? number_format($softpanel->spaceremain / 1024 / 1024, 2) : $softpanel->spaceremain) . ' ' . $l['mb'] . '<br />
					' . $l['req_space'] . ' : ' . number_format($info['space'] / 1024 / 1024, 2) . ' ' . $l['mb'] . '</span>
				</td>
				<td valign="top" align="center" width="10%"><a href="' . $info['support'] . '"><font color="#447edf"><i class="fa sai-question fa-3x"></i></font></a></td>
				<td valign="top" width="40%">
					<span class="sai_head">' . $l['software_support'] . '</span><br />
					<span class="sai_exp"><a href="' . $info['support'] . '" target="_blank">' . $l['support_link'] . '</a><br />
					' . $l['support_note'] . '</span>
				</td>
			</tr>
		</table>
	</td>
</tr>
</table>';
    // Which Version is this software ?
    $info['overview'] .= '
<script language="javascript" type="text/javascript"><!-- // --><![CDATA[

function show_ins_but(){
	if($_("iagree").checked){
		$("#softsubmitbut").show();	
	}else{
		$("#softsubmitbut").hide();
	}
};
</script>';
    if (!empty($installed)) {
        $info['overview'] = '<h3>' . $l['congrats'] . '</h3><br />
' . $software['name'] . ' ' . $l['succesful'] . '<br />
' . $l['enjoy'] . '<br /><br />
' . (!empty($notes) ? $l['install_notes'] . ' : <br />
<div class="sai_notes">' . softparse($notes, $soft, 1) . '</div><br /><br />' : '') . '
' . $l['please_note'] . '<br /><br />
' . $l['regards'] . ',<br />
' . $l['softinstaller'] . '<br /><br />
<center><b><a href="' . app_link($soft) . '">' . $l['return'] . '</a></b></center><!--PROC_DONE--><br /><br />';
        if (empty($globals['install_tweet_off']) || empty($globals['lictype'])) {
            $info['overview'] .= '<form method="get" action="http://twitter.com/intent/tweet" id="tweet" onsubmit="return dotweet(this);">
	<table border="0" cellpadding="5" cellspacing="1" align="center" class="sai_divroundshad">
		<tr>
			<td colspan="2">
				<font size="+1"><b>' . $l['install_tweet_sub'] . ' :</b></font>
			</td>
		</tr>
		<tr>
			<td valign="middle">
			<textarea name="text" cols="60" row="3" style="resize:none">' . loadtweetdata('install_tweet', $l['install_tweet_classes']) . '</textarea>
			</td>
			<td valign="middle">
			<input type="submit" value="Tweet!" class="sai_twitter-btn" onsubmit="return false;" id="twitter-btn"/>
			</td>
		</tr>
	</table>
	</form>';
        }
    } elseif (!empty($removed)) {
        $info['overview'] = '<br /><br /><br /><div class="sai_success"><img src="' . $theme['images'] . 'notice.gif" /> &nbsp; ' . $l['uninstalled'] . '</div><!--PROC_DONE--><br /><br />
<center><b><a href="' . app_link($soft) . '">' . $l['return'] . '</a></b></center>';
    } else {
        // Premium App | Just listed in Free to TEMPT the USER
        if (empty($globals['lictype']) && !empty($apps[$soft]['force_apps'])) {
            $info['overview'] .= '<center class="sai_anotice">' . lang_vars($l['not_in_free'], array($apps[$soft]['name'])) . '</center><br />';
        }
        // The installer
        $info['overview'] .= '<br />

' . error_handle($error, "100%", 0, 1) . '<form accept-charset="' . $globals['charset'] . '" name="installsoftware" method="post" action="" onsubmit="return checkform();" id="installsoftware">
	<p align="center">';
        if (!empty($settings)) {
            // For set defaults check box display
            $is_display = 0;
            if (!empty($info['is_default'])) {
                foreach ($info['is_default'] as $k => $v) {
                    if (array_key_exists($v, $iapps)) {
                        $ins_display = 1;
                    }
                }
            }
            // Is this app a dependency for any other application ?
            foreach ($iapps as $k => $v) {
                if (empty($v['deps'])) {
                    continue;
                }
                if (in_array($apps[$soft]['softname'], $v['deps'])) {
                    $rem_display = 1;
                }
            }
            if (!empty($ins_display) || !empty($rem_display)) {
                foreach ($settings as $group => $sets) {
                    if ($group == 'hidden' || empty($sets)) {
                        continue;
                    }
                    $ext_disp .= '<br />
<table width="100%" cellpadding="8" cellspacing="1" border="0" class="sai_divroundshad">
<tr class="nohover">
<td class="sai_heading_full" colspan="5">' . $group . '</td>
</tr>
';
                    foreach ($sets as $sk => $sv) {
                        $ext_disp .= '<tr>
						<td width="50%">
						<span class="sai_head">' . $sv['head'] . '</span>
						' . (empty($sv['exp']) ? '' : '<br /><span class="sai_exp">' . $sv['exp'] . '</span>') . '
						</td>
						<td valign="top">
						' . (preg_match('/admin_pass|softpass/is', $sv['tag']) ? preg_replace('/>|\\/>/is', ' onkeyup="check_pass_strength();">', $sv['tag']) : $sv['tag']) . '
						' . (preg_match('/softmail/is', $sv['tag']) ? '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
						softemail["' . $sk . '"] = false;
						//Add an event handler
						$_("' . $sk . '").onkeydown = function(){
							softemail["' . $sk . '"] = true;
						}
						// ]]></script>
						' : '') . '
						' . (preg_match('/admin_pass|softpass/is', $sv['tag']) ? '
						<a href="javascript: void(0);" onclick="$_(\'' . $sk . '\').value=randstr(10, 1);check_pass_strength();return false;" title="' . $l['randpass'] . '"><img src="' . $theme['images'] . 'randpass.gif" /></a>
						<div id="pass-strength-result" class="">' . $l['strength_indicator'] . '</div>' : '') . '
						' . (preg_match('/admin_pass|softpass/is', $sv['tag']) && (!empty($softpanel->securepass) || !empty($globals['random_pass'])) ? '
						<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
						addonload(\'$_("' . $sk . '").value=randstr(10, 1);check_pass_strength();\');
						// ]]></script>
						' : '') . '
						' . (preg_match('/admin_pass|softpass/is', $sv['tag']) && !empty($globals['empty_pass']) ? '
						<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
						addonload(\'$_("' . $sk . '").value="";check_pass_strength();\');
						// ]]></script>
						' : '') . '
						' . (preg_match('/dbprefix/is', $sv['tag']) && !empty($globals['random_dbprefix']) ? '
						<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
						addonload(\'$_("' . $sk . '").value=randstr(3)+"_";\');
						// ]]></script>
						' : '') . '
						' . (preg_match('/admin_username/is', $sv['tag']) && !empty($globals['random_username']) && !empty($random_username) ? '
						<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
						addonload(\'$_("' . $sk . '").value=randstr(5);\');
						// ]]></script>
						' : '') . '
						' . (preg_match('/admin_username/is', $sv['tag']) && !empty($globals['empty_username']) && !empty($random_username) ? '
						<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
						addonload(\'$_("' . $sk . '").value="";\');
						// ]]></script>
						' : '') . '
						' . (preg_match('/admin_username/is', $sv['tag']) && !empty($globals['admin_prefix']) && empty($globals['empty_username']) && empty($globals['random_username']) && !empty($random_username) ? '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
						addonload(\'prepend_prefix("' . $globals['admin_prefix'] . '");\');
							// ]]></script>
						' : '') . '
						</td>
						</tr>';
                    }
                    $ext_disp .= '</table><br />';
                }
            }
            //End of if($settings)
        }
        if (empty($iapps[$soft . '_1'])) {
            if (!empty($ins_display)) {
                $info['overview'] .= $ext_disp;
            }
            $info['overview'] .= '<center><input type="hidden" align="" name="install" id="softsubmit" value="install" />
			<input type="submit" name="softsubmitbut" id="softsubmitbut" value="' . $l['softsubmit'] . '" class="sai_graybluebut" /></center>';
        } else {
            if (!empty($rem_display)) {
                $info['overview'] .= $ext_disp;
            }
            $info['overview'] .= '<center><input type="hidden" name="remove" id="softsubmit" value="remove" />
			<input type="submit" name="softsubmitbut" id="softsubmitbut" onclick="return confirm_remove();" value="' . $l['remove'] . '" class="sai_graybluebut" /></center>';
        }
        $info['overview'] .= '<span id="show_txt" style="display:none;"></span>
	
	<input type="hidden" name="soft_status_key" id="soft_status_key" value="' . POSTval('soft_status_key', generateRandStr(32)) . '" />
	</p>
</form>
</div><br />

<div id="progress_bar" style="height:125px; display: none;">
	<br />
	<center>
	<font size="4" color="#222222" id="progress_txt">' . $l['checking_data'] . '</font>
	<font style="font-size: 18px;font-weight: 400;color: #444444;" id="progress_percent">(0 %)</font><br /><br />
	</center>
	<table width="500" cellpadding="0" cellspacing="0" id="table_progress" border="0" align="center" height="28" style="border:1px solid #CCC; -moz-border-radius: 5px;
-webkit-border-radius: 5px; border-radius: 5px;background-color:#efefef;">
		<tr>
			<td id="progress_color" width="1" style="background-image: url(' . $theme['images'] . 'bar.gif); -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px;"></td>
			<td id="progress_nocolor">&nbsp;</td>
		</tr>
	</table>
<br /><center>' . $l['wait_note'] . '</center>
</div>

<script language="javascript" type="text/javascript"><!-- // --><![CDATA[

function confirm_remove(){
	
	var r = confirm("' . $l['del_insid'] . '");
	if(r != true){
		return false;
	}
	
	return true;
	
}

function checkform(dosubmit){
	try{
		if(!formcheck()){
			return false;
		}
	}catch(e){
		//Do nothing
	}
	$_("softsubmitbut").disabled = true;	
	
	if(!get_package()){
		return false;
	}
	
	if(useprog){
		
		// Send a request to check the status
		progressbar.start();
		
		// Return false so that the form is not submitted
		return false;
	
	// This is OLD School !
	}else{
		if($_("softsubmit").value == "remove"){
			show_msg("' . $l['removing'] . '");
		}else{
			if(dosubmit == 1){			
				$_("installsoftware").submit();	
			}
			show_msg("' . $l['installing'] . '");
		}
	}
	
	return true;
	
};

var progressbar = {
	timer: 0,
	total_width: 0,	
	status_key: "",
	synctimer: 0,
	fadeout_div: "#fadeout_div",
	win_div: "#overview_win",
	progress_div: "#progress_bar",
	formid: "#installsoftware",
	frequency: 8000,
	
	current: function(){
		try{
			var tmp_cur = Math.round(parseInt($_("progress_color").width)/parseInt($_("table_progress").width)*100);
			if(tmp_cur > 100){
				tmp_cur = 99;
			}
			return tmp_cur;
		}catch(e){
			return -1;	
		}
	},
	
	reset: function(){ try{
		clearTimeout(this.timer);
		$_("progress_color").width = 1;
	}catch(e){ }},
	
	move: function(dest, speed, todo){ try{
		var cur = this.current();
		if(cur < 0){
			clearTimeout(this.timer);
			return false;
		}
		var cent = cur + 1;
		var new_width = cent/100*this.total_width;
		if(new_width < 1){
			new_width = 1;
		}
		//alert(new_width+" "+dest+" "+cent);
		$_("progress_color").width = new_width;
		$_("progress_percent").innerHTML = "("+cent+" %)";
		
		if(cent < dest){
			this.timer = setTimeout("progressbar.move("+dest+", "+speed+")", speed);
		}else{
			eval(todo);	
		}
	}catch(e){ }},
	
	text: function(txt){ try{
		$("#progress_txt").html(txt);
	}catch(e){ }},
	
	sync: function(){
		if(progressbar.status_key.length < 2){
			return false;
		}
		$.ajax({
			url: window.location+"&ajaxstatus="+progressbar.status_key+"&random="+Math.random(),
			type: "GET",
			success: function(data){
			if(data == 0) return false;			
				var tmp = data.split("|");
				var cur = progressbar.current();
				tmp[2] = (3000/(tmp[0]-cur));
				
				if(tmp[0] > cur){
					if(parseInt(tmp[2]) == 0){
						tmp[2] = 800;
					}
					progressbar.move(tmp[0], tmp[2]);
				}
				progressbar.text(tmp[1]);
				progressbar.synctimer = setTimeout("progressbar.sync()", progressbar.frequency);
			}
		});
	},
	
	sync_abort: function(){
		clearTimeout(this.synctimer);
	},
	
	start: function(){ try{
		this.post();
		this.reset();
		this.total_width = parseInt($_("table_progress").width);
		this.move(95, 800);
		this.status_key = $("#soft_status_key").attr("value");
		this.sync();
	}catch(e){ }},
	
	post: function(){
		
		// Scroll to the Top and show the progress bar
		goto_top();
		$(progressbar.fadeout_div).fadeOut(500, 
			function(){
				$(progressbar.progress_div).fadeOut(1);
				$(progressbar.progress_div).fadeIn(500);
			}
		);
		
		try{
			var sid = $_("softbranch").value;
		}catch(e){
			var sid = ' . $soft . '
		}
		var action = $("#softsubmitbut").val();
		$.ajax({
			url: window.location+"&jsnohf=1&soft="+sid+"&multi_ver=1",
			type: "POST",
			data: $(progressbar.formid).serialize(),
			complete: function( jqXHR, status, responseText ) {
				
				progressbar.sync_abort();
				
				// Store the response as specified by the jqXHR object
				responseText = jqXHR.responseText;
				
				try{
					
					if(responseText.match(/\\<\\!\\-\\-PROC_DONE\\-\\-\\>/gi)){
						if(action == "Install"){
							progressbar.text("' . addslashes($l['ins_finishing_process']) . '");
						}else{
							progressbar.text("' . addslashes($l['rem_finishing_process']) . '");
						}
							
						progressbar.move(99, 10, "$(progressbar.progress_div).fadeOut(1)");
					}else{
						progressbar.reset();
					}
				}catch(e){ }
				
				if ( jqXHR.isResolved() ) {
				
					// #4825: Get the actual response in case
					// a dataFilter is present in ajaxSettings
					jqXHR.done(function( r ) {
						responseText = r;
					});
			
					// Create a dummy div to hold the results
					// inject the contents of the document in, removing the scripts
					// to avoid any "Permission Denied" errors in IE
					var newhtml = jQuery("<div>").append(responseText).find(progressbar.win_div).html();
					
					$(progressbar.win_div).animate({opacity: 0}, 1000, "", function(){
						$(progressbar.win_div).html(newhtml);
					}).delay(50).animate({opacity: 1}, 500);
					
					//alert(newhtml);
					
				}else{
					alert("Oops ... the connection was lost");
				}
			}
		});
	}
};

function show_msg(msg){	
	$_("show_txt").innerHTML = "<br /><br /> &nbsp; "+msg+" &nbsp; <img src=\\"' . $theme['images'] . 'progress.gif\\" />";
	$_("show_txt").style.display = "";
}

// Is the package there ?
var nopackage = ' . (empty($nopackage) ? 0 : 1) . ';

// Use the Progress Bar ?
var useprog = 1; 
try{
	if(BrowserDetect.browser.toLowerCase() == "safari" && BrowserDetect.version.toString().substr(0, 1) == "3"){
		useprog = 0;
	}
}catch(e){ }

function get_package(){	
	if(nopackage){
		
		show_msg("' . $l['downloading'] . '");
		
		try{		
			AJAX("' . $globals['index'] . 'act=software&soft=' . $soft . '&ajaxdownload=1&random="+Math.random(), "get_package_handle(re)");
		}catch(e){ }
		
		return false;
	}else{
		$_("show_txt").style.display = "none";
		return true;
	}
};

function get_package_handle(resp){
	nopackage = 0;
	show_msg("' . $l['installing'] . '");
	checkform(1);
};
</script>
';
    }
    //Parse and take care of images
    $info['features'] = softparse($info['features'], $soft, 1);
    $info['ratings'] = '';
    $info['reviews'] = '<div id="allreviews"></div>';
    foreach ($info as $k => $v) {
        if (in_array($k, array('demo', 'support', 'import', 'install'))) {
            continue;
        }
        echo '<div id="' . $k . '_win" style="display: ' . ($init_tab == $k ? "block" : "none") . ';">
	' . $v . '
	</div>';
    }
    softfooter();
}
Пример #13
0
function adv_software_theme()
{
    global $theme, $globals, $user, $l, $langs, $skins, $error, $saved, $admintag, $admintag_catwise, $adv_software, $iscripts, $reset;
    softheader($l['<title>']);
    echo '<div class="sai_heading" align="center">&nbsp;&nbsp;&nbsp;' . $l['adv_software_head'] . '</div>
<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" /><br /><br />';
    error_handle($error);
    if (!empty($saved)) {
        echo '<br /><div class="sai_success"><img src="' . $theme['images'] . 'success.gif" /> ' . $l['settings_saved'] . '</div><br />';
    }
    if (!empty($reset)) {
        echo '<br /><div class="sai_success"><img src="' . $theme['images'] . 'success.gif" /> ' . $l['settings_reset'] . '</div><br />';
    }
    if (!empty($admintag_catwise)) {
        echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
	function reset_field(input, field){	
		var this_page = "' . $globals['index'] . 'act=adv_software";
		window.location = this_page+"&soft="+input;	
		if(field){
			window.location = this_page+"&soft="+input+"&field="+field;	
		}	
	};
	
	function reset_all(){	
		var this_page = "' . $globals['index'] . 'act=adv_software";
		window.location = this_page+"&reset_all="+1;
	};
	
	function showtip(txt, el){	
		
		$_("stooltip").innerHTML = txt;
		
		var pos = findelpos(el);
		$_("stooltip").style.display = "";
		var tipheight = parseInt($_("stooltip").offsetHeight);
		var tipwidth = parseInt($_("stooltip").offsetWidth);
		//alert(tipheight+" "+tipwidth);
		
		var abody = findelpos($_("abody"));
		var bodyWidth = abody[0] + $_("abody").offsetWidth
		
		if((pos[0] + tipwidth) > bodyWidth){
			pos[0] = pos[0] - (pos[0] + tipwidth - bodyWidth) + 15;
		}
		
		$_("stooltip").style.left = pos[0]+"px";
		$_("stooltip").style.top = (pos[1]-5-tipheight)+"px";
		
		el.onmouseout = function(){
			hidetip();
		};
	
	};
	
	function hidetip(){
		$_("stooltip").style.display = "none";
	};
	
	// ]]></script>
	
	<div id="stooltip" style="display:none; position:absolute; top: 0px; left: 0px; border: 1px solid #CCC; padding: 8px; background: #FFF; z-index:1000;"></div>
	<form accept-charset="' . $globals['charset'] . '" name="adv_software" method="post" action="">
	<link href="' . $globals['mirror_images'] . 'sprites/20.css" rel="stylesheet" type="text/css" />
		<table width="721" cellpadding="6" cellspacing="0" border="0" style="margin:0px auto;" class="sai_divroundshad">
		
		<tr>
			<td colspan="2">
				<table width="100%" cellpadding="5" cellspacing="1" border="0">';
        //r_print($adv_software);
        //r_print($admintag_catwise);
        //Showing All scripts Category wise
        foreach ($admintag_catwise as $ak => $av) {
            echo '<tr>
							<td colspan="4"><center class=ribbonhead><b>' . strtoupper($ak) . ' Apps</b></center></td>
						</tr>';
            echo '<tr>
							<td colspan="2">
								<table width="107%" border="0" class="sai_ribboneffect" style="left:-26px;">
									<tr>
										<td width="2%"></td>
										<td valign="top" width="280">
											<br /><font class="bboxtxt" style="color:#FFF;"><b>' . $l['cat_' . $ak . '_' . $kk] . '</b></font>
										</td>
										<td align="center" style="cursor:pointer">
											<font class="bboxtxt" style="color:#FFF;" id="enable" onmouseover="showtip(\'' . $l['enable_exp'] . '\', this);" ><b>' . $l['enable'] . '</b></font>
										</td>
										<td align="center" style="cursor:pointer">
											<font class="bboxtxt" style="color:#FFF;" onmouseover="showtip(\'' . $l['default_exp'] . '\', this);" ><b>' . $l['default'] . '</b></font>
										</td>
										<td align="center" style="cursor:pointer">
											<font class="bboxtxt" style="color:#FFF;" onmouseover="showtip(\'' . $l['editable_exp'] . '\', this);" ><b>' . $l['editable'] . '</b></font>
										</td>
										<td align="right" width="40"></td>
									</tr>
								</table>
							</td>
						</tr>';
            foreach ($av as $kk => $vv) {
                if (empty($av[$kk])) {
                    continue;
                }
                foreach ($vv as $k => $v) {
                    //r_print($v);
                    echo '<tr>
							<td>
							<table border="0" width="100%" id="td_' . $k . '" cellpadding="5" cellspacing="0" class="adv_cat">
								<tr>
								<th colspan="4">
									<table border="0" width="100%" cellpadding="3" cellspacing="0">
										<tr>
											<td width="16"><div class="sp20_' . $iscripts[$k]['softname'] . '"></div></td>
											<td><font class="bboxtxt"><b>' . $iscripts[$k]['name'] . '</b></font></td>
										</tr>
									</table>
								</th>
								<th align="left" width="2%">
									<img src="' . $theme['images'] . 'restore.gif" onclick="reset_field(' . $k . ')" onmouseover="showtip(\'' . lang_vars($l['reset_soft'], array($iscripts[$k]['name'])) . '\', this);" style="cursor:pointer"/>
								</th>
								</tr>';
                    foreach ($v as $dk => $dv) {
                        //r_print($dv);
                        $tmp = array();
                        echo '<tr>
									<td width="40%">
										<font class="bboxtxt"><b>' . $dv['head'] . '</b></font>
									</td>
									<td align="center" width="10%">
										<input type="checkbox" name="' . $k . '_' . $dk . '_enabled" id="' . $k . '_' . $dk . '_enabled" ' . POSTchecked($k . '_' . $dk . '_enabled', $dv['enabled']) . '>
									</td>
									<td width="30%">';
                        // Is it a checkbox or textbox or textarea ?
                        if (preg_match('/^<textarea/is', $dv['tag'])) {
                            $tmp['type'] = 'textarea';
                        } else {
                            preg_replace('/^<input(.*?)type="(.*?)"/ies', '$tmp[\'type\'] = trim(\'$2\')', $dv['tag']);
                        }
                        // Is it checkbox ?
                        if ($tmp['type'] == 'checkbox') {
                            $tmp['default'] = isset($adv_software[$k][$dk]['default']) ? $adv_software[$k][$dk]['default'] == 'checked="checked"' ? 'checked="checked"' : '' : (preg_match('/checked="checked"/is', $dv['tag']) ? 'checked="checked"' : '');
                            echo '<center><input type="checkbox" name="' . $k . '_' . $dk . '_default" id="' . $k . '_' . $dk . '_default" ' . POSTchecked($k . '_' . $dk . '_default', $tmp['default']) . '></center>';
                        }
                        // Is it a textbox ?
                        if ($tmp['type'] == 'text') {
                            preg_replace('/^<input(.*?)value="(.*?)"/ies', '$tmp[\'value\'] = trim(\'$2\')', $dv['tag']);
                            if (isset($adv_software[$k][$dk]['default']) && !empty($adv_software[$k][$dk]['default'])) {
                                $value = $adv_software[$k][$dk]['default'];
                            } else {
                                $value = $tmp['value'];
                            }
                            echo '<input type="text" name="' . $k . '_' . $dk . '_default" id="' . $k . '_' . $dk . '_default" value="' . POSTval($k . '_' . $dk . '_default', $value) . '" />';
                        }
                        // Is it a textarea ?
                        if ($tmp['type'] == 'textarea') {
                            preg_replace('/^<textarea(.*?)>(.*?)<\\/textarea>/ies', '$tmp[\'value\'] = trim(\'$2\')', $dv['tag']);
                            preg_replace('/^<textarea(.*?)cols="(.*?)"(.*?)>(.*?)<\\/textarea>/ies', '$tmp[\'cols\'] = trim(\'$2\')', $dv['tag']);
                            preg_replace('/^<textarea(.*?)rows="(.*?)"(.*?)>(.*?)<\\/textarea>/ies', '$tmp[\'rows\'] = trim(\'$2\')', $dv['tag']);
                            if (isset($adv_software[$k][$dk]['default']) && !empty($adv_software[$k][$dk]['default'])) {
                                $value = $adv_software[$k][$dk]['default'];
                            } else {
                                $value = $tmp['value'];
                            }
                            echo '<textarea name="' . $k . '_' . $dk . '_default" id="' . $k . '_' . $dk . '_default"' . (!empty($tmp['cols']) ? ' cols="' . $tmp['cols'] . '"' : '') . (!empty($tmp['rows']) ? ' rows="' . $tmp['rows'] . '"' : '') . ' >' . POSTval($k . '_' . $dk . '_default', $value) . '</textarea>';
                        }
                        echo '</td>
									<td align="center" width="10%">
										<input type="checkbox" name="' . $k . '_' . $dk . '_editable" id="' . $k . '_' . $dk . '_editable" ' . POSTchecked($k . '_' . $dk . '_editable', $dv['editable']) . ' >
									</td>
									
									<td width="5%">
										<img src="' . $theme['images'] . 'restore.gif" onclick="reset_field(' . $k . ', \'' . $dk . '\');" onmouseover="showtip(\'' . $l['reset'] . '\', this);" style="cursor:pointer"/>
									</td>
									</tr>';
                    }
                    echo '</table>
								</td>
							</tr>
							<tr><td colspan="10">&nbsp;</td></tr>';
                }
            }
        }
        echo '</td></tr></table></td>
		</tr>
	</table>
	<br />
	<p align="center"><input type="submit" name="save" value="' . $l['save'] . '" class="sai_graybluebut" > &nbsp; &nbsp;
	<input type="button" onclick="reset_all()" value="' . $l['reset_all'] . '" class="sai_graybluebut" ></p>
	</form>';
    } else {
        echo '<h2 align="center">' . $l['no_results'] . '</h2>';
    }
    softfooter();
}
Пример #14
0
function sclone_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error, $scripts;
    global $software, $soft, $info, $settings, $init_tab, $dbtype, $dbs, $installed, $__settings, $setupcontinue, $installations, $notes, $cron, $datadir, $ajaxdb, $ajaxdbexists, $overwrite_option, $protocols, $nopackage, $can_publish, $not_default, $child, $install_option, $multi_ver, $child_sids, $installation_keys, $no_autoupgrade, $ajaxhttpsexists, $ajaxhttps, $insid, $cloned, $new_insid;
    if (optGET('ajaxdownload') && !empty($nopackage)) {
        // Try to download the package
        if (method_exists($softpanel, 'updatesoftwares')) {
            $softpanel->updatesoftwares($soft, 0, 0, 1);
            echo 1;
            return true;
        }
        // False call
        echo 0;
        return false;
    }
    // Give the status
    if (optGET('ajaxstatus')) {
        $_status = soft_progress(optGET('ajaxstatus'));
        $tmp_status = unserialize($_status[1]);
        $_status[1] = $tmp_status['current_status'];
        if (!empty($_status)) {
            echo implode('|', $_status);
            return true;
        }
        // False call
        echo 0;
        return false;
    }
    if (!empty($ajaxdb)) {
        echo $ajaxdbexists;
        return true;
    }
    if (!empty($ajaxhttps)) {
        echo $ajaxhttpsexists;
        return true;
    }
    softheader($l['<title>']);
    if (!empty($cloned)) {
        echo '
		<div class="bg">
			<h4>' . $l['congrats'] . '</h4><br />
			' . $software['name'] . ' ' . $l['succesful'] . ' : <br />
			<a href="' . $__settings['softurl'] . '" target="_blank">' . $__settings['softurl'] . '</a>
			' . (!empty($software['adminurl']) ? '<br />' . $l['admin_url'] . ' : <a href="' . $__settings['softurl'] . '/' . $software['adminurl'] . '" target="_blank">' . $__settings['softurl'] . '/' . $software['adminurl'] . '</a>' : '') . '<br /><br />
			' . (!empty($setupcontinue) ? $l['setup_continue'] . ' : <br />
			<a href="' . $__settings['softurl'] . '/' . $setupcontinue . '" target="_blank">' . $__settings['softurl'] . '/' . $setupcontinue . '</a><br /><br />' : '') . '
			' . $l['enjoy'] . '<br /><br />
			' . (!empty($notes) ? $l['install_notes'] . ' : <br />
			<div class="sai_notes">' . softparse($notes, $soft) . '</div><br /><br />' : '') . '
			' . $l['please_note'] . '<br /><br />
			' . $l['regards'] . ',<br />
			' . $l['softinstaller'] . '<br /><br />
			<center><b><a href="' . script_link($soft) . '&highlight=' . $new_insid . '&postact=clone" class="sai_head">' . $l['return'] . '</a></b></center><br /><br />';
        if (empty($globals['clone_tweet_off']) || empty($globals['lictype'])) {
            echo '
				<form method="get" action="http://twitter.com/intent/tweet" id="tweet" onsubmit="return dotweet(this);">
					<div class="panel panel-info" style="width:55%; margin:0 auto;">
						<div class="panel-heading" style="padding:5px; font-size:15px;">
							<font><b>' . $l['clone_tweet_sub'] . ' :</b></font>
						</div>
						<div class="panel-body">
							<div class="row">
								<div class="col-sm-10">
									<textarea name="text" cols="80" row="3" style="resize:none; width:100%;">' . loadtweetdata('clone_tweet', $l['clone_tweet']) . '</textarea>
								</div>
								<div class="col-sm-2 col-xs-2">
									<input type="submit" value="Tweet!" class="btn btn-info" onsubmit="return false;" id="twitter-btn" style="margin-top:20px;"/>
								</div>
							</div>
						</div>
					</div>
				</form>';
        }
        echo '
		</div><!--end of bg class--><!--PROC_DONE-->
		<br /><br />';
    } else {
        echo '
		<div id="install_win">
			<div id="fadeout_div">
				<form accept-charset="' . $globals['charset'] . '" name="clonesoftware" method="post" action="" onsubmit="return checkform();" id="clonesoftware">
			
					<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
					
					function checkform(dosubmit){
						
						try{
							if(!formcheck()){
								return false;
							}
						}catch(e){
							//Do nothing
						}
						$_("softsubmitbut").disabled = true;	
						
						if(!get_package()){
							return false;
						}
						
						if(useprog){
							
							// Send a request to check the status
							progressbar.start();
							
							// Return false so that the form is not submitted
							return false;
						
						// This is OLD School !
						}else{		
							if(dosubmit == 1){			
								$_("clonesoftware").submit();	
							}
							show_msg("' . $l['cloning'] . '");
						}
						
						return true;
						
					};
					
					var progressbar = {
						timer: 0,
						total_width: 0,	
						status_key: "",
						synctimer: 0,
						fadeout_div: "#fadeout_div",
						win_div: "#install_win",
						progress_div: "#progress_bar",
						formid: "#clonesoftware",
						frequency: 8000,
						
						current: function(){
							try{
								var tmp_cur = Math.round(parseInt($_("progress_color").width)/parseInt($_("table_progress").width)*100);
								if(tmp_cur > 100){
									tmp_cur = 99;
								}
								return tmp_cur;
							}catch(e){
								return -1;	
							}
						},
						
						reset: function(){ try{
							clearTimeout(this.timer);
							$_("progress_color").width = 1;
						}catch(e){ }},
						
						move: function(dest, speed, todo){ try{
							var cur = this.current();
							if(cur < 0){
								clearTimeout(this.timer);
								return false;
							}
							var cent = cur + 1;
							var new_width = cent/100*this.total_width;
							if(new_width < 1){
								new_width = 1;
							}
							//alert(new_width+" "+dest+" "+cent);
							$_("progress_color").width = new_width;
							$_("progress_percent").innerHTML = "("+cent+" %)";
							
							if(cent < dest){
								this.timer = setTimeout("progressbar.move("+dest+", "+speed+")", speed);
							}else{
								eval(todo);	
							}
						}catch(e){ }},
						
						text: function(txt){ try{
							$_("progress_txt").innerHTML = txt;
						}catch(e){ }},
						
						sync: function(){
							if(progressbar.status_key.length < 2){
								return false;
							}
							$.ajax({
								url: window.location+"&ajaxstatus="+progressbar.status_key+"&random="+Math.random(),
								type: "GET",
								success: function(data){
									if(data == 0) return false;
									var tmp = data.split("|");
									var cur = progressbar.current();
									tmp[2] = (3000/(tmp[0]-cur));
									//alert(tmp);
									if(tmp[0] > cur){
										if(parseInt(tmp[2]) == 0){
											tmp[2] = 800;
										}
										progressbar.move(tmp[0], tmp[2]);
									}
									progressbar.text(tmp[1]);
									progressbar.synctimer = setTimeout("progressbar.sync()", progressbar.frequency);
								}
							});
						},
						
						sync_abort: function(){
							clearTimeout(this.synctimer);
						},
						
						start: function(){ try{
							this.post();
							this.reset();
							this.total_width = parseInt($_("table_progress").width);
							this.move(95, 800);
							this.status_key = $("#soft_status_key").attr("value");
							this.sync();
						}catch(e){ }},
						
						post: function(){
							
							// Scroll to the Top and show the progress bar
							goto_top();
							$(progressbar.fadeout_div).fadeOut(500, 
								function(){
									$(progressbar.progress_div).fadeOut(1);
									$(progressbar.progress_div).fadeIn(500);
								}
							);
							
							try{
								var sid = $_("softbranch").value;
							}catch(e){
								var sid = ' . $soft . '
							}
							
							$.ajax({
								url: window.location+"&jsnohf=1&soft="+sid+"&multi_ver=1",
								type: "POST",
								data: $(progressbar.formid).serialize(),
								complete: function( jqXHR, status, responseText ) {
									
									progressbar.sync_abort();
									
									// Store the response as specified by the jqXHR object
									responseText = jqXHR.responseText;
									
									try{
										if(responseText.match(/\\<\\!\\-\\-PROC_DONE\\-\\-\\>/gi)){
											progressbar.text("' . addslashes($l['finishing_process']) . '");
											progressbar.move(99, 10, "$(progressbar.progress_div).fadeOut(1)");
										}else{
											progressbar.reset();
										}
									}catch(e){ }
									
									if ( jqXHR.isResolved() ) {
									
										// #4825: Get the actual response in case
										// a dataFilter is present in ajaxSettings
										jqXHR.done(function( r ) {
											responseText = r;
										});
								
										// Create a dummy div to hold the results
										// inject the contents of the document in, removing the scripts
										// to avoid any "Permission Denied" errors in IE
										//var newhtml = jQuery("<div>").append(responseText).find(progressbar.win_div).html();
										//alert(responseText);
										$(progressbar.win_div).animate({opacity: 0}, 1000, "", function(){
											$(progressbar.win_div).html(responseText);
											new_theme_funcs_init();
										}).delay(50).animate({opacity: 1}, 500);
										
										//alert(newhtml);
										
									}else{
										alert("Oops ... the connection was lost");
									}
								}
							});
						}
					};
					
					function show_msg(msg){	
						$_("show_txt").innerHTML = "<br /><br /> &nbsp; "+msg+" &nbsp; <img src=\\"' . $theme['images'] . 'progress.gif\\" />";
						$_("show_txt").style.display = "";
					}
					
					// Is the package there ?
					var nopackage = ' . (empty($nopackage) ? 0 : 1) . ';
					
					// Use the Progress Bar ?
					var useprog = 1; 
					try{
						if(BrowserDetect.browser.toLowerCase() == "safari" && BrowserDetect.version.toString().substr(0, 1) == "3"){
							useprog = 0;
						}
					}catch(e){ }
					
					function get_package(){	
						if(nopackage){
							
							show_msg("' . $l['downloading'] . '");
							
							try{		
								AJAX("' . script_link($soft) . '&ajaxdownload=1&random="+Math.random(), "get_package_handle(re)");
							}catch(e){ }
							
							return false;
						}else{
							$_("show_txt").style.display = "none";
							return true;
						}
					};
					
					function get_package_handle(resp){
						nopackage = 0;
						show_msg("' . $l['cloning'] . '");
						checkform(1);
					};
					
					function checkhttps(proto_id, softdomain_id, alrt){
						try{
							var id = $_(proto_id);
							var proto = id.options[id.selectedIndex].text;
						
							$("#checkhttps_wait").css("display","inline-block");
							if(proto.indexOf("https") !== -1){
							
								 $.ajax({
									type: "POST",
									url: "' . script_link($soft) . '&checkhttps="+encodeURIComponent(proto+$_(softdomain_id).value),
									timeout:10000,
									// Checking for error
									success: function(data){
										$("#checkhttps_wait").css("display","none");
										is_https(data);
									},
									error: function(jqXHR, status, e) {
										$("#checkhttps_wait").css("display","none");
										is_https(e);
										return false;
									}
								}); 
								
								//AJAX("' . script_link($soft) . '&checkhttps="+id.options[id.selectedIndex].text+$_(softdomain_id).value, "is_https(re)");
							}else{
								$("#checkhttps_wait").css("display","none");
								is_https("true");
							}
							if(alrt == true){
								alert(proto+$_(softdomain_id).value);
							}
						}catch(e){
							//
						}
						return true;
					};
					
					function is_https(re){
						try{
							httpserror = "";
							
							//Check if it exists
							if(re !== "true"){
								httpserror = "' . $l['no_https'] . '";
							}
							if(httpserror != ""){
								$_("httpserror").style.display = "block";
								$_("httpserror").innerHTML = httpserror;
								return false;
							}else{
								$_("httpserror").style.display = "none";
							}
							
						}catch(e){
							//
						}
						return true;
					};
					';
        if (!empty($dbtype)) {
            echo 'function checkdbname(id, alrt){
							try{		
								AJAX("' . script_link($soft) . '&checkdbexists="+$_(id).value, "dbexists(\'"+id+"\', "+alrt+", re)");	
							}catch(e){
								//
							}
							return true;
						};
						
						function dbexists(id, alrt, re){
							try{
								
								dberror = "";
								
								//Is the length fine
								if($_(id).value.length > ' . (empty($softpanel->maxdblen) ? 7 : $softpanel->maxdblen) . '){
									dberror = "' . $l['db_name_long'] . '";
								}
								
								//There should be only alphanumeric characters
								if(/[^a-zA-Z0-9]/.test($_(id).value) && !' . aefer() . '0){
									dberror = "' . $l['db_alpha_num'] . '";
								}
								
								//Check if it exists
								if(re == "true"){
									dberror = "' . $l['database_exists'] . '";
								}
								
								if(dberror != ""){
									$_(id+"error").style.display = "block";
									$_(id+"error").innerHTML = dberror;
									if(alrt == true){
										alert(dberror);
									}
									return false;
								}else{
									$_(id+"error").style.display = "none";
								}
								
							}catch(e){
								//
							}
							return true;
						};';
        }
        //End of if($dbtype)
        echo '
					// ]]></script>';
        echo '
					<div class="bg"><br />						
						<div class="row sai_main_head" style="width:100%;" align="center">
							<div class="col-sm-6 col-xs-5" style="padding:0 10px 0 0; text-align:right;">
								<i class="fa sai-copy fa-2x" style="color:#00A0D2;"></i>
							</div>
							<div class="col-sm-6 col-xs-7" style="padding-top:10px; padding-left:0; text-align:left;">' . $l['prog_cloning'] . $software['name'] . '</div>
						</div>';
        if (empty($globals['lictype']) && !empty($scripts[$soft]['force_scripts'])) {
            echo '<br />
							<div class="alert alert-warning">
								<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
								<center>' . lang_vars($l['not_in_free'], array($software['name'])) . (!webuzo() ? '&nbsp;&nbsp;' . $l['notify_admin'] : '') . '</center>
							</div>';
        }
        echo error_handle($error, "100%", 0, 1);
        echo '
						<div style="padding: 0 25px;"><br />
							<div class="sai_sub_head">' . $l['clone_ins'] . '</div><hr>';
        if (empty($softpanel->noprotocol)) {
            echo '
								<div class="row">
									<div class="col-sm-5">
										<label for="softproto" class="sai_head">' . $l['choose_protocol'] . '</label><br />
										<span class="sai_exp2">' . $l['choose_protocol_exp'] . '</span>
									</div>
									<div class="col-sm-7">
										<select name="softproto" id="softproto" class="form-control" onblur="checkhttps(\'softproto\', \'softdomain\', false)">';
            foreach ($protocols as $k => $v) {
                echo '<option value="' . $k . '" ' . (optPOST('softproto') == $k || $globals['default_protocol'] == $k && empty($_POST['softproto']) ? 'selected="selected"' : '') . '>' . $v . '</option>';
            }
            echo '
										</select>
										<div style="display:none;" id="checkhttps_wait">&nbsp;&nbsp;<img src="' . $theme['images'] . 'progress.gif" alt="please wait..">
										</div><br />
										<div class="row">
											<div class="col-sm-12">
												<span id="httpserror" style="display:none; font-size:12px; padding:10px;" class="alert alert-danger"></span>
											</div>
										</div>
									</div>
								</div>';
        }
        echo '
							<div class="row">
								<div class="col-sm-5">
									<label for="softdomain" class="sai_head">' . $l['choose_domain'] . '</label><br />
									<span class="sai_exp2">' . $l['choose_domain_exp'] . '</span>
								</div>
								<div class="col-sm-7">
									<select name="softdomain" id="softdomain" class="form-control" onchange="softmail();" onblur="checkhttps(\'softproto\', \'softdomain\', false)">';
        foreach ($softpanel->domainroots as $domain => $dompath) {
            echo '<option value="' . $domain . '" ' . (!empty($_POST['softdomain']) && $_POST['softdomain'] == $domain ? 'selected="selected"' : '') . '>' . $domain . '</option>';
        }
        echo '
									</select>
								</div>
							</div><br />
							
							<div class="row">
								<div class="col-sm-5">
									<label for="softdirectory" class="sai_head">' . $l['in_directory'] . '</label><br />
									<span class="sai_exp2">' . $l['in_directory_exp'] . '</span>
								</div>
								<div class="col-sm-7">
									<input type="text" name="softdirectory" id="softdirectory" class="form-control" size="30" value="' . POSTval('softdirectory', !empty($globals['no_prefill']) ? '' : $software['softname']) . '" />
								</div>
							</div><br />';
        // A data Directory ?
        if (!empty($datadir)) {
            echo '
								<div class="row">
									<div class="col-sm-5">
										<label for="datadir" class="sai_head">' . $l['datadir'] . '</label><br />
										<span class="sai_exp2">' . $l['datadir_exp'] . '</span>
									</div>
									<div class="col-sm-7">
										<input type="text" name="datadir" id="datadir" class="form-control" size="30" value="' . POSTval('datadir', $datadir) . '" />
									</div>
								</div><br />';
        }
        if (!empty($dbtype)) {
            $dbname = mysqldbname($software['softname']);
            if (method_exists($softpanel, 'mysqldbname')) {
                $dbname = $softpanel->mysqldbname();
            }
            echo '
								<div class="row">
									<div class="col-sm-5">
										<label for="softdb" class="sai_head">' . $l['database_name'] . '</label><br />
										<span class="sai_exp2">' . (aefer() ? $l['database_name_exp_aefer'] : $l['database_name_exp']) . '</span>
									</div>
									<div class="col-sm-7">
										<input type="text" name="softdb" id="softdb" class="form-control" size="30" value="' . POSTval('softdb', $dbname) . '" onblur="checkdbname(\'softdb\', false)" />
										<span id="softdberror" style="background: #FDB3B3; display:none; width:200px;"></span>
									</div>
								</div><br />';
            if (!empty($softpanel->no_db_create)) {
                // Database Username
                echo '
									<div class="row">
										<div class="col-sm-5">
											<label for="dbusername" class="sai_head">' . $l['dbusername'] . '</label><br />
											<span class="sai_exp2">' . $l['dbusername_exp'] . '</span>
										</div>
										<div class="col-sm-7">
											<input type="text" name="dbusername" id="dbusername" class="form-control" size="30" value="' . POSTval('dbusername', '') . '" />
										</div>
									</div><br />';
                // Database Password
                echo '
									<div class="row">
										<div class="col-sm-5">
											<label for="dbuserpass" class="sai_head">' . $l['dbuserpass'] . '</label><br />
											<span class="sai_exp2">' . $l['dbuserpass_exp'] . '</span>
										</div>
										<div class="col-sm-7">
											<input type="text" name="dbuserpass" id="dbuserpass" class="form-control" size="30" value="' . POSTval('dbuserpass', '') . '" />
										</div>
									</div><br />';
                //Database Host Name
                echo '
									<div class="row">
										<div class="col-sm-5">
											<label for="hostname" class="sai_head">' . $l['hostname'] . '</label><br />
											<span class="sai_exp2">' . $l['hostname_exp'] . '</span>
										</div>
										<div class="col-sm-7">
											<input type="text" name="hostname" id="hostname" class="form-control" size="30" value="' . POSTval('hostname', 'localhost') . '" />
										</div>
									</div><br />';
            }
        }
        if (!empty($cron)) {
            echo '
								<div class="row">
									<div class="col-sm-5">
										<span class="sai_head">' . $l['cron_job'] . '</span><br />
										<span class="sai_exp2">' . $l['cron_job_exp'] . '</span>
									</div>
									<div class="col-sm-7">
										<div class="row">
											<div class="col-sm-2">
												<span>' . $l['cron_min'] . '</span>	
												<input type="text" class="form-control" name="cron_min" id="cron_min" size="2" value="' . POSTval('cron_min', $cron['min']) . '" />
											</div>
											<div class="col-sm-2">
												<span>' . $l['cron_hour'] . '</span>
												<input type="text" class="form-control" name="cron_hour" id="cron_hour" size="2" value="' . POSTval('cron_hour', $cron['hour']) . '" />
											</div>
											<div class="col-sm-2">
												<span>' . $l['cron_day'] . '</span>
												<input type="text" class="form-control" name="cron_day" id="cron_day" size="2" value="' . POSTval('cron_day', $cron['day']) . '" />
											</div>
											<div class="col-sm-2">
												<span>' . $l['cron_month'] . '</span>
												<input type="text" class="form-control" name="cron_month" id="cron_month" size="2" value="' . POSTval('cron_month', $cron['month']) . '" />
											</div>
											<div class="col-sm-2">
												<span>' . $l['cron_weekday'] . '</span>
												<input type="text" class="form-control" name="cron_weekday" id="cron_weekday" size="2" value="' . POSTval('cron_weekday', $cron['weekday']) . '" />
											</div>
										</div>
									</div>
								</div><br />';
        }
        if (!empty($overwrite_option)) {
            echo '
								<div class="row">
									<div class="col-sm-5">
										<label class="sai_head">' . $l['overwrite'] . '</label>
									</div>
									<div class="col-sm-7">
										<input type="checkbox" name="overwrite_existing" id="overwrite_existing" />
									</div>
								</div><br />';
        }
        echo '
							<br />
						</div>';
        // The Clone details form
        echo '
						<div class="bg info_block">
						
							<div class="sai_sub_head">' . $l['info'] . '</div><hr style="border-color: #D1D2D3;">
								
							<div class="row">
								<div class="col-sm-5 col-xs-5">
									<span class="sai_head">' . $l['ins_softname'] . '</span>
								</div>
								<div class="col-sm-6 col-xs-6">
									<span class="sai_info">' . $software['name'] . '</span>
								</div>
							</div><br />
							
							<div class="row">
								<div class="col-sm-5 col-xs-5">
									<span class="sai_head">' . $l['ins_num'] . '</span>
								</div>
								<div class="col-sm-6 col-xs-6">
									<span class="sai_info">' . $user['ins'][$insid]['insid'] . '</span>
								</div>
							</div><br />
							
							<div class="row">
								<div class="col-sm-5 col-xs-5">
									<span class="sai_head">' . $l['ins_ver'] . '</span>
								</div>
								<div class="col-sm-6 col-xs-6">
									<span class="sai_info">' . $user['ins'][$insid]['ver'] . '</span>
								</div>
							</div><br />
								
							<div class="row">
								<div class="col-sm-5 col-xs-5">
									<span class="sai_head">' . $l['ins_time'] . '</span>
								</div>
								<div class="col-sm-6 col-xs-6">
									<span class="sai_info">' . datify($user['ins'][$insid]['itime']) . '</span>
								</div>
							</div><br />
								
							<div class="row">
								<div class="col-sm-5 col-xs-5">
									<span class="sai_head">' . $l['ins_path'] . '</span>
								</div>
								<div class="col-sm-6 col-xs-6">
									<span class="sai_info">' . $user['ins'][$insid]['softpath'] . '</span>
								</div>
							</div><br />
								
							<div class="row">
								<div class="col-sm-5 col-xs-5">
									<span class="sai_head">' . $l['ins_url'] . '</span>
								</div>
								<div class="col-sm-6 col-xs-6">
									<span class="sai_info"><a href="' . $user['ins'][$insid]['softurl'] . '" target="_blank">' . $user['ins'][$insid]['softurl'] . '</a></span>
								</div>
							</div><br />';
        if (!empty($user['ins'][$insid]['admin_folder']) || !empty($scripts[$soft]['admin_url'])) {
            $adminurl = $user['ins'][$insid]['softurl'] . '/' . (!empty($user['ins'][$insid]['admin_folder']) ? $user['ins'][$insid]['admin_folder'] : $scripts[$soft]['admin_url']);
            echo '
								<div class="row">
									<div class="col-sm-5 col-xs-5">
										<span class="sai_head">' . $l['ins_admin_url'] . '</span>
									</div>
									<div class="col-sm-6 col-xs-6">
										<span class="sai_info"><a href="' . $adminurl . '" target="_blank">' . $adminurl . '</a></span>
									</div>	
								</div><br />';
        }
        echo '
						
							' . (empty($user['ins'][$insid]['wwwdir']) ? '' : '
								<div class="row">
									<div class="col-sm-5 col-xs-5">
										<span class="sai_head">' . $l['ins_wwwdir'] . '</span>
									</div>
									<div class="col-sm-6 col-xs-6">
										<span class="sai_info">' . $user['ins'][$insid]['wwwdir'] . '</span>
									</div>
								</div><br />
							') . '
								
							' . (empty($user['ins'][$insid]['wwwurl']) ? '' : '
								<div class="row">
									<div class="col-sm-5 col-xs-5">
										<span class="sai_head">' . $l['ins_wwwurl'] . '</span>
									</div>
									<div class="col-sm-6 col-xs-6">
										<span class="sai_info">' . $user['ins'][$insid]['wwwurl'] . '</span>
									</div>
								</div><br />
							') . '
								
								
							' . (empty($user['ins'][$insid]['softdatadir']) ? '' : '
								<div class="row">
									<div class="col-sm-5 col-xs-5">
										<span class="sai_head">' . $l['ins_datadir'] . '</span>
									</div>
									<div class="col-sm-6 col-xs-6">
										<span class="sai_info">' . $user['ins'][$insid]['softdatadir'] . '</span>
									</div>
								</div><br />
							') . '	
								
							' . (empty($user['ins'][$insid]['softdb']) ? '' : '
								<div class="row">
									<div class="col-sm-5 col-xs-5">
										<span class="sai_head">' . $l['ins_db'] . '</span>
									</div>
									<div class="col-sm-6 col-xs-6">
										<span class="sai_info">' . $user['ins'][$insid]['softdb'] . '</span>
									</div>
								</div><br />
							') . '	
								
							' . (empty($user['ins'][$insid]['softdbuser']) ? '' : '
								<div class="row">
									<div class="col-sm-5 col-xs-5">
										<span class="sai_head">' . $l['ins_dbuser'] . '</span>
									</div>
									<div class="col-sm-6 col-xs-6">
										<span class="sai_info">' . $user['ins'][$insid]['softdbuser'] . '</span>
									</div>		
								</div><br />
							') . '	
								
							' . (empty($user['ins'][$insid]['softdbhost']) ? '' : '
								<div class="row">
									<div class="col-sm-5 col-xs-5">
										<span class="sai_head">' . $l['ins_dbhost'] . '</span>
									</div>
									<div class="col-sm-6 col-xs-6">
										<span class="sai_info">' . $user['ins'][$insid]['softdbhost'] . '</span>
									</div>		
								</div><br />
							') . '	
								
							' . (empty($user['ins'][$insid]['cron_command']) ? '' : '
								<div class="row">
									<div class="col-sm-5 col-xs-5">
										<span class="sai_head">' . $l['ins_cron_command'] . '</span>
									</div>
									<div class="col-sm-6 col-xs-6">
										<span class="sai_info">' . base64_decode($user['ins'][$insid]['cron_command']) . '</span>
									</div>			
								</div><br />
							') . '
								
						</div><br /><br /><!--end of bg class-->
								
						<p align="center">
							<input type="hidden" name="softsubmit" id="softsubmit" value="' . $l['softsubmit'] . '" />
							<input type="hidden" name="cloneins" id="cloneins" value="' . $l['cloneins'] . '" />
							<input type="submit" name="softsubmitbut" class="flat-butt" id="softsubmitbut" value="' . $l['cloneins'] . '" /><span id="show_txt" style="display:none;"></span>
						</p><br /><br />
					
						<input type="hidden" name="soft_status_key" id="soft_status_key" value="' . POSTval('soft_status_key', generateRandStr(32)) . '" />
						
						<center><b><a href="' . script_link($soft) . '" class="sai_head">' . $l['return'] . '</a></b></center><br /><br />';
        echo '
					</div><!--end of bg class-->
				</form>
			</div>
		
			<div id="progress_bar" style="display: none; width: 100%;">
				<br />
				<div class="bg">
					<center>
						<div class="row sai_main_head" style="width:100%;" align="center">
							<div class="col-sm-5 col-xs-5" style="padding:0 10px 0 0; text-align:right;">
								<i class="fa sai-copy fa-2x" style="color:#00A0D2;"></i>
							</div>
							<div class="col-sm-7 col-xs-7" style="padding-top:10px; padding-left:0; text-align:left;">' . $l['prog_cloning'] . $software['name'] . '</div>
						</div>
						<br />
						<font size="4" color="#222222" id="progress_txt" style="width: 100%;">' . $l['checking_data'] . '</font>
						<font style="font-size: 18px;font-weight: 400;color: #444444; width: 100%;" id="progress_percent">(0 %)</font><br /><br />
					</center>
					<table width="500" cellpadding="0" cellspacing="0" id="table_progress" border="0" align="center" height="28" style="border:1px solid #CCC; -moz-border-radius: 5px;
					-webkit-border-radius: 5px; border-radius: 5px;background-color:#efefef; width: 50%;">
						<tr>
							<td id="progress_color" width="1" style="background-image: url(' . $theme['images'] . 'bar.gif); -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px;"></td>
							<td id="progress_nocolor">&nbsp;</td>
						</tr>
					</table>
					<br />
					<center>' . $l['wait_note'] . '</center><br /><br />
				</div><!--end of bg class--><br /><br />
			</div><br /><br /><br /><br />';
        echo '
		</div><br /><br />';
    }
    softfooter();
}
Пример #15
0
function backups_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error, $scripts;
    global $backups, $deleted, $tmpbackup_info;
    softheader($l['<title>']);
    echo '<div class="bg">
<br />
<div class="row sai_main_head" style="width:100%;" align="center">
	<div class="col-sm-5 col-xs-5" style="padding:0 10px 0 0; text-align:right;">
		<i class="fa sai-backup fa-2x" style="color:#00A0D2;"></i>
	</div>
	<div class="col-sm-7 col-xs-7" style="padding-top:10px; padding-left:0; text-align:left;">' . $l['backups_head'] . '</div>
</div>
<hr>';
    error_handle($error, '100%');
    if (!empty($deleted)) {
        echo '<div class="alert alert-warning"><center><a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>' . $l['backup_deleted'] . '</center></div>';
    }
    if (!empty($globals['backups_expire'])) {
        echo '<center class="alert alert-warning"><a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>' . lang_vars($l['backups_expire'], array($globals['backups_expire'])) . '</center>';
    }
    echo '<div id="stooltip" style="display:none; position:absolute; top: 0px; left: 0px; border: 1px solid #CCC; padding: 8px; background: #FFF; z-index:1000;"></div>
<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
function _confirm(){
	var conf = confirm("' . $l['confirm_del'] . '");
	if(conf){
		return true;
	}else{
		return false;
	}
};

// ]]></script>
<div class="bg2">
	<table border="0" cellpadding="0" cellspacing="0" width="100%" class="table table-hover">
	<tr>
		<thead class="sai_head2" style="background:#333; color:#fff;">
			<th width="33%"><b>' . $l['bac_time'] . '</b></th>
			<th width="32%"><b>' . $l['file'] . '</b></th>
			<th width="6%"><b>' . $l['size'] . '</b></th>' . (!empty($tmpbackup_info['ver']) ? '<th width="8%" align="left"><b>' . $l['version'] . '</b></th>' : '') . '
			<th width="7%"><b>' . $l['note'] . '</b></th>
			<th width="10%"><b>' . $l['options'] . '</b></th>
			<th width="4%"><input type="checkbox" id="check_all_backups" onchange="multiple_check()"></th>
		</thead>
	</tr>
	</table>';
    if (count($backups) > 0) {
        foreach ($backups as $sid => $backs) {
            echo '<link href="' . $globals['mirror_images'] . 'sprites/20.css" rel="stylesheet" type="text/css" />
			<table border="0" cellpadding="5" cellspacing="0" width="100%" class="table">
				<tr>
					<td class="sai_heading_full" style="background:#EFEFEF;">
						<table border="0" cellpadding="0" cellspacing="0">
							<tr>
								<td class="sp20_' . $iscripts[$sid]['softname'] . '"></td>
								<td>&nbsp;' . (empty($iscripts[$sid]) ? $l['no_info'] : '<a href="' . script_link($sid, 1) . '" style="text-decoration:none;">' . $iscripts[$sid]['name'] . '</a>') . '</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td>
					<table border="0" cellpadding="5" cellspacing="0" width="100%" id="abody" class="table table-hover borderless">';
            $j = 1;
            foreach ($backs as $bk => $bv) {
                $i = 1;
                foreach ($bv as $ik => $iv) {
                    echo '<tr><td width="30%">';
                    if ($i == 1) {
                        if (empty($user['ins'][$bk]['softurl'])) {
                            echo lang_vars($l['installation_removed'], array($iv['softurl']));
                        } else {
                            echo '<a href="' . $user['ins'][$bk]['softurl'] . '" target="_blank">' . $user['ins'][$bk]['softurl'] . '</a>';
                        }
                    } else {
                        echo '&nbsp;';
                    }
                    echo '</td>';
                    if (!aefer()) {
                        echo '<td width="30%"><a href="' . $globals['ind'] . 'act=backups&download=' . rawurlencode($iv['name']) . '" title="' . $l['download'] . '">' . $iv['name'] . '</a></td>';
                    } else {
                        echo '<td width="30%">' . $iv['name'] . '</td>';
                    }
                    echo '</td>
							<td width="7%">' . number_format($iv['size'] / 1024 / 1024, 2) . ' ' . $l['size_mb'] . '</td>' . (!empty($tmpbackup_info['ver']) ? '<td width="8%">' . $iv['ver'] . '</td>' : '') . (!empty($iv['backup_note']) ? '<td width="5%"><img src="' . $theme['images'] . 'note15.png" onmouseover="showtip(\'' . $iv['backup_note'] . '\', this);" style="cursor:pointer;"/></td>' : '<td width="4%">&nbsp</td>') . '
							<td width="4%">';
                    if (!aefer()) {
                        echo '<a href="' . $globals['ind'] . 'act=backups&download=' . rawurlencode($iv['name']) . '" title="' . $l['download'] . '"><img src="' . $theme['images'] . 'download.gif" /></a>';
                    }
                    echo '</td>
							<td width="4%">
								<a href="' . $globals['ind'] . 'act=restore&restore=' . rawurlencode($iv['name']) . '" title="' . $l['restore'] . '"><img src="' . $theme['images'] . 'restore.gif" /></a>
							</td>
							<td width="4%">
								<a href="' . $globals['ind'] . 'act=backups&remove=' . rawurlencode($iv['name']) . '" title="' . $l['remove'] . '" onclick="return _confirm();"><img src="' . $theme['images'] . 'remove.gif" /></a>
							</td>
							<td width="3%">
								<input type="checkbox" name="insids[]" id="' . $iv['softurl'] . '" value="' . $iv['name'] . '" class="check_all_backups">
							</td>
							</tr>';
                    $i++;
                }
                $j++;
            }
            echo '</table>
				</td></tr>
			</table><br />';
        }
    } else {
        echo '<br /><br /><center><table><tr>
			<td colspan="4" align="center">
				' . $l['no_ins'] . '
			</td>
			</tr></table><center>';
    }
    echo '<br />
		<p align="right">
			' . $l['with_selected'] . ': 
			<select name="multi_options" id="multi_options">
				<option name="todo" id="todo" value="0">---</option>
				<option name="todo" id="todo" value="mult_rem">' . $l['remove'] . '</option>
			</select>
			<input type="button" value="' . $l['go'] . '" onclick="show_confirm()" class="sai_graybluebut">
			<br />
		</p>
		<div id="rem_div"></div>
</div><!--end of bg class-->
</div>
<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
insids = new Array();
removed = new Object();

function show_confirm(){
	
	insids = new Array();
	removed = new Object();
	
	if($_("multi_options").value != "mult_rem"){
		return false;
	}

	// Build the list of Installations to remove
	var field = document.getElementsByName(\'insids[]\');
		insids = new Array();
		var c = 0;
		for(i = 0; i < field.length; i++){
			if(field[i].checked == true){
				insids[c] = field[i].value;
				c++;
			}
		
	}
	//alert(insids);
	
	if(c == 0){
		alert("' . $l['no_sel_inst'] . '");
		return false;
	}
	
	var r = confirm("' . $l['del_insid'] . '");
	if(r != true){
		return false;
	}

	remove_by_id(insids[0], "", 0);
}

function remove_by_id(insid, re, oldinsid){

	removed[insid] = false;
	
	if(re.length > 0 && oldinsid > 0){
		if(re == "removed"){
			removed[insid] = true;
		}
	}
	
	nextinsid = 0;
	
	// Find the next INSTALLATION to remove
	for(i = 0; i < insids.length; i++){
		if(typeof(removed[insids[i]]) != "undefined"){
			continue;
		}
		nextinsid = insids[i];
		break;
	}

	// If there is something left to be removed
	if(insid != 0){
		try{	
			AJAX("' . $globals['index'] . 'act=backups&remove="+insid+"&ajax=1&random="+Math.random(), "remove_by_id(\'"+nextinsid+"\', re, \'"+insid+"\')");
			$_("rem_div").innerHTML = "<br /><br /><p align=\\"center\\"><img src=\\"' . $theme['images'] . 'ajax_remove.gif\\"> <br />' . $l['rem_backup_id'] . ' File: " +insid+ "<br /></p>";
			return true;
		}catch(e){
			return false;
		}
	}
	$_("rem_div").innerHTML = "";
	alert("' . $l['inst_remvd'] . '");
	location.reload(true);
	return true;
}

function multiple_check(){
	$("#check_all_backups").on("click", function(event){
		if(this.checked == true){
			$(".check_all_backups").prop("checked", true);
		}else{
			$(".check_all_backups").prop("checked", false);
		}
	});
}

$(document).ready(function(){
	multiple_check();
	
	$(".sai_altrowstable tr").mouseover(function(){
		var old_class = $(this).attr("class");
		//alert(old_class);
		$(this).attr("class", "sai_tr_bgcolor");
		
		$(this).mouseout(function(){
			$(this).attr("class", old_class);
		});
	});
	
});

// ]]></script>';
    softfooter();
}
Пример #16
-1
function editdetail_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error, $edit, $settings;
    global $insid, $edited, $software, $soft, $scripts, $version_updated, $account_details_editable, $no_autoupgrade, $add_to_fileindex, $__settings, $default_fileindex;
    softheader($l['<title>']);
    echo '
	<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
	
	// show/hide backup options
	function show_backup(){
		try{
			if(auto_backup.value == 0){
				$("#auto_backup_rotation").prop("disabled", true);
			}else{
				$("#auto_backup_rotation").prop("disabled", false);
			}
			
		}catch(e){
			//
		}
		return true;
	};
	
	function toggle_advoptions(ele){
		//alert("#"+ele);
		
		if ($("#"+ele).is(":hidden")){
			$("#"+ele).slideDown("slow");
			$("#advoptions_toggle_plus").attr("src", "' . $theme['images'] . 'minus_new.gif");
		}
		else{
			$("#"+ele).slideUp("slow");
			$("#advoptions_toggle_plus").attr("src", "' . $theme['images'] . 'plus_new.gif");
		}
	}
	
	function plus_onmouseover(ele){
		$("#"+ele.id+"_plus").attr("src", "' . $theme['images'] . 'plus_hover.gif");
	}
	
	function plus_onmouseout(ele){
		$("#"+ele.id+"_plus").attr("src", "' . $theme['images'] . 'plus.gif");
	}
	
	$(document).ready(function() {
		$("#editfiles tr").click(function(event) {
			if (event.target.type !== "checkbox") {
			  $(":checkbox", this).trigger("click");
			}
		});
	});
	
	' . (!empty($_POST) ? '' : 'addonload(\'show_backup();\');') . '
	
	// ]]></script>';
    $width_size = 65;
    if (!empty($softpanel->leftpanel_resize)) {
        $width_size = 40;
    }
    if (!empty($edited)) {
        echo '
		<div class="bg"><br />
			<div class="alert alert-warning"><center>' . $l['details_edited'] . '</center></div><br /><br />
			<center><b><a href="' . script_link($soft) . '&highlight=' . $insid . '&postact=edit" class="sai_head">' . $l['return'] . '</a></b></center><br />
		</div><!--end of bg-->';
    } else {
        echo '
		<form accept-charset="' . $globals['charset'] . '" name="editsettings" method="post" action="" class="form-horizontal">
			<div class="bg"><br />			
				<div class="row sai_main_head" style="width:100%;" align="center">
					<div class="col-sm-5 col-xs-4" style="padding:0 10px 0 0; text-align:right;">
						<i class="fa sai-projectman fa-2x" style="color:#00A0D2;"></i>
					</div>
					<div class="col-sm-7 col-xs-8" style="padding-top:10px; padding-left:0; text-align:left;">' . $l['edit_ins'] . '</div>
				</div><br />';
        error_handle($error, '100%');
        if (!empty($version_updated)) {
            echo '<div class="alert alert-warning" align="center"><a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>' . $l['version_edited'] . '</div>';
        }
        echo !empty($GLOBALS['alreadyupdated']) ? '
					<form accept-charset="' . $globals['charset'] . '" method="post" name="uprec" id="uprec" action="">
					<br />
						<center class="alert alert-warning">
							<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
							<a href="' . $globals['index'] . 'act=editdetail&insid=' . $insid . '&updateversion=1" style="text-decoration:none;"><img src="' . $theme['images'] . 'notice.gif" /> &nbsp; ' . lang_vars($l['alreadyupdated'], array($GLOBALS['alreadyupdated'], $user['ins'][$insid]['ver'])) . '</a>
						</center>
					</form>' : '';
        echo '
				<div style="padding: 0 25px;">
					<div class="sai_sub_head">' . $l['ins_details'] . '</div><hr>';
        if (empty($globals['hide_directory_url'])) {
            echo '
						<div class="row">
							<div class="col-sm-5">
								<label for="edit_dir" class="sai_head">' . $l['edit_dir'] . '</label><br />
							</div>	
							<div class="col-sm-7">
								<input type="text" name="edit_dir" id="edit_dir" class="form-control" value="' . POSTval('edit_dir', $user['ins'][$insid]['softpath']) . '" size="' . $width_size . '" />
							</div>	
						</div><br />
						
						<div class="row">
							<div class="col-sm-5">
								<label for="edit_url" class="sai_head">' . $l['edit_url'] . '</label><br />
							</div>	
							<div class="col-sm-7">	
								<input type="text" name="edit_url" id="edit_url" class="form-control" value="' . POSTval('edit_url', $user['ins'][$insid]['softurl']) . '" size="' . $width_size . '" />
							</div>	
						</div><br />
					';
        }
        // Web directory @since 3.5
        if (!empty($user['ins'][$insid]['wwwdir'])) {
            echo '
						<div class="row">
							<div class="col-sm-5">
								<label for="edit_wwwdir" class="sai_head">' . $l['edit_wwwdir'] . '</label><br />
							</div>
							<div class="col-sm-7"> 
								<input type="text" name="edit_wwwdir" id="edit_wwwdir" class="form-control" value="' . POSTval('edit_wwwdir', $user['ins'][$insid]['wwwdir']) . '" size="' . $width_size . '" />
							</div>	
						</div><br />
					';
        }
        // Web directory URL @since 3.5
        if (!empty($user['ins'][$insid]['wwwurl'])) {
            echo '
						<div class="row">
							<div class="col-sm-5">
								<label for="edit_wwwurl" class="sai_head">' . $l['edit_wwwurl'] . '</label><br />
							</div>
							<div class="col-sm-7">
								<input type="text" name="edit_wwwurl" id="edit_wwwurl" class="form-control" value="' . POSTval('edit_wwwurl', $user['ins'][$insid]['wwwurl']) . '" size="' . $width_size . '" />
							</div>	
						</div><br />
					';
        }
        // Data directory ?
        if (!empty($user['ins'][$insid]['softdatadir'])) {
            echo '
						<div class="row">
							<div class="col-sm-5">
								<label for="edit_datadir" class="sai_head">' . $l['edit_datadir'] . '</label><br />
							</div>
							<div class="col-sm-7">
								<input type="text" name="edit_datadir" id="edit_datadir" class="form-control" value="' . POSTval('edit_datadir', $user['ins'][$insid]['softdatadir']) . '" size="' . $width_size . '" />
							</div>	
						</div><br />
					';
        }
        if (!empty($user['ins'][$insid]['softdb'])) {
            echo '
						<div class="row">
							<div class="col-sm-5">
								<label for="edit_db" class="sai_head">' . $l['edit_db'] . '</label><br />
							</div>
							<div class="col-sm-7">
								<input type="text" name="edit_dbname" id="edit_db" class="form-control" value="' . POSTval('edit_dbname', $user['ins'][$insid]['softdb']) . '" size="' . $width_size . '" />
							</div>					
						</div><br />
					';
        }
        if (!empty($user['ins'][$insid]['softdbuser'])) {
            echo '
						<div class="row">
							<div class="col-sm-5">
								<label for="edit_dbuser" class="sai_head">' . $l['edit_dbuser'] . '</label><br />
							</div>
							<div class="col-sm-7">
								<input type="text" name="edit_dbuser" id="edit_dbuser" class="form-control" value="' . POSTval('edit_dbuser', $user['ins'][$insid]['softdbuser']) . '" size="' . $width_size . '" />
							</div>
						</div><br />
					';
        }
        if (!empty($user['ins'][$insid]['display_softdbpass'])) {
            echo '
						<div class="row">
							<div class="col-sm-5">
								<label for="edit_dbpass" class="sai_head">' . $l['edit_dbpass'] . '</label><br />
							</div>
							<div class="col-sm-7">
								<input type="text" name="edit_dbpass" id="edit_dbpass" class="form-control" value="' . aPOSTval('edit_dbpass', $user['ins'][$insid]['display_softdbpass']) . '" size="' . $width_size . '" />
							</div>						
						</div><br />
					';
        }
        if (!empty($user['ins'][$insid]['softdbhost'])) {
            echo '
						<div class="row">
							<div class="col-sm-5">
								<label for="edit_dbhost" class="sai_head">' . $l['edit_dbhost'] . '</label><br />
							</div>
							<div class="col-sm-7">
								<input type="text" name="edit_dbhost" class="form-control" id="edit_dbhost" value="' . aPOSTval('edit_dbhost', $user['ins'][$insid]['softdbhost']) . '" size="' . $width_size . '" />
							</div>	
						</div><br />
					';
        }
        echo '
					<div class="row">
						<div class="col-sm-5">
							<label for="disable_notify_update" class="sai_head">' . $l['disable_notify_update'] . '</label><br />
							<span class="sai_exp">' . $l['exp_disable_notify_update'] . '</span>
						</div>
						<div class="col-xs-6">
							<input type="checkbox" name="disable_notify_update" id="disable_notify_update" ' . POSTchecked('disable_notify_update', $user['ins'][$insid]['disable_notify_update']) . ' />
						</div>	
					</div><br />';
        if (!empty($scripts[$soft]['auto_upgrade']) && empty($no_autoupgrade)) {
            echo '
						<div class="row">
							<div class="col-sm-5">
								<label for="eu_auto_upgrade" class="sai_head">' . $l['eu_auto_upgrade'] . '</label><br />
								<span class="sai_exp">' . $l['exp_eu_auto_upgrade'] . '</span>
							</div>
							<div class="col-sm-7">
								<input type="checkbox"  name="eu_auto_upgrade" id="eu_auto_upgrade" ' . POSTchecked('eu_auto_upgrade', $user['ins'][$insid]['eu_auto_upgrade']) . ' />
							</div>
						</div><br />
					';
        }
        if (empty($globals['off_upgrade_plugins']) && !empty($software['update_plugins'])) {
            echo '
						<div class="row">
							<div class="col-sm-5">
								<label for="auto_upgrade_plugins" class="sai_head">' . lang_vars($l['auto_upgrade_plugins'], array($software['name'])) . '</label><br />
								<span class="sai_exp">' . lang_vars($l['exp_auto_upgrade_plugins'], array($software['name'])) . '</span>	
							</div>
							<div class="col-sm-7">
								<input type="checkbox" name="auto_upgrade_plugins" id="auto_upgrade_plugins" id="auto_upgrade_plugins" ' . POSTchecked('auto_upgrade_plugins', $user['ins'][$insid]['auto_upgrade_plugins']) . ' />
							</div>	
						</div><br />
					';
        }
        if (empty($globals['off_upgrade_themes']) && !empty($software['update_themes'])) {
            echo '
						<div class="row">
							<div class="col-sm-5">
								<label for="auto_upgrade_themes" class="sai_head">' . lang_vars($l['auto_upgrade_themes'], array($software['name'])) . '</label><br />
								<span class="sai_exp">' . lang_vars($l['exp_auto_upgrade_themes'], array($software['name'])) . '</span>
							</div>
							<div class="col-sm-7">
								<input type="checkbox" name="auto_upgrade_themes" id="auto_upgrade_themes" ' . POSTchecked('auto_upgrade_themes', $user['ins'][$insid]['auto_upgrade_themes']) . ' />	
							</div>	
						</div><br />
					';
        }
        if (empty($globals['disable_backup_restore']) && empty($globals['disable_auto_backup']) && !aefer()) {
            echo '
						<div class="row">
							<div class="col-sm-5">
								<label for="auto_backup" class="sai_head">' . $l['auto_backup'] . '</label><br />
								<span class="sai_exp">' . $l['exp_auto_backup'] . '</span>	
							</div>
							<div class="col-sm-7">
								<select name="auto_backup" class="form-control" id="auto_backup" onchange="show_backup();">
								<option value="0" ' . POSTselect('auto_backup', '0', empty($user['ins'][$insid]['auto_backup']) ? '1' : '0') . '>' . $l['no_backup'] . '</option>' . (empty($globals['disable_auto_backup_daily']) ? '<option value="daily" ' . POSTselect('auto_backup', 'daily', $user['ins'][$insid]['auto_backup'] == 'daily' ? '1' : '0') . '>' . $l['daily'] . '</option>' : '') . (empty($globals['disable_auto_backup_weekly']) ? '<option value="weekly" ' . POSTselect('auto_backup', 'weekly', $user['ins'][$insid]['auto_backup'] == 'weekly' ? '1' : '0') . '>' . $l['weekly'] . '</option>' : '') . (empty($globals['disable_auto_backup_monthly']) ? '<option value="monthly" ' . POSTselect('auto_backup', 'monthly', $user['ins'][$insid]['auto_backup'] == 'monthly' ? '1' : '0') . '>' . $l['monthly'] . '</option>' : '') . '					
								</select>					
							</div>
						</div><br />
					';
        }
        echo '
					<div class="row">
						<div class="col-sm-5">
							<label for="auto_backup_rotation" class="sai_head">' . $l['auto_backup_rotation'] . '</label><br />
							<span class="sai_exp">' . $l['exp_auto_backup_rotation'] . '</span>
						</div>
						<div class="col-sm-7">
							<select name="auto_backup_rotation" class="form-control" id="auto_backup_rotation">';
        for ($i = 0; $i <= 10; $i++) {
            // Do we have a limit from admin ?
            if (!empty($globals['auto_backup_limit']) && ($i > $globals['auto_backup_limit'] || $i == 0) || !empty($globals['max_backups']) && ($i > $globals['max_backups'] || $i == 0)) {
                continue;
            }
            echo '<option value="' . $i . '" ' . POSTselect('auto_backup_rotation', $i, !empty($user['ins'][$insid]['auto_backup_rotation']) && $user['ins'][$insid]['auto_backup_rotation'] == $i ? '1' : empty($user['ins'][$insid]['auto_backup_rotation']) && $i == 4 ? '1' : '0') . '>' . (empty($i) ? $l['unlimited'] : $i) . '</option>';
        }
        echo '</select>		
						</div>			
					</div><br />';
        if (!empty($add_to_fileindex)) {
            echo '
						<div class="row">
							<div class="col-sm-5">
								<label for="advoptions_toggle" class="sai_head">' . $l['select_files'] . '</label><br />
								<span class="sai_exp">' . $l['select_files_exp'] . '</span><br />
							</div>
							<div class="col-sm-7">
								<div id="advoptions_toggle" onclick="toggle_advoptions(\'selectfile\');" class="sai_head" style="background: none; cursor:pointer;"><img id="advoptions_toggle_plus" src="' . $theme['images'] . 'plus_new.gif" /> &nbsp; ' . $l['select_files_list'] . '</div>
								<div id="selectfile" style="display:none">
									<table class="table table-hover">
										<thead style="background:#EFEFEF;" class="sai_head2">
											<tr>
												<th width="5%"><input type="checkbox" id="check_all_edit" name="check_all_edit"></th>
												<th colspan="2"><b>' . $l['check_all_edit'] . '</b></th>
											</tr>
										</thead>';
            foreach ($add_to_fileindex as $ck => $cv) {
                if (in_array($cv['name'], $default_fileindex)) {
                    continue;
                }
                echo '<tr>
													<td><input type="checkbox" name="add_to_fileindex[]" class="soft_filelist" value="' . $cv['name'] . '" ' . POSTmulticheck('add_to_fileindex', $cv['name'], $__settings['fileindex']) . ' /></td>
													<td width="5%"><img src="' . $theme['images'] . '' . (!empty($cv['dir']) ? 'dir.png' : 'file.png') . '"></td>
													<td>' . $cv['name'] . '</td>
												</tr>';
                $i++;
            }
            echo '
									</table>
								</div>		
							</div>	
						</div><br />	
						
						<div class="row">
							<div class="col-sm-5">
								<label for="select_files_backup" class="sai_head">' . $l['select_files_backup'] . '</label><br />
								<span class="sai_exp">' . $l['select_files_backup_exp'] . '</span>
							</div>
							<div class="col-sm-7">
								<select name="select_files_backup" class="form-control" id="select_files_backup">
									<option value="0" ' . POSTselect('select_files_backup', '0', empty($user['ins'][$insid]['select_files_backup']) ? '1' : '0') . '>' . $l['no'] . '</option>
									<option value="1" ' . POSTselect('select_files_backup', '1', !empty($user['ins'][$insid]['select_files_backup']) ? '1' : '0') . '>' . $l['yes'] . '</option>
								</select>				
							</div>			
						</div>
						<br />';
        }
        echo '
				</div>';
        if (!empty($settings)) {
            echo '
					<div class="bg">';
            foreach ($settings as $group => $sets) {
                if ($group == 'hidden' || empty($sets)) {
                    continue;
                }
                echo '
							<div class="sai_sub_head">' . $group . '</div><hr>';
                foreach ($sets as $sk => $sv) {
                    if ($sk == 'admin_pass') {
                        $exp_class = 'sai_exp2';
                    } else {
                        $exp_class = 'sai_exp';
                    }
                    echo '
								<div class="row">
									<div class="col-sm-5">
										<label for=' . $sk . ' class="sai_head">' . $sv['head'] . '</label>
										' . (empty($sv['exp']) ? '' : '<br /><span class="' . $exp_class . '">' . $sv['exp'] . '</span>') . '
									</div>';
                    //Adding class to input
                    if (preg_match('/type="text"/is', $sv['tag'])) {
                        $sv['tag'] = preg_replace('/>/is', 'class="form-control">', $sv['tag']);
                    }
                    echo '
									<div class="col-sm-7">' . $sv['tag'] . '</div>
								</div><br />';
                }
            }
            //The Hidden groups
            if (!empty($settings['hidden'])) {
                foreach ($settings['hidden'] as $sk => $sv) {
                    echo $sv['tag'];
                }
            }
            echo '
					</div><br /><!--end of bg clss-->';
        }
        //End of if($settings)
        echo '
				<div class="bg info_block">
				
					<div class="sai_sub_head">' . $l['info'] . '</div><hr style="border-color: #D1D2D3;">
				
					<div class="row">
						<div class="col-sm-5 col-xs-5">
							<span class="sai_head">' . $l['ins_softname'] . '</span>
						</div>
						<div class="col-sm-6 col-xs-6">
							<span class="sai_info">' . $software['name'] . '</span>
						</div>
					</div><br />
					
					<div class="row">
						<div class="col-sm-5 col-xs-5">
							<span class="sai_head">' . $l['ins_num'] . '</span>
						</div>
						<div class="col-sm-6 col-xs-6">
							<span class="sai_info">' . $user['ins'][$insid]['insid'] . '</span>
						</div>
					</div><br />
					
					<div class="row">
						<div class="col-sm-5 col-xs-5">
							<span class="sai_head">' . $l['ins_ver'] . '</span>
						</div>
						<div class="col-sm-6 col-xs-6">
							<span class="sai_info">' . $user['ins'][$insid]['ver'] . '</span>
						</div>
					</div><br />
					
					<div class="row">
						<div class="col-sm-5 col-xs-5">
							<span class="sai_head">' . $l['ins_time'] . '</span>
						</div>
						<div class="col-sm-6 col-xs-6">
							<span class="sai_info">' . datify($user['ins'][$insid]['itime']) . '</span>
						</div>
					</div><br />
			
					<div class="row">
						<div class="col-sm-5 col-xs-5">
							<span class="sai_head">' . $l['ins_path'] . '</span>
						</div>
						<div class="col-sm-6 col-xs-6">
							<span class="sai_info">' . $user['ins'][$insid]['softpath'] . '</span>
						</div>
					</div><br />
					
					<div class="row">
						<div class="col-sm-5 col-xs-5">
							<span class="sai_head">' . $l['ins_url'] . '</span>
						</div>
						<div class="col-sm-6 col-xs-6">
							<span class="sai_info"><a href="' . $user['ins'][$insid]['softurl'] . '" target="_blank">' . $user['ins'][$insid]['softurl'] . '</a></span>
						</div>
					</div><br />';
        if (!empty($user['ins'][$insid]['admin_folder']) || !empty($scripts[$soft]['admin_url'])) {
            $adminurl = $user['ins'][$insid]['softurl'] . '/' . (!empty($user['ins'][$insid]['admin_folder']) ? $user['ins'][$insid]['admin_folder'] : $scripts[$soft]['admin_url']);
            echo '
						<div class="row">
							<div class="col-sm-5 col-xs-5">
								<span class="sai_head">' . $l['ins_admin_url'] . '</span>
							</div>
							<div class="col-sm-6 col-xs-6">
								<span class="sai_info"><a href="' . $adminurl . '" target="_blank">' . $adminurl . '</a></span>
							</div>
						</div><br />';
        }
        echo '
					
					' . (empty($user['ins'][$insid]['wwwdir']) ? '' : '
						<div class="row">
							<div class="col-sm-5 col-xs-5">
								<span class="sai_head">' . $l['ins_wwwdir'] . '</span>
							</div>
							<div class="col-sm-6 col-xs-6">
								<span class="sai_info">' . $user['ins'][$insid]['wwwdir'] . '</span>
							</div>			
						</div><br />
					') . '
					
					' . (empty($user['ins'][$insid]['wwwurl']) ? '' : '
						<div class="row">
							<div class="col-sm-5 col-xs-5">
								<span class="sai_head">' . $l['ins_wwwurl'] . '</span>
							</div>
							<div class="col-sm-6 col-xs-6">
								<span class="sai_info">' . $user['ins'][$insid]['wwwurl'] . '</span>
							</div>		
						</div><br />
					') . '
					
					' . (empty($user['ins'][$insid]['softdatadir']) ? '' : '
						<div class="row">
							<div class="col-sm-5 col-xs-5">
								<span class="sai_head">' . $l['ins_datadir'] . '</span>
							</div>
							<div class="col-sm-6 col-xs-6">
								<span class="sai_info">' . $user['ins'][$insid]['softdatadir'] . '</span>
							</div>
						</div><br />
					') . '	
					
					' . (empty($user['ins'][$insid]['softdb']) ? '' : '
						<div class="row">
							<div class="col-sm-5 col-xs-5">
								<span class="sai_head">' . $l['ins_db'] . '</span>
							</div>
							<div class="col-sm-6 col-xs-6">
								<span class="sai_info">' . $user['ins'][$insid]['softdb'] . '</span>
							</div>
						</div><br />
					') . '	
					
					' . (empty($user['ins'][$insid]['softdbuser']) ? '' : '
						<div class="row">
							<div class="col-sm-5 col-xs-5">
								<span class="sai_head">' . $l['ins_dbuser'] . '</span>
							</div>
							<div class="col-sm-6 col-xs-6">
								<span class="sai_info">' . $user['ins'][$insid]['softdbuser'] . '</span>
							</div>
						</div><br />
					') . '	
					
					' . (empty($user['ins'][$insid]['softdbhost']) ? '' : '
						<div class="row">
							<div class="col-sm-5 col-xs-5">
								<span class="sai_head">' . $l['ins_dbhost'] . '</span>
							</div>
							<div class="col-sm-6 col-xs-6">
								<span class="sai_info">' . $user['ins'][$insid]['softdbhost'] . '</span>
							</div>
						</div><br />
					') . '	
					
					' . (empty($user['ins'][$insid]['cron_command']) ? '' : '
						<div class="row">
							<div class="col-sm-5 col-xs-5">
								<span class="sai_head">' . $l['ins_cron_command'] . '</span>
							</div>
							<div class="col-sm-6 col-xs-6">
								<span class="sai_info">' . base64_decode($user['ins'][$insid]['cron_command']) . '</span>
							</div>
						</div><br />
					
					') . '	
				</div><!--end of bg class-->
				
				<br /><br />
				<p align="center">
					<input type="hidden" name="editins" id="editins" value="' . $l['editins'] . '" />
					<input type="submit" name="softsubmitbut" class="flat-butt" id="softsubmitbut" value="' . $l['editins'] . '"  />
				</p><br /><br />
				<center><b><a href="' . script_link($soft) . '" class="sai_head">' . $l['return'] . '</a></b></center><br /><br />					
			</div><!--end of bg class-->
		</form><br /><br />
		
		<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
			$(document).ready(function(){
			
				$("#check_all_edit").on("click", function(event){
					if(this.checked == true){
						$(".soft_filelist").prop("checked", true);
					}else{
						$(".soft_filelist").prop("checked", false);
					}
				});
			
				$(".sai_altrowstable tr").mouseover(function(){
					var old_class = $(this).attr("class");
					//alert(old_class);
					$(this).attr("class", "sai_tr_bgcolor");
					
					$(this).mouseout(function(){
						$(this).attr("class", old_class);
					});
				});
				
			});
		// ]]></script>';
    }
    softfooter();
}