App.widgets.activeCollabSystemInfo=function(){var wrapper;var params;var wrapper_list;var version_wrapper;var table;var table_row;var first_cell;var second_cell;var third_cell;var refresh_button;var update_button;var buttons_wrapper;var official_modules;var license_details_auto_refresh_period=5*60*1000;var update_system_info_block=function(params){wrapper.empty();table=$('<table cellspacing="0"></table>').appendTo(wrapper);table_row=$("<tr></tr>").appendTo(table);first_cell=$('<td class="edition"></td>').appendTo(table_row);second_cell=$('<td class="version"></td>').appendTo(table_row);third_cell=$('<td class="other"></td>').appendTo(table_row);first_cell.append('<img src="'+App.Wireframe.Utils.applicationIconUrl(40)+'"><h4>activeCollab</h4>');var application_update_status=App.getApplicationUpdateStatusCode(params.application_version,params.latest_version,params.latest_available_version);var application_update_status_code=application_update_status.code;if(application_update_status_code==-1){second_cell.append("<span>"+App.lang("Development version")+"</span>")}else{second_cell.append('<span><span class="version_label">'+App.lang("Installed Version")+":</span> "+params.application_version+", build "+params.application_build+"</span>").append("<br />");version_wrapper=$('<span class="system_info_version_wrapper"></span>').appendTo(second_cell);buttons_wrapper=$('<div class="update_button_wrapper"></div>').appendTo(second_cell);refresh_button=$('<a href="#" class="link_button"></a>').append('<span class="inner">'+App.lang("Refresh")+"</span>").appendTo(buttons_wrapper).hide().click(function(){if(!params.check_for_new_version){App.Wireframe.Flash.error(App.lang('Please enable "CHECK_FOR_NEW_VERSION" in your config.php file'));return false}refresh_from_server();return false});var flyout_width="narrow";update_button=$('<a href="'+params.update_details_url+'" class="link_button" title="'+App.lang("New Version Details")+'"><span class="inner">'+App.lang("Update")+"</span></a>").appendTo(buttons_wrapper).hide();if(!application_update_status_code){version_wrapper.html(App.lang("Not checked")).removeClass("updating new_version running_latest");refresh_button.show()}else{if(application_update_status_code==3||application_update_status_code==4){version_wrapper.removeClass("updating new_version running_latest").addClass("new_version").html(App.lang("New version available (:new_version)",{new_version:params.latest_version}));if(application_update_status_code==3){update_button.show().attr("href",params.update_url).attr("title",App.lang("Update activeCollab")).attr("updating","true");flyout_width=null}update_button.show();refresh_button.show()}else{if(params.new_modules_available){version_wrapper.removeClass("updating new_version running_latest").addClass("new_version").html(App.lang("New modules available"));update_button.show().attr("href",params.update_url).attr("title",App.lang("Update activeCollab")).attr("updating","true");flyout_width=null;refresh_button.show()}else{version_wrapper.removeClass("updating new_version running_latest").addClass("running_latest").html(App.lang("activeCollab is up to date"));refresh_button.show()}}}}if(update_button&&update_button.length){update_button.flyout({width:flyout_width})}wrapper_list=$("<dl></dl>").appendTo(third_cell);wrapper_list.append("<dt>"+App.lang("Branding Removed")+"</dt>");if(params.license_copyright_removed){wrapper_list.append("<dd>"+App.lang("Yes")+"</dd>")}else{wrapper_list.append("<dd>"+App.lang("No")+' · <a href="'+params.remove_branding_url+'">'+App.lang("Purchase Branding Removal")+"</a></dd>")}var expire_date=new Date(params.license_expires*1000);wrapper_list.append("<dt>"+App.lang("Support Plan Expires")+"</dt>");wrapper_list.append("<dd>"+expire_date.format(App.Config.get("format_date"))+' · <a href="'+params.renew_support_url+'">'+App.lang("Extend Support")+"</a></dd>");wrapper_list.append("<dt>"+App.lang("License Key")+"</dt>");wrapper_list.append("<dd>"+App.formatLicenseKey(params.license_key,params.license_uid)+"</dd>");wrapper_list.append("<dt>"+App.lang("Platform")+"</dt>");wrapper_list.append("<dd>PHP ("+params.php_version+"), MYSQL ("+params.mysql_version+")</dd>")};var save_fresh_info=function(){$.ajax({url:params.save_license_details_url,type:"post",data:{submitted:"submitted",license_details:params}})};var refresh_from_server=function(){if(typeof(version_wrapper)!="undefined"&&version_wrapper.length>0){version_wrapper.removeClass("updating new_version running_latest");}};return{init:function(wrapper_id,initial_params){wrapper=$("#"+wrapper_id);params=initial_params;update_system_info_block(params);}}}();