Skip to content

Commit

Permalink
Config.php
Browse files Browse the repository at this point in the history
Problem in _load_language_file if path doesn't exist (two files had typos in name).
Added a file_exists call - better than a require fail? I thought possibly

Index.php

Deleted mine by mistake - should be identical as taken from trunk

Some language files changes to fix the properties errors and a typo in Peer review

Modules/Xerte/Peer.php had some eeeeengggggleeeeeesh in it still. Now removed. Toppie!

RSS.PHP - all garbled up, now put back together again (suspect the merge)

Website_code/php/fileupload.php - typo in name of language file

website_code/php/peer/peer_review.php - typo in name of language file

website_code/php/properties/access_template.php - all messed up by the merge i think (code had reappeared that had been taken out).

website_code/php/properties/xml_template.php - all messed up by the merge i think (code had reappeared that had been taken out).

website_code/php/scorm/export.php added isset check to some variables so as to pass STRICT_WARNINGS and resolved all manner of crazy post mergeness - the file had it's contents copied three times.

website_code/php/scorm/scorm_library.php fixed typo in array index for licences (to licence)

git-svn-id: https://xerteonlinetoolkits.googlecode.com/svn/trunk@283 912cdd6b-5c7d-d5a7-a2ba-d0f0cdb91641
  • Loading branch information
pgogy committed Mar 7, 2012
1 parent 0ebc62f commit db74f18
Show file tree
Hide file tree
Showing 12 changed files with 78 additions and 229 deletions.
9 changes: 7 additions & 2 deletions config.php
Expand Up @@ -54,14 +54,19 @@ function _debug($string, $up = 0) {
if(!function_exists('_load_language_file')) {
function _load_language_file($file_path) {
if(isset($_SESSION['toolkits_language'])) {
$file_path = dirname(__FILE__) . '/languages/' . $_SESSION['toolkits_language'] . "/" . $file_path;
$file_path = dirname(__FILE__) . '/languages/' . $_SESSION['toolkits_language'] . $file_path;
}
else {
// additional logic could use e.g. $_GET['language'] or $_COOKIE['language'] at this point... or something like Zend_Locale and HTTP accept headers...
// we'll just fall back to assuming en-gb if nothing else is specified here.
$file_path = dirname(__FILE__) . '/languages/en-gb/' . $file_path;
}
require_once($file_path);
if(file_exists($file_path)){

require_once($file_path);

}

return true;
}
}
Expand Down
68 changes: 34 additions & 34 deletions index.php
Expand Up @@ -52,7 +52,7 @@ function show_page($extra,$xerte_toolkits_site){
<p>
<?PHP echo $xerte_toolkits_site->welcome_message; ?>
</p>
</div>
</div>
<div class="mainbody_holder">
<div class="mainbody_div_2">
<div class="top_left sign_in_TL m_b_d_2_child" style="background-color:#f3eee2;">
Expand Down Expand Up @@ -108,15 +108,15 @@ function show_page($extra,$xerte_toolkits_site){

</div>
<div class="mainbody_left">
<div class="tutorials">
<div class="tutorials">
</div>
</div>
<div class="mainbody_div">
</div>
<div class="mainbody_div">
<p class="intro">
<?PHP echo $xerte_toolkits_site->site_text; ?>
</p>
</div>
</div>
</div>
</div>
<div class="border">
</div>
Expand Down Expand Up @@ -212,7 +212,7 @@ function show_page($extra,$xerte_toolkits_site){

include $xerte_toolkits_site->php_library_path . "user_library.php";

$mysql_id=database_connect("index.php database connect success","index.php database connect fail");
$mysql_id=database_connect("index.php database connect success","index.php database connect fail");

$_SESSION['toolkits_logon_username'] = $_POST["login"];

Expand All @@ -223,7 +223,7 @@ function show_page($extra,$xerte_toolkits_site){
if(check_if_first_time($_SESSION['toolkits_logon_username'])){

/*
* create the user a new id
* create the user a new id
*/

$_SESSION['toolkits_logon_id'] = create_user_id($_SESSION['toolkits_logon_username'], $_SESSION['toolkits_firstname'], $_SESSION['toolkits_surname']);
Expand All @@ -232,7 +232,7 @@ function show_page($extra,$xerte_toolkits_site){
* create a virtual root folder for this user
*/

create_a_virtual_root_folder();
create_a_virtual_root_folder();

}else{

Expand All @@ -246,7 +246,7 @@ function show_page($extra,$xerte_toolkits_site){

}

recycle_bin();
recycle_bin();

/*
* Output the main page, including the user's and blank templates
Expand Down Expand Up @@ -313,7 +313,7 @@ function show_page($extra,$xerte_toolkits_site){
-->

<div class="folder_popup" id="message_box">
<div class="folder_popup" id="message_box">
<div class="corner" style="background-image:url(website_code/images/MessBoxTL.gif); background-position:top left;">
</div>
<div class="central" style="background-image:url(website_code/images/MessBoxTop.gif);">
Expand All @@ -324,7 +324,7 @@ function show_page($extra,$xerte_toolkits_site){
<div class="main_area_holder_2">
<div class="main_area" id="dynamic_section">
<p><?PHP echo INDEX_FOLDER_PROMPT; ?></p><form id="foldernamepopup" action="javascript:create_folder()" method="post" enctype="text/plain"><input type="text" width="200" id="foldername" name="foldername" style="margin:0px; margin-right:5px; padding:3px" /> <input type="image" src="website_code/images/Bttn_NewFolderOff.gif" onmouseover="this.src='website_code/images/Bttn_NewFolderOn.gif'" onmousedown="this.src='website_code/images/Bttn_NewFolderClick.gif'" onmouseout="this.src='website_code/images/Bttn_NewFolderOff.gif'" style="vertical-align:middle; margin-left:5px; border:1px solid #0f0;" /></form><p><img src="website_code/images/Bttn_CancelOff.gif" onmouseover="this.src='website_code/images/Bttn_CancelOn.gif'" onmousedown="this.src='website_code/images/Bttn_CancelClick.gif'" onmouseout="this.src='website_code/images/Bttn_CancelOff.gif'" onclick="javascript:popup_close()" /></p>
</div>
</div>
</div>
</div>
<div class="corner" style="background-image:url(website_code/images/MessBoxBL.gif); background-position:top left;">
Expand Down Expand Up @@ -354,8 +354,8 @@ function show_page($extra,$xerte_toolkits_site){
<div class="file_mgt_area_top">
<div class="top_left sign_in_TL m_b_d_2_child">
<div class="top_right sign_in_TR m_b_d_2_child">
<p class="heading">
<?PHP echo INDEX_WORKSPACE_TITLE; ?>
<p class="heading">
<?PHP echo INDEX_WORKSPACE_TITLE; ?>
</p>
</div>
</div>
Expand All @@ -372,15 +372,15 @@ function show_page($extra,$xerte_toolkits_site){

<div class="file_mgt_area_middle_button_left">
<img src="website_code/images/Bttn_NewFolderOff.gif" onmousedown="this.src='website_code/images/Bttn_NewFolderClick.gif'" onmouseover="this.src='website_code/images/Bttn_NewFolderOn.gif'" onmouseout="this.src='website_code/images/Bttn_NewFolderOff.gif'" onclick="javascript:make_new_folder()" />
</div>
</div>
<div class="file_mgt_area_middle_button_left">
<img id="properties" src="website_code/images/Bttn_PropertiesDis.gif" />
<img id="edit" src="website_code/images/Bttn_EditDis.gif" />
<img id="preview" src="website_code/images/Bttn_PreviewDis.gif" />
</div>
<div class="file_mgt_area_middle_button_right">
<img id="delete" src="website_code/images/Bttn_DeleteDis.gif" />
<img id="duplicate" src="website_code/images/Bttn_DuplicateDis.gif" />
<img id="preview" src="website_code/images/Bttn_PreviewDis.gif" />
</div>
<div class="file_mgt_area_middle_button_right">
<img id="delete" src="website_code/images/Bttn_DeleteDis.gif" />
<img id="duplicate" src="website_code/images/Bttn_DuplicateDis.gif" />
<img id="publish" src="website_code/images/Bttn_PublishDis.gif" />
</div>
<div id="file_area" onscroll="scroll_check(event,this)" onmousemove="mousecoords(event)" onmouseup="file_drag_stop(event,this)"><?PHP
Expand All @@ -396,8 +396,8 @@ function show_page($extra,$xerte_toolkits_site){
-->

</div>
<div class="file_mgt_area_bottom" style="height:30px;">
</div>
<div class="file_mgt_area_bottom" style="height:30px;">
<div class="bottom_left sign_in_BL m_b_d_2_child" style="height:30px;">
<div class="bottom_right sign_in_BR m_b_d_2_child" style="height:30px;">
<form name="sorting" style="display:inline">
Expand All @@ -417,21 +417,21 @@ function show_page($extra,$xerte_toolkits_site){
</div>
<div class="border" style="margin-top:10px"></div>
<div class="help" style="width:48%">
<?PHP echo $xerte_toolkits_site->pod_one; ?>
<?PHP echo $xerte_toolkits_site->pod_one; ?>
</div>

<div class="help" style="width:48%; float:right;">
<?PHP echo $xerte_toolkits_site->pod_two; ?>
<?PHP echo $xerte_toolkits_site->pod_two; ?>
</div>
</div>

<div class="new_template_area">
<div class="top_left sign_in_TL m_b_d_2_child new_template_mod">
<div class="top_right sign_in_TR m_b_d_2_child">
<p class="heading">
<?PHP echo INDEX_CREATE; ?> </p>
<p class="heading">
<?PHP echo INDEX_CREATE; ?> </p>
<p class="general">
<?PHP echo INDEX_TEMPLATES; ?> </p>
<?PHP echo INDEX_TEMPLATES; ?> </p>
</div>
</div>

Expand All @@ -445,7 +445,7 @@ function show_page($extra,$xerte_toolkits_site){



<div id="new_template_area_middle_ajax" class="new_template_area_middle_scroll"><?PHP
<div id="new_template_area_middle_ajax" class="new_template_area_middle_scroll"><?PHP

list_blank_templates();

Expand All @@ -455,18 +455,18 @@ function show_page($extra,$xerte_toolkits_site){
-->

</div>
</div>
</div>
<div class="file_mgt_area_bottom" style="width:100%">
<div class="file_mgt_area_bottom" style="width:100%">
<div class="bottom_left sign_in_BL m_b_d_2_child">
<div class="bottom_right sign_in_BR m_b_d_2_child" style="height:10px;"> </div>
<div class="bottom_right sign_in_BR m_b_d_2_child" style="height:10px;"> </div>
</div>
</div>
</div>
<div class="border"> </div>
<div class="border"> </div>
<p class="copyright">
<img src="website_code/images/lt_logo.gif" /><br>
<?PHP echo $xerte_toolkits_site->copyright; ?></p>
<?PHP echo $xerte_toolkits_site->copyright; ?></p>
</div>


Expand All @@ -476,7 +476,7 @@ function show_page($extra,$xerte_toolkits_site){

}else{

if(($_POST["login"]==$xerte_toolkits_site->admin_username)&&(stripslashes($_POST["password"])==$xerte_toolkits_site->admin_password)){
if(($_POST["login"]==$xerte_toolkits_site->admin_username)&&(stripslashes($_POST["password"])==$xerte_toolkits_site->admin_password)){

show_page("<p>" . INDEX_SITE_ADMIN . "</p>",$xerte_toolkits_site);

Expand All @@ -498,4 +498,4 @@ function show_page($extra,$xerte_toolkits_site){

?>
</body>
</html>
</html>
2 changes: 2 additions & 0 deletions languages/en-gb/modules/xerte/peer.inc
Expand Up @@ -15,4 +15,6 @@

define("XERTE_PEER_GUIDANCE", "Please review this learning object. Use the feedback form below to submit your feedback.");

define("XERTE_PEER_TEXTAREA_INSTRUCTIONS", "You have been asked to provide some feedback on this learning object. Please enter your feedback and click save when you have finished. This feedback is anonymous.");

?>
Expand Up @@ -134,8 +134,6 @@

define("PROPERTIES_LIBRARY_RSS_INCLUDE", "Include this project in the RSS Feeds");

define("PROPERTIES_LIBRARY_RSS_EXPORT", "You can also include a description for your project in the RSS Feed as well");

define("PROPERTIES_LIBRARY_RSS_DESCRIPTION", "You can also include a description for your project in the RSS Feed as well");

define("PROPERTIES_LIBRARY_RSS_SITE", "You can include this content in the site's RSS feeds. People who subscribe to the feeds will see new content as it as added to the feeds. There are several feeds available");
Expand Down
2 changes: 1 addition & 1 deletion modules/xerte/peer.php
Expand Up @@ -63,7 +63,7 @@ function enableTTS(){

echo "<a name=\"feedbackform\"><p style=\"width:250px; color:red;\" id=\"feedback\"></p></a>";

echo "<br><form name=\"peer\" action=\"javascript:send_review('" . $row_play['username'] . "','" . $row_play['template_id'] . "')\" method=\"post\" enctype=\"text/plain\"><textarea style=\"width:800px; height:300px;\" name=\"response\">You have been asked to provide some feedback on this learning object. Please enter your feedback and click save when you have finished. This feedback is anonymous.</textarea><br/><input type=\"image\" src=\"website_code/images/Bttn_SaveOff.gif\" onmouseover=\"this.src='website_code/images/Bttn_SaveOn.gif'\" onmousedown=\"this.src='website_code/images/Bttn_SaveClick.gif'\" onmouseout=\"this.src='website_code/images/Bttn_SaveOff.gif'\" /></form><a name=\"feedbackform\"><p style=\"width:250px;\" id=\"feedback\"></p></a></div>";
echo "<br><form name=\"peer\" action=\"javascript:send_review('" . $row_play['username'] . "','" . $row_play['template_id'] . "')\" method=\"post\" enctype=\"text/plain\"><textarea style=\"width:800px; height:300px;\" name=\"response\">" . XERTE_PEER_TEXTAREA_INSTRUCTIONS . "</textarea><br/><input type=\"image\" src=\"website_code/images/Bttn_SaveOff.gif\" onmouseover=\"this.src='website_code/images/Bttn_SaveOn.gif'\" onmousedown=\"this.src='website_code/images/Bttn_SaveClick.gif'\" onmouseout=\"this.src='website_code/images/Bttn_SaveOff.gif'\" /></form><a name=\"feedbackform\"><p style=\"width:250px;\" id=\"feedback\"></p></a></div>";

echo "</body></html>";

Expand Down
20 changes: 10 additions & 10 deletions rss.php
Expand Up @@ -52,16 +52,16 @@
$folder_string = " - " . _html_escape(str_replace("_", " ", $_GET['folder_name']));
}

echo "<rss version=\"2.0\"><channel>
<title>" . _html_escape($temp_array[0]) . " " . _html_escape($temp_array[1]) . RSS_LO . " - " . {$xerte_toolkits_site->name}</title>
<link>{$xerte_toolkits_site->site_url}</link>
<description>" . RSS_FEED_DESC . _html_escape($temp_array[0]) . " " . _html_escape($temp_array[1]) . RSS_PLURAL . " {$folder_string} . " . RSS_FEED_PUBLIC . {$xerte_toolkits_site->name}</description>
<language>en-gb</language>
<image>
<title>{$xerte_toolkits_site->rss_title}</title>
<url>{$xerte_toolkits_site->site_url}website_code/images/xerteLogo.jpg</url>
<link>{$xerte_toolkits_site->site_url}</link></image>";
$row_create = $rows[1];
echo "<rss version=\"2.0\">
<channel><title>{$xerte_toolkits_site->name}</title>
<link>{$xerte_toolkits_site->site_url}</link>
<description>" . RSS_DESCRIPTION . " " . $xerte_toolkits_site->name . "</description>
<language>" . RSS_LANGUAGE . "</language>
<image><title>{$xerte_toolkits_site->name}</title>
<url>{$xerte_toolkits_site->site_url}website_code/images/xerteLogo.jpg</url>
<link>{$xerte_toolkits_site->site_url}</link></image>";

$row_create = $rows[0];

}
}
Expand Down
2 changes: 1 addition & 1 deletion website_code/php/import/fileupload.php
Expand Up @@ -2,7 +2,7 @@

require_once "../../../config.php";

_load_language_file("/website_code/php/fileupload.inc");
_load_language_file("/website_code/php/import/fileupload.inc");

if(in_array($_FILES['filenameuploaded']['type'],$xerte_toolkits_site->mimetypes)){

Expand Down
8 changes: 6 additions & 2 deletions website_code/php/peer/peer_review.php
Expand Up @@ -12,7 +12,7 @@

require_once("../../../config.php");

_load_language_file("/website_code/php/peer_review.inc");
_load_language_file("/website_code/php/peer/peer_review.inc");

if(empty($_POST['template_id'])) {
die("invalid form submission");
Expand All @@ -26,7 +26,11 @@

if(isset($_POST['user'])){

if(mail( $_POST['user'] . "@" . $xerte_toolkits_site->email_to_add_to_username, PEER_REVIEW_FEEDBACK . " - \"" . str_replace("_"," ",$row_template_name['template_name']) ."\"", PEER_REVIEW_EMAIL_GREETING . " <br><br> " . PEER_REVIEW_EMAIL_INTRO . "<br><br><br>" . $_POST['feedback'] . "<br><br><br>" . PEER_REVIEW_EMAIL_YOURS . "<br><br>" . PEER_REVIEW_EMAIL_SIGNATURE, $headers)){
$message = PEER_REVIEW_FEEDBACK . " - \"" . str_replace("_"," ",$row_template_name['template_name']) ."\"";

$subject = PEER_REVIEW_EMAIL_GREETING . " <br><br> " . PEER_REVIEW_EMAIL_INTRO . "<br><br><br>" . $_POST['feedback'] . "<br><br><br>" . PEER_REVIEW_EMAIL_YOURS . "<br><br>" . PEER_REVIEW_EMAIL_SIGNATURE;

if(mail( $_POST['user'] . "@" . $xerte_toolkits_site->email_to_add_to_username, $subject, $message, $headers)){

echo "<b>" . PEER_REVIEW_USER_FEEDBACK . "</b>";

Expand Down
28 changes: 2 additions & 26 deletions website_code/php/properties/access_template.php
Expand Up @@ -56,34 +56,10 @@ function template_share_status($string){

access_display_fail();

}

mysql_close($database_connect_id);

if(mysql_num_rows($query_for_security_content_response)!=0){

while($row_security = mysql_fetch_array($query_for_security_content_response)){

if(template_share_status($row_security['security_setting'])){

echo "<p id=\"" . $row_security['security_setting'] . "\" class=\"share_status_paragraph\"><img src=\"website_code/images/TickBoxOn.gif\" onclick=\"javascript:access_tick_toggle(this)\" />";

}else{

echo "<p id=\"" . $row_security['security_setting'] . "\" class=\"share_status_paragraph\"><img src=\"website_code/images/TickBoxOff.gif\" onclick=\"javascript:access_tick_toggle(this)\" />";

}

echo " " . $row_security['security_setting'] . "</p><p class=\"share_explain_paragraph\">" . $row_security['security_info'] . "</p>";

}

}

echo "</div>";

echo "<p><img src=\"website_code/images/Bttn_SaveOff.gif\" onmouseover=\"this.src='website_code/images/Bttn_SaveClick.gif'\" onmousedown=\"this.src='website_code/images/Bttn_SaveOn.gif'\" onmouseout=\"this.src='website_code/images/Bttn_SaveOff.gif'\" onclick=\"javascript:access_change_template(" . $_POST['template_id'] . ")\" /> </p>";

}else{

echo "<p>Sorry only the creator can set the access settings</p>";

}
6 changes: 0 additions & 6 deletions website_code/php/properties/xml_template.php
Expand Up @@ -33,12 +33,6 @@

}

mysql_close($database_id);

echo "<p>Sorry, only creators of templates can set up XML sharing</p>";

}

mysql_close($database_id);

}
Expand Down

0 comments on commit db74f18

Please sign in to comment.