Пример #1
0
function webuzo_acl_theme()
{
    global $theme, $globals, $l, $error, $done, $softpanel;
    softheader($l['<title>']);
    echo '<div class="sai_heading" align="center">&nbsp;&nbsp;&nbsp;' . $l['heading_webuzo_acl'] . '</div>
<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" /><br /><br />';
    error_handle($error);
    if (!empty($done)) {
        echo '<br /><div class="sai_success"><img src="' . $theme['images'] . 'success.gif" /> ' . $l['change_final'] . '</div><br />';
    }
    echo '<form accept-charset="' . $globals['charset'] . '" action="" method="post" name="changepass" id="editform">
<table border="0" cellpadding="8" cellspacing="8" width="700px" align="center" class="sai_divroundshad"  style="padding-left:15px; padding-top:15px; ">
	<tr>
		<td width="70%">
			<span class="sai_head">' . $l['disable_system_apps'] . '</span><br />
			<span class="sai_exp2">' . $l['disable_system_apps_exp'] . '</span>
		</td>
		<td valign="top">
			<input type="checkbox" name="disable_syapps" ' . POSTchecked('disable_syapps', $softpanel->getconf('DISABLE_SYSAPPS')) . ' />
		</td>
	</tr>
	<tr>
		<td colspan="2">
			<span class="sai_exp2">' . $l['root_login_admin'] . '</span><br />
		</td>
	</tr>	
	<tr align="center">
		<td colspan="2">
			<input type="submit" style="cursor:pointer" value="' . $l['submit_button'] . '" name="savechanges" class="sai_graybluebut" />
		</td>
	</tr>	
</table>
</form><br /><br /><br />';
    softfooter();
}
Пример #2
0
function ssh_access_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error;
    global $installations, $langs, $saved;
    softheader($l['<title>']);
    error_handle($error, '100%');
    if (!empty($saved)) {
        echo '<div class="sai_success">' . $l['settings_saved'] . '</div>';
    }
    echo '<form accept-charset="' . $globals['charset'] . '" name="editsettings" method="post" action="">
<center class="sai_tit"><img src="' . $theme['a_images'] . 'ssh_login.gif" />&nbsp;' . $l['ssh_access'] . '</center>
<table border="0" cellpadding="8" cellspacing="8" width="700px" align="center" class="sai_divroundshad" style="padding-left:15px; padding-top:15px;" >
	<tr>
		<td>
			<span class="sai_head">' . $l['ssh_enable'] . '</font></span><br/><span class="sai_exp">' . $l['ssh_check'] . '</span>
		</td>
		<td>			
			<input type="checkbox" name="sshon" id="sshon" ' . POSTchecked('sshon', $softpanel->getssh()) . ' ">
		</td>
	</tr>
	<tr>
		<td colspan="2">
			<p align="center">			
				<input type="submit" class="sai_graybluebut" name="editsshsettings" value="' . $l['edit_settings'] . '" />
			</p>
		</td>
	</tr>	
</table>
</form>';
    softfooter();
}
Пример #3
0
function secure_theme()
{
    global $theme, $globals, $softpanel, $user, $l, $error, $updates_available, $done, $checked, $is_secured;
    softheader($l['<title>']);
    echo '<center class="sai_tit"><img src="' . $theme['a_images'] . 'secure.gif" />&nbsp; ' . $l['ampps_secure'] . '<br/></center>
<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" />';
    error_handle($error, '100%');
    if (!empty($done)) {
        echo '<div class="sai_success">' . (empty($is_secured) ? $l['ampps_unsecured'] : $l['ampps_secured']) . '</div>';
        echo '<br /><a href="' . $globals['ind'] . '">' . $l['lbl_home'] . '</a>';
    } else {
        echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
	function showpass(){
		if($_("secure").checked){		
			$_("pass_row").style.display = "";
			$_("conf_row").style.display = "";
		}else{
			$_("pass_row").style.display = "none";
			$_("conf_row").style.display = "none";
		}
	}
	addonload("showpass();");
	
	// ]]></script>
	<form action="" method="post">
	<table border="0" cellpadding="8" cellspacing="2">
	<tr>
		<td align="left"><span class="sai_head">' . $l['question'] . '</span><br/>';
        if ($is_secured == true) {
            echo '<span class="sai_exp">' . $l['is_secure'] . '<font color="green">Secured</font></span>';
        } else {
            echo '<span class="sai_exp">' . $l['is_secure'] . '<font color="red">Unsecured</font></span>';
        }
        echo '</td><td><input type="checkbox" name="secure" id="secure" ' . POSTchecked('secure', $is_secured) . ' onclick="showpass(this);"></td>
	</tr>
	<tr id="pass_row">
		<td align="right"><span class="sai_head">' . $l['set_pass'] . '</span><br/><span class="sai_exp">' . $l['set_notify'] . '</span></td>
		<td><input type="password" name="setpass" /></td>
	</tr>
	<tr id="conf_row">
		<td align="right" class="sai_head">' . $l['retype_pass'] . '</td>
		<td><input type="password" name="retypepass" /></td>
	</tr>
	<tr>
		<td colspan="2" align="center"><input type="submit" name="submit" value="Submit"/></td>
	</tr>';
        if ($done == 1) {
            echo '<tr>
		<td colspan="2" align="center">' . $l['pass_set'] . '</td>
		</tr>';
        }
        echo '</table>
	<p>' . $l['note'] . '</p>
	</form></body></html>';
    }
    softfooter();
}
Пример #4
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();
}
Пример #5
0
function settings_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error;
    global $installations, $langs, $saved;
    softheader($l['<title>']);
    echo '
<link rel="stylesheet" type="text/css" href="' . $theme['url'] . '/spectrum.css?' . $GLOBALS['globals']['version'] . '" />
<form accept-charset="' . $globals['charset'] . '" name="editsettings" method="post" action="" id="editsettings" class="form-horizontal">

<div class="bg"><br />
	<div class="row sai_main_head" style="width:100%;" align="center">
		<div class="col-sm-6 col-xs-6" style="padding:0px 10px 0 0; text-align:right;">
			<i class="fa sai-settings fa-2x" style="color:#00A0D2;"></i>
		</div>
		<div class="col-sm-6 col-xs-6" style="padding-top:5px; padding-left:0; text-align:left;">' . $l['settings'] . '</div>
	</div><hr>';
    error_handle($error, '100%');
    if (!empty($saved)) {
        echo '<div class="alert alert-success" style="padding:10px;font-size:15px;"><center><img src="' . $theme['images'] . 'message_success.gif">&nbsp;&nbsp;' . $l['settings_saved'] . '</div></center>';
    }
    echo '
	<div class="row">
		<div class="col-sm-5">
			<label  for="choose_lang" class="sai_head">' . $l['choose_lang'] . '</label>
			<span class="sai_exp">' . $l['exp_lang'] . '</span>
		</div>
		<div class="col-sm-7">
			<select name="language" id="choose_lang" class="form-control">';
    foreach ($langs as $k => $v) {
        echo '<option value="' . $v . '" ' . (empty($_POST['language']) && (empty($user['language']) ? $globals['language'] : $user['language']) == $v ? 'selected="selected"' : (trim($_POST['language']) == $v ? 'selected="selected"' : '')) . '>' . _ucfirst($v) . '</option>';
    }
    echo '</select>
		</div>
	</div><br /><!---row end--->

	<div class="row">
		<div class="col-sm-5">
			<label for="timezone" class="sai_head">' . $l['timezone'] . '</label>
		</div>
		<div class="col-sm-7">
			<select name="timezone" id="timezone" class="form-control">
				<option value="-12" ' . ($user['timezone'] == -12 ? 'selected="selected"' : '') . '>(GMT -12:00) Eniwetok, Kwajalein</option>
				<option value="-11" ' . ($user['timezone'] == -11 ? 'selected="selected"' : '') . '>(GMT -11:00) Midway Island, Samoa</option>
				<option value="-10" ' . ($user['timezone'] == -10 ? 'selected="selected"' : '') . '>(GMT -10:00) Hawaii</option>
				<option value="-9" ' . ($user['timezone'] == -9 ? 'selected="selected"' : '') . '>(GMT -9:00) Alaska</option>
				<option value="-8" ' . ($user['timezone'] == -8 ? 'selected="selected"' : '') . '>(GMT -8:00) Pacific Time (US &amp; Canada)</option>
				<option value="-7" ' . ($user['timezone'] == -7 ? 'selected="selected"' : '') . '>(GMT -7:00) Mountain Time (US &amp; Canada)</option>
				<option value="-6" ' . ($user['timezone'] == -6 ? 'selected="selected"' : '') . '>(GMT -6:00) Central Time (US &amp; Canada), Mexico City</option>
				<option value="-5" ' . ($user['timezone'] == -5 ? 'selected="selected"' : '') . '>(GMT -5:00) Eastern Time (US &amp; Canada), Bogota, Lima</option>
				<option value="-4" ' . ($user['timezone'] == -4 ? 'selected="selected"' : '') . '>(GMT -4:00) Atlantic Time (Canada), Caracas, La Paz</option>
				<option value="-3.5" ' . ($user['timezone'] == -3.5 ? 'selected="selected"' : '') . '>(GMT -3:30) Newfoundland</option>
				<option value="-3" ' . ($user['timezone'] == -3 ? 'selected="selected"' : '') . '>(GMT -3:00) Brazil, Buenos Aires, Georgetown</option>
				<option value="-2" ' . ($user['timezone'] == -2 ? 'selected="selected"' : '') . '>(GMT -2:00) Mid-Atlantic</option>
				<option value="-1" ' . ($user['timezone'] == -1 ? 'selected="selected"' : '') . '>(GMT -1:00 hour) Azores, Cape Verde Islands</option>
				<option value="+0" ' . ($user['timezone'] == '+0' ? 'selected="selected"' : '') . '>(GMT) Western Europe Time, London, Lisbon, Casablanca</option>
				<option value="1" ' . ($user['timezone'] == 1 ? 'selected="selected"' : '') . '>(GMT +1:00 hour) Brussels, Copenhagen, Madrid, Paris</option>
				<option value="2" ' . ($user['timezone'] == 2 ? 'selected="selected"' : '') . '>(GMT +2:00) Kaliningrad, South Africa</option>
				<option value="3" ' . ($user['timezone'] == 3 ? 'selected="selected"' : '') . '>(GMT +3:00) Baghdad, Riyadh, Moscow, St. Petersburg</option>
				<option value="3.5" ' . ($user['timezone'] == 3.5 ? 'selected="selected"' : '') . '>(GMT +3:30) Tehran</option>
				<option value="4" ' . ($user['timezone'] == 4 ? 'selected="selected"' : '') . '>(GMT +4:00) Abu Dhabi, Muscat, Baku, Tbilisi</option>
				<option value="4.5" ' . ($user['timezone'] == 4.5 ? 'selected="selected"' : '') . '>(GMT +4:30) Kabul</option>
				<option value="5" ' . ($user['timezone'] == 5 ? 'selected="selected"' : '') . '>(GMT +5:00) Ekaterinburg, Islamabad, Karachi, Tashkent</option>
				<option value="5.5" ' . ($user['timezone'] == 5.5 ? 'selected="selected"' : '') . '>(GMT +5:30) Bombay, Calcutta, Madras, New Delhi</option>
				<option value="6" ' . ($user['timezone'] == 6 ? 'selected="selected"' : '') . '>(GMT +6:00) Almaty, Dhaka, Colombo</option>
				<option value="6.5" ' . ($user['timezone'] == 6.5 ? 'selected="selected"' : '') . '>(GMT +6:30) Yangon, Myanmar</option>
				<option value="7" ' . ($user['timezone'] == 7 ? 'selected="selected"' : '') . '>(GMT +7:00) Bangkok, Hanoi, Jakarta</option>
				<option value="8" ' . ($user['timezone'] == 8 ? 'selected="selected"' : '') . '>(GMT +8:00) Beijing, Perth, Singapore, Hong Kong, Taiwan</option>
				<option value="9" ' . ($user['timezone'] == 9 ? 'selected="selected"' : '') . '>(GMT +9:00) Tokyo, Seoul, Osaka, Sapporo, Yakutsk</option>
				<option value="9.5" ' . ($user['timezone'] == 9.5 ? 'selected="selected"' : '') . '>(GMT +9:30) Adelaide, Darwin</option>
				<option value="10" ' . ($user['timezone'] == 10 ? 'selected="selected"' : '') . '>(GMT +10:00) Eastern Australia, Guam, Vladivostok</option>
				<option value="11" ' . ($user['timezone'] == 11 ? 'selected="selected"' : '') . '>(GMT +11:00) Magadan, Solomon Islands, New Caledonia</option>
				<option value="12" ' . ($user['timezone'] == 12 ? 'selected="selected"' : '') . '>(GMT +12:00) Auckland, Wellington, Fiji, Kamchatka</option>
				<option value="0" ' . (empty($user['timezone']) ? 'selected="selected"' : '') . '>' . $l['default_timezone'] . '</option>
			</select>
		</div>			
	</div><br />

	<div class="row">
		<div class="col-sm-5">
			<label class="sai_head">' . $l['arrange_domain'] . '</label>
			<span class="sai_exp">' . $l['exp_arrange_domain'] . '</span>
		</div>
		<div class="col-sm-7">
			<input type="checkbox" name="arrange_domain" id="arrange_domain" ' . POSTchecked('arrange_domain', $user['arrange_domain']) . ' />
		</div>
	</div><br />';
    if ($theme['this_theme'] == 'modern' && empty($globals['off_customize_theme'])) {
        echo '
		<div class="row">
			<div class="col-sm-5">
				<label class="sai_head">' . $l['use_custom_color'] . '</label>
				<span class="sai_exp">' . $l['exp_use_custom_color'] . '</span>
			</div>
			<div class="col-sm-7">
				<input type="checkbox" name="user_defined_color" id="user_defined_color" ' . POSTchecked('user_defined_color', $user['user_defined_color']) . ' onchange="change_div(this.id);" />
			</div>
		</div><br />
	
		<div id="show_color_option" ' . (!empty($user['user_defined_color']) ? '' : 'style="display:none;"') . '>
			<div class="row">
				<div class="col-sm-5">
					<label class="sai_head">' . $l['left_panel_bg'] . '</label>
					<span class="sai_exp">' . $l['left_panel_bg_exp'] . '</span>
				</div>
				<div class="col-sm-7">
					<input type="color" name="color" id="left_panel_bg" class="changecolor"/>&nbsp;&nbsp;
					<input type="hidden" name="left_panel_bg" value="' . aPOSTval('left_panel_bg', $user['color_theme']['left_panel_bg']) . '" id="hidden_left_panel_bg">
					<input type="color" name="color" id="left_panel_cathead_hover" class="changecolor" />
					<input type="hidden" name="left_panel_cathead_hover" value="' . aPOSTval('left_panel_cathead_hover', $user['color_theme']['left_panel_cathead_hover']) . '" id="hidden_left_panel_cathead_hover">
				</div>
			</div><br />
			
			<div class="row">
				<div class="col-sm-5">
					<label class="sai_head">' . $l['text_color'] . '</label>
					<span class="sai_exp">' . $l['text_color_exp'] . '</span>
				</div>
				<div class="col-sm-7">
					<input type="color" name="color" id="left_panel_cathead" class="changecolor"/>&nbsp;&nbsp;
					<input type="hidden" name="left_panel_cathead" value="' . aPOSTval('left_panel_cathead', $user['color_theme']['left_panel_cathead']) . '" id="hidden_left_panel_cathead">
					<input type="color" name="color" id="left_panel_scriptname" class="changecolor"/>
					<input type="hidden" name="left_panel_scriptname" value="' . aPOSTval('left_panel_scriptname', $user['color_theme']['left_panel_scriptname']) . '" id="hidden_left_panel_scriptname">
				</div>
			</div><br />
					
		</div></br>';
    }
    echo '
	<p align="center">
		<input type="submit" class="flat-butt" name="editsettings" value="' . $l['edit_settings'] . '" /><br /><img id="waiting" src="' . $theme['images'] . 'progress.gif" style="display:none">
	</p><br />
</div><br /><!--end of bg class-->	
</form>';
    if ($theme['this_theme'] == 'modern') {
        echo '
	<script src="' . $theme['url'] . '/js/spectrum.js" type="text/javascript"></script>
	<script type="text/javascript">
	
	function change_div(id){
	
		//alert($_(id).checked);
		
		if($_(id).checked == true){
			$("#show_color_option").show();
		}else{
			$("#show_color_option").hide();
		}
	}
	
	function reset_theme(){
		$("#user_defined_color").val("0");
		$("#editsettings").submit();
	}
	
	function updateColor(color, id) {
		
		var hexColor = "transparent";
		if(color) {
			hexColor = color.toHexString();
		}
		if(hexColor == "transparent") return;
		
		// Set the hidden value so that we can save the settings of user
		$("#user_defined_color").val("1");
		
		// For changing text colors of category heading
		if(id == "left_panel_cathead"){
			$(".soft_cathead a").css("color", hexColor);
			$(".soft_nav a").css("color", hexColor);
			$(".fa").css("color", hexColor);
			
			// set the hidden value so that it can be saved
			$("#hidden_left_panel_cathead").val(hexColor);
		}
		
		// For changing text colors of category heading hover color
		if(id == "left_panel_cathead_hover"){
			try{
				$(".soft_cathead:hover, .soft_cathead_slide:hover").css("background-color", hexColor);
				//$(".soft_cathead_slide:hover").css("background-color", hexColor);
			
				// set the hidden value so that it can be saved
				$("#hidden_left_panel_cathead_hover").val(hexColor);
			}catch(e){
				// do nothing
			}
		}
		
		// For changing text colors of script names
		if(id == "left_panel_scriptname"){
			$(".softlinks li a").css("color", hexColor);
			
			// set the hidden value so that it can be saved
			$("#hidden_left_panel_scriptname").val(hexColor);
		}
		
		// For changing background color
		if(id == "left_panel_bg"){
			$(".left_panel").css("background-image", "none");
			$(".left_panel").css("background-color", hexColor);
			$(".soft_nav").css("background", hexColor);
			
			// set the hidden value so that it can be saved
			$("#hidden_left_panel_bg").val(hexColor);
		}
		
	}
	
	var pallete_array = [
			["rgb(0, 0, 0)", "rgb(67, 67, 67)", "rgb(102, 102, 102)", /*"rgb(153, 153, 153)","rgb(183, 183, 183)",*/
			"rgb(204, 204, 204)", "rgb(217, 217, 217)", /*"rgb(239, 239, 239)", "rgb(243, 243, 243)",*/ "rgb(255, 255, 255)"],
			["rgb(152, 0, 0)", "rgb(255, 0, 0)", "rgb(255, 153, 0)", "rgb(255, 255, 0)", "rgb(0, 255, 0)",
			"rgb(0, 255, 255)", "rgb(74, 134, 232)", "rgb(0, 0, 255)", "rgb(153, 0, 255)", "rgb(255, 0, 255)"],
			["rgb(230, 184, 175)", "rgb(244, 204, 204)", "rgb(252, 229, 205)", "rgb(255, 242, 204)", "rgb(217, 234, 211)",
			"rgb(208, 224, 227)", "rgb(201, 218, 248)", "rgb(207, 226, 243)", "rgb(217, 210, 233)", "rgb(234, 209, 220)",
			"rgb(221, 126, 107)", "rgb(234, 153, 153)", "rgb(249, 203, 156)", "rgb(255, 229, 153)", "rgb(182, 215, 168)",
			"rgb(162, 196, 201)", "rgb(164, 194, 244)", "rgb(159, 197, 232)", "rgb(180, 167, 214)", "rgb(213, 166, 189)",
			"rgb(204, 65, 37)", "rgb(224, 102, 102)", "rgb(246, 178, 107)", "rgb(255, 217, 102)", "rgb(147, 196, 125)",
			"rgb(118, 165, 175)", "rgb(109, 158, 235)", "rgb(111, 168, 220)", "rgb(142, 124, 195)", "rgb(194, 123, 160)",
			"rgb(166, 28, 0)", "rgb(204, 0, 0)", "rgb(230, 145, 56)", "rgb(241, 194, 50)", "rgb(106, 168, 79)",
			"rgb(69, 129, 142)", "rgb(60, 120, 216)", "rgb(61, 133, 198)", "rgb(103, 78, 167)", "rgb(166, 77, 121)",
			/*"rgb(133, 32, 12)", "rgb(153, 0, 0)", "rgb(180, 95, 6)", "rgb(191, 144, 0)", "rgb(56, 118, 29)",
			"rgb(19, 79, 92)", "rgb(17, 85, 204)", "rgb(11, 83, 148)", "rgb(53, 28, 117)", "rgb(116, 27, 71)",*/
			"rgb(91, 15, 0)", "rgb(102, 0, 0)", "rgb(120, 63, 4)", "rgb(127, 96, 0)", "rgb(39, 78, 19)",
			"rgb(12, 52, 61)", "rgb(28, 69, 135)", "rgb(7, 55, 99)", "rgb(32, 18, 77)", "rgb(76, 17, 48)"]
		];
	
	';
        foreach ($user['color_theme'] as $kc => $vc) {
            echo '$(function() {
			$("#' . $kc . '").spectrum({
				allowEmpty:true,
				color : "' . $vc . '",
				showInput: true,
				className: "full-spectrum",
				showInitial: true,
				showPalette: true,
				showSelectionPalette: true,
				maxPaletteSize: 10,
				preferredFormat: "hex",
				localStorageKey: "soft.demo",
				move: function (color) {
					updateColor(color, this.id);
				},
				hide: function (color) {
					updateColor(color, this.id);
				},
				palette: pallete_array
			});
		});';
        }
        echo '
	</script>';
    }
    // END OF "if($theme['this_theme'] == 'modern'){"
    softfooter();
}
Пример #6
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();
}
Пример #7
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>';
}
Пример #8
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();
}
Пример #9
0
function adduser_theme()
{
    global $theme, $globals, $user, $l, $langs, $error, $reseller, $iscripts, $plans, $done, $_cpplan, $_users, $allcatwise, $_resellers, $loaded_scripts, $softpanel, $__adduser;
    softheader($l['<title>']);
    echo '<br /><form accept-charset="' . $globals['charset'] . '" name="addplan" method="post" action="">
<div class="sai_heading" align="center"><img src="' . $theme['images'] . 'admin/addplan.gif" />&nbsp; ' . $l['title'] . '</div>
<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" /><br /><br /><br />';
    error_handle($error);
    if (!empty($done)) {
        echo '<div class="sai_notice"><img src="' . $theme['images'] . 'success.gif" /> &nbsp; ' . $l['done'] . '</div>';
    }
    echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
	
function show(){
	if($_("is_reseller").checked){		
		$_("num_users_row").style.display = "";
	}else{
		$_("num_users_row").style.display = "none";
		$_("num_users").value = 0;
	}
}
addonload("show();");

// ]]></script>';
    echo '<link href="https://www.softaculous.net/images/sprites/20.css" rel="stylesheet" type="text/css" />
<table width="721" cellpadding="6" cellspacing="0" border="0" style="margin:0px auto;" class="sai_reviewform">
	<tr>
	<td colspan="2">
		<table class="sai_ribboneffect" width="107%" style="left:-21px;" border="0"> 
			<tr>
				<td width="2%"></td>
				<td valign="top"><br />
					<font class="sai_ribbonhead" style="color:#FFF;"><b>' . $l['user_details'] . '</b></font> 
				</td>
			</tr>
		</table>
	</td>
	</tr>
	<tr>
		<td width="35%">
			<span class="sai_head">' . $l['username'] . '</span><br />
			<span class="sai_exp2">' . $l['exp_username'] . '</span>
		</td>
		<td valign="top">
			<input type="text" name="username" size="40" value="' . POSTval('username', '') . '">
		</td>
	</tr>
	<tr>
		<td width="35%">
			<span class="sai_head">' . $l['user_email'] . '</span><br />
			<span class="sai_exp2">' . $l['exp_user_email'] . '</span>
		</td>
		<td valign="top">
			<input type="text" name="user_email" size="40" value="' . POSTval('user_email', '') . '">
		</td>
	</tr>';
    if (ent()) {
        echo '<tr>
			<td width="35%">
				<span class="sai_head">' . $l['uid'] . '</span><br />
				<span class="sai_exp2">' . $l['exp_uid'] . '</span>
			</td>
			<td valign="top">
				<input type="text" name="uid" size="40" value="' . POSTval('uid', '') . '">
			</td>
		</tr>
		<tr>
			<td width="35%">
				<span class="sai_head">' . $l['gid'] . '</span><br />
				<span class="sai_exp2">' . $l['exp_gid'] . '</span>
			</td>
			<td valign="top">
				<input type="text" name="gid" size="40" value="' . POSTval('gid', '') . '">
			</td>
		</tr>';
    }
    if (!defined('SOFTRESELLER')) {
        echo '<tr>
			<td width="35%">
				<span class="sai_head">' . $l['is_reseller'] . '</span><br />
				<span class="sai_exp2">' . $l['exp_is_reseller'] . '</span>
			</td>
			<td valign="top">
				<input type="checkbox" name="is_reseller" size="40"  id="is_reseller" ' . POSTchecked('is_reseller', true) . ' onclick="show(this);">
			</td>
		</tr>
		<tr id="num_users_row" style="display:none;">
			<td width="35%">
				<span class="sai_head">' . $l['number_of_users'] . '</span><br />
				<span class="sai_exp2">' . $l['exp_number_of_users'] . '</span>
			</td>
			<td valign="top">
				<input type="text" name="num_users" id="num_users" size="40" value="' . POSTval('num_users', '') . '">
			</td>
		</tr>';
    }
    echo '</td>
	</tr>
	<tr><td></td></tr>
</table>

<p align="center"><input type="submit" name="saveuser" value="' . $l['saveuser'] . '" class="sai_graybluebut"  ></p>
</form>';
    softfooter();
}
Пример #10
0
function no_autoupgrade_theme()
{
    global $theme, $globals, $user, $l, $langs, $skins, $error, $saved, $categories, $iscripts, $scripts, $top, $no_autoupgrade, $noautoupgrade_catwise, $noautoupgrade_scripts;
    softheader($l['<title>']);
    echo '<div class="sai_heading" align="center">' . $l['show_top_scripts'] . '</div>
<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" /><br /><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 />';
    }
    echo '<form accept-charset="' . $globals['charset'] . '" name="reordercat" method="post" action="">

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

ids1 = new Array(' . implode(', ', array_keys($noautoupgrade_scripts)) . ');

function checkallsoftware(checker){	
	for(x in ids1){
		
		$_("scripts_"+ids1[x]).checked = checker.checked;
		
		//change td background color
		changebg(ids1[x],"scripts_");
	}	
};


function selectchkbox(id,type){
	if($_(type+id).checked){
		$_(type+id).checked = false;
	}else{
		$_(type+id).checked = true;
	}
	
	//change td background color
	changebg(id,type);
}

function changebg(id,type){
	try{
		if($_(type+id).checked){
			$("#td_"+id).css({ backgroundColor: "#C5EAFF" });
			$("#td_"+id).css({boxShadow: "0 0 4px #3EA0DC"});
			
		}else{
			$_("td_"+id).style.background = "#ffffff";
			$("#td_"+id).css({boxShadow: "0 0 4px #FFF"});
		}
	}catch(e){}
};

function checkall(){
	
	// for scripts
	for(x in ids1){	
		changebg(ids1[x],"scripts_");
	}
	
};

addonload("checkall();");

// ]]></script>';
    /*  $reseller $user*/
    echo '<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_reviewform">
	<tr>
	<td colspan="2">
		<table class="sai_ribboneffect" width="107%" style="left:-21px;" border="0"> 
			<tr>
				<td width="2%"></td>
				<td valign="top"><br />
					<font class="sai_ribbonhead" style="color:#FFF;"><b>' . $l['planhead'] . '</b></font> 
				</td>
			</tr>
		</table>
	</td>
	</tr>
	<tr>
		<td>
		<span class="sai_head">' . $l['disable_autoupgrade'] . '</span><br />
		<span class="sai_exp2">' . $l['disable_autoupgrade_exp'] . '</span>
		</td>
		<td valign="top">
		<input type="checkbox" name="disable_autoupgrade" size="30" ' . POSTchecked('disable_autoupgrade', @$no_autoupgrade['disable_autoupgrade']) . ' />
		</td>
	</tr>

	<tr>
		<td width="50%">
			<span class="sai_head">' . $l['uptime'] . '</span><br />
			<span class="sai_exp2">' . $l['exp_uptime'] . '</span>
		</td>
		<td valign="top">
			<input type="text" name="uptime" size="40" value="' . POSTval('uptime', $no_autoupgrade['uptime']) . '">
		</td>
	</tr>
	
	<tr>
	<td colspan="2">
		<div class="notebox" style="width:95%">
			<font class="bboxtxt"><b>' . $l['script_note'] . '</b> : <br />' . $l['script_note_exp'] . '</font>
		</div>
	</td>
	</tr>';
    echo '</table><br /><br />';
    echo '
	<table width="721" cellpadding="6" cellspacing="0" border="0" style="margin:0px auto;" class="sai_divroundshad">
	<tr>
		<td colspan="2">
			<table class="sai_ribboneffect" width="107%" style="left:-21px;" border="0"> 
				<tr>
					<td width="2%"></td>
					<td valign="top"><br />
						<font class="sai_ribbonhead" style="color:#FFF;"><b>' . $l['scriptselect'] . '</b></div>
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td colspan="2">
		<span>' . $l['exp_scriptselect'] . '</span><br /><br />
		<span class="sai_exp2">' . $l['select_all'] . '<input type="checkbox" onclick="checkallsoftware(this);" /></span>
		</td>
	</tr>
	
	<tr>
		<td colspan="2">
			<table width="100%" cellpadding="5" cellspacing="1" border="0">';
    //r_print($noautoupgrade_catwise);
    //Showing All scripts Category wise
    foreach ($noautoupgrade_catwise as $ak => $av) {
        echo '<tr>
					<td colspan="4"><center class="sai_ribbonhead"><b>' . strtoupper($ak) . ' Apps</b></center></td>
				</tr>';
        foreach ($av as $kk => $vv) {
            if (empty($av[$kk])) {
                continue;
            }
            echo '<tr>
							 <td colspan="2">
								<div class="sai_ribbonhead">' . $l['cat_' . $ak . '_' . $kk] . '</div>
								<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" />
							</td>
							</tr>';
            $i = 0;
            foreach ($vv as $k => $v) {
                if (is_int($i / 4)) {
                    echo '<tr>';
                }
                echo '<td width="20%">
						<table border="0" id="td_' . $k . '">
						<tr>
						<td width="10%">
							<input type="checkbox" id="scripts_' . $k . '" name="scripts_' . $k . '" ' . POSTchecked('scripts_' . $k, $no_autoupgrade['scripts'][$k]) . '  onclick="changebg(\'' . $k . '\',\'scripts_\');"/>
						</td>
						<td width="10%">
							<div class="sp20_' . $v['softname'] . '"></div>
						</td>
						<td>
							<a href="javascript:void(0)" style="text-decoration: none; " onclick="selectchkbox(\'' . $k . '\',\'scripts_\');" ><font class="bboxtxt">' . $v['name'] . '</font></a>
						</td>
						</tr>
						</table>
						</td>';
                $i++;
                if (is_int($i / 4)) {
                    echo '</tr>';
                }
            }
        }
    }
    echo '</table></td>
	</tr>
</table>

<p align="center"><input type="submit" name="save" value="' . $l['save'] . '" class="sai_graybluebut"  ></p>
</form>';
    softfooter();
}
Пример #11
0
function domainadd_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error;
    global $insid, $backed, $software, $soft, $done;
    // For adding MX Record
    if (optGET('ajaxdomadd')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        // Creating domain
        if (!empty($done)) {
            echo '1' . $l['suc_dom_added'];
            return true;
        }
    }
    softheader($l['<title>']);
    error_handle($error, '100%');
    echo '<form accept-charset="' . $globals['charset'] . '"  name="importsoftware" method="post" action="" onsubmit="return checkform();" >
<script language="javascript" type="text/javascript"><!-- // --><![CDATA[

var dompath = false;

var message_box = function(){			
return {
	show_message: function(title, body , image) {			
		var okbutton = \'<input  style="width:75px" class="sai_graybluebut" 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($(jQuery.browser.webkit ? "body": "html")).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\');
	}
}
}();


function show(){
	if($_("isaddon").checked){		
		$_("addon").style.display = "";
		$_("addon1").style.display = "";
		
	}else{
		$_("addon").style.display = "none";
		$_("addon1").style.display = "none";
	
	}
}
addonload("show();");

function checkform(){
	try{
		if(!formcheck() || !checkdbname(\'softdb\', true)){
			return false;
		}
	}catch(e){
		//Do nothing
	}
	return true;
};

function suggestdompath(domval){
	if(dompath){
		return true;	
	}
	$_("domainpath").value = "www/"+$_("domain").value.trim();
}

$(document).ready(function(){

	// For creating MX Record	
	$("#submitdomain").click(function(){
		$("#createdomain").css("display", "");	
		var domain = ($("#domain").val());
		if($_("isaddon").checked == true){
			var isaddon = 1;
			var domainpath = ($("#domainpath").val());
			var ip = ($("#ip").val());
			var tmp = "&domainpath="+domainpath;
		}else{
			var selectdomain = ($("#selectdomain").val());
			var isaddon = 0;
			var tmp = "&selectdomain="+selectdomain;
		}
		
		$.ajax({
			type: "POST",
			url: window.location+"&submitdomain=1&ajaxdomadd=1",					
			data: "domain="+domain+"&isaddon="+isaddon+tmp+"&ip="+ip,
			
			// Checking for error
			success: function(data){
				$("#createdomain").css("display", "none");
				var result = data.substring(0,1);
				var msg = data.substring(1);
				if(result == "1"){
					$_("domain").value="";
					$_("ip").value="";
					if($_("isaddon").checked == true){
						$_("domainpath").value="www/";
					}
					message_box.show_message( "Done ",msg,2);														
				}
				if(result == "0"){	
					$("#createdomain").css("display", "none");
					message_box.show_message( "Error",msg,1);
				}
			},
			error: function() {
				message_box.show_message("Error",\'' . $l['connect_error'] . '\',1);						
			}															
		});												
	});
});
// ]]></script>

<center><div class="sai_tit"><img src="' . $theme['a_images'] . 'adddomain.gif" alt="" />&nbsp;' . $l['domain_add_label'] . '</div></center>
<table border="0" cellpadding="8" cellspacing="8" width="700px" align="center" class="sai_divroundshad"  style="padding:15px; ">
	<tr>
		<td width="35%">
			<span class="sai_head">' . $l['domain_label'] . '</span>
		</td>
		<td valign="top">
			<input type="text" name="domain" id="domain" onkeyup="suggestdompath(this);" size="30" value="' . POSTval('domain', '') . '" />
		</td>
	</tr>
	<tr>
		<td>
			<span class="sai_head">' . $l['is_addon_part'] . '</font></span><br/><span class="sai_exp">' . $l['exp_checkaddon'] . '</span>
		</td>
		<td>
			<input type="checkbox" name="isaddon" id="isaddon" ' . POSTchecked('isaddon', true) . ' onclick="show(this);">
		</td>
	</tr>
	<tr id="addon">
		<td>
			<span class="sai_head">' . $l['domain_path'] . '</span><span class="sai_exp">' . $softpanel->user['homedir'] . '/' . '</span>
		</td>
		<td valign="top">
			<input type="text" name="domainpath" id="domainpath" size="30" value="' . stripslashes(POSTval('domainpath', 'www/')) . '" onfocus="" />
<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
//Add an event handler
$_("domainpath").onkeydown = function(){
	dompath = true;
}
// ]]></script>
	</tr>
	<tr id="addon1">
		<td width="35%">
			<span class="sai_head">' . $l['ip_label'] . '</span><br/><span class="sai_exp">' . $l['exp_ip'] . '</span>
		</td>
		<td valign="top">
			<input type="text" name="ip" id="ip" size="30" value="' . POSTval('ip', '') . '" />
		</td>
	</tr>		
	<tr>
		<td colspan="2">
			<p align="center">
				<input type="button" style="cursor:pointer" name="submitdomain" value="' . $l['submitdomain'] . '" id="submitdomain" class="sai_graybluebut"/> &nbsp;<img id="createdomain" src="' . $theme['images'] . 'progress.gif" style="display:none">
			</p>
		</td>
	</tr>
	
</table>
<br /><br />


</form>';
    softfooter();
}
Пример #12
0
function proxy_theme()
{
    global $theme, $globals, $user, $l, $langs, $skins, $error, $saved;
    softheader($l['<title>']);
    echo '<div class="sai_heading" align="center">&nbsp;&nbsp;&nbsp;' . $l['proxyhead'] . '</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 />';
    }
    echo '<br />
<form accept-charset="' . $globals['charset'] . '" name="editeproxysettings" method="post" action="">
<table width="95%" cellpadding="10" cellspacing="1" class="sai_reviewform" style="margin:0px auto;" border="0">
<tr>
<td width="10%">
</td>
</tr>
<tr>
<td width="10%">
</td>
<td width="45%">
<span class="sai_head">' . $l['proxy_check'] . '</span>
</td>
<td>
<input type="checkbox" name="proxy_check" ' . POSTchecked('proxy_check', $globals['proxy_check']) . ' />
</td>
</tr>
<tr>
<td width="10%">
</td>
<td width="45%">
<span class="sai_head">' . $l['proxy_ip'] . '</span>
</td>
<td valign="top">
<input type="text" name="proxy_ip" size="30" value="' . aPOSTval('proxy_ip', $globals['proxy_ip']) . '" />
</td>
</tr>

<tr>
<td>
</td>
<td>
<span class="sai_head">' . $l['proxy_port'] . '</span>
</td>
<td valign="top">
<input type="text" name="proxy_port" size="30" value="' . aPOSTval('proxy_port', $globals['proxy_port']) . '" />
</td>
</tr>

<tr>
<td>
</td>
<td>
<span class="sai_head">' . $l['proxy_user'] . '</span>
</td>
<td valign="top">
<input type="text" name="proxy_user" size="30" value="' . aPOSTval('proxy_user', $globals['proxy_user']) . '" />
</td>
</tr>

<tr>
<td>
</td>
<td>
<span class="sai_head">' . $l['proxy_pass'] . '</span>
</td>
<td valign="top">
<input type="password" name="proxy_pass" size="30" value="' . aPOSTval('proxy_pass', $globals['proxy_pass']) . '" />
</td>
</tr>
<tr>
<td colspan="4">
	<p align="center"><input type="submit" name="editproxysettings" value="' . $l['edit_settings'] . '" class="sai_graybluebut"/></p>
</td>
</tr>
</table><br /><br />
<div class="notebox" style="width:95%;">
	<font class="bboxtxt">' . $l['tcp_note'] . '</font>
</div>

</form>';
    softfooter();
}
Пример #13
0
function domainadd_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error;
    global $insid, $backed, $software, $soft, $done;
    // For adding MX Record
    if (optGET('ajaxdomadd')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        // Creating domain
        if (!empty($done)) {
            echo '1' . $l['suc_dom_added'];
            return true;
        }
    }
    softheader($l['<title>']);
    error_handle($error, '100%');
    echo '<form accept-charset="' . $globals['charset'] . '" name="importsoftware" method="post" action="" onsubmit="return checkform();">
<script language="javascript" type="text/javascript"><!-- // --><![CDATA[

var dompath = false;

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($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150);
			jQuery(\'.sai_message_box\').show(\'slow\');
		}else{
			var message = \'<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 + \'</a></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\');
	}
}
}();


function show(){
	if($_("isaddon").checked){		
		$_("addon").style.display = "";
		$_("parked").style.display = "none";
	}else{
		$_("addon").style.display = "none";
		$_("parked").style.display = "";
	}
}
addonload("show();");

function checkform(){
	try{
		if(!formcheck() || !checkdbname(\'softdb\', true)){
			return false;
		}
	}catch(e){
		//Do nothing
	}
	return true;
};

function asuggestdompath(domval){
	if(dompath){
		return true;	
	}
	$_("domainpath").value = "' . (empty($globals['adomain_path']) ? cleanpath($softpanel->user['homedir']) . '/www/' : $globals['adomain_path']) . '"+$_("domain").value;
}

function error(err){
	return err;
}

$(document).ready(function(){
	var r=1;
	$(\'#hostadd\').prop(\'checked\', true);
	
	// For creating MX Record	
	$("#submitdomain").click(function(){
		$("#createdomain").css("display", "");	
		var domain = ($("#domain").val());
		if($_("isaddon").checked == true){
			var isaddon = 1;
			var domainpath = ($("#domainpath").val());
			var tmp = "&domainpath="+domainpath;
		}else{
			var selectdomain = ($("#selectdomain").val());
			var isaddon = 0;
			var tmp = "&selectdomain="+selectdomain;
		}
		if($_("hostadd").checked == true){
			var hostadd = 1;
		}else{
			var hostadd = 0;
		}
		if($_("ssl").checked == true){
			var ssl = 1;
		}else{
			var ssl = 0;
		}
		$.ajax({
			type: "POST",
			url: window.location+"&submitdomain=1&ajaxdomadd=1",					
			data: "domain="+domain+"&isaddon="+isaddon+tmp+"&hostadd="+hostadd+"&ssl="+ssl,
			
			// Checking for error
			success: function(data){
				$("#createdomain").css("display", "none");
				var result = data.substring(0,1);
				var msg = data.substring(1);
				if(result == "1"){
					$_("domain").value="";
					if($_("isaddon").checked == true){
						$_("domainpath").value="' . cleanpath($softpanel->user['homedir']) . '/www/";
					}
					$(\'input:checkbox[name="hostadd"]\').attr(\'checked\', true);
					$(\'input:checkbox[name="ssl"]\').attr(\'checked\', false);
					r=1;
					message_box.show_message( "Done ",msg,2);
				}
				if(result == "0"){
					$("#createdomain").css("display", "none");
					message_box.show_message( "Error",msg,1);
				}
			},
			error: function() {
				message_box.show_message("Error",\'' . $l['connect_error'] . '\',1);
			}
		});
	});
});
// ]]></script>

<center><div class="sai_heading"><img src="' . $theme['images'] . 'adddomain.gif" alt="" /> &nbsp;' . $l['domain_add_label'] . '</div></center>
<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" />

<br /><br />

<table border=0 width="100%" cellpadding="5" cellspacing="1">
	<tr>
		<td width="35%">
			<span class="sai_head">' . $l['domain_label'] . '</span>
		</td>
		<td valign="top">
			<input type="text" name="domain" id="domain" onkeyup="asuggestdompath(this);" size="30" value="' . POSTval('domain', '') . '" />
		</td>
	</tr>
	<tr>
		<td>
			<span class="sai_head">' . $l['is_addon_part'] . '</font></span><br/><span class="sai_exp">' . $l['exp_checkaddon'] . '</span>
		</td>
		<td>
			<input type="checkbox" name="isaddon" id="isaddon" ' . POSTchecked('isaddon', true) . ' onclick="show(this);">
		</td>
	</tr>
	<tr id="addon">
		<td>
			<span class="sai_head">' . $l['domain_path'] . '</span><span class="sai_exp">' . $l['exp_dompath'] . '</span>
		</td>
		<td valign="top">
			<input type="text" name="domainpath" id="domainpath" size="30" value="' . (!empty($globals['adomain_path']) ? $globals['adomain_path'] : cleanpath($softpanel->user['homedir']) . '/www/') . '" onfocus="" />
<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
//Add an event handler
$_("domainpath").onkeydown = function(){
	dompath = true;
}
// ]]></script>
		</td>
	</tr>
	<tr id="parked" style="display:none">
		<td>
			<span class="sai_head">' . $l['select_domain'] . '</span>
		</td>
		<td>
			<select class="input" name="selectdomain" id="selectdomain"> ';
    $domains = $softpanel->domains();
    foreach ($domains as $k => $v) {
        if ($k != '') {
            echo '<option value="' . $k . '">' . $k . '</option>';
        }
    }
    echo '</td>
	</tr>
	<tr id="ssltr" ' . ($softpanel->is_ssl() == true ? '' : 'style="display:none"') . '>
		<td>
			<span class="sai_head">' . $l['ssl_entry'] . '</span><br/><span class="sai_exp">' . $l['exp_ssl'] . '</span>
		</td>
		<td>
			<input type="checkbox" name="ssl" id="ssl" ' . POSTchecked('ssl', false) . '>
		</td>
	</tr>
	<tr ' . ($globals['os'] == 'windows' ? '' : ($softpanel->currentBinary() > 16 ? '' : 'style="display:none"')) . '>
		<td>
			<span class="sai_head">' . $l['host_entry'] . '</span><br/><span class="sai_exp">' . $l['exp_hostadd'] . ($softpanel->isUAC() != 0 ? '<br/><font color=red>' . $l['hosts_perms'] . '</font>' : '') . '</span>
		</td>
		<td>
			<input type="checkbox" name="hostadd" id="hostadd" ' . POSTchecked('hostadd', false) . '>
		</td>
	</tr>
</table>
<br />
<table border="0" width="100%">
<td align="left" width="40%"><a href="http://' . $_SERVER['HTTP_HOST'] . '/ampps/index.php?act=ampps_domainmanage">' . $l['lbl_domain_manage'] . '</a></td>
<td align="left"><input type="button" style="cursor:pointer" name="submitdomain" value="' . $l['submitdomain'] . '" id="submitdomain" class="sai_submit"/> &nbsp;<img id="createdomain" src="' . $theme['images'] . 'progress.gif" style="display:none"></td></table>
</form>';
    softfooter();
}
Пример #14
0
function installations_theme()
{
    global $theme, $globals, $user, $l, $langs, $skins, $error, $list, $scripts, $_scriptwise, $emailed, $iscripts, $autoupgrade, $ins_to_be_upgrade, $records_updated, $real_version, $_domainwise;
    if (optGET('api')) {
        _api($list, optGET('api'));
        return;
    }
    softheader($l['<title>']);
    echo '<div class="sai_heading" align="center">' . $l['searchinstallations'] . '</div>
<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" /><br /><br /><br />';
    error_handle($error);
    //The necessary JavaScripts
    echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
var ids = [];
function show_image(){
	
	goto_top();
	$("#prog_img").fadeIn(500);
	$("#list_ins").hide();
	$("#autoupgrade_process").css("display","");
	$("#prog_img").show();

	$("#list_ins").find( "input[type=checkbox][checked]" ).each( function(){
		ids.push(this.value);
	});
	
	//alert(aArray);return;
		
	updatedids = new Object();
	for(x in ids){
		if(ids[x] != "on"){
			//alert(ids[x]);
			updatedids[ids[x]] = false;
		}
	}
	$("#upgrade_ins_div1").css("display","none");
	$("#upgrade_ins_div2").css("display","none");
	
	autoupgradeins(0, \'\');
	return false;
};

function autoupgradeins(id, resp){
	//alert(resp);
	//alert(id);
	
	
	//Update the Status with Response
	if(id != 0){
		$("<div>"+resp+"</div>").appendTo("#autoupgrade_process");
		updatedids[id] = true;
	}

	for(x in ids){
		//alert(ids[x]);
		if(updatedids[ids[x]] == false){
			var tmp_id = ids[x].split("-");
			AJAX("' . $globals['index'] . 'act=installations&show=upgrade&sact=autoupgradeins&user="******"&insid="+tmp_id[1], "autoupgradeins(\'"+ids[x]+"\', re)");
			return true;
		}
	}

	$("#prog_img").fadeOut(50);
	$("#succ_upgrad_msg").fadeIn(100);
	$("#goto_list_link").fadeIn(100);
	
};

// ]]></script>';
    echo '<script language="JavaScript" src="' . $theme['url'] . '/js/osuggest.js" type="text/javascript"></script>
<div style="width:710px; margin:0px auto;">
<form accept-charset="' . $globals['charset'] . '" name="serchinstallations" method="post" action="">
<table width="100%" cellpadding="5" cellspacing="1" border="0" class="sai_reviewform" style="margin:0px auto; padding:"20px;">
<tr>
	<td><br />
		<span class="sai_head">' . $l['search_scripts'] . '</span><br />
		<span class="sai_exp2">' . $l['search_scripts_exp'] . '</span>
	</td>
	<td><br />
		<input type="text" name="scripts" id="scripts" size="30" value="' . POSTval('scripts') . '" onkeyup="handlesuggest(event, \'scripts\')" onkeydown="handlekeys(event)" autocomplete=off  onblur="setTimeout(hidesuggest, 1000);" suggesturl="' . $globals['ind'] . 'act=suggest&sact=scripts" /> &nbsp; &nbsp;
	</td>
	<td width="250">
		<span class="sai_head">' . $l['group_by_scripts'] . '</span><br />
		<span class="sai_exp2">' . $l['group_by_scripts_exp'] . '</span>
	</td>
	<td width="50">
		<input type="checkbox" name="group_by_scripts" ' . POSTchecked('group_by_scripts') . ' />
	</td>
</tr>
<tr>';
    if (!webuzo()) {
        echo '
	<td>
		<span class="sai_head">' . $l['search_users'] . '</span><br />
		<span class="sai_exp2">' . $l['search_users_exp'] . '</span>
	</td>
	<td>
		<input type="text" name="users" id="users" size="30" value="' . POSTval('users') . '" onkeyup="handlesuggest(event, \'users\')" onkeydown="handlekeys(event)" autocomplete=off  onblur="setTimeout(hidesuggest, 1000);" suggesturl="' . $globals['ind'] . 'act=suggest&sact=users" />
	</td>';
    } else {
        echo '<td colspan="2">
		</td>';
    }
    echo '<td width="250">
		<span class="sai_head">' . $l['only_outdated'] . '</span><br />
		<span class="sai_exp2">' . $l['only_outdated_exp'] . '</span>
	</td>
	<td width="50">
		<input type="checkbox" name="only_outdated" ' . POSTchecked('only_outdated') . ' />
	</td>
</tr>
<tr>
	<td>
		<span class="sai_head">' . $l['search_domains'] . '</span><br />
		<span class="sai_exp2">' . $l['search_domains_exp'] . '</span>
	</td>
	<td>
		<input type="text" name="domains" id="domains" size="30" value="' . POSTval('domains') . '" />
	</td>
	<td>
		<span class="sai_head">' . $l['only_realversion'] . '</span><br />
		<span class="sai_exp2">' . $l['only_realversion_exp'] . '</span>
	</td>
	<td width="50">
		<input type="checkbox" name="only_realversion" ' . POSTchecked('only_realversion') . ' />
	</td>
</tr>
<tr>
	<td colspan="4">
		<p align="center"><input type="submit" name="listinstallations" value="' . $l['search_ins'] . '" class="sai_graybluebut" /></p>	
	</td>
</tr>
</table>
<br /><br />
</form>
</div>';
    if (isset($_REQUEST['listinstallations'])) {
        $upgrade_ins_button = '<table cellpadding="0" cellspacing="0" width="100%" border="0">
			<tr>
				<td width="80%">
					<p align="right" class="bboxtxt">' . $l['with_selected'] . '&nbsp;&nbsp;
				</td> 
				<td>:&nbsp;&nbsp;</td>
				<td valign="middle"><input type="submit" name="upgrade_ins" id="upgrade_ins" value="' . $l['sub_upgrade_ins'] . '" class="sai_graybluebut" onclick="return show_image();" /></td>
			</tr>
		</table>';
        // In case there is any error than just dont show the button
        if (!empty($error)) {
            $upgrade_ins_button = '';
        }
        $email_button = '<p align="right" class="bboxtxt"><table cellpadding="0" cellspacing="0" width="100%" border="0">
		<tr>
			<td width="60%" align="right" valign="middle">' . $l['with_selected'] . '&nbsp;&nbsp;:&nbsp;&nbsp;</td>';
        if (!empty($real_version)) {
            $email_button .= '<td valign="middle"><br /><input type="submit" name="update_records" id="update_records" value="' . $l['update_records'] . '" class="sai_graybluebut"/></td></tr></table></p>';
        } else {
            $email_button .= '<td valign="middle"><br /><input type="submit" name="send_email" id="send_email" value="' . $l['sub_email_users'] . '" class="sai_graybluebut"/></td></tr></table></p>';
        }
        if (!empty($records_updated)) {
            echo '<br /><div class="sai_success"><img src="' . $theme['images'] . 'success.gif" /> ' . $l['succ_update_record'] . '</div><br />';
        }
        if (empty($list)) {
            echo '<h2 align="center">' . $l['no_results'] . '</h2>';
        } else {
            if (!empty($emailed)) {
                echo '<br /><div class="sai_success"><img src="' . $theme['images'] . 'success.gif" /> ' . $l['emailed_users'] . '</div><br />';
            }
            echo '<br /><div class="sai_notice" id="succ_upgrad_msg" style="display:none">' . $l['upgraded_ins'] . '</div><br />';
            echo '<div style="width:710px; margin:0px auto;">
		<form accept-charset="' . $globals['charset'] . '" name="email_users" method="post" action="" id="email_users">
		<link href="' . $globals['mirror_images'] . 'sprites/20.css" rel="stylesheet" type="text/css" />
		<table cellpadding="0" cellspacing="0" width="100%" border="0">
			<tr>
				<td width="50%">
				<div style="display:none;float:left" id="prog_img"><img src="' . $theme['images'] . 'admin_progress.gif" />&nbsp;&nbsp;' . $l['upgrading_ins'] . '</div>
				</td>
			</tr>
			<tr>
				<td align="right">';
            if (!isset($_REQUEST['upgrade_installation']) || !empty($real_version)) {
                echo $email_button;
            } else {
                // We are ending the table because we are not ending this in the variable.
                echo '<div id="upgrade_ins_div1">' . $upgrade_ins_button . '</div>';
            }
            echo '</td></tr>
		</table><br /><br />';
            if (!empty($real_version)) {
                echo '<div class="notebox" style="width:95%;" id="beta_notice1">
					<table width="100%" cellpadding="5" cellspacing="1" border="0">
						<tr>
							<td width="25px">
								<div class="lirealver" style="height:16px;width:16px"></div>
							</td>
							<td><font class="bboxtxt">' . $l['real_ver_notice'] . '</font></td>
						</tr>
						<tr>
							<td width="25px">
								<div class="lioutdated" style="height:16px;width:16px"></div>
							</td>
							<td><font class="bboxtxt">' . $l['latest_ver_notice'] . '</font></td>
						</tr>
					</table>
				</div>';
            }
            echo '<div class="sai_divroundshad" id="list_ins" style="display:block">
		<table width="100%" cellpadding="5" cellspacing="1" border="0">
		<tr>
			<td class="lihead" width="100">' . (empty($_scriptwise) ? empty($_domainwise) ? $l['li_user'] : $l['li_domains'] : $l['li_scripts']) . '</td>
			<td class="lihead">' . (empty($_scriptwise) ? $l['li_scripts'] : $l['li_user']) . '</td>' . (!empty($_domainwise) ? '<td class="lihead" width="5%">' . $l['li_user'] . '</td>' : '') . '
			<td class="lihead">' . $l['li_url'] . '</td>
			<td class="lihead" width="15%">' . $l['li_insver'] . '</td>' . (!empty($real_version) ? '<td class="lihead" width="15%">' . $l['li_realver'] . '</td>' : '') . '<td class="lihead" width="2%">' . $l['li_ver'] . '</td>
			<td class="lihead"><img src="' . $theme['images'] . 'auto_upgrade.png"  title="' . $l['auto_upgrade_enabled'] . '" style="cursor:pointer"/>
			<td class="lihead"><input type="checkbox" onclick="check(document.getElementsByName(\'list[]\'), this);" ' . (!empty($error) ? 'disabled=true' : '') . '/></td>
		</tr>';
            $class = '';
            foreach ($list as $lk => $lv) {
                $i = 1;
                $class = $class == 'lione' ? 'litwo' : 'lione';
                foreach ($lv as $llk => $llv) {
                    foreach ($llv as $ik => $iv) {
                        $_class = $class;
                        echo '<tr>
				<td class="' . ($i == 1 ? $class : '') . '">';
                        $isCustom = is_customscript($iv['sid']) ? 1 : 0;
                        if ($i == 1) {
                            echo '<font class="bboxtxt">' . (empty($_scriptwise) ? $lk : (!empty($scripts[$iv['sid']]) && !empty($iscripts[$iv['sid']]) ? $scripts[$iv['sid']]['name'] : (!empty($isCustom) ? $iscripts[$iv['sid']]['name'] : $l['no_info']))) . '</font>';
                        } else {
                            echo '&nbsp;';
                        }
                        if (!empty($isCustom)) {
                            if ($iscripts[$iv['sid']]['ver'] != $iv['ver']) {
                                $_class = 'lioutdated';
                            }
                        } else {
                            if ($iscripts[$iv['sid']]['ver'] != $iv['ver'] && file_exists($globals['softscripts'] . '/' . $iscripts[$iv['sid']]['softname'] . '/upgrade.xml')) {
                                $_class = 'lioutdated';
                            }
                        }
                        $real_class = 'lirealver';
                        $__user = empty($_scriptwise) ? $lk : $llk;
                        if (!empty($_domainwise)) {
                            $__user = $iv['user'];
                        }
                        echo '</td>
		<td class="' . $class . '">' . (empty($_scriptwise) ? !empty($scripts[$iv['sid']]) && !empty($iscripts[$iv['sid']]) ? $scripts[$iv['sid']]['name'] : (!empty($isCustom) ? $iscripts[$iv['sid']]['name'] : $l['no_info']) : $llk) . '</td>' . (!empty($_domainwise) ? '<td class="' . $class . '">' . $__user . '</td>' : '') . '
		<td class="' . $class . '"><a href="' . $iv['softurl'] . '" target="_blank">' . $iv['softurl'] . '</a></td>
		<td class="' . $class . '">' . $iv['ver'] . '</td>' . (!empty($iv['real_ver']) && !empty($real_version) ? '<td class="' . $real_class . '">' . $iv['real_ver'] . '</td>' : '') . '<td class="' . $_class . '">' . (empty($isCustom) ? $scripts[$iv['sid']]['ver'] : $iscripts[$iv['sid']]['ver']) . '</td>
		<td class="' . $class . '" align="center">' . (!empty($iv['eu_auto_upgrade']) ? '<img src="' . $theme['images'] . 'success.gif" hight="20px" width="20px" title="' . $l['auto_upgrade_enabled'] . '" style="cursor:pointer"/>' : '') . '
		<td class="' . $class . '">' . (empty($isCustom) ? $scripts[$iv['sid']]['ver'] != $iv['ver'] && file_exists($globals['softscripts'] . '/' . $scripts[$iv['sid']]['softname'] . '/upgrade.xml') : $iscripts[$iv['sid']]['ver'] != $iv['ver'] && file_exists($globals['softscripts'] . '/' . $iscripts[$iv['sid']]['softname'] . '/upgrade.xml') ? '<input type="checkbox" name="list[]" value="' . $__user . '-' . $ik . '" ' . (!empty($error) ? 'disabled=true' : '') . '/>' : '') . '</td>
			</tr>';
                        $i++;
                    }
                }
            }
            echo '
		</table>
		</div>
		<div id="autoupgrade_process" style="display:none"></div>
		<div id="goto_list_link" style="display:none" class="sai_heading"><center>' . $l['upgrading_completed'] . '&nbsp;&nbsp;<a href="' . $globals['ind'] . 'act=installations&show=upgrade' . '">' . $l['go_to_autoupgrade'] . '</a><center></div>
		
		<br /><br />
		<table cellpadding="0" cellspacing="0" width="100%" border="0">
		<tr>
			<td width="50%">&nbsp;</td> 
		</tr>
		<tr>
			<td align="right">';
            if (!isset($_REQUEST['upgrade_installation']) || !empty($real_version)) {
                echo $email_button;
            } else {
                echo '<div id="upgrade_ins_div2">' . $upgrade_ins_button . '</div>';
            }
            echo '</td>
		</tr>
		</table>';
            if (!empty($real_version)) {
                echo '<div class="notebox" style="width:95%;" id="beta_notice1">
					<table width="100%" cellpadding="5" cellspacing="1" border="0">
						<tr>
							<td width="25px">
								<div class="lirealver" style="height:16px;width:16px"></div>
							</td>
							<td><font class="bboxtxt">' . $l['real_ver_notice'] . '</font></td>
						</tr>
						<tr>
							<td width="25px">
								<div class="lioutdated" style="height:16px;width:16px"></div>
							</td>
							<td><font class="bboxtxt">' . $l['latest_ver_notice'] . '</font></td>
						</tr>
					</table>
				</div>';
            }
            echo '</form>';
        }
    }
    softfooter();
}
Пример #15
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();
}
Пример #16
0
function addplans_theme()
{
    global $theme, $globals, $user, $l, $langs, $error, $reseller, $iscripts, $plans, $done, $_cpplan, $_users, $allcatwise, $_resellers, $loaded_scripts, $softpanel;
    softheader($l['<title>']);
    echo '<br /><form accept-charset="' . $globals['charset'] . '" name="addplan" method="post" action="">
<div class="sai_heading" align="center"><img src="' . $theme['images'] . 'admin/addplan.gif" />&nbsp; ' . $l['title'] . '</div>
<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" /><br /><br /><br />' . (empty($globals['lictype']) ? '<div class="sai_notebox">' . $l['feature_not_available'] . '</div>' : '') . '<br />';
    error_handle($error);
    if (!empty($done)) {
        echo '<div class="sai_notice"><img src="' . $theme['images'] . 'success.gif" /> &nbsp; ' . $l['done'] . '</div><br />';
    }
    echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
ids = new Array("' . implode('", "', array_keys($_users)) . '");

function checkalluser(checker){
	for(x in ids){
		$_("users_"+ids[x]).checked = checker.checked;
		changebg(ids[x], "users_");
	}
};

ids1 = new Array(' . implode(', ', array_keys($iscripts)) . ');
function checkallsoftware(checker){	
	for(x in ids1){
		$_("scripts_"+ids1[x]).checked = checker.checked;
		
		//change td background color
		changebg(ids1[x],"scripts_");
	}	
};

ids2 = new Array("' . implode('", "', array_keys($_resellers)) . '");
function checkallreseller(checker){	
	for(x in ids2){
		$_("resellers_"+ids2[x]).checked = checker.checked;
		changebg(ids2[x], "resellers_");
	}
};

ids3 = new Array("' . implode('", "', array_keys($_cpplan)) . '");
function checkallcpplan(checker){	
	for(x in ids3){
		$_("cpplan_"+ids3[x]).checked = checker.checked;
		changebg(ids3[x], "cpplan_");
	}	
};

function selectchkbox(id,type){
	if($_(type+id).checked){
		$_(type+id).checked = false;
	}else{
		$_(type+id).checked = true;
	}
	
	//change td background color
	changebg(id,type);
}

function changebg(id,type){
	try{
		if($_(type+id).checked){
			$("#td_"+id).css({ backgroundColor: "#C5EAFF" });
			$("#td_"+id).css({boxShadow: "0 0 4px #3EA0DC"});
			
		}else{
			$_("td_"+id).style.background = "#ffffff";
			$("#td_"+id).css({boxShadow: "0 0 4px #FFF"});
		}
	}catch(e){}
};

function checkall(){
	
	// for users
	for(x in ids){	
		changebg(ids[x],"users_");
	}
	
	// for scripts
	for(x in ids1){	
		changebg(ids1[x],"scripts_");
	}
	
	// for scripts
	for(x in ids2){	
		changebg(ids2[x],"resellers_");
	}
	// for scripts
	for(x in ids3){	
		changebg(ids3[x],"cpplan_");
	}	
};

addonload("checkall();");
// ]]></script>';
    /*  $reseller $user*/
    echo '<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_reviewform">
	<tr>
	<td colspan="2">
		<table class="sai_ribboneffect" width="107%" style="left:-21px;" border="0"> 
			<tr>
				<td width="2%"></td>
				<td valign="top"><br />
					<font class="sai_ribbonhead" style="color:#FFF;"><b>' . $l['planhead'] . '</b></font> 
				</td>
			</tr>
		</table>
	</td>
	</tr>
	<tr>
		<td width="35%">
			<span class="sai_head">' . $l['planname'] . '</span><br />
			<span class="sai_exp2">' . $l['exp_plan'] . '</span>
		</td>
		<td valign="top">' . (defined('SOFTRESELLER') ? 'reseller_' . SOFTRESELLER . '_' : '') . '
			<input type="text" name="planname" size="40" value="' . POSTval('planname', '') . '">
		</td>
	</tr>';
    if (!defined('SOFTRESELLER')) {
        echo '<tr>
		<td colspan="2">
			<span class="sai_exp2">' . $l['default_plan_note'] . '</span><br />
		</td>
	</tr>';
    }
    echo '</table><br /><br />';
    // Are there control panel plans
    if (!empty($_cpplan)) {
        echo '<table width="721" cellpadding="6" cellspacing="0" border="0" style="margin:0px auto;" class="sai_divroundshad">
				<tr>
					<td colspan="2">
						<table class="sai_ribboneffect" width="107%" style="left:-21px;" border="0"> 
							<tr>
								<td width="2%"></td>
								<td valign="top"><br />
									<font class="sai_ribbonhead" style="color:#FFF;"><b>' . $l['cpanelplan'] . '</b></font>
								</td>
							</tr>
					</table>
				</td>
			</tr>
		<tr>
			<td colspan="2">
			<span>' . $l['cpplanselect'] . '</span><br /><br />
			<span class="sai_exp2">' . $l['select_all'] . '<input type="checkbox" onclick="checkallcpplan(this);" /></span>&nbsp;
			<span class="sai_exp2">' . $l['overwrite_settings'] . '<input type="checkbox" name="cpplansetting"/></span>
			</td>
		</tr>
		<tr>
			<td colspan="2">
			<table width="100%" cellpadding="10" cellspacing="1" border="0">';
        $i = 0;
        foreach ($_cpplan as $k => $v) {
            if (is_int($i / 4)) {
                echo '<tr>';
            }
            echo '<td id="td_' . $k . '" valign="top" >
						<input type="checkbox" id="cpplan_' . $k . '" name="cpplan_' . $k . '" ' . POSTchecked('cpplan_' . $k, '') . ' onclick="changebg(\'' . $k . '\',\'cpplan_\');" />
				<a href="javascript:void(0)" style="text-decoration: none; " onclick="selectchkbox(\'' . $k . '\',\'cpplan_\');"><font class="sai_bboxtxt">' . $v['original_key'] . '</font></a></td>';
            $i++;
            if (is_int($i / 4)) {
                echo '</tr>';
            }
        }
        echo '</table>
			</td>
			</tr>
		</table><br /><br />';
    }
    if (!defined('SOFTRESELLER') && method_exists('softpanel', 'listresellers')) {
        echo '<table width="721" cellpadding="6" cellspacing="0" border="0" style="margin:0px auto;" class="sai_divroundshad">
				<tr>
					<td colspan="2">
						<table class="sai_ribboneffect" width="107%" style="left:-21px;" border="0"> 
							<tr>
								<td width="2%"></td>
								<td valign="top"><br />
									<font class="sai_ribbonhead" style="color:#FFF;"><b>' . $l['resellerselect'] . '</b></div>
								</td>
							</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td colspan="2">
				<span>' . $l['exp_resellerselect'] . '</span><br /><br />
				<span class="sai_exp2">' . $l['select_all'] . '<input type="checkbox" onclick="checkallreseller(this);" /></span>&nbsp;
				<span class="sai_exp2">' . $l['overwrite_settings'] . '<input type="checkbox" name="resellersetting"/></span>
				</td>
			</tr>
			<tr>
				<td colspan="2">
				<table width="100%" cellpadding="5" cellspacing="1">';
        $i = 0;
        foreach ($_resellers as $k => $v) {
            if (is_int($i / 4)) {
                echo '<tr>';
            }
            echo '<td id="td_' . $k . '"><input type="checkbox" id="resellers_' . $k . '" name="resellers_' . $k . '" ' . POSTchecked('resellers_' . $k, '') . ' onclick="changebg(\'' . $k . '\',\'resellers_\');"/><img src="' . $theme['images'] . 'reseller15.png" style="margin-bottom:4px;>&nbsp;<a href="javascript:void(0)" style="text-decoration: none; " onclick="selectchkbox(\'' . $k . '\',\'resellers_\');"><font class="sai_bboxtxt">' . $k . '</font></a></td>';
            $i++;
            if (is_int($i / 4)) {
                echo '</tr>';
            }
        }
        echo '</table>
				</td>
			</tr>
			</table><br /><br />';
    }
    echo '<table width="721" cellpadding="6" cellspacing="0" border="0" style="margin:0px auto;" class="sai_divroundshad">
			<tr>
				<td colspan="2">
					<table class="sai_ribboneffect" width="107%" style="left:-21px;" border="0"> 
						<tr>
							<td width="2%"></td>
							<td valign="top"><br />
								<font class="sai_ribbonhead" style="color:#FFF;"><b>' . $l['userselect'] . '</b></div>
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td colspan="2">
				<span>' . $l['exp_userselect'] . '</span><br /><br />
				<span class="sai_exp2">' . $l['select_all'] . '<input type="checkbox" onclick="checkalluser(this);" /></span>
				<span class="sai_exp2">' . $l['overwrite_settings'] . '<input type="checkbox" name="usersetting" /></span>
				</td>
			</tr>
			<tr>
				<td colspan="2">
				<table width="100%" cellpadding="10" cellspacing="1" border="0">';
    $i = 0;
    foreach ($_users as $k => $v) {
        if (is_int($i / 4)) {
            echo '<tr>';
        }
        echo '<td id="td_' . $k . '" valign="top">
						<input type="checkbox" id="users_' . $k . '" name="users_' . $k . '" ' . POSTchecked('users_' . $k, '') . ' onclick="changebg(\'' . $k . '\',\'users_\');" />
						<img src="' . $theme['images'] . 'user15.png" style="margin-bottom:4px;"> <a href="javascript:void(0)" style="text-decoration: none; " onclick="selectchkbox(\'' . $k . '\',\'users_\');"><font class="sai_bboxtxt">' . $v['original_key'] . '</font></a></td>';
        $i++;
        if (is_int($i / 4)) {
            echo '</tr>';
        }
    }
    echo '</table>
				</td>
			</tr>
			</table><br /><br />
	
	<table width="721" cellpadding="6" cellspacing="0" border="0" style="margin:0px auto;" class="sai_divroundshad">
	<tr>
		<td colspan="2">
			<table class="sai_ribboneffect" width="107%" style="left:-21px;" border="0"> 
				<tr>
					<td width="2%"></td>
					<td valign="top"><br />
						<font class="sai_ribbonhead" style="color:#FFF;"><b>' . $l['scriptselect'] . '</b></div>
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td colspan="2">
		<span>' . $l['exp_scriptselect'] . '</span><br /><br />
		<span class="sai_exp2">' . $l['select_all'] . '<input type="checkbox" onclick="checkallsoftware(this);" /></span>
		</td>
	</tr>
	
	<tr>
		<td colspan="2">
			<table width="100%" cellpadding="5" cellspacing="1" border="0">';
    //r_print($allcatwise);
    //Showing All scripts Category wise
    foreach ($allcatwise as $ak => $av) {
        if (empty($allcatwise[$ak])) {
            continue;
        }
        echo '<tr>
					<td colspan="4"><center class=ribbonhead><b>' . strtoupper($ak) . ' Apps</b></center></td>
				</tr>';
        foreach ($av as $kk => $vv) {
            if (empty($av[$kk])) {
                continue;
            }
            echo '<tr>
							 <td colspan="2">
								<div class="sai_ribbonhead">' . $l['cat_' . $ak . '_' . $kk] . '</div>
								<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" />
							</td>
							</tr>';
            $i = 0;
            foreach ($vv as $k => $v) {
                if (is_int($i / 4)) {
                    echo '<tr>';
                }
                echo '<td width="20%">
						<table width="100%" border="0" id="td_' . $k . '">
						<tr>
						<td width="10%">
							<input type="checkbox" id="scripts_' . $k . '" name="scripts_' . $k . '" ' . POSTchecked('scripts_' . $k, '') . '  onclick="changebg(\'' . $k . '\',\'scripts_\');"/>
						</td>
						<td width="15%">
							<div class="sp20_' . $v['softname'] . '"></div>
						</td>
						<td>
							<a href="javascript:void(0)" style="text-decoration: none; " onclick="selectchkbox(\'' . $k . '\',\'scripts_\');" ><font class="sai_bboxtxt">' . $v['name'] . '</font></a>
						</td>
						</tr>
						</table>
						</td>';
                $i++;
                if (is_int($i / 4)) {
                    echo '</tr>';
                }
            }
        }
    }
    echo '</table></td>
	</tr>
</table>

<p align="center"><input type="submit" name="saveplan" value="' . $l['saveplan'] . '" class="sai_graybluebut"  ></p>' . (empty($globals['lictype']) ? '<div class="sai_notebox">' . $l['feature_not_available'] . '</div>' : '') . '<br />
</form>';
    softfooter();
}
Пример #17
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();
}
Пример #18
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();
}
Пример #19
0
function install_cert_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $error, $done, $domain_list, $install_list, $detailkey, $done, $detail;
    // For delete
    if (optGET('ajaxdel')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        if (!empty($done)) {
            echo '1' . $l['delete'];
            showcert();
            return true;
        }
    }
    // For detail
    if (optGET('ajaxdetail')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        if (!empty($done)) {
            return true;
        }
    }
    softheader($l['<title>']);
    error_handle($error, '100%');
    if (!empty($done)) {
        echo '<div class="sai_success">' . $done . '</div>';
    }
    echo '<center class="sai_tit"><img src="' . $theme['a_images'] . 'install_cert.gif" />&nbsp;' . $l['lbl_head'] . '</center>
	<div id="showrectab">';
    showcert();
    echo '<br/></div>
	</div><br /><br />
	<form accept-charset="' . $globals['charset'] . '" action="" method="post" enctype="multipart/form-data" id="editformuplode">
		<table border="0" cellpadding="8" cellspacing="8" width="700px" align="center" class="sai_divroundshad"  style="padding:15px; ">
			<tr>
				<td >
					<span class="sai_head">' . $l['domain'] . '</span><br />
				</td>	
				<td valign="middle">
					<select class="input" name="selectdomain" id="selectdomain" onchange="disp_type(this.value)">';
    foreach ($domain_list as $key => $value) {
        echo '<option value=' . $key . '>' . $key . '</option>';
    }
    echo '</select>&nbsp; &nbsp; &nbsp; 
				<input type="button" name="fatch_data" style="cursor:pointer" value="' . $l['fatch_button'] . '" class="sai_graybluebut" id="fatchdata"/>&nbsp; &nbsp;<img id="createcron" src="' . $theme['images'] . 'progress.gif" style="display:none">
				</td>
				
			</tr>	
			
			<tr>
				<td valign="top">
					<span class="sai_head">' . $l['paste_key'] . '</span>					
				</td>		
				<td> 
					<textarea name="kpaste" id="kpaste" rows="15" cols="70" wrap="off"></textarea>					
				</td>
			</tr>
			<tr>
				<td valign="top">
					<span class="sai_head">' . $l['paste_crt'] . '</span>					
				</td>		
				<td> 
					<textarea name="cpaste" id="cpaste" rows="15" cols="70" wrap="off"></textarea>
				</td>
			</tr>
			<tr>
				<td valign="top">
					<span class="sai_head">' . $l['paste_ca'] . '</span>					
				</td>		
				<td> 
					<textarea name="bpaste" id="bpaste" rows="15" cols="70" wrap="off"></textarea>
				</td>
			</tr>			
			<tr>
				<td>
					<span class="sai_head">' . $l['use_for_panel'] . '</font></span><br/><span class="sai_exp">' . $l['exp_use_for_panel'] . '</span>
				</td>
				<td>
					<input type="checkbox" name="ispanel" id="ispanel" ' . POSTchecked('ispanel', false) . '>
				</td>
			</tr>				
			<tr>
			<td colspan="2">
				<p align="center">
					<input type="submit" name="install_key" style="cursor:pointer" value="' . $l['install_button'] . '" class="sai_graybluebut" id="instkey"/> 
				</p>
			</td>
		</tr>			
		</table>		
	</form>
	<script language="javascript" type="text/javascript"><!-- // --><![CDATA[	
	
	var message_box = function(){			
			return{
				show_message: function(title, body , image) {			
					var okbutton = \'<input  style="width:75px" class="sai_graybluebut" 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($(jQuery.browser.webkit ? "body": "html")).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 );
					}
				},
				delete_message: function(title, body ,did) {			
					var yesbutton = \'<input type="button" style="width:75px" onclick="message_box.yes_close_message(\\\'\'+did+\'\\\');" value="YES" class="sai_graybluebut"/>\';
					var nobutton = \'<input type="button" style="width:75px" onclick="message_box.no_close_message();" value="NO" class="sai_graybluebut" />\';
					var img = \'<img src="' . $theme['images'] . 'remove_big.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 height="60%" ><td rowspan="2" width="40%" > \'+ img + \'</td><td width="60%" class ="msg_tr1" height="10%">\' +  title + \'</td></tr><tr ><td style="text-align:left" height="60%" cellpading="2" class ="msg_tr2">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3" >\' + yesbutton + \'&nbsp; &nbsp; \' + nobutton + \'</td></tr></table></div>\';				
						jQuery(document.body).append( message );								
						jQuery(\'.sai_message_box\').css(\'top\', jQuery($(jQuery.browser.webkit ? "body": "html")).scrollTop() + 150);
						jQuery(\'.sai_message_box\').show(\'slow\');
					}else{
						var message = \' <table  border="0" cellpadding="8" width="100%" height="100%"><tr height="60%" ><td rowspan="2" width="40%">\'+ img +  \'</td><td widt="60%" class ="msg_tr1" height="10%">\' + title + \'</td></tr><tr><td style="text-align:left" height="60%" cellpading="2" class ="msg_tr2">\' + body + \'</td></tr><tr ><td colspan="2" class ="msg_tr3" >\' + yesbutton + \'&nbsp; &nbsp; \' + nobutton + \'</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\');
				},
				yes_close_message: function(did) {
					$(\'#did\'+did).attr("src","' . $theme['images'] . 'progress.gif");
					jQuery(\'.sai_message_box\').hide(\'fast\');					
					$.ajax({				
						type: "POST",				
						url: window.location+"&ajaxdel=1&delete_record="+did,				
						// checking for error
						success: function(data){
							var result = data.substring(0,1);					
							var msg = data.substring(1);
							if(result == "1"){
								var msg = data.substring(1,data.indexOf("<table"));
								var output = data.substring(data.indexOf("<table"));							
								message_box.show_message( "Delete ",msg,2);
								$("#showrectab").html(output);																																			
							}
							if(result == "0"){
								message_box.show_message( "Error ",msg,1);																																			
								$(\'#did\'+did).attr("src","' . $theme['images'] . 'remove.gif");																																		
							}
						},				
						error: function(request,error) {
							message_box.show_message("Error",\'' . $l['connect_error'] . '\',1);					
						}
					});					
				},
				no_close_message: function() {
					jQuery(\'.sai_message_box\').hide(\'fast\');			
				}
			}
		}();
		
		$(document).ready(function(){	
			$(".sai_altrowstable tr").mouseover(function(){
				var old_class = $(this).attr(\'class\');		
				$(this).attr("class", \'sai_tr_bgcolor\');		
				$(this).mouseout(function(){
				$(this).attr(\'class\', old_class);
				});
			});
			
			// For deleting record
			$(".delete").click(function() {	
				var did = $(this).attr(\'id\');
				did = did.substr(3);						
				message_box.delete_message (\'Warning\',\'' . $l['record_del_conf'] . '\',did);			
			});	
			
			
			// For creating DNS	
			$("#fatchdata").click(function(){
				var domain = $("#selectdomain").val();				
				$("#createcron").css("display", "");
				$("#kpaste").html("");
				$("#cpaste").html("");				
				$.ajax({
					type: "POST",
					url: window.location+"&ajaxdetail=1&detail_record="+domain,
					
					// Checking for error
					success: function(data){
						$("#createcron").css("display", "none");
						var result = data.substring(0,1);					
						var msg = data.substring(1);
						
						if(result == "0"){															
							message_box.show_message(\'Warning\',msg, 1);																																									
						}else{	
											
							var arr = data.split("webuzo-1");							
																										
							$("#kpaste").html(arr[0]);
							$("#cpaste").html(arr[1]);
						}
					},
					error: function() {
						$("#createcron").css("display", "none");
						message_box.show_message("Error",\'' . $l['connect_error'] . '\',1);						
					}															
				});		
														
			});	
						
		});	
		
		// Function for show host
		function disp_type(str){				
			$("#select_domain").val(str);			
		}
		
		// ]]></script>';
    softfooter();
}
Пример #20
0
function adddomain_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error;
    global $saved, $aefer;
    softheader($l['<title>']);
    echo '<div class="bg"><br />';
    echo '<form accept-charset="' . $globals['charset'] . '" name="addadomain" method="post" action="" class="form-horizontal">
	<div class="sai_main_head" style="width:100%;" align="center">' . $l['add_domain'] . '</div><hr>';
    error_handle($error, '100%');
    if (!empty($saved)) {
        echo '<div class="alert alert-warning">
			<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
			<center><img src="' . $theme['images'] . 'notice.gif" /> &nbsp; ' . $l['settings_saved'] . '</center>
		</div>';
    }
    echo '<div class="row">
		<div class="col-sm-5">
			<label for="domain" class="sai_head">' . $l['domain'] . '</label><br />
			<span class="sai_exp2">' . $l['domain_exp'] . '</span>
		</div>
		<div class="col-sm-7">
			<input type="text" name="domain" id="domain" class="form-control" value="' . POSTval('domain', '') . '" />
		</div>
	</div><br />
	
	<div class="row">
		<div class="col-sm-5">
			<label for="server_host" class="sai_head">' . $l['server_host'] . '</label>
			<span class="sai_exp">' . $l['server_host_exp'] . '</span>
		</div>
		<div class="col-sm-7">
			<input type="text" name="server_host" id="server_host" class="form-control" value="' . POSTval('server_host', '') . '" />
		</div>
	</div><br />';
    if (empty($globals['custom_handler'])) {
        echo '
		<div class="row">
			<div class="col-sm-5">
				<label for="protocol" class="sai_head">' . $l['protocol'] . '</label>
				<span class="sai_exp">' . $l['protocol_exp'] . '</span>
			</div>
			<div class="col-sm-7">
				<select name="protocol" class="form-control" id="protocol">
					<option value="ftp" ' . (isset($_POST['protocol']) && $_POST['protocol'] == 'ftp' ? 'selected="selected"' : '') . '>FTP</option>
					<option value="ftps" ' . (isset($_POST['protocol']) && $_POST['protocol'] == 'ftps' ? 'selected="selected"' : '') . '>FTPS</option>
					<option value="sftp" ' . (isset($_POST['protocol']) && $_POST['protocol'] == 'sftp' ? 'selected="selected"' : '') . '>SFTP</option>
				</select>
			</div>
		</div><br />';
    }
    echo '
	<div class="row">
		<div class="col-sm-5">
			<label for="port" class="sai_head">' . $l['port'] . '</label>
			<span class="sai_exp">' . $l['port_exp'] . '</span>
		</div>
		<div class="col-sm-7">
			<input type="text" name="port" id="port" class="form-control" value="' . POSTval('port', '') . '" />
		</div>
	</div><br />
	
	<div class="row">
		<div class="col-sm-5">
			<label for="ftp_user" class="sai_head">' . $l['ftp_user'] . '</label>
			<span class="sai_exp">' . $l['ftp_user_exp'] . '</span>
		</div>
		<div class="col-sm-7">
			<input type="text" name="ftp_user" id="ftp_user" class="form-control" value="' . POSTval('ftp_user', '') . '" />
		</div>
	</div><br />
	
	<div class="row" id="ftp_pass">
		<div class="col-sm-5">
			<label for="ftp_pass" class="sai_head">' . $l['ftp_pass'] . '</label>
			<span class="sai_exp">' . $l['ftp_pass_exp'] . '</span>
		</div>
		<div class="col-sm-7">
			<input type="text" name="ftp_pass" id="ftp_pass" class="form-control" value="' . POSTval('ftp_pass', '') . '" /><br />
		</div>
	</div>
	
	<div class="row" id="trauthpass">
		<div class="col-sm-5">
			<label for="auth_password" class="sai_head">' . $l['auth_password'] . '</label>
			<span class="sai_exp">' . $l['auth_password_exp'] . '</span>
		</div>
		<div class="col-sm-7">
			<input type="checkbox" name="auth_password" id="auth_password" ' . POSTchecked('auth_password', true) . ' /><br /><br />
		</div>
	</div>
	
	<div class="row" id="pub">
		<div class="col-sm-5">
			<label for="public_key" class="sai_head">' . $l['public_key'] . '</label>
			<span class="sai_exp">' . $l['public_key_exp'] . '</span>
		</div>
		<div class="col-sm-7">
			<input type="text" name="public_key" id="public_key" class="form-control" value="' . POSTval('public_key', '') . '" /><br />
		</div>
	</div>
	
	<div class="row" id="pri">
		<div class="col-sm-5">
			<label for="private_key" class="sai_head">' . $l['private_key'] . '</label>
			<span class="sai_exp">' . $l['private_key_exp'] . '</span>
		</div>
		<div class="col-sm-7">
			<input type="text" name="private_key" id="private_key" class="form-control" value="' . POSTval('private_key', '') . '" /><br />
		</div>
	</div>
	
	<div class="row" id="passphrase">
		<div class="col-sm-5">
			<label for="passphrase" class="sai_head">' . $l['passphrase'] . '</label>
			<span class="sai_exp">' . $l['passphrase_exp'] . '</span>
		</div>
		<div class="col-sm-7">
			<input type="text" name="passphrase" id="passphrase" class="form-control" value="' . POSTval('passphrase', '') . '" /><br />
		</div>
	</div>
	
	<div class="row">
		<div class="col-sm-5">
			<label for="ftp_path" class="sai_head">' . $l['ftp_path'] . '</label><br />
			<span class="sai_exp2">' . $l['ftp_path_exp'] . '</span>
		</div>
		<div class="col-sm-7">
			<input type="text" name="ftp_path" id="ftp_path" class="form-control" value="' . POSTval('ftp_path', '') . '" />
		</div>
	</div><br />
	
	<div class="row">
		<div class="col-sm-5">
			<label for="backup_path" class="sai_head">' . $l['backup_path'] . '</label><br />
			<span class="sai_exp2">' . $l['backup_path_exp'] . '</span>
		</div>
		<div class="col-sm-7">
			<input type="text" name="backup_path" id="backup_path" class="form-control" value="' . POSTval('backup_path', '') . '" />
		</div>
	</div><br />
	
	<div class="row">
		<div class="col-sm-5">
			<label for="data_dir" class="sai_head">' . $l['data_dir'] . '</label><br />
			<span class="sai_exp2">' . $l['data_dir_exp'] . '</span>
		</div>
		<div class="col-sm-7">
			<input type="text" name="data_dir" id="data_dir" class="form-control" value="' . POSTval('data_dir', '') . '" />
		</div>
	</div><br />

	<br /><br />
	<p align="center">
	<input class="flat-butt" type="submit" name="add_domain" value="' . $l['submit_add'] . '" />
	<br /><br /><br /><br />
	<b><a class="sai_head" href="' . $globals['ind'] . 'act=domains">' . $l['show_all_dom'] . '</a></b>
	</p>
	</form>
</div>';
    echo ' <br /><br />
<script language="javascript" type="text/javascript"><!-- // --><![CDATA[

$(document).ready(function(){
	checkprotocol();
	$(\'#auth_password\').change(function(){
		if($(this).is(":checked")) {
			hide_pubkey();
		}else{
			show_pubkey();
		}
	});
	
	$(\'#protocol\').change(function(){
		checkprotocol();
	});
});

function checkprotocol(){
	if($(\'#protocol\').val() == \'ftp\'){
		if($(\'#port\').val() == ""){
			$(\'#port\').val(\'21\');
		}
		$(\'#trauthpass\').hide();
		hide_pubkey();
		ftppath();
	}
	if($(\'#protocol\').val() == \'ftps\'){
		if($(\'#port\').val() == ""){
			$(\'#port\').val(\'21\');
		}
		$(\'#trauthpass\').hide();
		hide_pubkey();
		ftppath();
	}
	if($(\'#protocol\').val() == \'sftp\'){
		if($(\'#port\').val() == ""){
			$(\'#port\').val(\'22\');
		}
		$(\'#trauthpass\').show();
		if($(\'#auth_password\').is(":checked")){
			hide_pubkey();
		}else{
			show_pubkey();
		}
		sftppath();
	}
}

function hide_pubkey(){
	$(\'#public_key\').prop(\'disabled\', true);
	$(\'#private_key\').prop(\'disabled\', true);
	$(\'#pub\').hide();
	$(\'#pri\').hide();
	$(\'#passphrase\').hide();
	$(\'#ftp_pass\').show();
}

function show_pubkey(){
	$(\'#public_key\').prop(\'disabled\', false);
	$(\'#private_key\').prop(\'disabled\', false);
	$(\'#pub\').show();
	$(\'#pri\').show();
	$(\'#passphrase\').show();
	$(\'#ftp_pass\').hide();
}

function ftppath(){
	$(\'#ftp_path\').html("' . $l['ftp_path'] . '");
	$(\'#ftp_path_exp\').html("' . $l['ftp_path_exp'] . '");
	$(\'#backup_path_exp\').html("' . $l['backup_path_exp'] . '");
}

function sftppath(){
	$(\'#ftp_path\').html("' . $l['sftp_path'] . '");
	$(\'#ftp_path_exp\').html("' . $l['sftp_path_exp'] . '");
	$(\'#backup_path_exp\').html("' . $l['sbackup_path_exp'] . '");
}

// ]]></script>
<!--<center>
<h2>How to Add a Domain</h2>
<object width="450" height="345" align="center">
<param name="movie" value="Add Domain">
<embed src="../theme/videos/add_domain/video.swf" width="450" height="345">
</embed>
</object>
</center>-->';
    softfooter();
}
Пример #21
0
function email_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error, $saved;
    // For email settings
    if (optGET('ajax_email')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        if (!empty($saved)) {
            echo '1' . $l['settings_saved'];
            return true;
        }
    }
    softheader($l['<title>']);
    echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[

	var message_box = function(){			
			return {
				show_message: function(title, body , image) {			
					var okbutton = \'<input  style="width:75px; margin-top:5px; background:#00A0D2; color:#FFF;" 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="30%" > \'+ img + \'</td><td width="70%" class ="msg_tr1">\' +  title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2">\' + 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="30%">\'+ img +  \'</td><td widt="70%" class ="msg_tr1">\' + title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td colspan="2">\' + okbutton + \'</td></tr></table>\';				
						jQuery(\'.sai_message_box\').css(\'top\', jQuery(\'html, body\').scrollTop() + 150);
						jQuery(\'.sai_message_box\').show(\'slow\');
						jQuery(\'.sai_message_box\').html( message );
					}
				},
				close_message: function() {
					jQuery(\'.sai_message_box\').hide(\'fast\');
				}
			}
		}();

	$(document).ready(function(){
			
		// For email settings
		$("#editform").submit(function(){
			
			$("#create_email").css("display", "");
			
			$.ajax({
				type: "POST",
				url: window.location+"&ajax_email=1",					
				data: $("#editform").serialize(),
				
				// Checking for error
				success: function(data){
					$("#create_email").css("display", "none");
					var result = data.substring(0,1);
					if(result == "1"){
						var msg = data.substring(1);
						message_box.show_message( "Done ",msg,2);																					
					}
					if(result == "0"){
						var msg = data.substring(1);
						message_box.show_message( "Error",msg,1);
					}
				},
				error: function() {
					message_box.show_message("Error", "Oops ... the connection was lost", 1);
				}													
			});
			
			return false;
														
		});	
	});
	// ]]></script>';
    echo '<form accept-charset="' . $globals['charset'] . '" name="editemailsettings" method="post" action="" id="editform" class="form-horizontal">
<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:0px 10px 0 0; text-align:right;">
			<i class="fa sai-mail fa-2x" style="color:#00A0D2;"></i>
		</div>
		<div class="col-sm-6 col-xs-7" style="padding-top:5px; padding-left:0px; text-align:left;">' . $l['emailsettings'] . '</div>
	</div><hr>';
    error_handle($error);
    if (!empty($saved)) {
        echo '<div class="alert alert-success">' . $l['settings_saved'] . '</div>';
    }
    echo '
	<div class="row">
		<div class="col-sm-5">
			<label  for="email" class="sai_head">' . $l['email_address'] . '</label>
			<span class="sai_exp">' . $l['email_exp'] . '</span>
		</div>
		<div class="col-sm-7">
			<input type="text" id="email" name="email" class="form-control" size="30" value="' . POSTval('email', $user['email']) . '" softmail="true">
		</div>
	</div><br /><!---row end--->';
    // If admin has disabled installation email than dont show.
    if (empty($globals['off_install_mail'])) {
        echo '<div class="row">
				<div class="col-sm-5">
					<label class="sai_head">' . $l['ins_email'] . '</label>
					<span class="sai_exp">' . $l['ins_email_exp'] . '</span>
				</div>
				<div class="col-sm-7">
					<input type="checkbox" id="ins_email" name="ins_email" ' . POSTchecked('ins_email', $user['ins_email']) . ' />
				</div>
			</div><br />';
    }
    // If admin has disabled remove email than dont show.
    if (empty($globals['off_remove_mail'])) {
        echo '<div class="row">
				<div class="col-sm-5">
					<label class="sai_head">' . $l['rem_email'] . '</label>
					<span class="sai_exp">' . $l['rem_email_exp'] . '</span>
				</div>
				<div class="col-sm-7">
					<input type="checkbox" id="rem_email" name="rem_email" ' . POSTchecked('rem_email', $user['rem_email']) . ' />
				</div>
			</div><br />';
    }
    // If admin has disabled edit email than dont show.
    if (empty($globals['off_edit_mail'])) {
        echo '<div class="row">
				<div class="col-sm-5">
					<label class="sai_head">' . $l['editdetail_email'] . '</label>
					<span class="sai_exp">' . $l['editdetail_email_exp'] . '</span>
				</div>
				<div class="col-sm-7">
					<input type="checkbox" id="editdetail_email" name="editdetail_email" ' . POSTchecked('editdetail_email', $user['editdetail_email']) . ' />
				</div>
			</div><br />';
    }
    // If admin has disabled backup email than dont show.
    if (empty($globals['off_backup_mail']) && empty($globals['disable_backup_restore'])) {
        echo '<div class="row">
				<div class="col-sm-5">
					<label class="sai_head">' . $l['backup_email'] . '</label>
					<span class="sai_exp">' . $l['backup_email_exp'] . '</span>
				</div>
				<div class="col-sm-7">
					<input type="checkbox" id="backup_email" name="backup_email" ' . POSTchecked('backup_email', $user['backup_email']) . ' />
				</div>
			</div><br />';
    }
    // Restore email settings
    if (empty($globals['off_restore_mail'])) {
        echo '<div class="row">
				<div class="col-sm-5">
					<label class="sai_head">' . $l['restore_email'] . '</label>
					<span class="sai_exp">' . $l['restore_email_exp'] . '</span>
				</div>
				<div class="col-sm-7">
					<input type="checkbox" id="restore_email" name="restore_email" ' . POSTchecked('restore_email', empty($user['disable_restore_email']) ? 1 : 0) . ' />
				</div>
			</div><br />';
    }
    // Clone email settings
    if (empty($globals['off_clone_mail'])) {
        echo '<div class="row">
				<div class="col-sm-5">
					<label class="sai_head">' . $l['clone_email'] . '</label>
					<span class="sai_exp">' . $l['clone_email_exp'] . '</span>
				</div>
				<div class="col-sm-7">
					<input type="checkbox" id="clone_email" name="clone_email" ' . POSTchecked('clone_email', empty($user['disable_clone_email']) ? 1 : 0) . ' />
				</div>
			</div><br />';
    }
    echo '<div class="row">
			<div class="col-sm-5">
				<label class="sai_head">' . $l['disable_all_notify_update'] . '</label>
				<span class="sai_exp">' . $l['disable_all_notify_update_exp'] . '</span>
			</div>
			<div class="col-sm-7">
				<input type="checkbox" id="disable_all_notify_update" name="disable_all_notify_update" ' . POSTchecked('disable_all_notify_update', $user['disable_all_notify_update']) . ' />
			</div>
		</div><br />
	
		<p align="center">
			<input type="hidden" name="editemailsettings" value="1" />
			<input type="submit" name="editsubmit" value="' . $l['edit_settings'] . '" class="flat-butt" /> <br /><img id="create_email" src="' . $theme['images'] . 'progress.gif" style="display:none">
		</p>
</form>
</div><br /><!--end of bg class-->';
    softfooter();
}
Пример #22
0
function restore_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error, $scripts, $_insid, $dbexist, $restored, $datadir, $wwwdir;
    global $backups, $deleted, $soft, $backupinfo;
    // 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($restored)) {
        echo '
			<div class="bg"><br />
				<div class="alert alert-warning">
					<center><img src="' . $theme['images'] . 'notice.gif" /> &nbsp; ' . $l['restore'] . '
					<center><b><a href="' . script_link($soft) . '&highlight=' . $backupinfo['insid'] . '&postact=restore"></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="restore" method="post" action="" onsubmit="return checkform();" id="restore">
				
					<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
					function checkform(dosubmit){
						var conf = confirm(\'' . $l['confirm_restore'] . '\');
						if(conf){
							$_("restorebtn").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;
						}else{
							return false;
						}
					}	
					
					var progressbar = {
						timer: 0,
						total_width: 0,	
						status_key: "",
						synctimer: 0,
						fadeout_div: "#fadeout_div",
						win_div: "#install_win",
						progress_div: "#progress_bar",
						formid: "#restore",
						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");
									}
								}
							});
						}
					};
					
						
					// 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>
				
				
					<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-restore 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_restoring'] . $iscripts[$soft]['name'] . '</div>
						</div>
						<hr><br />';
        echo error_handle($error, "100%", 0, 1);
        echo '
						<div class="row">
							<div class="col-sm-5">
								<label class="sai_head">' . $l['restore_dir'] . '</label><br />
								<span class="sai_exp2">' . $l['restore_dir_exp'] . '</span>
							</div>
							<div class="col-sm-7">
								<input type="checkbox" name="restore_dir" ' . POSTchecked('restore_dir', true) . ' />
							</div>
						</div><br />';
        // Web directory ?
        if (!empty($wwwdir)) {
            echo '
							<div class="row">
								<div class="col-sm-5">
									<label class="sai_head">' . $l['restore_wwwdir'] . '</label><br />
									<span class="sai_exp2">' . $l['restore_wwwdir_exp'] . '</span>
								</div>
								<div class="col-sm-7">
									<input type="checkbox" name="restore_wwwdir" ' . POSTchecked('restore_wwwdir', true) . ' />
								</div>
							</div><br />';
        }
        // Data directory ?
        if (!empty($datadir)) {
            echo '
							<div class="row">
								<div class="col-sm-5">
									<label class="sai_head">' . $l['restore_datadir'] . '</label><br />
									<span class="sai_exp2">' . $l['restore_datadir_exp'] . '</span>
								</div>
								<div class="col-sm-7">
									<input type="checkbox" name="restore_datadir" ' . POSTchecked('restore_datadir', true) . ' />
								</div>
							</div><br />';
        }
        if (!empty($dbexist)) {
            echo '
							<div class="row">
								<div class="col-sm-5">
									<label class="sai_head">' . $l['restore_db'] . '</label><br />
									<span class="sai_exp2">' . $l['restore_db_exp'] . '</span>
								</div>
								<div class="col-sm-7">
									<input type="checkbox" name="restore_db" ' . POSTchecked('restore_db', true) . ' />
								</div>
							</div><br />';
        }
        echo '<br /><br />
						<p align="center">
							<input type="hidden" name="restore_ins" value="1" />
							<input type="hidden" name="soft_status_key" id="soft_status_key" value="' . POSTval('soft_status_key', generateRandStr(32)) . '" />
							<input type="submit" name="restorebtn" class="flat-butt" id="restorebtn" value="' . $l['restore_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">
					<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-restore 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_restoring'] . $iscripts[$soft]['name'] . '</div>
						</div><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 />
					<center><b><a href="' . script_link($soft) . '">' . $l['return'] . '</a></b></center><br /><br />
				</div>
			</div><br /><br />';
    }
    echo '
	</div>';
    softfooter();
}
Пример #23
0
function choosesoftwares_theme()
{
    global $theme, $globals, $user, $l, $langs, $skins, $error, $saved, $iscripts, $scripts, $catscripts, $allcatwise, $_iscripts, $cscripts;
    softheader($l['<title>']);
    echo '<div class="sai_heading" align="center">' . $l['gen_scripts'] . '</div>
<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" /><br /><br />';
    error_handle($error);
    if (!empty($saved)) {
        //r_print($_iscripts);
        echo '<br /><table class="sai_notice" width="100%" border="0">
					<tr>
						<td width="40%" align="right">
							<img src="' . $theme['images'] . 'notice.gif" alt="" />&nbsp;&nbsp;&nbsp;
						</td>
						<td align="left" class="sai_bboxtxt">' . $l['settings_saved'] . '<br />
						</td>
					</tr>
				</table>
	<table width="97%" style="margin:0px auto;" >
	<tr>
	<td>
		<div id="responses">
			<div class="sai_heading"><img src="' . $theme['images'] . 'admin_progress.gif" id="admin_progress">&nbsp;&nbsp;&nbsp;' . $l['updating_files'] . '</div>
			<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" /><br /><br />
		</div>
	</td>
	</tr>
	</table>';
        //The necessary JavaScripts
        echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
ids = [' . implode(', ', array_keys($_iscripts)) . '];
//alert(ids);
updatedids = new Object();

for(x in ids){
	updatedids["soft_"+ids[x]] = false;
}

function updatesoftware(id, resp){
	
	//Update the Status with Response
	if(id > 0){
		$_("responses").innerHTML = $_("responses").innerHTML + resp;
		updatedids["soft_"+id] = true;
	}

	for(x in ids){
		if(updatedids["soft_"+ids[x]] == false){
			AJAX("' . $globals['index'] . 'act=softwares&sact=updatesoft&softid="+ids[x], "updatesoftware("+ids[x]+", re)");
			return true;
		}
	}
	
	$_("responses").innerHTML = $_("responses").innerHTML + "<div class=\\"sai_heading\\">' . $l['updating_completed'] . '<a href=\\"' . $globals['ind'] . 'act=softwares' . '\\">' . $l['go_to_soft'] . '</a></div>";
	$("#admin_progress").hide();
	
};

addonload("updatesoftware(0, \'\');");

// ]]></script>';
        softfooter();
        return true;
    }
    //The necessary JavaScripts
    echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
ids = new Array(' . implode(', ', array_keys($scripts)) . ');
function checkallsoftware(checker){	
	try{
		for(x in ids){
			$_("soft_"+ids[x]).checked = checker.checked;
		}
	}catch(e){
		// Dont do anything
	}
		
};

function checkallpre(checker){	
	try{
		for(x in ids){
			$_("soft_pre_"+ids[x]).checked = checker.checked;
		}
	}catch(e){
		// Dont do anything
	}
		
};

function checkcatsoftware(checker, arr){
		
	$_(checker.id).checked = checker.checked;
	try{
		for(x in arr){
			$_("soft_"+arr[x]).checked = checker.checked;
		}	
	}catch(e){	
		//$_("soft_"+arr.length).checked = checker.checked;	
		// Dont do anything
	}
};

function checkcatpre(checker, arr){
	$_(checker.id).checked = checker.checked;
	//alert(arr);return;	
	try{
		for(x in arr){
			$_("soft_pre_"+arr[x]).checked = checker.checked;
		}	
	}catch(e){
		// Dont do anything
	}
};

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>';
    if (empty($globals['lictype'])) {
        echo '<div style="width:700px; margin:0px auto;" class="sai_notebox"><font class="sai_bboxtxt">' . $l['soft_free_note'] . '<br /></font></div>';
    }
    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>
<form accept-charset="' . $globals['charset'] . '" name="updatesoft" method="post" action="">
<br />
<link href="' . $globals['mirror_images'] . 'sprites/20.css" rel="stylesheet" type="text/css" />
<table width="723" cellpadding="1" cellspacing="0" border="0" style="margin:0px auto;">
<tr>
<td colspan="6" align="center">
<table width="100%" class="sai_divroundshad" style="padding:10px;" border="0">
<tr>
<td align="center">
	<font size="4" color="#182e7a">' . (count($iscripts) - count($cscripts)) . '/' . count($scripts) . '</font><font class="sai_bboxtxt"> ' . $l['scripts_are_ins'] . '</font> 
</td>';
    if (!empty($globals['lictype'])) {
        echo '<td><input type="submit" name="updatesoft" value="' . $l['updatesoft'] . '" class="sai_graybluebut"/></td>';
    }
    echo '<td><input type="checkbox" onclick="checkallsoftware(this);" /></td>
' . (empty($globals['pre_download_all']) ? '<td><input type="checkbox" onclick="checkallpre(this);" /></td>' : '') . '
</tr>
</table><br />
</td>
</tr>
<tr>
<td colspan="6">
<table width="100%" class="sai_purplegrad">
<td class="sai_head" width="20%"><b>' . $l['soft_name'] . '</b></td>
<td class="sai_head" width="50%"><b>' . $l['soft_desc'] . '</b></td>
<td class="sai_head" width="10%"><b>' . $l['soft_ins'] . ' ' . $l['soft_ver'] . '</b></td>
<td class="sai_head" width="10%"><b>' . $l['soft_ver'] . '</b></td>
<td class="sai_head" width="5%"><b>' . $l['soft_ins'] . '</b>' . (empty($globals['pre_download_all']) ? '<br /><b style="font-size:8px">' . $l['pre_down'] . '</b></td>' : '') . '
</tr>
</table>
</td>
</tr>
';
    foreach ($allcatwise as $cattype => $catscripts) {
        if (empty($catscripts)) {
            continue;
        }
        echo '<tr>
<td colspan="6" align="center">
<h2>' . $l['type_' . $cattype] . '</h2>
</td>
</tr>';
        foreach ($catscripts as $cat => $cv) {
            if (empty($cv)) {
                continue;
            }
            echo '<tr>
		<td>
		<table width="100%" border="0" class="sai_divroundshad" cellspacing="1" cellpadding="5">
			<tr>
				<td colspan="6">
					<table width="107%" border="0" class="sai_ribboneffect" style="left:-20px;">
						<tr>
							<td width="2%"></td>
							<td valign="top" width="650">
								<br /><font class="sai_bboxtxt" style="color:#FFF;"><b>' . $l['cat_' . $cattype . '_' . $cat] . '</b></font>
							</td>
							<td valign="top" width="' . (empty($globals['pre_download_all']) ? '30' : '77') . '"> 
								<br /><input type="checkbox" id="soft_' . $cat . '" name="soft_' . $cat . '" onclick="checkcatsoftware(this, (new Array(' . implode(',', array_keys($cv)) . ')));" />
							</td>';
            if (empty($globals['pre_download_all'])) {
                echo '<td valign="top" width="47"> 
									<br /><input type="checkbox" id="soft_pre_' . $cat . '" name="soft_pre_' . $cat . '" onclick="checkcatpre(this, (new Array(' . implode(',', array_keys($cv)) . ')));" />
								</td>';
            }
            echo '</tr>
					</table>
				</td>
			</tr>';
            $i = 0;
            foreach ($cv as $k => $v) {
                if ($k > 10000) {
                    continue;
                }
                echo '<tr class="' . ($i % 2 == 0 ? "sai_altrow" : "sai_naltrow") . '">
					<td width="17%" valign="top">
						<table width="100%" border="0">
							<tr>
								<td><div class="sp20_' . $v['softname'] . '"></div></td>
								<td class="sai_bboxtxt" align="left" width="90%">' . $v['name'] . '</td>
							</tr>
						</table>
					</td>
					<td width="54%" class="sai_bboxtxt">' . $v['desc'] . '</td>
					<td ' . (trim($v['cur_ver']) == trim($v['ver']) ? '' : 'style="background:#FDCFC4"') . ' width="10%" class="sai_bboxtxt">' . $v['cur_ver'] . '</td>
					<td width="10%" class="sai_bboxtxt">' . $v['ver'] . '</td>
					<td width="5%" class="sai_bboxtxt" align="center"><input type="checkbox" id="soft_' . $k . '" name="soft_' . $k . '" ' . POSTchecked('soft_' . $k, !empty($iscripts[$k])) . ' onmouseover="showtip(\'' . $l['soft_enable'] . ' ' . $scripts[$k]['name'] . '\', this)" /></td>
					' . (empty($globals['pre_download_all']) ? '<td width="5%" class="sai_bboxtxt" align="center"><input type="checkbox" id="soft_pre_' . $k . '" name="soft_pre_' . $k . '" ' . POSTchecked('soft_pre_' . $k, !empty($iscripts[$k]['pre_down'])) . ' onmouseover="showtip(\'' . $l['pre_down'] . ' ' . $scripts[$k]['name'] . '\', this)" /></td>' : '') . '
				</tr>';
                $i++;
            }
            echo '</table><br />';
        }
    }
    echo '</td></tr></table>';
    if (empty($globals['lictype'])) {
        echo '<div style="width:700px; margin:0px auto;" class="sai_notebox"><font class="sai_bboxtxt">' . $l['soft_free_note'] . '<br /></div>';
    } else {
        echo '<p align="center"><input type="submit" name="updatesoft" value="' . $l['updatesoft'] . '" class="sai_graybluebut" /></p>';
    }
    echo '</form>';
    softfooter();
}
Пример #24
0
function topscripts_theme()
{
    global $theme, $globals, $user, $l, $langs, $skins, $error, $saved, $categories, $iscripts, $scripts, $top, $top_selected, $reset_topscripts, $softpanel;
    softheader($l['<title>']);
    echo '<div class="sai_heading" align="center">' . $l['show_top_scripts'] . '</div>
<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" /><br /><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_topscripts)) {
        echo '<br /><div class="sai_success"><img src="' . $theme['images'] . 'success.gif" /> ' . $l['reset_topscripts_done'] . '</div><br />';
    }
    echo '
<script language="javascript">
	function reset_topscript(){
		var cnf = confirm("' . $l['resetscripts_warning'] . '");
		if(cnf){
			window.location = "' . $globals['index'] . 'act=topscripts&reset_topscripts=1";
		}
		return false;
	};
</script>';
    echo '<form accept-charset="' . $globals['charset'] . '" name="reordercat" method="post" action="">
<table cellpadding="0" cellspacing="0" border="0" style="width:720px; margin:0px auto;">
		<tr>
			<td colspan="2" align="center">
				<table cellpadding="8" cellspacing="0" border="0" class="sai_reviewform">
<tr>
<td width="60%"><br />
<span class="sai_head">' . $l['enable_apps'] . '</span><br />
<span class="sai_exp2">' . $l['enable_apps_exp'] . '</span>
</td>
<td valign="top"><br />
<input type="checkbox" name="enable_topscripts" ' . (!empty($globals['show_top_scripts']) ? "checked=checked" : "") . '>
</td>
</tr>';
    if (method_exists($softpanel, 'save_topscripts_index')) {
        echo '<tr>
<td>
<span class="sai_head">' . $l['show_top_scripts'] . '</span><br />
<span class="sai_exp2">' . $l['show_top_scripts_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="show_top_scripts" size="30" value="' . aPOSTval('show_top_scripts', $globals['show_top_scripts']) . '" />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['append_apps'] . '</span><br />
<span class="sai_exp2">' . $l['append_apps_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="append_apps" ' . POSTchecked('append_apps', $globals['append_apps']) . '>
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['disable_cats'] . '</span><br />
<span class="sai_exp2">' . $l['disable_cats_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="disable_cats" ' . POSTchecked('disable_cats', $globals['disable_cats']) . '>
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['enable_myins'] . '</span><br />
<span class="sai_exp2">' . $l['enable_myins_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="enable_myins" ' . POSTchecked('enable_myins', $globals['enable_myins']) . '>
</td>
</tr>';
        if ($globals['softpanel'] == 'cpanel') {
            echo '<tr>
<td>
<span class="sai_head">' . $l['show_in_notice'] . '</span><br />
<span class="sai_exp2">' . $l['show_in_notice_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="show_in_notice" ' . POSTchecked('show_in_notice', $globals['show_in_notice']) . '>
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['group_order'] . '</span><br />
<span class="sai_exp2">' . $l['group_order_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="group_order"  size="30" value="' . optPOST('group_order', $globals['group_order']) . '">
</td>
</tr>';
        }
    }
    echo '
</table><br /><br />
</td>
</tr>
<tr>
<td><br /><br />
<table cellpadding="15" cellspacing="0" border="0" class="sai_divroundshad" width="720">
<tr>
<td colspan="2"	>
<span class="sai_head" >' . $l['select_from_below'] . ' :</span>
</td>
</tr>

<tr>
<td>
<span class="sai_exp2">' . $l['select_top_scripts'] . ' :</span><br />
</td>
<td>
<span class="sai_exp2">' . $l['selected_top_scripts'] . ' :</span>
</td>
</tr>

<tr>
<td colspan="2">
<link href="' . $globals['mirror_images'] . 'sprites/32.css" rel="stylesheet" type="text/css" />

      <div class="formbox">        
        <div id="all_users">
           		';
    foreach ($top as $k => $v) {
        if ($k == $top_selected[$k]) {
            continue;
        }
        echo '<div id="user' . $k . '" sid="' . $k . '" class="innertxt">
						<table cellspacing="0" border="0" cellpadding="5"><tr>
						<td width="50" align="center" style="background-color:#FFFFFF"><div class="sp32_' . $iscripts[$k]['softname'] . '"></div><td>
						<td><strong>' . $iscripts[$k]['name'] . '</strong><td>
						</tr></table>
						<input type="hidden" id="select' . $k . '" class="selectit" />
						</div>
						';
    }
    echo '
            </div>
            <div style="width:100px; text-align:center; margin-left:20px; padding-top: 100px; width:75px; float:left;">
				<a href="javascript:void(0);" id="move_right">Right &raquo;</a><br /><br />
				<a href="javascript:void(0);" id="move_left">&laquo; Left</a>
            <div class="float_break"></div>   
            </div>
            <div id="selected_users">';
    if (count($top_selected) > 0) {
        foreach ($top_selected as $k => $v) {
            if (empty($iscripts[$k])) {
                continue;
            }
            echo '<div id="user' . $k . '" sid="' . $k . '" class="innertxt2">
						<table cellspacing="0" border="0" cellpadding="5"><tr>
						<td width="50" align="center" style="background-color:#FFFFFF"><div class="sp32_' . $iscripts[$k]['softname'] . '"></div><td>
						<td><strong>' . $iscripts[$k]['name'] . '</strong><td>
						</tr></table>
						<input type="hidden" id="select' . $k . '" class="selectit" />
					 </div>';
        }
    }
    echo '</div>
         </div>    
</td>
</tr>
<tr>
<td colspan="2">
	<div class="notebox" style="width:95%">
		<font class="bboxtxt"><b>' . $l['script_note'] . '</b> : <br />' . $l['script_note_exp'] . '</font>
	</div>
</td>
</tr>		  
</table>
</td>
</tr>
</table>

';
    echo ' 
<input type="hidden" name="hidden_selected" id="hidden_selected" />
<p align="center">
	<input type="submit" name="savescript" value="' . $l['savescript'] . '" class="sai_graybluebut" />&nbsp;
	<input type="button" name="reset_topscripts" value="' . $l['reset_topscripts'] . '" class="sai_graybluebut" onclick="reset_topscript();" />
</p>
' . (empty($globals['lictype']) ? '<div class="notebox" style="width:95%"><font class="bboxtxt">' . $l['soft_free_note'] . '</font></div>' : '') . '<br />
</form>';
    echo '
<script language="javascript">

	$(document).ready(function () {
		// Uncheck each checkbox on body load
		//$("#all_users .selectit").each(function() {this.checked = false;});
		//$("#selected_users .selectit").each(function() {this.checked = false;});
		
		//onload we have to save the PREVIOUS slected scripts
		var scripts = "";
		$("#selected_users .innertxt2").each(function() {
			var s_id = $(this).attr("sid");
			if (scripts == "") 
				scripts += s_id;
			else
				scripts += "," + s_id;
		});
		document.getElementById("hidden_selected").value = scripts;
		
    	$("#all_users .innertxt").click(function() {
			
			var color = $(this).css("background-color");
			if(color != "transparent" && (!color.match(/rgb(a?)\\(0/))){
				$(this).css("background-color","transparent");
			}else{
				$(this).css("background-color","lightblue");
			}
			var userid = $(this).attr("id");
			$("#" + userid).toggleClass("innertxt_bg");
		});
		
		$("#selected_users .innertxt2").click(function() {
			
			var color = $(this).css("background-color");
			if(color != "transparent"){
				$(this).css("background-color","transparent");
			}else{
				$(this).css("background-color","lightblue");
			}
			var userid = $(this).attr("id");
			$("#" + userid).toggleClass("innertxt_bg");
		});
		
		$("#move_right").click(function() {
			var users = $("#selected_users .innertxt2").size();
			var selected_users = $("#all_users .innertxt_bg").size();
			
			/*if (users + selected_users > 14) {
				alert("You can only chose maximum 14 Scripts.");
				return;
			}*/
			
			$("#all_users .innertxt_bg").each(function() {
				var user_clone = $(this).clone(true);
				$(user_clone).removeClass("innertxt");
				$(user_clone).removeClass("innertxt_bg");
				$(user_clone).addClass("innertxt2");
				$(user_clone).css("background-color","transparent");
				
				$("#selected_users").append(user_clone);
				$(this).remove();
			});
			
			var scripts = "";
			$("#selected_users .innertxt2").each(function() {
				var s_id = $(this).attr("sid");
				if (scripts == "") 
					scripts += s_id;
				else
					scripts += "," + s_id;
			});
			document.getElementById("hidden_selected").value = scripts;
		});
		
		$("#move_left").click(function() {
			$("#selected_users .innertxt_bg").each(function() {
				
				
				var user_clone = $(this).clone(true);
				$(user_clone).removeClass("innertxt2");
				$(user_clone).removeClass("innertxt_bg");
				$(user_clone).addClass("innertxt");
				$(user_clone).css("background-color","transparent");
				
				$("#all_users").append(user_clone);
				$(this).remove();
			});
			
			var scripts = "";
			$("#selected_users .innertxt2").each(function() {
				var s_id = $(this).attr("sid");
				if (scripts == "") 
					scripts += s_id;
				else
					scripts += "," + s_id;
			});
			document.getElementById("hidden_selected").value = scripts;
		});
		
		$("#view").click(function() {
			var scripts = "";
			$("#selected_users .innertxt2").each(function() {
				var s_id = $(this).attr("sid");
				if (scripts == "") 
					scripts += s_id;
				else
					scripts += "," + s_id;
			});
			document.getElementById("hidden_selected").value = scripts;
			//alert(scripts);
			
		});

	});		

</script>

';
    softfooter();
}
Пример #25
0
function settings_theme()
{
    global $theme, $globals, $user, $l, $langs, $skins, $error, $saved, $softpanel, $protocols;
    //Is suPHP installed ?
    $apache_modules = function_exists('apache_get_modules') ? apache_get_modules() : '';
    if (is_array($apache_modules)) {
        foreach ($apache_modules as $av) {
            if (strtolower($av) == 'mod_suphp') {
                $suphp = true;
            }
        }
    }
    softheader($l['<title>']);
    echo '<div class="sai_heading" align="center">&nbsp;&nbsp;&nbsp;' . $l['settings'] . '</div>
<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" />
<br /><br /><br />';
    error_handle($error);
    echo '<link rel="stylesheet" type="text/css" href="' . $theme['url'] . '/spectrum.css?' . $globals['version'] . '" />
<script language="javascript" src="' . $theme['url'] . '/js/combined.js" type="text/javascript"></script>
<script src="' . $theme['url'] . '/js/spectrum.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript"><!-- // --><![CDATA[

function show_ud(id){
	var val = id.value;
	if(val == "user_defined"){
		$("#admin_prefix_ud").css("display", "");
	}else{
		$("#admin_prefix_ud").css("display", "none");
	}
}

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";
}

function isNumber(n) {
	if(isNaN(n.value)){
		alert(n.value+\' is not a valid Number\');
		return false;
		return false;
	}
}

// ]]></script>';
    if (!empty($saved)) {
        echo '<br /><div class="sai_success"><img src="' . $theme['images'] . 'success.gif" /> ' . $l['settings_saved'] . '</div><br />';
    }
    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>
<form accept-charset="' . $globals['charset'] . '" name="editsettings" method="post" action="">
<table width="732" cellpadding="5" cellspacing="1" border="0" style="margin:0px auto;">';
    if (!defined('SOFTRESELLER')) {
        echo '
<tr>
<td colspan="2">
<table border="0" width="100%" cellpadding="6" class="sai_reviewform" style="padding:7px 10px;">
<tr>
<td colspan="2">
<table width="110%" border="0" class="sai_ribboneffect">
<tr>
<td width="2%"></td>
<td valign="top"><br />
<font class="sai_ribbonhead" style="color:#FFF;">' . $l['pathhead'] . '</font>
</td>
</tr>
</table>
</td>
</tr>

<tr>
<td width="55%">
<span class="sai_head">' . $l['softpath'] . '</span><br />
<span class="sai_exp2">' . $l['softpath_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="path" size="30" value="' . aPOSTval('path', $globals['path']) . '" />
</td>
</tr>


<tr>
<td>
<span class="sai_head">' . $l['softscripts'] . '</span><br />
<span class="sai_exp2">' . $l['softscripts_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="softscripts" size="30" value="' . aPOSTval('softscripts', $globals['softscripts']) . '" />
</td>
</tr>
</table>
</td>
</tr>';
    }
    echo '
<tr>
<td colspan="2">
<table border="0" width="100%" cellpadding="6" class="sai_reviewform" style="padding:7px 10px;">
<tr>
<td colspan="2">
<table width="110%" border="0" class="sai_ribboneffect">
<tr>
<td width="2%"></td>
<td valign="top"><br />
<font class="sai_ribbonhead" style="color:#FFF;"><b>' . $l['gen_set'] . '</b></font>
</td>
</tr>
</table>
</td>
</tr>

<tr>
<td width="55%">
<span class="sai_head">' . $l['sitename'] . '</span><br />
<span class="sai_exp2">' . $l['sitename_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="sn" size="30" value="' . aPOSTval('sn', $globals['sn']) . '" />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['logo_url'] . '</span><br />
<span class="sai_exp2">' . $l['logo_url_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="logo_url" size="30" value="' . aPOSTval('logo_url', $globals['logo_url']) . '" />
</td>
</tr>';
    if (!defined('SOFTRESELLER')) {
        echo '<tr>
<td>
<span class="sai_head">' . $l['is_vps'] . '</span><br />
<span class="sai_exp2">' . $l['is_vps_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="is_vps" ' . POSTchecked('is_vps', $globals['is_vps']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['cook_name'] . '</span><br />
<span class="sai_exp2">' . $l['cook_name_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="cookie_name" size="30" value="' . aPOSTval('cookie_name', $globals['cookie_name']) . '" />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['chmod_files'] . '</span><br />
<span class="sai_exp2">' . $l['chmod_files_exp'] . ' ' . (empty($suphp) ? '' : '<b>(' . $l['suphp_detected'] . ')</b>') . '</span>
</td>
<td valign="top">
<input type="text" name="chmod_files" size="20" value="' . aPOSTval('chmod_files', $globals['chmod_files']) . '" />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['chmod_dir'] . '</span><br />
<span class="sai_exp2">' . $l['chmod_dir_exp'] . ' ' . (empty($suphp) ? '' : '<b>(' . $l['suphp_detected'] . ')</b>') . '</span>
</td>
<td valign="top">
<input type="text" name="chmod_dir" size="20" value="' . aPOSTval('chmod_dir', $globals['chmod_dir']) . '" />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['chmod_conf_file'] . '</span><br />
<span class="sai_exp2">' . $l['chmod_conf_file_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="chmod_conf_file" size="20" value="' . aPOSTval('chmod_conf_file', @$globals['chmod_conf_file']) . '" />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['footer_link'] . '</span><br />
<span class="sai_exp2">' . $l['footer_link_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="footer_link" size="20" value="' . aPOSTval('footer_link', @$globals['footer_link']) . '" />
</td>
</tr>';
    }
    if ($globals['softpanel'] == 'directadmin' && !defined('SOFTRESELLER')) {
        echo '<tr>
<td>
<span class="sai_head">' . $l['remote_mysql'] . '</span><br />
<span class="sai_exp2">' . $l['remote_mysql_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="remote_mysql" size="20" value="' . aPOSTval('remote_mysql', @$globals['remote_mysql']) . '" />
</td>
</tr>';
    }
    if (!defined('SOFTRESELLER')) {
        echo '<tr>
<td>
<span class="sai_head">' . $l['soft_email'] . '</span><br />
<span class="sai_exp2">' . $l['soft_email_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="soft_email" size="30" value="' . aPOSTval('soft_email', $globals['soft_email']) . '" />
</td>
</tr>';
    }
    echo '<tr>
<td>
<span class="sai_head">' . $l['from_email'] . '</span><br />
<span class="sai_exp2">' . $l['from_email_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="from_email" size="30" value="' . aPOSTval('from_email', $globals['from_email']) . '" />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['choose_lang'] . '</span><br />
<span class="sai_exp2">' . $l['choose_lang_exp'] . '</span>
</td>
<td valign="top">
<select name="language">';
    foreach ($langs as $k => $v) {
        echo '<option value="' . $v . '" ' . (empty($_POST['language']) && $globals['language'] == $v ? 'selected="selected"' : (@trim($_POST['language']) == $v ? 'selected="selected"' : '')) . '>' . _ucfirst($v) . '</option>';
    }
    echo '</select>
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['choose_protocol'] . '</span><br />
<span class="sai_exp2">' . $l['choose_protocol_exp'] . '</span>
</td>
<td>
<select name="default_protocol">';
    foreach ($protocols as $pk => $pv) {
        echo '<option value="' . $pk . '" ' . ($globals['default_protocol'] == $pk ? 'selected="selected"' : '') . '>' . $pv . '</option>';
    }
    echo '</select>
</td>
</tr>';
    if (!defined('SOFTRESELLER')) {
        echo '<tr>
<td>
<span class="sai_head">' . $l['choose_theme'] . '</span><br />
<span class="sai_exp2">' . $l['choose_theme_exp'] . '</span>
</td>
<td valign="top">
<select name="theme_folder">';
        foreach ($skins as $k => $v) {
            echo '<option value="' . $v . '" ' . (empty($_POST['theme_folder']) && $globals['theme_folder'] == $v ? 'selected="selected"' : (trim($_POST['theme_folder']) == $v ? 'selected="selected"' : '')) . '>' . _ucfirst($v) . '</option>';
        }
        echo '</select>
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['default_hf_bg'] . '</span><br />
<span class="sai_exp2">' . $l['default_hf_bg_exp'] . '</span>
</td>
<td valign="top">
<input type="color" name="color" id="default_hf_bg" class="changecolor"/>&nbsp;&nbsp;
<input type="hidden" name="default_hf_bg" value="' . aPOSTval('default_hf_bg', $globals['default_hf_bg']) . '" id="hidden_default_hf_bg">
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['default_cat_hover'] . '</span><br />
<span class="sai_exp2">' . $l['default_cat_hover_exp'] . '</span>
</td>
<td valign="top">
<input type="color" name="color" id="default_cat_hover" class="changecolor"/>&nbsp;&nbsp;
<input type="hidden" name="default_cat_hover" value="' . aPOSTval('default_cat_hover', $globals['default_cat_hover']) . '" id="hidden_default_cat_hover">
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['default_hf_text'] . '</span><br />
<span class="sai_exp2">' . $l['default_hf_text_exp'] . '</span>
</td>
<td valign="top">
<input type="color" name="color" id="default_hf_text" class="changecolor"/>&nbsp;&nbsp;
<input type="hidden" name="default_hf_text" value="' . aPOSTval('default_hf_text', $globals['default_hf_text']) . '" id="hidden_default_hf_text">
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['default_scriptname_text'] . '</span><br />
<span class="sai_exp2">' . $l['default_scriptname_text_exp'] . '</span>
</td>
<td valign="top">
<input type="color" name="color" id="default_scriptname_text" class="changecolor"/>&nbsp;&nbsp;
<input type="hidden" name="default_scriptname_text" value="' . aPOSTval('default_scriptname_text', $globals['default_scriptname_text']) . '" id="hidden_default_scriptname_text">
</td>
</tr>';
        if ($globals['softpanel'] == 'webuzo') {
            $disable_sysapps = $softpanel->getconf('DISABLE_SYSAPPS');
            echo '<tr>
<td>
<span class="sai_head">' . $l['network_interface'] . '</span><br />
<span class="sai_exp2">' . $l['network_interface_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="network_interface" size="30" value="' . aPOSTval('network_interface', $globals['network_interface']) . '" />
</td>
</tr>';
            if (empty($disable_sysapps)) {
                echo '<tr>
<td>
<span class="sai_head">' . $l['webuzo_disable_username'] . '</span><br />
<span class="sai_exp2">' . $l['webuzo_disable_username_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="webuzo_disable_username" ' . POSTchecked('webuzo_disable_username', @$globals['webuzo_disable_username']) . ' />
</td>
</tr>';
            }
        }
        echo '<tr>
<td>
<span class="sai_head">' . $l['time_format'] . '</span><br />
<span class="sai_exp2">' . $l['time_format_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="time_format" size="30" value="' . aPOSTval('time_format', $globals['time_format']) . '" />
</td>
</tr>

<tr>
<td colspan="2" align="center"><span class="sai_head">' . $l['timezone'] . ' : </span>&nbsp; &nbsp; 
	<select name="timezone" style="font-size:11px">
		<option value="-12" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '-12' ? 'selected="selected"' : ($globals['timezone'] == -12 ? 'selected="selected"' : '')) . ' >(GMT -12:00) Eniwetok, Kwajalein</option>
		<option value="-11" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '-11' ? 'selected="selected"' : ($globals['timezone'] == -11 ? 'selected="selected"' : '')) . ' >(GMT -11:00) Midway Island, Samoa</option>
		<option value="-10" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '-10' ? 'selected="selected"' : ($globals['timezone'] == -10 ? 'selected="selected"' : '')) . ' >(GMT -10:00) Hawaii</option>
		<option value="-9" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '-9' ? 'selected="selected"' : ($globals['timezone'] == -9 ? 'selected="selected"' : '')) . ' >(GMT -9:00) Alaska</option>
		<option value="-8" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '-8' ? 'selected="selected"' : ($globals['timezone'] == -8 ? 'selected="selected"' : '')) . ' >(GMT -8:00) Pacific Time (US &amp; Canada)</option>
		<option value="-7" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '-7' ? 'selected="selected"' : ($globals['timezone'] == -7 ? 'selected="selected"' : '')) . ' >(GMT -7:00) Mountain Time (US &amp; Canada)</option>
		<option value="-6" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '-6' ? 'selected="selected"' : ($globals['timezone'] == -6 ? 'selected="selected"' : '')) . ' >(GMT -6:00) Central Time (US &amp; Canada), Mexico City</option>
		<option value="-5" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '-5' ? 'selected="selected"' : ($globals['timezone'] == -5 ? 'selected="selected"' : '')) . ' >(GMT -5:00) Eastern Time (US &amp; Canada), Bogota, Lima</option>
		<option value="-4" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '-4' ? 'selected="selected"' : ($globals['timezone'] == -4 ? 'selected="selected"' : '')) . ' >(GMT -4:00) Atlantic Time (Canada), Caracas, La Paz</option>
		<option value="-3.5" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '-3.5' ? 'selected="selected"' : ($globals['timezone'] == -3.5 ? 'selected="selected"' : '')) . ' >(GMT -3:30) Newfoundland</option>
		<option value="-3" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '-3' ? 'selected="selected"' : ($globals['timezone'] == -3 ? 'selected="selected"' : '')) . ' >(GMT -3:00) Brazil, Buenos Aires, Georgetown</option>
		<option value="-2" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '-2' ? 'selected="selected"' : ($globals['timezone'] == -2 ? 'selected="selected"' : '')) . ' >(GMT -2:00) Mid-Atlantic</option>
		<option value="-1" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '-1' ? 'selected="selected"' : ($globals['timezone'] == -1 ? 'selected="selected"' : '')) . ' >(GMT -1:00 hour) Azores, Cape Verde Islands</option>
		<option value="0" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '0' ? 'selected="selected"' : ($globals['timezone'] == 0 ? 'selected="selected"' : '')) . ' >(GMT) Western Europe Time, London, Lisbon, Casablanca</option>
		<option value="1" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '1' ? 'selected="selected"' : ($globals['timezone'] == 1 ? 'selected="selected"' : '')) . ' >(GMT +1:00 hour) Brussels, Copenhagen, Madrid, Paris</option>
		<option value="2" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '2' ? 'selected="selected"' : ($globals['timezone'] == 2 ? 'selected="selected"' : '')) . ' >(GMT +2:00) Kaliningrad, South Africa</option>
		<option value="3" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '3' ? 'selected="selected"' : ($globals['timezone'] == 3 ? 'selected="selected"' : '')) . ' >(GMT +3:00) Baghdad, Riyadh, Moscow, St. Petersburg</option>
		<option value="3.5" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '3.5' ? 'selected="selected"' : ($globals['timezone'] == 3.5 ? 'selected="selected"' : '')) . ' >(GMT +3:30) Tehran</option>
		<option value="4" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '4' ? 'selected="selected"' : ($globals['timezone'] == 4 ? 'selected="selected"' : '')) . ' >(GMT +4:00) Abu Dhabi, Muscat, Baku, Tbilisi</option>
		<option value="4.5" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '4.5' ? 'selected="selected"' : ($globals['timezone'] == 4.5 ? 'selected="selected"' : '')) . ' >(GMT +4:30) Kabul</option>
		<option value="5" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '5' ? 'selected="selected"' : ($globals['timezone'] == 5 ? 'selected="selected"' : '')) . ' >(GMT +5:00) Ekaterinburg, Islamabad, Karachi, Tashkent</option>
		<option value="5.5" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '5.5' ? 'selected="selected"' : ($globals['timezone'] == 5.5 ? 'selected="selected"' : '')) . ' >(GMT +5:30) Bombay, Calcutta, Madras, New Delhi</option>
		<option value="6" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '6' ? 'selected="selected"' : ($globals['timezone'] == 6 ? 'selected="selected"' : '')) . ' >(GMT +6:00) Almaty, Dhaka, Colombo</option>
		<option value="6.5" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '6.5' ? 'selected="selected"' : ($globals['timezone'] == 6.5 ? 'selected="selected"' : '')) . ' >(GMT +6:30) Yangon, Myanmar</option>
		<option value="7" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '7' ? 'selected="selected"' : ($globals['timezone'] == 7 ? 'selected="selected"' : '')) . ' >(GMT +7:00) Bangkok, Hanoi, Jakarta</option>
		<option value="8" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '8' ? 'selected="selected"' : ($globals['timezone'] == 8 ? 'selected="selected"' : '')) . ' >(GMT +8:00) Beijing, Perth, Singapore, Hong Kong, Taiwan</option>
		<option value="9" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '9' ? 'selected="selected"' : ($globals['timezone'] == 9 ? 'selected="selected"' : '')) . ' >(GMT +9:00) Tokyo, Seoul, Osaka, Sapporo, Yakutsk</option>
		<option value="9.5" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '9.5' ? 'selected="selected"' : ($globals['timezone'] == 9.5 ? 'selected="selected"' : '')) . ' >(GMT +9:30) Adelaide, Darwin</option>
		<option value="10" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '10' ? 'selected="selected"' : ($globals['timezone'] == 10 ? 'selected="selected"' : '')) . ' >(GMT +10:00) Eastern Australia, Guam, Vladivostok</option>
		<option value="11" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '11' ? 'selected="selected"' : ($globals['timezone'] == 11 ? 'selected="selected"' : '')) . ' >(GMT +11:00) Magadan, Solomon Islands, New Caledonia</option>
		<option value="12" ' . (isset($_POST['timezone']) && $_POST['timezone'] == '12' ? 'selected="selected"' : ($globals['timezone'] == 12 ? 'selected="selected"' : '')) . ' >(GMT +12:00) Auckland, Wellington, Fiji, Kamchatka</option>
	</select>
</td>
</tr>';
    }
    echo '
</table>
</td>
</tr>

<tr>
<td colspan="2">
<table border="0" width="100%" cellpadding="6" class="sai_reviewform" style="padding:7px 10px;">
<tr>
<td colspan="2">
<table width="110%" border="0" class="sai_ribboneffect">
<tr>
<td width="2%"></td>
<td valign="top"><br />
<font class="sai_ribbonhead" style="color:#FFF;"><b>' . $l['end_user_set'] . '</b></font>
</td>
</tr>
</table>
</td>
</tr>

<tr>
<td width="55%">
<span class="sai_head">' . $l['eu_news_off'] . '</span><br />
<span class="sai_exp2">' . $l['eu_news_off_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="eu_news_off" ' . POSTchecked('eu_news_off', @$globals['eu_news_off']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['no_prefill'] . '</span><br />
<span class="sai_exp2">' . $l['no_prefill_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="no_prefill" ' . POSTchecked('no_prefill', @$globals['no_prefill']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['random_username'] . '</span><br />
<span class="sai_exp2">' . $l['random_username_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="random_username" ' . POSTchecked('random_username', @$globals['random_username']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['random_pass'] . '</span><br />
<span class="sai_exp2">' . $l['random_pass_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="random_pass" ' . POSTchecked('random_pass', @$globals['random_pass']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['random_dbprefix'] . '</span><br />
<span class="sai_exp2">' . $l['random_dbprefix_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="random_dbprefix" ' . POSTchecked('random_dbprefix', @$globals['random_dbprefix']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['off_demo_link'] . '</span><br />
<span class="sai_exp2">' . $l['off_demo_link_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_demo_link" ' . POSTchecked('off_demo_link', @$globals['off_demo_link']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['off_screenshot_link'] . '</span><br />
<span class="sai_exp2">' . $l['off_screenshot_link_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_screenshot_link" ' . POSTchecked('off_screenshot_link', @$globals['off_screenshot_link']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['off_rating_link'] . '</span><br />
<span class="sai_exp2">' . $l['off_rating_link_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_rating_link" ' . POSTchecked('off_rating_link', @$globals['off_rating_link']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['off_review_link'] . '</span><br />
<span class="sai_exp2">' . $l['off_review_link_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_review_link" ' . POSTchecked('off_review_link', @$globals['off_review_link']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['off_email_link'] . '</span><br />
<span class="sai_exp2">' . $l['off_email_link_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_email_link" ' . POSTchecked('off_email_link', $globals['off_email_link']) . ' />
</td>
</tr>';
    if (!defined('SOFTRESELLER')) {
        echo '
<tr>
<td width="55%">
<span class="sai_head">' . $l['eu_email_off'] . '</span><br />
<span class="sai_exp2">' . $l['eu_email_off_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="eu_email_off" ' . POSTchecked('eu_email_off', @$globals['eu_email_off']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['empty_username'] . '</span><br />
<span class="sai_exp2">' . $l['empty_username_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="empty_username" ' . POSTchecked('empty_username', @$globals['empty_username']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['empty_pass'] . '</span><br />
<span class="sai_exp2">' . $l['empty_pass_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="empty_pass" ' . POSTchecked('empty_pass', @$globals['empty_pass']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['comp_output'] . '</span><br />
<span class="sai_exp2">' . $l['comp_output_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="gzip" ' . POSTchecked('gzip', $globals['gzip']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['off_remove_mail'] . '</span><br />
<span class="sai_exp2">' . $l['off_remove_mail_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_remove_mail" ' . POSTchecked('off_remove_mail', $globals['off_remove_mail']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['off_backup_mail'] . '</span><br />
<span class="sai_exp2">' . $l['off_backup_mail_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_backup_mail" ' . POSTchecked('off_backup_mail', $globals['off_backup_mail']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['off_install_mail'] . '</span><br />
<span class="sai_exp2">' . $l['off_install_mail_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_install_mail" ' . POSTchecked('off_install_mail', $globals['off_install_mail']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['off_edit_mail'] . '</span><br />
<span class="sai_exp2">' . $l['off_edit_mail_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_edit_mail" ' . POSTchecked('off_edit_mail', $globals['off_edit_mail']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['off_clone_mail'] . '</span><br />
<span class="sai_exp2">' . $l['off_clone_mail_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_clone_mail" ' . POSTchecked('off_clone_mail', $globals['off_clone_mail']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['off_restore_mail'] . '</span><br />
<span class="sai_exp2">' . $l['off_restore_mail_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_restore_mail" ' . POSTchecked('off_restore_mail', $globals['off_restore_mail']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['off_customize_theme'] . '</span><br />
<span class="sai_exp2">' . $l['off_customize_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_customize_theme" ' . POSTchecked('off_customize_theme', $globals['off_customize_theme']) . ' />
</td>
</tr>';
    }
    if (!empty($softpanel->native_ui)) {
        echo '<tr>
<td>
<span class="sai_head">' . $l['panel_hf'] . '</span><br />
<span class="sai_exp2">' . $l['panel_hf_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="panel_hf" size="30" ' . POSTchecked('panel_hf', @$globals['panel_hf']) . ' />
</td>
</tr>';
    }
    if (!defined('SOFTRESELLER')) {
        echo '<tr>
<td>
<span class="sai_head">' . $l['off_sync_link'] . '</span><br />
<span class="sai_exp2">' . $l['off_sync_link_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_sync_link" ' . POSTchecked('off_sync_link', @$globals['off_sync_link']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['off_panel_link'] . '</span><br />
<span class="sai_exp2">' . $l['off_panel_link_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_panel_link" ' . POSTchecked('off_panel_link', @$globals['off_panel_link']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['perl_scripts'] . '</span><br />
<span class="sai_exp2">' . $l['perl_scripts_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="perl_scripts" ' . POSTchecked('perl_scripts', @$globals['perl_scripts']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['nolabels'] . '</span><br />
<span class="sai_exp2">' . $l['nolabels_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="nolabels" size="30" ' . POSTchecked('nolabels', $globals['nolabels']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['show_cscript_in_top'] . '</span><br />
<span class="sai_exp2">' . $l['show_cscript_in_top_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="show_cscript_in_top" ' . POSTchecked('show_cscript_in_top', @$globals['show_cscript_in_top']) . ' />
</td>
</tr>';
        // Classes are only avaialable to Premium License
        if (!empty($globals['lictype'])) {
            echo '<tr>
<td>
<span class="sai_head">' . $l['disable_classes'] . '</span><br />
<span class="sai_exp2">' . $l['disable_classes_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="disable_classes" size="30" ' . POSTchecked('disable_classes', @$globals['disable_classes']) . ' />
</td>
</tr>';
        }
        if (!empty($softpanel->user_mod_dir)) {
            echo '<tr>
<td>
<span class="sai_head">' . $l['user_mod_dir'] . '</span><br />
<span class="sai_exp2">' . $l['user_mod_dir_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="user_mod_dir" ' . POSTchecked('user_mod_dir', $globals['user_mod_dir']) . ' />
</td>
</tr>';
        }
        echo '<tr>
<td>
<span class="sai_head">' . $l['disable_reseller_panel'] . '</span><br />
<span class="sai_exp2">' . $l['disable_reseller_panel_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="disable_reseller_panel" size="30" ' . POSTchecked('disable_reseller_panel', @$globals['disable_reseller_panel']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['pass_strength'] . '</span><br />
<span class="sai_exp2">' . $l['pass_strength_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="pass_strength" size="30" value="' . aPOSTval('pass_strength', $globals['pass_strength']) . '" />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['admin_prefix'] . '</span><br />
<span class="sai_exp2">' . $l['admin_prefix_exp'] . '</span>
</td>
<td valign="top">
<select id="admin_prefix" name="admin_prefix" onchange="show_ud(this);">

	<option value="" ' . (isset($_POST['admin_prefix']) && $_POST['admin_prefix'] == "" ? 'selected="selected"' : (!isset($_POST['admin_prefix']) && $globals['admin_prefix'] == "" ? 'selected="selected"' : '')) . '>' . $l['ap_none'] . '</option>
	
	<option value="username" ' . (isset($_POST['admin_prefix']) && $_POST['admin_prefix'] == "username" ? 'selected="selected"' : (!isset($_POST['admin_prefix']) && $globals['admin_prefix'] == "username" ? 'selected="selected"' : '')) . '>' . $l['ap_username'] . '</option>
	
	<option value="domain" ' . (isset($_POST['admin_prefix']) && $_POST['admin_prefix'] == "domain" ? 'selected="selected"' : (!isset($_POST['admin_prefix']) && $globals['admin_prefix'] == "domain" ? 'selected="selected"' : '')) . '>' . $l['ap_domain'] . '</option>
	
	<option value="user_defined" ' . (isset($_POST['admin_prefix']) && $_POST['admin_prefix'] == "user_defined" ? 'selected="selected"' : (!isset($_POST['admin_prefix']) && $globals['admin_prefix'] != "username" && $globals['admin_prefix'] != "domain" && $globals['admin_prefix'] != "" ? 'selected="selected"' : '')) . '>' . $l['ap_admin_defined'] . '</option>
	
</select>&nbsp;&nbsp;&nbsp;
<input type="text" id="admin_prefix_ud" name="admin_prefix_ud" ' . (!empty($_POST['admin_prefix_ud']) && $_POST['admin_prefix'] != "" && $_POST['admin_prefix'] != "username" && $_POST['admin_prefix'] != "domain" ? 'value="' . $_POST['admin_prefix_ud'] . '" style=""' : (!isset($_POST['admin_prefix']) && ($globals['admin_prefix'] != "username" && $globals['admin_prefix'] != "domain" && $globals['admin_prefix'] != "") ? 'value="' . $globals['admin_prefix'] . '" style=""' : 'style="display:none"')) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['disable_clone'] . '</span><br />
<span class="sai_exp2">' . $l['disable_clone_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="disable_clone" ' . POSTchecked('disable_clone', @$globals['disable_clone']) . ' />
</td>
</tr>';
        // At the moment only for H-Sphere we are providing this option
        if ($globals['softpanel'] == 'hsphere') {
            echo '<tr>
<td>
<span class="sai_head">' . $l['ephp_bin'] . '</span><br />
<span class="sai_exp2">' . $l['ephp_bin_exp'] . sphpbin() . '</span>
</td>
<td valign="top">
<input type="text" name="ephp_bin" value="' . aPOSTval('ephp_bin', $globals['ephp_bin']) . '" size="30" />
</td>
</tr>
';
        }
    }
    if ($globals['softpanel'] == 'ampps') {
        echo '<tr>
<td>
<span class="sai_head">' . $l['default_domain_path'] . '</span><br />
<span class="sai_exp2">' . $l['default_domain_path_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="adomain_path" size="30" value="' . aPOSTval('adomain_path', $globals['adomain_path']) . '" />
</td>
</tr>';
    }
    if ($globals['softpanel'] != 'ampps' && !empty($globals['ampps_enabled']) && !empty($globals['lictype'])) {
        echo '<tr>
<td>
<span class="sai_head">' . $l['no_ampps_download'] . '</span><br />
<span class="sai_exp2">' . $l['no_ampps_download_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="no_ampps" ' . POSTchecked('no_ampps', @$globals['no_ampps']) . ' />
</td>
</tr>';
    }
    if (!defined('SOFTRESELLER')) {
        echo '<tr>
<td>
<span class="sai_head">' . $l['no_strong_mysql_pass'] . '</span><br />
<span class="sai_exp2">' . $l['no_strong_mysql_pass_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="no_strong_mysql_pass" ' . POSTchecked('no_strong_mysql_pass', @$globals['no_strong_mysql_pass']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['pre_download_all'] . '</span><br />
<span class="sai_exp2">' . $l['pre_download_all_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="pre_download_all" ' . POSTchecked('pre_download_all', @$globals['pre_download_all']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['disable_backup_restore'] . '</span><br />
<span class="sai_exp2">' . $l['disable_backup_restore_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="disable_backup_restore" size="30" ' . POSTchecked('disable_backup_restore', @$globals['disable_backup_restore']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['disable_backup_upgrade'] . '</span><br />
<span class="sai_exp2">' . $l['disable_backup_upgrade_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="disable_backup_upgrade" ' . POSTchecked('disable_backup_upgrade', @$globals['disable_backup_upgrade']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['disable_auto_backup'] . '</span><br />
<span class="sai_exp2">' . $l['disable_auto_backup_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="disable_auto_backup" ' . POSTchecked('disable_auto_backup', @$globals['disable_auto_backup']) . ' />' . $l['auto_backup_all'] . '<br />
<input type="checkbox" name="disable_auto_backup_daily" ' . POSTchecked('disable_auto_backup_daily', @$globals['disable_auto_backup_daily']) . ' />' . $l['auto_backup_daily'] . '<br />
<input type="checkbox" name="disable_auto_backup_weekly" ' . POSTchecked('disable_auto_backup_weekly', @$globals['disable_auto_backup_weekly']) . ' />' . $l['auto_backup_weekly'] . '<br />
<input type="checkbox" name="disable_auto_backup_monthly" ' . POSTchecked('disable_auto_backup_monthly', @$globals['disable_auto_backup_monthly']) . ' />' . $l['auto_backup_monthly'] . '
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['auto_backup_limit'] . '</span><br />
<span class="sai_exp2">' . $l['auto_backup_limit_exp'] . '</span>
</td>
<td valign="top">
<select name="auto_backup_limit">';
        for ($i = 0; $i <= 10; $i++) {
            echo '<option value="' . $i . '" ' . (empty($_POST['auto_backup_limit']) && $globals['auto_backup_limit'] == $i ? 'selected="selected"' : (trim($_POST['auto_backup_limit']) == $i ? 'selected="selected"' : '')) . '>' . (empty($i) ? $l['auto_backup_unlimited'] : $i) . '</option>';
        }
        echo '</select>
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['max_backups'] . '</span><br />
<span class="sai_exp2">' . $l['max_backups_exp'] . '</span>
</td>
<td valign="top">
<select name="max_backups">';
        for ($i = 0; $i <= 10; $i++) {
            echo '<option value="' . $i . '" ' . (empty($_POST['max_backups']) && $globals['max_backups'] == $i ? 'selected="selected"' : (trim($_POST['max_backups']) == $i ? 'selected="selected"' : '')) . '>' . (empty($i) ? $l['max_backups_unlimited'] : $i) . '</option>';
        }
        echo '</select>
</td>
</tr>';
        if (!aefer() && !ent()) {
            echo '<tr>
<td>
<span class="sai_head">' . $l['backups_expire'] . '</span><br />
<span class="sai_exp2">' . $l['backups_expire_exp'] . '</span>
</td>
<td valign="top">
<input type="text" id="backups_expire" name="backups_expire" value="' . aPOSTval('backups_expire', @$globals['backups_expire']) . '" onblur="isNumber(this)"/>&nbsp; days
</td>
</tr>';
        }
        echo '<tr>
<td>
<span class="sai_head">' . $l['off_upgrade_plugins'] . '</span><br />
<span class="sai_exp2">' . $l['off_upgrade_plugins_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_upgrade_plugins" ' . POSTchecked('off_upgrade_plugins', @$globals['off_upgrade_plugins']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['off_upgrade_themes'] . '</span><br />
<span class="sai_exp2">' . $l['off_upgrade_themes_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off_upgrade_themes" ' . POSTchecked('off_upgrade_themes', @$globals['off_upgrade_themes']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['enable_auto_upgrade'] . '</span><br />
<span class="sai_exp2">' . $l['enable_auto_upgrade_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="enable_auto_upgrade" ' . POSTchecked('enable_auto_upgrade', @$globals['enable_auto_upgrade']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['force_auto_upgrade'] . '</span><br />
<span class="sai_exp2">' . $l['force_auto_upgrade_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="force_auto_upgrade" ' . POSTchecked('force_auto_upgrade', @$globals['force_auto_upgrade']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['enc_db_pass'] . '</span><br />
<span class="sai_exp2">' . $l['enc_db_pass_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="enc_db_pass" ' . POSTchecked('enc_db_pass', @$globals['enc_db_pass']) . ' />
</td>
</tr>

<td>
<span class="sai_head">' . $l['set_backup_dir'] . '</span><br />
<span class="sai_exp2">' . $l['set_backup_dir_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="set_backup_dir" size="20" value="' . aPOSTval('set_backup_dir', @$globals['set_backup_dir']) . '" />
</td>
</tr>';
        if (asperapp(1, 0, 0)) {
            // Only for Softaculous
            echo '
<tr>
<td>
<span class="sai_head">' . $l['default_landing'] . '</span><br />
<span class="sai_exp2">' . $l['default_landing_exp'] . '</span>
</td>
<td valign="top">
<select name="default_landing">
<option value="" ' . (!isset($_POST['default_landing']) && empty($globals['default_landing']) ? 'selected="selected"' : '') . '>' . $l['top_scripts'] . '</option>
<option value="installations" ' . (isset($_POST['default_landing']) && $_POST['default_landing'] == 'installations' ? 'selected="selected"' : ($globals['default_landing'] == 'installations' ? 'selected="selected"' : '')) . '>' . $l['all_ins'] . '</option>
<option value="outdated_ins" ' . (isset($_POST['default_landing']) && $_POST['default_landing'] == 'outdated_ins' ? 'selected="selected"' : ($globals['default_landing'] == 'outdated_ins' ? 'selected="selected"' : '')) . '>' . $l['outdated_ins'] . '</option>
</select>
</td>
</tr>';
        }
        if (aefer()) {
            echo '<tr>
	<td>
	<span class="sai_head">' . $l['no_ftp_encrypted'] . '</span><br />
	<span class="sai_exp2">' . $l['no_ftp_encrypted_exp'] . '</span>
	</td>
	<td valign="top">
	<input type="checkbox" name="no_ftp_encrypted" ' . POSTchecked('no_ftp_encrypted', @$globals['no_ftp_encrypted']) . ' />
	</td>
	</tr>
	
	<tr>
	<td>
	<span class="sai_head">' . $l['no_add_domain'] . '</span><br />
	<span class="sai_exp2">' . $l['no_add_domain_exp'] . '</span>
	</td>
	<td valign="top">
	<input type="checkbox" name="no_add_domain" ' . POSTchecked('no_add_domain', @$globals['no_add_domain']) . ' />
	</td>
	</tr>
	
	<tr>
	<td>
	<span class="sai_head">' . $l['no_prefill_db'] . '</span><br />
	<span class="sai_exp2">' . $l['no_prefill_db_exp'] . '</span>
	</td>
	<td valign="top">
	<input type="checkbox" name="no_prefill_db" ' . POSTchecked('no_prefill_db', @$globals['no_prefill_db']) . ' />
	</td>
	</tr>';
        }
        if (aefer() || ent()) {
            echo '<tr>
	<td>
	<span class="sai_head">' . $l['session_timeout'] . '</span><br />
	<span class="sai_exp2">' . $l['session_timeout_exp'] . '</span>
	</td>
	<td valign="top">
	<input type="text" id="session_timeout" name="session_timeout" value="' . aPOSTval('session_timeout', @$globals['session_timeout']) . '" onblur="isNumber(this)"/>
	</td>
	</tr>';
        }
    }
    echo '</table>
</td>
</tr>';
    if (!defined('SOFTRESELLER')) {
        // PFX Settings will be here
        if (!empty($globals['lictype'])) {
            echo '<tr>
<td colspan="2">
<table border="0" width="100%" cellpadding="6" class="sai_reviewform" style="padding:7px 10px;">
<tr>
<td colspan="2">
<table width="110%" border="0" class="sai_ribboneffect">
<tr>
<td width="2%"></td>
<td valign="top"><br />
<font class="sai_ribbonhead" style="color:#FFF;"><b>' . $l['pfx_settings'] . '</b></font>
</td>
</tr>
</table>
</td>
</tr>

<tr>
<td width="55%">
<span class="sai_head">' . $l['eu_enable_themes'] . '</span><br />
<span class="sai_exp2">' . $l['eu_enable_themes_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="eu_enable_themes" ' . POSTchecked('eu_enable_themes', @$globals['eu_enable_themes']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['eu_themes_premium'] . '</span><br />
<span class="sai_exp2">' . $l['eu_themes_premium_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="eu_themes_premium" ' . POSTchecked('eu_themes_premium', @$globals['eu_themes_premium']) . ' />
</td>
</tr>

</table>
</td>
</tr>';
        }
        echo '
<tr>
<td colspan="2">
<table border="0" width="100%" cellpadding="6" class="sai_reviewform" style="padding:7px 10px;">
<tr>
<td colspan="2">
<table width="110%" border="0" class="sai_ribboneffect">
<tr>
<td width="2%"></td>
<td valign="top"><br />
<font class="sai_ribbonhead" style="color:#FFF;"><b>' . $l['update_settings'] . '</b></font>
</td>
</tr>
</table>
</td>
</tr>

<tr>
<td valign="top" <td width="55%">
<span class="sai_head">' . $l['auto_upd_softac'] . '</span><br />
<span class="sai_exp2">' . $l['auto_upd_softac_exp'] . '</span>
</td>
<td valign="top">
<input type="radio" name="update" value="0" ' . POSTradio('update', 0, $globals['update']) . ' /> ' . $l['never_update'] . ' <br />
<input type="radio" name="update" value="1" ' . POSTradio('update', 1, $globals['update']) . ' /> ' . $l['stable'] . ' <br />
<input type="radio" name="update" value="2" ' . POSTradio('update', 2, $globals['update']) . ' /> ' . $l['release_cand'] . '
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['auto_upd_soft'] . '</span><br />
<span class="sai_exp2">' . $l['auto_upd_soft_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="update_softs" ' . POSTchecked('update_softs', $globals['update_softs']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['auto_add_soft'] . '</span><br />
<span class="sai_exp2">' . $l['auto_add_soft_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="add_softs" ' . POSTchecked('add_softs', $globals['add_softs']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['email_upd_soft'] . '</span><br />
<span class="sai_exp2">' . $l['email_upd_soft_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="email_update" ' . POSTchecked('email_update', $globals['email_update']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['email_upd_softs'] . '</span><br />
<span class="sai_exp2">' . $l['email_upd_softs_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="email_update_softs" ' . POSTchecked('email_update_softs', $globals['email_update_softs']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['cron_time'] . '</span><br />
<span class="sai_exp2">' . $l['cron_time_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="cron_time" size="30" value="' . aPOSTval('cron_time', $globals['cron_time']) . '" />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['php_bin'] . '</span><br />
<span class="sai_exp2">' . $l['php_bin_exp'] . '</span>
</td>
<td valign="top">
<input type="text" name="php_bin" size="30" value="' . aPOSTval('php_bin', $globals['php_bin']) . '" />
</td>
</tr>
</table>
</td>
</tr>

<tr>
<td colspan="2">
<table border="0" width="100%" cellpadding="6" class="sai_reviewform" style="padding:7px 10px;">
<tr>
<td colspan="2">
<table width="110%" border="0" class="sai_ribboneffect">
<tr>
<td width="2%"></td>
<td valign="top"><br />
<font class="sai_ribbonhead" style="color:#FFF;"><b>' . $l['remove_options'] . '</b></font>
</td>
</tr>
</table>
</td>
</tr>

<tr>
<td width = "55%">
<span class="sai_head">' . $l['remove_dir'] . '</span><br />
<span class="sai_exp2">' . $l['remove_dir_exp'] . '</span><br />
</td>
<td valign="top">
<input type="checkbox" name="remove_dir" ' . POSTchecked('remove_dir', $globals['remove_dir']) . ' />
</td>
</tr>

<tr>
<td width = "55%">
<span class="sai_head">' . $l['remove_db'] . '</span><br />
<span class="sai_exp2">' . $l['remove_db_exp'] . '</span><br />
</td>
<td valign="top">
<input type="checkbox" name="remove_db" ' . POSTchecked('remove_db', $globals['remove_db']) . ' />
</td>
</tr>

<tr>
<td width = "55%">
<span class="sai_head">' . $l['remove_datadir'] . '</span><br />
<span class="sai_exp2">' . $l['remove_datadir_exp'] . '</span><br />
</td>
<td valign="top">
<input type="checkbox" name="remove_datadir" ' . POSTchecked('remove_datadir', $globals['remove_datadir']) . ' />
</td>
</tr>

<tr>
<td width = "55%">
<span class="sai_head">' . $l['remove_wwwdir'] . '</span><br />
<span class="sai_exp2">' . $l['remove_wwwdir_exp'] . '</span><br />
</td>
<td valign="top">
<input type="checkbox" name="remove_wwwdir" ' . POSTchecked('remove_wwwdir', $globals['remove_wwwdir']) . ' />
</td>
</tr>
</table>
</td>
</tr>

<tr>
<td colspan="2">
<table border="0" width="100%" cellpadding="6" class="sai_reviewform" style="padding:7px 10px;">
<tr>
<td colspan="2">
<table width="110%" border="0" class="sai_ribboneffect">
<tr>
<td width="2%"></td>
<td valign="top"><br />
<font class="sai_ribbonhead" style="color:#FFF;"><b>' . $l['social_media'] . '</b></font>
</td>
</tr>
</table>
</td>
</tr>

<tr>
<td width="55%">
<span class="sai_head">' . $l['install_tweet_off'] . '</span><br />
<span class="sai_exp2">' . $l['install_tweet_off_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="install_tweet_off" ' . POSTchecked('install_tweet_off', $globals['install_tweet_off']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['install_tweet_msg'] . '</span><br />
<span class="sai_exp2">' . $l['install_tweet_msg_exp'] . '</span><br />
<span style="cursor:pointer;" onmouseover="showtip(\'' . $l['tweet_vars'] . '\', this)">' . $l['tweet_vars_link'] . '</span>
</td>
<td valign="top">
<input type="text" name="install_tweet" size="30" value="' . aPOSTval('install_tweet', !empty($globals['install_tweet']) ? $globals['install_tweet'] : $l['install_tweet']) . '" />
</td>
</tr>

<tr>
<td width="55%">
<span class="sai_head">' . $l['upgrade_tweet_off'] . '</span><br />
<span class="sai_exp2">' . $l['upgrade_tweet_off_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="upgrade_tweet_off" ' . POSTchecked('upgrade_tweet_off', $globals['upgrade_tweet_off']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['upgrade_tweet_msg'] . '</span><br />
<span class="sai_exp2">' . $l['upgrade_tweet_msg_exp'] . '</span><br />
<span style="cursor:pointer;" onmouseover="showtip(\'' . $l['tweet_vars'] . '\', this)">' . $l['tweet_vars_link'] . '</span>
</td>
<td valign="top">
<input type="text" name="upgrade_tweet" size="30" value="' . aPOSTval('upgrade_tweet', !empty($globals['upgrade_tweet']) ? $globals['upgrade_tweet'] : $l['upgrade_tweet']) . '" />
</td>
</tr>

<tr>
<td width="55%">
<span class="sai_head">' . $l['clone_tweet_off'] . '</span><br />
<span class="sai_exp2">' . $l['clone_tweet_off_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="clone_tweet_off" ' . POSTchecked('clone_tweet_off', $globals['clone_tweet_off']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['clone_tweet_msg'] . '</span><br />
<span class="sai_exp2">' . $l['clone_tweet_msg_exp'] . '</span><br />
<span style="cursor:pointer;" onmouseover="showtip(\'' . $l['tweet_vars'] . '\', this)">' . $l['tweet_vars_link'] . '</span>
</td>
<td valign="top">
<input type="text" name="clone_tweet" size="30" value="' . aPOSTval('clone_tweet', !empty($globals['clone_tweet']) ? $globals['clone_tweet'] : $l['clone_tweet']) . '" />
</td>
</tr>

</table>
</td>
</tr>

<tr>
<td colspan="2">
<table border="0" width="100%" cellpadding="6" class="sai_reviewform" style="padding:7px 10px;">
<tr>
<td colspan="2">
<table width="110%" border="0" class="sai_ribboneffect">
<tr>
<td width="2%"></td>
<td valign="top"><br />
<font class="sai_ribbonhead" style="color:#FFF;"><b>' . $l['disable_soft'] . '</b></font>
</td>
</tr>
</table>
</td>
</tr>

<tr>
<td width="55%">
<span class="sai_head">' . $l['soft_off'] . '</span><br />
<span class="sai_exp2">' . $l['soft_off_exp'] . '</span>
</td>
<td valign="top">
<input type="checkbox" name="off" ' . POSTchecked('off', $globals['off']) . ' />
</td>
</tr>

<tr>
<td>
<span class="sai_head">' . $l['off_sub'] . '</span>
</td>
<td valign="top">
<input type="text" name="off_subject" size="30" value="' . aPOSTval('off_subject', $globals['off_subject']) . '" />
</td>
</tr>

<tr>
<td valign="top">
<span class="sai_head">' . $l['off_message'] . '</span>
</td>
<td valign="top">
<textarea name="off_message" cols="30" rows="6">' . aPOSTval('off_message', $globals['off_message']) . '</textarea>
</td>
</tr>';
    }
    echo '</table>

<p align="center"><input type="submit" name="editsettings" value="' . $l['edit_settings'] . '" class="sai_graybluebut"/></p>


</form>
<script>
function updateColor(color, id) {
	
	var hexColor = "transparent";
	if(color) {
		hexColor = color.toHexString();
	}
	if(hexColor == "transparent") return;
	
	// Set the hidden value so that we can save the settings
	$("#default_hf_bg").val("1");
	
	// For changing text colors of category heading
	if(id == "default_hf_text"){
		$(".soft_cathead a").css("color", hexColor);
		$(".soft_nav a").css("color", hexColor);
		$(".fa").css("color", hexColor);
		
		// set the hidden value so that it can be saved
		$("#hidden_default_hf_text").val(hexColor);
	}
	
	// For changing text colors of category heading hover color
	if(id == "default_cat_hover"){
		try{
			$(".soft_cathead:hover, .soft_cathead_slide:hover").css("background-color", hexColor);
			//$(".soft_cathead_slide:hover").css("background-color", hexColor);
		
			// set the hidden value so that it can be saved
			$("#hidden_default_cat_hover").val(hexColor);
		}catch(e){
			// do nothing
		}
	}
	
	// For changing text colors of script names
	if(id == "default_scriptname_text"){
		$(".softlinks li a").css("color", hexColor);
		
		// set the hidden value so that it can be saved
		$("#hidden_default_scriptname_text").val(hexColor);
	}
	
	// For changing background color
	if(id == "default_hf_bg"){
		$(".left_panel").css("background-image", "none");
		$(".left_panel").css("background-color", hexColor);
		$(".soft_nav").css("background", hexColor);
		
		// set the hidden value so that it can be saved
		$("#hidden_default_hf_bg").val(hexColor);
	}
	
}

var pallete_array = [
		["rgb(0, 0, 0)", "rgb(67, 67, 67)", "rgb(102, 102, 102)", /*"rgb(153, 153, 153)","rgb(183, 183, 183)",*/
		"rgb(204, 204, 204)", "rgb(217, 217, 217)", /*"rgb(239, 239, 239)", "rgb(243, 243, 243)",*/ "rgb(255, 255, 255)"],
		["rgb(152, 0, 0)", "rgb(255, 0, 0)", "rgb(255, 153, 0)", "rgb(255, 255, 0)", "rgb(0, 255, 0)",
		"rgb(0, 255, 255)", "rgb(74, 134, 232)", "rgb(0, 0, 255)", "rgb(153, 0, 255)", "rgb(255, 0, 255)"],
		["rgb(230, 184, 175)", "rgb(244, 204, 204)", "rgb(252, 229, 205)", "rgb(255, 242, 204)", "rgb(217, 234, 211)",
		"rgb(208, 224, 227)", "rgb(201, 218, 248)", "rgb(207, 226, 243)", "rgb(217, 210, 233)", "rgb(234, 209, 220)",
		"rgb(221, 126, 107)", "rgb(234, 153, 153)", "rgb(249, 203, 156)", "rgb(255, 229, 153)", "rgb(182, 215, 168)",
		"rgb(162, 196, 201)", "rgb(164, 194, 244)", "rgb(159, 197, 232)", "rgb(180, 167, 214)", "rgb(213, 166, 189)",
		"rgb(204, 65, 37)", "rgb(224, 102, 102)", "rgb(246, 178, 107)", "rgb(255, 217, 102)", "rgb(147, 196, 125)",
		"rgb(118, 165, 175)", "rgb(109, 158, 235)", "rgb(111, 168, 220)", "rgb(142, 124, 195)", "rgb(194, 123, 160)",
		"rgb(166, 28, 0)", "rgb(204, 0, 0)", "rgb(230, 145, 56)", "rgb(241, 194, 50)", "rgb(106, 168, 79)",
		"rgb(69, 129, 142)", "rgb(60, 120, 216)", "rgb(61, 133, 198)", "rgb(103, 78, 167)", "rgb(166, 77, 121)",
		/*"rgb(133, 32, 12)", "rgb(153, 0, 0)", "rgb(180, 95, 6)", "rgb(191, 144, 0)", "rgb(56, 118, 29)",
		"rgb(19, 79, 92)", "rgb(17, 85, 204)", "rgb(11, 83, 148)", "rgb(53, 28, 117)", "rgb(116, 27, 71)",*/
		"rgb(91, 15, 0)", "rgb(102, 0, 0)", "rgb(120, 63, 4)", "rgb(127, 96, 0)", "rgb(39, 78, 19)",
		"rgb(12, 52, 61)", "rgb(28, 69, 135)", "rgb(7, 55, 99)", "rgb(32, 18, 77)", "rgb(76, 17, 48)"]
	];

$(function() {
	$("#default_hf_bg").spectrum({
		allowEmpty:true,
		color : "' . (!empty($globals['default_hf_bg']) ? $globals['default_hf_bg'] : '#333333') . '",
		showInput: true,
		className: "full-spectrum",
		showInitial: true,
		showPalette: true,
		showSelectionPalette: true,
		maxPaletteSize: 10,
		preferredFormat: "hex",
		localStorageKey: "soft.demo",
		move: function (color) {
			updateColor(color, this.id);
		},
		hide: function (color) {
			updateColor(color, this.id);
		},
		palette: pallete_array
	});
});

$(function() {
	$("#default_cat_hover").spectrum({
		allowEmpty:true,
		color : "' . (!empty($globals['default_cat_hover']) ? $globals['default_cat_hover'] : '#4096ee') . '",
		showInput: true,
		className: "full-spectrum",
		showInitial: true,
		showPalette: true,
		showSelectionPalette: true,
		maxPaletteSize: 10,
		preferredFormat: "hex",
		localStorageKey: "soft.demo",
		move: function (color) {
			updateColor(color, this.id);
		},
		hide: function (color) {
			updateColor(color, this.id);
		},
		palette: pallete_array
	});
});

$(function() {
	$("#default_hf_text").spectrum({
		allowEmpty:true,
		color : "' . (!empty($globals['default_hf_text']) ? $globals['default_hf_text'] : '#F2F2F2') . '",
		showInput: true,
		className: "full-spectrum",
		showInitial: true,
		showPalette: true,
		showSelectionPalette: true,
		maxPaletteSize: 10,
		preferredFormat: "hex",
		localStorageKey: "soft.demo",
		move: function (color) {
			updateColor(color, this.id);
		},
		hide: function (color) {
			updateColor(color, this.id);
		},
		palette: pallete_array
	});
});

$(function() {
	$("#default_scriptname_text").spectrum({
		allowEmpty:true,
		color : "' . (!empty($globals['default_scriptname_text']) ? $globals['default_scriptname_text'] : '#FFFFFF') . '",
		showInput: true,
		className: "full-spectrum",
		showInitial: true,
		showPalette: true,
		showSelectionPalette: true,
		maxPaletteSize: 10,
		preferredFormat: "hex",
		localStorageKey: "soft.demo",
		move: function (color) {
			updateColor(color, this.id);
		},
		hide: function (color) {
			updateColor(color, this.id);
		},
		palette: pallete_array
	});
});
</script>';
    softfooter();
}
Пример #26
0
function apache_settings_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iapps, $error, $saved, $dserver, $done, $proxy;
    // ENABLE PROXY
    if (optGET('enable_proxy')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        if (!empty($done)) {
            echo '1' . $l['enable_done'];
            return true;
        }
    }
    // DISABLE PROXY
    if (optGET('disable_proxy')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        if (!empty($done)) {
            echo '1' . $l['disable_done'];
            return true;
        }
    }
    softheader($l['<title>']);
    error_handle($error, '100%');
    if (!empty($saved)) {
        echo '<div class="sai_success">' . $l['settings_saved'] . '</div>';
    }
    if ($dserver == 'nginx') {
        echo '
		<form accept-charset="' . $globals['charset'] . '" name="editsettingsspdy" method="post" action="">
			<center class="sai_tit">
				<img src="' . $theme['a_images'] . 'nginx_settings.gif" />&nbsp;' . $l['nginxsettings'] . '
			</center>
			<table border="0" cellpadding="8" cellspacing="8" width="700px" align="center" class="sai_divroundshad" style="padding-left:15px; padding-top:15px;" >
				<tr>
					<td>
						<span class="sai_head">' . $l['spdy_enable'] . '</font></span><br/>
						<span class="sai_exp">' . $l['spdy_check'] . '</span>
					</td>
					<td>
						<input type="checkbox" name="spdyon" id="spdyon" ' . POSTchecked('spdyon', $softpanel->getconf('WU_SPDY')) . ' />
					</td>
				</tr>
				<tr>
					<td colspan="2">
						<p align="center">
							<input type="submit" class="sai_graybluebut" name="editspdysettings" value="' . $l['edit_nginx_settings'] . '" />
						</p>
					</td>
				</tr>
			</table>
		</form>
		
		<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
		
		$(document).ready(function(){
			
			// ENABLE PROXY
			$("#enable").click(function(){
				
				var port = $("#port").val();
				$("#progress").css("display", "");
				
				$.ajax({
					type: "POST",
					url: window.location+"&enable_proxy=1",
					data: $("#enable_p").serialize(),
					
					// Checking the result
					success: function(data){
						$("#progress").css("display", "none");
						var result = data.substring(0,1);
						var msg = data.substring(1);
						if(result == "1"){
							$("#port").val("");
							message_box.show_message("Done", msg, 2, 1);
						}else{
							message_box.show_message("Error", msg, 1, 1);
						}
					},
					error: function() {
						message_box.show_message("Error", "' . $l['connect_error'] . '", 1, 1);
					}
				});
				return false;
			});
			
			// DISABLE PROXY
			$("#disable").click(function(){
				
				var webserver = $("input[name=webserver]:checked").val();
				$("#progress").css("display", "");
				
				$.ajax({
					type: "POST",
					url: window.location+"&disable_proxy=1",
					data: "webserver="+webserver,
					
					// Checking for error
					success: function(data){
						$("#progress").css("display", "none");
						var result = data.substring(0,1);
						var msg = data.substring(1);
						if(result == "1"){
							message_box.show_message("Done", msg, 2, webserver);
						}else{
							message_box.show_message("Error", msg, 1, 1);
						}
					},
					error: function() {
						message_box.show_message("Error", "' . $l['connect_error'] . '", 1, 1);
					}
				});
				return false;
			});
		});
		// ]]></script>
		<center class="sai_tit">
			<img src="' . $theme['a_images'] . 'nginx_proxy.gif" />&nbsp;' . $l['lbl_head'] . '</img>
		</center>
		<div id="show_set">';
        show_proxy();
        echo '</div>';
    }
    // Display if DEFAULT WEBSERVER IS APACHE OR {PROXY IS ENABLED AND APACHE IS THE PROXY SERVER}
    if ($dserver == 'httpd' || !empty($proxy) && $proxy == 'httpd') {
        echo '
		<form accept-charset="' . $globals['charset'] . '" name="editsettings" method="post" action="" >
			<center class="sai_tit">
				<img src="' . $theme['a_images'] . 'apache_settings.gif" />&nbsp;' . $l['apachesettings'] . '
			</center>
			<table border="0" cellpadding="8" cellspacing="8" width="700px" align="center" class="sai_divroundshad" style="padding-left:15px; padding-top:15px;" >
				<tr>
					<td>
						<span class="sai_head">' . $l['suphp_enable'] . '</font></span><br/>
						<span class="sai_exp">' . $l['suphp_check'] . '</span>
					</td>
					<td>
						<input type="checkbox" name="suphpon" id="suphpon" ' . POSTchecked('suphpon', !$softpanel->getconf('NO_SUPHP')) . ' />
					</td>
				</tr>
				<tr>
					<td colspan="2">
						<p align="center">
							<input type="submit" class="sai_graybluebut" name="editapachesettings" value="' . $l['edit_settings'] . '" />
						</p>
					</td>
				</tr>
			</table>
		</form>';
    }
    softfooter();
}
Пример #27
-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();
}