Skip to content

Commit

Permalink
Fixed bugs with code merges
Browse files Browse the repository at this point in the history
Improved some language support

git-svn-id: https://xerteonlinetoolkits.googlecode.com/svn/trunk@295 912cdd6b-5c7d-d5a7-a2ba-d0f0cdb91641
  • Loading branch information
pgogy committed Apr 19, 2012
1 parent 89ee7dc commit 91e6dc7
Show file tree
Hide file tree
Showing 10 changed files with 141 additions and 38 deletions.
Expand Up @@ -11,7 +11,7 @@
*/


define("USERS_UPDATE_SUCCESS", "User update");
define("USERS_UPDATE_SUCCESS", "User update success");

define("USERS_UPDATE_FAIL", "User update failed");

Expand Down
6 changes: 6 additions & 0 deletions languages/en-gb/website_code/scripts/template_management.js
Expand Up @@ -41,5 +41,11 @@
var DELETE_FOLDER_NOT_EMPTY = "Sorry you cannot delete a folder that has projects in it. Please empty the folder first";

var NAME_FAIL = "Sorry that is not a valid name. Please use only letters and numbers.";

var FILE_SYNC_FAIL = "Error synchronising ";

var ERROR_DELETE = 'Error while trying to delete template';

var ERROR_DUPLICATE = 'Error while duplicating ';


22 changes: 22 additions & 0 deletions management.php
Expand Up @@ -22,6 +22,17 @@ function mgt_page($xerte_toolkits_site, $extra){
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title><?PHP echo $xerte_toolkits_site->site_title; ?></title>
<?PHP

echo "<script type=\"text/javascript\"> // JAVASCRIPT library for fixed variables\n // management of javascript is set up here\n // SITE SETTINGS\n";

echo "var site_url = \"" . $xerte_toolkits_site->site_url . "\";\n";

echo "var site_apache = \"" . $xerte_toolkits_site->apache . "\";\n";

echo "var properties_ajax_php_path = \"website_code/php/properties/\";\n var management_ajax_php_path = \"website_code/php/management/\";\n var ajax_php_path = \"website_code/php/\";\n";

?>

<link href="website_code/styles/frontpage.css" media="screen" type="text/css" rel="stylesheet" />

Expand Down Expand Up @@ -150,6 +161,17 @@ function mgt_page($xerte_toolkits_site, $extra){

<link href="website_code/styles/frontpage.css" media="screen" type="text/css" rel="stylesheet" />
<link href="website_code/styles/management.css" media="screen" type="text/css" rel="stylesheet" />
<?PHP

echo "<script type=\"text/javascript\"> // JAVASCRIPT library for fixed variables\n // management of javascript is set up here\n // SITE SETTINGS\n";

echo "var site_url = \"" . $xerte_toolkits_site->site_url . "\";\n";

echo "var site_apache = \"" . $xerte_toolkits_site->apache . "\";\n";

echo "var properties_ajax_php_path = \"website_code/php/properties/\";\n var management_ajax_php_path = \"website_code/php/management/\";\n var ajax_php_path = \"website_code/php/\";\n";

?></script>

<!--
Expand Down
3 changes: 3 additions & 0 deletions website_code/php/database_library.php
Expand Up @@ -111,6 +111,9 @@ function db_query($sql, $params = array()) {
$curph--;
}
_debug("Running : $sql",1);

//echo $sql . "<br />";

$result = mysql_query($sql, $connection);
if(!$result) {
_debug("Failed to execute query : $sql : " . mysql_error());
Expand Down
14 changes: 11 additions & 3 deletions website_code/php/management/management_library.php
Expand Up @@ -4,12 +4,14 @@

function category_list(){

global $xerte_toolkits_site;

$query="select * from " . $xerte_toolkits_site->database_table_prefix . "syndicationcategories order by category_name ASC";

echo "<p>" . MANAGEMENT_LIBRARY_ADD_CATEGORY . "</p>";

echo "<p>" . MANAGEMENT_LIBRARY_NEW_CATEGORY . "<form><textarea cols=\"100\" rows=\"2\" id=\"newcategory\">" . MANAGEMENT_LIBRARY_NEW_CATEGORY_NAME . "</textarea></form></p>";
echo "<p><form action=\"javascript:new_category();\"><input type=\"submit\" label=\"" . MANAGEMENT_LIBRARY_ADD . "\" /></form></p>";
echo "<p><form action=\"javascript:new_category();\"><input type=\"submit\" label=\"" . MANAGEMENT_LIBRARY_NEW_LABEL . "\" /></form></p>";

echo "<p>" . MANAGEMENT_LIBRARY_EXISTING_CATEGORIES . "</p>";

Expand All @@ -25,6 +27,8 @@ function category_list(){

function syndication_list(){

global $xerte_toolkits_site;

$database_id = database_connect("templates list connected","template list failed");

$query="select * from " . $xerte_toolkits_site->database_table_prefix . "templatesyndication," . $xerte_toolkits_site->database_table_prefix . "templatedetails where " . $xerte_toolkits_site->database_table_prefix . "templatesyndication.template_id = " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_id and( rss=\"true\" or export=\"true\" or syndication=\"true\")";
Expand Down Expand Up @@ -59,6 +63,8 @@ function syndication_list(){

function security_list(){

global $xerte_toolkits_site;

$query_for_play_security = "select * from " . $xerte_toolkits_site->database_table_prefix . "play_security_details";

$query_for_play_security_response = mysql_query($query_for_play_security);
Expand All @@ -68,7 +74,7 @@ function security_list(){
echo "<p>" . MANAGEMENT_LIBRARY_NEW_SECURITY . "<form><textarea cols=\"100\" rows=\"2\" id=\"newsecurity\">" . MANAGEMENT_LIBRARY_NEW_SECURITY_NAME . "</textarea></form></p>";
echo "<p>" . MANAGEMENT_LIBRARY_NEW_SECURITY_DATA . "<form><textarea cols=\"100\" rows=\"2\" id=\"newdata\">" . MANAGEMENT_LIBRARY_NEW_SECURITY_DETAILS . "</textarea></form></p>";
echo "<p>" . MANAGEMENT_LIBRARY_NEW_SECURITY_INFO . "<form><textarea cols=\"100\" rows=\"2\" id=\"newdesc\">" . MANAGEMENT_LIBRARY_NEW_SECURITY_DESCRIPTION . "</textarea></form></p>";
echo "<p><form action=\"javascript:new_security();\"><input type=\"submit\" label=\"" . MANAGEMENT_LIBRARY_ADD . "\" /></form></p>";
echo "<p><form action=\"javascript:new_security();\"><input type=\"submit\" label=\"" . MANAGEMENT_LIBRARY_ADD_SECURITY . "\" /></form></p>";

echo "<p>" . MANAGEMENT_LIBRARY_EXISTING_SECURITY . "</p>";

Expand All @@ -88,12 +94,14 @@ function security_list(){

function licence_list(){

global $xerte_toolkits_site;

$database_id = database_connect("licence list connected","licence list failed");

echo "<p>" . MANAGEMENT_LIBRARY_NEW_LICENCE . "</p>";

echo "<p>" . MANAGEMENT_LIBRARY_NEW_LICENCE_DETAILS . "<form><textarea cols=\"100\" rows=\"2\" id=\"newlicense\">" . MANAGEMENT_LIBRARY_NEW_LICENCE_NAME . "</textarea></form></p>";
echo "<p><form action=\"javascript:new_license();\"><input type=\"submit\" label=\"" . MANAGEMENT_LIBRARY_ADD . "\" /></form></p>";
echo "<p><form action=\"javascript:new_license();\"><input type=\"submit\" label=\"" . MANAGEMENT_LIBRARY_NEW_LABEL . "\" /></form></p>";

echo "<p>" . MANAGEMENT_LIBRARY_MANAGE_LICENCES . "</p>";

Expand Down
2 changes: 1 addition & 1 deletion website_code/php/management/site.php
Expand Up @@ -108,7 +108,7 @@

echo "<p>" . MANAGEMENT_SITE_ERROR_EMAIL_ACCOUNT . "<form><textarea id=\"error_log_message\">" . $row['error_log_message'] . "</textarea></form></p>";

echo "<p>" . MANAGEMENT_SITE_ERROR_EMAIL . "<form><textarea id=\"error_email_message\">" . $row['error_email_message'] . "</textarea></form></p>";
echo "<p>" . MANAGEMENT_SITE_ERROR_EMAIL . "<form><textarea id=\"error_email_list\">" . $row['email_error_list'] . "</textarea></form></p>";

echo "<p>" . MANAGEMENT_SITE_ERROR_MAX . "<form><textarea id=\"error_email_message\">" . $row['max_error_size'] . "</textarea></form></p>";

Expand Down
6 changes: 3 additions & 3 deletions website_code/php/management/site_details_management.php
Expand Up @@ -18,7 +18,7 @@
error_log_message=?, error_email_message=?, ldap_host=?, ldap_port=?, bind_pwd=?, basedn=?, bind_dn=?, flash_save_path=?, flash_upload_path=?, flash_preview_check_path=?, flash_flv_skin=? , site_email_account=?,
headers=?, email_to_add_to_username=?, proxy1=?, port1=?, site_session_name=?, synd_publisher=?, synd_rights=?, synd_license=?,import_path=? ,
apache=?, mimetypes=?, LDAP_preference=? ,LDAP_filter=? , integration_config_path=?, admin_username=? ,admin_password=? ";

$data = array($_POST['site_url'], $_POST['site_title'], $_POST['site_name'], $_POST['site_logo'], $_POST['organisational_logo'], $_POST['welcome_message'], $_POST['site_text'], base64_encode(stripcslashes($_POST['news_text'])), base64_encode(stripcslashes($_POST['pod_one'])), base64_encode(stripcslashes($_POST['pod_two'])), $copyright, $_POST['demonstration_page'], base64_encode(stripcslashes($_POST['form_string'])),
base64_encode(stripcslashes($_POST['peer_form_string'])) , $_POST['feedback_list'] , $_POST['rss_title'] , $_POST['module_path'] , $_POST['website_code_path'] , $_POST['users_file_area_short'] ,
$_POST['php_library_path'] , str_replace("\\","/",$_POST['root_file_path']) , base64_encode(stripcslashes($_POST['play_edit_preview_query'])) , $_POST['email_error_list'] , $_POST['error_log_message'] ,
Expand All @@ -33,13 +33,13 @@

$res2 = db_query($query, array($_POST['ldap_host'], $_POST['ldap_port'], $_POST['bind_dn'], $_POST['bind_pwd'], $_POST['base_dn'], $_POST['LDAP_filter'], $_POST['LDAP_preference']));

if(mysql_query($query)){
if($res && $res2){

echo MANAGEMENT_SITE_CHANGES_SUCCESS;

}else{

echo MANAGEMENT_SITE_CHANGES_FAIL;
echo MANAGEMENT_SITE_CHANGES_FAIL . " " . mysql_error($database_id);

}

Expand Down
8 changes: 4 additions & 4 deletions website_code/php/management/template_details_management.php
Expand Up @@ -12,22 +12,22 @@
date_uploaded=?,
display_name=?,
display_id=?,
access_right=?,
access_rights=?,
active=? WHERE template_type_id = ? ";


$active = "0";
if($_POST['active']==true){
$query.= "1";
$active = "1";
}

$res = db_query($query, array($_POST['desc'], $_POST{'date_uploaded'], $_POST['display'], $_POST['example'], $_POST['access'], $active, $_POST['template_id']));
$res = db_query($query, array($_POST['desc'], $_POST['date_uploaded'], $_POST['display'], $_POST['example'], $_POST['access'], $active, $_POST['template_id']));


if($res){
echo TEMPLATE_CHANGE_SUCCESS;
}else{
echo TEMPLATE_CHANGE_FAIL;
echo TEMPLATE_CHANGE_FAIL . " " . mysql_error();
}

}

0 comments on commit 91e6dc7

Please sign in to comment.