示例#1
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();
}
示例#2
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();
}
示例#3
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();
}
示例#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 softheader($title = '', $leftbody = true)
{
    global $theme, $user, $logged_in, $globals, $l, $dmenus, $onload, $newslinks, $feeds, $softpanel, $iscripts, $catwise, $allcatwise, $soft, $classes_categories, $scripts, $apps, $apps_catwise;
    if (optGET('jsnohf')) {
        return true;
    }
    /* <script language="javascript" src="'.js_url('js/jquery.js', 'js/universal.js', 'js/suggest.js', 'js/smoothscroll.js', 'js/slider.js', 'js/dock.js').'" type="text/javascript"> </script> */
    $title = empty($title) ? $globals['sn'] : $title;
    $got_cache_js = get_cache_time();
    // Is there a Panel Header ?
    if (!empty($softpanel->pheader)) {
        echo $softpanel->pheader;
    }
    //Lets echo the top headers
    echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=' . $globals['charset'] . '" />
	<meta name="keywords" content="softaculous, software" />
	<title>' . $title . '</title>
	<link rel="stylesheet" type="text/css" href="' . $theme['this_url'] . '/style.css?' . $GLOBALS['globals']['version'] . '" />
	<link rel="stylesheet" type="text/css" href="' . $theme['url'] . '/bootstrap/css/bootstrap.min.css?' . $GLOBALS['globals']['version'] . '" />
	<link rel="stylesheet" type="text/css" href="' . $theme['url'] . '/font-awesome.css?' . $GLOBALS['globals']['version'] . '" />
	<!--[if IE 7]>
	<link rel="stylesheet" type="text/css" href="' . $theme['url'] . '/ie7.css?' . $GLOBALS['globals']['version'] . '">
	<![endif]-->
	<link rel="shortcut icon" href="' . $theme['images'] . '/' . asperapp('', 'webuzo/', 'ampps/') . 'favicon.ico" />
	<script language="javascript" src="' . $theme['url'] . '/js/jquery.js" type="text/javascript"></script>
	<script language="javascript" src="' . $theme['url'] . '/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
	<script language="javascript" src="' . $theme['url'] . '/js/combined.js?' . $GLOBALS['globals']['version'] . '" type="text/javascript"></script>
	<script language="javascript" src="' . $theme['this_url'] . '/cache/cache.js?' . $got_cache_js . '" type="text/javascript"> </script>
	</head>
	<body onload="bodyonload();">';
    // Show the EULA Notice in Interworx panel
    if (empty($user['eula_accept']) && $globals['softpanel'] == 'interworx') {
        echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
	
		var message_box = function(){			
				return {
					show_message: function(title, body , image) {			
						var okbtn = \'<input  style="width:75px" class="sai_submit" type="button" onclick="message_box.close_message(this.value);" value="Agree" name="okbtn" />\';	
						var cancelbtn = \'<input  style="width:75px" class="sai_submit" type="button" onclick="message_box.close_message(this.value);" value="Decline" name="cancelbtn" />\';
											
						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 width="100%" class ="msg_tr1" style="text-align:center">\' +  title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td class ="msg_tr3">\' + okbtn + \' &nbsp; &nbsp; \' + cancelbtn + \'</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 widt="60%" class ="msg_tr1">\' + title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td class ="msg_tr3">\' + okbtn + \'</td><td class ="msg_tr3">\' + cancelbtn + \'</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(action) {
						
						jQuery(\'.sai_message_box\').hide(\'fast\');
						
						if(action == "Agree"){
				
							$.ajax({
								type: "GET",
								url: window.location+"?&eula_accept=1",
								
								// Checking for error
								success: function(data){
								},
								error: function() {
								}													
							});
							
							return false;
							
						}else{
							alert("You must not use Softaculous if you do not agree to the EULA");
						}
					}
				}
			}();
	
		$(document).ready(function(){
			
			// Show the eula accept message
			var agree_msg = \'<center>You must agree to the <a href="http://www.softaculous.com/softaculous/eula" target="_blank">EULA</a> before using Softaculous</center>\';
			
			message_box.show_message("<a href=\\"http://www.softaculous.com/softaculous/eula\\" target=\\"_blank\\" style=\\"text-decoration:none\\">End User License Agreement</a>",agree_msg,1);
			
		});
		// ]]></script>';
    }
    echo '<div id="loading_soft" class="sai_loading_soft">
			<img src="' . $theme['images'] . 'fb_loader.gif" alt="Loading..." />
		</div>';
    echo '<table border="0" cellpadding="0" cellspacing="0" width="100%" class="sai_docktable">	
		<tr>
			<td align="left" width="440" valign="middle">
			<a href="' . $globals['ind'] . '"><img src="' . ($globals['softpanel'] == 'ampps' ? $theme['a_images'] . 'header.jpg' : (empty($globals['logo_url']) ? $globals['softpanel'] == 'webuzo' ? $theme['a_images'] . 'header.jpg' : $theme['images'] . 'header.gif' : $globals['logo_url'])) . '" alt="" /></a>
			</td>
			<td>&nbsp;</td>
			
			<td align="right" width="280" style="padding:8px" valign="top">
			
<ul id="dock" class="sai_dock">
' . (empty($globals['off_panel_link']) ? '<li><a href="' . $softpanel->theme['panel_url'] . '"><img src="' . $theme['images'] . 'panel.gif" alt="" tooltip="' . $l['go_cpanel'] . '" /></a></li>' : '') . '
<li>' . (webuzo() && !$softpanel->is_sysapps_disable() ? '<img src="' . $theme['images'] . 'panel.gif" alt="" tooltip="' . $l['go_cpanel'] . '" onclick="goto_panel();" style="cursor:pointer" /></a>' : '<a href="' . $globals['ind'] . '"><img src="' . $theme['images'] . 'home.gif" alt="" tooltip="' . $l['go_home'] . '" /></a>') . '</li>
' . (aefer() && allow_adddomain() ? '<li><a href="' . $globals['ind'] . 'act=domains"><img src="' . $theme['images'] . 'domains.gif" alt="" tooltip="' . $l['go_domain'] . '" /></a></li>' : '') . (webuzo() ? '<li><a href="' . $globals['ind'] . 'act=domainmanage"><img src="' . $theme['images'] . 'domains.gif" alt="" tooltip="' . $l['go_domain'] . '" /></a></li>' : '') . (empty($globals['off_demo_link']) ? '<li><a href="' . $globals['ind'] . 'act=demos"><img src="' . $theme['images'] . 'demos.gif" alt="" tooltip="' . $l['go_demos'] . '" /></a></li>' : '') . (empty($globals['off_rating_link']) ? '<li><a href="' . $globals['ind'] . 'act=ratings"><img src="' . $theme['images'] . 'ratings.gif" alt="" tooltip="' . $l['go_ratings'] . '" /></a></li>' : '') . '
<li><a href="' . $globals['ind'] . 'act=installations"><img src="' . $theme['images'] . 'installations.gif" alt="" tooltip="' . $l['go_installations'] . '" /></a></li>' . (webuzo() && !$softpanel->is_sysapps_disable() ? '<li><a href="' . $globals['ind'] . 'act=apps_installations"><img src="' . $theme['images'] . 'apps_installations.gif" alt="" tooltip="' . $l['go_apps_installations'] . '" /></a></li>' : '') . '
<li><a href="' . $globals['ind'] . 'act=eu_tasklist"><img src="' . $theme['images'] . 'tasklist.png" alt="" tooltip="' . $l['go_tasklist'] . '" /></a></li>
<li><a href="' . $globals['ind'] . 'act=settings"><img src="' . $theme['images'] . 'settings.gif" alt="" tooltip="' . $l['go_settings'] . '" /></a></li>' . (empty($globals['disable_backup_restore']) ? '<li><a href="' . $globals['ind'] . 'act=backups"><img src="' . $theme['images'] . 'backups.gif" alt="" tooltip="' . $l['go_backups'] . '" /></a></li>' : '') . ' 
' . (empty($globals['off_email_link']) ? '<li><a href="' . $globals['ind'] . 'act=email"><img src="' . $theme['images'] . 'emails.gif" alt="" tooltip="' . $l['go_email_settings'] . '" /></a></li>' : '') . (empty($globals['off_sync_link']) ? '<li><a href="' . $globals['ind'] . 'act=sync"><img src="' . $theme['images'] . 'sync.gif" alt="" tooltip="' . $l['go_sync'] . '" /></a></li>' : '') . (!empty($globals['eu_themes_premium']) && !empty($globals['lictype']) ? '<li><a href="' . $globals['ind'] . 'act=my_themes"><img src="' . $theme['images'] . 'pfx_icon.png" alt="" tooltip="' . $l['go_my_themes'] . '" /></a></li>' : '') . '
<li><a href="' . $globals['ind'] . 'act=help"><img src="' . $theme['images'] . 'help.gif" alt="" tooltip="' . $l['go_support'] . '" /></a></li>
</ul>
<span id="dock_titler" style="visibility:hidden; position:absolute; top:0px; left:0px; border:1px solid #DEDCD1; background-color:#FFFFFF; text-align:left; padding: 1px; width:auto; white-space:nowrap;"></span>
<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
softdock = new dock();
softdock.min = 30;
softdock.max = 50;
softdock.init();

function checksearchform(){
	if($_("inputString").value == ""){
		return false;
	}else{
		return true;
	}
};

function goto_panel(){
		
	var str = window.location; 	
	
	var port_find = str.toString().search(\'2003\'); 	

	if(port_find < 1){		
		var str_url = str.toString().replace("2002", "2004");
	}else{
		var str_url = str.toString().replace("2003", "2005");
	}
	
	var res = str_url.split("/",4);
	
	var res_out = res.join("/");	
	
	window.location = res_out+"/";
}

function set_pheader(){
	var cur_status = getcookie("pheader");
	if(cur_status == "no"){
		setcookie("pheader","yes",365);
	}else{
		removecookie("pheader");
		setcookie("pheader","no",365);
	}
	//alert(getcookie("pheader"));
	window.location.href = window.location;
}

$(document).ready(function(){
	
	$(".soft_cathead_slide").click(function(){
					
		var cat_head = $(this).attr("id");
		var tmp_img = cat_head.split("_");
		
		//$("#shift_"+tmp_img[1]).css("width", "1");
		var id = $("#leftcontent_"+tmp_img[1]);
		//alert(id.attr("id"))
		//alert(id.is(":visible"))
		
		if(id.css("display") == "none"){
			//id.show();
			id.slideDown("slow");			
			$("#icat"+tmp_img[1]).attr("src", "' . $theme['images'] . 'expanded.gif");
			setcookie(cat_head, 2, 365);
		}else{
			$("#icat"+tmp_img[1]).attr("src", "' . $theme['images'] . 'collapsed.gif");
			id.slideUp("slow");
			removecookie(cat_head);
		
			setcookie(cat_head, "", -365);
			
		}
		
	});
});

// ]]></script>

			</td>			
		</tr>	
	</table>';
    $temp_allcatwise = $allcatwise;
    // Classes are only avaialable to Premium License
    if (empty($globals['disable_classes']) && !empty($globals['lictype'])) {
        $temp_allcatwise['classes'] = 'Classes';
    }
    // Webuzo has the APPs support
    if (webuzo()) {
        $disablesysapps = $softpanel->is_sysapps_disable();
        if (empty($disablesysapps)) {
            $temp_allcatwise['apps'] = 'Apps';
            $allcatwise['apps'] = $apps_catwise;
        } else {
            if ($globals['mode'] == 'apps') {
                redirect('');
                return false;
            }
        }
    }
    echo '<table border="0" cellpadding="0" cellspacing="0" width="100%" height="35">	
	<tr>
		<td width="5" align="right">&nbsp;</td>
		<td width="10" align="right"><img src="' . $theme['images'] . 'leftheader.gif" alt="" /></td>
		<td width="60" align="left" class="sai_softac_header sai_headtd">
		<a href="' . $globals['ind'] . '"><img src="' . $theme['images'] . 'home_bar.gif" alt="' . $l['go_home'] . '" /></a>
		</td>
		
		<td align="left" class="sai_softac_header">&nbsp;&nbsp;' . (!empty($globals['panel_hf']) && !empty($softpanel->can_shrink_nativeui) ? '<a href="javascript:set_pheader();" id="pheader_view" ><img src="' . $theme['this_images'] . ($_COOKIE['pheader'] == 'yes' ? 'expand.png" title="' . $l['expand_view'] . '"' : 'collapse.png" title="' . $l['collapse_view'] . '"') . '></a>' : '');
    if (empty($globals['nolabels'])) {
        echo '&nbsp; Scripts : &nbsp; <a href="' . $globals['ind'] . 'ind=' . $globals['mode'] . '" style="font-size:15px">' . ($globals['mode'] == 'js' ? 'JavaScripts' : ($globals['mode'] == 'classes' ? 'Classes' : (asperapp(0, 1, 0) ? $globals['mode'] == 'java' ? 'JAVA' : ($globals['mode'] == 'python' ? 'Python' : strtoupper($globals['mode'])) : strtoupper($globals['mode'])))) . '</a>';
        foreach ($temp_allcatwise as $k => $v) {
            echo empty($temp_allcatwise[$k]) || $globals['mode'] == $k ? '' : '&nbsp; <a href="' . $globals['ind'] . 'ind=' . $k . '" >' . ($k == 'js' ? 'JavaScripts' : ($k == 'classes' ? 'Classes' : ($k == 'java' || $k == 'apps' || $k == 'python' ? ucfirst($k) : strtoupper($k)))) . '</a>';
        }
    }
    echo '</td><td align="right" class="sai_softac_header"> ' . (webuzo() && $softpanel->getCurrentUser() == 'root' ? $l['root_login'] : '') . '&nbsp; ' . $l['welcome'] . ' ' . (empty($softpanel->user['displayname']) ? $softpanel->user['name'] : $softpanel->user['displayname']) . ' [<a href="' . $softpanel->theme['logout'] . '">' . $l['logout'] . '</a>] &nbsp; &nbsp;	
		</td>	
		
		<td width="168" align="left" class="sai_softac_header sai_search" valign="middle">
			<form accept-charset="' . $globals['charset'] . '" name="search" method="post" action="' . $globals['ind'] . 'act=search&smode=' . $globals['mode'] . '" onsubmit="return checksearchform();" id="searchform">
			<input type="text" name="inputString" id="inputString" style="border:none" class="sai_search_box" onfocus="suggestjs.show(0, this.id);" value="' . $l['search'] . '" onKeyUp="suggestjs.myKeyDownHandler(event, this.value);" autocomplete="off" onblur="suggestjs.show(1);" sugurl="' . $globals['index'] . '&act=suggest&smode=' . $globals['mode'] . '" mode="' . $globals['mode'] . '"/>
			<input type="hidden" name="hidden_cid" id="hidden_cid">
			<div id="suggestions" class="sai_suggestions" style="position:absolute;width:200px;left:0px; top:0px; display:none;"></div>
			</form>			
		</td>
		
		<td width="10" align="left"><img src="' . $theme['images'] . 'rightheader.gif" alt="" /></td>
		<td width="5" align="left">&nbsp;</td>
	</tr>	
	</table>
	<br />';
    //The Menus of softwares
    if (!empty($leftbody)) {
        $theme['leftbody'] = $leftbody;
        echo '<table border="0" cellpadding="8" cellspacing="0" width="100%" class="sai_softwares">	
	<tr>
		<td align="left" valign="top" width="' . (!empty($softpanel->leftpanel_resize) ? '192' : '220') . '" class="sai_softmenu">';
        $ind = $globals['mode'];
        //This is done for the SLIDER
        $js_cat = array();
        foreach ($allcatwise[$ind] as $cat => $softs) {
            if (empty($softs)) {
                continue;
            }
            $js_cat[] = $cat;
        }
        echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
			imgurl = "' . $theme['images'] . '";
			softmenu = new slider();
			if(!isIE){
				softmenu.speed = 5;
			}
			softmenu.elements = new Array(\'cat' . implode('\', \'cat', $js_cat) . '\');
			softmenu.expanded = new Array("catlibraries");
			//addonload(\'softmenu.init();\');
			
			timers = new Object();
			
			function incwidth(elid, to, inc){
				eleid = "shift_"+elid;
				clearTimeout(timers[eleid]);
				current = parseInt($_(eleid).width);
				
				tobecome = current + inc;
				if(tobecome >= to){
					tobecome = to;
				}
				
				$_(eleid).width = tobecome;
				r = parseInt(255 - current*2);
				g = parseInt(255 - current);
				
				$("#head_"+elid).css("background", "rgb("+r+", "+g+", 255)");
				
				if(tobecome < to){
					timers[eleid] = setTimeout("incwidth(\\""+elid+"\\", "+to+", "+inc+")", 20);
				}
			};
			
			function decwidth(elid, to, dec){
				eleid = "shift_"+elid;
				
				clearTimeout(timers[eleid]);
				current = parseInt($_(eleid).width);
				tobecome = current - dec;
				if(tobecome < to){
					tobecome = to;
				}
				$_(eleid).width = tobecome;
				r = parseInt(255 - current*2);
				g = parseInt(255 - current);
				$("#head_"+elid).css("background", "rgb("+r+", "+g+", 255)");
				
				if(tobecome > to){
					timers[eleid] = setTimeout("decwidth(\\""+elid+"\\", "+to+", "+dec+")", 20);
				}else{
					$("#head_"+elid).css("background", "rgb(255, 255, 255)");
				}		
			};
			
			function ajax_listsoftware(str_id){
				
				$("#softcontent").fadeOut(0);
				$_("loading_soft").style.top = (scrolledy()+250)+"px";
				$("#loading_soft").show();
				
				$("#softcontent").load("' . $globals['indexmode'] . 'act=listsoftwares&cat="+str_id+"&jsnohf=1", 
					function(){
						$("#loading_soft").hide();
						$("#softcontent").fadeIn(300);
					}
				);
				
				window.location.hash = "!act=listsoftwares&cat="+str_id;
			}
			
// ]]></script>
		
<div id="softmenu">';
        if ($ind == 'classes' || optGET('act') == 'classes') {
            echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
	
	(function($) {
		$.extend($.fx.step,{
			backgroundPosition: function(fx) {
				if (fx.state === 0 && typeof fx.end == \'string\') {
					var start = $.curCSS(fx.elem,\'backgroundPosition\');
					if(typeof(start) == "undefined"){
						start = $.css(fx.elem, "background-position-x")+\' \'+$.css(fx.elem, "background-position-y");
					}
					start = toArray(start);
					fx.start = [start[0],start[2]];
					var end = toArray(fx.end);
					fx.end = [end[0],end[2]];
					fx.unit = [end[1],end[3]];
				}
				var nowPosX = [];
				nowPosX[0] = ((fx.end[0] - fx.start[0]) * fx.pos) + fx.start[0] + fx.unit[0];
				nowPosX[1] = ((fx.end[1] - fx.start[1]) * fx.pos) + fx.start[1] + fx.unit[1];
				fx.elem.style.backgroundPosition = nowPosX[0]+\' \'+nowPosX[1];
	
			   function toArray(strg){
				   strg = strg.replace(/left|top/g,\'0px\');
				   strg = strg.replace(/right|bottom/g,\'100%\');
				   strg = strg.replace(/([0-9\\.]+)(\\s|\\)|$)/g,"$1px$2");
				   var res = strg.match(/(-?[0-9\\.]+)(px|\\%|em|pt)\\s(-?[0-9\\.]+)(px|\\%|em|pt)/);
				   return [parseFloat(res[1],10),res[2],parseFloat(res[3],10),res[4]];
			   }
			}
		});
	})(jQuery);
	
		
	// navigation background fading effect . it will work only on loading external javascript file jquery.bgpos.js in js folder
	$(function(){
			$("#cmenu li ").css( {backgroundPosition:"0px -120px"})
			.mouseover(function()
			{
					 $(this).stop().animate({ backgroundPosition:"(0px 0px)",
					 marginLeft: "5px"}, {duration:400});
			})
			.mouseout(function()
			{
						$(this).stop().animate({backgroundPosition:"(0px -120px)",
						marginLeft: "0px"}, {duration:400, complete:function(){
						$(this).css({backgroundPosition: "0px -120px"})
						}});
			})
		});
	
	// this function will add blue arrow after clicking	
	$(function(){
		$("#cmenu li a").click(function(){
			 $("#cmenu li a ").removeClass("selected");
			 $(this).addClass("selected");
		 })
	});
	
	//function to display list of classes
	function show_list(start, length, cat){
		$("#softcontent").fadeOut(0);
		$_("loading_soft").style.top = (scrolledy()+250)+"px";
		$("#loading_soft").show();
		$("#softcontent").html("");
		goto_top();	
		$.getJSON("' . $globals['api_nuphp'] . 'category_classes.php?cat="+cat+"&in=json&start="+start+"&length="+length+"&callback=?", 
		function (data) {
			if (typeof(data.data)!="object" || typeof data.data == "undefined"){
			  $("#loading_soft").hide();//hide fb loader
			  $("#softcontent").html("<center><span class=\'sai_newhead\'>' . $l['classes_con_failed'] . '</span></center>");	
			  $("#softcontent").fadeIn(300);
			}
			var soft_classes = \'<div class="bg"><br /><div class="row row_usi_cls">\';
			var br = 1; 
			$.each(data.data, function (i, item) {
				soft_classes += \'<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12" style="padding-bottom: 20px;"><div class="sai_classes_boxgrid2" onclick=window.location=this.id; id="' . $globals['index'] . 'act=classes&cid=\'+item.cid+\'&tab=overview" ><div class="sai_classes_boxgrid"><div><h2>\'
				+item.name+
				\'</h2><p style="padding:10px;height:50px;">\'
				+item.desc+\'</p><p style="padding:10px;height:15px;"> <b>' . $l['cl_ratings'] . '</b> : \'
				+parseFloat(item.ratings)+\'/5</p> </div><div style="height:200px;"><br /><h2>\'
				+item.name+
				\'</h2><p style="margin-left:10px;margin-top:15px"><b> ' . $l['cl_author'] . '</b> : \'
				+item.author+\'</p><p style="margin-left:10px;"><b> ' . $l['cl_license'] . '</b> :\'
				+item.license+\'</p><p style="margin-left:10px;"><b> ' . $l['cl_version'] . '</b> :\'
				+item.version+\'</p><div align="center"> <a href="' . $globals['index'] . 'act=classes&cid=\'+item.cid+\'&tab=install" class="sai_cbutton"> ' . $l['cl_install_but'] . ' </a><a href="' . $globals['index'] . 'act=classes&cid=\'+item.cid+\'&tab=file" class="sai_cbutton"> ' . $l['cl_show_files'] . '</a></div></div></div></div></div>\';
				 
				 br += 1 ;
			});// end of each loop
	
			soft_classes += "</div></div>";
			
			$("#softcontent").append(soft_classes); 
			
			// Pagination Coding
			var p1 = 0; // Start variable for mysql api . length is set to 12
			
			// Find which is the current page
			var current = (start/length) + 1;
			var class_pagination = \'<center><div class="pagination"><ul>\';
			for (i=1; i<=data.pages; i++)
			{
				var page_class = "sai_cbutton";
				if(i == current){
					page_class += " selected_page";
				}			
				
				class_pagination += \'<li style="display:inline;font-size:18px;font-style:italic;margin-right:3px;cursor:pointer"><a class="\'+page_class+\'" style="background: #F5F5F5;color:#000;" onclick="show_list(\'+p1+\',12, \\\'\'+data.class_category+\'\\\');" href="javascript:void(0)" >\'+ i+\'</a></li>\';
				p1+=12;
			}
			
			class_pagination+= \'</ul></div></center>\';	
	
			$("#softcontent").append(class_pagination);
			$("#loading_soft").hide();//hide fb loader
			$("#softcontent").fadeIn(300);	
					
			window.location.hash = "!act=listclasses&cat="+data.class_category;	
			
			$(".sai_classes_boxgrid").hover(function(){$(this).stop().animate({top:"-200px"},{queue:false,duration:200});},function() 
			{$(this).stop().animate({top:"0px"},{queue:true,duration:200});});
			
			 }); // end of get json function
	
	}//end of show list
	
// ]]></script>';
            echo '<div><ul class="sai_cmenu" id="cmenu">';
            ksort($classes_categories);
            foreach ($classes_categories as $key => $value) {
                echo '<li>
					<div class ="blue_select">
						<a onclick="show_list(0, 12, \'' . $key . '\');  return false;" href="javascript:void(0)" >' . $l['classes_' . $key] . '</a>
					</div>
				</li>';
            }
            echo '</ul></div>';
        } else {
            // end of $ind == 'classes'
            echo '<table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<td>
				<div id="load_leftpanel_js"></div>';
            $icat = 0;
            $str = '<script>
				var cat_lang = new Array();
				var catimg_from_site = new Array();
				';
            foreach ($allcatwise as $i_ind => $ind_type) {
                foreach ($ind_type as $cat => $softs) {
                    if (empty($softs)) {
                        continue;
                    }
                    // If we have any cat images to be load from our website
                    if (!empty($GLOBALS['catimgs'][$i_ind . '_' . $cat])) {
                        $str .= 'catimg_from_site[\'' . $i_ind . '_' . $cat . '\'] = "' . $GLOBALS['catimgs'][$i_ind . '_' . $cat] . '";';
                    }
                    $str .= 'cat_lang[\'cat_' . $i_ind . '_' . $cat . '\'] = "' . $l['cat_' . $i_ind . '_' . $cat] . '";';
                }
            }
            $str .= '
				var iscripts = new Array("' . implode('", "', array_keys($iscripts)) . '");
				var apps = new Array("' . implode('", "', array_keys($apps)) . '");
				</script>';
            echo $str;
            echo '</td>
			</tr></table>';
            echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[

			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;
			}
			
			var ind_types_array = new Array("ind_php", "ind_perl", "ind_java", "ind_python");
			
			var all_ind_types_array = new Array("ind_php", "ind_perl", "ind_java", "ind_apps", "ind_js", "ind_python");
			
			function initiate_status(){
				var main = $("#softmain tr");
				
				main.each(function(){
					
					var cookie_id = $(this).closest("tr").attr("id");
					var if_isset = getcookie(cookie_id);
					var tmp_cookieid = String(cookie_id);
					if(if_isset == 2 && tmp_cookieid != "undefined"){
						
						//alert(if_isset+"--"+ cookie_id)
						var id = $($("#"+cookie_id).next("tr").find("div"));
						//alert(id.attr("id")+ " -- "+if_isset+"--"+ cookie_id)
						id.show();	
						var tmp_img = tmp_cookieid.split("_");
						$("#icat"+tmp_img[1]).attr("src", "' . $theme['images'] . 'expanded.gif");
					}
				});
			}
			
			function show_left_panel(combine){
				var str_html = "";
				var icat = 0;
				
				$.each(allcatwise, function (i_ind, ind_type) {
					$.each(ind_type, function (i, item) {
						
						if(catimg_from_site[i_ind+\'_\'+i] != undefined || catimg_from_site[i_ind+\'_\'+i] != null){
							var catimg = catimg_from_site[i_ind+\'_\'+i];
						}else{
							var catimg = "' . $theme['images'] . 'cats/"+i_ind+"_"+i+".gif";
						}
						
						var if_isset = getcookie("head_"+icat);
						var tmp_cookieid = String("head_"+icat);
						var display_open = "none";
						if(if_isset == 2 && tmp_cookieid != "undefined"){
							display_open = "block";
						}
						var show_combined = true;
						var isset_ind = ' . (isset($_GET['ind']) ? '"' . $_GET['ind'] . '"' : '0') . ';
						
						if(!isset_ind){
							isset_ind = ' . (isset($_GET['act']) ? '"' . $_GET['act'] . '"' : '0') . ';
						}
						
						if(!in_array("ind_"+isset_ind, all_ind_types_array)){
							isset_ind = "php";
						}
						
						if(isset_ind == "software"){
							isset_ind = "php";
						}
						
						if(isset_ind){
							var show_i_ind = isset_ind;
						}else{
							var show_i_ind = "php";
						}
						//alert("cat_"+i_ind+"_"+i);
						var cat_key = "cat_"+i_ind+"_"+i;
						
						// If all scripts in that category is disabled by Admin it was showing "undefined" so to resolve this we have written the following code.
						if(typeof cat_lang[cat_key] == "undefined"){
							for(x in ind_types_array){
								var tmp_arr = String(ind_types_array[x]).split("_");
								var tmp_cat_key = "cat_"+tmp_arr[1]+"_"+i;
								if(typeof cat_lang[tmp_cat_key] != "undefined" && typeof cat_lang[tmp_cat_key] == "string"){
									var cat_key = tmp_cat_key;
								}
								
							}
						}
						
						str_html += \'<table border="0" cellpadding="2" cellspacing="0" id="softmain" width="100%" >\';
						
						if(i_ind == "js" && i == "libraries"){
							var links_class = "softlib";
						}else{
							var links_class = "softlinks";
						}
						
						if(i_ind == show_i_ind && typeof cat_lang[cat_key] != "undefined"){
							
						str_html += \'<tr id="head_\'+icat+\'" class="soft_cathead_slide" onmouseout="decwidth(\\\'\'+icat+\'\\\', 1, 1)" onmouseover="incwidth(\\\'\'+icat+\'\\\', 12, 1)"><td width="1" id="shift_\'+icat+\'"></td><td class="soft_cathead" ><a href="' . (empty($globals['lictype']) ? '#' : $globals['indmode'] . 'act=listsoftwares&cat=\'+i+\'') . '" onclick="ajax_listsoftware(\\\'\'+i+\'\\\'); return false;"><img src="\'+catimg+\'" alt="" />&nbsp;&nbsp;\'+cat_lang[cat_key]+\'</a></td>' . (empty($globals['lictype']) ? '<td align="left" width="10"><a href="http://www.softaculous.com/softwares/\'+i+\'"><img src="' . $theme['this_images'] . 'external.gif" alt="" /></a></td>' : '') . '<td width="10"><a href="javascript:void(0);"><img src="' . $theme['images'] . 'collapsed.gif" alt="" valign="top" id="icat\'+icat+\'"/></a></td></tr><tr><td colspan="2"><div id="leftcontent_\'+icat+\'" style="display:none;" class="\'+links_class+\'">\';
						
						$.each(item, function (sid, softw) {
							var tmp_sid = sid.split("_");
							sid = tmp_sid[1];
							
							var acts = softw.type;
							if(acts == "php"){
								acts = "software";
							}
							
							var soft = "soft";
							
							if(acts == "app" || acts == "service"){
								acts = "apps";
								soft = "app";
							}
							
							var searchin = iscripts;
							
							if(soft == "app"){
								searchin = apps;
							}
							
							var li_classes = "";
							
							' . (!empty($soft) ? 'if(' . $soft . ' == sid) li_classes = "class=\\"softlinkscurrent\\"";' : '') . '
							
							if((softw.parent != undefined || softw.parent != null) && in_array(softw.parent, iscripts)){
								return;
							}
							
							if(!in_array(sid, searchin)){
								return;
							}
							
							//alert(isset_ind +"--||"+ not_selected_ind)
							if(isset_ind){
								
								for(x in ind_types_array){
									//alert(ind_types_array[x]);
									var get_ind_type = getcookie(ind_types_array[x]);
									if(get_ind_type == "yes"){
										var tmp_arr = String(ind_types_array[x]).split("_");
										removecookie(get_ind_type);
										setcookie(get_ind_type, "no", 365);
										$("#"+tmp_arr[1]).removeClass("soft_nav_selected");
										//$("#"+tmp_arr[1]).addClass("soft_nav_selected");
									}
								}
								
								show_combined = false;
							}
							
							if(combine){
								show_combined = true;
								$("#"+combine).addClass("soft_nav_selected");
							}
							
							if(acts == "apps"){
								show_combined = true;
							}
							var start_span = "";
							var end_span = "";
							if(li_classes != ""){
								var start_span = \'<span \'+li_classes+\'>\';
								var end_span = \'</span>\';
							}
							
							if(in_array(sid, searchin) && show_combined){
								
								str_html += start_span+\'<a href="' . $globals['ind'] . 'act=\'+acts+\'&\'+soft+\'=\'+sid+\'" title="\'+softw.desc+\'">\'+softw.name+\'</a>\'+end_span;
							}
							
							if(softw.type == i_ind && !show_combined){
								str_html += start_span+\'<a href="' . $globals['ind'] . 'act=\'+acts+\'&\'+soft+\'=\'+sid+\'" title="\'+softw.desc+\'">\'+softw.name+\'</a>\'+end_span;
							}
						});
						
						}
						str_html += \'</div></td></tr></table>\';
						icat = icat + 1;
						
					});	
				});
				
				$("#load_leftpanel_js").html(str_html);
				
			}
			
			var on_index_page = ' . (isset($_GET['ind']) ? '"' . $_GET['ind'] . '"' : '0') . ';
						
			if(!on_index_page){
				on_index_page = ' . (isset($_GET['act']) ? '"' . $_GET['act'] . '"' : '0') . ';
			}
			
			if(!on_index_page){
				show_left_panel(1);
			}else{
				show_left_panel(0);
			}
			
			initiate_status();			
// ]]></script>';
        }
        echo '</td>
		<td valign="top" style="padding-left:20px;">';
    }
    //Everything else will go here
    echo '<div id="softcontent" style="padding:0px; margin:0px;" >';
}
示例#6
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();
}
示例#7
0
function sclone_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error, $scripts;
    global $software, $soft, $info, $settings, $init_tab, $dbtype, $dbs, $installed, $__settings, $setupcontinue, $installations, $notes, $cron, $datadir, $ajaxdb, $ajaxdbexists, $overwrite_option, $protocols, $nopackage, $can_publish, $not_default, $child, $install_option, $multi_ver, $child_sids, $installation_keys, $no_autoupgrade, $ajaxhttpsexists, $ajaxhttps, $insid, $cloned, $new_insid;
    if (optGET('ajaxdownload') && !empty($nopackage)) {
        // Try to download the package
        if (method_exists($softpanel, 'updatesoftwares')) {
            $softpanel->updatesoftwares($soft, 0, 0, 1);
            echo 1;
            return true;
        }
        // False call
        echo 0;
        return false;
    }
    // Give the status
    if (optGET('ajaxstatus')) {
        $_status = soft_progress(optGET('ajaxstatus'));
        $tmp_status = unserialize($_status[1]);
        $_status[1] = $tmp_status['current_status'];
        if (!empty($_status)) {
            echo implode('|', $_status);
            return true;
        }
        // False call
        echo 0;
        return false;
    }
    if (!empty($ajaxdb)) {
        echo $ajaxdbexists;
        return true;
    }
    if (!empty($ajaxhttps)) {
        echo $ajaxhttpsexists;
        return true;
    }
    softheader($l['<title>']);
    if (!empty($cloned)) {
        echo '
		<div class="bg">
			<h4>' . $l['congrats'] . '</h4><br />
			' . $software['name'] . ' ' . $l['succesful'] . ' : <br />
			<a href="' . $__settings['softurl'] . '" target="_blank">' . $__settings['softurl'] . '</a>
			' . (!empty($software['adminurl']) ? '<br />' . $l['admin_url'] . ' : <a href="' . $__settings['softurl'] . '/' . $software['adminurl'] . '" target="_blank">' . $__settings['softurl'] . '/' . $software['adminurl'] . '</a>' : '') . '<br /><br />
			' . (!empty($setupcontinue) ? $l['setup_continue'] . ' : <br />
			<a href="' . $__settings['softurl'] . '/' . $setupcontinue . '" target="_blank">' . $__settings['softurl'] . '/' . $setupcontinue . '</a><br /><br />' : '') . '
			' . $l['enjoy'] . '<br /><br />
			' . (!empty($notes) ? $l['install_notes'] . ' : <br />
			<div class="sai_notes">' . softparse($notes, $soft) . '</div><br /><br />' : '') . '
			' . $l['please_note'] . '<br /><br />
			' . $l['regards'] . ',<br />
			' . $l['softinstaller'] . '<br /><br />
			<center><b><a href="' . script_link($soft) . '&highlight=' . $new_insid . '&postact=clone" class="sai_head">' . $l['return'] . '</a></b></center><br /><br />';
        if (empty($globals['clone_tweet_off']) || empty($globals['lictype'])) {
            echo '
				<form method="get" action="http://twitter.com/intent/tweet" id="tweet" onsubmit="return dotweet(this);">
					<div class="panel panel-info" style="width:55%; margin:0 auto;">
						<div class="panel-heading" style="padding:5px; font-size:15px;">
							<font><b>' . $l['clone_tweet_sub'] . ' :</b></font>
						</div>
						<div class="panel-body">
							<div class="row">
								<div class="col-sm-10">
									<textarea name="text" cols="80" row="3" style="resize:none; width:100%;">' . loadtweetdata('clone_tweet', $l['clone_tweet']) . '</textarea>
								</div>
								<div class="col-sm-2 col-xs-2">
									<input type="submit" value="Tweet!" class="btn btn-info" onsubmit="return false;" id="twitter-btn" style="margin-top:20px;"/>
								</div>
							</div>
						</div>
					</div>
				</form>';
        }
        echo '
		</div><!--end of bg class--><!--PROC_DONE-->
		<br /><br />';
    } else {
        echo '
		<div id="install_win">
			<div id="fadeout_div">
				<form accept-charset="' . $globals['charset'] . '" name="clonesoftware" method="post" action="" onsubmit="return checkform();" id="clonesoftware">
			
					<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
					
					function checkform(dosubmit){
						
						try{
							if(!formcheck()){
								return false;
							}
						}catch(e){
							//Do nothing
						}
						$_("softsubmitbut").disabled = true;	
						
						if(!get_package()){
							return false;
						}
						
						if(useprog){
							
							// Send a request to check the status
							progressbar.start();
							
							// Return false so that the form is not submitted
							return false;
						
						// This is OLD School !
						}else{		
							if(dosubmit == 1){			
								$_("clonesoftware").submit();	
							}
							show_msg("' . $l['cloning'] . '");
						}
						
						return true;
						
					};
					
					var progressbar = {
						timer: 0,
						total_width: 0,	
						status_key: "",
						synctimer: 0,
						fadeout_div: "#fadeout_div",
						win_div: "#install_win",
						progress_div: "#progress_bar",
						formid: "#clonesoftware",
						frequency: 8000,
						
						current: function(){
							try{
								var tmp_cur = Math.round(parseInt($_("progress_color").width)/parseInt($_("table_progress").width)*100);
								if(tmp_cur > 100){
									tmp_cur = 99;
								}
								return tmp_cur;
							}catch(e){
								return -1;	
							}
						},
						
						reset: function(){ try{
							clearTimeout(this.timer);
							$_("progress_color").width = 1;
						}catch(e){ }},
						
						move: function(dest, speed, todo){ try{
							var cur = this.current();
							if(cur < 0){
								clearTimeout(this.timer);
								return false;
							}
							var cent = cur + 1;
							var new_width = cent/100*this.total_width;
							if(new_width < 1){
								new_width = 1;
							}
							//alert(new_width+" "+dest+" "+cent);
							$_("progress_color").width = new_width;
							$_("progress_percent").innerHTML = "("+cent+" %)";
							
							if(cent < dest){
								this.timer = setTimeout("progressbar.move("+dest+", "+speed+")", speed);
							}else{
								eval(todo);	
							}
						}catch(e){ }},
						
						text: function(txt){ try{
							$_("progress_txt").innerHTML = txt;
						}catch(e){ }},
						
						sync: function(){
							if(progressbar.status_key.length < 2){
								return false;
							}
							$.ajax({
								url: window.location+"&ajaxstatus="+progressbar.status_key+"&random="+Math.random(),
								type: "GET",
								success: function(data){
									if(data == 0) return false;
									var tmp = data.split("|");
									var cur = progressbar.current();
									tmp[2] = (3000/(tmp[0]-cur));
									//alert(tmp);
									if(tmp[0] > cur){
										if(parseInt(tmp[2]) == 0){
											tmp[2] = 800;
										}
										progressbar.move(tmp[0], tmp[2]);
									}
									progressbar.text(tmp[1]);
									progressbar.synctimer = setTimeout("progressbar.sync()", progressbar.frequency);
								}
							});
						},
						
						sync_abort: function(){
							clearTimeout(this.synctimer);
						},
						
						start: function(){ try{
							this.post();
							this.reset();
							this.total_width = parseInt($_("table_progress").width);
							this.move(95, 800);
							this.status_key = $("#soft_status_key").attr("value");
							this.sync();
						}catch(e){ }},
						
						post: function(){
							
							// Scroll to the Top and show the progress bar
							goto_top();
							$(progressbar.fadeout_div).fadeOut(500, 
								function(){
									$(progressbar.progress_div).fadeOut(1);
									$(progressbar.progress_div).fadeIn(500);
								}
							);
							
							try{
								var sid = $_("softbranch").value;
							}catch(e){
								var sid = ' . $soft . '
							}
							
							$.ajax({
								url: window.location+"&jsnohf=1&soft="+sid+"&multi_ver=1",
								type: "POST",
								data: $(progressbar.formid).serialize(),
								complete: function( jqXHR, status, responseText ) {
									
									progressbar.sync_abort();
									
									// Store the response as specified by the jqXHR object
									responseText = jqXHR.responseText;
									
									try{
										if(responseText.match(/\\<\\!\\-\\-PROC_DONE\\-\\-\\>/gi)){
											progressbar.text("' . addslashes($l['finishing_process']) . '");
											progressbar.move(99, 10, "$(progressbar.progress_div).fadeOut(1)");
										}else{
											progressbar.reset();
										}
									}catch(e){ }
									
									if ( jqXHR.isResolved() ) {
									
										// #4825: Get the actual response in case
										// a dataFilter is present in ajaxSettings
										jqXHR.done(function( r ) {
											responseText = r;
										});
								
										// Create a dummy div to hold the results
										// inject the contents of the document in, removing the scripts
										// to avoid any "Permission Denied" errors in IE
										//var newhtml = jQuery("<div>").append(responseText).find(progressbar.win_div).html();
										//alert(responseText);
										$(progressbar.win_div).animate({opacity: 0}, 1000, "", function(){
											$(progressbar.win_div).html(responseText);
											new_theme_funcs_init();
										}).delay(50).animate({opacity: 1}, 500);
										
										//alert(newhtml);
										
									}else{
										alert("Oops ... the connection was lost");
									}
								}
							});
						}
					};
					
					function show_msg(msg){	
						$_("show_txt").innerHTML = "<br /><br /> &nbsp; "+msg+" &nbsp; <img src=\\"' . $theme['images'] . 'progress.gif\\" />";
						$_("show_txt").style.display = "";
					}
					
					// Is the package there ?
					var nopackage = ' . (empty($nopackage) ? 0 : 1) . ';
					
					// Use the Progress Bar ?
					var useprog = 1; 
					try{
						if(BrowserDetect.browser.toLowerCase() == "safari" && BrowserDetect.version.toString().substr(0, 1) == "3"){
							useprog = 0;
						}
					}catch(e){ }
					
					function get_package(){	
						if(nopackage){
							
							show_msg("' . $l['downloading'] . '");
							
							try{		
								AJAX("' . script_link($soft) . '&ajaxdownload=1&random="+Math.random(), "get_package_handle(re)");
							}catch(e){ }
							
							return false;
						}else{
							$_("show_txt").style.display = "none";
							return true;
						}
					};
					
					function get_package_handle(resp){
						nopackage = 0;
						show_msg("' . $l['cloning'] . '");
						checkform(1);
					};
					
					function checkhttps(proto_id, softdomain_id, alrt){
						try{
							var id = $_(proto_id);
							var proto = id.options[id.selectedIndex].text;
						
							$("#checkhttps_wait").css("display","inline-block");
							if(proto.indexOf("https") !== -1){
							
								 $.ajax({
									type: "POST",
									url: "' . script_link($soft) . '&checkhttps="+encodeURIComponent(proto+$_(softdomain_id).value),
									timeout:10000,
									// Checking for error
									success: function(data){
										$("#checkhttps_wait").css("display","none");
										is_https(data);
									},
									error: function(jqXHR, status, e) {
										$("#checkhttps_wait").css("display","none");
										is_https(e);
										return false;
									}
								}); 
								
								//AJAX("' . script_link($soft) . '&checkhttps="+id.options[id.selectedIndex].text+$_(softdomain_id).value, "is_https(re)");
							}else{
								$("#checkhttps_wait").css("display","none");
								is_https("true");
							}
							if(alrt == true){
								alert(proto+$_(softdomain_id).value);
							}
						}catch(e){
							//
						}
						return true;
					};
					
					function is_https(re){
						try{
							httpserror = "";
							
							//Check if it exists
							if(re !== "true"){
								httpserror = "' . $l['no_https'] . '";
							}
							if(httpserror != ""){
								$_("httpserror").style.display = "block";
								$_("httpserror").innerHTML = httpserror;
								return false;
							}else{
								$_("httpserror").style.display = "none";
							}
							
						}catch(e){
							//
						}
						return true;
					};
					';
        if (!empty($dbtype)) {
            echo 'function checkdbname(id, alrt){
							try{		
								AJAX("' . script_link($soft) . '&checkdbexists="+$_(id).value, "dbexists(\'"+id+"\', "+alrt+", re)");	
							}catch(e){
								//
							}
							return true;
						};
						
						function dbexists(id, alrt, re){
							try{
								
								dberror = "";
								
								//Is the length fine
								if($_(id).value.length > ' . (empty($softpanel->maxdblen) ? 7 : $softpanel->maxdblen) . '){
									dberror = "' . $l['db_name_long'] . '";
								}
								
								//There should be only alphanumeric characters
								if(/[^a-zA-Z0-9]/.test($_(id).value) && !' . aefer() . '0){
									dberror = "' . $l['db_alpha_num'] . '";
								}
								
								//Check if it exists
								if(re == "true"){
									dberror = "' . $l['database_exists'] . '";
								}
								
								if(dberror != ""){
									$_(id+"error").style.display = "block";
									$_(id+"error").innerHTML = dberror;
									if(alrt == true){
										alert(dberror);
									}
									return false;
								}else{
									$_(id+"error").style.display = "none";
								}
								
							}catch(e){
								//
							}
							return true;
						};';
        }
        //End of if($dbtype)
        echo '
					// ]]></script>';
        echo '
					<div class="bg"><br />						
						<div class="row sai_main_head" style="width:100%;" align="center">
							<div class="col-sm-6 col-xs-5" style="padding:0 10px 0 0; text-align:right;">
								<i class="fa sai-copy fa-2x" style="color:#00A0D2;"></i>
							</div>
							<div class="col-sm-6 col-xs-7" style="padding-top:10px; padding-left:0; text-align:left;">' . $l['prog_cloning'] . $software['name'] . '</div>
						</div>';
        if (empty($globals['lictype']) && !empty($scripts[$soft]['force_scripts'])) {
            echo '<br />
							<div class="alert alert-warning">
								<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
								<center>' . lang_vars($l['not_in_free'], array($software['name'])) . (!webuzo() ? '&nbsp;&nbsp;' . $l['notify_admin'] : '') . '</center>
							</div>';
        }
        echo error_handle($error, "100%", 0, 1);
        echo '
						<div style="padding: 0 25px;"><br />
							<div class="sai_sub_head">' . $l['clone_ins'] . '</div><hr>';
        if (empty($softpanel->noprotocol)) {
            echo '
								<div class="row">
									<div class="col-sm-5">
										<label for="softproto" class="sai_head">' . $l['choose_protocol'] . '</label><br />
										<span class="sai_exp2">' . $l['choose_protocol_exp'] . '</span>
									</div>
									<div class="col-sm-7">
										<select name="softproto" id="softproto" class="form-control" onblur="checkhttps(\'softproto\', \'softdomain\', false)">';
            foreach ($protocols as $k => $v) {
                echo '<option value="' . $k . '" ' . (optPOST('softproto') == $k || $globals['default_protocol'] == $k && empty($_POST['softproto']) ? 'selected="selected"' : '') . '>' . $v . '</option>';
            }
            echo '
										</select>
										<div style="display:none;" id="checkhttps_wait">&nbsp;&nbsp;<img src="' . $theme['images'] . 'progress.gif" alt="please wait..">
										</div><br />
										<div class="row">
											<div class="col-sm-12">
												<span id="httpserror" style="display:none; font-size:12px; padding:10px;" class="alert alert-danger"></span>
											</div>
										</div>
									</div>
								</div>';
        }
        echo '
							<div class="row">
								<div class="col-sm-5">
									<label for="softdomain" class="sai_head">' . $l['choose_domain'] . '</label><br />
									<span class="sai_exp2">' . $l['choose_domain_exp'] . '</span>
								</div>
								<div class="col-sm-7">
									<select name="softdomain" id="softdomain" class="form-control" onchange="softmail();" onblur="checkhttps(\'softproto\', \'softdomain\', false)">';
        foreach ($softpanel->domainroots as $domain => $dompath) {
            echo '<option value="' . $domain . '" ' . (!empty($_POST['softdomain']) && $_POST['softdomain'] == $domain ? 'selected="selected"' : '') . '>' . $domain . '</option>';
        }
        echo '
									</select>
								</div>
							</div><br />
							
							<div class="row">
								<div class="col-sm-5">
									<label for="softdirectory" class="sai_head">' . $l['in_directory'] . '</label><br />
									<span class="sai_exp2">' . $l['in_directory_exp'] . '</span>
								</div>
								<div class="col-sm-7">
									<input type="text" name="softdirectory" id="softdirectory" class="form-control" size="30" value="' . POSTval('softdirectory', !empty($globals['no_prefill']) ? '' : $software['softname']) . '" />
								</div>
							</div><br />';
        // A data Directory ?
        if (!empty($datadir)) {
            echo '
								<div class="row">
									<div class="col-sm-5">
										<label for="datadir" class="sai_head">' . $l['datadir'] . '</label><br />
										<span class="sai_exp2">' . $l['datadir_exp'] . '</span>
									</div>
									<div class="col-sm-7">
										<input type="text" name="datadir" id="datadir" class="form-control" size="30" value="' . POSTval('datadir', $datadir) . '" />
									</div>
								</div><br />';
        }
        if (!empty($dbtype)) {
            $dbname = mysqldbname($software['softname']);
            if (method_exists($softpanel, 'mysqldbname')) {
                $dbname = $softpanel->mysqldbname();
            }
            echo '
								<div class="row">
									<div class="col-sm-5">
										<label for="softdb" class="sai_head">' . $l['database_name'] . '</label><br />
										<span class="sai_exp2">' . (aefer() ? $l['database_name_exp_aefer'] : $l['database_name_exp']) . '</span>
									</div>
									<div class="col-sm-7">
										<input type="text" name="softdb" id="softdb" class="form-control" size="30" value="' . POSTval('softdb', $dbname) . '" onblur="checkdbname(\'softdb\', false)" />
										<span id="softdberror" style="background: #FDB3B3; display:none; width:200px;"></span>
									</div>
								</div><br />';
            if (!empty($softpanel->no_db_create)) {
                // Database Username
                echo '
									<div class="row">
										<div class="col-sm-5">
											<label for="dbusername" class="sai_head">' . $l['dbusername'] . '</label><br />
											<span class="sai_exp2">' . $l['dbusername_exp'] . '</span>
										</div>
										<div class="col-sm-7">
											<input type="text" name="dbusername" id="dbusername" class="form-control" size="30" value="' . POSTval('dbusername', '') . '" />
										</div>
									</div><br />';
                // Database Password
                echo '
									<div class="row">
										<div class="col-sm-5">
											<label for="dbuserpass" class="sai_head">' . $l['dbuserpass'] . '</label><br />
											<span class="sai_exp2">' . $l['dbuserpass_exp'] . '</span>
										</div>
										<div class="col-sm-7">
											<input type="text" name="dbuserpass" id="dbuserpass" class="form-control" size="30" value="' . POSTval('dbuserpass', '') . '" />
										</div>
									</div><br />';
                //Database Host Name
                echo '
									<div class="row">
										<div class="col-sm-5">
											<label for="hostname" class="sai_head">' . $l['hostname'] . '</label><br />
											<span class="sai_exp2">' . $l['hostname_exp'] . '</span>
										</div>
										<div class="col-sm-7">
											<input type="text" name="hostname" id="hostname" class="form-control" size="30" value="' . POSTval('hostname', 'localhost') . '" />
										</div>
									</div><br />';
            }
        }
        if (!empty($cron)) {
            echo '
								<div class="row">
									<div class="col-sm-5">
										<span class="sai_head">' . $l['cron_job'] . '</span><br />
										<span class="sai_exp2">' . $l['cron_job_exp'] . '</span>
									</div>
									<div class="col-sm-7">
										<div class="row">
											<div class="col-sm-2">
												<span>' . $l['cron_min'] . '</span>	
												<input type="text" class="form-control" name="cron_min" id="cron_min" size="2" value="' . POSTval('cron_min', $cron['min']) . '" />
											</div>
											<div class="col-sm-2">
												<span>' . $l['cron_hour'] . '</span>
												<input type="text" class="form-control" name="cron_hour" id="cron_hour" size="2" value="' . POSTval('cron_hour', $cron['hour']) . '" />
											</div>
											<div class="col-sm-2">
												<span>' . $l['cron_day'] . '</span>
												<input type="text" class="form-control" name="cron_day" id="cron_day" size="2" value="' . POSTval('cron_day', $cron['day']) . '" />
											</div>
											<div class="col-sm-2">
												<span>' . $l['cron_month'] . '</span>
												<input type="text" class="form-control" name="cron_month" id="cron_month" size="2" value="' . POSTval('cron_month', $cron['month']) . '" />
											</div>
											<div class="col-sm-2">
												<span>' . $l['cron_weekday'] . '</span>
												<input type="text" class="form-control" name="cron_weekday" id="cron_weekday" size="2" value="' . POSTval('cron_weekday', $cron['weekday']) . '" />
											</div>
										</div>
									</div>
								</div><br />';
        }
        if (!empty($overwrite_option)) {
            echo '
								<div class="row">
									<div class="col-sm-5">
										<label class="sai_head">' . $l['overwrite'] . '</label>
									</div>
									<div class="col-sm-7">
										<input type="checkbox" name="overwrite_existing" id="overwrite_existing" />
									</div>
								</div><br />';
        }
        echo '
							<br />
						</div>';
        // The Clone details form
        echo '
						<div class="bg info_block">
						
							<div class="sai_sub_head">' . $l['info'] . '</div><hr style="border-color: #D1D2D3;">
								
							<div class="row">
								<div class="col-sm-5 col-xs-5">
									<span class="sai_head">' . $l['ins_softname'] . '</span>
								</div>
								<div class="col-sm-6 col-xs-6">
									<span class="sai_info">' . $software['name'] . '</span>
								</div>
							</div><br />
							
							<div class="row">
								<div class="col-sm-5 col-xs-5">
									<span class="sai_head">' . $l['ins_num'] . '</span>
								</div>
								<div class="col-sm-6 col-xs-6">
									<span class="sai_info">' . $user['ins'][$insid]['insid'] . '</span>
								</div>
							</div><br />
							
							<div class="row">
								<div class="col-sm-5 col-xs-5">
									<span class="sai_head">' . $l['ins_ver'] . '</span>
								</div>
								<div class="col-sm-6 col-xs-6">
									<span class="sai_info">' . $user['ins'][$insid]['ver'] . '</span>
								</div>
							</div><br />
								
							<div class="row">
								<div class="col-sm-5 col-xs-5">
									<span class="sai_head">' . $l['ins_time'] . '</span>
								</div>
								<div class="col-sm-6 col-xs-6">
									<span class="sai_info">' . datify($user['ins'][$insid]['itime']) . '</span>
								</div>
							</div><br />
								
							<div class="row">
								<div class="col-sm-5 col-xs-5">
									<span class="sai_head">' . $l['ins_path'] . '</span>
								</div>
								<div class="col-sm-6 col-xs-6">
									<span class="sai_info">' . $user['ins'][$insid]['softpath'] . '</span>
								</div>
							</div><br />
								
							<div class="row">
								<div class="col-sm-5 col-xs-5">
									<span class="sai_head">' . $l['ins_url'] . '</span>
								</div>
								<div class="col-sm-6 col-xs-6">
									<span class="sai_info"><a href="' . $user['ins'][$insid]['softurl'] . '" target="_blank">' . $user['ins'][$insid]['softurl'] . '</a></span>
								</div>
							</div><br />';
        if (!empty($user['ins'][$insid]['admin_folder']) || !empty($scripts[$soft]['admin_url'])) {
            $adminurl = $user['ins'][$insid]['softurl'] . '/' . (!empty($user['ins'][$insid]['admin_folder']) ? $user['ins'][$insid]['admin_folder'] : $scripts[$soft]['admin_url']);
            echo '
								<div class="row">
									<div class="col-sm-5 col-xs-5">
										<span class="sai_head">' . $l['ins_admin_url'] . '</span>
									</div>
									<div class="col-sm-6 col-xs-6">
										<span class="sai_info"><a href="' . $adminurl . '" target="_blank">' . $adminurl . '</a></span>
									</div>	
								</div><br />';
        }
        echo '
						
							' . (empty($user['ins'][$insid]['wwwdir']) ? '' : '
								<div class="row">
									<div class="col-sm-5 col-xs-5">
										<span class="sai_head">' . $l['ins_wwwdir'] . '</span>
									</div>
									<div class="col-sm-6 col-xs-6">
										<span class="sai_info">' . $user['ins'][$insid]['wwwdir'] . '</span>
									</div>
								</div><br />
							') . '
								
							' . (empty($user['ins'][$insid]['wwwurl']) ? '' : '
								<div class="row">
									<div class="col-sm-5 col-xs-5">
										<span class="sai_head">' . $l['ins_wwwurl'] . '</span>
									</div>
									<div class="col-sm-6 col-xs-6">
										<span class="sai_info">' . $user['ins'][$insid]['wwwurl'] . '</span>
									</div>
								</div><br />
							') . '
								
								
							' . (empty($user['ins'][$insid]['softdatadir']) ? '' : '
								<div class="row">
									<div class="col-sm-5 col-xs-5">
										<span class="sai_head">' . $l['ins_datadir'] . '</span>
									</div>
									<div class="col-sm-6 col-xs-6">
										<span class="sai_info">' . $user['ins'][$insid]['softdatadir'] . '</span>
									</div>
								</div><br />
							') . '	
								
							' . (empty($user['ins'][$insid]['softdb']) ? '' : '
								<div class="row">
									<div class="col-sm-5 col-xs-5">
										<span class="sai_head">' . $l['ins_db'] . '</span>
									</div>
									<div class="col-sm-6 col-xs-6">
										<span class="sai_info">' . $user['ins'][$insid]['softdb'] . '</span>
									</div>
								</div><br />
							') . '	
								
							' . (empty($user['ins'][$insid]['softdbuser']) ? '' : '
								<div class="row">
									<div class="col-sm-5 col-xs-5">
										<span class="sai_head">' . $l['ins_dbuser'] . '</span>
									</div>
									<div class="col-sm-6 col-xs-6">
										<span class="sai_info">' . $user['ins'][$insid]['softdbuser'] . '</span>
									</div>		
								</div><br />
							') . '	
								
							' . (empty($user['ins'][$insid]['softdbhost']) ? '' : '
								<div class="row">
									<div class="col-sm-5 col-xs-5">
										<span class="sai_head">' . $l['ins_dbhost'] . '</span>
									</div>
									<div class="col-sm-6 col-xs-6">
										<span class="sai_info">' . $user['ins'][$insid]['softdbhost'] . '</span>
									</div>		
								</div><br />
							') . '	
								
							' . (empty($user['ins'][$insid]['cron_command']) ? '' : '
								<div class="row">
									<div class="col-sm-5 col-xs-5">
										<span class="sai_head">' . $l['ins_cron_command'] . '</span>
									</div>
									<div class="col-sm-6 col-xs-6">
										<span class="sai_info">' . base64_decode($user['ins'][$insid]['cron_command']) . '</span>
									</div>			
								</div><br />
							') . '
								
						</div><br /><br /><!--end of bg class-->
								
						<p align="center">
							<input type="hidden" name="softsubmit" id="softsubmit" value="' . $l['softsubmit'] . '" />
							<input type="hidden" name="cloneins" id="cloneins" value="' . $l['cloneins'] . '" />
							<input type="submit" name="softsubmitbut" class="flat-butt" id="softsubmitbut" value="' . $l['cloneins'] . '" /><span id="show_txt" style="display:none;"></span>
						</p><br /><br />
					
						<input type="hidden" name="soft_status_key" id="soft_status_key" value="' . POSTval('soft_status_key', generateRandStr(32)) . '" />
						
						<center><b><a href="' . script_link($soft) . '" class="sai_head">' . $l['return'] . '</a></b></center><br /><br />';
        echo '
					</div><!--end of bg class-->
				</form>
			</div>
		
			<div id="progress_bar" style="display: none; width: 100%;">
				<br />
				<div class="bg">
					<center>
						<div class="row sai_main_head" style="width:100%;" align="center">
							<div class="col-sm-5 col-xs-5" style="padding:0 10px 0 0; text-align:right;">
								<i class="fa sai-copy fa-2x" style="color:#00A0D2;"></i>
							</div>
							<div class="col-sm-7 col-xs-7" style="padding-top:10px; padding-left:0; text-align:left;">' . $l['prog_cloning'] . $software['name'] . '</div>
						</div>
						<br />
						<font size="4" color="#222222" id="progress_txt" style="width: 100%;">' . $l['checking_data'] . '</font>
						<font style="font-size: 18px;font-weight: 400;color: #444444; width: 100%;" id="progress_percent">(0 %)</font><br /><br />
					</center>
					<table width="500" cellpadding="0" cellspacing="0" id="table_progress" border="0" align="center" height="28" style="border:1px solid #CCC; -moz-border-radius: 5px;
					-webkit-border-radius: 5px; border-radius: 5px;background-color:#efefef; width: 50%;">
						<tr>
							<td id="progress_color" width="1" style="background-image: url(' . $theme['images'] . 'bar.gif); -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px;"></td>
							<td id="progress_nocolor">&nbsp;</td>
						</tr>
					</table>
					<br />
					<center>' . $l['wait_note'] . '</center><br /><br />
				</div><!--end of bg class--><br /><br />
			</div><br /><br /><br /><br />';
        echo '
		</div><br /><br />';
    }
    softfooter();
}
示例#8
0
function listuser_theme()
{
    global $theme, $globals, $user, $l, $langs, $error, $reseller, $iscripts, $plans, $done, $_cpplan, $_users, $allcatwise, $_resellers, $loaded_scripts, $softpanel, $listusers, $SESS;
    if (optGET('ajaxdel')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        if (!empty($done)) {
            echo '1' . $l['delete'];
            return true;
        }
    }
    if (optGET('ajaxedit')) {
        if (!empty($error)) {
            echo '0' . current($error);
            return false;
        }
        if (!empty($done)) {
            echo '1' . $l['edit'];
            return true;
        }
    }
    softheader($l['<title>']);
    echo '<br /><form accept-charset="' . $globals['charset'] . '" name="listuser" 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);
    echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
	
// For msgbox
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\', scrolledy() + 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\', scrolledy() + 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\', scrolledy() + 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\', scrolledy() + 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\');
			var deltmp = did.split("--soft--");
			$.ajax({				
				type: "POST",				
				url: window.location+"&ajaxdel=1&deluser="******"&delowner="+deltmp[0],				
				// checking for error
				success: function(data){
					var result = data.substring(0,1);					
					var msg = data.substring(1);
					if(result == "1"){
						message_box.show_message("Delete ", msg, 2);
						$_("tr"+did).style.display = "none";
					}
					if(result == "0"){
						message_box.show_message("Error ", msg, 1);
					}
				},				
				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(){
	
	// For deleting record
	$(".delete").click(function() {
		var did = $(this).attr(\'id\');
		did = did.substr(3);
		var tmp_ress = did.split("--soft--");
		message_box.delete_message (\'Warning\',(tmp_ress[0] == tmp_ress[1] ? \'' . $l['del_res_user'] . '\' : \'' . $l['del_user'] . '\'), did);			
	});
	
	// Cancel
	$(".cancel").click(function() {
		var cid = $(this).attr(\'id\');
		cid = cid.substr(3);
		$("#cid"+cid).css("display", "none");
		$("#eid"+cid).attr("src","' . $theme['images'] . 'editdetail.gif");
		$("#nof_entry"+cid).css("display", "none");
		$("#updateuser_entry"+cid).css("display", "none");
		$("#nof"+cid).css("display", "");
		$("#updateuser"+cid).css("display", "");
		if(' . (ent() ? 1 : 0) . '){
				$("#uid_entry"+cid).css("display", "none");
				$("#uid"+cid).css("display", "");
				$("#gid_entry"+cid).css("display", "none");
				$("#gid"+cid).css("display", "");
		}
	});

	// For editing record
	$(".edit").click(function() {
		var id = $(this).attr(\'id\');
		id = id.substr(3);
		edittmp = id.split("--soft--");
		$("#cid"+id).css("display", "");
		
		if($(this).attr(\'src\') == "' . $theme['images'] . 'save.gif"){
			var nof = $(\'#nof_entry\'+id).val();
			var updateuser = $(\'#updateuser_entry\'+id).val();
			if(' . (ent() ? 1 : 0) . '){
				var uid = $(\'#uid_entry\'+id).val();
				var gid = $(\'#gid_entry\'+id).val();
			}
			$.ajax({
				type: "POST",
				url: window.location+"&ajaxedit=1&moduser="******"&updateuser="******"&nof="+nof+"&modowner="+edittmp[0]' . (ent() ? '+"&uid="+uid+"&gid="+gid' : '') . ',
								
				// checking for error
				success: function(data){
					//alert(data);
					var result = data.substring(0,1);
					var msg = data.substring(1);
					if(result == "0"){
						message_box.show_message( "Error ",msg,1);
					}
					if(result == "1"){
						message_box.show_message( "Done ",msg,2);
						$(\'#nof\'+id).html($("#nof_entry"+id).val());
						var new_user = $("#updateuser_entry"+id).val();
						
						if(edittmp[0]!=edittmp[1]){
		
							var ahref_val = $("#ah"+id).attr("href");
							var ahref_val = ahref_val.replace(edittmp[1], new_user);
							$("#ah"+id).attr("href", ahref_val);
							
							$(\'#updateuser\'+id).html(new_user);
							$(\'#tr\'+edittmp[0]+\'--soft--\'+edittmp[1]).attr("id", \'tr\'+edittmp[0]+\'--soft--\'+new_user);
							$(\'#updateuser\'+edittmp[0]+\'--soft--\'+edittmp[1]).attr("id", \'updateuser\'+edittmp[0]+\'--soft--\'+new_user);
							$(\'#updateuser_entry\'+edittmp[0]+\'--soft--\'+edittmp[1]).attr("id", \'updateuser_entry\'+edittmp[0]+\'--soft--\'+new_user);
							$(\'#nof\'+edittmp[0]+\'--soft--\'+edittmp[1]).attr("id", \'nof\'+edittmp[0]+\'--soft--\'+new_user);
							$(\'#nof_entry\'+edittmp[0]+\'--soft--\'+edittmp[1]).attr("id", \'nof_entry\'+edittmp[0]+\'--soft--\'+new_user);
							$(\'#eid\'+edittmp[0]+\'--soft--\'+edittmp[1]).attr("id", \'eid\'+edittmp[0]+\'--soft--\'+new_user);
							$(\'#did\'+edittmp[0]+\'--soft--\'+edittmp[1]).attr("id", \'did\'+edittmp[0]+\'--soft--\'+new_user);
							$(\'#cid\'+edittmp[0]+\'--soft--\'+edittmp[1]).attr("id", \'cid\'+edittmp[0]+\'--soft--\'+new_user);
							$(\'#ah\'+edittmp[0]+\'--soft--\'+edittmp[1]).attr("id", \'ah\'+edittmp[0]+\'--soft--\'+new_user);
						}
						
						if(' . (ent() ? 1 : 0) . '){
							$(\'#uid\'+id).html($("#uid_entry"+id).val());
							$(\'#gid\'+id).html($("#gid_entry"+id).val());
						}
					}
					$(\'#eid\'+edittmp[0]+\'--soft--\'+new_user).attr("src","' . $theme['images'] . 'editdetail.gif");
				},
				error: function() {
					message_box.show_message("Error",\'' . $l['connect_error'] . '\',1);
				}
			});
			$(this).attr("src","' . $theme['images'] . 'progress.gif");
			$("#cid"+id).css("display", "none");
			$("#nof_entry"+id).css("display", "none");
			$("#nof"+id).css("display", "");
			$("#updateuser_entry"+id).css("display", "none");
			$("#updateuser"+id).css("display", "");
			if(' . (ent() ? 1 : 0) . '){
				$("#uid_entry"+id).css("display", "none");
				$("#uid"+id).css("display", "");
				$("#gid_entry"+id).css("display", "none");
				$("#gid"+id).css("display", "");
			}
		}else{
			$(this).attr("src","' . $theme['images'] . 'save.gif");
			if(edittmp[0]==edittmp[1]){
				$("#nof"+id).css("display", "none");
				$("#nof_entry"+id)
					.val($("#nof"+id).text())
					.css("display", "")
					.focus();
			}
			
			if(edittmp[0]!=edittmp[1]){
				$("#updateuser"+id).css("display", "none");
				$("#updateuser_entry"+id)
					.val($("#updateuser"+id).text())
					.css("display", "")
					.focus();
			}
			
			if(' . (ent() ? 1 : 0) . '){
				$("#uid"+id).css("display", "none");
				$("#uid_entry"+id)
					.val($("#uid"+id).text())
					.css("display", "")
					.focus();
				$("#gid"+id).css("display", "none");
				$("#gid_entry"+id)
					.val($("#gid"+id).text())
					.css("display", "")
					.focus();
			}
		}
	});
});
	
// ]]></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>
		
		
		<form accept-charset="' . $globals['charset'] . '" name="ussearch" method="GET" action="">
		<table cellspacing="0" cellpadding="10" border="0" width="95%" align="center" class="showsearch">
			<tr>
				<td>
					<span class="fhead">' . $l['user_name'] . ': </span>
				</td>
				<td>
					<input type="text" name="usersearch" id="usersearch" size="30" value="' . POSTval('usersearch', '') . '" />
				</td>
				<td>
					<input type="submit" name="search" value="' . $l['submit'] . '" class="sai_graybluebut" />
				</td>
			</tr>
		</table>
		</form>
		
		';
    if (!empty($listusers)) {
        page_links($globals['num_res'], $globals['cur_page'], $globals['reslen']);
        echo '<br />
		<table border="0" cellpadding="8" cellspacing="1" width="95%" class="sai_altrowstable" style="margin:0px auto;">
			<tr>
				<th align="center" class="sai_head" width="20%">' . $l['owner'] . '</th>
				<th align="center" class="sai_head" width="20%">' . $l['user_name'] . '</th>
				<th align="center" class="sai_head" width="10%">' . $l['login'] . '</th>
				<th align="center" class="sai_head" width="20%">' . $l['number_of_users'] . '</th>';
        if (ent()) {
            echo '<th align="center" class="sai_head" width="10%">' . $l['uid'] . '</th>
					<th align="center" class="sai_head" width="10%">' . $l['gid'] . '</th>';
        }
        echo '<th align="center" class="sai_head" width="20%">' . $l['option'] . '</th>
			</tr>';
        $i = 1;
        foreach ($listusers as $k => $v) {
            $_k = str_replace($v['owner'] . '_', '', $k);
            echo '<tr class="' . ($i % 2 == 0 ? "sai_evenrowcolor" : "sai_oddrowcolor") . '" id="tr' . $v['owner'] . '--soft--' . $v['username'] . '">
				
						<td>' . $v['owner'] . '</td>
						<td><span id="updateuser' . $v['owner'] . '--soft--' . $v['username'] . '">' . $v['username'] . '</span>
						<input type="text" id="updateuser_entry' . $v['owner'] . '--soft--' . $v['username'] . '" style="display:none;"></td>
						
						<td>' . ($k != $softpanel->user['owner'] . '_' . $softpanel->user['username'] ? '<a href="https://' . $globals['HTTP_HOST'] . '/index.php?api_key=' . $softpanel->user['api_key'] . '&api_pass='******'api_pass'] . '&createSession=' . $_k . '&owner=' . $v['owner'] . '" target="_blank" id="ah' . $v['owner'] . '--soft--' . $v['username'] . '"><img src="' . $theme['images'] . 'arrow_right.gif" height="28px"/></a>' : '') . '</td>
				
						<td><span id="nof' . $v['owner'] . '--soft--' . $v['username'] . '">' . (empty($v['num_users']) ? '-' : $v['num_users']) . '</span>
						<input type="text" id="nof_entry' . $v['owner'] . '--soft--' . $v['username'] . '" style="display:none;width:45px;" ></td>';
            if (ent()) {
                echo '<td><span id="uid' . $v['owner'] . '--soft--' . $v['username'] . '">' . (empty($v['_uid']) ? '-' : $v['_uid']) . '</span>
							<input type="text" id="uid_entry' . $v['owner'] . '--soft--' . $v['username'] . '" style="display:none;width:35px;" ></td>
					
							<td><span id="gid' . $v['owner'] . '--soft--' . $v['username'] . '">' . (empty($v['_gid']) ? '-' : $v['_gid']) . '</span>
							<input type="text" id="gid_entry' . $v['owner'] . '--soft--' . $v['username'] . '" style="display:none;width:35px;" ></td>';
            }
            echo '<td align="center">
						<table width="100%" border="0">
						<tr>';
            if (ent()) {
                if (defined('SOFTRESELLER') ? !($v['owner'] == $v['username']) : !($v['owner'] == $v['username'] && $v['owner'] == 'root')) {
                    echo '<td width="33%"><img title="Edit" class="edit" id="eid' . $v['owner'] . '--soft--' . $v['username'] . '" src="' . $theme['images'] . 'edit.gif" style="cursor:pointer" />&nbsp;&nbsp;</td>
					
								<td width="33%"><img title="Delete" class="delete" id="did' . $v['owner'] . '--soft--' . $v['username'] . '" src="' . $theme['images'] . 'remove.gif" style="cursor:pointer" />&nbsp;&nbsp;</td>
							
								<td width="33%"><img title="Cancel" class="cancel" id="cid' . $v['owner'] . '--soft--' . $v['username'] . '" src="' . $theme['images'] . 'del.gif" style="display:none;cursor:pointer"  />
								</td>';
                } else {
                    echo '<td align="center">-</td>';
                }
            }
            if (aefer()) {
                // Do not allow to edit the user himself
                if ($k != $softpanel->user['owner'] . '_' . $softpanel->user['username']) {
                    echo '<td width="33%"><img title="Edit" class="edit" id="eid' . $v['owner'] . '--soft--' . $v['username'] . '" src="' . $theme['images'] . 'edit.gif" style="cursor:pointer" />&nbsp;&nbsp;</td>
								<td width="33%"><img title="Delete" class="delete" id="did' . $v['owner'] . '--soft--' . $v['username'] . '" src="' . $theme['images'] . 'remove.gif" style="cursor:pointer" />&nbsp;&nbsp;</td>
								<td width="33%"><img title="Cancel" class="cancel" id="cid' . $v['owner'] . '--soft--' . $v['username'] . '" src="' . $theme['images'] . 'del.gif" style="display:none;cursor:pointer"  />';
                } else {
                    echo '-';
                }
                echo '</td>';
            }
            echo '</tr>
						</table>';
            $i++;
        }
        echo '</table>';
        page_links($globals['num_res'], $globals['cur_page'], $globals['reslen']);
    } else {
        echo '<div class="sai_notice">' . $l['no_users'] . '</div>';
    }
    echo '</td>
	</tr>
	<tr>
		
	</tr>
	</td>
	</tr>
	<tr><td></td></tr>
</table>
<br/>
<p align="center"><a href="' . $globals['ind'] . 'act=adduser" style="text-decoration:none;"><span class="sai_graybluebut">' . $l['adduser'] . '</a></p>
</form>';
    softfooter();
}
示例#9
0
function softheader($title = '', $leftbody = true)
{
    global $theme, $user, $logged_in, $globals, $l, $dmenus, $onload, $newslinks, $act, $iscripts, $catwise, $softpanel;
    // If it is reseller the title should be changed
    if (defined('SOFTRESELLER')) {
        $title = $l['reseller_title'];
    }
    $title = empty($title) ? $globals['sn'] : $title;
    //Lets echo the top headers
    echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=' . $globals['charset'] . '" />
	<meta name="keywords" content="softaculous, software" />
	<title>' . $title . '</title>
	<link rel="stylesheet" type="text/css" href="' . $theme['url'] . '/admin/style.css?' . $GLOBALS['globals']['version'] . '" />
	
	<link rel="shortcut icon" href="' . $theme['images'] . '/' . asperapp('', 'webuzo/', 'ampps/') . 'favicon.ico" />
	<script language="javascript" src="' . js_url('js/jquery.js', 'js/universal.js', 'js/domdrag.js', 'js/smoothscroll.js', 'js/script_select.js') . '" type="text/javascript"></script>
	</head>
	<body onload="bodyonload();">';
    echo '<table width="750" border="0" cellpadding="0" cellspacing="0" align="center" class="body" id="abody">
	<tr><td>
	
	<div class="' . asperapp('', 'w', 'a') . 'adminheader">
	<div style="height:80px">&nbsp;</div>
	<table border="0" cellpadding="2" cellspacing="0" width="100%" class="adminmenu">
		<tr>
			<td class="adminmenutd tabicons' . (empty($act) ? ' tabgrey' : '') . '" align="center" width="80">
				<a href="' . $globals['ind'] . '" style="display:block;">' . $l['tab_home'] . '</a>
			</td>
			
			<td class="adminmenutd tabicons' . (in_array($act, array('settings', 'email', 'topscripts', 'emailtemp', 'categories', 'webuzoconfigs', 'editini', 'errorlog', 'no_autoupgrade', 'import_export', 'root_pass', 'webuzo_acl')) ? ' tabgrey' : '') . '" align="center" onmouseover=" $_(\'subsettings\').style.display=\'block\';" onmouseout="$_(\'subsettings\').style.display=\'none\';" id="settings" width="80">
				<a href="' . $globals['ind'] . 'act=settings" style="display:block;">' . $l['tab_settings'] . '</a>
			</td>';
    if (!defined('SOFTRESELLER')) {
        echo '
				<td class="adminmenutd tabicons' . (in_array($act, array('softwares', 'customscripts', 'adv_software', 'script_requirement')) ? ' tabgrey' : '') . '" align="center" onmouseover=" $_(\'subsoftwares\').style.display=\'block\';" onmouseout="$_(\'subsoftwares\').style.display=\'none\';" id="softwares" width="90">
					<a href="' . $globals['ind'] . 'act=softwares" style="display:block;">' . $l['tab_softwares'] . '</a>
				</td>';
        echo '
				<td class="adminmenutd tabicons' . ($act == 'updates' ? ' tabgrey' : '') . '" align="center" width="80">
					<a href="' . $globals['ind'] . 'act=updates" style="display:block;">' . $l['tab_updates'] . '</a>
				</td>';
    }
    // Is the installations function there ?
    if (method_exists($softpanel, 'listinstallations')) {
        echo '
				
				<td class="adminmenutd tabicons' . ($act == 'installations' ? ' tabgrey' : '') . '" align="center" onmouseover=" $_(\'subinstallations\').style.display=\'block\';" onmouseout="$_(\'subinstallations\').style.display=\'none\';" id="installations" width="80">
					<a href="' . $globals['ind'] . 'act=installations" style="display:block;">' . $l['tab_installations'] . '</a>
				</td>';
    }
    if ($globals['softpanel'] != 'ampps' && $globals['softpanel'] != 'webuzo' && $globals['softpanel'] != 'aefer' && $globals['softpanel'] != 'enterprise') {
        if ($globals['softpanel'] != 'isp' && $globals['softpanel'] != 'cwp') {
            echo '			
					<td class="adminmenutd tabicons' . ($act == 'plans' ? ' tabgrey' : '') . '" align="center" width="80" onmouseover=" $_(\'subplans\').style.display=\'block\';" onmouseout="$_(\'subplans\').style.display=\'none\';" id="plans" >
						<a href="' . $globals['ind'] . 'act=plans" style="display:block;">' . $l['tab_plans'] . '</a>
					</td>';
        }
    }
    if ($globals['softpanel'] == 'aefer' || $globals['softpanel'] == 'enterprise') {
        echo '
				
				<td class="adminmenutd tabicons' . ($act == 'adduser' ? ' tabgrey' : '') . '" align="center" width="90" onmouseover=" $_(\'subuser\').style.display=\'block\';" onmouseout="$_(\'subuser\').style.display=\'none\';" id="user" >
					<a href="' . $globals['ind'] . 'act=listuser" style="display:block;">' . $l['user'] . '</a>
				</td>';
    }
    if ($globals['softpanel'] == 'enterprise') {
        echo '
				
				<td class="adminmenutd tabicons' . ($act == 'listdomains' ? ' tabgrey' : '') . '" align="center" width="90" onmouseover=" $_(\'domains\').style.display=\'block\';" onmouseout="$_(\'domains\').style.display=\'none\';" id="domain">
					<a href="' . $globals['ind'] . 'act=listdomains" style="display:block;">Domain</a>
				</td>';
    }
    if (webuzo()) {
        echo '
				
				<td class="adminmenutd tabicons" align="center" width="90">
					<a href="javascript:goto_panel()" style="display:block;">' . $l['tab_goto_enduser'] . '</a>
				</td>';
    }
    if ($globals['softpanel'] == 'webuzo' || $globals['softpanel'] == 'aefer' || $globals['softpanel'] == 'enterprise') {
        echo '
				
				<td class="adminmenutd tabicons' . ($act == 'logout' ? ' tabgrey' : '') . '" align="center" width="90">
					<a href="' . $globals['ind'] . 'act=logout" style="display:block;">' . $l['tab_logout'] . '</a>
				</td>';
    } else {
        if (!defined('SOFTRESELLER') && $globals['softpanel'] != 'ampps') {
            echo '
					
					<td class="adminmenutd tabicons' . ($act == 'import' ? ' tabgrey' : '') . '" align="center" width="90">
						<a href="' . $globals['ind'] . 'act=import" style="display:block;">' . $l['tab_import'] . '</a>
					</td>';
        }
    }
    echo '
		</tr>		
	</table>
	<br />
	<script>
	
		// For Webuzo
		function goto_panel(){
			
			var str = window.location;
			var find_port = str.toString().search(\'2005\');
			
			if(find_port < 1){
				var str_url = str.toString().replace("2004", "2002");
			}else{
				var str_url = str.toString().replace("2005", "2003");
			}
	
			var res = str_url.split("/",4);
			
			var res_out = res.join("/");	
			
			window.location = res_out+"/";
		}
		
		function dropsubmenu(element){
	
			$("#"+element).bind("mouseenter",function(e){
				var prod = findelpos($_($(this).attr("id")));
				var tabheight = 32;
				var tabwidth = 0;
		 			
				$(".subheads").css("left" , prod[0]-tabwidth);
				$(".subheads").css("top" , prod[1]+tabheight);
				$(".subheads").css("border" , "1px solid #eee");			  
		
			});
		}
		
		$(document).ready(function(){
			dropsubmenu("installations");
			dropsubmenu("settings");
			dropsubmenu("softwares");
			dropsubmenu("plans");
			dropsubmenu("user");
			dropsubmenu("domain");
		});
	</script>		
	
	<table class="subheads" id="subinstallations" onmouseover="$_(\'subinstallations\').style.display=\'block\';" onmouseout="$_(\'subinstallations\').style.display=\'none\';" cellpadding="8" width="162">
		<tr>
			<td width="100%" style="padding:8px 11px;">
				<a href="' . $globals['ind'] . 'act=installations&show=byusers"><font class="bboxtxt">' . $l['sub_byuser'] . '</font></a>
			</td>
		</tr>
		<tr>
			<td>
				<a href="' . $globals['ind'] . 'act=installations&show=byscript"><font class="bboxtxt">' . $l['sub_byscript'] . '</font></a>
			</td>
		</tr>
		<tr>
			<td width="100%" style="padding:8px 11px;">
				<a href="' . $globals['ind'] . 'act=installations&show=bydomains"><font class="bboxtxt">' . $l['sub_bydomain'] . '</font></a>
			</td>
		</tr>
		<tr>
			<td>
				<a href="' . $globals['ind'] . 'act=installations&show=outdated"><font class="bboxtxt">' . $l['sub_outdated'] . '</font></a>
			</td>
		</tr>
		<tr>
			<td>
				<a href="' . $globals['ind'] . 'act=ins_statistics"><font class="bboxtxt">' . $l['sub_ins_statistics'] . '</font></a>
			</td>
		</tr>';
    if (!defined('SOFTRESELLER') && $globals['softpanel'] != 'ampps') {
        echo '<tr>
					<td>
						<a href="' . $globals['ind'] . 'act=installations&show=upgrade"><font class="bboxtxt">' . $l['sub_upgrade'] . '</font></a>
					</td>
				</tr>';
    }
    echo '</table>
			
				
	<table class="subheads" id="subsettings" onmouseover="$_(\'subsettings\').style.display=\'block\';" onmouseout="$_(\'subsettings\').style.display=\'none\';" cellpadding="8" width="162">
		<tr>
			<td width="162" style="padding:8px 11px;">
				<a href="' . $globals['ind'] . 'act=settings"><font class="bboxtxt">' . $l['sub_gen_set'] . '</font></a>
			</td>
		</tr>';
    if ($globals['softpanel'] == 'webuzo') {
        echo '
		<tr>				
			<td>
				<a href="' . $globals['ind'] . 'act=webuzoconfigs" style="display:block;"><font class="bboxtxt">' . $l['tab_webuzoconfigs'] . '</font></a>
			</td>
		</tr>
		<tr>				
			<td>
				<a href="' . $globals['ind'] . 'act=root_pass" style="display:block;"><font class="bboxtxt">' . $l['tab_root_pass'] . '</font></a>
			</td>
		</tr>
		<tr>				
			<td>
				<a href="' . $globals['ind'] . 'act=webuzo_acl" style="display:block;"><font class="bboxtxt">' . $l['tab_webuzo_acl'] . '</font></a>
			</td>
		</tr>';
    }
    echo '<tr>
			<td>
				<a href="' . $globals['ind'] . 'act=email"><font class="bboxtxt">' . $l['tab_email'] . '</font></a>
			</td>
		</tr>';
    // proxy menu is availbale for ADMIN only.
    if (!defined('SOFTRESELLER') && (!empty($globals['enable_proxy']) || $globals['softpanel'] == 'ampps' || aefer() || ent())) {
        echo '<tr>
			<td>
				<a href="' . $globals['ind'] . 'act=proxy"><font class="bboxtxt">' . $l['tab_proxy'] . '</font></a>
			</td>
		</tr>';
    }
    if (!defined('SOFTRESELLER')) {
        echo '
		<tr>
			<td>
				<a href="' . $globals['ind'] . 'act=topscripts"><font class="bboxtxt">' . $l['sub_top_scripts'] . '</font></a>
			</td>
		</tr>';
    }
    if (!defined('SOFTRESELLER')) {
        echo '
			<tr>
				<td>
					<a href="' . $globals['ind'] . 'act=categories" style="display:block;"><font class="bboxtxt">' . $l['tab_categories'] . '</font></a>
				</td>
			</tr>
			<tr>
				<td>
					<a href="' . $globals['ind'] . 'act=errorlog" style="display:block;"><font class="bboxtxt">' . $l['tab_error_log'] . '</font></a>
				</td>
			</tr>
			<tr>
				<td>
					<a href="' . $globals['ind'] . 'act=no_autoupgrade" style="display:block;"><font class="bboxtxt">' . $l['tab_disable_autoupgrade'] . '</font></a>
				</td>
			</tr>
			';
    }
    if (!defined('SOFTRESELLER') && $globals['softpanel'] != 'webuzo' && $globals['softpanel'] != 'ampps') {
        echo '
		<tr>
			<td>
				<a href="' . $globals['ind'] . 'act=emailtemp" style="display:block;"><font class="bboxtxt">' . $l['tab_mail_trmplate'] . '</font></a>
			</td>
		</tr>';
    }
    if (!defined('SOFTRESELLER') && in_array($globals['softpanel'], array('cpanel', 'enterprise', 'aefer', 'webuzo'))) {
        echo '
		<tr>
			<td>
				<a href="' . $globals['ind'] . 'act=import_export"><font class="bboxtxt">' . $l['sub_import_export'] . '</font></a>
			</td>
		</tr>';
    }
    if (asperapp(0, 1, 1)) {
        echo '
		<tr>
			<td>
				<a href="' . $globals['ind'] . 'act=licensekey"><font class="bboxtxt">' . $l['sub_license'] . '</font></a>
			</td>
		</tr>';
    }
    echo '</table>		
		
	<table class="subheads" id="subsoftwares" onmouseover="$_(\'subsoftwares\').style.display=\'block\';" onmouseout="$_(\'subsoftwares\').style.display=\'none\';" cellpadding="8" width="162">
		<tr>
			<td width="162" style="padding:8px 11px;">
				<a href="' . $globals['ind'] . 'act=softwares"><font class="bboxtxt">' . $l['sub_general_scripts'] . '</font></a>
			</td>
		</tr>
		<tr>
			<td>
				<a href="' . $globals['ind'] . 'act=customscripts"><font class="bboxtxt">' . $l['sub_custom_scripts'] . '</font></a>
			</td>
		</tr>
		<tr>
			<td>
				<a href="' . $globals['ind'] . 'act=adv_software"><font class="bboxtxt">' . $l['adv_software'] . '</font></a>
			</td>
		</tr>
		<tr>
			<td>
				<a href="' . $globals['ind'] . 'act=script_requirement"><font class="bboxtxt">' . $l['sub_script_req'] . '</font></a>
			</td>
		</tr>
	</table>
	
	<table class="subheads" id="subplans" onmouseover="$_(\'subplans\').style.display=\'block\';" onmouseout="$_(\'subplans\').style.display=\'none\';" cellpadding="8" width="162">
		<tr>
			<td width="100%" style="padding:8px 11px;">
				<a href="' . $globals['ind'] . 'act=plans"><font class="bboxtxt">' . $l['list_plan'] . '</font></a>
			</td>
		</tr>
		<tr>
			<td>
				<a href="' . $globals['ind'] . 'act=addplans"><font class="bboxtxt">' . $l['add_plan'] . '</font></a>
			</td>
		</tr>
	</table>
	
	<table class="subheads" id="subuser" onmouseover="$_(\'subuser\').style.display=\'block\';" onmouseout="$_(\'subuser\').style.display=\'none\';" cellpadding="8" width="162">
		<tr>
			<td width="100%" style="padding:8px 11px;">
				<a href="' . $globals['ind'] . 'act=listuser"><font class="bboxtxt">' . $l['list_user'] . '</font></a>
			</td>
		</tr>
		<tr>
			<td>
				<a href="' . $globals['ind'] . 'act=adduser"><font class="bboxtxt">' . $l['add_user'] . '</font></a>
			</td>
		</tr>
	</table>
	
	<table class="subheads" id="domains" onmouseover="$_(\'domains\').style.display=\'block\';" onmouseout="$_(\'domains\').style.display=\'none\';" cellpadding="8" width="162">
		<tr>
			<td width="100%" style="padding:8px 11px;">
				<a href="' . $globals['ind'] . 'act=listdomains"><font class="bboxtxt">List Domains</font></a>
			</td>
		</tr>
		<tr>
			<td>
				<a href="' . $globals['ind'] . 'act=adddomain"><font class="bboxtxt">Add Domain</font></a>
			</td>
		</tr>
	</table>
	
		
	</div>
	</div>';
    //Everything else will go here
}
示例#10
0
function backups_theme()
{
    global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error, $scripts;
    global $backups, $deleted, $tmpbackup_info;
    softheader($l['<title>']);
    echo '<div class="bg">
<br />
<div class="row sai_main_head" style="width:100%;" align="center">
	<div class="col-sm-5 col-xs-5" style="padding:0 10px 0 0; text-align:right;">
		<i class="fa sai-backup fa-2x" style="color:#00A0D2;"></i>
	</div>
	<div class="col-sm-7 col-xs-7" style="padding-top:10px; padding-left:0; text-align:left;">' . $l['backups_head'] . '</div>
</div>
<hr>';
    error_handle($error, '100%');
    if (!empty($deleted)) {
        echo '<div class="alert alert-warning"><center><a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>' . $l['backup_deleted'] . '</center></div>';
    }
    if (!empty($globals['backups_expire'])) {
        echo '<center class="alert alert-warning"><a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>' . lang_vars($l['backups_expire'], array($globals['backups_expire'])) . '</center>';
    }
    echo '<div id="stooltip" style="display:none; position:absolute; top: 0px; left: 0px; border: 1px solid #CCC; padding: 8px; background: #FFF; z-index:1000;"></div>
<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
function _confirm(){
	var conf = confirm("' . $l['confirm_del'] . '");
	if(conf){
		return true;
	}else{
		return false;
	}
};

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

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

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

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

function remove_by_id(insid, re, oldinsid){

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

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

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

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

// ]]></script>';
    softfooter();
}
示例#11
0
function softheader($title = '', $leftbody = true)
{
    global $theme, $user, $logged_in, $globals, $l, $dmenus, $onload, $newslinks, $feeds, $softpanel, $iscripts, $catwise, $allcatwise, $soft, $classes_categories, $scripts, $apps, $apps_catwise;
    if (optGET('jsnohf')) {
        return true;
    }
    //r_print($user['color_theme']);
    /* <script language="javascript" src="'.js_url('js/jquery.js', 'js/universal.js', 'js/suggest.js', 'js/smoothscroll.js', 'js/slider.js', 'js/dock.js').'" type="text/javascript"> </script> */
    $title = empty($title) ? $globals['sn'] : $title;
    // Is there a Panel Header ?
    if (!empty($softpanel->pheader)) {
        echo $softpanel->pheader;
    }
    //Lets echo the top headers
    echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=' . $globals['charset'] . '" />
		<meta name="keywords" content="softaculous, software" />
		<meta name="viewport" content="width=device-width,initial-scale=1.0" />
		<title>' . $title . '</title>
		<link rel="stylesheet" type="text/css" href="' . $theme['url'] . '/bootstrap/css/bootstrap.css?' . $GLOBALS['globals']['version'] . '" />
		<link rel="stylesheet" type="text/css" href="' . $theme['url'] . '/style.css?' . $GLOBALS['globals']['version'] . '" />
		<link rel="stylesheet" type="text/css" href="' . $theme['url'] . '/font-awesome.css?' . $GLOBALS['globals']['version'] . '" />
		<!--[if IE 7]>
		<link rel="stylesheet" type="text/css" href="' . $theme['url'] . '/ie7.css?' . $GLOBALS['globals']['version'] . '">
		<![endif]-->
		<link rel="shortcut icon" href="' . $theme['images'] . '/' . asperapp('', 'webuzo/', 'ampps/') . 'favicon.ico" />';
    $got_cache_js = get_cache_time();
    echo '<script language="javascript" src="' . $theme['url'] . '/js/jquery.js" type="text/javascript"> </script>
		<script language="javascript" src="' . $theme['url'] . '/bootstrap/js/bootstrap.min.js" type="text/javascript"> </script>
		<script language="javascript" src="' . $theme['url'] . '/js/combined.js" type="text/javascript"> </script>
		<script language="javascript" src="' . $theme['url'] . '/cache/cache.js?' . $got_cache_js . '" type="text/javascript"> </script>
		<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
		</script>';
    echo '
	</head>
	
	<body onload="bodyonload();">';
    $ind = $globals['mode'];
    //This is done for the SLIDER
    $js_cat = array();
    foreach ($allcatwise[$ind] as $cat => $softs) {
        if (empty($softs)) {
            continue;
        }
        $js_cat[] = $cat;
    }
    $temp_allcatwise = $allcatwise;
    // Classes are only avaialable to Premium License
    if (empty($globals['disable_classes']) && !empty($globals['lictype'])) {
        $temp_allcatwise['classes'] = 'Classes';
    }
    // Webuzo has the APPs support
    if (webuzo()) {
        $disablesysapps = $softpanel->is_sysapps_disable();
        if (empty($disablesysapps)) {
            $temp_allcatwise['apps'] = 'Apps';
            $allcatwise['apps'] = $apps_catwise;
        } else {
            if ($globals['mode'] == 'apps') {
                redirect('');
                return false;
            }
        }
    }
    // Show the EULA Notice in Interworx panel
    if (empty($user['eula_accept']) && $globals['softpanel'] == 'interworx') {
        echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
	
		var message_box = function(){			
				return {
					show_message: function(title, body , image) {			
						var okbtn = \'<input  style="width:75px; margin-top:10px; background:#00A0D2; color:#FFF;" class="sai_submit" type="button" onclick="message_box.close_message(this.value);" value="Agree" name="okbtn" />\';	
						var cancelbtn = \'<input  style="width:75px; margin-top:10px; background:#00A0D2; color:#FFF;" class="sai_submit" type="button" onclick="message_box.close_message(this.value);" value="Decline" name="cancelbtn" />\';
											
						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 width="100%" class ="msg_tr1" style="text-align:center">\' +  title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td class ="msg_tr3">\' + okbtn + \' &nbsp; &nbsp; \' + cancelbtn + \'</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 widt="60%" class ="msg_tr1">\' + title + \'</td></tr><tr class ="msg_tr2"><td style="text-align:left">\' + body + \'</td></tr><tr ><td>\' + okbtn + \'</td><td>\' + cancelbtn + \'</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(action) {
						
						jQuery(\'.sai_message_box\').hide(\'fast\');
						
						if(action == "Agree"){
				
							$.ajax({
								type: "GET",
								url: window.location+"?&eula_accept=1",
								
								// Checking for error
								success: function(data){
								},
								error: function() {
								}													
							});
							
							return false;
							
						}else{
							alert("You must not use Softaculous if you do not agree to the EULA");
						}
					}
				}
			}();
	
		$(document).ready(function(){
			// Show the eula accept message
			var agree_msg = \'<center>You must agree to the <a href="http://www.softaculous.com/softaculous/eula" target="_blank">EULA</a> before using Softaculous</center>\';
			
			message_box.show_message("<a href=\\"http://www.softaculous.com/softaculous/eula\\" target=\\"_blank\\" style=\\"text-decoration:none\\">End User License Agreement</a>",agree_msg,1);
			
		});
		// ]]></script>';
    }
    //For native UI support
    if (!empty($softpanel->pheader)) {
        if (substr_count($_SERVER['REQUEST_URI'], 'paper_lantern') > 0) {
            echo '
			<style>
			@media screen and (min-width: 320px) and (max-width: 360px){
				.soft_nav{
					margin-top:20px;
				}
			}
			</style>
			';
        }
    }
    echo '
	<table width="100%" cellspacing="0" cellpadding="0" border="0">
		<tr>
			<td>
				<table width="100%" border="0" cellspacing="0" cellpadding="0" class="soft_nav">								
					<tr>
						<td width="' . (!empty($softpanel->leftpanel_resize) ? '192' : '220') . '" id="header_logo">
							<a href="' . $globals['ind'] . '" style="margin:20px;"><img src="' . ($globals['softpanel'] == 'ampps' ? $theme['a_images'] . 'header.png' : (empty($globals['logo_url']) ? $globals['softpanel'] == 'webuzo' ? $theme['a_images'] . 'header.png' : $theme['images'] . 'header.png' : $globals['logo_url'])) . '" alt="" height="' . (!empty($softpanel->leftpanel_resize) ? '60' : '55') . '"/></a>
						</td>';
    $top_bar = !empty($globals['panel_hf']) && !empty($softpanel->can_shrink_nativeui) ? '<td width="40" align="center">&nbsp;&nbsp;<a href="javascript:set_pheader();" id="pheader_view" ><img src="' . $theme['images'] . ($_COOKIE['pheader'] == 'yes' ? 'expand.png" title="' . $l['expand_view'] . '"' : 'collapse.png" title="' . $l['collapse_view'] . '"') . '></a></td>' : '';
    $pre_selected_ind = array('php', 'perl', 'java', 'python');
    if (empty($globals['nolabels'])) {
        $top_bar .= '<td align="center" width="40" ' . (!empty($softpanel->pheader) ? 'height="40"' : '') . '>&nbsp;&nbsp;<a href="' . $globals['ind'] . 'ind=' . $globals['mode'] . '" id="' . $globals['mode'] . '" class="indtype soft_nav_selected">' . ($globals['mode'] == 'js' ? 'JavaScripts' : ($globals['mode'] == 'classes' ? 'Classes' : (asperapp(0, 1, 0) ? $globals['mode'] == 'java' ? 'JAVA' : ($globals['mode'] == 'python' ? 'Python' : strtoupper($globals['mode'])) : strtoupper($globals['mode'])))) . '</a></td>';
        foreach ($temp_allcatwise as $k => $v) {
            $top_bar .= empty($temp_allcatwise[$k]) || $globals['mode'] == $k ? '' : '<td  align="center" width="40">&nbsp;&nbsp;<a href="' . $globals['ind'] . 'ind=' . $k . '" class="' . ($globals['mode'] == $k || empty($_GET['act']) && empty($_GET['ind']) && in_array($k, $pre_selected_ind) ? 'indtype soft_nav_selected' : 'indtype') . '" id="' . $k . '">' . ($k == 'js' ? 'JavaScripts' : ($k == 'classes' ? 'Classes' : ($k == 'java' || $k == 'apps' || $k == 'python' ? ucfirst($k) : strtoupper($k)))) . '</a></td>';
        }
    }
    $top_bar .= '
						<td>&nbsp;</td>
						<td>&nbsp;</td>
						<td>&nbsp;</td>
						<td>&nbsp;</td>
						<td>&nbsp;</td>';
    $top_bar1 = (empty($globals['off_panel_link']) ? '<td align="center" width="32" class="someclass" title="' . $l['go_cpanel'] . '"><a href="' . $softpanel->theme['panel_url'] . '"><i class="fa sai-control_panel fa-2x"></i></a></td>' : '') . '

						' . (webuzo() && !$softpanel->is_sysapps_disable() ? '<td align="center" width="32" class="someclass" title="' . $l['go_cpanel'] . '"><a href="javascript:goto_panel();"><i class="fa sai-control_panel fa-2x"></i></a>' : '<td align="center" width="32" class="someclass" title="' . $l['go_home'] . '"><a href="' . $globals['ind'] . '"><i class="fa sai-home fa-2x"></i></a></td>') . '

						' . (aefer() && allow_adddomain() ? '<td align="center" width="32" class="someclass" title="' . $l['go_domain'] . '"><a href="' . $globals['ind'] . 'act=domains"><i class="fa sai-www fa-2x"></i></a></td>' : '') . (webuzo() ? '<td align="center" width="32" class="someclass" title="' . $l['go_domain'] . '"><a href="' . $globals['ind'] . 'act=domainmanage"><b><i class="fa sai-www fa-2x"></i></b></a></td>' : '') . (empty($globals['off_demo_link']) ? '<td align="center" width="32" class="someclass" title="' . $l['go_demos'] . '"><a href="' . $globals['ind'] . 'act=demos"><i class="fa sai-demo fa-1x"></i></a></td>' : '') . (empty($globals['off_rating_link']) ? '<td align="center" width="32" class="someclass" title="' . $l['go_ratings'] . '"><a href="' . $globals['ind'] . 'act=ratings"><i class="fa sai-fullstar fa-1x"></i></a></td>' : '') . '

						<td  align="center" width="32" class="someclass" title="' . $l['go_installations'] . '"><a href="' . $globals['ind'] . 'act=installations"><i class="fa sai-installations fa-1x"></i></a></td>' . (webuzo() && !$softpanel->is_sysapps_disable() ? '<td align="center" width="32" class="someclass" title="' . $l['go_apps_installations'] . '"><a href="' . $globals['ind'] . 'act=apps_installations"><i class="fa sai-apps fa-2x"></i></a></td>' : '') . '

						<td  align="center" width="32" class="someclass" title="' . $l['go_tasklist'] . '"><a href="' . $globals['ind'] . 'act=eu_tasklist"><i class="fa sai-list fa-1x"></i></a></td>

						<td align="center" width="32" class="someclass" title="' . $l['go_settings'] . '"><a href="' . $globals['ind'] . 'act=settings"><i class="fa sai-settings fa-1x"></i></a></td>' . (empty($globals['disable_backup_restore']) ? '<td align="center" width="32" class="someclass" title="' . $l['go_backups'] . '"><a href="' . $globals['ind'] . 'act=backups"><i class="fa sai-backup fa-1x"></i></a></td>' : '') . '

						' . (empty($globals['off_email_link']) ? '<td align="center" width="32" class="someclass" title="' . $l['go_email_settings'] . '"><a href="' . $globals['ind'] . 'act=email"><i class="fa sai-mail fa-1x"></i></a></td>' : '') . (!empty($globals['eu_themes_premium']) && !empty($globals['lictype']) ? '<td align="center" width="32" class="someclass" title="' . $l['go_my_themes'] . '"><a href="' . $globals['ind'] . 'act=my_themes"><i class="fa sai-pfx_icon fa-2x"></i></a></td>' : '') . (empty($globals['off_sync_link']) ? '<td align="center" width="32" class="someclass" title="' . $l['go_sync'] . '"><a href="' . $globals['ind'] . 'act=sync"><i class="fa sai-sync fa-1x"></i></a></td>' : '') . '
						<td align="center" width="32" class="someclass" title="' . $l['go_support'] . '"><a href="' . $globals['ind'] . 'act=help"><i class="fa sai-question fa-1x"></i></a></td>
						</td>
						<td align="center" width="32" class="someclass" title="' . $l['go_logout'] . '">
							<a href="' . $softpanel->theme['logout'] . '"><i class="fa sai-logout fa-1x"></i></a>
						</td>';
    if (!empty($softpanel->pheader) && substr_count($_SERVER['REQUEST_URI'], 'paper_lantern') < 0) {
        echo $top_bar . '</tr><tr>' . $top_bar1;
    } else {
        echo $top_bar . $top_bar1;
    }
    echo '</tr>
				</table>
			</td>
		</tr>
	</table>
	<img src="' . $theme['images'] . 'menu.png" alt="Left_menu" id="header_toggle_btn" class="header_toggle_btn pull-right">			
	<div class="soft_nav_mob"><br />
		<ul style="list-style-type:none; padding-left:10px;">';
    $top_bar = !empty($globals['panel_hf']) && !empty($softpanel->can_shrink_nativeui) ? '<li style="display:inline-block;">&nbsp;&nbsp;<a href="javascript:set_pheader();" id="pheader_view" ><img src="' . $theme['images'] . ($_COOKIE['pheader'] == 'yes' ? 'expand.png" title="' . $l['expand_view'] . '"' : 'collapse.png" title="' . $l['collapse_view'] . '"') . '></a></li>' : '';
    $pre_selected_ind = array('php', 'perl', 'java', 'python');
    if (empty($globals['nolabels'])) {
        $top_bar .= '<li style="display:inline-block;">&nbsp;&nbsp;<a href="' . $globals['ind'] . 'ind=' . $globals['mode'] . '" id="' . $globals['mode'] . '" class="indtype soft_nav_selected">' . ($globals['mode'] == 'js' ? 'JavaScripts' : ($globals['mode'] == 'classes' ? 'Classes' : (asperapp(0, 1, 0) ? $globals['mode'] == 'java' ? 'JAVA' : ($globals['mode'] == 'python' ? 'Python' : strtoupper($globals['mode'])) : strtoupper($globals['mode'])))) . '</a></li>';
        foreach ($temp_allcatwise as $k => $v) {
            $top_bar .= empty($temp_allcatwise[$k]) || $globals['mode'] == $k ? '' : '<li style="display:inline-block;">&nbsp;&nbsp;<a href="' . $globals['ind'] . 'ind=' . $k . '" class="' . ($globals['mode'] == $k || empty($_GET['act']) && empty($_GET['ind']) && in_array($k, $pre_selected_ind) ? 'indtype soft_nav_selected' : 'indtype') . '" id="' . $k . '">' . ($k == 'js' ? 'JavaScripts' : ($k == 'classes' ? 'Classes' : ($k == 'java' || $k == 'apps' || $k == 'python' ? ucfirst($k) : strtoupper($k)))) . '</a></li>';
        }
    }
    $top_bar1 = (empty($globals['off_panel_link']) ? '<li><a href="' . $softpanel->theme['panel_url'] . '"><i class="fa sai-control_panel fa-2x"></i>&nbsp;&nbsp;' . $l['go_cpanel'] . '</a></li><br />' : '') . '
						<li>' . (webuzo() && !$softpanel->is_sysapps_disable() ? '<a href="javascript:goto_panel();"><i class="fa sai-control_panel fa-2x"></i>&nbsp;&nbsp;' . $l['go_cpanel'] . '</a>' : '<a href="' . $globals['ind'] . '"><i class="fa sai-home fa-2x"></i>&nbsp;&nbsp;' . $l['go_home'] . '</a>') . '</li><br />
						' . (aefer() && allow_adddomain() ? '<li><a href="' . $globals['ind'] . 'act=domains"><i class="fa sai-www fa-2x"></i>&nbsp;&nbsp;' . $l['go_domain'] . '</a></li><br />' : '') . (webuzo() ? '<li><a href="' . $globals['ind'] . 'act=domainmanage"><b><i class="fa sai-www fa-2x"></i>&nbsp;&nbsp;' . $l['go_domain'] . '</b></a></li><br />' : '') . (empty($globals['off_demo_link']) ? '<li><a href="' . $globals['ind'] . 'act=demos"><i class="fa sai-demo fa-1x"></i>&nbsp;&nbsp;' . $l['go_demos'] . '</a></li><br />' : '') . (empty($globals['off_rating_link']) ? '<li><a href="' . $globals['ind'] . 'act=ratings"><i class="fa sai-fullstar fa-1x"></i>&nbsp;&nbsp;' . $l['go_ratings'] . '</a></li><br />' : '') . '

						<li><a href="' . $globals['ind'] . 'act=installations"><i class="fa sai-installations fa-1x"></i>&nbsp;&nbsp;' . $l['go_installations'] . '</a></li><br />' . (webuzo() && !$softpanel->is_sysapps_disable() ? '<li><a href="' . $globals['ind'] . 'act=apps_installations"><i class="fa sai-apps fa-2x"></i>&nbsp;&nbsp;' . $l['go_apps_installations'] . '</a></li><br />' : '') . '

						<li><a href="' . $globals['ind'] . 'act=eu_tasklist"><i class="fa sai-list fa-1x"></i>&nbsp;&nbsp;' . $l['go_tasklist'] . '</a></li><br />

						<li><a href="' . $globals['ind'] . 'act=settings"><i class="fa sai-settings fa-1x"></i>&nbsp;&nbsp;' . $l['go_settings'] . '</a></li><br />' . (empty($globals['disable_backup_restore']) ? '<li><a href="' . $globals['ind'] . 'act=backups"><i class="fa sai-backup fa-1x"></i>&nbsp;&nbsp;' . $l['go_backups'] . '</a></li><br />' : '') . '

						' . (empty($globals['off_email_link']) ? '<li><a href="' . $globals['ind'] . 'act=email"><i class="fa sai-mail fa-1x"></i>&nbsp;&nbsp;' . $l['go_email_settings'] . '</a></li><br />' : '') . (!empty($globals['eu_themes_premium']) && !empty($globals['lictype']) ? '<li><a href="' . $globals['ind'] . 'act=my_themes"><i class="fa sai-pfx_icon fa-2x"></i>&nbsp;&nbsp;' . $l['go_my_themes'] . '</a></li><br />' : '') . (empty($globals['off_sync_link']) ? '<li><a href="' . $globals['ind'] . 'act=sync"><i class="fa sai-sync fa-1x"></i>&nbsp;&nbsp;' . $l['go_sync'] . '</a></li><br />' : '') . '
						<li><a href="' . $globals['ind'] . 'act=help"><i class="fa sai-question fa-1x"></i>&nbsp;&nbsp;' . $l['go_support'] . '</a></li><br />
						<li><a href="' . $softpanel->theme['logout'] . '"><i class="fa sai-logout fa-1x"></i>&nbsp;&nbsp;' . $l['go_logout'] . '</a></li><br />';
    echo $top_bar . '<br /><br />' . $top_bar1;
    echo '
		</ul>
	</div><!--soft_nav_mob-->
	<script type=text/javascript>
		$(document).ready(function(){
			$("#left_toggle_btn").click(function(){
				if($(".left_panel").is(":visible")){
					$("#header_logo").show();
				}else{
					$("#header_logo").hide();
				}
			});';
    if (!empty($softpanel->pheader) && substr_count($_SERVER['REQUEST_URI'], 'x3') > 0) {
        echo '$(".ver_style").css("margin-left","0px");
					$(".release_style").css("margin-left","0px");
					$(".change_style").css({"margin-left":"0px", "margin-top":"-15px"});
					$(".sai_search_left").css("width","159px")';
    }
    echo '  });
	</script>
	<!--[if IE]>
		<style>
			.left_panel{
				 margin-top:-53px;
			}
		</style>
	<![endif]-->
	<div id="loading_soft" class="sai_loading_soft">
		<img src="' . $theme['images'] . 'fb_loader.gif" alt="Loading..." />
	</div>';
    echo '<table width="100%" cellspacing="0" cellpadding="0" border="0" style="margin-top:-53px;"> 
		<tr>
			<img src="' . $theme['images'] . 'menu.png" alt="Left_menu" class="left_toggle_btn" id="left_toggle_btn">
			<td width="' . (!empty($softpanel->leftpanel_resize) ? '192' : '220') . '" valign="top" class="left_panel" style="min-height:100%;">
				<!--left panel table start here-->
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td align="center">
								<center>
									<a href="' . $globals['ind'] . '"><img src="' . ($globals['softpanel'] == 'ampps' ? $theme['a_images'] . 'header.png' : (empty($globals['logo_url']) ? $globals['softpanel'] == 'webuzo' ? $theme['a_images'] . 'header.png' : $theme['images'] . 'header.png' : $globals['logo_url'])) . '" alt="" height="' . (!empty($softpanel->leftpanel_resize) ? '60' : '70') . '"/></a>
								</center>
							</td>
						</tr>';
    if ($ind != 'classes') {
        echo '<tr>
							<td>
								<table cellspacing="0" cellpadding="0" border="0" align="center">
									<tr><br />
										<td align="right">
											<form accept-charset="' . $globals['charset'] . '" name="search" method="post" action="' . $globals['ind'] . 'act=search&smode=' . $globals['mode'] . '" onsubmit="return checksearchform();" id="searchform">
												<input type="text" name="inputString" size="23" id="inputString" onfocus="this.value=\'\';" value="' . $l['search'] . '" onblur="this.value=\'' . $l['search'] . '\';init();" onKeyUp="search_scripts(this.value);" autocomplete="off"  sugurl="' . $globals['index'] . '&act=suggest&smode=' . $globals['mode'] . '" mode="' . $globals['mode'] . '" class="sai_search_left" style="margin-bottom:8px;"/>
												<img src="' . $theme['images'] . 'search.png" class="sai_search_img" />
												<input type="hidden" name="hidden_cid" id="hidden_cid" />
												<div id="suggestions" class="sai_suggestions" style="position:absolute;left:0px; top:0px; display:none;"></div>
											</form>
										</td>
									</tr>
								</table>
								<!--<div class="search_suggestion" style="display:none"></div>-->
							</td>
						</tr>';
    }
    if (!empty($leftbody)) {
        if ($ind == 'classes' || optGET('act') == 'classes') {
            echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
								
		(function($) {
			$.extend($.fx.step,{
				backgroundPosition: function(fx) {
					if (fx.state === 0 && typeof fx.end == \'string\') {
						var start = $.curCSS(fx.elem,\'backgroundPosition\');
						if(typeof(start) == "undefined"){
							start = $.css(fx.elem, "background-position-x")+\' \'+$.css(fx.elem, "background-position-y");
						}
						start = toArray(start);
						fx.start = [start[0],start[2]];
						var end = toArray(fx.end);
						fx.end = [end[0],end[2]];
						fx.unit = [end[1],end[3]];
					}
					var nowPosX = [];
					nowPosX[0] = ((fx.end[0] - fx.start[0]) * fx.pos) + fx.start[0] + fx.unit[0];
					nowPosX[1] = ((fx.end[1] - fx.start[1]) * fx.pos) + fx.start[1] + fx.unit[1];
					fx.elem.style.backgroundPosition = nowPosX[0]+\' \'+nowPosX[1];
		
				   function toArray(strg){
					   strg = strg.replace(/left|top/g,\'0px\');
					   strg = strg.replace(/right|bottom/g,\'100%\');
					   strg = strg.replace(/([0-9\\.]+)(\\s|\\)|$)/g,"$1px$2");
					   var res = strg.match(/(-?[0-9\\.]+)(px|\\%|em|pt)\\s(-?[0-9\\.]+)(px|\\%|em|pt)/);
					   return [parseFloat(res[1],10),res[2],parseFloat(res[3],10),res[4]];
				   }
				}
			});
		})(jQuery);
		
			
		// this function will add blue arrow after clicking	
		$(function(){
			$("#cmenu li a").click(function(){
				 $(this).removeClass("softlinkscurrent");
				 $(this).addClass("softlinkscurrent");
			 })
		});
		
		//function to display list of classes
		function show_list(start, length, cat){
			$("#softcontent").fadeOut(0);
			$_("loading_soft").style.top = (scrolledy()+250)+"px";
			$("#loading_soft").show();
			$("#softcontent").html("");
			goto_top();	
			$.getJSON("' . $globals['api_nuphp'] . 'category_classes.php?cat="+cat+"&in=json&start="+start+"&length="+length+"&callback=?", 
			function (data) {
				if (typeof(data.data)!="object" || typeof data.data == "undefined"){
				  $("#loading_soft").hide();//hide fb loader
				  $("#softcontent").html("<center><span class=\'sai_newhead\'>' . $l['classes_con_failed'] . '</span></center>");	
				  $("#softcontent").fadeIn(300);
				}
				var soft_classes = \'<div class="bg"><br /><div class="row row_usi_cls">\';
				var br = 1; 
				$.each(data.data, function (i, item) {
					soft_classes += \'<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12" style="padding-bottom: 20px;"><div class="sai_classes_boxgrid2" onclick=window.location=this.id; id="' . $globals['index'] . 'act=classes&cid=\'+item.cid+\'&tab=overview" ><div class="sai_classes_boxgrid"><div><h2>\'
					+item.name+
					\'</h2><p style="padding:10px;height:50px;">\'
					+item.desc+\'</p><p style="padding:10px;height:15px;"> <b>' . $l['cl_ratings'] . '</b> : \'
					+parseFloat(item.ratings)+\'/5</p> </div><div style="height:200px;"><br /><h2>\'
					+item.name+
					\'</h2><p style="margin-left:10px;margin-top:20px"><b> ' . $l['cl_author'] . '</b> : \'
					+item.author+\'</p><p style="margin-left:10px;"><b> ' . $l['cl_license'] . '</b> :\'
					+item.license+\'</p><p style="margin-left:10px;"><b> ' . $l['cl_version'] . '</b> :\'
					+item.version+\'</p><div align="center"> <a href="' . $globals['index'] . 'act=classes&cid=\'+item.cid+\'&tab=install" style="margin:5px;" class="sai_cbutton"> ' . $l['cl_install_but'] . ' </a><a href="' . $globals['index'] . 'act=classes&cid=\'+item.cid+\'&tab=file" style="margin:5px;"class="sai_cbutton"> ' . $l['cl_show_files'] . '</a></div></div></div></div></div>\';
					 
					 br += 1 ;
				});// end of each loop
		
				soft_classes += "</div></div>";
				
				$("#softcontent").append(soft_classes); 
				
				// Pagination Coding
				var p1 = 0; // Start variable for mysql api . length is set to 12
				
				// Find which is the current page
				var current = (start/length) + 1;
				var class_pagination = \'<center><div class="pagination"><ul>\';
				for (i=1; i<=data.pages; i++)
				{
					var page_class = "sai_cbutton";
					if(i == current){
						page_class += " selected_page";
					}			
					
					class_pagination += \'<li style="display:inline;font-size:18px;font-style:italic;margin-right:3px;cursor:pointer"><a class="\'+page_class+\'" style="background: #F5F5F5;color:#000;" onclick="show_list(\'+p1+\',12, \\\'\'+data.class_category+\'\\\');" href="javascript:void(0)" >\'+ i+\'</a></li>\';
					p1+=12;
				}
				
				class_pagination+= \'</ul></div></center>\';	
		
				$("#softcontent").append(class_pagination);
				$("#loading_soft").hide();//hide fb loader
				$("#softcontent").fadeIn(300);	
						
				window.location.hash = "!act=listclasses&cat="+data.class_category;	
				
				$(".sai_classes_boxgrid").hover(function(){$(this).stop().animate({top:"-200px"},{queue:false,duration:200});},function() 
				{$(this).stop().animate({top:"0px"},{queue:true,duration:200});});
				
			}); // end of get json function
		
		}//end of show list
								
// ]]></script>';
        }
        // end of $ind == 'classes'
        $theme['leftbody'] = $leftbody;
        echo '<tr>
								<td id="load_leftpanel_js">';
        // Only for classes menu
        if ($ind == 'classes') {
            echo '<ul class="softlinks" id="cmenu">';
            ksort($classes_categories);
            foreach ($classes_categories as $key => $value) {
                echo '<li>
												<a onclick="show_list(0, 12, \'' . $key . '\');  return false;" href="javascript:void(0)" >' . $l['classes_' . $key] . '<div class="class_arrow"><img src="' . $theme['images'] . 'collapsed.png"></div></a>
											</li>';
            }
            echo '</ul>';
        } else {
            $icat = 0;
            $str = '<script>
									var cat_lang = new Array();
									var catimg_from_site = new Array();';
            foreach ($allcatwise as $i_ind => $ind_type) {
                foreach ($ind_type as $cat => $softs) {
                    if (empty($softs)) {
                        continue;
                    }
                    // If we have any cat images to be load from our website
                    if (!empty($GLOBALS['catimgs'][$i_ind . '_' . $cat])) {
                        $str .= 'catimg_from_site[\'' . $i_ind . '_' . $cat . '\'] = "' . $GLOBALS['catimgs'][$i_ind . '_' . $cat] . '";';
                    }
                    $str .= 'cat_lang[\'cat_' . $i_ind . '_' . $cat . '\'] = "' . $l['cat_' . $i_ind . '_' . $cat] . '";';
                }
            }
            $str .= '
									
									var iscripts = new Array("' . implode('", "', array_keys($iscripts)) . '");
									var apps = new Array("' . implode('", "', array_keys($apps)) . '");
									</script>';
            echo $str;
        }
        // End of ELSE (i.e for iscripts)
        echo '</td>
						</tr>';
    }
    echo '</table>
				</td>
				<td colspan="2"  valign="top">
				
<script language="javascript" type="text/javascript"><!-- // --><![CDATA[

function goto_panel(){
			
	var str = window.location; 	
	
	var port_find = str.toString().search(\'2003\'); 	

	if(port_find < 1){		
		var str_url = str.toString().replace("2002", "2004");
	}else{
		var str_url = str.toString().replace("2003", "2005");
	}
	
	var res = str_url.split("/",4);
	
	var res_out = res.join("/");	
	
	window.location = res_out+"/";	
}

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

var ind_types_array = new Array("ind_php", "ind_perl", "ind_java", "ind_python");

var all_ind_types_array = new Array("ind_php", "ind_perl", "ind_java", "ind_apps", "ind_js", "ind_python");

$(document).ready(function(){
	var shown=false;
	
	$("#left_toggle_btn").on("click", function(e){
		shown=$(".left_panel").is(":visible");
		$(".left_panel").toggle("1000",function(){
			$(".left_panel").css({"position":"absolute", "z-index":"1000"});
		});
		if(!shown){
			$(".left_toggle_btn").animate({
				left: "' . (!empty($softpanel->leftpanel_resize) ? '192' : '220') . 'px"
			},"1000");
		}else{
			$(".left_toggle_btn").animate({
				left: "0px"
			},"1000");
		}
	});
	
	$("#header_toggle_btn").click(function(){
		$(".soft_nav_mob").slideToggle("slow");
	});
	
	$(".top").click(function(){									
		$("html, body").animate({ scrollTop: 0 }, 500);
		return false;
	});
	
	$(".someclass").tipTip({delay:0});
	
	function checksearchform(){
		if($_("inputString").value == ""){
			return false;
		}else{
			return true;
		}
	};
	
});

function set_pheader(){
	var cur_status = getcookie("pheader");
	if(cur_status == "no" || cur_status == false){
		setcookie("pheader","yes",365);
	}else{
		removecookie("pheader");
		setcookie("pheader","no",365);
	}
	//alert(getcookie("pheader"));
	window.location.href = window.location;
}';
    // If the $ind == classes than dond load unecessary stuff
    if ($ind != 'classes') {
        echo 'function initiate_status(){
		var main = $("#softmain tr");
		
		main.each(function(){
			
			var cookie_id = $(this).closest("tr").attr("id");
			var if_isset = getcookie(cookie_id);
			var tmp_cookieid = String(cookie_id);
			
			if(if_isset == 2 && tmp_cookieid != "undefined"){
				
				//alert(if_isset+"--"+ cookie_id)
				var id = $($("#"+cookie_id).next("tr").find("div"));
				//alert(id.attr("id"))
				id.show();	
				var tmp_img = tmp_cookieid.split("_");
				$("#icat"+tmp_img[1]).attr("src", "' . $theme['images'] . 'expanded.png");
			}
		});
	}
	
	function show_left_panel(combine){
		var str_html = "";
		var icat = 0;
		
		$.each(allcatwise, function (i_ind, ind_type) {
			$.each(ind_type, function (i, item) {
				
				if(catimg_from_site[i_ind+\'_\'+i] != undefined || catimg_from_site[i_ind+\'_\'+i] != null){
					var catimg = catimg_from_site[i_ind+\'_\'+i];
				}else{
					var catimg = "' . $theme['images'] . 'cats/"+i_ind+"_"+i+".png";
				}
				
				var if_isset = getcookie("head_"+icat);
				var tmp_cookieid = String("head_"+icat);
				var display_open = "none";
				if(if_isset == 2 && tmp_cookieid != "undefined"){
					display_open = "block";
				}
				var show_combined = true;
				var isset_ind = ' . (isset($_GET['ind']) ? '"' . $_GET['ind'] . '"' : '0') . ';
				
				if(!isset_ind){
					isset_ind = ' . (isset($_GET['act']) ? '"' . $_GET['act'] . '"' : '0') . ';
				}
				
				if(!in_array("ind_"+isset_ind, all_ind_types_array)){
					isset_ind = "php";
				}
				
				if(isset_ind == "software"){
					isset_ind = "php";
				}
				
				if(isset_ind){
					var show_i_ind = isset_ind;
				}else{
					var show_i_ind = "php";
				}
				
				var cat_key = "cat_"+i_ind+"_"+i;
				str_html += \'<table border="0" cellpadding="0" cellspacing="0" id="softmain" width="100%">\';
				
				if(i_ind == show_i_ind){
					
				str_html += \'<tr id="head_\'+icat+\'" class="soft_cathead_slide"><td width="80%" class="soft_cathead" height="32" valign="middle"><a href="' . (empty($globals['lictype']) ? '#' : $globals['indmode'] . 'act=listsoftwares&cat=\'+i+\'') . '" onclick="ajax_listsoftware(\\\'\'+i+\'\\\'); return false;"><i class="fa sai-\'+i+\' fa-lg"></i>&nbsp;&nbsp;\'+cat_lang[cat_key]+\'</a></td>' . (empty($globals['lictype']) ? '<td align="left" width="5%"><a href="http://www.softaculous.com/softwares/\'+i+\'"><img src="' . $theme['images'] . 'external.gif" alt="" /></a></td>' : '') . '<td width="5%"><a href="javascript:void(0);"><img src="' . $theme['images'] . 'collapsed.png" alt="" valign="top" id="icat\'+icat+\'"/></a></td></tr><tr><td><div id="leftcontent" style="display:none"><ul class="softlinks">\';
				
				$.each(item, function (sid, softw) {
					var tmp_sid = sid.split("_");
					sid = tmp_sid[1];
					var acts = softw.type;
					if(acts == "php"){
						acts = "software";
					}
					
					var soft = "soft";
					
					if(acts == "app" || acts == "service"){
						acts = "apps";
						soft = "app";
					}
					
					var searchin = iscripts;
					
					if(soft == "app"){
						searchin = apps;
					}
					
					var li_classes = "";
					
					' . (!empty($soft) ? 'if(' . $soft . ' == sid) li_classes = "class=\\"softlinkscurrent\\"";' : '') . '
					if((softw.parent != undefined || softw.parent != null) && in_array(softw.parent, iscripts)){
						return;
					}
					
					if(!in_array(sid, searchin)){
						return;
					}
					
					//alert(isset_ind +"--||"+ not_selected_ind)
					if(isset_ind){
						
						// Removed this because causing issues in paper_lantern Native UI
						/*for(x in ind_types_array){
							//alert(ind_types_array[x]);
							var get_ind_type = getcookie(ind_types_array[x]);
							if(get_ind_type == "yes"){
								var tmp_arr = String(ind_types_array[x]).split("_");
								removecookie(get_ind_type);
								setcookie(get_ind_type, "no", 365);
								$("#"+tmp_arr[1]).removeClass("soft_nav_selected");
								//$("#"+tmp_arr[1]).addClass("soft_nav_selected");
							}
						}*/
						
						show_combined = false;
					}
					
					if(combine){
						show_combined = true;
						$("#"+combine).addClass("soft_nav_selected");
					}
					
					if(acts == "apps"){
						show_combined = true;
					}
					
					if(in_array(sid, searchin) && show_combined){
						
						str_html += \'<li \'+li_classes+\'><a href="' . $globals['ind'] . 'act=\'+acts+\'&\'+soft+\'=\'+sid+\'" title="\'+softw.desc+\'">\'+softw.name+\'</a></li>\';
					}
					
					if(softw.type == i_ind && !show_combined){
						
						str_html += \'<li \'+li_classes+\'><a href="' . $globals['ind'] . 'act=\'+acts+\'&\'+soft+\'=\'+sid+\'" title="\'+softw.desc+\'">\'+softw.name+\'</a></li>\';
					}
				});
				}
				str_html += \'</ul></div></td></tr></table>\';
				icat = icat + 1;
				
			});	
		});
		$("#load_leftpanel_js").html(str_html);
		
	}
	var on_index_page = ' . (isset($_GET['ind']) ? '"' . $_GET['ind'] . '"' : '0') . ';
				
	if(!on_index_page){
		on_index_page = ' . (isset($_GET['act']) ? '"' . $_GET['act'] . '"' : '0') . ';
	}
	
	if(!on_index_page){
		show_left_panel(1);
	}else{
		show_left_panel(0);
	}
	
	
	remove_unnecessary_tables();
	initiate_status();
	
	
	$(".indtype").click(function(e) {
		var chk_ind = $(this).attr("id");
		if(chk_ind == "js" || chk_ind == "apps" || chk_ind == "classes") return true;
		if(e.shiftKey) {
		//Shift-Click
		}
		if(e.ctrlKey) {
			
			var indtype_name = "ind_"+$(this).attr("id");
			var get_ind_type = getcookie(indtype_name);
			
			if(get_ind_type == "no" || get_ind_type == false){
				setcookie(indtype_name, "yes", 365);
				$(this).addClass("soft_nav_selected");
			}else{
				removecookie(indtype_name);
				setcookie(indtype_name, "no", 365);
				$(this).removeClass("soft_nav_selected");
			}
			
			show_left_panel($(this).attr("id"));
			remove_unnecessary_tables();
			init();
			initiate_status();
			
			return false;
			//Ctrl+Click
		}
		if(e.altKey) {
		//Alt+Click
		}
	});
	
	function search_scripts(val){
		
		var q = val.toLowerCase();
		var qlen = val.length;
		
		var str_html = "";
		var icat = 0;
		var cats_array = new Array();
		$.each(allcatwise, function (i_ind, ind_type) {
			
			$.each(ind_type, function (i, item) {
				
				if(catimg_from_site[i_ind+\'_\'+i] != undefined || catimg_from_site[i_ind+\'_\'+i] != null){
					var catimg = catimg_from_site[i_ind+\'_\'+i];
				}else{
					var catimg = "' . $theme['images'] . 'cats/"+i_ind+"_"+i+".png";
				}
				
				var isset_ind = ' . (isset($_GET['ind']) ? '"' . $_GET['ind'] . '"' : '0') . ';
				
				if(isset_ind){
					var show_i_ind = "' . $_GET['ind'] . '";
				}else{
					var show_i_ind = "php";
				}
				
				var cat_key = "cat_"+i_ind+"_"+i;
				
				// If all scripts in that category is disabled by Admin it was showing "undefined" so to resolve this we have written the following code.
				if(typeof cat_lang[cat_key] == "undefined"){
					for(x in ind_types_array){
						var tmp_arr = String(ind_types_array[x]).split("_");
						var tmp_cat_key = "cat_"+tmp_arr[1]+"_"+i;
						if(typeof cat_lang[tmp_cat_key] != "undefined" && typeof cat_lang[tmp_cat_key] == "string"){
							var cat_key = tmp_cat_key;
						}
					}
				}
				
				str_html += \'<table border="0" cellpadding="0" cellspacing="0" id="softmain" width="100%">\';
				if((i_ind == show_i_ind || i_ind == "apps" || i_ind == "js") && typeof cat_lang[cat_key] != "undefined"){
					str_html += \'<tr id="head_\'+icat+\'" class="soft_cathead_slide"><td width="100%" class="soft_cathead" valign="middle" height="32"><a href="' . (empty($globals['lictype']) ? '#' : $globals['indmode'] . 'act=listsoftwares&cat=\'+i+\'') . '" onclick="ajax_listsoftware(\\\'\'+i+\'\\\'); return false;"><i class="fa sai-\'+i+\' fa-lg"></i>&nbsp;&nbsp;\'+cat_lang[cat_key]+\'</a></td>' . (empty($globals['lictype']) ? '<td align="left" width="5%"><a href="http://www.softaculous.com/softwares/\'+i+\'"><img src="' . $theme['images'] . 'external.gif" alt="" /></a></td>' : '') . '<td width="5%"><a href="javascript:void(0);"><img src="' . $theme['images'] . 'expanded.png" alt="" valign="top" id="icat\'+icat+\'"/></a></td></tr><tr><td><div id="leftcontent"><ul class="softlinks">\';
					
					$.each(item, function (sid, softw) {
						var tmp_sid = sid.split("_");
						sid = tmp_sid[1];
						
						var acts = softw.type;
						if(acts == "php"){
							acts = "software"
						}
						
						var soft = "soft";
						
						if(acts == "app" || acts == "service"){
							acts = "apps";
							soft = "app";
						}
						
						var searchin = iscripts;
						
						if(soft == "app"){
							searchin = apps;
						}
						
						var name = String(softw.name);
						var searched = name.substr(0, qlen).toLowerCase();
						
						if(searched == q){
							
							if((softw.parent != undefined || softw.parent != null) && in_array(softw.parent, iscripts)){
								return;
							}
							if(in_array(sid, searchin)){
								str_html += \'<li><a href="' . $globals['ind'] . 'act=\'+acts+\'&\'+soft+\'=\'+sid+\'" title="\'+softw.desc+\'">\'+softw.name+\'</a></li>\';
							}
						}
					});
				}
				str_html += \'</ul></div></td></tr></table>\';
				icat = icat + 1;
			});
		});
		
		
		$("#load_leftpanel_js").html(str_html);
		remove_unnecessary_tables();
		init();
	}
	
	function remove_unnecessary_tables(){
		
		var icat = 0;
		$.each(allcatwise, function (i_ind, ind_type) {
			$.each(ind_type, function (i, item) {
				var id = $($("#head_"+icat).next("tr").find("div").children());
				if(id.children().length == 0){
					$("#head_"+icat).closest("table").remove();
					//$("#head_"+icat).remove();
				}
				icat = icat + 1;
			});
		});
		
		if($("#load_leftpanel_js").children().length == 0){
			$("#load_leftpanel_js").html("<center>' . $l['no_script_found'] . '</center>");
			$("#load_leftpanel_js").css("color", "' . (!empty($user['color_theme']['left_panel_scriptname']) ? $user['color_theme']['left_panel_scriptname'] : $globals['default_scriptname_text']) . '");
		}
	}';
    }
    // End of if($ind != 'classes')
    echo '
function init(){
	
$(".soft_cathead_slide").click(function(){
	
	var cat_head = $(this).attr("id");
	var tmp_img = cat_head.split("_");
	
	var id = $($(this).next("tr").find("div"));
	//alert(id.attr("id"))
	if(id.css("display") == "none"){
		id.slideDown("slow");
		$("#icat"+tmp_img[1]).attr("src", "' . $theme['images'] . 'expanded.png");
		setcookie(cat_head, 2, 365);
	}else{
		id.slideUp("slow");
		removecookie(cat_head);
		setcookie(cat_head, "", -365);
		$("#icat"+tmp_img[1]).attr("src", "' . $theme['images'] . 'collapsed.png");
	}
});

// navigation background fading effect . it will work only on loading external javascript file jquery.bgpos.js in js folder
$(function(){
	$(".soft_cathead, .soft_cathead_slide").mouseover(function()
	{
		 $(this).animate({color:"#fff",paddingLeft: "10px"});
	})
	.mouseout(function()
	{
		$(this).stop().animate({color:"#fff",paddingLeft: "10px"});
	})
});';
    // if user has it own color scheme than we will have to change the css boy!';
    if (!empty($user['user_defined_color']) || !empty($globals['default_hf_bg']) || !empty($globals['default_cat_hover']) || !empty($globals['default_hf_text']) || !empty($globals['default_scriptname_text'])) {
        // For changing text colors of category heading hover color
        if (!empty($user['color_theme']['left_panel_cathead_hover']) || !empty($globals['default_cat_hover'])) {
            echo '
		$(".soft_cathead_slide, .soft_cathead").mouseover(function(){
			$(this).css("background-color", "' . (!empty($user['color_theme']['left_panel_cathead_hover']) ? $user['color_theme']['left_panel_cathead_hover'] : $globals['default_cat_hover']) . '");
		});
		
		$(".soft_cathead_slide, .soft_cathead").mouseout(function(){
			$(this).css("background-color", "' . (!empty($user['color_theme']['left_panel_bg']) ? $user['color_theme']['left_panel_bg'] : $globals['default_hf_bg']) . '");
		});';
        }
        // For changing background color
        if (!empty($user['color_theme']['left_panel_bg']) || !empty($globals['default_hf_bg'])) {
            echo '
		$(".soft_nav").css("background", "none");
		$(".left_toggle_btn").css("background", "none");
		$(".soft_nav_mob").css("background", "none");
		$(".soft_nav").css("filter", "none");
		$(".soft_nav").css("background-color", "' . (!empty($user['color_theme']['left_panel_bg']) ? $user['color_theme']['left_panel_bg'] : $globals['default_hf_bg']) . '");
		$(".left_panel").css("background-image", "none");
		$(".left_panel").css("background-color", "' . (!empty($user['color_theme']['left_panel_bg']) ? $user['color_theme']['left_panel_bg'] : $globals['default_hf_bg']) . '");
		$(".left_toggle_btn").css("background-color", "' . (!empty($user['color_theme']['left_panel_bg']) ? $user['color_theme']['left_panel_bg'] : $globals['default_hf_bg']) . '");
		$(".soft_nav_mob").css("background-color", "' . (!empty($user['color_theme']['left_panel_bg']) ? $user['color_theme']['left_panel_bg'] : $globals['default_hf_bg']) . '");
		$(".footer").css("background-color", "' . (!empty($user['color_theme']['left_panel_bg']) ? $user['color_theme']['left_panel_bg'] : $globals['default_hf_bg']) . '");';
        }
        // For changing text colors of script names
        if (!empty($user['color_theme']['left_panel_scriptname']) || !empty($globals['default_scriptname_text'])) {
            echo '$(".softlinks li a").css("color", "' . (!empty($user['color_theme']['left_panel_scriptname']) ? $user['color_theme']['left_panel_scriptname'] : $globals['default_scriptname_text']) . '");';
        }
        // For changing text colors of category heading
        if (!empty($user['color_theme']['left_panel_cathead']) || !empty($globals['default_hf_text'])) {
            echo '$(".soft_cathead a").css("color", "' . (!empty($user['color_theme']['left_panel_cathead']) ? $user['color_theme']['left_panel_cathead'] : $globals['default_hf_text']) . '");
		$(".soft_nav a").css("color", "' . (!empty($user['color_theme']['left_panel_cathead']) ? $user['color_theme']['left_panel_cathead'] : $globals['default_hf_text']) . '");';
        }
    }
    echo '}// End of init()

init();

function ajax_listsoftware(str_id){
				
	$("#softcontent").fadeOut(0);
	$_("loading_soft").style.top = (scrolledy()+250)+"px";
	if($(".sp-container")){
		$(".sp-container").hide();
	}
	$("#loading_soft").show();
	
	$("#softcontent").load("' . $globals['indexmode'] . 'act=listsoftwares&cat="+str_id+"&jsnohf=1", 
		function(){
			$("#loading_soft").hide();
			$("#softcontent").fadeIn(300);
		}
	);
	
	
	window.location.hash = "!act=listsoftwares&cat="+str_id;
}

// ]]></script>';
    //Everything else will go here
    echo '<div align="right" class="sai_head" style="width:100%; padding-right:25px; padding-top:53px;">
			' . (webuzo() && $softpanel->getCurrentUser() == 'root' ? $l['root_login'] : '') . '&nbsp; ' . $l['welcome'] . ' ' . (empty($softpanel->user['displayname']) ? $softpanel->user['name'] : $softpanel->user['displayname']) . '
		</div>
		<div id="softcontent">';
}
示例#12
-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();
}