diff --git a/website_code/admin_headers b/website_code/admin_headers deleted file mode 100644 index 50de9b2703..0000000000 --- a/website_code/admin_headers +++ /dev/null @@ -1,17 +0,0 @@ - - - - - -Welcome to Xerte Web Toolkits - - - \ No newline at end of file diff --git a/website_code/admin_middle b/website_code/admin_middle deleted file mode 100644 index 8dee72951d..0000000000 --- a/website_code/admin_middle +++ /dev/null @@ -1,18 +0,0 @@ - - - - - -
-
- -
-
-
- - \ No newline at end of file diff --git a/website_code/admin_top b/website_code/admin_top deleted file mode 100644 index db6640d6bf..0000000000 --- a/website_code/admin_top +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - -
-
-
-
-
-
-
-
-
-
-

What would you like to call your folder?

-
-
-
-
-
-
-
-
-
-
- -
-
-

Log out

-
- -
- - - -
- -
-
- -
- -
-
- - - - -
- Save -
-
\ No newline at end of file diff --git a/website_code/error_top b/website_code/error_top deleted file mode 100644 index 6b596d3bac..0000000000 --- a/website_code/error_top +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - -Xerte Online Editor Window - - - - - -
-
- - -
-
- diff --git a/website_code/images/BackgroundLogin.gif b/website_code/images/BackgroundLogin.gif deleted file mode 100644 index 9eaba7d216..0000000000 Binary files a/website_code/images/BackgroundLogin.gif and /dev/null differ diff --git a/website_code/images/Bttn_CancelClick.gif b/website_code/images/Bttn_CancelClick.gif deleted file mode 100644 index 7074c0c62b..0000000000 Binary files a/website_code/images/Bttn_CancelClick.gif and /dev/null differ diff --git a/website_code/images/Bttn_CancelOff.gif b/website_code/images/Bttn_CancelOff.gif deleted file mode 100644 index b0d4243e13..0000000000 Binary files a/website_code/images/Bttn_CancelOff.gif and /dev/null differ diff --git a/website_code/images/Bttn_CancelOn.gif b/website_code/images/Bttn_CancelOn.gif deleted file mode 100644 index 8368323901..0000000000 Binary files a/website_code/images/Bttn_CancelOn.gif and /dev/null differ diff --git a/website_code/images/Bttn_CloseClick.gif b/website_code/images/Bttn_CloseClick.gif deleted file mode 100644 index 3972446004..0000000000 Binary files a/website_code/images/Bttn_CloseClick.gif and /dev/null differ diff --git a/website_code/images/Bttn_CloseCrossClick.gif b/website_code/images/Bttn_CloseCrossClick.gif deleted file mode 100644 index db59d158f3..0000000000 Binary files a/website_code/images/Bttn_CloseCrossClick.gif and /dev/null differ diff --git a/website_code/images/Bttn_CloseCrossOff.gif b/website_code/images/Bttn_CloseCrossOff.gif deleted file mode 100644 index 37075fe2f4..0000000000 Binary files a/website_code/images/Bttn_CloseCrossOff.gif and /dev/null differ diff --git a/website_code/images/Bttn_CloseCrossOn.gif b/website_code/images/Bttn_CloseCrossOn.gif deleted file mode 100644 index 7aad11b703..0000000000 Binary files a/website_code/images/Bttn_CloseCrossOn.gif and /dev/null differ diff --git a/website_code/images/Bttn_CloseOff.gif b/website_code/images/Bttn_CloseOff.gif deleted file mode 100644 index 6395323930..0000000000 Binary files a/website_code/images/Bttn_CloseOff.gif and /dev/null differ diff --git a/website_code/images/Bttn_CloseOn.gif b/website_code/images/Bttn_CloseOn.gif deleted file mode 100644 index f8518431a8..0000000000 Binary files a/website_code/images/Bttn_CloseOn.gif and /dev/null differ diff --git a/website_code/images/Bttn_CloseWindowClick.gif b/website_code/images/Bttn_CloseWindowClick.gif deleted file mode 100644 index e32ee3a573..0000000000 Binary files a/website_code/images/Bttn_CloseWindowClick.gif and /dev/null differ diff --git a/website_code/images/Bttn_CloseWindowOff.gif b/website_code/images/Bttn_CloseWindowOff.gif deleted file mode 100644 index 0721b0510d..0000000000 Binary files a/website_code/images/Bttn_CloseWindowOff.gif and /dev/null differ diff --git a/website_code/images/Bttn_CloseWindowOn.gif b/website_code/images/Bttn_CloseWindowOn.gif deleted file mode 100644 index 1db881a3fc..0000000000 Binary files a/website_code/images/Bttn_CloseWindowOn.gif and /dev/null differ diff --git a/website_code/images/Bttn_CreateClick.gif b/website_code/images/Bttn_CreateClick.gif deleted file mode 100644 index 34373c59d8..0000000000 Binary files a/website_code/images/Bttn_CreateClick.gif and /dev/null differ diff --git a/website_code/images/Bttn_CreateOff.gif b/website_code/images/Bttn_CreateOff.gif deleted file mode 100644 index d0ae18ec3f..0000000000 Binary files a/website_code/images/Bttn_CreateOff.gif and /dev/null differ diff --git a/website_code/images/Bttn_CreateOn.gif b/website_code/images/Bttn_CreateOn.gif deleted file mode 100644 index 45afee60f9..0000000000 Binary files a/website_code/images/Bttn_CreateOn.gif and /dev/null differ diff --git a/website_code/images/Bttn_CreateProjectClick.gif b/website_code/images/Bttn_CreateProjectClick.gif deleted file mode 100644 index e5a7f8cce1..0000000000 Binary files a/website_code/images/Bttn_CreateProjectClick.gif and /dev/null differ diff --git a/website_code/images/Bttn_CreateProjectOff.gif b/website_code/images/Bttn_CreateProjectOff.gif deleted file mode 100644 index 280b2522f5..0000000000 Binary files a/website_code/images/Bttn_CreateProjectOff.gif and /dev/null differ diff --git a/website_code/images/Bttn_CreateProjectOn.gif b/website_code/images/Bttn_CreateProjectOn.gif deleted file mode 100644 index ca4e7a2e9c..0000000000 Binary files a/website_code/images/Bttn_CreateProjectOn.gif and /dev/null differ diff --git a/website_code/images/Bttn_DeleteClick.gif b/website_code/images/Bttn_DeleteClick.gif deleted file mode 100644 index 3c97d067f4..0000000000 Binary files a/website_code/images/Bttn_DeleteClick.gif and /dev/null differ diff --git a/website_code/images/Bttn_DeleteDis.gif b/website_code/images/Bttn_DeleteDis.gif deleted file mode 100644 index 60d2d94a45..0000000000 Binary files a/website_code/images/Bttn_DeleteDis.gif and /dev/null differ diff --git a/website_code/images/Bttn_DeleteOff.gif b/website_code/images/Bttn_DeleteOff.gif deleted file mode 100644 index 6edbbfd3f8..0000000000 Binary files a/website_code/images/Bttn_DeleteOff.gif and /dev/null differ diff --git a/website_code/images/Bttn_DeleteOn.gif b/website_code/images/Bttn_DeleteOn.gif deleted file mode 100644 index a08d9c9cc3..0000000000 Binary files a/website_code/images/Bttn_DeleteOn.gif and /dev/null differ diff --git a/website_code/images/Bttn_DuplicateClick.gif b/website_code/images/Bttn_DuplicateClick.gif deleted file mode 100644 index 65e5f492a8..0000000000 Binary files a/website_code/images/Bttn_DuplicateClick.gif and /dev/null differ diff --git a/website_code/images/Bttn_DuplicateDis.gif b/website_code/images/Bttn_DuplicateDis.gif deleted file mode 100644 index 82f43b7a7e..0000000000 Binary files a/website_code/images/Bttn_DuplicateDis.gif and /dev/null differ diff --git a/website_code/images/Bttn_DuplicateOff.gif b/website_code/images/Bttn_DuplicateOff.gif deleted file mode 100644 index b268efe031..0000000000 Binary files a/website_code/images/Bttn_DuplicateOff.gif and /dev/null differ diff --git a/website_code/images/Bttn_DuplicateOn.gif b/website_code/images/Bttn_DuplicateOn.gif deleted file mode 100644 index 1ce4bcb1fc..0000000000 Binary files a/website_code/images/Bttn_DuplicateOn.gif and /dev/null differ diff --git a/website_code/images/Bttn_EditClick.gif b/website_code/images/Bttn_EditClick.gif deleted file mode 100644 index 57650ef68e..0000000000 Binary files a/website_code/images/Bttn_EditClick.gif and /dev/null differ diff --git a/website_code/images/Bttn_EditDis.gif b/website_code/images/Bttn_EditDis.gif deleted file mode 100644 index 7c9a725236..0000000000 Binary files a/website_code/images/Bttn_EditDis.gif and /dev/null differ diff --git a/website_code/images/Bttn_EditOff.gif b/website_code/images/Bttn_EditOff.gif deleted file mode 100644 index 30d8149c51..0000000000 Binary files a/website_code/images/Bttn_EditOff.gif and /dev/null differ diff --git a/website_code/images/Bttn_EditOn.gif b/website_code/images/Bttn_EditOn.gif deleted file mode 100644 index 33aa93eaba..0000000000 Binary files a/website_code/images/Bttn_EditOn.gif and /dev/null differ diff --git a/website_code/images/Bttn_ExportClick.gif b/website_code/images/Bttn_ExportClick.gif deleted file mode 100644 index a13e3911be..0000000000 Binary files a/website_code/images/Bttn_ExportClick.gif and /dev/null differ diff --git a/website_code/images/Bttn_ExportOff.gif b/website_code/images/Bttn_ExportOff.gif deleted file mode 100644 index e4178eb2fd..0000000000 Binary files a/website_code/images/Bttn_ExportOff.gif and /dev/null differ diff --git a/website_code/images/Bttn_ExportOn.gif b/website_code/images/Bttn_ExportOn.gif deleted file mode 100644 index 78e613d218..0000000000 Binary files a/website_code/images/Bttn_ExportOn.gif and /dev/null differ diff --git a/website_code/images/Bttn_LoginClick.gif b/website_code/images/Bttn_LoginClick.gif deleted file mode 100644 index bf04062b42..0000000000 Binary files a/website_code/images/Bttn_LoginClick.gif and /dev/null differ diff --git a/website_code/images/Bttn_LoginOff.gif b/website_code/images/Bttn_LoginOff.gif deleted file mode 100644 index 316dcd0728..0000000000 Binary files a/website_code/images/Bttn_LoginOff.gif and /dev/null differ diff --git a/website_code/images/Bttn_LoginOn.gif b/website_code/images/Bttn_LoginOn.gif deleted file mode 100644 index 100b507be0..0000000000 Binary files a/website_code/images/Bttn_LoginOn.gif and /dev/null differ diff --git a/website_code/images/Bttn_NewFolderClick.gif b/website_code/images/Bttn_NewFolderClick.gif deleted file mode 100644 index b6862d0a1f..0000000000 Binary files a/website_code/images/Bttn_NewFolderClick.gif and /dev/null differ diff --git a/website_code/images/Bttn_NewFolderOff.gif b/website_code/images/Bttn_NewFolderOff.gif deleted file mode 100644 index f79c52f351..0000000000 Binary files a/website_code/images/Bttn_NewFolderOff.gif and /dev/null differ diff --git a/website_code/images/Bttn_NewFolderOn.gif b/website_code/images/Bttn_NewFolderOn.gif deleted file mode 100644 index 68cba0a2ed..0000000000 Binary files a/website_code/images/Bttn_NewFolderOn.gif and /dev/null differ diff --git a/website_code/images/Bttn_PreviewClick.gif b/website_code/images/Bttn_PreviewClick.gif deleted file mode 100644 index d72228d5f8..0000000000 Binary files a/website_code/images/Bttn_PreviewClick.gif and /dev/null differ diff --git a/website_code/images/Bttn_PreviewDis.gif b/website_code/images/Bttn_PreviewDis.gif deleted file mode 100644 index 0d2f5c0f83..0000000000 Binary files a/website_code/images/Bttn_PreviewDis.gif and /dev/null differ diff --git a/website_code/images/Bttn_PreviewOff.gif b/website_code/images/Bttn_PreviewOff.gif deleted file mode 100644 index f8c61052c6..0000000000 Binary files a/website_code/images/Bttn_PreviewOff.gif and /dev/null differ diff --git a/website_code/images/Bttn_PreviewOn.gif b/website_code/images/Bttn_PreviewOn.gif deleted file mode 100644 index 4467bd5a4c..0000000000 Binary files a/website_code/images/Bttn_PreviewOn.gif and /dev/null differ diff --git a/website_code/images/Bttn_PropertiesClick.gif b/website_code/images/Bttn_PropertiesClick.gif deleted file mode 100644 index 07ffa38b6f..0000000000 Binary files a/website_code/images/Bttn_PropertiesClick.gif and /dev/null differ diff --git a/website_code/images/Bttn_PropertiesDis.gif b/website_code/images/Bttn_PropertiesDis.gif deleted file mode 100644 index 4863fc3dd8..0000000000 Binary files a/website_code/images/Bttn_PropertiesDis.gif and /dev/null differ diff --git a/website_code/images/Bttn_PropertiesOff.gif b/website_code/images/Bttn_PropertiesOff.gif deleted file mode 100644 index 3f7e4e9d0b..0000000000 Binary files a/website_code/images/Bttn_PropertiesOff.gif and /dev/null differ diff --git a/website_code/images/Bttn_PropertiesOn.gif b/website_code/images/Bttn_PropertiesOn.gif deleted file mode 100644 index a4a9f6cfab..0000000000 Binary files a/website_code/images/Bttn_PropertiesOn.gif and /dev/null differ diff --git a/website_code/images/Bttn_PublishClick.gif b/website_code/images/Bttn_PublishClick.gif deleted file mode 100644 index 5d3ff81951..0000000000 Binary files a/website_code/images/Bttn_PublishClick.gif and /dev/null differ diff --git a/website_code/images/Bttn_PublishDis.gif b/website_code/images/Bttn_PublishDis.gif deleted file mode 100644 index 6c1714583c..0000000000 Binary files a/website_code/images/Bttn_PublishDis.gif and /dev/null differ diff --git a/website_code/images/Bttn_PublishOff.gif b/website_code/images/Bttn_PublishOff.gif deleted file mode 100644 index 56d9bc43d1..0000000000 Binary files a/website_code/images/Bttn_PublishOff.gif and /dev/null differ diff --git a/website_code/images/Bttn_PublishOn.gif b/website_code/images/Bttn_PublishOn.gif deleted file mode 100644 index a0b8d9f936..0000000000 Binary files a/website_code/images/Bttn_PublishOn.gif and /dev/null differ diff --git a/website_code/images/Bttn_RemoveClick.gif b/website_code/images/Bttn_RemoveClick.gif deleted file mode 100644 index b7c39edc81..0000000000 Binary files a/website_code/images/Bttn_RemoveClick.gif and /dev/null differ diff --git a/website_code/images/Bttn_RemoveOff.gif b/website_code/images/Bttn_RemoveOff.gif deleted file mode 100644 index 28962b1ad1..0000000000 Binary files a/website_code/images/Bttn_RemoveOff.gif and /dev/null differ diff --git a/website_code/images/Bttn_RemoveOn.gif b/website_code/images/Bttn_RemoveOn.gif deleted file mode 100644 index fb3d6e6d4e..0000000000 Binary files a/website_code/images/Bttn_RemoveOn.gif and /dev/null differ diff --git a/website_code/images/Bttn_SaveClick.gif b/website_code/images/Bttn_SaveClick.gif deleted file mode 100644 index 8f2a5a0efa..0000000000 Binary files a/website_code/images/Bttn_SaveClick.gif and /dev/null differ diff --git a/website_code/images/Bttn_SaveOff.gif b/website_code/images/Bttn_SaveOff.gif deleted file mode 100644 index 5f69238ead..0000000000 Binary files a/website_code/images/Bttn_SaveOff.gif and /dev/null differ diff --git a/website_code/images/Bttn_SaveOn.gif b/website_code/images/Bttn_SaveOn.gif deleted file mode 100644 index ac4efc161a..0000000000 Binary files a/website_code/images/Bttn_SaveOn.gif and /dev/null differ diff --git a/website_code/images/Bttn_Sep.gif b/website_code/images/Bttn_Sep.gif deleted file mode 100644 index a539f6874e..0000000000 Binary files a/website_code/images/Bttn_Sep.gif and /dev/null differ diff --git a/website_code/images/IconMessRight.gif b/website_code/images/IconMessRight.gif deleted file mode 100644 index 0dc9ae649b..0000000000 Binary files a/website_code/images/IconMessRight.gif and /dev/null differ diff --git a/website_code/images/IconMessWrong.gif b/website_code/images/IconMessWrong.gif deleted file mode 100644 index 351d591748..0000000000 Binary files a/website_code/images/IconMessWrong.gif and /dev/null differ diff --git a/website_code/images/Icon_Folder.gif b/website_code/images/Icon_Folder.gif deleted file mode 100644 index 93a1cd93f0..0000000000 Binary files a/website_code/images/Icon_Folder.gif and /dev/null differ diff --git a/website_code/images/Icon_FolderOpen.gif b/website_code/images/Icon_FolderOpen.gif deleted file mode 100644 index fd334f8107..0000000000 Binary files a/website_code/images/Icon_FolderOpen.gif and /dev/null differ diff --git a/website_code/images/Icon_FolderOpen2.gif b/website_code/images/Icon_FolderOpen2.gif deleted file mode 100644 index 85f86609fe..0000000000 Binary files a/website_code/images/Icon_FolderOpen2.gif and /dev/null differ diff --git a/website_code/images/Icon_Folder_Empty.gif b/website_code/images/Icon_Folder_Empty.gif deleted file mode 100644 index fcb7e9282c..0000000000 Binary files a/website_code/images/Icon_Folder_Empty.gif and /dev/null differ diff --git a/website_code/images/Icon_Page.gif b/website_code/images/Icon_Page.gif deleted file mode 100644 index 707112dec8..0000000000 Binary files a/website_code/images/Icon_Page.gif and /dev/null differ diff --git a/website_code/images/MessBoxBL.gif b/website_code/images/MessBoxBL.gif deleted file mode 100644 index 6c170f6360..0000000000 Binary files a/website_code/images/MessBoxBL.gif and /dev/null differ diff --git a/website_code/images/MessBoxBR.gif b/website_code/images/MessBoxBR.gif deleted file mode 100644 index 4f08132c0e..0000000000 Binary files a/website_code/images/MessBoxBR.gif and /dev/null differ diff --git a/website_code/images/MessBoxBottom.gif b/website_code/images/MessBoxBottom.gif deleted file mode 100644 index 9a31386922..0000000000 Binary files a/website_code/images/MessBoxBottom.gif and /dev/null differ diff --git a/website_code/images/MessBoxLeft.gif b/website_code/images/MessBoxLeft.gif deleted file mode 100644 index ae44757449..0000000000 Binary files a/website_code/images/MessBoxLeft.gif and /dev/null differ diff --git a/website_code/images/MessBoxRight.gif b/website_code/images/MessBoxRight.gif deleted file mode 100644 index d6e7abd5a3..0000000000 Binary files a/website_code/images/MessBoxRight.gif and /dev/null differ diff --git a/website_code/images/MessBoxTL.gif b/website_code/images/MessBoxTL.gif deleted file mode 100644 index abeace1559..0000000000 Binary files a/website_code/images/MessBoxTL.gif and /dev/null differ diff --git a/website_code/images/MessBoxTR.gif b/website_code/images/MessBoxTR.gif deleted file mode 100644 index b6a98963a9..0000000000 Binary files a/website_code/images/MessBoxTR.gif and /dev/null differ diff --git a/website_code/images/MessBoxTop.gif b/website_code/images/MessBoxTop.gif deleted file mode 100644 index 1c974bd3b5..0000000000 Binary files a/website_code/images/MessBoxTop.gif and /dev/null differ diff --git a/website_code/images/PointLine.gif b/website_code/images/PointLine.gif deleted file mode 100644 index 1caca78d2e..0000000000 Binary files a/website_code/images/PointLine.gif and /dev/null differ diff --git a/website_code/images/RoundCornerBL.gif b/website_code/images/RoundCornerBL.gif deleted file mode 100644 index fdce87b2f5..0000000000 Binary files a/website_code/images/RoundCornerBL.gif and /dev/null differ diff --git a/website_code/images/RoundCornerBR.gif b/website_code/images/RoundCornerBR.gif deleted file mode 100644 index 269928d4b0..0000000000 Binary files a/website_code/images/RoundCornerBR.gif and /dev/null differ diff --git a/website_code/images/RoundCornerTL.gif b/website_code/images/RoundCornerTL.gif deleted file mode 100644 index 152a9a45fb..0000000000 Binary files a/website_code/images/RoundCornerTL.gif and /dev/null differ diff --git a/website_code/images/RoundCornerTR.gif b/website_code/images/RoundCornerTR.gif deleted file mode 100644 index b677841b9b..0000000000 Binary files a/website_code/images/RoundCornerTR.gif and /dev/null differ diff --git a/website_code/images/RssLogo.gif b/website_code/images/RssLogo.gif deleted file mode 100644 index 1fba92edcc..0000000000 Binary files a/website_code/images/RssLogo.gif and /dev/null differ diff --git a/website_code/images/Thumbs.db b/website_code/images/Thumbs.db deleted file mode 100644 index fb6bc7dfa9..0000000000 Binary files a/website_code/images/Thumbs.db and /dev/null differ diff --git a/website_code/images/TickBoxOff.gif b/website_code/images/TickBoxOff.gif deleted file mode 100644 index 75e34b1dc4..0000000000 Binary files a/website_code/images/TickBoxOff.gif and /dev/null differ diff --git a/website_code/images/TickBoxOn.gif b/website_code/images/TickBoxOn.gif deleted file mode 100644 index 3de1178ad7..0000000000 Binary files a/website_code/images/TickBoxOn.gif and /dev/null differ diff --git a/website_code/images/TopBar.jpg b/website_code/images/TopBar.jpg deleted file mode 100644 index 5718fbd552..0000000000 Binary files a/website_code/images/TopBar.jpg and /dev/null differ diff --git a/website_code/images/UofNLogo.jpg b/website_code/images/UofNLogo.jpg deleted file mode 100644 index 9e8fa8ba60..0000000000 Binary files a/website_code/images/UofNLogo.jpg and /dev/null differ diff --git a/website_code/images/bullet_error.gif b/website_code/images/bullet_error.gif deleted file mode 100644 index cbc125c11b..0000000000 Binary files a/website_code/images/bullet_error.gif and /dev/null differ diff --git a/website_code/images/delete.gif b/website_code/images/delete.gif deleted file mode 100644 index 2f064bf00e..0000000000 Binary files a/website_code/images/delete.gif and /dev/null differ diff --git a/website_code/images/edit_TopBar.jpg b/website_code/images/edit_TopBar.jpg deleted file mode 100644 index ecbbd73102..0000000000 Binary files a/website_code/images/edit_TopBar.jpg and /dev/null differ diff --git a/website_code/images/edit_UofNLogo.jpg b/website_code/images/edit_UofNLogo.jpg deleted file mode 100644 index fa460d46f7..0000000000 Binary files a/website_code/images/edit_UofNLogo.jpg and /dev/null differ diff --git a/website_code/images/edit_xerteLogo.jpg b/website_code/images/edit_xerteLogo.jpg deleted file mode 100644 index b16aac5b46..0000000000 Binary files a/website_code/images/edit_xerteLogo.jpg and /dev/null differ diff --git a/website_code/images/folder_workspace.gif b/website_code/images/folder_workspace.gif deleted file mode 100644 index 624d2c639d..0000000000 Binary files a/website_code/images/folder_workspace.gif and /dev/null differ diff --git a/website_code/images/folder_workspace.jpg b/website_code/images/folder_workspace.jpg deleted file mode 100644 index 8a8112ab6d..0000000000 Binary files a/website_code/images/folder_workspace.jpg and /dev/null differ diff --git a/website_code/images/lt_logo.gif b/website_code/images/lt_logo.gif deleted file mode 100644 index ec339861aa..0000000000 Binary files a/website_code/images/lt_logo.gif and /dev/null differ diff --git a/website_code/images/rb_empty.gif b/website_code/images/rb_empty.gif deleted file mode 100644 index ae901b94e3..0000000000 Binary files a/website_code/images/rb_empty.gif and /dev/null differ diff --git a/website_code/images/rb_full.gif b/website_code/images/rb_full.gif deleted file mode 100644 index c340b0e1db..0000000000 Binary files a/website_code/images/rb_full.gif and /dev/null differ diff --git a/website_code/images/xerteLogo.jpg b/website_code/images/xerteLogo.jpg deleted file mode 100644 index 1b2123a60c..0000000000 Binary files a/website_code/images/xerteLogo.jpg and /dev/null differ diff --git a/website_code/integration_top b/website_code/integration_top deleted file mode 100644 index 6b8233dbeb..0000000000 --- a/website_code/integration_top +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
-
-
-
-
-

What would you like to call your folder?

-
-
-
-
-
-
-
-
-
-
- -
-
-
- -
- - - -
- -
-
- -
- -
-
- - - -
- -
-
- - - -
-
- - - -
-
\ No newline at end of file diff --git a/website_code/login_bottom b/website_code/login_bottom deleted file mode 100644 index fa5f9c7cad..0000000000 --- a/website_code/login_bottom +++ /dev/null @@ -1,49 +0,0 @@ - - -
-
-
-
-
-
-
-

- Getting Started -

-

- We've produced a short introduction to the Toolkits website.

Demonstration -

-
-
-
- {{news}} -
- -
-
-

- {{site_text}} -

- -
-
- -
-
-
- -
- - - diff --git a/website_code/login_top b/website_code/login_top deleted file mode 100644 index b1a7a1cc5c..0000000000 --- a/website_code/login_top +++ /dev/null @@ -1,51 +0,0 @@ - - - - -{{site_title}} - - - - - - - - - -
- - -
-
-
-

- {{welcome_message}} -

-
-
-
- -
- - -
-
- -
-
-
- {{pod_one}} -
- -
- {{pod_two}} -
-
- -
- - -
- - - - - -
- - \ No newline at end of file diff --git a/website_code/management_top b/website_code/management_top deleted file mode 100644 index f28dd09b21..0000000000 --- a/website_code/management_top +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
-
-
-
-
-

What would you like to call your folder?

-
-
-
-
-
-
-
-
-
-
- -
-
-

Log out

-
- -
- - - -
- -
-
- -
- -
-
- - - -
- -
-
- - - -
-
- - - -
-
\ No newline at end of file diff --git a/website_code/php/database_library.php b/website_code/php/database_library.php deleted file mode 100644 index 367a906806..0000000000 --- a/website_code/php/database_library.php +++ /dev/null @@ -1,69 +0,0 @@ -database_host, $xerte_toolkits_site->database_username, $xerte_toolkits_site->database_password); - - /* - * Check for connection and error if failed - */ - - if(!$mysql_connect_id){ - - die("Sorry, the system cannot connect to the database at present. The mysql error is " . mysql_error() ); - - } - - mysql_select_db($xerte_toolkits_site->database_name) or die($database_fail = true); - - /* - * database failing code - */ - - if($database_fail){ - - receive_message($_SESSION['toolkits_logon_username'], "ADMIN", "CRITICAL", "DATABASE FAILED AT " . $error_string, "MYSQL ERROR MESSAGE IS " . mysql_error()); - die("Sorry, the system cannot connect to the database at present. The mysql error is " . mysql_error() ); - - - }else{ - - receive_message($_SESSION['toolkits_logon_username'], "ADMIN", "SUCCESS", "DATABASE CONNECTED", $success_string); - - } - - /* - * if all worked returned the mysql ID - */ - - return $mysql_connect_id; - -} - -?> \ No newline at end of file diff --git a/website_code/php/deletion_library.php b/website_code/php/deletion_library.php deleted file mode 100644 index d55fbeec4f..0000000000 --- a/website_code/php/deletion_library.php +++ /dev/null @@ -1,118 +0,0 @@ - \ No newline at end of file diff --git a/website_code/php/display_library.php b/website_code/php/display_library.php deleted file mode 100644 index 8ff35a1c99..0000000000 --- a/website_code/php/display_library.php +++ /dev/null @@ -1,524 +0,0 @@ -database_table_prefix . "folderdetails where login_id =\"" . $_SESSION['toolkits_logon_id'] . "\" and folder_parent=\"" . $folder_id . "\""; - - $query_response = mysql_query($query); - - while($row = mysql_fetch_array($query_response)){ - - echo "

" . str_replace("_", " ", $row['folder_name']) . "

"; - - list_folder_contents_event_free($row['folder_id']); - - echo "
"; - - } - -} - - /** - * - * Function list files in this folder event free - * This function is used in the folder properties tab to display files - * @param string $folder_id = The id of the folder we are checking - * @version 1.0 - * @author Patrick Lockley - */ - -function list_files_in_this_folder_event_free($folder_id){ - - global $xerte_toolkits_site; - - $query = "select template_name, template_id from " . $xerte_toolkits_site->database_table_prefix . "templatedetails where template_id in ( select " . $xerte_toolkits_site->database_table_prefix . "templaterights.template_id from " . $xerte_toolkits_site->database_table_prefix . "templaterights where user_id =\"" . $_SESSION['toolkits_logon_id'] . "\" and folder=\"" . $folder_id . "\") order by " . $xerte_toolkits_site->database_table_prefix . "templatedetails.date_created ASC"; - - $query_response = mysql_query($query); - - while($row = mysql_fetch_array($query_response)){ - - echo "

" . str_replace("_", " ", $row['template_name']) . "

"; - - } - -} - - /** - * - * Function list folder contents event free - * This function is used as part of the recursion with the above two functions - * @param string $folder_id = The id of the folder we are checking - * @version 1.0 - * @author Patrick Lockley - */ - -function list_folder_contents_event_free($folder_id){ - - list_folders_in_this_folder_event_free($folder_id); - list_files_in_this_folder_event_free($folder_id); - -} - - /** - * - * Function list folder in this folder - * This function is used as part of the recursion to display the main file system - * @param string $folder_id = The id of the folder we are checking - * @param string $sort_type = A variable which dictates how we are sorting this - * @version 1.0 - * @author Patrick Lockley - */ - -function list_folders_in_this_folder($folder_id, $sort_type){ - - /* - * use the global level for folder indenting - */ - - global $level, $xerte_toolkits_site; - - /* - * select the folders in this folder - */ - - $query="select folder_id, folder_name from " . $xerte_toolkits_site->database_table_prefix . "folderdetails where login_id =\"" . $_SESSION['toolkits_logon_id'] . "\" and folder_parent=\"" . $folder_id . "\" "; - - /* - * Add some more to the query to sort the files - */ - - if($sort_type=="alpha_down"){ - - $query.=" order by folder_name DESC"; - - }else if($sort_type=="alpha_up"){ - - $query.=" order by folder_name ASC"; - - }else if($sort_type=="date_down"){ - - $query.=" order by date_created DESC"; - - }else if($sort_type=="date_up"){ - - $query.=" order by date_created ASC"; - - } - - $query_response = mysql_query($query); - - /* - * recurse through the folders - */ - - while($row = mysql_fetch_array($query_response)){ - - $query_for_folder_content="select template_id from " . $xerte_toolkits_site->database_table_prefix . "templaterights where folder=\"" . $row['folder_id'] . "\" UNION SELECT folder_id from " . $xerte_toolkits_site->database_table_prefix . "folderdetails where folder_parent=\"" . $row['folder_id'] . "\""; - - $query_response_for_folder_content = mysql_query($query_for_folder_content); - - /* - * Use level to nest the folders - */ - - echo "

" . str_replace("_", " ", $row['folder_name']) . "

"; - - }else{ - - echo " src=\"website_code/images/Icon_Folder.gif\" id=\"folder_" . $row['folder_id'] . "_image\" />" . str_replace("_", " ", $row['folder_name']) . "

"; - - list_folder_contents($row['folder_id'], $sort_type); - - } - - echo "
"; - - } - -} - - /** - * - * Function list files in this folder - * This function is used as part of the recursion to display the main file system - * @param string $folder_id = The id of the folder we are checking - * @param string $sort_type = A variable which dictates how we are sorting this - * @version 1.0 - * @author Patrick Lockley - */ - -function list_files_in_this_folder($folder_id, $sort_type){ - - global $level, $xerte_toolkits_site; - - $query = "select template_name, template_id from " . $xerte_toolkits_site->database_table_prefix . "templatedetails where template_id in ( select " . $xerte_toolkits_site->database_table_prefix . "templaterights.template_id from " . $xerte_toolkits_site->database_table_prefix . "templaterights where user_id =\"" . $_SESSION['toolkits_logon_id'] . "\" and folder=\"" . $folder_id . "\") "; - - if($sort_type=="alpha_down"){ - - $query.="order by " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_name DESC"; - - }else if($sort_type=="alpha_up"){ - - $query.="order by " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_name ASC"; - - }else if($sort_type=="date_down"){ - - $query.="order by " . $xerte_toolkits_site->database_table_prefix . "templatedetails.date_created DESC"; - - }else if($sort_type=="date_up"){ - - $query.="order by " . $xerte_toolkits_site->database_table_prefix . "templatedetails.date_created ASC"; - - } - - $query_response = mysql_query($query); - - while($row = mysql_fetch_array($query_response)){ - - echo "
" . str_replace("_", " ", $row['template_name']) . "
"; - - } - -} - - /** - * - * Function list folder contents - * This function is used as part of the recursion to display the main file system - * @param string $folder_id = The id of the folder we are checking - * @param string $sort_type = A variable which dictates how we are sorting this - * @version 1.0 - * @author Patrick Lockley - */ - -function list_folder_contents($folder_id, $sort_type){ - - global $level; - - $level++; - list_folders_in_this_folder($folder_id, $sort_type); - list_files_in_this_folder($folder_id, $sort_type); - $level--; - -} - - /** - * - * Function list users projects - * This function is used as part of the recursion to display the main file system - * @param string $sort_type = A variable which dictates how we are sorting this - * @version 1.0 - * @author Patrick Lockley - */ - -function list_users_projects($sort_type){ - - /* - * Called by index.php to start off the process - */ - - global $level, $xerte_toolkits_site; - - $root_folder = get_user_root_folder(); - - /* - * Create the workspace folder - */ - - echo "

Workspace

"; - - $level=1; - - list_folder_contents(get_user_root_folder(),$sort_type); - - $query = "select folder_id from " . $xerte_toolkits_site->database_table_prefix . "folderdetails where folder_name=\"recyclebin\" and login_id =\"" . $_SESSION['toolkits_logon_id'] . "\""; - - $query_response = mysql_query($query); - - $row = mysql_fetch_array($query_response); - - $level=1; - - $query_for_folder_content="select template_id from " . $xerte_toolkits_site->database_table_prefix . "templaterights where folder=\"" . $row['folder_id'] . "\" UNION SELECT folder_id from " . $xerte_toolkits_site->database_table_prefix . "folderdetails where folder_parent=\"" . $row['folder_id'] . "\""; - - $query_response_for_folder_content = mysql_query($query_for_folder_content); - - echo "
"; - - /* - * Display the recycle bin - */ - - echo "

Recycle Bin

"; - - list_folder_contents($row['folder_id'],$sort_type); - - echo "
"; - -} - -/** - * - * Function list users projects - * This function is used to display all the unrestricted templates (Access to whom = *) - * @version 1.0 - * @author Patrick Lockley - */ - -function list_blank_templates(){ - - /* - * note the access rights to discern what templates this user can see - */ - - global $xerte_toolkits_site; - - $query_for_blank_templates = "select * from " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails where access_rights=\"*\" and active=true order by date_uploaded DESC"; - - $query_for_blank_templates_response = mysql_query($query_for_blank_templates); - - while($row = mysql_fetch_array($query_for_blank_templates_response)){ - - echo "

"; - - echo $row['display_name']; - - echo "

"; - - echo $row['description']; - - /* - * If no example don't display the link - */ - - if($row['display_id']!=0){ - - echo "

See example | "; - - }else{ - - echo "
"; - - } - - echo "Create
"; - - echo "Enter a name for this project

"; - - } - - /* - * once done listing the blank templates, list if any the specific templates available for this user - */ - - list_specific_templates(); - -} - - /** - * - * Function access check - * This function is used to assess which specific usernames match the access to whom value - * @param string $security_details = the masks used for this template to limit its display - * @version 1.0 - * @author Patrick Lockley - */ - -function access_check($security_details){ - - $list = explode(",",$security_details); - - while($dev_mask = array_pop($list)){ - - if(strpos($dev_mask,"*")!=0){ - - if(strcmp(substr($dev_mask,0,strpos($dev_mask,"*")),substr($_SESSION['toolkits_logon_username'],0,strpos($dev_mask,"*")))==0){ - - return true; - - } - - }else{ - - if(strcmp($dev_mask,$_SESSION['toolkits_logon_username'])==0){ - - return true; - - } - - } - - } - - return false; - -} - - /** - * - * Function list specific templates - * This function is used to display templates with access restrictions - * @version 1.0 - * @author Patrick Lockley - */ - -function list_specific_templates(){ - - global $xerte_toolkits_site; - - $query_for_blank_templates = "select * from " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails where access_rights!=\"*\" order by date_uploaded DESC"; - - $query_for_blank_templates_response = mysql_query($query_for_blank_templates); - - while($row = mysql_fetch_array($query_for_blank_templates_response)){ - - if(access_check($row['access_rights'])){ - - echo "

"; - - echo $row['display_name']; - - echo "

"; - - echo $row['description']; - - echo "

See example | Create
"; - - echo "Enter a name for this project

"; - - } - - } - -} - - /** - * - * Function login page format top - * This function is used as part of the display of Index.php - * @param string $buffer = A HTML string to work on - * @version 1.0 - * @author Patrick Lockley - */ - -function login_page_format_top($buffer){ - - global $xerte_toolkits_site; - - $buffer = str_replace("{{site_title}}", $xerte_toolkits_site->site_title , $buffer); - $buffer = str_replace("{{site_logo}}", $xerte_toolkits_site->site_logo , $buffer); - $buffer = str_replace("{{organisational_logo}}", $xerte_toolkits_site->organisational_logo , $buffer); - $buffer = str_replace("{{welcome_message}}", $xerte_toolkits_site->welcome_message , $buffer); - - return $buffer; - -} - - /** - * - * Function login page format top - * This function is used to display the index.php HTML - * @param string $buffer = A HTML string to work on - * @version 1.0 - * @author Patrick Lockley - */ - -function login_page_format_bottom($buffer){ - - global $xerte_toolkits_site; - - $buffer = str_replace("{{demonstration_page}}", $xerte_toolkits_site->demonstration_page , $buffer); - $buffer = str_replace("{{site_text}}", $xerte_toolkits_site->site_text , $buffer); - $buffer = str_replace("{{news}}", $xerte_toolkits_site->news_text , $buffer); - $buffer = str_replace("{{copyright}}", $xerte_toolkits_site->copyright , $buffer); - - return $buffer; - -} - - - /** - * - * Function login page format middle - * This function is used to display the index.php HTML - * @param string $buffer = A HTML string to work on - * @version 1.0 - * @author Patrick Lockley - */ - -function logged_in_page_format_middle($buffer){ - - global $xerte_toolkits_site; - - $buffer = str_replace("{{pod_one}}", $xerte_toolkits_site->pod_one , $buffer); - $buffer = str_replace("{{pod_two}}", $xerte_toolkits_site->pod_two , $buffer); - - return $buffer; - -} - - - /** - * - * Function error show template - * This function is used to display a respinse when the users accesses a resource they have no right to - * @version 1.0 - * @author Patrick Lockley - */ - -function error_show_template(){ - - echo "An error has occured and as such you cannot edit at present"; - -} - - - /** - * - * Function output locked file code - * This function is used to display a message when a lock file is found - * @version 1.0 - * @author Patrick Lockley - */ - -function output_locked_file_code($lock_file_creator){ - - echo "this file is in use by $lock_file_creator and will be made available to you when the current editor closes it down"; - -} - -?> \ No newline at end of file diff --git a/website_code/php/error_library.php b/website_code/php/error_library.php deleted file mode 100644 index 33d4fede80..0000000000 --- a/website_code/php/error_library.php +++ /dev/null @@ -1,187 +0,0 @@ -error_log_message=="true"){ - - write_message($user_name, $type, $level, $subject, $content); - - } - - - /* - * If error email message turned on, send an error email message - */ - - if($xerte_toolkits_site->error_email_message=="true"){ - - email_message($user_name, $type, $level, $subject, $content); - - } - -} - - /** - * - * Function receive message - * This function is used to send an error email meesage - * @param string $user_name = username the error relates to - * @param string $type = user / Admin / system - * @param string $level = how serious the problem is, or whether it is a sucess - * @param string $subject = The title of the error problem (a preci effectively) - * @param string $content = The error message in full. - * @version 1.0 - * @author Patrick Lockley - */ - -function write_message($user_name, $type, $level, $subject,$content){ - - global $xerte_toolkits_site; - - if($user_name==""){ - - $user_name="UNKNOWN"; - - } - - /* - * Get the log file contents (a series of HTML paragraphs separated by *) - */ - - if(file_exists($xerte_toolkits_site->error_log_path . $user_name . ".log")){ - - $error_string = file_get_contents($xerte_toolkits_site->error_log_path . $user_name . ".log"); - - } - - $error_array = explode("*",$error_string); - - /* - * If the error log is bigger than the maximum size, remove a section - */ - - if(count($error_array)>$xerte_toolkits_site->max_error_size){ - - array_splice($error_array,0,1); - - } - - /* - * If the error log is bigger than the maximum size, remove a section - */ - - if(file_exists($xerte_toolkits_site->error_log_path . $user_name . ".log")){ - - $error_message_handle = fopen($xerte_toolkits_site->error_log_path . $user_name . ".log" , "w"); - - $string = implode("*", $error_array) . "

" . date("G:i:s - d/m/Y") . " " . $level . "
" . $subject . "
" . $content . "

*"; - - fwrite($error_message_handle, $string); - - fclose($error_message_handle); - - }else{ - - $error_message_handle = fopen($xerte_toolkits_site->error_log_path . $user_name . ".log" , "w"); - - $string = "

" . date("G:i:s - d/m/Y") . " " . $level . "
" . $subject . "
" . $content . "

*"; - - fwrite($error_message_handle, $string); - - fclose($error_message_handle); - - } - - - /* - * Make an error log file per level as well - */ - - if(file_exists($xerte_toolkits_site->error_log_path . $level . ".log")){ - - $error_string = file_get_contents($xerte_toolkits_site->error_log_path . $level . ".log"); - - } - - $error_array = explode("*",$error_string); - - if(count($error_array)>$xerte_toolkits_site->max_error_size){ - - array_splice($error_array,0,1); - - } - - if(file_exists($xerte_toolkits_site->error_log_path . $level . ".log")){ - - $error_message_handle = fopen($xerte_toolkits_site->error_log_path . $level . ".log" , "w"); - - $string = implode("*", $error_array) . "

" . date("G:i:s - d/m/Y") . " " . $level . "
" . $subject . "
" . $content . "

*"; - - fwrite($error_message_handle, $string); - - fclose($error_message_handle); - - }else{ - - $error_message_handle = fopen($xerte_toolkits_site->error_log_path . $level . ".log" , "w"); - - $string = "

" . date("G:i:s - d/m/Y") . " " . $level . "
" . $subject . "
" . $content . "

*"; - - fwrite($error_message_handle, $string); - - fclose($error_message_handle); - - } - - -} - - /** - * - * Function email message - * This function is used to send an error email meesage - * @param string $user_name = username the error relates to - * @param string $type = user / Admin / system - * @param string $level = how serious the problem is, or whether it is a sucess - * @param string $subject = The title of the error problem (a preci effectively) - * @param string $content = The error message in full. - * @version 1.0 - * @author Patrick Lockley - */ - -function email_message($user_name, $type, $level, $subject, $content){ - - global $xerte_toolkits_site; - - $email_subject = $user_name . " " . $type . " " . $level . " " . $subject; - - $email_content = date("G:i:s-d/m/Y") . "\n" . $content; - - mail($xerte_toolkits_site->email_error_list, $email_subject, $email_content); - -} - -?> \ No newline at end of file diff --git a/website_code/php/file_library.php b/website_code/php/file_library.php deleted file mode 100644 index 37c526bc46..0000000000 --- a/website_code/php/file_library.php +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/website_code/php/folder_library.php b/website_code/php/folder_library.php deleted file mode 100644 index 3c1cf95738..0000000000 --- a/website_code/php/folder_library.php +++ /dev/null @@ -1,204 +0,0 @@ -database_table_prefix . "folderdetails (login_id,folder_parent,folder_name,date_created) values ('" . $_SESSION['toolkits_logon_id'] . "','" . get_user_root_folder() . "','" . $folder_name ."','" . date('Y-m-d') . "')"; - - }else{ - - $query = "INSERT INTO " . $xerte_toolkits_site->database_table_prefix . "folderdetails (login_id,folder_parent,folder_name,date_created) values ('" . $_SESSION['toolkits_logon_id'] . "','" . $folder_id . "','" . $folder_name . "','" . date('Y-m-d') . "')"; - - } - - if(mysql_query($query)){ - - receive_message($_SESSION['toolkits_logon_username'], "USER", "SUCCESS", "Folder creation succeeded for " . $_SESSION['toolkits_logon_username'], "Folder creation succeeded for " . $_SESSION['toolkits_logon_username']); - - echo "The folder has been created"; - - }else{ - - receive_message($_SESSION['toolkits_logon_username'], "USER", "CRITICAL", "Folder creation failed for " . $_SESSION['toolkits_logon_username'], "Folder creation failed for " . $_SESSION['toolkits_logon_username']); - - echo "Error creating folder"; - - } - - mysql_close($mysql_id); - - -} - - /** - * - * Function delete folder - * This function is used to send an error email meesage - * @param string $folder_id = id for the new folder - * @param string $folder_name = Name of the new folder - * @version 1.0 - * @author Patrick Lockley - */ - -function delete_folder($folder_id){ - - global $xerte_toolkits_site; - - $database_id = database_connect("Delete folder database connect success","Delete folder database connect failed"); - - $folder_id = substr($folder_id,strpos($folder_id,"_")+1,strlen($folder_id)); - - echo $folder_id; - - $query_to_delete_folder = "delete from " .$xerte_toolkits_site->database_table_prefix . "folderdetails where folder_id=\"" . $folder_id . "\""; - - echo $query_to_delete_folder; - - if(mysql_query($query_to_delete_folder)){ - - receive_message($_SESSION['toolkits_logon_username'], "USER", "SUCCESS", "Folder " . $folder_id . " deleted for " . $_SESSION['toolkits_logon_username'], "Folder creation succeeded for " . $_SESSION['toolkits_logon_username']); - - }else{ - - receive_message($_SESSION['toolkits_logon_username'], "USER", "CRITICAL", "Folder " . $folder_id . " not deleted for " . $_SESSION['toolkits_logon_username'], "Folder creation succeeded for " . $_SESSION['toolkits_logon_username']); - - } - - mysql_close($database_id); - -} - - /** - * - * Function move file - * This function is used to move files and folders - * @param array $files_to_move = an array of files and folders to move - * @param string $destination = Name of the new folder - * @version 1.0 - * @author Patrick Lockley - */ - -function move_file($files_to_move,$destination){ - - global $xerte_toolkits_site; - - $mysql_id = database_connect("Move file database connect success", "Move file database connect failure"); - - $new_files_array=explode(",",$files_to_move); - - /* - * Files array can be complicated, and this thread can lock the system, so limit max files to 50 - */ - - if((count($new_files_array)!=0)&&(count($new_files_array)<=50)){ - - /* - * check their is a destination - */ - - if(($destination!="")){ - - for($x=0;$x!=count($new_files_array);$x++){ - - // check there are files - - if($new_files_array[$x]!=""){ - - if($new_files_array[$x+1]=="file"){ - - if($new_files_array[$x+2]=="folder_workspace"){ - - $parent = get_user_root_folder(); - - } - - if($destination=="folder_workspace"){ - - $destination = get_user_root_folder(); - - } - - if($destination=="recyclebin"){ - - $destination = get_recycle_bin(); - - } - - /* - * Move files in the database - */ - - $query_file = "UPDATE " .$xerte_toolkits_site->database_table_prefix . "templaterights SET folder = \"" . $destination . "\" where (template_id=\"" . $new_files_array[$x] . "\" AND user_id =\"" . $_SESSION['toolkits_logon_id'] . "\")"; - - if(mysql_query($query_file)){ - - receive_message($_SESSION['toolkits_logon_username'], "USER", "SUCCESS", "File " . $new_files_array[$x]. " moved into " . $destination . " for " . $_SESSION['toolkits_logon_username'], "File " . $new_files_array[$x]. " moved into " . $destination . " for " . $_SESSION['toolkits_logon_username']); - - }else{ - - receive_message($_SESSION['toolkits_logon_username'], "USER", "SUCCESS", "File " . $new_files_array[$x]. " failed to move into " . $destination . " for " . $_SESSION['toolkits_logon_username'], "File " . $new_files_array[$x]. " failed to move into " . $destination . " for " . $_SESSION['toolkits_logon_username']); - - } - - }else{ - - /* - * destination is the root folder - */ - - if($destination=="folder_workspace"){ - - $destination = get_user_root_folder(); - - } - - $query_folder = "UPDATE " .$xerte_toolkits_site->database_table_prefix . "folderdetails SET folder_parent = \"" . $destination . "\" where (folder_id=\"" . $new_files_array[$x] . "\")"; - - if(mysql_query($query_folder)){ - - receive_message($_SESSION['toolkits_logon_username'], "USER", "SUCCESS", "Folder " . $new_files_array[$x]. " moved into " . $destination . " for " . $_SESSION['toolkits_logon_username'], "File " . $new_files_array[$x]. " moved into " . $destination . " for " . $_SESSION['toolkits_logon_username']); - - }else{ - - receive_message($_SESSION['toolkits_logon_username'], "USER", "SUCCESS", "File " . $new_files_array[$x]. " failed to move into " . $destination . " for " . $_SESSION['toolkits_logon_username'], "Folder " . $new_files_array[$x]. " failed to move into " . $destination . " for " . $_SESSION['toolkits_logon_username']); - - } - - } - - $x+=2; - - } - - } - - } - - } - - mysql_close($mysql_id); - -} - -?> \ No newline at end of file diff --git a/website_code/php/folderproperties/folder_content_template.php b/website_code/php/folderproperties/folder_content_template.php deleted file mode 100644 index d91539cfd0..0000000000 --- a/website_code/php/folderproperties/folder_content_template.php +++ /dev/null @@ -1,37 +0,0 @@ -Folder contents

"; - - echo "
"; - - list_folder_contents_event_free(mysql_real_escape_string($_POST['folder_id'])); - - echo "
"; - - } - -?> \ No newline at end of file diff --git a/website_code/php/folderproperties/folder_rss_template.php b/website_code/php/folderproperties/folder_rss_template.php deleted file mode 100644 index 68f7f52906..0000000000 --- a/website_code/php/folderproperties/folder_rss_template.php +++ /dev/null @@ -1,47 +0,0 @@ -database_table_prefix . "folderdetails where folder_id=\"" . mysql_real_escape_string($_POST['folder_id']) . "\""; - - $query_name_response = mysql_query($query_for_folder_name); - - $row_template_name = mysql_fetch_array($query_name_response); - - echo "

Folder RSS Feeds

"; - - echo "

If there is any public content in this folder, you will be able to access it via the RSS Feed at

"; - - $query_for_name = "select firstname, surname from " . $xerte_toolkits_site->database_table_prefix . "logindetails where login_id=\"" . $_SESSION['toolkits_logon_id'] . "\""; - - $query_name_response = mysql_query($query_for_name); - - $row_name = mysql_fetch_array($query_name_response); - - if($xerte_toolkits_site->apache=="true"){ - - echo "

site_url . "RSS/" . $row_name['firstname'] . "_" . $row_name['surname'] . "/" . str_replace(" ","_",$row_template_name['folder_name']) . "/\">" . $xerte_toolkits_site->site_url . "RSS/" . $row_name['firstname'] . "_" . $row_name['surname'] . "/" . str_replace(" ","_",$row_template_name['folder_name']) . "/

"; - - }else{ - - echo "

site_url . "rss.php?username=" . $row_name['firstname'] . "_" . $row_name['surname'] . "&folder_name=" . str_replace(" ","_",$row_template_name['folder_name']) . "\">" . $xerte_toolkits_site->site_url . "rss.php?username=" . $row_name['firstname'] . "_" . $row_name['surname'] . "&folder_name=" . str_replace(" ","_",$row_template_name['folder_name']) . "

"; - - } - -?> \ No newline at end of file diff --git a/website_code/php/folderproperties/folderproperties_template.php b/website_code/php/folderproperties/folderproperties_template.php deleted file mode 100644 index 52c3176523..0000000000 --- a/website_code/php/folderproperties/folderproperties_template.php +++ /dev/null @@ -1,40 +0,0 @@ -database_table_prefix . "folderdetails where folder_id=\"" . mysql_real_escape_string($_POST['folder_id']) . "\""; - - $query_name_response = mysql_query($query_for_folder_name); - - $row_template_name = mysql_fetch_array($query_name_response); - - echo "

Folder properties

"; - - echo "

This folder is called " . str_replace("_", " ", $row_template_name['folder_name']) . "

"; - - echo "

Change the name of the project

"; - - echo "

"; - - } - - -?> \ No newline at end of file diff --git a/website_code/php/folderproperties/rename_folder_template.php b/website_code/php/folderproperties/rename_folder_template.php deleted file mode 100644 index ba4ee91b48..0000000000 --- a/website_code/php/folderproperties/rename_folder_template.php +++ /dev/null @@ -1,46 +0,0 @@ -database_table_prefix . "folderdetails SET folder_name =\"" . str_replace(" ", "_", $_POST['folder_name']) . "\" WHERE folder_id =\"" . mysql_real_escape_string($_POST['folder_id']) . "\""; - - if(mysql_query($query)){ - - echo "

Folder properties

"; - - echo "

Folder name: " . str_replace("_", " ", $_POST['folder_name']) . "

"; - - echo "

Change the name of the project

"; - - echo "

Folder renamed

"; - - /** - * Extra bit of code to tell the ajax back on the web page what to rename the folder to be - */ - - echo "~*~" . $_POST['folder_name']; - - }else{ - - } - - } - - mysql_close($database_id); - -?> \ No newline at end of file diff --git a/website_code/php/folders/copy_to_new_folder.php b/website_code/php/folders/copy_to_new_folder.php deleted file mode 100644 index 7ab3b87458..0000000000 --- a/website_code/php/folders/copy_to_new_folder.php +++ /dev/null @@ -1,17 +0,0 @@ - \ No newline at end of file diff --git a/website_code/php/folders/delete_folder.php b/website_code/php/folders/delete_folder.php deleted file mode 100644 index 46d3ff78cf..0000000000 --- a/website_code/php/folders/delete_folder.php +++ /dev/null @@ -1,17 +0,0 @@ - \ No newline at end of file diff --git a/website_code/php/folders/make_new_folder.php b/website_code/php/folders/make_new_folder.php deleted file mode 100644 index ea72bc248a..0000000000 --- a/website_code/php/folders/make_new_folder.php +++ /dev/null @@ -1,16 +0,0 @@ - \ No newline at end of file diff --git a/website_code/php/import/dUnzip2.inc.php b/website_code/php/import/dUnzip2.inc.php deleted file mode 100644 index 56ce81e377..0000000000 --- a/website_code/php/import/dUnzip2.inc.php +++ /dev/null @@ -1,515 +0,0 @@ -file_put_contents: Cannot create file $file
"; - return false; - } -} - -class dUnzip2{ - Function getVersion(){ - return "2.6"; - } - // Public - var $fileName; - var $compressedList; // You will problably use only this one! - var $centralDirList; // Central dir list... It's a kind of 'extra attributes' for a set of files - var $endOfCentral; // End of central dir, contains ZIP Comments - var $debug; - - // Private - var $fh; - var $zipSignature = "\x50\x4b\x03\x04"; // local file header signature - var $dirSignature = "\x50\x4b\x01\x02"; // central dir header signature - var $dirSignatureE= "\x50\x4b\x05\x06"; // end of central dir signature - - // Public - Function dUnzip2($fileName){ - $this->fileName = $fileName; - $this->compressedList = - $this->centralDirList = - $this->endOfCentral = Array(); - } - - Function getList($stopOnFile=false){ - if(sizeof($this->compressedList)){ - $this->debugMsg(1, "Returning already loaded file list."); - return $this->compressedList; - } - - // Open file, and set file handler - $fh = fopen($this->fileName, "r"); - $this->fh = &$fh; - if(!$fh){ - $this->debugMsg(2, "Failed to load file."); - return false; - } - - $this->debugMsg(1, "Loading list from 'End of Central Dir' index list..."); - if(!$this->_loadFileListByEOF($fh, $stopOnFile)){ - $this->debugMsg(1, "Failed! Trying to load list looking for signatures..."); - if(!$this->_loadFileListBySignatures($fh, $stopOnFile)){ - $this->debugMsg(1, "Failed! Could not find any valid header."); - $this->debugMsg(2, "ZIP File is corrupted or empty"); - return false; - } - } - - if($this->debug){ - #------- Debug compressedList - $kkk = 0; - echo ""; - foreach($this->compressedList as $fileName=>$item){ - if(!$kkk && $kkk=1){ - echo ""; - foreach($item as $fieldName=>$value) - echo ""; - echo ''; - } - echo ""; - foreach($item as $fieldName=>$value){ - if($fieldName == 'lastmod_datetime') - echo ""; - else - echo ""; - } - echo ""; - } - echo "
$fieldName
".date("d/m/Y H:i:s", $value)."$value
"; - - #------- Debug centralDirList - $kkk = 0; - if(sizeof($this->centralDirList)){ - echo ""; - foreach($this->centralDirList as $fileName=>$item){ - if(!$kkk && $kkk=1){ - echo ""; - foreach($item as $fieldName=>$value) - echo ""; - echo ''; - } - echo ""; - foreach($item as $fieldName=>$value){ - if($fieldName == 'lastmod_datetime') - echo ""; - else - echo ""; - } - echo ""; - } - echo "
$fieldName
".date("d/m/Y H:i:s", $value)."$value
"; - } - - #------- Debug endOfCentral - $kkk = 0; - if(sizeof($this->endOfCentral)){ - echo ""; - echo ""; - foreach($this->endOfCentral as $field=>$value){ - echo ""; - echo ""; - echo ""; - echo ""; - } - echo "
dUnzip - End of file
$field$value
"; - } - } - - return $this->compressedList; - } - Function getExtraInfo($compressedFileName){ - return - isset($this->centralDirList[$compressedFileName])? - $this->centralDirList[$compressedFileName]: - false; - } - Function getZipInfo($detail=false){ - return $detail? - $this->endOfCentral[$detail]: - $this->endOfCentral; - } - - Function unzip($compressedFileName, $targetFileName=false, $applyChmod=0777){ - if(!sizeof($this->compressedList)){ - $this->debugMsg(1, "Trying to unzip before loading file list... Loading it!"); - $this->getList(false, $compressedFileName); - } - - $fdetails = &$this->compressedList[$compressedFileName]; - if(!isset($this->compressedList[$compressedFileName])){ - $this->debugMsg(2, "File '$compressedFileName' is not compressed in the zip."); - return false; - } - if(substr($compressedFileName, -1) == "/"){ - $this->debugMsg(2, "Trying to unzip a folder name '$compressedFileName'."); - return false; - } - if(!$fdetails['uncompressed_size']){ - $this->debugMsg(1, "File '$compressedFileName' is empty."); - return $targetFileName? - file_put_contents($targetFileName, ""): - ""; - } - - fseek($this->fh, $fdetails['contents-startOffset']); - $ret = $this->uncompress( - fread($this->fh, $fdetails['compressed_size']), - $fdetails['compression_method'], - $fdetails['uncompressed_size'], - $targetFileName - ); - if($applyChmod && $targetFileName) - chmod($targetFileName, 0777); - - return $ret; - } - Function unzipAll($targetDir=false, $baseDir="", $maintainStructure=true, $applyChmod=0777){ - if($targetDir === false) - $targetDir = dirname(__FILE__)."/"; - - $lista = $this->getList(); - if(sizeof($lista)) foreach($lista as $fileName=>$trash){ - $dirname = dirname($fileName); - $outDN = "$targetDir/$dirname"; - - if(substr($dirname, 0, strlen($baseDir)) != $baseDir) - continue; - - if(!is_dir($outDN) && $maintainStructure){ - $str = ""; - $folders = explode("/", $dirname); - foreach($folders as $folder){ - $str = $str?"$str/$folder":$folder; - if(!is_dir("$targetDir/$str")){ - $this->debugMsg(1, "Creating folder: $targetDir/$str"); - mkdir("$targetDir/$str"); - if($applyChmod) - chmod("$targetDir/$str", $applyChmod); - } - } - } - if(substr($fileName, -1, 1) == "/") - continue; - - $maintainStructure? - $this->unzip($fileName, "$targetDir/$fileName", $applyChmod): - $this->unzip($fileName, "$targetDir/".basename($fileName), $applyChmod); - } - } - - Function close(){ // Free the file resource - if($this->fh) - fclose($this->fh); - } - Function __destroy(){ - $this->close(); - } - - // Private (you should NOT call these methods): - Function uncompress($content, $mode, $uncompressedSize, $targetFileName=false){ - switch($mode){ - case 0: - // Not compressed - return $targetFileName? - file_put_contents($targetFileName, $content): - $content; - case 1: - $this->debugMsg(2, "Shrunk mode is not supported... yet?"); - return false; - case 2: - case 3: - case 4: - case 5: - $this->debugMsg(2, "Compression factor ".($mode-1)." is not supported... yet?"); - return false; - case 6: - $this->debugMsg(2, "Implode is not supported... yet?"); - return false; - case 7: - $this->debugMsg(2, "Tokenizing compression algorithm is not supported... yet?"); - return false; - case 8: - // Deflate - return $targetFileName? - file_put_contents($targetFileName, gzinflate($content, $uncompressedSize)): - gzinflate($content, $uncompressedSize); - case 9: - $this->debugMsg(2, "Enhanced Deflating is not supported... yet?"); - return false; - case 10: - $this->debugMsg(2, "PKWARE Date Compression Library Impoloding is not supported... yet?"); - return false; - case 12: - // Bzip2 - return $targetFileName? - file_put_contents($targetFileName, bzdecompress($content)): - bzdecompress($content); - case 18: - $this->debugMsg(2, "IBM TERSE is not supported... yet?"); - return false; - default: - $this->debugMsg(2, "Unknown uncompress method: $mode"); - return false; - } - } - Function debugMsg($level, $string){ - if($this->debug) - if($level == 1) - echo "dUnzip2: $string
"; - if($level == 2) - echo "dUnzip2: $string
"; - } - - Function _loadFileListByEOF(&$fh, $stopOnFile=false){ - // Check if there's a valid Central Dir signature. - // Let's consider a file comment smaller than 1024 characters... - // Actually, it length can be 65536.. But we're not going to support it. - - for($x = 0; $x < 1024; $x++){ - fseek($fh, -22-$x, SEEK_END); - - $signature = fread($fh, 4); - if($signature == $this->dirSignatureE){ - // If found EOF Central Dir - $eodir['disk_number_this'] = unpack("v", fread($fh, 2)); // number of this disk - $eodir['disk_number'] = unpack("v", fread($fh, 2)); // number of the disk with the start of the central directory - $eodir['total_entries_this'] = unpack("v", fread($fh, 2)); // total number of entries in the central dir on this disk - $eodir['total_entries'] = unpack("v", fread($fh, 2)); // total number of entries in - $eodir['size_of_cd'] = unpack("V", fread($fh, 4)); // size of the central directory - $eodir['offset_start_cd'] = unpack("V", fread($fh, 4)); // offset of start of central directory with respect to the starting disk number - $zipFileCommentLenght = unpack("v", fread($fh, 2)); // zipfile comment length - $eodir['zipfile_comment'] = $zipFileCommentLenght[1]?fread($fh, $zipFileCommentLenght[1]):''; // zipfile comment - $this->endOfCentral = Array( - 'disk_number_this'=>$eodir['disk_number_this'][1], - 'disk_number'=>$eodir['disk_number'][1], - 'total_entries_this'=>$eodir['total_entries_this'][1], - 'total_entries'=>$eodir['total_entries'][1], - 'size_of_cd'=>$eodir['size_of_cd'][1], - 'offset_start_cd'=>$eodir['offset_start_cd'][1], - 'zipfile_comment'=>$eodir['zipfile_comment'], - ); - - // Then, load file list - fseek($fh, $this->endOfCentral['offset_start_cd']); - $signature = fread($fh, 4); - - while($signature == $this->dirSignature){ - $dir['version_madeby'] = unpack("v", fread($fh, 2)); // version made by - $dir['version_needed'] = unpack("v", fread($fh, 2)); // version needed to extract - $dir['general_bit_flag'] = unpack("v", fread($fh, 2)); // general purpose bit flag - $dir['compression_method'] = unpack("v", fread($fh, 2)); // compression method - $dir['lastmod_time'] = unpack("v", fread($fh, 2)); // last mod file time - $dir['lastmod_date'] = unpack("v", fread($fh, 2)); // last mod file date - $dir['crc-32'] = fread($fh, 4); // crc-32 - $dir['compressed_size'] = unpack("V", fread($fh, 4)); // compressed size - $dir['uncompressed_size'] = unpack("V", fread($fh, 4)); // uncompressed size - $fileNameLength = unpack("v", fread($fh, 2)); // filename length - $extraFieldLength = unpack("v", fread($fh, 2)); // extra field length - $fileCommentLength = unpack("v", fread($fh, 2)); // file comment length - $dir['disk_number_start'] = unpack("v", fread($fh, 2)); // disk number start - $dir['internal_attributes'] = unpack("v", fread($fh, 2)); // internal file attributes-byte1 - $dir['external_attributes1']= unpack("v", fread($fh, 2)); // external file attributes-byte2 - $dir['external_attributes2']= unpack("v", fread($fh, 2)); // external file attributes - $dir['relative_offset'] = unpack("V", fread($fh, 4)); // relative offset of local header - $dir['file_name'] = fread($fh, $fileNameLength[1]); // filename - $dir['extra_field'] = $extraFieldLength[1] ?fread($fh, $extraFieldLength[1]) :''; // extra field - $dir['file_comment'] = $fileCommentLength[1]?fread($fh, $fileCommentLength[1]):''; // file comment - - // Convert the date and time, from MS-DOS format to UNIX Timestamp - $BINlastmod_date = str_pad(decbin($dir['lastmod_date'][1]), 16, '0', STR_PAD_LEFT); - $BINlastmod_time = str_pad(decbin($dir['lastmod_time'][1]), 16, '0', STR_PAD_LEFT); - $lastmod_dateY = bindec(substr($BINlastmod_date, 0, 7))+1980; - $lastmod_dateM = bindec(substr($BINlastmod_date, 7, 4)); - $lastmod_dateD = bindec(substr($BINlastmod_date, 11, 5)); - $lastmod_timeH = bindec(substr($BINlastmod_time, 0, 5)); - $lastmod_timeM = bindec(substr($BINlastmod_time, 5, 6)); - $lastmod_timeS = bindec(substr($BINlastmod_time, 11, 5)); - - $this->centralDirList[$dir['file_name']] = Array( - 'version_madeby'=>$dir['version_madeby'][1], - 'version_needed'=>$dir['version_needed'][1], - 'general_bit_flag'=>str_pad(decbin($dir['general_bit_flag'][1]), 8, '0', STR_PAD_LEFT), - 'compression_method'=>$dir['compression_method'][1], - 'lastmod_datetime' =>mktime($lastmod_timeH, $lastmod_timeM, $lastmod_timeS, $lastmod_dateM, $lastmod_dateD, $lastmod_dateY), - 'crc-32' =>str_pad(dechex(ord($dir['crc-32'][3])), 2, '0', STR_PAD_LEFT). - str_pad(dechex(ord($dir['crc-32'][2])), 2, '0', STR_PAD_LEFT). - str_pad(dechex(ord($dir['crc-32'][1])), 2, '0', STR_PAD_LEFT). - str_pad(dechex(ord($dir['crc-32'][0])), 2, '0', STR_PAD_LEFT), - 'compressed_size'=>$dir['compressed_size'][1], - 'uncompressed_size'=>$dir['uncompressed_size'][1], - 'disk_number_start'=>$dir['disk_number_start'][1], - 'internal_attributes'=>$dir['internal_attributes'][1], - 'external_attributes1'=>$dir['external_attributes1'][1], - 'external_attributes2'=>$dir['external_attributes2'][1], - 'relative_offset'=>$dir['relative_offset'][1], - 'file_name'=>$dir['file_name'], - 'extra_field'=>$dir['extra_field'], - 'file_comment'=>$dir['file_comment'], - ); - $signature = fread($fh, 4); - } - - // If loaded centralDirs, then try to identify the offsetPosition of the compressed data. - if($this->centralDirList) foreach($this->centralDirList as $filename=>$details){ - $i = $this->_getFileHeaderInformation($fh, $details['relative_offset']); - $this->compressedList[$filename]['file_name'] = $filename; - $this->compressedList[$filename]['compression_method'] = $details['compression_method']; - $this->compressedList[$filename]['version_needed'] = $details['version_needed']; - $this->compressedList[$filename]['lastmod_datetime'] = $details['lastmod_datetime']; - $this->compressedList[$filename]['crc-32'] = $details['crc-32']; - $this->compressedList[$filename]['compressed_size'] = $details['compressed_size']; - $this->compressedList[$filename]['uncompressed_size'] = $details['uncompressed_size']; - $this->compressedList[$filename]['lastmod_datetime'] = $details['lastmod_datetime']; - $this->compressedList[$filename]['extra_field'] = $i['extra_field']; - $this->compressedList[$filename]['contents-startOffset']=$i['contents-startOffset']; - if(strtolower($stopOnFile) == strtolower($filename)) - break; - } - return true; - } - } - return false; - } - Function _loadFileListBySignatures(&$fh, $stopOnFile=false){ - fseek($fh, 0); - - $return = false; - for(;;){ - $details = $this->_getFileHeaderInformation($fh); - if(!$details){ - $this->debugMsg(1, "Invalid signature. Trying to verify if is old style Data Descriptor..."); - fseek($fh, 12 - 4, SEEK_CUR); // 12: Data descriptor - 4: Signature (that will be read again) - $details = $this->_getFileHeaderInformation($fh); - } - if(!$details){ - $this->debugMsg(1, "Still invalid signature. Probably reached the end of the file."); - break; - } - $filename = $details['file_name']; - $this->compressedList[$filename] = $details; - $return = true; - if(strtolower($stopOnFile) == strtolower($filename)) - break; - } - - return $return; - } - Function _getFileHeaderInformation(&$fh, $startOffset=false){ - if($startOffset !== false) - fseek($fh, $startOffset); - - $signature = fread($fh, 4); - if($signature == $this->zipSignature){ - # $this->debugMsg(1, "Zip Signature!"); - - // Get information about the zipped file - $file['version_needed'] = unpack("v", fread($fh, 2)); // version needed to extract - $file['general_bit_flag'] = unpack("v", fread($fh, 2)); // general purpose bit flag - $file['compression_method'] = unpack("v", fread($fh, 2)); // compression method - $file['lastmod_time'] = unpack("v", fread($fh, 2)); // last mod file time - $file['lastmod_date'] = unpack("v", fread($fh, 2)); // last mod file date - $file['crc-32'] = fread($fh, 4); // crc-32 - $file['compressed_size'] = unpack("V", fread($fh, 4)); // compressed size - $file['uncompressed_size'] = unpack("V", fread($fh, 4)); // uncompressed size - $fileNameLength = unpack("v", fread($fh, 2)); // filename length - $extraFieldLength = unpack("v", fread($fh, 2)); // extra field length - $file['file_name'] = fread($fh, $fileNameLength[1]); // filename - $file['extra_field'] = $extraFieldLength[1]?fread($fh, $extraFieldLength[1]):''; // extra field - $file['contents-startOffset']= ftell($fh); - - // Bypass the whole compressed contents, and look for the next file - fseek($fh, $file['compressed_size'][1], SEEK_CUR); - - // Convert the date and time, from MS-DOS format to UNIX Timestamp - $BINlastmod_date = str_pad(decbin($file['lastmod_date'][1]), 16, '0', STR_PAD_LEFT); - $BINlastmod_time = str_pad(decbin($file['lastmod_time'][1]), 16, '0', STR_PAD_LEFT); - $lastmod_dateY = bindec(substr($BINlastmod_date, 0, 7))+1980; - $lastmod_dateM = bindec(substr($BINlastmod_date, 7, 4)); - $lastmod_dateD = bindec(substr($BINlastmod_date, 11, 5)); - $lastmod_timeH = bindec(substr($BINlastmod_time, 0, 5)); - $lastmod_timeM = bindec(substr($BINlastmod_time, 5, 6)); - $lastmod_timeS = bindec(substr($BINlastmod_time, 11, 5)); - - // Mount file table - $i = Array( - 'file_name' =>$file['file_name'], - 'compression_method'=>$file['compression_method'][1], - 'version_needed' =>$file['version_needed'][1], - 'lastmod_datetime' =>mktime($lastmod_timeH, $lastmod_timeM, $lastmod_timeS, $lastmod_dateM, $lastmod_dateD, $lastmod_dateY), - 'crc-32' =>str_pad(dechex(ord($file['crc-32'][3])), 2, '0', STR_PAD_LEFT). - str_pad(dechex(ord($file['crc-32'][2])), 2, '0', STR_PAD_LEFT). - str_pad(dechex(ord($file['crc-32'][1])), 2, '0', STR_PAD_LEFT). - str_pad(dechex(ord($file['crc-32'][0])), 2, '0', STR_PAD_LEFT), - 'compressed_size' =>$file['compressed_size'][1], - 'uncompressed_size' =>$file['uncompressed_size'][1], - 'extra_field' =>$file['extra_field'], - 'general_bit_flag' =>str_pad(decbin($file['general_bit_flag'][1]), 8, '0', STR_PAD_LEFT), - 'contents-startOffset'=>$file['contents-startOffset'] - ); - return $i; - } - return false; - } -} - - - - - - diff --git a/website_code/php/import/fileupload.php b/website_code/php/import/fileupload.php deleted file mode 100644 index 3ce85296ae..0000000000 --- a/website_code/php/import/fileupload.php +++ /dev/null @@ -1,54 +0,0 @@ -mimetypes)){ - - if($_FILES['filenameuploaded']['type']=="text/html"){ - - $php_check = file_get_contents($_FILES['filenameuploaded']['tmp_name']); - - if(!strpos($php_check," \ No newline at end of file diff --git a/website_code/php/import/import.php b/website_code/php/import/import.php deleted file mode 100644 index 4a136c935c..0000000000 --- a/website_code/php/import/import.php +++ /dev/null @@ -1,703 +0,0 @@ -database_table_prefix . "originaltemplatesdetails where template_name = '" . $type . "'"; - - $query_for_template_type_id_response = mysql_query($query_for_template_type_id); - - $row_template_type = mysql_fetch_array($query_for_template_type_id_response); - - /* - * create the new template record in the database - */ - - /* - * See if we have been given a name, if not, use a fixed one. - */ - - if($_POST['templatename']!=""){ - - $template_name = mysql_real_escape_string($_POST['templatename']); - - }else{ - - $template_name = "Imported template"; - - } - - $query_for_new_template = "INSERT INTO " . $xerte_toolkits_site->database_table_prefix . "templatedetails (template_id, creator_id, template_type_id, date_created, date_modified, access_to_whom, template_name) VALUES (\"" . ($maximum_template_id+1) . "\",\"" . $_SESSION['toolkits_logon_id'] . "\", \"" . $row_template_type['template_type_id'] . "\",\"" . date('Y-m-d') . "\",\"" . date('Y-m-d') . "\",\"Private\",\"" . $template_name . "\")"; - - if(mysql_query($query_for_new_template)){ - - /* - * Are we importing into a folder - */ - - if($folder_id==""){ - - $folder_id = $root_folder_id; - - } - - $query_for_template_rights = "INSERT INTO " . $xerte_toolkits_site->database_table_prefix . "templaterights (template_id,user_id,role, folder) VALUES (\"" . ($maximum_template_id+1) . "\",\"" . $_SESSION['toolkits_logon_id'] . "\", \"creator\" ,\"" . $folder_id . "\")"; - - if(mysql_query($query_for_template_rights)){ - - /* - * Make the folders and copy the files in - */ - - receive_message($_SESSION['toolkits_logon_username'], "ADMIN", "SUCCESS", "Created new template record for the database", $query_for_new_template . " " . $query_for_template_rights); - - mkdir($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->users_file_area_short . ($maximum_template_id+1) . "-" . $_SESSION['toolkits_logon_username'] . "-" . $type); - - chmod($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->users_file_area_short . ($maximum_template_id+1) . "-" . $_SESSION['toolkits_logon_username'] . "-" . $type,0777); - - mkdir($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->users_file_area_short . ($maximum_template_id+1) . "-" . $_SESSION['toolkits_logon_username'] . "-" . $type . "/media/"); - - chmod($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->users_file_area_short . ($maximum_template_id+1) . "-" . $_SESSION['toolkits_logon_username'] . "-" . $type . "/media/",0777); - - copy_loop($zip_path, $xerte_toolkits_site->root_file_path . $xerte_toolkits_site->users_file_area_short . ($maximum_template_id+1) . "-" . $_SESSION['toolkits_logon_username'] . "-" . $type . "/"); - - echo "New template imported.****"; - - /* - * Remove the files - */ - - array_splice($delete_folder_array,0); - - delete_loop($zip_path); - - while($delete_folder = array_pop($delete_folder_array)){ - - rmdir($delete_folder); - - } - - rmdir($zip_path); - - - - }else{ - - receive_message($_SESSION['toolkits_logon_username'], "ADMIN", "CRITICAL", "Failed to create new template record for the database", $query_for_template_rights); - - } - - }else{ - - receive_message($_SESSION['toolkits_logon_username'], "ADMIN", "CRITICAL", "Failed to create new template record for the database", $query_for_new_template); - - echo("FAILED-" . $_SESSION['toolkits_most_recent_error']); - - } - - mysql_close($database_connect_id); - -} - /** - * - * Function replace_existing_template - * This function removes a template and replaces it by importing over the top - * @param string $path_to_copy_from = path from imported file - * @param string $template_id = id of template to replace - * @version 1.0 - * @author Patrick Lockley - */ - -function replace_existing_template($path_to_copy_from, $template_id){ - - global $xerte_toolkits_site, $delete_file_array, $delete_folder_array; - - $query_for_play_content_strip = str_replace("\" . \$xerte_toolkits_site->database_table_prefix . \"", $xerte_toolkits_site->database_table_prefix, $xerte_toolkits_site->play_edit_preview_query); - - $query_for_play_content = str_replace("TEMPLATE_ID_TO_REPLACE", $template_id, $query_for_play_content_strip); - - $query_for_play_content_response = mysql_query($query_for_play_content); - - $row_play = mysql_fetch_array($query_for_play_content_response); - - delete_loop($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->users_file_area_short . $template_id . "-" . $row_play['username'] . "-" . $row_play['template_name'] . "/"); - - while($delete_file = array_pop($delete_file_array)){ - - unlink($delete_file); - - } - - copy_loop($path_to_copy_from, $xerte_toolkits_site->root_file_path . $xerte_toolkits_site->users_file_area_short . $template_id . "-" . $row_play['username'] . "-" . $row_play['template_name'] . "/"); - - array_splice($delete_folder_array,0); - - delete_loop($path_to_copy_from); - - while($delete_folder = array_pop($delete_folder_array)){ - - rmdir($delete_folder); - - } - - rmdir($path_to_copy_from); - - echo "Template successfully replaced.****"; - -} - - /** - * - * Function copy loop - * This function checks http security settings - * @param string $zip_path = path to the zipped files - * @param string $final_path = path to where the files are going - * @version 1.0 - * @author Patrick Lockley - */ - -function copy_loop($zip_path, $final_path){ - - global $xerte_toolkits_site; - - $d = opendir($zip_path); - - while($f = readdir($d)){ - - if(is_dir($zip_path . $f)){ - - if(($f!=".")&&($f!="..")){ - - copy_loop($zip_path . $f . "/", $final_path . $f . "/"); - - } - - }else{ - - rename($zip_path . $f, $final_path . $f); - - } - - } - - closedir($d); - -} - - /** - * - * Function delete loop - * This function checks http security settings - * @param string $path = path to the files we are deleting - * @version 1.0 - * @author Patrick Lockley - */ - -function delete_loop($path){ - - global $likelihood_array, $delete_folder_array, $delete_file_array; - - $d = opendir($path); - - while($f = readdir($d)){ - - if(is_dir($path . $f)){ - - if(($f!=".")&&($f!="..")){ - - delete_loop($path . $f . "/"); - - array_push($delete_folder_array, $path . $f . "/"); - - } - - }else{ - - array_push($delete_file_array, $path . $f); - - } - - } - - closedir($d); - -} - - /** - * - * Function folder loop - * This function checks http security settings - * @param string $path = path to loop through - * @version 1.0 - * @author Patrick Lockley - */ - -function folder_loop($path){ - - global $likelihood_array; - - $d = opendir($path); - - while($f = readdir($d)){ - - if(is_dir($path . $f)){ - - if(($f!=".")&&($f!="..")){ - - folder_loop($path . $f . "/"); - - } - - }else{ - - if(strpos($f,".rlt")!=0){ - - $template_check = file_get_contents($path . $f); - - $folder = explode('"',substr($template_check,strpos($template_check,"targetFolder"),strpos($template_check,"version")-strpos($template_check,"targetFolder"))); - - $start_point = strpos($template_check,"version"); - - $version = explode('"',substr($template_check,$start_point,strpos($template_check," ",$start_point)-$start_point)); - - $temp_array = array($folder[1],$version[1]); - - array_push($likelihood_array,$temp_array); - - }else{ - - - } - - } - - } - - closedir($d); - -} - -/* -* Check who made the template -*/ - -if($_POST['replace']!=""){ - - if(!is_user_creator(mysql_real_escape_string($_POST['replace']))){ - - echo "Only the owner of this template can import over the top.****"; - die(); - - } - -} - -$folder_id = ""; - -/* -* Check the file is the write type -*/ - -if(($_FILES['filenameuploaded']['type']=="application/x-zip-compressed")||($_FILES['filenameuploaded']['type']=="application/zip")){ - - $this_dir = rand() . "/"; - - mkdir($xerte_toolkits_site->import_path . $this_dir); - - chmod($xerte_toolkits_site->import_path . $this_dir,0777); - - $new_file_name = $xerte_toolkits_site->import_path . $this_dir . time() . $_FILES['filenameuploaded']['name']; - - if(@move_uploaded_file($_FILES['filenameuploaded']['tmp_name'], $new_file_name)){ - - require_once dirname(__FILE__)."/dUnzip2.inc.php"; - - $zip = new dUnzip2($new_file_name); - - $zip->debug = false; - - $zip->getList(); - - $file_data = array(); - - $template_data_equivalent = null; - - /* - * Look for the folders in the zip and move files accordingly - */ - - foreach($zip->compressedList as $x){ - - foreach($x as $y){ - - if(!(strpos($y,"media/")===false)){ - - $string = $zip->unzip($y, false, 0777); - - $temp_array = array($y,$string,"media"); - - array_push($file_data,$temp_array); - - } - - if(!(strpos($y,".rlt")===false)){ - - $string = $zip->unzip($y, false, 0777); - - $rlt_name = $y; - - $temp_array = array($y,$string,"rlt"); - - array_push($file_data,$temp_array); - - if(!(strpos($string,"templateData=")===false)){ - - $temp = substr($string,strpos($string,"templateData=\"FileLocation + '")+strlen("templateData=\"FileLocation + '")); - - $temp = substr($temp,0,strpos($temp,"'")); - - $template_data_equivalent = $temp; - - } - - } - - } - - } - - /* - * Look for an xml file linked to the RLO - */ - - if($template_data_equivalent!=null){ - - foreach($zip->compressedList as $x){ - - foreach($x as $y){ - - if($y===$template_data_equivalent){ - - $data_xml = $zip->unzip($y, false, 0777); - - $temp_array = array("data.xml",$data_xml,null); - - array_push($file_data,$temp_array); - - } - - } - - } - - }else{ - - echo "File transfer has failed.****"; - - } - - /* - * Make some new folders - */ - - mkdir($xerte_toolkits_site->import_path . $this_dir . "media"); - - chmod($xerte_toolkits_site->import_path . $this_dir, 0777); - - /* - * Put the files into the right folders - */ - - while($file_to_create = array_pop($file_data)){ - - if($file_to_create[2]=="media"){ - - $fp = fopen($xerte_toolkits_site->import_path . $this_dir . $file_to_create[0],"w"); - - fwrite($fp,$file_to_create[1]); - - fclose($fp); - - chmod($xerte_toolkits_site->import_path . $this_dir . $file_to_create[0],0777); - - }else if($file_to_create[2]=="rlt"){ - - $fp = fopen($xerte_toolkits_site->import_path . $this_dir . $file_to_create[0],"w"); - - fwrite($fp,$file_to_create[1]); - - fclose($fp); - - $template_check = $file_to_create[1]; - - chmod($xerte_toolkits_site->import_path . $this_dir . $file_to_create[0],0777); - - }else{ - - $fp = fopen($xerte_toolkits_site->import_path . $this_dir . $file_to_create[0],"w"); - - fwrite($fp,$file_to_create[1]); - - fclose($fp); - - chmod($xerte_toolkits_site->import_path . $this_dir . $file_to_create[0],0777); - - } - - } - - $zip->close(); - - unlink($new_file_name); - - /* - * use the template attributes to make the folders required and name them accordingly - */ - - $folder = explode('"',substr($template_check,strpos($template_check,"targetFolder"),strpos($template_check,"version")-strpos($template_check,"targetFolder"))); - - $start_point = strpos($template_check,"version"); - - $version = explode('"',substr($template_check,$start_point,strpos($template_check," ",$start_point)-$start_point)); - - if($_POST['replace']){ - - $query = "select template_framework from " . $xerte_toolkits_site->database_table_prefix . "templatedetails, " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails where " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_type_id = " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails.template_type_id AND " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_id =\"" . mysql_real_escape_string($_POST['replace']) . "\""; - - $query_response = mysql_query($query); - - if($query_reponse===false){ - - receive_message($_SESSION['toolkits_logon_username'], "USER", "CRITICAL", "Failed to get template type", "Failed to get template type"); - - echo "Sorry, we cannot get a template type for this template.****"; - - }else{ - - $row = mysql_fetch_array($query_response); - - if($row['template_framework']=="xerte"){ - - folder_loop($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . "xerte/parent_templates/"); - - $template_found = false; - - while($list_of_rlts = array_pop($likelihood_array)){ - - if(($folder[1]!="")&&($version[1]!="")&&($folder[1]==$list_of_rlts[0])&&($version[1]==$list_of_rlts[1])){ - - $template_found=true; - break; - - } - - } - - if($template_found){ - - unlink($xerte_toolkits_site->import_path . $this_dir . $rlt_name); - - $preview_xml = file_get_contents($xerte_toolkits_site->import_path . $this_dir . "data.xml"); - - $fh = fopen($xerte_toolkits_site->import_path . $this_dir . "preview.xml", "w"); - - fwrite($fh, $preview_xml); - - fclose($fh); - - /* - * Copy over the top - */ - - replace_existing_template($xerte_toolkits_site->import_path . $this_dir, mysql_real_escape_string($_POST['replace'])); - - - }else{ - - echo "No valid template equivalent found on this site. Please contact your system administrators.****"; - delete_loop($xerte_toolkits_site->import_path . $this_dir); - - while($delete_file = array_pop($delete_file_array)){ - - unlink($delete_file); - - } - - while($delete_folder = array_pop($delete_folder_array)){ - - rmdir($delete_folder); - - } - - rmdir($xerte_toolkits_site->import_path . $this_dir); - - } - - } - - } - - }else{ - - if($_POST['folder']!=""){ - - $folder_id = $_POST['folder']; - - } - - if($template_check!=null){ - - folder_loop($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . "xerte/parent_templates/"); - - $template_found = false; - - while($list_of_rlts = array_pop($likelihood_array)){ - - if(($folder[1]!="")&&($version[1]!="")&&($folder[1]==$list_of_rlts[0])&&($version[1]==$list_of_rlts[1])){ - - $template_found=true; - break; - - } - - } - - if($template_found){ - - /* - * Make a new template - */ - - unlink($xerte_toolkits_site->import_path . $this_dir . $rlt_name); - - $preview_xml = file_get_contents($xerte_toolkits_site->import_path . $this_dir . "data.xml"); - - $fh = fopen($xerte_toolkits_site->import_path . $this_dir . "preview.xml", "w"); - - fwrite($fh, $preview_xml); - - fclose($fh); - - make_new_template($folder[1], $xerte_toolkits_site->import_path . $this_dir); - - }else{ - - echo "No valid template equivalent found on this site. Please contact your system administrators.****"; - delete_loop($xerte_toolkits_site->import_path . $this_dir); - - while($delete_file = array_pop($delete_file_array)){ - - unlink($delete_file); - - } - - while($delete_folder = array_pop($delete_folder_array)){ - - rmdir($delete_folder); - - } - - rmdir($xerte_toolkits_site->import_path . $this_dir); - - } - - }else{ - - echo "Only Xerte templates are currently imported.****"; - - delete_loop($xerte_toolkits_site->import_path . $this_dir); - - while($delete_file = array_pop($delete_file_array)){ - - unlink($delete_file); - - } - - while($delete_folder = array_pop($delete_folder_array)){ - - rmdir($delete_folder); - - } - - rmdir($xerte_toolkits_site->import_path . $this_dir); - - - } - - } - - }else{ - - echo "File transfer has failed.****"; - delete_loop($xerte_toolkits_site->import_path . $this_dir); - while($delete_file = array_pop($delete_file_array)){ - - unlink($delete_file); - - } - while($delete_folder = array_pop($delete_folder_array)){ - - rmdir($delete_folder); - - } - rmdir($xerte_toolkits_site->import_path . $this_dir); - - } - -}else{ - - echo $_FILES['filenameuploaded']['type'] . "
"; - - echo "You can only import Zip Files.****"; - -} - -?> \ No newline at end of file diff --git a/website_code/php/import/import_template.php b/website_code/php/import/import_template.php deleted file mode 100644 index e5ae243f39..0000000000 --- a/website_code/php/import/import_template.php +++ /dev/null @@ -1,383 +0,0 @@ -import_path . $this_dir); - - chmod($xerte_toolkits_site->import_path . $this_dir,0777); - - $new_file_name = $xerte_toolkits_site->import_path . $_FILES['filenameuploaded']['name']; - - if(@move_uploaded_file($_FILES['filenameuploaded']['tmp_name'], $new_file_name)){ - - require_once dirname(__FILE__)."/dUnzip2.inc.php"; - - $zip = new dUnzip2($new_file_name); - - $zip->debug = false; - - $zip->getList(); - - $zip->unzipAll($xerte_toolkits_site->import_path . $this_dir); - - } - - $zip->close(); - - unlink($new_file_name); - - if($_POST['folder']!=""){ - - /* - * We are replacing, so delete files - */ - - delete_loop($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . "xerte/templates/" . $_POST['folder'] . "/"); - delete_loop($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . "xerte/parent_templates/" . $_POST['folder'] . "/"); - - while($file_to_delete = array_pop($delete_file_array)){ - - @unlink($file_to_delete); - - } - - }else{ - - $dir = opendir($xerte_toolkits_site->import_path . $this_dir . substr($_FILES['filenameuploaded']['name'],0,strlen($_FILES['filenameuploaded']['name'])-4)); - - if($dir===false){ - - delete_loop($xerte_toolkits_site->import_path . $this_dir); - - while($file_to_delete = array_pop($delete_file_array)){ - - @unlink($file_to_delete); - - } - - rmdir($xerte_toolkits_site->import_path . $this_dir); - - echo "Zip file not properly structured. ****"; - - die(); - - } - - $rlt_not_found = false; - - while($filename = readdir($dir)){ - - /* - * Get the variables from out of the RLT - */ - - if($filename=="template.rlt"){ - - $string = file_get_contents($xerte_toolkits_site->import_path . $this_dir . substr($_FILES['filenameuploaded']['name'],0,strlen($_FILES['filenameuploaded']['name'])-4) . "/" . $filename); - - if((strpos($string, "targetFolder=")===false)||(strpos($string, "name=")===false)||(strpos($string, "description=")===false)){ - - delete_loop($xerte_toolkits_site->import_path . $this_dir); - - echo "Template not setup correctly to work on toolkits. ****"; - - while($file_to_delete = array_pop($delete_file_array)){ - - @unlink($file_to_delete); - - } - - rmdir($xerte_toolkits_site->import_path . $this_dir); - - die(); - - }else{ - - $folder = substr(substr($string, strpos($string, "targetFolder=")+14),0,strpos(substr($string, strpos($string, "targetFolder=")+14),"\"")); - - $name = substr(substr($string, strpos($string, "name=")+6),0,strpos(substr($string, strpos($string, "name=")+6),"\"")); - - $desc = substr(substr($string, strpos($string, "description=")+13),0,strpos(substr($string, strpos($string, "description=")+13),"\"")); - - $rlt_not_found = true; - - } - - } - - } - - if(!$rlt_not_found){ - - delete_loop($xerte_toolkits_site->import_path . $this_dir); - - while($file_to_delete = array_pop($delete_file_array)){ - - @unlink($file_to_delete); - - } - - rmdir($xerte_toolkits_site->import_path . $this_dir); - - echo "No file called template.rlt found. ****"; - - die(); - - } - - } - - if($_POST['folder']==""){ - - /* - * Make all the new folders - */ - - $parent = fileperms($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . "xerte/parent_templates/"); - $templates = fileperms($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . "xerte/templates/"); - - @chmod($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . "xerte/parent_templates/",0777); - @chmod($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . "xerte/templates/",0777); - - @mkdir($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . "xerte/parent_templates/" . $folder . "/"); - @mkdir($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . "xerte/parent_templates/" . $folder . "/common/"); - @mkdir($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . "xerte/parent_templates/" . $folder . "/thumbs/"); - @mkdir($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . "xerte/parent_templates/" . $folder . "/models/"); - @mkdir($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . "xerte/templates/" . $folder . "/"); - @mkdir($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . "xerte/templates/" . $folder . "/media/"); - - @chmod($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . "xerte/parent_templates/" . $folder . "/",0777); - @chmod($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . "xerte/parent_templates/" . $folder . "/common/",0777); - @chmod($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . "xerte/parent_templates/" . $folder . "/thumbs/",0777); - @chmod($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . "xerte/parent_templates/" . $folder . "/models/",0777); - @chmod($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . "xerte/templates/" . $folder . "/",0777); - @chmod($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . "xerte/templates/" . $folder . "/media/",0777); - - @chmod($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . "xerte/parent_templates/",$parent); - @chmod($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . "xerte/templates/",$templates); - - $this_dir .= substr($_FILES['filenameuploaded']['name'],0,strlen($_FILES['filenameuploaded']['name'])-4) . "/"; - - }else{ - - $folder = mysql_real_escape_string($_POST['folder']); - - } - - copy_loop($xerte_toolkits_site->import_path . $this_dir . "media"); - - while($file_to_copy = array_pop($copy_file_array)){ - - @rename($xerte_toolkits_site->import_path . $this_dir . "media/" . $file_to_copy, $xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . "xerte/templates/" . $folder . "/media/" . $file_to_copy); - - } - - /* - * Remove files - */ - - delete_loop($xerte_toolkits_site->import_path . $this_dir . "media"); - - while($file_to_delete = array_pop($delete_file_array)){ - - @unlink($file_to_delete); - - } - - copy_loop($xerte_toolkits_site->import_path . $this_dir . "thumbs"); - - while($file_to_copy = array_pop($copy_file_array)){ - - @rename($xerte_toolkits_site->import_path . $this_dir . "thumbs/" . $file_to_copy, $xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . "xerte/parent_templates/" . $folder . "/thumbs/" . $file_to_copy); - - } - - delete_loop($xerte_toolkits_site->import_path . $this_dir . "thumbs"); - - while($file_to_delete = array_pop($delete_file_array)){ - - @unlink($file_to_delete); - - } - - copy_loop($xerte_toolkits_site->import_path . $this_dir . "common"); - - while($file_to_copy = array_pop($copy_file_array)){ - - @rename($xerte_toolkits_site->import_path . $this_dir . "common/" . $file_to_copy, $xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . "xerte/parent_templates/" . $folder . "/common/" . $file_to_copy); - - } - - delete_loop($xerte_toolkits_site->import_path . $this_dir . "common"); - - while($file_to_delete = array_pop($delete_file_array)){ - - @unlink($file_to_delete); - - } - - while($file_to_copy = array_pop($copy_file_array)){ - - @rename($xerte_toolkits_site->import_path . $this_dir . "models/" . $file_to_copy, $xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . "xerte/parent_templates/" . $folder . "/common/" . $file_to_copy); - - } - - delete_loop($xerte_toolkits_site->import_path . $this_dir . "models"); - - while($file_to_delete = array_pop($delete_file_array)){ - - @unlink($file_to_delete); - - } - - delete_loop($xerte_toolkits_site->import_path . $this_dir); - - while($file_to_delete = array_pop($delete_file_array)){ - - @unlink($file_to_delete); - - } - - rmdir($xerte_toolkits_site->import_path . $this_dir . "common"); - rmdir($xerte_toolkits_site->import_path . $this_dir . "media"); - rmdir($xerte_toolkits_site->import_path . $this_dir . "thumbs"); - rmdir($xerte_toolkits_site->import_path . $this_dir . "models"); - - rename($xerte_toolkits_site->import_path . $this_dir . "template.rlt", $xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . "xerte/parent_templates/" . $folder . "/" . $folder . ".rlt"); - - rename($xerte_toolkits_site->import_path . $this_dir . "template.xml", $xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . "xerte/templates/" . $folder . "/data.xml"); - - rename($xerte_toolkits_site->import_path . $this_dir . "template.xwd", $xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . "xerte/parent_templates/" . $folder . "/data.xwd"); - - if($_POST['folder']==""){ - - /* - * No folder was posted, so add records to the database id. - */ - - $mysql_id = database_connect("Import_template.php database connect success", "Import_template.php database connect failure"); - - $query = "INSERT INTO " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails (template_framework, template_name, description, date_uploaded, display_name, display_id, access_rights, active) values ('xerte','" . $folder . "','" . $desc ."','" . date('Y-m-d') . "','" . $name . "','0','','false')"; - - if(mysql_query($query)){ - - receive_message($_SESSION['toolkits_logon_username'], "USER", "SUCCESS", "Folder creation succeeded for " . $_SESSION['toolkits_logon_username'], "Folder creation succeeded for " . $_SESSION['toolkits_logon_username']); - - echo "The folder has been created****"; - - rmdir(substr($xerte_toolkits_site->import_path . $end_dir,-1)); - - }else{ - - receive_message($_SESSION['toolkits_logon_username'], "USER", "CRITICAL", "Folder creation failed for " . $_SESSION['toolkits_logon_username'], "Folder creation failed for " . $_SESSION['toolkits_logon_username']); - - echo "Error creating folder****"; - - rmdir(substr($xerte_toolkits_site->import_path . $end_dir,-1)); - - } - - mysql_close($mysql_id); - - } - -} \ No newline at end of file diff --git a/website_code/php/login_library.php b/website_code/php/login_library.php deleted file mode 100644 index b03dfc90c9..0000000000 --- a/website_code/php/login_library.php +++ /dev/null @@ -1,456 +0,0 @@ -LDAP_preference; - - $ldap_search_attr = array('firstname' => 'givenname', 'lastname' => 'sn'); - - $ldapbind = null; - - $ds = @ldap_connect($host, (int)$port); - - if($bind_pwd!=""){ - - @ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); - - if ($ds) { - - if ($bind_dn != '') { - - $ldapbind = @ldap_bind($ds, $bind_dn, $bind_pwd); - - $sr = @ldap_search($ds, $basedn, $ldap_filter_attr ."=". $toolkits_username, array_values($ldap_search_attr)); - - if(!$sr){ - - /* - * login has failed - */ - - ldap_close($ds); - - return false; - - } - - $entry = ldap_get_entries($ds, $sr); - - if(! $entry or ! $entry[0]) { - - ldap_close($ds); - - return false; - - }else{ - - if(@ldap_bind($ds, $entry[0]['dn'], $password) ) { - - /* - * valid login, so return true - */ - - ldap_close($ds); - - return $entry; - - } - - } - - } - - }else{ - - /* - * login failed (possibly for technical reasons with LDAP) - */ - - ldap_close($ds); - - return false; - - } - - }else{ - - $filter = $xerte_toolkits_site->LDAP_filter . $toolkits_username; - - $ldapConnection = ldap_connect($host, (int)$port); - - $ldapSearchResult = @ldap_search($ldapConnection, $basedn, $filter ); - - $ldapSearchArray = @ldap_get_entries($ldapConnection, $ldapSearchResult); - - $userBaseDn = $ldapSearchArray[0]["dn"]; - - /* - * Bind with password & baseDN - */ - - if ($ldapConnection){ - - if (@ldap_bind($ldapConnection, $userBaseDn, $password)){ - - $entry = ldap_get_entries($ldapConnection, $ldapSearchResult); - - if(!$entry or !$entry[0]){ - - ldap_close($ds); - - return false; - - }else{ - - return $entry; - - } - - }else{ - - return false; - - } - - } - ldap_close($ldapConnection); - - - } - -} - - - - -function authenticate_to_host($host,$port,$bind_pwd,$basedn,$bind_dn,$toolkits_username,$password,$xerte_toolkits_site){ - - $ldap_filter_attr = $xerte_toolkits_site->LDAP_preference; - - $ldap_search_attr = array('firstname' => 'givenname', 'lastname' => 'sn'); - - $ldapbind = null; - - $ds = @ldap_connect($host, (int)$port); - - if($bind_pwd!=""){ - - @ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); - - if ($ds) { - - if ($bind_dn != '') { - - $ldapbind = @ldap_bind($ds, $bind_dn, $bind_pwd); - - $sr = @ldap_search($ds, $basedn, $ldap_filter_attr ."=". $toolkits_username, array_values($ldap_search_attr)); - - if(!$sr){ - - /* - * login has failed - */ - - ldap_close($ds); - - return false; - - } - - $entry = ldap_get_entries($ds, $sr); - - if(! $entry or ! $entry[0]) { - - ldap_close($ds); - - return false; - - }else{ - - if(@ldap_bind($ds, $entry[0]['dn'], $password)) { - - /* - * valid login, so return true - */ - - ldap_close($ds); - - return true; - - } - - } - - } - - }else{ - - /* - * login failed (possibly for technical reasons with LDAP) - */ - - ldap_close($ds); - - return false; - - } - - }else{ - - $filter = $xerte_toolkits_site->LDAP_filter . $toolkits_username; - - $ldapConnection = ldap_connect($host, (int)$port); - - $ldapSearchResult = @ldap_search($ldapConnection, $basedn, $filter); - - $ldapSearchArray = @ldap_get_entries($ldapConnection, $ldapSearchResult); - - $userBaseDn = $ldapSearchArray[0]["dn"]; - - /* - * Bind with password & baseDN - */ - - if ($ldapConnection){ - - if (@ldap_bind($ldapConnection, $userBaseDn, $password)){ - - $entry = ldap_get_entries($ldapConnection, $ldapSearchResult); - - if(!$entry or !$entry[0]){ - - ldap_close($ds); - - return false; - - }else{ - - return true; - - } - - }else{ - - return false; - - } - - } - - ldap_close($ldapConnection); - - } - -} - - /** - * - * Function valid login - * This function is used to authenticate users on index.php - * @param string $username = username given - * @param string $password = password given - * @return bool - True or false depending on authentication - * @version 1.0 - * @author Patrick Lockley - */ - -function valid_login($username,$password){ - - require('config.php'); - - require_once($xerte_toolkits_site->php_library_path . "error_library.php"); - - if(strpos($xerte_toolkits_site->ldap_host,"$$$")){ - - $login_check = false; - - $host = explode("$$$",$xerte_toolkits_site->ldap_host); - $port = explode("$$$",$xerte_toolkits_site->ldap_port); - $bind_pwd = explode("$$$",$xerte_toolkits_site->bind_pwd); - $basedn = explode("$$$",$xerte_toolkits_site->basedn); - $bind_dn = explode("$$$",$xerte_toolkits_site->bind_dn); - - for($x=0;$xldap_host; - $port = $xerte_toolkits_site->ldap_port; - $bind_pwd= $xerte_toolkits_site->bind_pwd; - $basedn= $xerte_toolkits_site->basedn; - $bind_dn = $xerte_toolkits_site->bind_dn; - - $result = authenticate_to_host($host,$port,$bind_pwd,$basedn,$bind_dn,$username,$password,$xerte_toolkits_site); - - if($result){ - - receive_message($username, "USER", "SUCCESS", "Logging in succeeded for " . $username, "Logging in succeeded for " . $username); - - return $result; - - }else{ - - receive_message($username, "USER", "CRITICAL", "Login failed for " . $username, "Login failed for " . $username); - - return $result; - - } - - } - -} - - /** - * - * Function get user details - * This function is used to get a users details from LDAP - * @param string $username = username given - * @param string $password = password given - * @return array $entry - the LDAP array returned - * @version 1.0 - * @author Patrick Lockley - */ - -function get_user_details($username,$password){ - - require('config.php'); - - require_once($xerte_toolkits_site->php_library_path . "error_library.php"); - - if(strpos($xerte_toolkits_site->ldap_host,"$$$")){ - - $login_check = false; - - $host = explode("$$$",$xerte_toolkits_site->ldap_host); - $port = explode("$$$",$xerte_toolkits_site->ldap_port); - $bind_pwd = explode("$$$",$xerte_toolkits_site->bind_pwd); - $basedn = explode("$$$",$xerte_toolkits_site->basedn); - $bind_dn = explode("$$$",$xerte_toolkits_site->bind_dn); - - for($x=0;$xldap_host; - $port = $xerte_toolkits_site->ldap_port; - $bind_pwd= $xerte_toolkits_site->bind_pwd; - $basedn= $xerte_toolkits_site->basedn; - $bind_dn = $xerte_toolkits_site->bind_dn; - - $result = get_ldap_array($host,$port,$bind_pwd,$basedn,$bind_dn,$username,$password,$xerte_toolkits_site); - - if($result){ - - receive_message($username, "USER", "SUCCESS", "Ldap Array succeeded for " . $username, "Ldap Array succeeded for " . $username); - - return $result; - - }else{ - - receive_message($username, "USER", "CRITICAL", "Ldap Array for " . $username, "Ldap Array failed for " . $username); - - return $result; - - } - - } - - -} - - /** - * - * Function password username check - * This function is used to authenticate on the password play page - * @param string $login_details = username and passwird in an array - * @version 1.0 - * @author Patrick Lockley - */ - -function password_username_check($login_details){ - - if(($login_details["login"]=="")&&($login_details["password"]=="")){ - - $results_and_message = array ("false", "

Please enter your username and password

"); - - return $results_and_message; - - }else if($login_details["login"]==""){ - - $results_and_message = array ("false", "

Please enter your username

"); - - return $results_and_message; - - }else if($login_details["password"]==""){ - - $results_and_message = array ("false", "

Please enter your password

"); - - return $results_and_message; - - }else if(($login_details["login"]!="")&&($login_details["password"]!="")){ - - if(valid_login($login_details["login"],$login_details["password"])){ - - $results_and_message = array ("true", " "); - - return $results_and_message; - - }else{ - - $results_and_message = array ("false", " "); - - return $results_and_message; - - } - - } - -} - -?> \ No newline at end of file diff --git a/website_code/php/logout.php b/website_code/php/logout.php deleted file mode 100644 index 7d6272c179..0000000000 --- a/website_code/php/logout.php +++ /dev/null @@ -1,21 +0,0 @@ -site_session_name); - - session_start($xerte_toolkits_site->site_session_name); - - unset(session_id()); - - session_destroy(); - -?> \ No newline at end of file diff --git a/website_code/php/management/categories.php b/website_code/php/management/categories.php deleted file mode 100644 index 33dfd3a1dc..0000000000 --- a/website_code/php/management/categories.php +++ /dev/null @@ -1,35 +0,0 @@ -database_table_prefix . "syndicationcategories order by category_name ASC"; - - echo "

Add a new category

"; - - echo "

The new category is

"; - echo "

"; - - echo "

Manage existing categories

"; - - $query_response = mysql_query($query); - - while($row = mysql_fetch_array($query_response)){ - - echo "

" . $row['category_name'] . " - Remove

"; - - } - -}else{ - - echo "the feature is for administrators only"; - -} - -?> \ No newline at end of file diff --git a/website_code/php/management/delete_template.php b/website_code/php/management/delete_template.php deleted file mode 100644 index 808ea7f176..0000000000 --- a/website_code/php/management/delete_template.php +++ /dev/null @@ -1,56 +0,0 @@ -database_table_prefix . "originaltemplatesdetails where template_type_id = \"" . $_POST['template_id'] . "\""; - - echo $query_to_get_template_type_id . "
"; - - $query_to_get_template_type_id_response = mysql_query($query_to_get_template_type_id); - - $row_template_id = mysql_fetch_array($query_to_get_template_type_id_response); - - $path = $xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . $row_template_id['template_framework'] . "/parent_templates/" . $row_template_id['template_name'] . "/"; - - $path2 = $xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . $row_template_id['template_framework'] . "/templates/" . $row_template_id['template_name'] . "/"; - - echo $path . "
" . $path2; - - set_up_deletion($path); - - set_up_deletion($path2); - - $query_to_delete_template = "delete from " .$xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails where template_type_id=\"" . $_POST['template_id'] . "\""; - - echo $query_to_delete_template . "
"; - - if(mysql_query($query_to_delete_template)){ - - echo "succeed"; - - }else{ - - echo "Fail"; - - } - - - } - mysql_close($database_id); - -?> \ No newline at end of file diff --git a/website_code/php/management/error_list.php b/website_code/php/management/error_list.php deleted file mode 100644 index ef2dde97de..0000000000 --- a/website_code/php/management/error_list.php +++ /dev/null @@ -1,49 +0,0 @@ -error_log_path; - - $error_file_list = opendir($path); - - while($file = readdir($error_file_list)){ - - if(strpos($file,".log")!=0){ - - $user_parameter = substr($file,0,strlen($file)-4); - - $query_for_full_name = "select login_id, firstname, surname from " . $xerte_toolkits_site->database_table_prefix . "logindetails where username=\"" . $user_parameter . "\""; - - $query_for_full_name_response = mysql_query($query_for_full_name); - - $row_name = mysql_fetch_array($query_for_full_name_response); - - if(mysql_num_rows($query_for_full_name_response)!=0){ - - echo "

" . $row_name['firstname'] . " " . $row_name['surname'] . " View

"; - - }else{ - - echo "

" . $user_parameter . " View

"; - - } - - echo "

" . str_replace("*","",file_get_contents($path . $file)) . "

"; - - echo "
"; - - } - - } - -}else{ - - echo "the feature is for administrators only"; - -} - -?> \ No newline at end of file diff --git a/website_code/php/management/licenses.php b/website_code/php/management/licenses.php deleted file mode 100644 index 000f7dbf3c..0000000000 --- a/website_code/php/management/licenses.php +++ /dev/null @@ -1,36 +0,0 @@ -Add a new license

"; - - echo "

The new license is

"; - echo "

"; - - echo "

Manage existing licenses

"; - - $query="select * from " . $xerte_toolkits_site->database_table_prefix . "syndicationlicenses"; - - $query_response = mysql_query($query); - - while($row = mysql_fetch_array($query_response)){ - - echo "

" . $row['license_name'] . " - Remove

"; - - } - - -}else{ - - echo "the feature is for administrators only"; - -} - -?> \ No newline at end of file diff --git a/website_code/php/management/new_category.php b/website_code/php/management/new_category.php deleted file mode 100644 index c0f1cfcc06..0000000000 --- a/website_code/php/management/new_category.php +++ /dev/null @@ -1,53 +0,0 @@ -database_table_prefix . "syndicationcategories (category_name) values ('" . $_POST['newcategory'] . "')"; - - if(mysql_query($query)){ - - // change these - - //receive_message($_SESSION['toolkits_logon_username'], "USER", "SUCCESS", "Folder creation succeeded for " . $_SESSION['toolkits_logon_username'], "Folder creation succeeded for " . $_SESSION['toolkits_logon_username']); - - }else{ - - // change these - - //receive_message($_SESSION['toolkits_logon_username'], "USER", "CRITICAL", "Folder creation failed for " . $_SESSION['toolkits_logon_username'], "Folder creation failed for " . $_SESSION['toolkits_logon_username']); - - - } - - $query="select * from " . $xerte_toolkits_site->database_table_prefix . "syndicationcategories order by category_name ASC"; - - echo "

Add a new category

"; - - echo "

The new category is

"; - echo "

"; - - echo "

Manage existing categories

"; - - $query_response = mysql_query($query); - - while($row = mysql_fetch_array($query_response)){ - - echo "

" . $row['category_name'] . " - Remove

"; - - } - - -}else{ - - echo "the feature is for administrators only"; - -} - -?> - diff --git a/website_code/php/management/new_license.php b/website_code/php/management/new_license.php deleted file mode 100644 index 7614d78d31..0000000000 --- a/website_code/php/management/new_license.php +++ /dev/null @@ -1,54 +0,0 @@ -database_table_prefix . "syndicationlicenses (license_name) values ('" . $_POST['newlicense'] . "')"; - - if(mysql_query($query)){ - - // change these - - //receive_message($_SESSION['toolkits_logon_username'], "USER", "SUCCESS", "Folder creation succeeded for " . $_SESSION['toolkits_logon_username'], "Folder creation succeeded for " . $_SESSION['toolkits_logon_username']); - - }else{ - - // change these - - //receive_message($_SESSION['toolkits_logon_username'], "USER", "CRITICAL", "Folder creation failed for " . $_SESSION['toolkits_logon_username'], "Folder creation failed for " . $_SESSION['toolkits_logon_username']); - - - } - - $database_id = database_connect("templates list connected","template list failed"); - - echo "

Add a new license

"; - - echo "

The new license is

"; - echo "

"; - - echo "

Manage existing licenses

"; - - $query="select * from " . $xerte_toolkits_site->database_table_prefix . "syndicationlicenses"; - - $query_response = mysql_query($query); - - while($row = mysql_fetch_array($query_response)){ - - echo "

" . $row['license_name'] . " - Remove

"; - - } - - -}else{ - - echo "the feature is for administrators only"; - -} - -?> \ No newline at end of file diff --git a/website_code/php/management/new_security.php b/website_code/php/management/new_security.php deleted file mode 100644 index 8430cd76bf..0000000000 --- a/website_code/php/management/new_security.php +++ /dev/null @@ -1,63 +0,0 @@ -database_table_prefix . "play_security_details (security_setting,security_data,security_info) values ('" . $_POST['newsecurity'] . "','" . $_POST['newdata'] . "','" . $_POST['newdesc'] ."')"; - - if(mysql_query($query)){ - - // change these - - //receive_message($_SESSION['toolkits_logon_username'], "USER", "SUCCESS", "Folder creation succeeded for " . $_SESSION['toolkits_logon_username'], "Folder creation succeeded for " . $_SESSION['toolkits_logon_username']); - - }else{ - - // change these - - //receive_message($_SESSION['toolkits_logon_username'], "USER", "CRITICAL", "Folder creation failed for " . $_SESSION['toolkits_logon_username'], "Folder creation failed for " . $_SESSION['toolkits_logon_username']); - - - } - - $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); - - echo "

Add a new setting

"; - - echo "

The security setting's name is

"; - echo "

The security data is

"; - echo "

The security info is

"; - echo "

"; - - echo "

Manage existing settings

"; - - while($row_security = mysql_fetch_array($query_for_play_security_response)){ - - echo "

" . $row_security['security_setting'] . " View

"; - - echo "

The security setting is

"; - echo "

The security data is

"; - echo "

The security info is

"; - - echo "

Remove this setting. In removing a setting all content with this option will be set to Private. You should inform your users of this change first.

"; - - } - - mysql_close($mysql_id); - - -}else{ - - echo "the feature is for administrators only"; - -} - -?> - diff --git a/website_code/php/management/play_security_list.php b/website_code/php/management/play_security_list.php deleted file mode 100644 index b83b59d112..0000000000 --- a/website_code/php/management/play_security_list.php +++ /dev/null @@ -1,41 +0,0 @@ -database_table_prefix . "play_security_details"; - - $query_for_play_security_response = mysql_query($query_for_play_security); - - echo "

Add a new setting

"; - - echo "

The security setting's name is

"; - echo "

The security data is

"; - echo "

The security info is

"; - echo "

"; - - echo "

Manage existing settings

"; - - while($row_security = mysql_fetch_array($query_for_play_security_response)){ - - echo "

" . $row_security['security_setting'] . " View

"; - - echo "

The security setting is

"; - echo "

The security data is

"; - echo "

The security info is

"; - - echo "

Remove this setting. In removing a setting all content with this option will be set to Private. You should inform your users of this change first.

"; - - } - - -}else{ - - echo "the feature is for administrators only"; - -} - -?> \ No newline at end of file diff --git a/website_code/php/management/play_security_management.php b/website_code/php/management/play_security_management.php deleted file mode 100644 index f247b20a6b..0000000000 --- a/website_code/php/management/play_security_management.php +++ /dev/null @@ -1,26 +0,0 @@ -database_table_prefix . "play_security_details set security_setting=\"" . $_POST['security'] . "\", security_data=\"" . $_POST['data'] . "\", security_info =\"" . $_POST['info'] . "\" where security_id =\"" . $_POST['play_id'] . "\""; - - if(mysql_query($query)){ - - echo "Update successful"; - - }else{ - - echo "Update failed"; - - } - -} - -?> \ No newline at end of file diff --git a/website_code/php/management/remove_category.php b/website_code/php/management/remove_category.php deleted file mode 100644 index 5d7a791b30..0000000000 --- a/website_code/php/management/remove_category.php +++ /dev/null @@ -1,40 +0,0 @@ -database_table_prefix . "syndicationcategories where category_id=\"" . $_POST['remove'] . "\""; - - $query_response = mysql_query($query); - - echo "

Add a new category

"; - - echo "

The new category is

"; - echo "

"; - - echo "

Manage existing categories

"; - - $query="select * from " . $xerte_toolkits_site->database_table_prefix . "syndicationcategories"; - - $query_response = mysql_query($query); - - while($row = mysql_fetch_array($query_response)){ - - echo "

" . $row['category_name'] . " - Remove

"; - - } - - -}else{ - - echo "the feature is for administrators only"; - -} - -?> \ No newline at end of file diff --git a/website_code/php/management/remove_license.php b/website_code/php/management/remove_license.php deleted file mode 100644 index 64a93e979a..0000000000 --- a/website_code/php/management/remove_license.php +++ /dev/null @@ -1,40 +0,0 @@ -database_table_prefix . "syndicationlicenses where license_id=\"" . $_POST['remove'] . "\""; - - $query_response = mysql_query($query); - - $query="select * from " . $xerte_toolkits_site->database_table_prefix . "syndicationlicenses"; - - echo "

Add a new license

"; - - echo "

The new license is

"; - echo "

"; - - echo "

Manage existing licenses

"; - - $query_response = mysql_query($query); - - while($row = mysql_fetch_array($query_response)){ - - echo "

" . $row['license_name'] . " - Remove

"; - - } - - -}else{ - - echo "the feature is for administrators only"; - -} - -?> \ No newline at end of file diff --git a/website_code/php/management/remove_play_security.php b/website_code/php/management/remove_play_security.php deleted file mode 100644 index a920f66cbe..0000000000 --- a/website_code/php/management/remove_play_security.php +++ /dev/null @@ -1,45 +0,0 @@ -database_table_prefix . "play_security_details where security_id=\"" . $_POST['play_id'] . "\""; - - mysql_query($query); - - echo "

Add a new setting

"; - - echo "

The security setting's name is

"; - echo "

The security data is

"; - echo "

The security info is

"; - echo "

"; - - echo "

Manage existing settings

"; - - $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); - - while($row_security = mysql_fetch_array($query_for_play_security_response)){ - - echo "

" . $row_security['security_setting'] . " View

"; - - echo "

The security setting is

"; - echo "

The security data is

"; - echo "

The security info is

"; - - echo "

Remove this setting. In removing a setting all content with this option will be set to Private. You should inform your users of this change first.

"; - - } - - -}else{ - - echo "the feature is for administrators only"; - -} - -?> \ No newline at end of file diff --git a/website_code/php/management/site.php b/website_code/php/management/site.php deleted file mode 100644 index 01cecb8b80..0000000000 --- a/website_code/php/management/site.php +++ /dev/null @@ -1,176 +0,0 @@ -database_table_prefix . "sitedetails"; - - $query_response = mysql_query($query); - - $row = mysql_fetch_array($query_response); - - echo "

Site settings (HTML / Images) View

"; - - echo "

The site url is (This is the URL of the site - changing this will not change the URL)

"; - - echo "

The site title is (This is the HTML title tag content)

"; - - echo "

The site name is (This is part of index.php and the RSS and Syndication feeds)

"; - - echo "

The site logo is (The logo in the top left)

"; - - echo "

The organisational logo is (The logo in the top right)

"; - - echo "

The Welcome message is (The text above the tools on index.php)

"; - - echo "

The site text is (The text to the right of the tools on index.php)

"; - - echo "

The news text is (The second pod under the login pod on index.php)

"; - - echo "

The content of pod one is (The first pod underneath the file area on the logged in page)

"; - - echo "

The content of pod two is (The second pod underneath the file area on the logged in page)

"; - - echo "

The copyright message is

"; - - echo "

The demonstration page URL is

"; - - echo "

The form string is (The code to handle the HTML format for the login box)

"; - - echo "

The Peer form string is (The code to handle the HTML format for the peer review login box)

"; - - echo "

The site's feedback list is (A semi-colon separated list of email addresses to receive feedback from the feedback page)

"; - - echo "
"; - - echo "

Server Settings View

"; - - echo "

The HTACCESS setting is (Whether or not you are using a .htaccess file on the site)

-

"; - - echo "

The PHP session name is

-

"; - - echo "

The allowed upload types for the Media and quota page are

-

"; - echo "

The integration config path is

-

"; - - echo "

The admin username is

-

"; - - echo "

The admin password is

-

"; - - echo "
"; - - echo "

RSS settings View

"; - - echo "

The RSS Feed title is

"; - - echo "

The institutional publisher as listed in the syndication feed is

"; - - echo "

The standard syndication rights for the syndicated content are

"; - - echo "

The standard syndication license for the syndicated content is

"; - - echo "
"; - - echo "

Path settings View

"; - - echo "

The module path is

"; - - echo "

The website code path is

"; - - echo "

The short file area path is

"; - - echo "

The php library path is

"; - - echo "

The root file path is

"; - - echo "

The import path is

"; - - echo "
"; - - echo "

SQL query settings View

"; - - echo "

The play edit preview query is

"; - - echo "
"; - - echo "

Error handling settings View

"; - - echo "

The email error list is (Accounts to receive email messages from the error logger)

"; - - echo "

The error log message is (Set to true to log errors)

"; - - echo "

The email error message is (Set to true to email errors)

"; - - echo "

The maximum error size is (The maximum number of entries per error log)

"; - - echo "
"; - - echo "

LDAP settings View

"; - - echo "

You can set up multiple hosts by separating entries in each of these fields with the $$$ string as a delimiter

"; - - echo "

The ldap host is

"; - - echo "

The ldap port is

"; - - echo "

The ldap password is

"; - - echo "

The ldap base is

"; - - echo "

The ldap bind is

"; - - echo "

The LDAP main filter is

-

"; - - echo "

The LDAP second filter is

-

"; - - echo "
"; - - echo "

Xerte Settings View

"; - - echo "

The flash save path is

"; - - echo "

The flash upload path is

"; - - echo "

The flash preview check path is

"; - - echo "

The flash flv skin is

"; - - echo "
"; - - echo "

Email View

"; - - echo "

The site email account is

"; - - echo "

The site email headers is (use the * symbol to represent a new line)

"; - - echo "

The site email to add to username is

"; - - echo "

The site's proxy host is

"; - - echo "

The site's proxy port is

"; - - echo "

By directly editing the rss proxy.php file (in the root folder), you can add up to 4 proxys and ports should you wish.

"; - - echo "
"; - -}else{ - - echo "the feature is for administrators only"; - -} - -?> \ No newline at end of file diff --git a/website_code/php/management/site_details_management.php b/website_code/php/management/site_details_management.php deleted file mode 100644 index 9308891c0a..0000000000 --- a/website_code/php/management/site_details_management.php +++ /dev/null @@ -1,27 +0,0 @@ -database_table_prefix . "sitedetails set site_url=\"" . $_POST['site_url'] . "\",site_title=\"" . $_POST['site_title'] . "\",site_name=\"" . $_POST['site_name'] . "\",site_logo=\"" . $_POST['site_logo'] . "\",organisational_logo=\"" . $_POST['organisational_logo'] . "\",welcome_message=\"" . $_POST['welcome_message'] . "\",site_text=\"" . $_POST['site_text'] . "\",news_text=\"" . base64_encode(stripcslashes($_POST['news_text'])) . "\",pod_one=\"" . base64_encode(stripcslashes($_POST['pod_one'])) . "\",pod_two=\"" . base64_encode(stripcslashes($_POST['pod_two'])) . "\",copyright=\"" . $copyright . "\",demonstration_page=\"" . $_POST['demonstration_page'] . "\",form_string=\"" . base64_encode(stripcslashes($_POST['form_string'])) . "\",peer_form_string=\"" . base64_encode(stripcslashes($_POST['peer_form_string'])) . "\",feedback_list=\"" . $_POST['feedback_list'] . "\",rss_title=\"" . $_POST['rss_title'] . "\",module_path=\"" . $_POST['module_path'] . "\",website_code_path=\"" . $_POST['website_code_path'] . "\",users_file_area_short=\"" . $_POST['users_file_area_short'] . "\",php_library_path=\"" . $_POST['php_library_path'] . "\",root_file_path=\"" . $_POST['root_file_path'] . "\",play_edit_preview_query=\"" . base64_encode(stripcslashes($_POST['play_edit_preview_query'])) . "\",email_error_list=\"" . $_POST['email_error_list'] . "\",error_log_message=\"" . $_POST['error_log_message'] . "\",error_email_message=\"" . $_POST['error_email_message'] . "\",ldap_host=\"" . $_POST['ldap_host'] . "\",ldap_port=\"" . $_POST['ldap_port'] . "\",bind_pwd=\"" . $_POST['bind_pwd'] . "\",basedn=\"" . $_POST['base_dn'] . "\",bind_dn=\"" . $_POST['bind_dn'] . "\",flash_save_path=\"" . $_POST['flash_save_path'] . "\",flash_upload_path=\"" . $_POST['flash_upload_path'] . "\",flash_preview_check_path=\"" . $_POST['flash_preview_check_path'] . "\",flash_flv_skin=\"" . $_POST['flash_flv_skin'] . "\",site_email_account=\"" . $_POST['site_email_account'] . "\",headers=\"" . $_POST['headers'] . "\",email_to_add_to_username=\"" . $_POST['email_to_add_to_username'] . "\",proxy1=\"" . $_POST['proxy1'] . "\",port1=\"" . $_POST['port1'] . "\",site_session_name=\"" . $_POST['site_session_name'] . "\",synd_publisher=\"" . $_POST['synd_publisher'] . "\",synd_rights=\"" . $_POST['synd_rights'] . "\",synd_license=\"" . $_POST['synd_license'] . "\",import_path=\"" . $_POST['import_path'] . "\",apache=\"" . $_POST['apache'] . "\",mimetypes=\"" . $_POST['mimetypes'] . "\",LDAP_preference=\"" . $_POST['LDAP_preference'] . "\",LDAP_filter=\"" . $_POST['LDAP_filter'] . "\",integration_config_path=\"" . $_POST['integration_config_path'] . "\",admin_username=\"" . $_POST['admin_username'] . "\",admin_password=\"" . $_POST['admin_password'] . "\""; - - if(mysql_query($query)){ - - echo "Template changes made"; - - }else{ - - echo "Template changes failed"; - - } - -} - -?> \ No newline at end of file diff --git a/website_code/php/management/syndication.php b/website_code/php/management/syndication.php deleted file mode 100644 index d6b7c5407c..0000000000 --- a/website_code/php/management/syndication.php +++ /dev/null @@ -1,48 +0,0 @@ -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\")"; - - $query_response = mysql_query($query); - - while($row = mysql_fetch_array($query_response)){ - - echo "

" . $row['template_name']; - - if($row['rss']=="true"){ - - echo " - Remove from RSS "; - - } - - if($row['export']=="true"){ - - echo " - Remove from Export "; - - } - - if($row['syndication']=="true"){ - - echo " - Remove from Syndication "; - - } - - } - - -}else{ - - echo "the feature is for administrators only"; - -} - -?> - diff --git a/website_code/php/management/syndication_remove.php b/website_code/php/management/syndication_remove.php deleted file mode 100644 index 5357d6c114..0000000000 --- a/website_code/php/management/syndication_remove.php +++ /dev/null @@ -1,74 +0,0 @@ -database_table_prefix . "templatesyndication set rss=\"false\" where template_id =\"" . $_POST['template_id'] . "\""; - - } - - if($_POST['export']!=""){ - - $query="update " . $xerte_toolkits_site->database_table_prefix . "templatesyndication set export=\"false\" where template_id =\"" . $_POST['template_id'] . "\""; - } - - if($_POST['synd']!=""){ - - $query="update " . $xerte_toolkits_site->database_table_prefix . "templatesyndication set syndication=\"false\" where template_id =\"" . $_POST['template_id'] . "\""; - - } - - $query_response = mysql_query($query); - - $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\")"; - - $query_response = mysql_query($query); - - if(mysql_num_rows($query_response)!=0){ - - while($row = mysql_fetch_array($query_response)){ - - echo "

" . $row['template_name']; - - if($row['rss']=="true"){ - - echo " - Remove from RSS "; - - } - - if($row['export']=="true"){ - - echo " - Remove from Export "; - - } - - if($row['syndication']=="true"){ - - echo " - Remove from Syndication "; - - } - - } - - }else{ - - echo "

No content in feeds

"; - - } - - -}else{ - - echo "the feature is for administrators only"; - -} - -?> \ No newline at end of file diff --git a/website_code/php/management/template_details_management.php b/website_code/php/management/template_details_management.php deleted file mode 100644 index 7b6911b6c2..0000000000 --- a/website_code/php/management/template_details_management.php +++ /dev/null @@ -1,38 +0,0 @@ -database_table_prefix . "originaltemplatesdetails set description=\"" . $_POST['desc'] . "\", display_name =\"" . $_POST['display'] . "\", display_id =\"" . $_POST['example'] . "\", access_rights=\"" . $_POST['access'] . "\", active=\""; - - if($_POST['active']==true){ - - $query.= "1"; - }else{ - - $query.= "0"; - - } - - $query .= "\" where template_type_id =\"" . $_POST['template_id'] . "\""; - - echo $query; - - if(mysql_query($query)){ - - echo "Template changes made"; - - }else{ - - echo "Template changes failed"; - - } - -} - -?> \ No newline at end of file diff --git a/website_code/php/management/templates.php b/website_code/php/management/templates.php deleted file mode 100644 index 6104f6478d..0000000000 --- a/website_code/php/management/templates.php +++ /dev/null @@ -1,70 +0,0 @@ -database_table_prefix . "originaltemplatesdetails"; - - $query_response = mysql_query($query); - - echo "

Upload a template


"; - - echo "

Manage Existing templates

"; - - while($row = mysql_fetch_array($query_response)){ - - echo "

" . $row['template_name'] . " View

"; - echo "

This template is of type " . $row['template_framework'] . "

"; - - if($row['template_framework']=="xerte"){ - - $template_check = file_get_contents($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . "xerte/parent_templates/" . $row['template_name'] . "/" . $row['template_name'] . ".rlt"); - - $folder = explode('"',substr($template_check,strpos($template_check,"targetFolder"),strpos($template_check,"version")-strpos($template_check,"targetFolder"))); - - $start_point = strpos($template_check,"version"); - - $version = explode('"',substr($template_check,$start_point,strpos($template_check," ",$start_point)-$start_point)); - - echo "

This template is version number " . $version[1] . "

"; - - } - - echo "

The description for this template is

"; - echo "

This template was uploaded on " . $row['date_uploaded'] . "

"; - echo "

The template has the following name for users

"; - echo "

The template has the following example (0 means no example)

"; - echo "

The following users can access this template (* means everyone)

"; - echo "

This template is currently set as "; - - echo "

"; - - }else{ - - echo " SelectedItem=\"true\" name=\"type\" id=\"" . $row['template_type_id'] . "active\" >

"; - - } - - echo "

Upload a new version of this template


"; - - echo "
"; - - } - -}else{ - - echo "the feature is for administrators only"; - -} - -?> \ No newline at end of file diff --git a/website_code/php/management/user_details_management.php b/website_code/php/management/user_details_management.php deleted file mode 100644 index 779773f5f0..0000000000 --- a/website_code/php/management/user_details_management.php +++ /dev/null @@ -1,30 +0,0 @@ -database_table_prefix . "logindetails set firstname=\"" . $_POST['firstname'] . "\", surname=\"" . $_POST['surname'] . "\", username =\"" . $_POST['username'] . "\""; - - $query .= " where login_id =\"" . $_POST['user_id'] . "\""; - - echo $query; - - if(mysql_query($query)){ - - echo "Template changes made"; - - }else{ - - echo "Template changes failed"; - - } - -} - -?> \ No newline at end of file diff --git a/website_code/php/management/user_templates.php b/website_code/php/management/user_templates.php deleted file mode 100644 index 4cf85ae69a..0000000000 --- a/website_code/php/management/user_templates.php +++ /dev/null @@ -1,59 +0,0 @@ -database_table_prefix . "logindetails"; - - $query_response = mysql_query($query); - - while($row = mysql_fetch_array($query_response)){ - - echo "

" . $row['firstname'] . " " . $row['surname'] . " View

"; - - $query_templates="select * from " . $xerte_toolkits_site->database_table_prefix . "templatedetails," . $xerte_toolkits_site->database_table_prefix . "templaterights where " . $xerte_toolkits_site->database_table_prefix . "templaterights.user_id =\"" . $row['login_id'] . "\" and " . $xerte_toolkits_site->database_table_prefix . "templaterights.template_id = " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_id"; - - $query_templates_response = mysql_query($query_templates); - - if(mysql_num_rows($query_templates_response)!=0){ - - while($row_templates = mysql_fetch_array($query_templates_response)){ - - echo "

" . $row_templates['template_name'] . " View

"; - - echo "

The template id is " . $row_templates['template_id'] . "

"; - echo "

The date created was " . $row_templates['date_created'] . "

"; - echo "

The date modified was " . $row_templates['date_modified'] . "

"; - echo "

The date accessed was " . $row_templates['date_accessed'] . "

"; - echo "

The number of plays is " . $row_templates['number_of_uses'] . "

"; - echo "

Access for this is set as " . $row_templates['access_to_whom'] . "

"; - echo "

Edit - Preview - Properties

"; - - echo "
"; - - } - - }else{ - - echo "

This user has no templates at present

"; - - } - - echo "
"; - - } - -}else{ - - echo "the feature is for administrators only"; - -} - -?> \ No newline at end of file diff --git a/website_code/php/management/users.php b/website_code/php/management/users.php deleted file mode 100644 index 9ee0b93b71..0000000000 --- a/website_code/php/management/users.php +++ /dev/null @@ -1,34 +0,0 @@ -database_table_prefix . "logindetails"; - - $query_response = mysql_query($query); - - while($row = mysql_fetch_array($query_response)){ - - echo "

" . $row['firstname'] . " " . $row['surname'] . " View

"; - - echo "

The user's ID is

"; - echo "

The user's first name is

"; - echo "

The user's surname is

"; - echo "

The user's username is

"; - echo "
"; - - } - -}else{ - - echo "the feature is for administrators only"; - -} - -?> \ No newline at end of file diff --git a/website_code/php/peer/peer_review.php b/website_code/php/peer/peer_review.php deleted file mode 100644 index 4464187c63..0000000000 --- a/website_code/php/peer/peer_review.php +++ /dev/null @@ -1,39 +0,0 @@ -database_table_prefix . "templatedetails where template_id =\"" . mysql_real_escape_string($_POST['template_id']) . "\""; - - $query_response = mysql_query($query_for_file_name); - - $row_template_name = mysql_fetch_array($query_response); - - $headers = str_replace("*","\n",$xerte_toolkits_site->headers); - - if(isset($_POST['user'])){ - - if(mail( $_POST['user'] . "@" . $xerte_toolkits_site->email_to_add_to_username, "Feedback on project - \"" . str_replace("_"," ",$row_template_name['template_name']) ."\"", "Hello,

You've received feedback on your project.


" . $_POST['feedback'] . "


Thanks for using the site

The Xerte Project Team", $headers)){ - - echo "Your feedback has been sent to the user"; - - }else{ - - echo "A problem has occured."; - - } - - } - -?> \ No newline at end of file diff --git a/website_code/php/properties/access_change_template.php b/website_code/php/properties/access_change_template.php deleted file mode 100644 index c9f20545f4..0000000000 --- a/website_code/php/properties/access_change_template.php +++ /dev/null @@ -1,164 +0,0 @@ -database_table_prefix . "templatedetails SET access_to_whom =\"" . mysql_real_escape_string($_POST['access']) . "-" . mysql_real_escape_string($_POST['server_string']) . "\" WHERE template_id =\"" . mysql_real_escape_string($_POST['template_id']) . "\""; - - }else{ - - $query = "update " . $xerte_toolkits_site->database_table_prefix . "templatedetails SET access_to_whom =\"" . mysql_real_escape_string($_POST['access']) . "\" WHERE template_id =\"" . mysql_real_escape_string($_POST['template_id']) . "\""; - - } - - if(mysql_query($query)){ - - /* - * Set the header paragraph to reflect the change - */ - - if(isset($_POST['server_string'])){ - - echo "

This file is currently set as " . $_POST['access'] . "-" . $_POST['server_string'] . "

"; - - }else{ - - echo "

This file is currently set as " . $_POST['access'] . "

"; - - } - - echo "
"; - - if(template_share_status("Public")){ - - echo "

"; - - }else{ - - echo "

"; - - } - - echo " Public

The template will be visible to anyone on the internet

"; - - - if(template_share_status("Password")){ - - echo "

"; - - }else{ - - echo "

"; - - } - - echo " Password protected

The template will be visible to people with University account

"; - - - if(template_share_status("Other")){ - - echo "

"; - - }else{ - - echo "

"; - - } - - echo " Other

Using this setting restricts access to your content. Your content will only be visible to people following links to your content from the site you provide. Enter the site URL below.

"; - - if(template_share_status("Private")){ - - echo "

"; - - }else{ - - echo "

"; - - } - - echo " Private

This makes your template visible to editors only.

"; - - /* - * Display extra settings - */ - - $query_for_security_content = "select * from " . $xerte_toolkits_site->database_table_prefix . "play_security_details"; - - $query_for_security_content_response = mysql_query($query_for_security_content); - - 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 "

"; - - }else{ - - echo "

"; - - } - - echo " " . $row_security['security_setting'] . "

" . $row_security['security_info'] . "

"; - - } - - } - - echo "
"; - - echo "

"; - - }else{ - - } - - mysql_close($database_id); - -?> \ No newline at end of file diff --git a/website_code/php/properties/access_template.php b/website_code/php/properties/access_template.php deleted file mode 100644 index ec1fbc3a6f..0000000000 --- a/website_code/php/properties/access_template.php +++ /dev/null @@ -1,159 +0,0 @@ -database_table_prefix . "templatedetails where template_id=" . mysql_real_escape_string($_POST['template_id']); - - $query_access_response = mysql_db_query($xerte_toolkits_site->database_name, $query_for_template_access); - - $row_access = mysql_fetch_array($query_access_response); - - echo "

This file is currently set as " . str_replace("-", " - ", $row_access['access_to_whom']) . "

"; - - echo "
"; - - if(template_share_status("Public")){ - - echo "

"; - - }else{ - - echo "

"; - - } - - echo " Public

The template will be visible to anyone on the internet

"; - - if(template_share_status("Password")){ - - echo "

"; - }else{ - - echo "

"; - } - - echo " Password protected

The template will be visible to people with University account

"; - - - if(template_share_status("Other")){ - - echo "

"; - - }else{ - - echo "

"; - - } - - echo " Other

Using this setting restricts access to your content. Your content will only be visible to people following links to your content from the site you provide. Enter the site URL below.

"; - - if(template_share_status("Private")){ - - echo "

"; - - }else{ - - echo "

"; - } - - echo " Private

This makes your template visible to editors only.

"; - - $query_for_security_content = "select * from " . $xerte_toolkits_site->database_table_prefix . "play_security_details"; - - $query_for_security_content_response = mysql_query($query_for_security_content); - - 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 "

"; - - }else{ - - echo "

"; - - } - - echo " " . $row_security['security_setting'] . "

" . $row_security['security_info'] . "

"; - - } - - } - - echo "
"; - - echo "

"; - - }else{ - - echo "

Sorry only the creator can set the access settings

"; - - } - - mysql_close($database_connect_id); - -} - -?> \ No newline at end of file diff --git a/website_code/php/properties/delete_file_template.php b/website_code/php/properties/delete_file_template.php deleted file mode 100644 index 2005efa655..0000000000 --- a/website_code/php/properties/delete_file_template.php +++ /dev/null @@ -1,23 +0,0 @@ - \ No newline at end of file diff --git a/website_code/php/properties/export_template.php b/website_code/php/properties/export_template.php deleted file mode 100644 index a81273d43d..0000000000 --- a/website_code/php/properties/export_template.php +++ /dev/null @@ -1,46 +0,0 @@ -Export

"; - - echo "

There are two ways to export a project

"; - - echo "

A zip file export will package (but not delete) your project into one zip file. If you then open this file, the contents can be used to deploy your project on any webpage.

Click on zip export to get your file - Zip export

"; - - echo "

A SCORM 1.2 file export will package (but not delete) your project into one zip file. This zip file can then be imported by most VLEs to become part of an online course. This file will be SCORM 1.2 compliant.

Click on Scorm export to get this package - Scorm export

"; - - }else{ - - echo "

Sorry you do not have rights to this template

"; - - } - -?> - - \ No newline at end of file diff --git a/website_code/php/properties/gift_template.php b/website_code/php/properties/gift_template.php deleted file mode 100644 index 08e06ce44c..0000000000 --- a/website_code/php/properties/gift_template.php +++ /dev/null @@ -1,36 +0,0 @@ -

To give this project to someone, please type their name here

Names will appear here

"; - - }else{ - - echo "

You have no rights to this template

"; - - } - - -?> \ No newline at end of file diff --git a/website_code/php/properties/gift_this_template.php b/website_code/php/properties/gift_this_template.php deleted file mode 100644 index a79dcd5c34..0000000000 --- a/website_code/php/properties/gift_this_template.php +++ /dev/null @@ -1,185 +0,0 @@ -database_table_prefix . "logindetails, " . $xerte_toolkits_site->database_table_prefix . "templatedetails, " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails where " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_type_id = " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails.template_type_id and template_id =\"" . $tutorial_id . "\" and login_id = creator_id"; - - $query_rename_response = mysql_query($query_for_rename); - - $row_rename = mysql_fetch_array($query_rename_response); - - /** - * Update the database - */ - - $query_to_gift = "update " . $xerte_toolkits_site->database_table_prefix . "templatedetails set creator_id = \"" . $user_id . "\" where template_id=\"" . $tutorial_id . "\""; - - mysql_query($query_to_gift); - - $query_for_root_folder = "select folder_id from " . $xerte_toolkits_site->database_table_prefix . "folderdetails where login_id='" . $user_id . "' AND folder_name != 'recyclebin'"; - - $query_response = mysql_query($query_for_root_folder); - - $row_folder = mysql_fetch_array($query_response); - - $query_to_gift = "update " . $xerte_toolkits_site->database_table_prefix . "templaterights set user_id = \"" . $user_id . "\", folder = \"" . $row_folder['folder_id'] . "\" where template_id=\"" . $tutorial_id . "\""; - - mysql_query($query_to_gift); - - $query_for_new_login = "select username from " . $xerte_toolkits_site->database_table_prefix . "logindetails where login_id='" . $user_id . "'"; - - $query_for_new_login_response = mysql_query($query_for_new_login); - - $row_new_login = mysql_fetch_array($query_for_new_login_response); - - $base_path = $xerte_toolkits_site->root_file_path . $xerte_toolkits_site->users_file_area_short; - - /** - * Rename the folder where the template is - */ - - rename($base_path . $tutorial_id . "-" . $row_rename['username'] . "-" . $row_rename['template_name'] . "/", $base_path . $tutorial_id . "-" . $row_new_login['username'] . "-" . $row_rename['template_name'] . "/"); - - echo "

Sorry you no longer have rights to this template

"; - - }else{ - - /** - * Giving away a duplicate - */ - - $database_id=database_connect("Template sharing rights database connect success","Template sharing rights database connect failed"); - - $query_for_currentdetails = "select *," . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_name AS actual_name from " . $xerte_toolkits_site->database_table_prefix . "templatedetails, " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails where template_id=\"" . $tutorial_id . "\" and " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails.template_type_id = " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_type_id"; - - $query_currentdetails_response = mysql_query($query_for_currentdetails); - - $row_currentdetails = mysql_fetch_array($query_currentdetails_response); - - $new_template_id = get_maximum_template_number()+1; - - $query_for_currentdetails = "INSERT INTO " . $xerte_toolkits_site->database_table_prefix . "templatedetails (template_id, creator_id, template_type_id,template_name,date_created,date_modified,date_accessed,number_of_uses,access_to_whom) VALUES (" . $new_template_id . "," . $user_id . ",\"" . $row_currentdetails['template_type_id'] . "\",\"" . $row_currentdetails['actual_name'] . "\",\"" . date('Y-m-d') . "\",\"" . date('Y-m-d') . "\",\"" . date('Y-m-d') . "\",\"0\",\"private\")"; - - mysql_query($query_for_currentdetails); - - $query_for_currentrights = "select * from " . $xerte_toolkits_site->database_table_prefix . "templaterights where template_id =\"" . $tutorial_id . "\""; - - $query_currentrights_response = mysql_query($query_for_currentrights); - - $row_currentrights = mysql_fetch_array($query_currentrights_response); - - $query_for_root_folder = "select folder_id from " . $xerte_toolkits_site->database_table_prefix . "folderdetails where login_id='" . $user_id . "' AND folder_name != 'recyclebin'"; - - $query_response = mysql_query($query_for_root_folder); - - $row_folder = mysql_fetch_array($query_response); - - $query_for_currentdetails = "INSERT INTO " . $xerte_toolkits_site->database_table_prefix . "templaterights (template_id, user_id, role,folder,notes) VALUES (" . $new_template_id . "," . $user_id . ",\"creator\",\"" . $row_folder['folder_id'] . "\",\" \")"; - - mysql_query($query_for_currentdetails); - - $query_for_new_login = "select firstname, surname, username from " . $xerte_toolkits_site->database_table_prefix . "logindetails where login_id='" . $user_id . "'"; - - $query_for_new_login_response = mysql_query($query_for_new_login); - - $row_new_login = mysql_fetch_array($query_for_new_login_response); - - $new_directory = $xerte_toolkits_site->root_file_path . $xerte_toolkits_site->users_file_area_short . $new_template_id . "-" . $row_new_login['username'] . "-" . $row_currentdetails['template_name'] . "/"; - - mkdir($new_directory); - - chmod($new_directory,0777); - - mkdir($new_directory . "media/"); - - chmod($new_directory . "media/" ,0777); - - $current_directory = $xerte_toolkits_site->root_file_path . $xerte_toolkits_site->users_file_area_short . $tutorial_id . "-" . $_SESSION['toolkits_logon_username'] . "-" . $row_currentdetails['template_name'] . "/"; - - copy_loop($current_directory, $new_directory); - - echo "

Template successfully gifted to " . $row_new_login['firstname'] . " " . $row_new_login['surname'] . ".

To give this project to someone, please type their name here

Names will appear here

"; - - } - - } - -?> \ No newline at end of file diff --git a/website_code/php/properties/media_and_quota_template.php b/website_code/php/properties/media_and_quota_template.php deleted file mode 100644 index d767e15f78..0000000000 --- a/website_code/php/properties/media_and_quota_template.php +++ /dev/null @@ -1,166 +0,0 @@ -site_url . str_replace($xerte_toolkits_site->root_file_path,"",$dir_path) . "/" . $f . "'\">" . $f . "
" . substr((filesize($full)/1000000),0,4) . " MB
In use "; - }else{ - $result = "
site_url . str_replace($xerte_toolkits_site->root_file_path,"",$dir_path) . "/" . $f . "'\">" . $f . "
" . substr((filesize($full)/1000000),0,4) . " MB
Not in use \"Click
"; - - /** - * add the files to the delete array that are not in use so they can be listed for use in the delete function - */ - - array_push($delete_string,$f); - - } - $quota += filesize($full); - } - - array_push($result_string,$result); - $result=""; - - } - -} - -database_connect("Media and quota template database connect success","Media and quota template database connect failed"); - -if(is_numeric($_POST['template_id'])){ - - if(has_rights_to_this_template(mysql_real_escape_string($_POST['template_id']), $_SESSION['toolkits_logon_id'])||is_user_admin()){ - - $query_for_path = "select " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails.template_name, " . $xerte_toolkits_site->database_table_prefix . "templaterights.folder, " . $xerte_toolkits_site->database_table_prefix . "logindetails.username from " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails, " . $xerte_toolkits_site->database_table_prefix . "templatedetails, " . $xerte_toolkits_site->database_table_prefix . "templaterights, " . $xerte_toolkits_site->database_table_prefix . "logindetails where " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails.template_type_id = " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_type_id and " . $xerte_toolkits_site->database_table_prefix . "templaterights.template_id = " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_id and " . $xerte_toolkits_site->database_table_prefix . "templatedetails.creator_id = " . $xerte_toolkits_site->database_table_prefix . "logindetails.login_id and " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_id =\"" . mysql_real_escape_string($_POST['template_id']) . "\" and role=\"creator\""; - - $query_for_path_response = mysql_query($query_for_path); - - $row_path = mysql_fetch_array($query_for_path_response); - - $end_of_path = $_POST['template_id'] . "-" . $row_path['username'] . "-" . $row_path['template_name']; - - /** - * Set the paths - */ - - $dir_path = $xerte_toolkits_site->users_file_area_full . $end_of_path . "/media"; - - $xmlpath = $xerte_toolkits_site->users_file_area_full . $end_of_path . "/data.xml"; - - $previewpath = $xerte_toolkits_site->users_file_area_full . $end_of_path . "/preview.xml"; - - $quota = filesize($xerte_toolkits_site->users_file_area_full . $end_of_path . "/data.xml") + filesize($xerte_toolkits_site->users_file_area_full . $end_of_path . "/preview.xml"); - - $d = opendir($dir_path); - - media_folder_loop($d); - - echo "

This project is currently using " . substr(($quota/1000000),0,4) . " MB

"; - - echo "

Import



Click on a file name and a link will appear below

"; - - echo "
"; - - /** - * display the first string - */ - - while($y=array_pop($result_string)){ - - echo $y; - - } - - //echo "
"; - - /** - * display the list of files that are not in use so they can be deleted. - */ - - //while($y=array_pop($delete_string)){ - - // echo "

Click to delete the unused file " . $y . "

"; - - //} - - //echo "
"; - - echo "
"; - - }else{ - - echo "

Sorry you do not have rights to this template

"; - - - } - -} - -?> \ No newline at end of file diff --git a/website_code/php/properties/name_select_gift_template.php b/website_code/php/properties/name_select_gift_template.php deleted file mode 100644 index f4fc293a1b..0000000000 --- a/website_code/php/properties/name_select_gift_template.php +++ /dev/null @@ -1,52 +0,0 @@ -database_table_prefix . "logindetails WHERE ((firstname like '" . $search . "%') or (surname like '" . $search . "%')) and login_id not in( SELECT creator_id from " . $xerte_toolkits_site->database_table_prefix . "templatedetails where template_id=\"" . $tutorial_id . "\" ) ORDER BY firstname ASC"; - - $query_names_response = mysql_query($query_for_names); - - if(mysql_num_rows($query_names_response)!=0){ - - while($row = mysql_fetch_array($query_names_response)){ - - echo "

" . $row['firstname'] . " " . $row['surname'] . " - click here to give a copy of this template to this user.

"; - - } - - }else{ - - echo "

No one found with those details

"; - - } - - } - - } - -?> \ No newline at end of file diff --git a/website_code/php/properties/name_select_template.php b/website_code/php/properties/name_select_template.php deleted file mode 100644 index e6fe4cc4fb..0000000000 --- a/website_code/php/properties/name_select_template.php +++ /dev/null @@ -1,52 +0,0 @@ -database_table_prefix . "logindetails WHERE ((firstname like '" . $search . "%') or (surname like '" . $search . "%')) and login_id not in( SELECT user_id from " . $xerte_toolkits_site->database_table_prefix . "templaterights where template_id=\"" . $tutorial_id . "\" ) ORDER BY firstname ASC"; - - $query_names_response = mysql_query($query_for_names); - - if(mysql_num_rows($query_names_response)!=0){ - - while($row = mysql_fetch_array($query_names_response)){ - - echo "

" . $row['firstname'] . " " . $row['surname'] . " - click here to add this user

"; - - } - - }else{ - - echo "

No one found with those details

"; - - } - - } - - } - -?> \ No newline at end of file diff --git a/website_code/php/properties/notes_change_template.php b/website_code/php/properties/notes_change_template.php deleted file mode 100644 index 5e79c08808..0000000000 --- a/website_code/php/properties/notes_change_template.php +++ /dev/null @@ -1,38 +0,0 @@ -database_table_prefix . "templaterights SET notes =\"" . mysql_real_escape_string($_POST['notes']) . "\" WHERE template_id =\"" . mysql_real_escape_string($_POST['template_id']) . "\""; - - if(mysql_query($query)){ - - echo "

Project Notes:

"; - - echo "

Notes saved

"; - - }else{ - - } - - mysql_close($database_id); - - } - -?> \ No newline at end of file diff --git a/website_code/php/properties/notes_template.php b/website_code/php/properties/notes_template.php deleted file mode 100644 index 67db18e90c..0000000000 --- a/website_code/php/properties/notes_template.php +++ /dev/null @@ -1,43 +0,0 @@ -database_table_prefix . "templaterights where template_id=" . mysql_real_escape_string($_POST['template_id']); - - $query_notes_response = mysql_query($query_for_template_notes); - - $row_notes = mysql_fetch_array($query_notes_response); - - echo "

Project Notes:

"; - - echo "

"; - - }else{ - - echo "

Sorry only the creator of the file can set notes for the project

"; - - } - - } - -?> diff --git a/website_code/php/properties/peer_change_template.php b/website_code/php/properties/peer_change_template.php deleted file mode 100644 index 17de43769e..0000000000 --- a/website_code/php/properties/peer_change_template.php +++ /dev/null @@ -1,83 +0,0 @@ -database_table_prefix . "additional_sharing where template_id=\"" . mysql_real_escape_string($_POST['template_id']) . "\" AND sharing_type=\"peer\""; - - mysql_query($query); - - }else{ - - $query = "INSERT INTO " . $xerte_toolkits_site->database_table_prefix . "additional_sharing (template_id, sharing_type, extra) VALUES (" . mysql_real_escape_string($_POST['template_id']) . ", \"peer\",\"" . mysql_real_escape_string($_POST['password']) . "\")"; - - mysql_query($query); - - } - - /** - * Update the screen - */ - - echo "

Peer review

"; - - echo "

In this section you can set up the peer review for one of your projects. This allows you to send a password protected link to staff, allowing them to access a project, and then giving them the facility to email you feedback

"; - - $query = "select * from " . $xerte_toolkits_site->database_table_prefix . "additional_sharing where sharing_type=\"peer\" AND template_id =\"" . mysql_real_escape_string($_POST['template_id']) . "\""; - - $query_response = mysql_query($query); - - echo "

Peer review is

"; - - if(mysql_num_rows($query_response)==1){ - - echo "

on

"; - echo "

off

"; - echo "

The link for peer review is site_url . url_return("peerreview", $_POST['template_id']) . "\">" . $xerte_toolkits_site->site_url . url_return("peerreview", $_POST['template_id']) . "

"; - - }else{ - - echo "

on

"; - echo "

off

"; - - } - - $row = mysql_fetch_array($query_response); - - echo "

Password to give to reviewers

Your changes have been saved

"; - - }else{ - - echo "

Sorry, only creators of templates can set up peer review

"; - - } - - mysql_close($database_id); - - } - -?> \ No newline at end of file diff --git a/website_code/php/properties/peer_template.php b/website_code/php/properties/peer_template.php deleted file mode 100644 index f6a2aefa48..0000000000 --- a/website_code/php/properties/peer_template.php +++ /dev/null @@ -1,65 +0,0 @@ -Peer review

"; - - echo "

In this section you can set up the peer review for one of your projects. This allows you to send a password protected link to staff, allowing them to access a project, and then giving them the facility to email you feedback

"; - - $query = "select * from " . $xerte_toolkits_site->database_table_prefix . "additional_sharing where sharing_type=\"peer\" AND template_id =\"" . mysql_real_escape_string($_POST['template_id']) . "\""; - - $query_response = mysql_query($query); - - echo "

Peer review is

"; - - if(mysql_num_rows($query_response)==1){ - - echo "

on

"; - echo "

off

"; - echo "

The link for peer review is site_url . url_return("peerreview", $_POST['template_id']) . "\">" . $xerte_toolkits_site->site_url . url_return("peerreview", $_POST['template_id']) . "

"; - - }else{ - - echo "

on

"; - echo "

off

"; - - } - - $row = mysql_fetch_array($query_response); - - echo "

Password to give to reviewers

"; - - }else{ - - echo "

Sorry, only creators of templates can set up peer review

"; - - } - - mysql_close($database_id); - - } - -?> \ No newline at end of file diff --git a/website_code/php/properties/properties_template.php b/website_code/php/properties/properties_template.php deleted file mode 100644 index 6d1c403bdf..0000000000 --- a/website_code/php/properties/properties_template.php +++ /dev/null @@ -1,78 +0,0 @@ -Project

"; - - $query_for_names = "select template_name, date_created, date_modified from " . $xerte_toolkits_site->database_table_prefix . "templatedetails where template_id=\"". $tutorial_id . "\""; - - $query_names_response = mysql_query($query_for_names); - - $row = mysql_fetch_array($query_names_response); - - if(is_user_creator(mysql_real_escape_string($_POST['template_id']))){ - - $query_for_template_name = "select template_name from " . $xerte_toolkits_site->database_table_prefix . "templatedetails where template_id=" . mysql_real_escape_string($_POST['template_id']); - - $query_name_response = mysql_query($query_for_template_name); - - $row_template_name = mysql_fetch_array($query_name_response); - - echo "

Project name

"; - - echo "
"; - - } - - echo "


This file was created on " . $row['date_created'] . "

"; - - echo "

This file was last modified on " . $row['date_modified'] . "

"; - - echo "

To allow other people to access this file, the link is

"; - - echo "

" . $xerte_toolkits_site->site_url . url_return("play", $_POST['template_id']) . "

"; - - // Get the template screen size - - $query_for_template_name = "select " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails.template_name, " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails.template_framework from " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails, " . $xerte_toolkits_site->database_table_prefix . "templatedetails where " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_type_id = " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails.template_type_id AND template_id =\"" . $tutorial_id . "\""; - - $query_name_response = mysql_query($query_for_template_name); - - $row_name = mysql_fetch_array($query_name_response); - - $temp_string = get_template_screen_size($row_name['template_name'], $row_name['template_framework']); - - $temp_array = explode("~",$temp_string); - - echo "

This code will allow you to embed your project into a web page

"; - - }else{ - - echo "

Sorry you do not have rights to this template

"; - - } - -?> \ No newline at end of file diff --git a/website_code/php/properties/publish.php b/website_code/php/properties/publish.php deleted file mode 100644 index 07d4af4203..0000000000 --- a/website_code/php/properties/publish.php +++ /dev/null @@ -1,111 +0,0 @@ -Project

"; - - $query_for_names = "select template_name, date_created, date_modified from " . $xerte_toolkits_site->database_table_prefix . "templatedetails where template_id=\"". $tutorial_id . "\""; - - $query_names_response = mysql_query($query_for_names); - - $row = mysql_fetch_array($query_names_response); - - echo "

This panel contains all the settings you need to publish your project.

"; - - $template_access = template_access_settings(mysql_real_escape_string($_POST['template_id'])); - - echo "

Access
If you have not published this project before, you must select the appropriate option in the 'Access' tab. This controls how your users can access your content. To set the access options, select the 'Access' tab and follow the instructions.

"; - - if($template_access=="Private"){ - - echo "

Your project is currently private. Click on 'Access' to change this.

"; - - }else{ - - echo "

Your project is currently set as " . $template_access . ".

"; - - } - - echo "

RSS
RSS feeds provide a convenient way for your users to keep up to date with your content. If you'd like to add this project to your RSS feeds, select the 'RSS' tab and follow the instructions.

"; - - if(!is_template_rss(mysql_real_escape_string($_POST['template_id']))){ - - echo "

Your project is not in any RSS feeds.

"; - - }else{ - - echo "

Your project is available in the RSS Feeds.

"; - - } - - echo "

Syndication
Syndicating your content makes it available to the widest possible audience by making it available for harvesting by open-access repositories of content. To syndicate your project, select the 'Syndication' tab and follow the instructions.

"; - - if(!is_template_syndicated(mysql_real_escape_string($_POST['template_id']))){ - - echo "

Your project is not currently syndicated.

"; - - }else{ - - echo "

Your project is currently syndicated.

"; - - } - - if($template_access=="Public"){ - - /** - * - * This section using $_SESSION['webct'] is for people using the integration option for webct. If you integration option has the ability to post back a URL then you would modify this code to allow for your systems working methods. - * - **/ - - - if($_SESSION['webct']=="true"){ - - $url = urlencode($xerte_toolkits_site->site_url . url_return("play",$tutorial_id)); - - echo "

" . str_replace("~~~URL~~~", $url,str_replace("~~~NAME~~~", str_replace("_", " " ,$row['template_name']),$_SESSION['toolkits_webct_url'])) . "

"; - - }else{ - - echo "

"; - - echo "

The web address for this resource is " . $xerte_toolkits_site->site_url . url_return("play",mysql_real_escape_string($_POST['template_id'])) . "

"; - - } - - }else{ - - echo "

"; - - } - - }else{ - - echo "

Sorry you do not have rights to this template

"; - - } - -?> \ No newline at end of file diff --git a/website_code/php/properties/remove_sharing_template.php b/website_code/php/properties/remove_sharing_template.php deleted file mode 100644 index 67c79f1642..0000000000 --- a/website_code/php/properties/remove_sharing_template.php +++ /dev/null @@ -1,32 +0,0 @@ -database_table_prefix . "templaterights where template_id =\"" . $tutorial_id . "\" and user_id=\"" . $user_id . "\""; - - echo "
" . $query_to_delete_share . "
"; - - mysql_query($query_to_delete_share); - -} - -?> \ No newline at end of file diff --git a/website_code/php/properties/rename_template.php b/website_code/php/properties/rename_template.php deleted file mode 100644 index 00cffdd194..0000000000 --- a/website_code/php/properties/rename_template.php +++ /dev/null @@ -1,75 +0,0 @@ -database_table_prefix . "templatedetails SET template_name =\"" . str_replace(" ", "_", mysql_real_escape_string($_POST['template_name'])) . "\" WHERE template_id =\"" . mysql_real_escape_string($_POST['template_id']) . "\""; - - if(mysql_query($query)){ - - $query_for_names = "select template_name, date_created, date_modified from " . $xerte_toolkits_site->database_table_prefix . "templatedetails where template_id=\"". $tutorial_id . "\""; - - $query_names_response = mysql_query($query_for_names); - - $row = mysql_fetch_array($query_names_response); - - echo "~~**~~" . $_POST['template_name'] . "~~**~~"; - - echo "

Project

"; - - echo "

Project Name

"; - - echo "

Project renamed

"; - - echo "

This file was created on " . $row['date_created'] . "

"; - echo "

This file was last modified on " . $row['date_modified'] . "

"; - - echo "

To allow other people to access this file, the link is

"; - - echo "

" . $xerte_toolkits_site->site_url . url_return("play", $_POST['template_id']) . "

"; - - /* - * Get the template screen size for the embed code - */ - - $query_for_template_name = "select " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails.template_name, " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails.template_framework from " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails, " . $xerte_toolkits_site->database_table_prefix . "templatedetails where " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_type_id = " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails.template_type_id AND template_id =\"" . $tutorial_id . "\""; - - $query_name_response = mysql_query($query_for_template_name); - - $row_name = mysql_fetch_array($query_name_response); - - $temp_string = get_template_screen_size($row_name['template_name'], $row_name['template_framework']); - - $temp_array = explode("~",$temp_string); - - echo "

This code will allow you to embed your project into a web page

"; - - - }else{ - - } - - mysql_close($database_id); - -} - -?> \ No newline at end of file diff --git a/website_code/php/properties/rss_change_template.php b/website_code/php/properties/rss_change_template.php deleted file mode 100644 index add5297bc4..0000000000 --- a/website_code/php/properties/rss_change_template.php +++ /dev/null @@ -1,99 +0,0 @@ -database_table_prefix . "templatesyndication where template_id=" . mysql_real_escape_string($_POST['template_id']); - - $query_for_rss_response = mysql_query($query_for_rss_status); - - if(mysql_num_rows($query_for_rss_response)==0){ - - $query_to_change_rss_status = "Insert into " . $xerte_toolkits_site->database_table_prefix . "templatesyndication(template_id,rss,export,description) VALUES (" . mysql_real_escape_string($_POST['template_id']) . ",'" . mysql_real_escape_string($_POST['rss']) . "','" . mysql_real_escape_string($_POST['export']) . "','" . mysql_real_escape_string($_POST['desc']) . "')"; - - }else{ - - $query_to_change_rss_status = "update " . $xerte_toolkits_site->database_table_prefix . "templatesyndication set rss='" . mysql_real_escape_string($_POST['rss']) . "', export='" . mysql_real_escape_string($_POST['export']) . "', description='" . mysql_real_escape_string($_POST['desc']) . "' where template_id=" . mysql_real_escape_string($_POST['template_id']); - - } - - $query_to_change_rss_status = mysql_query($query_to_change_rss_status); - - if(template_access_settings($_POST['template_id'])=="Public"){ - - $query_for_name = "select firstname,surname from " . $xerte_toolkits_site->database_table_prefix . "logindetails where login_id=" . $_SESSION['toolkits_logon_id']; - - $query_for_name_response = mysql_query($query_for_name); - - $row_name = mysql_fetch_array($query_for_name_response); - - echo "

RSS feeds

"; - - if($_POST['rss']=="true"){ - - echo "

Include this project in the RSS Feeds Yes No

"; - - }else{ - - echo "

Include this project in the RSS Feeds Yes No

"; - - } - - if($_POST['export']=="true"){ - - echo "

Include this project in the Export Feed Yes No

"; - - }else{ - - echo "

Include this project in the Export Feed Yes No

"; - - } - - echo "

You can also include a description for your project in the RSS Feed as well



"; - - echo "

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:

"; - - echo "

The main feed is at site_url . url_return("RSS",null) . "\">" . $xerte_toolkits_site->site_url . url_return("RSS",null) . ". This includes all content marked for inclusion from the site's users.

Your own RSS Feed is available at site_url . url_return("RSS_user", ($row_name['firstname'] . "_" . $row_name['surname'])) . "\">" . $xerte_toolkits_site->site_url . url_return("RSS_user", $row_name['firstname'] . "_" . $row_name['surname']) . ". This only includes the content you have marked for inclusion.

"; - - echo "

As you organise content in folders, each folder has it's own RSS feed. This provides a convenient way to include only some of your content in a feed. See the folder properties for more details, and the link to that folder's feed.

"; - - echo "

Including content in the export feed allows other users to download your project and make changes to it themselves.

"; - - - }else{ - - echo "

Please set this project to the 'Public' on the access tab before using the RSS Feed features

"; - - } - - }else{ - - echo "

Sorry only the creator of the file can set notes for the project

"; - - } - -} - -?> \ No newline at end of file diff --git a/website_code/php/properties/rss_template.php b/website_code/php/properties/rss_template.php deleted file mode 100644 index e640ecf967..0000000000 --- a/website_code/php/properties/rss_template.php +++ /dev/null @@ -1,82 +0,0 @@ -database_table_prefix . "logindetails where login_id=" . $_SESSION['toolkits_logon_id']; - - $query_for_name_response = mysql_query($query_for_name); - - $row_name = mysql_fetch_array($query_for_name_response); - - $query_for_rss = "select rss,export,description from " . $xerte_toolkits_site->database_table_prefix . "templatesyndication where template_id=" . mysql_real_escape_string($_POST['tutorial_id']); - - $query_rss_response = mysql_query($query_for_rss); - - $row_rss = mysql_fetch_array($query_rss_response); - - echo "

RSS feeds

"; - - if($row_rss['rss']=="true"){ - - echo "

Include this project in the RSS Feeds Yes No

"; - - }else{ - - echo "

Include this project in the RSS Feeds Yes No

"; - - } - - if($row_rss['export']=="true"){ - - echo "

Include this project in the Export Feed Yes No

"; - - }else{ - - echo "

Include this project in the Export Feed Yes No

"; - - } - - echo "

You can also include a description for your project in the RSS Feed as well



"; - - echo "

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:

"; - - echo "

The main feed is at site_url . url_return("RSS",null) . "\">" . $xerte_toolkits_site->site_url . url_return("RSS",null) . ". This includes all content marked for inclusion from the site's users.

Your own RSS Feed is available at site_url . url_return("RSS_user", ($row_name['firstname'] . "_" . $row_name['surname'])) . "\">" . $xerte_toolkits_site->site_url . url_return("RSS_user", $row_name['firstname'] . "_" . $row_name['surname']) . ". This only includes the content you have marked for inclusion.

"; - - echo "

As you organise content in folders, each folder has it's own RSS feed. This provides a convenient way to include only some of your content in a feed. See the folder properties for more details, and the link to that folder's feed.

"; - - echo "

Including content in the export feed allows other users to download your project and make changes to it themselves.

"; - - - }else{ - - echo "

Please set this project to the 'Public' on the access tab before using the RSS Feed features

"; - - } - - - }else{ - - echo "

Sorry only the creator of the file can set notes for the project

"; - - } - -?> \ No newline at end of file diff --git a/website_code/php/properties/screen_size_template.php b/website_code/php/properties/screen_size_template.php deleted file mode 100644 index 8864996cdf..0000000000 --- a/website_code/php/properties/screen_size_template.php +++ /dev/null @@ -1,32 +0,0 @@ -database_table_prefix . "originaltemplatesdetails.template_name, " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails.template_framework from " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails, " . $xerte_toolkits_site->database_table_prefix . "templatedetails where " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_type_id = " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails.template_type_id AND template_id =\"" . mysql_real_escape_string($_POST['tutorial_id']) . "\""; - - $query_name_response = mysql_query($query_for_template_name); - - $row_name = mysql_fetch_array($query_name_response); - - echo get_template_screen_size($row_name['template_name'], $row_name['template_framework']) . "~" . mysql_real_escape_string($_POST['tutorial_id']); - -} - -?> \ No newline at end of file diff --git a/website_code/php/properties/set_sharing_rights_template.php b/website_code/php/properties/set_sharing_rights_template.php deleted file mode 100644 index 8f40e9d94a..0000000000 --- a/website_code/php/properties/set_sharing_rights_template.php +++ /dev/null @@ -1,33 +0,0 @@ -database_table_prefix . "templaterights set role = \"" . $new_rights . "\" where template_id=\"" . $tutorial_id . "\" and user_id=\"" . $user_id . "\""; - - mysql_query($query_to_change_share_rights); - -} - -?> \ No newline at end of file diff --git a/website_code/php/properties/share_this_template.php b/website_code/php/properties/share_this_template.php deleted file mode 100644 index da911a66fc..0000000000 --- a/website_code/php/properties/share_this_template.php +++ /dev/null @@ -1,58 +0,0 @@ -database_table_prefix . "folderdetails where login_id =\"" . $user_id . "\" and folder_parent=\"0\" and folder_name!=\"recyclebin\""; - - $query_to_find_out_root_folder_response = mysql_query($query_to_find_out_root_folder); - - $row_query_root = mysql_fetch_array($query_to_find_out_root_folder_response); - - $query_to_insert_share = "INSERT INTO " . $xerte_toolkits_site->database_table_prefix . "templaterights (template_id, user_id, role, folder) VALUES (" . $tutorial_id . "," . $user_id . ",\"editor\",". $row_query_root['folder_id'] . ")"; - - if(mysql_query($query_to_insert_share)){ - - /** - * sort ouf the html to return to the screen - */ - - $query_for_name = "select firstname, surname from " . $xerte_toolkits_site->database_table_prefix . "logindetails WHERE login_id=\"" . $user_id . "\""; - - $query_name_response = mysql_query($query_for_name); - - $row = mysql_fetch_array($query_name_response); - - echo "Template successfully shared with " . $row['firstname'] . " " . $row['surname'] . "
"; - - }else{ - - echo "Sharing failed
"; - - } - -} - -?> \ No newline at end of file diff --git a/website_code/php/properties/sharing_status_template.php b/website_code/php/properties/sharing_status_template.php deleted file mode 100644 index 80d49267bc..0000000000 --- a/website_code/php/properties/sharing_status_template.php +++ /dev/null @@ -1,108 +0,0 @@ -database_table_prefix . "templaterights, " . $xerte_toolkits_site->database_table_prefix . "logindetails where " . $xerte_toolkits_site->database_table_prefix . "logindetails.login_id = " . $xerte_toolkits_site->database_table_prefix . "templaterights.user_id and template_id=\"" . mysql_real_escape_string($_POST['template_id']) . "\" and user_id !=\"" . $_SESSION['toolkits_logon_id'] . "\""; - - $query_sharing_response = mysql_query($query_for_sharing_details); - - /* - * show a different view if you are the file creator - */ - - if(is_user_creator(mysql_real_escape_string($_POST['template_id']))){ - - echo "

To share this template with some one, please type their name here

Names will appear here

"; - - } - - /* - * find out how many times it has been shares (analgous to number of rows for this template) - */ - - if(mysql_num_rows($query_sharing_response)!=0){ - - echo "

This template is currently shared with :

"; - - while($row = mysql_fetch_array($query_sharing_response)){ - - echo "

" . $row['firstname'] . " " . $row['surname'] . " (" . $row['role'] . ")

"; - - if($row['role']!="creator"){ - - if(is_user_creator(mysql_real_escape_string($_POST['template_id']))){ - - echo "

"; - - if($row['role']=="editor"){ - - echo " Editor"; - - }else{ - - echo " Editor"; - - } - - if($row['role']=="read-only"){ - - echo " Read only"; - - }else{ - - echo " Read only"; - } - - echo ""; - - echo "

"; - - echo "

"; - - } - - } - - } - - if(!is_user_creator(mysql_real_escape_string($_POST['template_id']))&&!is_user_admin()){ - - echo "

Click to stop sharing this file

"; - - } - - }else{ - - echo "

This template is not shared"; - - } - - }else{ - - echo "

You have no rights to this template

"; - - } - -} - -?> \ No newline at end of file diff --git a/website_code/php/properties/syndication_change_template.php b/website_code/php/properties/syndication_change_template.php deleted file mode 100644 index 04c39d7648..0000000000 --- a/website_code/php/properties/syndication_change_template.php +++ /dev/null @@ -1,132 +0,0 @@ -database_table_prefix . "templatesyndication where template_id=" . mysql_real_escape_string($_POST['tutorial_id']); - - $query_for_syndication_response = mysql_query($query_for_syndication_status); - - if(mysql_num_rows($query_for_syndication_response)==0){ - - $query_to_change_syndication_status = "Insert into " . $xerte_toolkits_site->database_table_prefix . "templatesyndication(template_id,syndication,keywords,description,category,license) VALUES (" . mysql_real_escape_string($_POST['tutorial_id']) . ",'" . mysql_real_escape_string($_POST['synd']) . "','" . mysql_real_escape_string($_POST['keywords']) . "','" . mysql_real_escape_string($_POST['desc']) . "','" . mysql_real_escape_string($_POST['category_value']) . "','" . mysql_real_escape_string($_POST['license_value']) . "')"; - - }else{ - - $query_to_change_syndication_status = "update " . $xerte_toolkits_site->database_table_prefix . "templatesyndication set syndication='" . mysql_real_escape_string($_POST['synd']) . "', keywords='" . mysql_real_escape_string($_POST['keywords']) . "', description='" . mysql_real_escape_string($_POST['description']) . "', category='" . mysql_real_escape_string($_POST['category_value']) . "', license='" . mysql_real_escape_string($_POST['license_value']) . "' where template_id=" . mysql_real_escape_string($_POST['tutorial_id']); - - } - - $query_to_change_syndication_status_response = mysql_query($query_to_change_syndication_status); - - /** - * Check template is public - */ - - if(template_access_settings(mysql_real_escape_string($_POST['tutorial_id']))=="Public"){ - - echo "

Open Content

"; - - echo "

This tab allows you to include to project in the site's open courseware list. Open Courseware is a set of learning materials that institutions have made publically available for any one to use. The address for this site's syndicated content is site_url . url_return("RSS_syndicate",null) . "\">" . $xerte_toolkits_site->site_url . url_return("RSS_syndicate",null) . "

"; - - $query_for_syndication = "select syndication,description,keywords,category,license from " . $xerte_toolkits_site->database_table_prefix . "templatesyndication where template_id=" . mysql_real_escape_string($_POST['tutorial_id']); - - $query_syndication_response = mysql_query($query_for_syndication); - - $row_syndication = mysql_fetch_array($query_syndication_response); - - echo "

Include this project in the Open Courseware Feed "; - - if($_POST['synd']=="true"){ - - echo " Yes No

"; - - }else{ - - echo " Yes No

"; - - } - - echo "

Please choose a category for your project

"; - - echo "

Please choose a license for your project

"; - - echo "

Please provide a description for your project

Please provide a list of comma separated keywords for this project

"; - - - }else{ - - echo "

Please set this project to the 'Public' on the access tab before using the RSS Feed features

"; - - } - - - }else{ - - echo "

Sorry only the creator of the file can set notes for the project

"; - - } - -} - -?> \ No newline at end of file diff --git a/website_code/php/properties/syndication_template.php b/website_code/php/properties/syndication_template.php deleted file mode 100644 index 9dfa3aa028..0000000000 --- a/website_code/php/properties/syndication_template.php +++ /dev/null @@ -1,121 +0,0 @@ -Open Content

"; - - echo "

This tab allows you to include to project in the site's open courseware list. Open Courseware is a set of learning materials that institutions have made publically available for any one to use. The address for this site's syndicated content is site_url . url_return("RSS_syndicate",null) . "\">" . $xerte_toolkits_site->site_url . url_return("RSS_syndicate",null) . "

"; - - $query_for_syndication = "select syndication,description,keywords,category,license from " . $xerte_toolkits_site->database_table_prefix . "templatesyndication where template_id=" . mysql_real_escape_string($_POST['tutorial_id']); - - $query_syndication_response = mysql_query($query_for_syndication); - - $row_syndication = mysql_fetch_array($query_syndication_response); - - echo "

Include this project in the Open Courseware Feed "; - - if($row_syndication['syndication']=="true"){ - - echo " Yes No

"; - - }else{ - - echo " Yes No

"; - - } - - echo "

Please choose a category for your project

"; - - echo "

Please choose a license for your project

"; - - echo "

Please provide a description for your project

Please provide a list of comma separated keywords for this project

"; - - - }else{ - - echo "

Please set this project to the 'Public' on the access tab before using the Syndication feature

"; - - echo "

The address for this site's syndicated content is site_url . url_return("RSS_syndicate",null) . "\">" . $xerte_toolkits_site->site_url . url_return("RSS_syndicate",null) . "

"; - - } - - - }else{ - - echo "

Sorry only the creator of the file can set notes for the project

"; - - } - -} - -?> \ No newline at end of file diff --git a/website_code/php/properties/xml_change_template.php b/website_code/php/properties/xml_change_template.php deleted file mode 100644 index 612d06f936..0000000000 --- a/website_code/php/properties/xml_change_template.php +++ /dev/null @@ -1,112 +0,0 @@ -database_table_prefix . "additional_sharing where template_id=\"" . mysql_real_escape_string($_POST['template_id']) . "\" AND sharing_type=\"xml\""; - - mysql_query($query); - - }else{ - - $query = "select * from " . $xerte_toolkits_site->database_table_prefix . "additional_sharing where sharing_type=\"xml\" AND template_id =\"" . mysql_real_escape_string($_POST['template_id']) . "\""; - - $query_response = mysql_query($query); - - if(mysql_num_rows($query_response)==0){ - - if($_POST['address']=="null"){ - - $query = "INSERT INTO " . $xerte_toolkits_site->database_table_prefix . "additional_sharing (template_id, sharing_type, extra) VALUES (" . mysql_real_escape_string($_POST['template_id']) . ", \"xml\",\"\")"; - - }else{ - - $query = "INSERT INTO " . $xerte_toolkits_site->database_table_prefix . "additional_sharing (template_id, sharing_type, extra) VALUES (" . mysql_real_escape_string($_POST['template_id']) . ", \"xml\",\"" . mysql_real_escape_string($_POST['address']) . "\")"; - - } - - mysql_query($query); - - }else{ - - if($_POST['address']=="null"){ - - $query = "UPDATE " . $xerte_toolkits_site->database_table_prefix . "additional_sharing SET extra =\"\" where template_id = \"" . mysql_real_escape_string($_POST['template_id']) . "\""; - - }else{ - - $query = "UPDATE " . $xerte_toolkits_site->database_table_prefix . "additional_sharing SET extra =\"" . mysql_real_escape_string($_POST['address']) . "\" where template_id = \"" . mysql_real_escape_string($_POST['template_id']) . "\""; - - } - - mysql_query($query); - - } - - } - - //Update the screen - - echo "

XML Sharing

"; - - echo "

In this section you can set up the XML Sharing for one of your projects. This allows your work to be used in other systems

"; - $query = "select * from " . $xerte_toolkits_site->database_table_prefix . "additional_sharing where sharing_type=\"xml\" AND template_id =\"" . mysql_real_escape_string($_POST['template_id']) . "\""; - - $query_response = mysql_query($query); - - echo "

XML Sharing is

"; - - if(mysql_num_rows($query_response)==1){ - - echo "

on

"; - echo "

off

"; - echo "

The link for xml sharing is " . $xerte_toolkits_site->site_url . url_return("xml",$_POST['template_id']) . "

"; - - }else{ - - echo "

on

"; - echo "

off

"; - - } - - $row = mysql_fetch_array($query_response); - - echo "

You can restrict access to one site if you would like



Your changes have been saved

"; - - - - }else{ - - echo "

Sorry, only creators of templates can set up XML Sharing

"; - - } - - mysql_close($database_id); - -} - -?> \ No newline at end of file diff --git a/website_code/php/properties/xml_template.php b/website_code/php/properties/xml_template.php deleted file mode 100644 index 9b0b44b0af..0000000000 --- a/website_code/php/properties/xml_template.php +++ /dev/null @@ -1,65 +0,0 @@ -XML Sharing

"; - - echo "

In this section you can set up the XML Sharing for one of your projects. This allows your work to be used in other systems

"; - - $query = "select * from " . $xerte_toolkits_site->database_table_prefix . "additional_sharing where sharing_type=\"xml\" AND template_id =\"" . mysql_real_escape_string($_POST['template_id']) . "\""; - - $query_response = mysql_query($query); - - echo "

XML Sharing is

"; - - if(mysql_num_rows($query_response)==1){ - - echo "

on

"; - echo "

off

"; - echo "

The link for xml sharing is " . $xerte_toolkits_site->site_url . url_return("xml",$_POST['template_id']) . "

"; - - }else{ - - echo "

on

"; - echo "

off

"; - - } - - $row = mysql_fetch_array($query_response); - - echo "

You can restrict access to one site if you would like



"; - - }else{ - - echo "

Sorry, only creators of templates can set up XML sharing

"; - - } - - mysql_close($database_id); - -} -?> \ No newline at end of file diff --git a/website_code/php/publish/publish_template.php b/website_code/php/publish/publish_template.php deleted file mode 100644 index 7d69152961..0000000000 --- a/website_code/php/publish/publish_template.php +++ /dev/null @@ -1,76 +0,0 @@ -database_table_prefix . \"", $xerte_toolkits_site->database_table_prefix, $xerte_toolkits_site->play_edit_preview_query); - - $query_for_edit_content = str_replace("TEMPLATE_ID_TO_REPLACE", $safe_template_id, $query_for_edit_content_strip); - - $query_for_edit_content_response = mysql_query($query_for_edit_content); - - $row_publish = mysql_fetch_array($query_for_edit_content_response); - - if(is_user_an_editor($safe_template_id,$_SESSION['toolkits_logon_id'])){ - - $file = file_get_contents($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->users_file_area_short . $safe_template_id . "-" . $row_publish['username'] . "-" . $row_publish['template_name'] . "/preview.xml"); - - $fh = fopen($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->users_file_area_short . $safe_template_id . "-" . $row_publish['username'] . "-" . $row_publish['template_name'] . "/data.xml", 'w'); - - fwrite($fh,$file); - - fclose($fh); - - echo template_access_settings($safe_template_id); - - } - - }else{ - - echo "Sorry you are not an editor of this template and so cannot publish it"; - - } - -?> \ No newline at end of file diff --git a/website_code/php/scorm/archive.php b/website_code/php/scorm/archive.php deleted file mode 100644 index 0902e607b6..0000000000 --- a/website_code/php/scorm/archive.php +++ /dev/null @@ -1,669 +0,0 @@ -options = array ( - 'basedir' => ".", - 'name' => $name, - 'prepend' => "", - 'inmemory' => 0, - 'overwrite' => 0, - 'recurse' => 1, - 'storepaths' => 1, - 'followlinks' => 0, - 'level' => 3, - 'method' => 1, - 'sfx' => "", - 'type' => "", - 'comment' => "" - ); - $this->files = array (); - $this->exclude = array (); - $this->storeonly = array (); - $this->error = array (); - } - - function set_options($options) - { - foreach ($options as $key => $value) - $this->options[$key] = $value; - if (!empty ($this->options['basedir'])) - { - $this->options['basedir'] = str_replace("\\", "/", $this->options['basedir']); - $this->options['basedir'] = preg_replace("/\/+/", "/", $this->options['basedir']); - $this->options['basedir'] = preg_replace("/\/$/", "", $this->options['basedir']); - } - if (!empty ($this->options['name'])) - { - $this->options['name'] = str_replace("\\", "/", $this->options['name']); - $this->options['name'] = preg_replace("/\/+/", "/", $this->options['name']); - } - if (!empty ($this->options['prepend'])) - { - $this->options['prepend'] = str_replace("\\", "/", $this->options['prepend']); - $this->options['prepend'] = preg_replace("/^(\.*\/+)+/", "", $this->options['prepend']); - $this->options['prepend'] = preg_replace("/\/+/", "/", $this->options['prepend']); - $this->options['prepend'] = preg_replace("/\/$/", "", $this->options['prepend']) . "/"; - } - } - - function create_archive() - { - $this->make_list(); - - if ($this->options['inmemory'] == 0) - { - $pwd = getcwd(); - chdir($this->options['basedir']); - if ($this->options['overwrite'] == 0 && file_exists($this->options['name'] . ($this->options['type'] == "gzip" || $this->options['type'] == "bzip" ? ".tmp" : ""))) - { - $this->error[] = "File {$this->options['name']} already exists."; - chdir($pwd); - return 0; - } - else if ($this->archive = @fopen($this->options['name'] . ($this->options['type'] == "gzip" || $this->options['type'] == "bzip" ? ".tmp" : ""), "wb+")) - chdir($pwd); - else - { - $this->error[] = "Could not open {$this->options['name']} for writing."; - chdir($pwd); - return 0; - } - } - else - $this->archive = ""; - - switch ($this->options['type']) - { - case "zip": - if (!$this->create_zip()) - { - $this->error[] = "Could not create zip file."; - return 0; - } - break; - case "bzip": - if (!$this->create_tar()) - { - $this->error[] = "Could not create tar file."; - return 0; - } - if (!$this->create_bzip()) - { - $this->error[] = "Could not create bzip2 file."; - return 0; - } - break; - case "gzip": - if (!$this->create_tar()) - { - $this->error[] = "Could not create tar file."; - return 0; - } - if (!$this->create_gzip()) - { - $this->error[] = "Could not create gzip file."; - return 0; - } - break; - case "tar": - if (!$this->create_tar()) - { - $this->error[] = "Could not create tar file."; - return 0; - } - } - - if ($this->options['inmemory'] == 0) - { - fclose($this->archive); - if ($this->options['type'] == "gzip" || $this->options['type'] == "bzip") - unlink($this->options['basedir'] . "/" . $this->options['name'] . ".tmp"); - } - } - - function add_data($data) - { - if ($this->options['inmemory'] == 0) - fwrite($this->archive, $data); - else - $this->archive .= $data; - } - - function make_list() - { - if (!empty ($this->exclude)) - foreach ($this->files as $key => $value) - foreach ($this->exclude as $current) - if ($value['name'] == $current['name']) - unset ($this->files[$key]); - if (!empty ($this->storeonly)) - foreach ($this->files as $key => $value) - foreach ($this->storeonly as $current) - if ($value['name'] == $current['name']) - $this->files[$key]['method'] = 0; - unset ($this->exclude, $this->storeonly); - } - - function add_files($list) - { - $temp = $this->list_files($list); - foreach ($temp as $current) - $this->files[] = $current; - } - - function exclude_files($list) - { - $temp = $this->list_files($list); - foreach ($temp as $current) - $this->exclude[] = $current; - } - - function store_files($list) - { - $temp = $this->list_files($list); - foreach ($temp as $current) - $this->storeonly[] = $current; - } - - function list_files($list) - { - - if (!is_array ($list)) - { - $temp = $list; - $list = array ($temp); - unset ($temp); - } - - $files = array (); - - $pwd = getcwd(); - chdir($this->options['basedir']); - - foreach ($list as $current) - { - $current = str_replace("\\", "/", $current); - $current = preg_replace("/\/+/", "/", $current); - $current = preg_replace("/\/$/", "", $current); - if (strstr($current, "*")) - { - $regex = preg_replace("/([\\\^\$\.\[\]\|\(\)\?\+\{\}\/])/", "\\\\\\1", $current); - $regex = str_replace("*", ".*", $regex); - $dir = strstr($current, "/") ? substr($current, 0, strrpos($current, "/")) : "."; - $temp = $this->parse_dir($dir); - foreach ($temp as $current2) - if (preg_match("/^{$regex}$/i", $current2['name'])) - $files[] = $current2; - unset ($regex, $dir, $temp, $current); - } - else if (@is_dir($current)) - { - $temp = $this->parse_dir($current); - foreach ($temp as $file) - $files[] = $file; - unset ($temp, $file); - } - else if (@file_exists($current)) - $files[] = array ('name' => $current, 'name2' => $this->options['prepend'] . - preg_replace("/(\.+\/+)+/", "", ($this->options['storepaths'] == 0 && strstr($current, "/")) ? - substr($current, strrpos($current, "/") + 1) : $current), - 'type' => @is_link($current) && $this->options['followlinks'] == 0 ? 2 : 0, - 'ext' => substr($current, strrpos($current, ".")), 'stat' => stat($current)); - } - - @chdir($pwd); - - unset ($current, $pwd); - - usort($files, array ("archive", "sort_files")); - - return $files; - } - - function parse_dir($dirname) - { - if ($this->options['storepaths'] == 1 && !preg_match("/^(\.+\/*)+$/", $dirname)) - $files = array (array ('name' => $dirname, 'name2' => $this->options['prepend'] . - preg_replace("/(\.+\/+)+/", "", ($this->options['storepaths'] == 0 && strstr($dirname, "/")) ? - substr($dirname, strrpos($dirname, "/") + 1) : $dirname), 'type' => 5, 'stat' => stat($dirname))); - else - $files = array (); - $dir = @opendir($dirname); - - while ($file = @readdir($dir)) - { - $fullname = $dirname . "/" . $file; - if ($file == "." || $file == "..") - continue; - else if (@is_dir($fullname)) - { - if (empty ($this->options['recurse'])) - continue; - $temp = $this->parse_dir($fullname); - foreach ($temp as $file2) - $files[] = $file2; - } - else if (@file_exists($fullname)) - $files[] = array ('name' => $fullname, 'name2' => $this->options['prepend'] . - preg_replace("/(\.+\/+)+/", "", ($this->options['storepaths'] == 0 && strstr($fullname, "/")) ? - substr($fullname, strrpos($fullname, "/") + 1) : $fullname), - 'type' => @is_link($fullname) && $this->options['followlinks'] == 0 ? 2 : 0, - 'ext' => substr($file, strrpos($file, ".")), 'stat' => stat($fullname)); - } - - @closedir($dir); - - return $files; - } - - function sort_files($a, $b) - { - if ($a['type'] != $b['type']) - if ($a['type'] == 5 || $b['type'] == 2) - return -1; - else if ($a['type'] == 2 || $b['type'] == 5) - return 1; - else if ($a['type'] == 5) - return strcmp(strtolower($a['name']), strtolower($b['name'])); - else if ($a['ext'] != $b['ext']) - return strcmp($a['ext'], $b['ext']); - else if ($a['stat'][7] != $b['stat'][7]) - return $a['stat'][7] > $b['stat'][7] ? -1 : 1; - else - return strcmp(strtolower($a['name']), strtolower($b['name'])); - return 0; - } - - function download_file($name) - { - if ($this->options['inmemory'] == 0) - { - $this->error[] = "Can only use download_file() if archive is in memory. Redirect to file otherwise, it is faster."; - return; - } - switch ($this->options['type']) - { - case "zip": - header("Content-Type: application/zip"); - break; - case "bzip": - header("Content-Type: application/x-bzip2"); - break; - case "gzip": - header("Content-Type: application/x-gzip"); - break; - case "tar": - header("Content-Type: application/x-tar"); - } - header("Content-Length: " . strlen($this->archive)); - header("Pragma: public"); - header('Content-disposition: attachment; filename="' . $name . '.zip"'); - //header("Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0"); - //header("Expires: Sat, 01 Jan 2000 12:00:00 GMT"); - header("Content-Transfer-Encoding: binary"); - print($this->archive); - } -} - - -class tar_file extends archive -{ - function tar_file($name) - { - $this->archive($name); - $this->options['type'] = "tar"; - } - - function create_tar() - { - $pwd = getcwd(); - chdir($this->options['basedir']); - - foreach ($this->files as $current) - { - if ($current['name'] == $this->options['name']) - continue; - if (strlen($current['name2']) > 99) - { - $path = substr($current['name2'], 0, strpos($current['name2'], "/", strlen($current['name2']) - 100) + 1); - $current['name2'] = substr($current['name2'], strlen($path)); - if (strlen($path) > 154 || strlen($current['name2']) > 99) - { - $this->error[] = "Could not add {$path}{$current['name2']} to archive because the filename is too long."; - continue; - } - } - $block = pack("a100a8a8a8a12a12a8a1a100a6a2a32a32a8a8a155a12", $current['name2'], sprintf("%07o", - $current['stat'][2]), sprintf("%07o", $current['stat'][4]), sprintf("%07o", $current['stat'][5]), - sprintf("%011o", $current['type'] == 2 ? 0 : $current['stat'][7]), sprintf("%011o", $current['stat'][9]), - " ", $current['type'], $current['type'] == 2 ? @readlink($current['name']) : "", "ustar ", " ", - "Unknown", "Unknown", "", "", !empty ($path) ? $path : "", ""); - - $checksum = 0; - for ($i = 0; $i < 512; $i++) - $checksum += ord(substr($block, $i, 1)); - $checksum = pack("a8", sprintf("%07o", $checksum)); - $block = substr_replace($block, $checksum, 148, 8); - - if ($current['type'] == 2 || $current['stat'][7] == 0) - $this->add_data($block); - else if ($fp = @fopen($current['name'], "rb")) - { - $this->add_data($block); - while ($temp = fread($fp, 1048576)) - $this->add_data($temp); - if ($current['stat'][7] % 512 > 0) - { - $temp = ""; - for ($i = 0; $i < 512 - $current['stat'][7] % 512; $i++) - $temp .= "\0"; - $this->add_data($temp); - } - fclose($fp); - } - else - $this->error[] = "Could not open file {$current['name']} for reading. It was not added."; - } - - $this->add_data(pack("a1024", "")); - - chdir($pwd); - - return 1; - } - - function extract_files() - { - $pwd = getcwd(); - chdir($this->options['basedir']); - - if ($fp = $this->open_archive()) - { - if ($this->options['inmemory'] == 1) - $this->files = array (); - - while ($block = fread($fp, 512)) - { - $temp = unpack("a100name/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/a1type/a100symlink/a6magic/a2temp/a32temp/a32temp/a8temp/a8temp/a155prefix/a12temp", $block); - $file = array ( - 'name' => $temp['prefix'] . $temp['name'], - 'stat' => array ( - 2 => $temp['mode'], - 4 => octdec($temp['uid']), - 5 => octdec($temp['gid']), - 7 => octdec($temp['size']), - 9 => octdec($temp['mtime']), - ), - 'checksum' => octdec($temp['checksum']), - 'type' => $temp['type'], - 'magic' => $temp['magic'], - ); - if ($file['checksum'] == 0x00000000) - break; - else if (substr($file['magic'], 0, 5) != "ustar") - { - $this->error[] = "This script does not support extracting this type of tar file."; - break; - } - $block = substr_replace($block, " ", 148, 8); - $checksum = 0; - for ($i = 0; $i < 512; $i++) - $checksum += ord(substr($block, $i, 1)); - if ($file['checksum'] != $checksum) - $this->error[] = "Could not extract from {$this->options['name']}, it is corrupt."; - - if ($this->options['inmemory'] == 1) - { - $file['data'] = fread($fp, $file['stat'][7]); - fread($fp, (512 - $file['stat'][7] % 512) == 512 ? 0 : (512 - $file['stat'][7] % 512)); - unset ($file['checksum'], $file['magic']); - $this->files[] = $file; - } - else if ($file['type'] == 5) - { - if (!is_dir($file['name'])) - mkdir($file['name'], $file['stat'][2]); - } - else if ($this->options['overwrite'] == 0 && file_exists($file['name'])) - { - $this->error[] = "{$file['name']} already exists."; - continue; - } - else if ($file['type'] == 2) - { - symlink($temp['symlink'], $file['name']); - chmod($file['name'], $file['stat'][2]); - } - else if ($new = @fopen($file['name'], "wb")) - { - fwrite($new, fread($fp, $file['stat'][7])); - fread($fp, (512 - $file['stat'][7] % 512) == 512 ? 0 : (512 - $file['stat'][7] % 512)); - fclose($new); - chmod($file['name'], $file['stat'][2]); - } - else - { - $this->error[] = "Could not open {$file['name']} for writing."; - continue; - } - chown($file['name'], $file['stat'][4]); - chgrp($file['name'], $file['stat'][5]); - touch($file['name'], $file['stat'][9]); - unset ($file); - } - } - else - $this->error[] = "Could not open file {$this->options['name']}"; - - chdir($pwd); - } - - function open_archive() - { - return @fopen($this->options['name'], "rb"); - } -} - -class gzip_file extends tar_file -{ - function gzip_file($name) - { - $this->tar_file($name); - $this->options['type'] = "gzip"; - } - - function create_gzip() - { - if ($this->options['inmemory'] == 0) - { - $pwd = getcwd(); - chdir($this->options['basedir']); - if ($fp = gzopen($this->options['name'], "wb{$this->options['level']}")) - { - fseek($this->archive, 0); - while ($temp = fread($this->archive, 1048576)) - gzwrite($fp, $temp); - gzclose($fp); - chdir($pwd); - } - else - { - $this->error[] = "Could not open {$this->options['name']} for writing."; - chdir($pwd); - return 0; - } - } - else - $this->archive = gzencode($this->archive, $this->options['level']); - - return 1; - } - - function open_archive() - { - return @gzopen($this->options['name'], "rb"); - } -} - -class bzip_file extends tar_file -{ - function bzip_file($name) - { - $this->tar_file($name); - $this->options['type'] = "bzip"; - } - - function create_bzip() - { - if ($this->options['inmemory'] == 0) - { - $pwd = getcwd(); - chdir($this->options['basedir']); - if ($fp = bzopen($this->options['name'], "wb")) - { - fseek($this->archive, 0); - while ($temp = fread($this->archive, 1048576)) - bzwrite($fp, $temp); - bzclose($fp); - chdir($pwd); - } - else - { - $this->error[] = "Could not open {$this->options['name']} for writing."; - chdir($pwd); - return 0; - } - } - else - $this->archive = bzcompress($this->archive, $this->options['level']); - - return 1; - } - - function open_archive() - { - return @bzopen($this->options['name'], "rb"); - } -} - -class zip_file extends archive -{ - function zip_file($name) - { - $this->archive($name); - $this->options['type'] = "zip"; - } - - function create_zip() - { - $files = 0; - $offset = 0; - $central = ""; - - if (!empty ($this->options['sfx'])) - if ($fp = @fopen($this->options['sfx'], "rb")) - { - $temp = fread($fp, filesize($this->options['sfx'])); - fclose($fp); - $this->add_data($temp); - $offset += strlen($temp); - unset ($temp); - } - else - $this->error[] = "Could not open sfx module from {$this->options['sfx']}."; - - $pwd = getcwd(); - chdir($this->options['basedir']); - - foreach ($this->files as $current) - { - if ($current['name'] == $this->options['name']) - continue; - - $timedate = explode(" ", date("Y n j G i s", $current['stat'][9])); - $timedate = ($timedate[0] - 1980 << 25) | ($timedate[1] << 21) | ($timedate[2] << 16) | - ($timedate[3] << 11) | ($timedate[4] << 5) | ($timedate[5]); - - $block = pack("VvvvV", 0x04034b50, 0x000A, 0x0000, (isset($current['method']) || $this->options['method'] == 0) ? 0x0000 : 0x0008, $timedate); - - if ($current['stat'][7] == 0 && $current['type'] == 5) - { - $block .= pack("VVVvv", 0x00000000, 0x00000000, 0x00000000, strlen($current['name2']) + 1, 0x0000); - $block .= $current['name2'] . "/"; - $this->add_data($block); - $central .= pack("VvvvvVVVVvvvvvVV", 0x02014b50, 0x0014, $this->options['method'] == 0 ? 0x0000 : 0x000A, 0x0000, - (isset($current['method']) || $this->options['method'] == 0) ? 0x0000 : 0x0008, $timedate, - 0x00000000, 0x00000000, 0x00000000, strlen($current['name2']) + 1, 0x0000, 0x0000, 0x0000, 0x0000, $current['type'] == 5 ? 0x00000010 : 0x00000000, $offset); - $central .= $current['name2'] . "/"; - $files++; - $offset += (31 + strlen($current['name2'])); - } - else if ($current['stat'][7] == 0) - { - $block .= pack("VVVvv", 0x00000000, 0x00000000, 0x00000000, strlen($current['name2']), 0x0000); - $block .= $current['name2']; - $this->add_data($block); - $central .= pack("VvvvvVVVVvvvvvVV", 0x02014b50, 0x0014, $this->options['method'] == 0 ? 0x0000 : 0x000A, 0x0000, - (isset($current['method']) || $this->options['method'] == 0) ? 0x0000 : 0x0008, $timedate, - 0x00000000, 0x00000000, 0x00000000, strlen($current['name2']), 0x0000, 0x0000, 0x0000, 0x0000, $current['type'] == 5 ? 0x00000010 : 0x00000000, $offset); - $central .= $current['name2']; - $files++; - $offset += (30 + strlen($current['name2'])); - } - else if ($fp = @fopen($current['name'], "rb")) - { - $temp = fread($fp, $current['stat'][7]); - fclose($fp); - $crc32 = crc32($temp); - if (!isset($current['method']) && $this->options['method'] == 1) - { - $temp = gzcompress($temp, $this->options['level']); - $size = strlen($temp) - 6; - $temp = substr($temp, 2, $size); - } - else - $size = strlen($temp); - $block .= pack("VVVvv", $crc32, $size, $current['stat'][7], strlen($current['name2']), 0x0000); - $block .= $current['name2']; - $this->add_data($block); - $this->add_data($temp); - unset ($temp); - $central .= pack("VvvvvVVVVvvvvvVV", 0x02014b50, 0x0014, $this->options['method'] == 0 ? 0x0000 : 0x000A, 0x0000, - (isset($current['method']) || $this->options['method'] == 0) ? 0x0000 : 0x0008, $timedate, - $crc32, $size, $current['stat'][7], strlen($current['name2']), 0x0000, 0x0000, 0x0000, 0x0000, 0x00000000, $offset); - $central .= $current['name2']; - $files++; - $offset += (30 + strlen($current['name2']) + $size); - } - else - $this->error[] = "Could not open file {$current['name']} for reading. It was not added."; - } - - $this->add_data($central); - - $this->add_data(pack("VvvvvVVv", 0x06054b50, 0x0000, 0x0000, $files, $files, strlen($central), $offset, - !empty ($this->options['comment']) ? strlen($this->options['comment']) : 0x0000)); - - if (!empty ($this->options['comment'])) - $this->add_data($this->options['comment']); - - @chdir($pwd); - - return 1; - } -} ?> diff --git a/website_code/php/scorm/export.php b/website_code/php/scorm/export.php deleted file mode 100644 index 9fa61caca2..0000000000 --- a/website_code/php/scorm/export.php +++ /dev/null @@ -1,178 +0,0 @@ -database_table_prefix . "templatedetails.template_name as zipname, " . $xerte_toolkits_site->database_table_prefix . "templaterights.template_id, " . $xerte_toolkits_site->database_table_prefix . "logindetails.username, " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails.template_name, " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails.template_framework from " . $xerte_toolkits_site->database_table_prefix . "templaterights, " . $xerte_toolkits_site->database_table_prefix . "logindetails, " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails, " . $xerte_toolkits_site->database_table_prefix . "templatedetails where " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_type_id = " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails.template_type_id and " . $xerte_toolkits_site->database_table_prefix . "templaterights.template_id = " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_id and " . $xerte_toolkits_site->database_table_prefix . "templatedetails.creator_id = " . $xerte_toolkits_site->database_table_prefix . "logindetails.login_id and " . $xerte_toolkits_site->database_table_prefix . "templaterights.template_id=\"" . mysql_real_escape_string($_GET['template_id']) . "\" AND role=\"creator\""; - - $query_response = mysql_query($query); - - $row = mysql_fetch_array($query_response); - - /* - * Set up the paths - */ - - $dir_path = $xerte_toolkits_site->users_file_area_full . $row['template_id'] . "-" . $row['username'] . "-" . $row['template_name'] . "/"; - - $parent_template_path = $xerte_toolkits_site->basic_template_path . $row['template_framework'] . "/parent_templates/" . $row['template_name'] . "/"; - - $scorm_path = $xerte_toolkits_site->basic_template_path . $row['template_framework'] . "/scorm/"; - - /* - * Make the zip - */ - - $zipfile = new zip_file("example_zipper_new" . date(U) . ".zip"); - $zipfile->set_options(array('basedir' => $dir_path, 'prepand' => "", 'inmemory' => 1, 'recurse' => 1, 'storepaths' => 1)); - - /* - * Copy the core files over from the parent folder - */ - - folder_loop($parent_template_path); - - copy($dir_path . "data.xml",$dir_path . "template.xml"); - - copy_parent_files(); - - /* - * If scorm copy the scorn files as well - */ - - $scorm=mysql_real_escape_string($_GET['scorm']); - - if($scorm=="true"){ - - folder_loop($scorm_path); - - copy_scorm_files(); - - }else{ - - copy($scorm_path . "rloObject.js", $dir_path . "rloObject.js"); - - array_push($delete_file_array, $dir_path . "rloObject.js"); - - copy($scorm_path . "MainPreloader.swf", $dir_path . "MainPreloader.swf"); - - array_push($delete_file_array, $dir_path . "MainPreloader.swf"); - - copy($scorm_path . "resources.swf", $dir_path . "resources.swf"); - - array_push($delete_file_array, $dir_path . "resources.swf"); - - } - - copy($xerte_toolkits_site->root_file_path . "XMLEngine.swf", $dir_path . "XMLEngine.swf"); - - array_push($delete_file_array, $dir_path . "XMLEngine.swf"); - - if($scorm=="true"){ - - copy($dir_path . $row['template_name'] . ".rlt", $dir_path . "learningobject.rlo"); - - unlink($dir_path . $row['template_name'] . ".rlt"); - - array_push($delete_file_array, $dir_path . "learningobject.rlo"); - - }else{ - - copy($dir_path . $row['template_name'] . ".rlt", $dir_path . "learningobject.rlt"); - - unlink($dir_path . $row['template_name'] . ".rlt"); - - array_push($delete_file_array, $dir_path . "learningobject.rlt"); - - } - - folder_loop($dir_path); - - /* - * Create scorm manifests of a basic HTML page - */ - - if($scorm=="true"){ - - lmsmanifest_create($row['zipname']); - - scorm_html_page_create($row['template_name'],$row['template_framework']); - - }else{ - - basic_html_page_create($row['template_name'],$row['template_framework']); - - } - - - /* - * Add the files to the zip file, create the archive, then send it to the user - */ - - xerte_zip_files(); - - $zipfile->create_archive(); - - $zipfile->download_file($row['zipname']); - - - /* - * remove the files - */ - - clean_up_files(); - - unlink($dir_path . "template.xml"); - - } - -} - -?> diff --git a/website_code/php/scorm/scorm_library.php b/website_code/php/scorm/scorm_library.php deleted file mode 100644 index 7b556b81d6..0000000000 --- a/website_code/php/scorm/scorm_library.php +++ /dev/null @@ -1,328 +0,0 @@ -ADL SCORM1.2"; - - $date = date(U); - - $scorm_personalise_string .= ""; - $scorm_personalise_string .= ""; - $scorm_personalise_string .= "" . str_replace("_"," ",$name) . ""; - $scorm_personalise_string .= ""; - $scorm_personalise_string .= "" . "My learning object title" . ""; - - $scorm_bottom_string = ""; - - $file_handle = fopen($dir_path . "imsmanifest.xml", 'w'); - - $buffer = $scorm_top_string . $scorm_personalise_string . $scorm_bottom_string; - - fwrite($file_handle,$buffer,strlen($buffer)); - fclose($file_handle); - - $zipfile->add_files("imsmanifest.xml"); - - array_push($delete_file_array, $dir_path . "imsmanifest.xml"); - -} - - /** - * - * Function basic html page create - * This function creates a basic HTML page for export - * @param string $name - name of the template - * @param string $type - type of template this is - * @version 1.0 - * @author Patrick Lockley - */ - -function basic_html_page_create($name, $type){ - - global $xerte_toolkits_site, $dir_path, $delete_file_array, $zipfile; - - $buffer = file_get_contents($xerte_toolkits_site->basic_template_path . $type . "/player/rloObject.htm"); - - $temp = get_template_screen_size($name,$type); - - $new_temp = explode("~",$temp); - - $buffer = str_replace("change_width",$new_temp[0],$buffer); - $buffer = str_replace("change_height",$new_temp[1],$buffer); - - $file_handle = fopen($dir_path . "index.htm", 'w'); - - fwrite($file_handle,$buffer,strlen($buffer)); - fclose($file_handle); - - $zipfile->add_files("index.htm"); - - array_push($delete_file_array, $dir_path . "index.htm"); - -} - -/** -* -* Function scorm html page create -* This function creates a scorm HTML page for export -* @param string $name - name of the template -* @param string $type - type of template this is -* @version 1.0 -* @author Patrick Lockley -*/ - -function scorm_html_page_create($name, $type){ - - global $scorm_path, $dir_path, $delete_file_array, $zipfile; - - $scorm_html_page_content = file_get_contents($scorm_path . "scormRLO.htm"); - - $temp = get_template_screen_size($name,$type); - - $new_temp = explode("~",$temp); - - $scorm_html_page_content = str_replace("rloWidth = 800","rloWidth = " . $new_temp[0],$scorm_html_page_content); - $scorm_html_page_content = str_replace("rloHeight = 600","rloHeight = " . $new_temp[0],$scorm_html_page_content); - - $file_handle = fopen($dir_path . "scormRLO.htm", 'w'); - - fwrite($file_handle,$scorm_html_page_content,strlen($scorm_html_page_content)); - fclose($file_handle); - - $zipfile->add_files("scormRLO.htm"); - - array_push($delete_file_array, $dir_path . "scormRLO.htm"); - -} - - /** - * - * Function folder loop - * This function loops through a folder tree collating files - * @param string $path - path to move through - * @version 1.0 - * @author Patrick Lockley - */ - -function folder_loop($path){ - - global $folder_id_array, $folder_array, $file_array, $zipfile, $dir_path; - - $d = opendir($path); - - array_push($folder_id_array, $d); - - while($f = readdir($d)){ - - if(is_dir($path . $f)){ - - if(($f!=".")&&($f!="..")){ - - folder_loop($path . $f . "/"); - - } - - }else{ - - if($f!="data.xml"){ - - $string = $path . $f; - - array_push($file_array, $string); - - - } - - } - - } - - $x = array_pop($folder_id_array); - - closedir($x); - -} - - /** - * - * Function clean up files - * This function removes files used in making the export - * @param string $name - name of the template - * @param string $type - type of template this is - * @version 1.0 - * @author Patrick Lockley - */ - -function clean_up_files(){ - - global $dir_path, $delete_file_array, $delete_folder_array; - - while($file = array_pop($delete_file_array)){ - - @unlink($file); - - } - - while($folder = array_pop($delete_folder_array)){ - - @rmdir($folder); - - } - -} - - /** - * - * Function directory maker - * This function adds directories to file names so as to make the zip names correct - * @param string $name - name of the template - * @param string $type - type of template this is - * @version 1.0 - * @author Patrick Lockley - */ - -function directory_maker($string){ - - global $dir_path, $delete_folder_array; - - $directory_path_array = explode("/", $string); - - $x = 0; - - while($x!=(count($directory_path_array)-1)){ - - if($x!=0){ - - $y=0; - - $extra_dir_string = ""; - - while($y<=$x){ - - $extra_dir_string .= $directory_path_array[$y++] . "/"; - - if(!file_exists($dir_path . $extra_dir_string )){ - - mkdir($dir_path . $extra_dir_string); - chmod($dir_path . $extra_dir_string, 0777); - array_push($delete_folder_array, $dir_path . $extra_dir_string); - - } - - } - - }else{ - - if(!file_exists($dir_path . $directory_path_array[$x] )){ - - mkdir($dir_path . $directory_path_array[$x]); - chmod($dir_path . $directory_path_array[$x], 0777); - - array_push($delete_folder_array, $dir_path . $directory_path_array[$x]); - - } - - } - - - $x++; - - } - -} - - /** - * - * Function copy parent files - * This function copies the files from parent template folder into the zip - * @version 1.0 - * @author Patrick Lockley - */ - -function copy_parent_files(){ - - global $file_array, $dir_path, $parent_template_path, $delete_file_array; - - while($file = array_pop($file_array)){ - - $string = str_replace($parent_template_path, "", $file); - - directory_maker($string); - - if($string=="data.xwd"){ - - $string="template.xwd"; - - } - - array_push($delete_file_array, $dir_path . $string); - - @copy($file, $dir_path . $string); - - } - -} - - /** - * - * Function copy scorm files - * This function copies scorm files into the zip - * @version 1.0 - * @author Patrick Lockley - */ - -function copy_scorm_files(){ - - global $file_array, $dir_path, $scorm_path, $delete_file_array; - - while($file = array_pop($file_array)){ - - if(strpos($file,"scormRLO.htm")===false){ - - $string = str_replace($scorm_path, "", $file); - - array_push($delete_file_array, $dir_path . $string); - - @copy($file, $dir_path . $string); - - } - - } - -} - - /** - * - * Function xerte zip files - * This function zips up the files - * @version 1.0 - * @author Patrick Lockley - */ - -function xerte_zip_files(){ - - global $file_array, $zipfile, $dir_path; - - while($file = array_pop($file_array)){ - - if(($file!="data.xwd")||($file!="data.xml")){ - - $string = str_replace($dir_path, "", $file); - - $zipfile->add_files($string); - - } - - } - -} - -?> \ No newline at end of file diff --git a/website_code/php/screen_size_library.php b/website_code/php/screen_size_library.php deleted file mode 100644 index 02948cc85d..0000000000 --- a/website_code/php/screen_size_library.php +++ /dev/null @@ -1,39 +0,0 @@ -basic_template_path . $type . "/parent_templates/" . $filename . "/" . $filename . ".rlt"; - - $data = file_get_contents($filename); - - $place = strpos($data, 'stageSize="')+11; - - if($place==11){ - - return "800~600"; - - }else{ - - $secondplace = strpos($data, '"', $place); - - $temp = substr($data, $place, ($secondplace-$place)); - - $temp = split(",",$temp); - - return $temp[0] . "~" . $temp[1]; - } - -} - -?> \ No newline at end of file diff --git a/website_code/php/template_library.php b/website_code/php/template_library.php deleted file mode 100644 index b6dc295dc1..0000000000 --- a/website_code/php/template_library.php +++ /dev/null @@ -1,36 +0,0 @@ -database_table_prefix . "templatedetails"; - - $query_response = mysql_query($query); - - if($query_reponse===false){ - - receive_message($_SESSION['toolkits_logon_username'], "ADMIN", "CRITICAL", "Failed to get the maximum template number", "Failed to get the maximum template number"); - - }else{ - - $row = mysql_fetch_array($query_response); - - return $row['max(template_id)']; - - } - -} - - -?> \ No newline at end of file diff --git a/website_code/php/template_status.php b/website_code/php/template_status.php deleted file mode 100644 index a02580eca6..0000000000 --- a/website_code/php/template_status.php +++ /dev/null @@ -1,344 +0,0 @@ -database_table_prefix . "templatesyndication where template_id=\"" . $template_id . "\" and rss=\"true\""; - - $query_response = mysql_query($query); - - if(mysql_num_rows($query_response)!=0){ - - if(mysql_num_rows($query_response)==1){ - - return true; - - }else{ - - return false; - - } - - } - -} - - /** - * - * Function is template syndicated - * - * @author Patrick Lockley - * @version 1.0 - * @params number $template_id - the template ID - * @return bool - is template syndicated - * @copyright Copyright (c) 2008,2009 University of Nottingham - * @package - */ - -function is_template_syndicated($template_id){ - - global $xerte_toolkits_site; - - $query = "select template_id from " . $xerte_toolkits_site->database_table_prefix . "templatesyndication where template_id=\"" . $template_id . "\" and syndication=\"true\""; - - $query_response = mysql_query($query); - - if(mysql_num_rows($query_response)!=0){ - - if(mysql_num_rows($query_response)==1){ - - return true; - - }else{ - - return false; - - } - - } - -} - - /** - * - * Function is template exportable - * - * @author Patrick Lockley - * @version 1.0 - * @params number $template_id - the template ID - * @return bool - is template syndicated - * @copyright Copyright (c) 2008,2009 University of Nottingham - * @package - */ - -function is_template_exportable($template_id){ - - global $xerte_toolkits_site; - - $query = "select template_id from " . $xerte_toolkits_site->database_table_prefix . "templatesyndication where template_id=\"" . $template_id . "\" and export=\"true\""; - - $query_response = mysql_query($query); - - if(mysql_num_rows($query_response)!=0){ - - if(mysql_num_rows($query_response)==1){ - - return true; - - }else{ - - return false; - - } - - } - -} - - /** - * - * Function is template shared - * - * @author Patrick Lockley - * @version 1.0 - * @params number $template_id - the template ID - * @return bool - is template shared - * @copyright Copyright (c) 2008,2009 University of Nottingham - * @package - */ - -function is_template_shared($template_id){ - - global $xerte_toolkits_site; - - $query = "select template_id from" . $xerte_toolkits_site->database_table_prefix . "templaterights where template_id=\"" . $template_id . "\""; - - $query_response = mysql_query($query); - - if(mysql_num_rows($query_response)!=0){ - - if(mysql_num_rows($query_response)==1){ - - return false; - - }else{ - - return true; - - } - - } - -} - - /** - * - * Function has template multiple editors - * - * @author Patrick Lockley - * @version 1.0 - * @params number $template_id - the template ID - * @return bool - has the template multiple editors - * @copyright Copyright (c) 2008,2009 University of Nottingham - * @package - */ - -function has_template_multiple_editors($template_id){ - - global $xerte_toolkits_site; - - $query_for_read_only = "select " . $xerte_toolkits_site->database_table_prefix . "templaterights.template_id, role, " . $xerte_toolkits_site->database_table_prefix . "logindetails.username, " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails.template_name from " . $xerte_toolkits_site->database_table_prefix . "templaterights, " . $xerte_toolkits_site->database_table_prefix . "logindetails, " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails, " . $xerte_toolkits_site->database_table_prefix . "templatedetails where " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_type_id = " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails.template_type_id and " . $xerte_toolkits_site->database_table_prefix . "templaterights.template_id = " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_id and " . $xerte_toolkits_site->database_table_prefix . "templatedetails.creator_id = " . $xerte_toolkits_site->database_table_prefix . "logindetails.login_id and " . $xerte_toolkits_site->database_table_prefix . "templaterights.template_id=\"" . $_GET['template_id'] . "\" AND role=\"read-only\""; - - $query_for_number_of_rows = "select " . $xerte_toolkits_site->database_table_prefix . "templaterights.template_id, role, " . $xerte_toolkits_site->database_table_prefix . "logindetails.username, " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails.template_name from " . $xerte_toolkits_site->database_table_prefix . "templaterights, " . $xerte_toolkits_site->database_table_prefix . "logindetails, " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails, " . $xerte_toolkits_site->database_table_prefix . "templatedetails where " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_type_id = " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails.template_type_id and " . $xerte_toolkits_site->database_table_prefix . "templaterights.template_id = " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_id and " . $xerte_toolkits_site->database_table_prefix . "templatedetails.creator_id = " . $xerte_toolkits_site->database_table_prefix . "logindetails.login_id and " . $xerte_toolkits_site->database_table_prefix . "templaterights.template_id=\"" . $_GET['template_id'] . "\""; - - $query_response = mysql_query($query_for_read_only); - - $read_only_rows = mysql_num_rows($query_response); - - $query_response = mysql_query($query_for_number_of_rows); - - $overall_rows = mysql_num_rows($query_response); - - if(mysql_num_rows($query_response)!=0){ - - if($read_only_rows==($overall_rows-1)){ - - return false; - - }else{ - - return true; - - } - - } - -} - - /** - * - * Function has rights to this template - * - * @author Patrick Lockley - * @version 1.0 - * @params number $template_id - the template ID - * @params number $user_id - the current user ID - * @return bool - does this ID have rights to this template - * @copyright Copyright (c) 2008,2009 University of Nottingham - * @package - */ - -function has_rights_to_this_template($template_id, $user_id){ - - global $xerte_toolkits_site; - - $query = "select * from " . $xerte_toolkits_site->database_table_prefix . "templaterights where user_id=\"" . $user_id . "\" and template_id=\"" . $template_id . "\""; - - $query_response = mysql_query($query); - - if(mysql_num_rows($query_response)!=0){ - - return true; - - }else{ - - return false; - - } - -} - - /** - * - * Function is user an editor - * - * @author Patrick Lockley - * @version 1.0 - * @params number $template_id - the template ID - * @params number $user_id - the current user ID - * @return bool - is the user an editor of this file - * @copyright Copyright (c) 2008,2009 University of Nottingham - * @package - */ - -function is_user_an_editor($template_id, $user_id){ - - global $xerte_toolkits_site; - - $query = "select role from " . $xerte_toolkits_site->database_table_prefix . "templaterights where user_id=\"" . $user_id . "\" and template_id=\"" . $template_id . "\""; - - $query_response = mysql_query($query); - - $row = mysql_fetch_array($query_response); - - if(($row['role']=="creator")||($row['role']=="editor")){ - - return true; - - }else{ - - return false; - - } - -} - - /** - * - * Function template_access_settings - * - * @author Patrick Lockley - * @version 1.0 - * @params number $template_id - the template ID - * @return string - the value in access to whom for this template - * @copyright Copyright (c) 2008,2009 University of Nottingham - * @package - */ - -function template_access_settings($id){ - - global $xerte_toolkits_site; - - $query_for_template_status = "select " . $xerte_toolkits_site->database_table_prefix . "templatedetails.access_to_whom from " . $xerte_toolkits_site->database_table_prefix . "templatedetails where template_id=\"" . $id . "\""; - - $query_response = mysql_query($query_for_template_status); - - $row = mysql_fetch_array($query_response); - - return $row['access_to_whom']; - -} - - /** - * - * Function template_access_settings ******* CHECK THIS *************** - * - * @author Patrick Lockley - * @version 1.0 - * @params number $template_id - the template ID - * @params number $user_id - the current user ID - * @return bool - does this ID have rights to this template - * @copyright Copyright (c) 2008,2009 University of Nottingham - * @package - */ - -function template_access_settings_temp(){ - - global $xerte_toolkits_site; - - $query_for_template_status = "select " . $xerte_toolkits_site->database_table_prefix . "templatedetails.access_to_whom from " . $xerte_toolkits_site->database_table_prefix . "templatedetails where template_id=\"" . $_GET['template_id'] . "\""; - - $query_response = mysql_query($query_for_template_status); - - $row = mysql_fetch_array($query_response); - - return $row['access_to_whom']; - -} - - /** - * - * Function is user creator - * - * @author Patrick Lockley - * @version 1.0 - * @params number $template_id - the template ID - * @return bool - Is this user the creator - * @copyright Copyright (c) 2008,2009 University of Nottingham - * @package - */ - -function is_user_creator($template_id){ - - global $xerte_toolkits_site; - - $query_for_template_status = "select role from " . $xerte_toolkits_site->database_table_prefix . "templaterights where template_id=\"" . $template_id . "\" AND user_id=\"" . $_SESSION['toolkits_logon_id'] . "\""; - - $query_response = mysql_query($query_for_template_status); - - $row = mysql_fetch_array($query_response); - - if($row['role']=="creator"){ - - return true; - - }else{ - - return false; - - } - -} - -?> \ No newline at end of file diff --git a/website_code/php/templates/delete_template.php b/website_code/php/templates/delete_template.php deleted file mode 100644 index 5896784752..0000000000 --- a/website_code/php/templates/delete_template.php +++ /dev/null @@ -1,66 +0,0 @@ -database_table_prefix . "templaterights where template_id=\"" . $safe_template_id . "\""; - - $query_for_folder_id_response = mysql_query($query_for_folder_id); - - $row = mysql_fetch_array($query_for_folder_id_response); - - // delete from the database - - $query_to_delete_template = "update " .$xerte_toolkits_site->database_table_prefix . "templaterights set folder=\"" . get_recycle_bin() . "\" where template_id=\"" . $safe_template_id . "\" and user_id=\"" . $_SESSION['toolkits_logon_id'] . "\""; - - if(mysql_query($query_to_delete_template)){ - - receive_message($_SESSION['toolkits_logon_username'], "ADMIN", "CRITICAL", "Moved file to users recycle bin", "Moved file to users recycle bin"); - - }else{ - - receive_message($_SESSION['toolkits_logon_username'], "ADMIN", "CRITICAL", "Failed to move file to the recycle bin", "Failed to move file to the recycle bin"); - - } - - - }else{ - - echo "Sorry you aren't the creator of this file and as such cannot delete it"; - - } - - }else{ - - echo "Sorry you cannot delete a syndicated project. To delete this project, first turn off syndication in the project's properties."; - - } - - - mysql_close($database_id); - -?> \ No newline at end of file diff --git a/website_code/php/templates/duplicate_template.php b/website_code/php/templates/duplicate_template.php deleted file mode 100644 index cbbf3eebf0..0000000000 --- a/website_code/php/templates/duplicate_template.php +++ /dev/null @@ -1,97 +0,0 @@ -database_table_prefix . "folderdetails where login_id = '" . $_SESSION['toolkits_logon_id'] . "' and folder_parent='0'"; - - //$query_for_root_folder_response = mysql_query($query_for_root_folder); - - //$row_root = mysql_fetch_array($query_for_root_folder_response); - - $query_for_template_type_id = "select " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails.template_type_id, " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails.template_name, template_framework from " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails, " . $xerte_toolkits_site->database_table_prefix . "templatedetails where " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails.template_type_id = " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_type_id AND template_id = '" . mysql_real_escape_string($_POST['template_id']) . "'"; - - $query_for_template_type_id_response = mysql_query($query_for_template_type_id); - - $row_template_type = mysql_fetch_array($query_for_template_type_id_response); - - /* - * create the new template record in the database - */ - - $query_for_new_template = "INSERT INTO " . $xerte_toolkits_site->database_table_prefix . "templatedetails (template_id, creator_id, template_type_id, date_created, date_modified, access_to_whom, template_name) VALUES (\"" . ($maximum_template_id+1) . "\",\"" . $_SESSION['toolkits_logon_id'] . "\", \"" . $row_template_type['template_type_id'] . "\",\"" . date('Y-m-d') . "\",\"" . date('Y-m-d') . "\",\"Private\",\"Copy of " . mysql_real_escape_string($_POST['template_name']) . "\")"; - - if(mysql_query($query_for_new_template)){ - - $query_for_template_rights = "INSERT INTO " . $xerte_toolkits_site->database_table_prefix . "templaterights (template_id,user_id,role, folder) VALUES (\"" . ($maximum_template_id+1) . "\",\"" . $_SESSION['toolkits_logon_id'] . "\", \"creator\" ,\"" . mysql_real_escape_string($folder_id) . "\")"; - - if(mysql_query($query_for_template_rights)){ - - receive_message($_SESSION['toolkits_logon_username'], "ADMIN", "SUCCESS", "Created new template record for the database", $query_for_new_template . " " . $query_for_template_rights); - - include $xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . $row_template_type['template_framework'] . "/duplicate_template.php"; - - duplicate_template(($maximum_template_id+1),$_POST['template_id'],$row_template_type['template_name']); - - }else{ - - receive_message($_SESSION['toolkits_logon_username'], "ADMIN", "CRITICAL", "Failed to create new template record for the database", $query_for_template_rights); - - echo("FAILED-" . $_SESSION['toolkits_most_recent_error']); - - } - - }else{ - - receive_message($_SESSION['toolkits_logon_username'], "ADMIN", "CRITICAL", "Failed to create new template record for the database", $query_for_new_template); - - echo("FAILED-" . $_SESSION['toolkits_most_recent_error']); - - } - - mysql_close($database_connect_id); - - }else{ - - echo "Only project creators can duplicate a project"; - - } - -?> \ No newline at end of file diff --git a/website_code/php/templates/general_templates.php b/website_code/php/templates/general_templates.php deleted file mode 100644 index 36d669c266..0000000000 --- a/website_code/php/templates/general_templates.php +++ /dev/null @@ -1,22 +0,0 @@ - \ No newline at end of file diff --git a/website_code/php/templates/new_template.php b/website_code/php/templates/new_template.php deleted file mode 100644 index 17d6bce1b0..0000000000 --- a/website_code/php/templates/new_template.php +++ /dev/null @@ -1,80 +0,0 @@ -database_table_prefix . "originaltemplatesdetails where template_name = '" . $_POST['tutorialid'] . "'"; - - $query_for_template_type_id_response = mysql_query($query_for_template_type_id); - - $row_template_type = mysql_fetch_array($query_for_template_type_id_response); - - /* - * create the new template record in the database - */ - - $query_for_new_template = "INSERT INTO " . $xerte_toolkits_site->database_table_prefix . "templatedetails (template_id, creator_id, template_type_id, date_created, date_modified, access_to_whom, template_name) VALUES (\"" . ($maximum_template_id+1) . "\",\"" . $_SESSION['toolkits_logon_id'] . "\", \"" . $row_template_type['template_type_id'] . "\",\"" . date('Y-m-d') . "\",\"" . date('Y-m-d') . "\",\"Private\",\"" . str_replace(" ","_", mysql_real_escape_string($_POST['tutorialname'])) . "\")"; - - if(mysql_query($query_for_new_template)){ - - $query_for_template_rights = "INSERT INTO " . $xerte_toolkits_site->database_table_prefix . "templaterights (template_id,user_id,role, folder) VALUES (\"" . ($maximum_template_id+1) . "\",\"" . $_SESSION['toolkits_logon_id'] . "\", \"creator\" ,\"" . $root_folder_id . "\")"; - - if(mysql_query($query_for_template_rights)){ - - receive_message($_SESSION['toolkits_logon_username'], "ADMIN", "SUCCESS", "Created new template record for the database", $query_for_new_template . " " . $query_for_template_rights); - - include $xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . $row_template_type['template_framework'] . "/new_template.php"; - - create_new_template(($maximum_template_id+1),$_POST['tutorialid']); - - echo ($maximum_template_id+1); - - }else{ - - receive_message($_SESSION['toolkits_logon_username'], "ADMIN", "CRITICAL", "Failed to create new template record for the database", $query_for_template_rights); - - echo("FAILED-" . $_SESSION['toolkits_most_recent_error']); - - } - - }else{ - - receive_message($_SESSION['toolkits_logon_username'], "ADMIN", "CRITICAL", "Failed to create new template record for the database", $query_for_new_template); - - echo("FAILED-" . $_SESSION['toolkits_most_recent_error']); - - } - - mysql_close($database_connect_id); - -?> \ No newline at end of file diff --git a/website_code/php/templates/remove_template.php b/website_code/php/templates/remove_template.php deleted file mode 100644 index cff09f2f14..0000000000 --- a/website_code/php/templates/remove_template.php +++ /dev/null @@ -1,100 +0,0 @@ -database_table_prefix . "templaterights where template_id=\"" . $safe_template_id . "\""; - - $query_for_folder_id_response = mysql_query($query_for_folder_id); - - $row = mysql_fetch_array($query_for_folder_id_response); - - /* - * delete from the database - */ - - $query_to_delete_template = "delete from " .$xerte_toolkits_site->database_table_prefix . "templaterights where template_id=\"" . $safe_template_id . "\""; - - if(mysql_query($query_to_delete_template)){ - - /* - * work out the file path before we start deletion - */ - - $query_to_get_template_type_id = " select template_type_id from " .$xerte_toolkits_site->database_table_prefix . "templatedetails where template_id = \"" . $safe_template_id . "\""; - - $query_to_get_template_type_id_response = mysql_query($query_to_get_template_type_id); - - $row_template_id = mysql_fetch_array($query_to_get_template_type_id_response); - - $query_to_get_template_type_name = "select template_name, template_framework from " .$xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails where template_type_id =\"" . $row_template_id['template_type_id'] . "\""; - - $query_to_get_template_type_name_response = mysql_query($query_to_get_template_type_name); - - $row_template_name = mysql_fetch_array($query_to_get_template_type_name_response); - - $path = $xerte_toolkits_site->users_file_area_full . $safe_template_id . "-" . $_SESSION['toolkits_logon_username'] . "-" . $row_template_name['template_name']; - - /* - * delete from the file system - */ - - include $xerte_toolkits_site->root_file_path . $xerte_toolkits_site->module_path . $row_template_name['template_framework'] . "/delete_template.php"; - - delete_template($path . "/"); - - $query_to_delete_template_attributes = "delete from " .$xerte_toolkits_site->database_table_prefix . "templatedetails where template_id=\"" . $safe_template_id . "\""; - - mysql_query($query_to_delete_template_attributes); - - $query_to_delete_syndication = "delete from " .$xerte_toolkits_site->database_table_prefix . "templatesyndication where template_id=\"" . $safe_template_id . "\""; - - mysql_query($query_to_delete_syndication); - - $query_to_delete_xml_and_peer = "delete from " .$xerte_toolkits_site->database_table_prefix . "additional_sharing where template_id=\"" . $safe_template_id . "\""; - - mysql_query($query_to_delete_xml_and_peer); - - }else{ - - - } - - }else{ - - echo "Sorry you aren't the creator of this file and as such cannot delete it"; - - } - - }else{ - - echo "Sorry, this file is syndicated and syndicated files cannot be deleted"; - - } - - mysql_close($database_id); - -?> \ No newline at end of file diff --git a/website_code/php/templates/sort_templates.php b/website_code/php/templates/sort_templates.php deleted file mode 100644 index e6d87bec83..0000000000 --- a/website_code/php/templates/sort_templates.php +++ /dev/null @@ -1,21 +0,0 @@ - \ No newline at end of file diff --git a/website_code/php/templates/your_templates.php b/website_code/php/templates/your_templates.php deleted file mode 100644 index eb88441075..0000000000 --- a/website_code/php/templates/your_templates.php +++ /dev/null @@ -1,21 +0,0 @@ - \ No newline at end of file diff --git a/website_code/php/url_library.php b/website_code/php/url_library.php deleted file mode 100644 index 61c4516aeb..0000000000 --- a/website_code/php/url_library.php +++ /dev/null @@ -1,194 +0,0 @@ -apache=="true"){ - - return $string . "_" . $template_number; - - }else{ - - return "play.php?template_id=" . $template_number; - - } - break; - - case "preview":if($xerte_toolkits_site->apache=="true"){ - - return $string . "_" . $template_number; - - }else{ - - return "preview.php?template_id=" . $template_number; - - } - break; - - case "edit": if($xerte_toolkits_site->apache=="true"){ - - return $string . "_" . $template_number; - - }else{ - - return "edit.php?template_id=" . $template_number; - - } - break; - - case "properties": if($xerte_toolkits_site->apache=="true"){ - - return $string . "_" . $template_number; - - }else{ - - return "properties.php?template_id=" . $template_number; - - } - break; - - case "folderproperties": if($xerte_toolkits_site->apache=="true"){ - - return $string . "_" . $template_number; - - }else{ - - return "edit.php?template_id=" . $template_number; - - } - break; - - case "export": if($xerte_toolkits_site->apache=="true"){ - - return $string . "_" . $template_number; - - }else{ - - return $xerte_toolkits_site->php_library_path . "scorm/export.php?scorm=false&template_id=" . $template_number; - - } - break; - - case "scorm": if($xerte_toolkits_site->apache=="true"){ - - return $string . "_" . $template_number; - - }else{ - - return $xerte_toolkits_site->php_library_path . "scorm/export.php?scorm=true&template_id=" . $template_number; - - } - break; - - case "drawing": if($xerte_toolkits_site->apache=="true"){ - - return $string . "_" . $template_number; - - }else{ - - return "drawing.php?template_id=" . $template_number; - - } - break; - - case "peerreview": if($xerte_toolkits_site->apache=="true"){ - - return $string . "_" . $template_number; - - }else{ - - return "peer.php?template_id=" . $template_number; - - } - break; - - case "xml": if($xerte_toolkits_site->apache=="true"){ - - return $string . "_" . $template_number; - - }else{ - - return "data.php?template_id=" . $template_number; - - } - break; - - case "RSS": if($xerte_toolkits_site->apache=="true"){ - - return "RSS/"; - - }else{ - - return "rss.php"; - - } - break; - - case "RSS_user": - - if($xerte_toolkits_site->apache=="true"){ - - return "RSS/" . $template_number . "/"; - - }else{ - - return "rss.php?username=" . $template_number; - - - } - break; - - case "RSS_user_folder": if($xerte_toolkits_site->apache=="true"){ - - return "RSS/" . $template_id . "/"; - - }else{ - - return "rss.php?username=" . $template_number; - - } - - case "RSS_export": if($xerte_toolkits_site->apache=="true"){ - - return "export/"; - - }else{ - - return "export.php"; - - } - break; - - case "RSS_syndicate": if($xerte_toolkits_site->apache=="true"){ - - return "syndication/"; - - }else{ - - return "syndicate.php"; - - } - break; - - default : break; - - - } - - } - -?> \ No newline at end of file diff --git a/website_code/php/user_library.php b/website_code/php/user_library.php deleted file mode 100644 index 180714d77f..0000000000 --- a/website_code/php/user_library.php +++ /dev/null @@ -1,280 +0,0 @@ -database_table_prefix . "logindetails where username ='" . $session_login_ldap . "'"; - - $query_response = mysql_query($query_for_users_first_time); - - if($query_response!=FALSE){ - - if(mysql_num_rows($query_response)==0){ - - return true; - - }else{ - - return false; - - } - - }else{ - - receive_message($session_login_ldap, "ADMIN", "CRITICAL", "Failed to check if the users first time", "Failed to check if the users first time"); - - } - -} - - /** - * - * Function get user id - * get the user's database ID - * @author Patrick Lockley - * @version 1.0 - * @return number - The user's database id - * @copyright Copyright (c) 2008,2009 University of Nottingham - * @package - */ - -function get_user_id(){ - - global $xerte_toolkits_site; - - $query_for_user_id = "select login_id from " . $xerte_toolkits_site->database_table_prefix . "logindetails where username ='" . $_SESSION['toolkits_logon_username'] . "'"; - - $query_response = mysql_query($query_for_user_id); - - if($query_response!=FALSE){ - - $row = mysql_fetch_array($query_response); - - return $row['login_id']; - - }else{ - - receive_message($_SESSION['toolkits_logon_username'], "ADMIN", "CRITICAL", "Failed to get users ID", "Failed to get users ID"); - - } - -} - - /** - * - * Function create user id - * If a new user, create an ID - * @author Patrick Lockley - * @version 1.0 - * @return number - the user id - * @copyright Copyright (c) 2008,2009 University of Nottingham - * @package - */ - -function create_user_id(){ - - global $xerte_toolkits_site; - - $query = "insert into " . $xerte_toolkits_site->database_table_prefix . "logindetails (username, lastlogin, firstname, surname) values ('" . $_SESSION['toolkits_logon_username'] . "','" . date('Y-m-d') . "','" . $_SESSION['toolkits_firstname'] . "','" . $_SESSION['toolkits_surname'] . "')"; - - if(mysql_query($query)){ - - receive_message($_SESSION['toolkits_logon_username'], "ADMIN", "CRITICAL", "Succeeded in creating users ID", "Succeeded in creating users ID"); - - return get_user_id(); - - }else{ - - receive_message($_SESSION['toolkits_logon_username'], "ADMIN", "CRITICAL", "Failed to create users ID", "Failed to create users ID"); - - } - -} - - /** - * - * Function recycle bin - * looks for a reycle bin and if can't find one, make it. - * @author Patrick Lockley - * @version 1.0 - * @copyright Copyright (c) 2008,2009 University of Nottingham - * @package - */ - -function recycle_bin(){ - - global $xerte_toolkits_site; - - $query = "select folder_name from " . $xerte_toolkits_site->database_table_prefix . "folderdetails where folder_name=\"recyclebin\" and login_id=\"" . $_SESSION['toolkits_logon_id'] . "\""; - - $query_response = mysql_query($query); - - $root_folder = get_user_root_folder(); - - if(mysql_num_rows($query_response)==0){ - - $query = "insert into " . $xerte_toolkits_site->database_table_prefix . "folderdetails (login_id,folder_parent,folder_name) VALUES (\"" . $_SESSION['toolkits_logon_id'] . "\", \"0\", \"recyclebin\" )"; - - if(mysql_query($query)){ - - receive_message($_SESSION['toolkits_logon_username'], "ADMIN", "SUCCESS", "Succeeded in creating users recycle bin " .$_SESSION['toolkits_logon_id'], "Succeeded in creating users root folder " .$_SESSION['toolkits_logon_id']); - - }else{ - - receive_message($_SESSION['toolkits_logon_username'], "ADMIN", "CRITICAL", "Failed to create users recycle bin", "Failed to create users recycle bin"); - - } - - } - -} - - /** - * - * Function get recycle bin - * Is this the users first time - * @author Patrick Lockley - * @version 1.0 - * @return number - folder id for the recycle bin - * @copyright Copyright (c) 2008,2009 University of Nottingham - * @package - */ - -function get_recycle_bin(){ - - global $xerte_toolkits_site; - - $query = "select folder_id from " . $xerte_toolkits_site->database_table_prefix . "folderdetails where folder_name=\"recyclebin\" AND login_id=\"" . $_SESSION['toolkits_logon_id'] . "\""; - - $query_response = mysql_query($query); - - $row = mysql_fetch_array($query_response); - - return $row['folder_id']; - -} - - /** - * - * Function create a virtual root folder - * Creates the root folder for the user - * @author Patrick Lockley - * @version 1.0 - * @copyright Copyright (c) 2008,2009 University of Nottingham - * @package - */ - -function create_a_virtual_root_folder(){ - - global $xerte_toolkits_site; - - $query = "insert into " . $xerte_toolkits_site->database_table_prefix . "folderdetails (login_id,folder_parent,folder_name) VALUES (\"" . $_SESSION['toolkits_logon_id'] . "\", \"0\", \"". $_SESSION['toolkits_logon_username'] . "\" )"; - - if(mysql_query($query)){ - - receive_message($_SESSION['toolkits_logon_username'], "ADMIN", "SUCCESS", "Succeeded in creating users root folder " .$_SESSION['toolkits_logon_id'], "Succeeded in creating users root folder " .$_SESSION['toolkits_logon_id']); - - }else{ - - receive_message($_SESSION['toolkits_logon_username'], "ADMIN", "CRITICAL", "Failed to create users root folder", "Failed to create users root folder"); - - } - -} - - /** - * - * Function update user logon time - * Modify the time the user last accessed the system - * @author Patrick Lockley - * @version 1.0 - * @copyright Copyright (c) 2008,2009 University of Nottingham - * @package - */ - -function update_user_logon_time(){ - - global $xerte_toolkits_site; - - $query = "UPDATE " . $xerte_toolkits_site->database_table_prefix . "logindetails SET lastlogin = '" . date('Y-m-d') . "' WHERE username = '" . $_SESSION['toolkits_logon_username'] . "'"; - - if(mysql_query($query)){ - - receive_message($_SESSION['toolkits_logon_username'], "ADMIN", "SUCCESS", "Succeeded in updating users login time " . $_SESSION['toolkits_logon_username'], "Succeeded in updating users login time " .$_SESSION['toolkits_logon_id']); - - }else{ - - receive_message($_SESSION['toolkits_logon_username'], "ADMIN", "MINOR", "Failed to update users login time", "Failed to update users login time"); - - } - -} - - /** - * - * Function get user root folder - * Get the id for the users root folder - * @author Patrick Lockley - * @version 1.0 - * @copyright Copyright (c) 2008,2009 University of Nottingham - * @package - */ - -function get_user_root_folder(){ - - global $xerte_toolkits_site; - - $query = "select folder_id from " . $xerte_toolkits_site->database_table_prefix . "folderdetails where login_id='" . $_SESSION['toolkits_logon_id'] . "' AND folder_name = '" . $_SESSION['toolkits_logon_username'] . "'"; - - $query_response = mysql_query($query); - - if($query_response!=FALSE){ - - $row = mysql_fetch_array($query_response); - - return $row['folder_id']; - - }else{ - - receive_message($_SESSION['toolkits_logon_username'], "ADMIN", "CRITICAL", "Failed to get users root folder", "Failed to get users root folder"); - - } - -} - - - /** - * - * Function is user admin - * Is this user set as an administrator - * @author Patrick Lockley - * @version 1.0 - * @return bool - Is this the user an administrator - * @copyright Copyright (c) 2008,2009 University of Nottingham - * @package - */ - -function is_user_admin(){ - - global $xerte_toolkits_site; - - if($_SESSION['toolkits_logon_id']=="site_administrator"){ - - return true; - - } - -} - -?> \ No newline at end of file diff --git a/website_code/php/versioncontrol/template_close.php b/website_code/php/versioncontrol/template_close.php deleted file mode 100644 index eceb681696..0000000000 --- a/website_code/php/versioncontrol/template_close.php +++ /dev/null @@ -1,80 +0,0 @@ -users_file_area_full . $_POST['file_path'] . "lockfile.txt")){ - - /* - * Code to delete the lock file - */ - - include('../database_library.php'); - - $lock_file_data = file_get_contents($xerte_toolkits_site->users_file_area_full . $temp_array[0] . "-" . $temp_array[1] . "-" . $temp_array[2] . "/lockfile.txt"); - - $temp = explode("*",$lock_file_data); - - $lock_file_creator = $temp[0]; - - $template_id = explode("-",$_POST['file_path']); - - $mysql_id = database_connect("Version Control Database connect success","Version Control database connect failed"); - - $query_for_file_name = "select template_name from " . $xerte_toolkits_site->database_table_prefix . "templatedetails where template_id =\"" . $template_id[0] . "\""; - - $query_response = mysql_query($query_for_file_name); - - $row_template_name = mysql_fetch_array($query_response); - - $user_list = $temp[1]; - - $users = explode(" ",$user_list); - - /* - * Email users in the lock file - */ - - for($x=0;$x!=count($users)-1;$x++){ - - mail($users[$x] . "@" . $xerte_toolkits_site->email_add_to_username, "File available - \"" . str_replace("_"," ",$row_template_name['template_name']) ."\"", "Hello,

You've requested to be informed when the file \"" . str_replace("_"," ",$row_template_name['template_name']) . "\" becomes available for editing. The file was made available at " . date("h:i a") . " on " . date("l, jS F") . "

Please note that multiple requests may have been made, and as such you may not be the only person to have receive one of these notifications. As such the file may well be locked by somebody else.

Please log into the site at site_url . "\">" . $xerte_toolkits_site->site_url . ".

Thank you,

the Xerte Online toolkits team", $xerte_toolkits_site->headers); - - } - - unlink($xerte_toolkits_site->users_file_area_full . $_POST['file_path'] . "lockfile.txt"); - -} - - /* - * Code to check to see if we should warn on a publish - */ - -if(is_user_an_editor($temp_array[0],$_SESSION['toolkits_logon_id'])){ - - $preview_xml = file_get_contents($xerte_toolkits_site->users_file_area_full . $temp_array[0] . "-" . $temp_array[1] . "-" . $temp_array[2] . "/preview.xml"); - - $data_xml = file_get_contents($xerte_toolkits_site->users_file_area_full . $temp_array[0] . "-" . $temp_array[1] . "-" . $temp_array[2] . "/data.xml"); - - if($data_xml!=$preview_xml){ - - echo "Would you like to publish your changes?~*~" . $xerte_toolkits_site->users_file_area_full . $temp_array[0] . "-" . $temp_array[1] . "-" . $temp_array[2]; - - } - -} - - -?> \ No newline at end of file diff --git a/website_code/php/versioncontrol/update_file.php b/website_code/php/versioncontrol/update_file.php deleted file mode 100644 index 38ba2c5487..0000000000 --- a/website_code/php/versioncontrol/update_file.php +++ /dev/null @@ -1,59 +0,0 @@ -users_file_area_full,"",stripcslashes($_POST['file_path']))); - -}else{ - - $query_for_play_content_strip = str_replace("\" . \$xerte_toolkits_site->database_table_prefix . \"", $xerte_toolkits_site->database_table_prefix, $xerte_toolkits_site->play_edit_preview_query); - - $query_for_play_content = str_replace("TEMPLATE_ID_TO_REPLACE", mysql_real_escape_string($_POST['template_id']), $query_for_play_content_strip); - - $query_for_play_content_response = mysql_query($query_for_play_content); - - $row_play = mysql_fetch_array($query_for_play_content_response); - - $temp_array = array(); - - array_push($temp_array, mysql_real_escape_string($_POST['template_id'])); - - array_push($temp_array, $row_play['username']); - - array_push($temp_array, $row_play['template_name']); - -} - /* - * Code to sync files - */ - -if(is_user_an_editor($temp_array[0],$_SESSION['toolkits_logon_id'])){ - - $preview_xml = file_get_contents($xerte_toolkits_site->users_file_area_full . $temp_array[0] . "-" . $temp_array[1] . "-" . $temp_array[2] . "/preview.xml"); - - $data_handle = fopen($xerte_toolkits_site->users_file_area_full . $temp_array[0] . "-" . $temp_array[1] . "-" . $temp_array[2] . "/data.xml","w"); - - fwrite($data_handle,$preview_xml); - - fclose($data_handle); - - echo "File updated"; - -} - - -?> \ No newline at end of file diff --git a/website_code/php/workspaceproperties/folder_rss_templates_template.php b/website_code/php/workspaceproperties/folder_rss_templates_template.php deleted file mode 100644 index 00c94a12bb..0000000000 --- a/website_code/php/workspaceproperties/folder_rss_templates_template.php +++ /dev/null @@ -1,69 +0,0 @@ -database_table_prefix . "folderdetails where login_id=\"" . $_SESSION['toolkits_logon_id'] . "\" and folder_parent!=\"0\""; - - $query_folder_response = mysql_query($query_for_folder); - - echo "

My Feeds

"; - - echo "

My RSS feed is
site_url . url_return("RSS_user", $_SESSION['toolkits_firstname'] . "_" . $_SESSION['toolkits_surname'] ) . "\" target=\"new\"> " . $xerte_toolkits_site->site_url . url_return("RSS_user", $_SESSION['toolkits_firstname'] . "_" . $_SESSION['toolkits_surname'] ) . "

"; - - if(mysql_num_rows($query_folder_response)!=0){ - - echo "

The RSS feeds for my folders are

"; - - while($row_folder = mysql_fetch_array($query_folder_response)){ - - echo "

site_url . url_return("RSS_user", $_SESSION['toolkits_firstname'] . "_" . $_SESSION['toolkits_surname'] ); - - if($xerte_toolkits_site->apache=="true"){ - - echo "/" . str_replace("_"," ",$row_folder['folder_name']) . "/"; - - }else{ - - echo "&folder_name=" . str_replace("_"," ",$row_folder['folder_name']); - - } - - echo "\" target=\"new\">" . $xerte_toolkits_site->site_url . url_return("RSS_user", $_SESSION['toolkits_firstname'] . "_" . $_SESSION['toolkits_surname'] ); - - if($xerte_toolkits_site->apache=="true"){ - - echo str_replace("_"," ",$row_folder['folder_name']) . "/"; - - }else{ - - echo "&folder_name=" . str_replace("_"," ",$row_folder['folder_name']); - - } - - echo "

"; - - } - - } - - -?> \ No newline at end of file diff --git a/website_code/php/workspaceproperties/my_properties_template.php b/website_code/php/workspaceproperties/my_properties_template.php deleted file mode 100644 index 487f23d2ab..0000000000 --- a/website_code/php/workspaceproperties/my_properties_template.php +++ /dev/null @@ -1,39 +0,0 @@ -database_table_prefix . "logindetails where login_id=\"" . $_SESSION['toolkits_logon_id'] . "\""; - - $query_user_response = mysql_query($query_for_user); - - $row_user = mysql_fetch_array($query_user_response); - - echo "

My Details

"; - - echo "

My name on the system is " . $row_user['firstname'] . " " . $row_user['surname'] . "

"; - - echo "

My last login was on " . $row_user['lastlogin'] . "

"; - - echo "

My username is " . $row_user['username'] . "

"; - -?> \ No newline at end of file diff --git a/website_code/php/workspaceproperties/peer_templates_template.php b/website_code/php/workspaceproperties/peer_templates_template.php deleted file mode 100644 index 229c74a8b1..0000000000 --- a/website_code/php/workspaceproperties/peer_templates_template.php +++ /dev/null @@ -1,47 +0,0 @@ -My projects

"; - - echo ""; - - $database_connect_id = database_connect("Folder_content_template.php connect success","Folder_content_template.php connect failed"); - - $query_for_peer_templates = "select * from " . $xerte_toolkits_site->database_table_prefix . "templatedetails, " . $xerte_toolkits_site->database_table_prefix . "templaterights, " . $xerte_toolkits_site->database_table_prefix . "additional_sharing where creator_id=\"" . $_SESSION['toolkits_logon_id'] . "\" and " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_id = " . $xerte_toolkits_site->database_table_prefix . "templaterights.template_id and " . $xerte_toolkits_site->database_table_prefix . "templaterights.template_id = " . $xerte_toolkits_site->database_table_prefix . "additional_sharing.template_id and sharing_type=\"peer\""; - - $query_peer_response = mysql_query($query_for_peer_templates); - - echo "
"; - - echo "
Name
Peer review
"; - - while($row_template_name = mysql_fetch_array($query_peer_response)){ - - echo "
" . $row_template_name['template_name'] . "
On
"; - - } - - echo "
"; - - echo "
"; - -?> \ No newline at end of file diff --git a/website_code/php/workspaceproperties/public_templates_template.php b/website_code/php/workspaceproperties/public_templates_template.php deleted file mode 100644 index 53dc3fc6c6..0000000000 --- a/website_code/php/workspaceproperties/public_templates_template.php +++ /dev/null @@ -1,45 +0,0 @@ -My projects

"; - - echo ""; - - $database_connect_id = database_connect("Folder_content_template.php connect success","Folder_content_template.php connect failed"); - - $query_for_public_templates = "select * from " . $xerte_toolkits_site->database_table_prefix . "templatedetails, " . $xerte_toolkits_site->database_table_prefix . "templaterights where access_to_whom=\"public\" and user_id =\"" . $_SESSION['toolkits_logon_id'] . "\" and " . $xerte_toolkits_site->database_table_prefix . "templaterights.template_id=" . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_id ORDER BY template_name DESC"; - - $query_public_response = mysql_query($query_for_public_templates); - - echo "
"; - - echo "
Name
"; - - while($row_template_name = mysql_fetch_array($query_public_response)){ - - echo "
" . $row_template_name['template_name'] . "
"; - - } - - echo "
"; - -?> \ No newline at end of file diff --git a/website_code/php/workspaceproperties/rss_templates_template.php b/website_code/php/workspaceproperties/rss_templates_template.php deleted file mode 100644 index f762e6acec..0000000000 --- a/website_code/php/workspaceproperties/rss_templates_template.php +++ /dev/null @@ -1,70 +0,0 @@ -My projects

"; - - echo ""; - - $database_connect_id = database_connect("Folder_content_template.php connect success","Folder_content_template.php connect failed"); - - $query_for_rss_templates = "select * from " . $xerte_toolkits_site->database_table_prefix . "templatedetails, " . $xerte_toolkits_site->database_table_prefix . "templaterights, " . $xerte_toolkits_site->database_table_prefix . "templatesyndication where creator_id=\"" . $_SESSION['toolkits_logon_id'] . "\" and " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_id = " . $xerte_toolkits_site->database_table_prefix . "templaterights.template_id and " . $xerte_toolkits_site->database_table_prefix . "templaterights.template_id = " . $xerte_toolkits_site->database_table_prefix . "templatesyndication.template_id and (rss=\"true\" or export=\"true\")"; - - $query_rss_response = mysql_query($query_for_rss_templates); - - echo "
"; - - echo "
Name
RSS
Export
"; - - while($row_template_name = mysql_fetch_array($query_rss_response)){ - - echo "
" . $row_template_name['template_name'] . "
"; - - if($row_template_name['rss']){ - - echo " On "; - - }else{ - - echo " Off "; - - } - - echo "
"; - if($row_template_name['export']){ - - echo " On "; - - }else{ - - echo " Off "; - - } - - echo "
"; - - } - - echo "
"; - - echo "
"; - -?> \ No newline at end of file diff --git a/website_code/php/workspaceproperties/shared_templates_template.php b/website_code/php/workspaceproperties/shared_templates_template.php deleted file mode 100644 index a0aa694fc0..0000000000 --- a/website_code/php/workspaceproperties/shared_templates_template.php +++ /dev/null @@ -1,48 +0,0 @@ -My projects

"; - - echo ""; - - $database_connect_id = database_connect("Folder_content_template.php connect success","Folder_content_template.php connect failed"); - - $query_for_shared_templates = "select * from " . $xerte_toolkits_site->database_table_prefix . "logindetails, " . $xerte_toolkits_site->database_table_prefix . "templatedetails, " . $xerte_toolkits_site->database_table_prefix . "templaterights where user_id=\"" . $_SESSION['toolkits_logon_id'] . "\" and role!=\"creator\" and " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_id = " . $xerte_toolkits_site->database_table_prefix . "templaterights.template_id and creator_id = login_id"; - - $query_shared_response = mysql_query($query_for_shared_templates); - - echo "
"; - - echo "
Name
creator
"; - - while($row_template_name = mysql_fetch_array($query_shared_response)){ - - echo "
" . $row_template_name['template_name'] . "
"; - echo "
" . $row_template_name['firstname'] . " " . $row_template_name['surname'] . "
"; - - } - - echo "
"; - - echo "
"; - -?> \ No newline at end of file diff --git a/website_code/php/workspaceproperties/syndication_templates_template.php b/website_code/php/workspaceproperties/syndication_templates_template.php deleted file mode 100644 index d09b1dae1b..0000000000 --- a/website_code/php/workspaceproperties/syndication_templates_template.php +++ /dev/null @@ -1,59 +0,0 @@ -My projects

"; - - echo ""; - - $database_connect_id = database_connect("Folder_content_template.php connect success","Folder_content_template.php connect failed"); - - $query_for_rss_templates = "select * from " . $xerte_toolkits_site->database_table_prefix . "templatedetails, " . $xerte_toolkits_site->database_table_prefix . "templaterights, " . $xerte_toolkits_site->database_table_prefix . "templatesyndication where creator_id=\"" . $_SESSION['toolkits_logon_id'] . "\" and " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_id = " . $xerte_toolkits_site->database_table_prefix . "templaterights.template_id and " . $xerte_toolkits_site->database_table_prefix . "templaterights.template_id = " . $xerte_toolkits_site->database_table_prefix . "templatesyndication.template_id and (rss=\"true\" or export=\"true\")"; - - $query_rss_response = mysql_query($query_for_rss_templates); - - echo "
"; - - echo "
Name
Syndication
"; - - while($row_template_name = mysql_fetch_array($query_rss_response)){ - - echo "
" . $row_template_name['template_name'] . "
"; - - if($row_template_name['syndication']){ - - echo " On "; - - }else{ - - echo " Off "; - - } - - echo "
"; - - } - - echo "
"; - - echo "
"; - -?> \ No newline at end of file diff --git a/website_code/php/workspaceproperties/usage_templates_template.php b/website_code/php/workspaceproperties/usage_templates_template.php deleted file mode 100644 index 19e9a77d3b..0000000000 --- a/website_code/php/workspaceproperties/usage_templates_template.php +++ /dev/null @@ -1,48 +0,0 @@ -My projects

"; - - echo ""; - - $database_connect_id = database_connect("Folder_content_template.php connect success","Folder_content_template.php connect failed"); - - $query_for_shared_templates = "select * from " . $xerte_toolkits_site->database_table_prefix . "templatedetails, " . $xerte_toolkits_site->database_table_prefix . "templaterights where user_id=\"" . $_SESSION['toolkits_logon_id'] . "\" and " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_id = " . $xerte_toolkits_site->database_table_prefix . "templaterights.template_id"; - - $query_shared_response = mysql_query($query_for_shared_templates); - - echo "
"; - - echo "
Name
Plays
"; - - while($row_template_name = mysql_fetch_array($query_shared_response)){ - - echo "
" . $row_template_name['template_name'] . "
"; - echo "
" . $row_template_name['number_of_uses'] . "
"; - - } - - echo "
"; - - echo "
"; - -?> \ No newline at end of file diff --git a/website_code/php/workspaceproperties/workspace_templates_template.php b/website_code/php/workspaceproperties/workspace_templates_template.php deleted file mode 100644 index a31da2fffe..0000000000 --- a/website_code/php/workspaceproperties/workspace_templates_template.php +++ /dev/null @@ -1,47 +0,0 @@ -My projects

"; - - echo ""; - - $database_connect_id = database_connect("Folder_content_template.php connect success","Folder_content_template.php connect failed"); - - $query_for_created_templates = "select * from " . $xerte_toolkits_site->database_table_prefix . "templatedetails where creator_id=\"" . $_SESSION['toolkits_logon_id'] . "\" ORDER BY date_created DESC"; - - $query_created_response = mysql_query($query_for_created_templates); - - echo "
"; - - echo "
Name
"; - - while($row_template_name = mysql_fetch_array($query_created_response)){ - - echo "
" . $row_template_name['template_name'] . "
"; - - } - - echo "
"; - - echo "
"; - -?> \ No newline at end of file diff --git a/website_code/php/workspaceproperties/xml_templates_template.php b/website_code/php/workspaceproperties/xml_templates_template.php deleted file mode 100644 index 099f6931f9..0000000000 --- a/website_code/php/workspaceproperties/xml_templates_template.php +++ /dev/null @@ -1,47 +0,0 @@ -My projects

"; - - echo ""; - - $database_connect_id = database_connect("Folder_content_template.php connect success","Folder_content_template.php connect failed"); - - $query_for_peer_templates = "select * from " . $xerte_toolkits_site->database_table_prefix . "templatedetails, " . $xerte_toolkits_site->database_table_prefix . "templaterights, " . $xerte_toolkits_site->database_table_prefix . "additional_sharing where creator_id=\"" . $_SESSION['toolkits_logon_id'] . "\" and " . $xerte_toolkits_site->database_table_prefix . "templatedetails.template_id = " . $xerte_toolkits_site->database_table_prefix . "templaterights.template_id and " . $xerte_toolkits_site->database_table_prefix . "templaterights.template_id = " . $xerte_toolkits_site->database_table_prefix . "additional_sharing.template_id and sharing_type=\"xml\""; - - $query_peer_response = mysql_query($query_for_peer_templates); - - echo "
"; - - echo "
Name
XML Sharing
"; - - while($row_template_name = mysql_fetch_array($query_peer_response)){ - - echo "
" . $row_template_name['template_name'] . "
On
"; - - } - - echo "
"; - - echo "
"; - -?> \ No newline at end of file diff --git a/website_code/scripts/ajax_management.js b/website_code/scripts/ajax_management.js deleted file mode 100644 index f38ca79e0e..0000000000 --- a/website_code/scripts/ajax_management.js +++ /dev/null @@ -1,45 +0,0 @@ - /** - * - * Ajax management, global function to check ajax is available - * - * @author Patrick Lockley - * @version 1.0 - * @copyright Copyright (c) 2008,2009 University of Nottingham - * @package - */ - - /** - * - * Function setup ajax - * This function tries to set up ajax - * @return bool - true or false if the ajax has been set up. - * @version 1.0 - * @author Patrick Lockley - */ - -function setup_ajax(){ - - try{ - - xmlHttp=new XMLHttpRequest(); - - }catch (e){ // Internet Explorer - - try{ - - xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); - - }catch (e){ - - try{ - - xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); - - }catch (e){ - - alert("Your browser does not support AJAX!"); - return false; - } - } - } -} \ No newline at end of file diff --git a/website_code/scripts/file_system.js b/website_code/scripts/file_system.js deleted file mode 100644 index f2994a4da4..0000000000 --- a/website_code/scripts/file_system.js +++ /dev/null @@ -1,1002 +0,0 @@ - /** - * - * file system, code for connecting to the database - * - * @author Patrick Lockley - * @version 1.0 - * @copyright Copyright (c) 2008,2009 University of Nottingham - * @package - */ - - /** - * Some global objects to manage the file system - */ - -var mousecursor = new Object; -var drag_manager = new Object; - -/* -* Key last pressed -*/ - -drag_manager.active_key=null; -drag_manager.orig_y=0; -drag_manager.drag = ""; -drag_manager.start_x=0; -drag_manager.start_y=0; - -/* -* Number of files / folders selected -*/ - -drag_manager.selected=0; - -/* -* flag used to indicate a drag has occurred -*/ - -drag_manager.dragged = false; - -/* -* last selected file -*/ - -drag_manager.last_selected = null; -drag_manager.last_mouse_over=null; - -/* -* used in IE - the value that the page has been scrolled -*/ - -drag_manager.scroll_value=0; - -/* -* height of the file area window -*/ - -drag_manager.file_area_top=0; -drag_manager.file_area_bottom=0; - -/* -* list of all files selected -*/ - -drag_manager.selected_items = new Array(); - -document.onkeydown = key_pressed; -document.onkeyup = key_up; - -/* -* arrays used when calculating the mouse position for folder shading and file dropping -*/ - -var folder_div_id = new Array(); -var folder_position_top = new Array(); -var folder_position_bottom = new Array(); - - /** - * - * Function scroll check - * This function checks the amount of scroll in the file area DIV - * @version 1.0 - * @author Patrick Lockley - */ - -function scroll_check(ev,tag){ - - drag_manager.scroll_value = tag.scrollTop; - - folder_positions_find(); - -} - - /** - * - * Function highlight main toggle - * This function highlights the work space and recycle bin highlight - * @param object div_name = the div we wish to highlight, passed as an object - * @version 1.0 - * @author Patrick Lockley - */ - -function highlight_main_toggle(div_name){ - - if(div_name.mainhightlight == undefined){ - - div_name.mainhighlight == true; - - } - - if(!div_name.mainhighlight){ - div_name.style.backgroundColor = "#e8edf3"; - div_name.mainhighlight = true; - }else{ - div_name.style.backgroundColor = "#ffffff"; - div_name.mainhighlight = false; - } - - for(q=0;q")+1) + array_response[1]; - - window_reference.document.getElementById(id).childNodes[0].innerHTML = future_innerHTML; - - - } - } - -} - - /** - * - * Function folders rss template - * This function displays the RSS features for this folder - * @version 1.0 - * @author Patrick Lockley - */ - -function folder_rss_template(){ - - if(setup_ajax()!=false){ - - var url="folder_rss_template.php"; - - folders_ajax_send_prepare(url); - - xmlHttp.send('folder_id=' + window.name); - - } - -} - - /** - * - * Function folders properties - * This function displays the basic properties panel for this folder - * @version 1.0 - * @author Patrick Lockley - */ - -function folderproperties_template(){ - - if(setup_ajax()!=false){ - - var url="folderproperties_template.php"; - - folders_ajax_send_prepare(url); - - xmlHttp.send('folder_id=' + String(window.name).substr(0,String(window.name).indexOf("_"))); - - } - -} - - /** - * - * Function folder content template - * This function shows the content of this folder for the folder content tab - * @version 1.0 - * @author Patrick Lockley - */ - - -function folder_content_template(){ - - if(setup_ajax()!=false){ - - var url="folder_content_template.php"; - - folders_ajax_send_prepare(url); - - xmlHttp.send('folder_id=' + String(window.name).substr(0,String(window.name).indexOf("_"))); - - } - -} - - /** CHECK THIS - OBSOLETE? - * - * Function folders ajax send prepare - * This function sorts out the URL for most of the queries in the folder properties window - * @param string url = the extra part of the url for this ajax query - * @version 1.0 - * @author Patrick Lockley - */ - - -function folder_name_template_a(){ - - if(setup_ajax()!=false){ - - var url="folder_name_template.php"; - - folders_ajax_send_prepare(url); - - xmlHttp.send('folder_id=' + window.name); - - } - -} - - /** - * - * Function rename folder - * This function renames the folder - * @param string folder_id = the id of this folder - * @param string form_tag = the the id of the form - * @version 1.0 - * @author Patrick Lockley - */ - - -function rename_folder(folder_id,form_tag){ - - new_name = document.getElementById(form_tag).childNodes[0].value; - - if(is_ok_name(new_name)){ - - if(setup_ajax()!=false){ - - var url="rename_folder_template.php"; - - xmlHttp.open("post","website_code/php/folderproperties/" + url,true); - xmlHttp.onreadystatechange=folder_rename_stateChanged; - xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - - xmlHttp.send('folder_id=' + folder_id +'&folder_name=' + new_name); - - } - - }else{ - - alert("Sorry that is not a valid name. Please use only numbers and letters"); - - } - -} \ No newline at end of file diff --git a/website_code/scripts/folders.js b/website_code/scripts/folders.js deleted file mode 100644 index 2ba34f6f3e..0000000000 --- a/website_code/scripts/folders.js +++ /dev/null @@ -1,287 +0,0 @@ - /** - * - * folders, code for handling folders - * - * @author Patrick Lockley - * @version 1.0 - * @copyright Copyright (c) 2008,2009 University of Nottingham - * @package - */ - - /** - * - * Function file status stage changed - * This function renames the folder - * @version 1.0 - * @author Patrick Lockley - */ - - -function file_status_stateChanged(){ - - if (xmlHttp.readyState==4){ - - screen_refresh(); - - } -} - -var folder_timeout = 0; - - /** - * - * Function folder status state changed - * This function handles what happens after a new folder has been recreated - * @version 1.0 - * @author Patrick Lockley - */ - - -function folder_status_stateChanged(){ - - if (xmlHttp.readyState==4){ - - document.getElementById("folder_feedback").innerHTML = xmlHttp.responseText; - - screen_refresh(); - - folder_timeout = setTimeout("popup_close()",500); - - } -} - - /** - * - * Function delete folder - * This function deletes a folder - * @param string folder_id = the id of this folder - * @version 1.0 - * @author Patrick Lockley - */ - - -function delete_folder(folder_id){ - - if(setup_ajax()!=false){ - - var url="website_code/php/folders/delete_folder.php"; - - xmlHttp.open("post",url,true); - xmlHttp.onreadystatechange=file_status_stateChanged; - xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - xmlHttp.send('folder_id=' + folder_id); - - } - -} - - /** - * - * Function create folder - * This function creates a folder - * @version 1.0 - * @author Patrick Lockley - */ - - -function create_folder(){ - - if(is_ok_name(document.foldercreateform.foldername.value)){ - - if(setup_ajax()!=false){ - - var url="website_code/php/folders/make_new_folder.php"; - - xmlHttp.open("post",url,true); - xmlHttp.onreadystatechange=folder_status_stateChanged; - xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - - /* - * if a folder is selected, create the folder in that folder - */ - - if(drag_manager.selected_items.length==1){ - - if(drag_manager.last_selected.id!=undefined){ - - if(drag_manager.last_selected.id.indexOf("folder_")!=-1){ - - drag_manager.last_selected.open = true; - - /* - * Add this folder to the open array - */ - - open_folders.push(drag_manager.last_selected); - - xmlHttp.send('folder_id=' + drag_manager.last_selected.id.substr(drag_manager.last_selected.id.indexOf("_")+1,drag_manager.last_selected.id.length) + '&folder_name=' + document.foldercreateform.foldername.value); - - }else{ - - xmlHttp.send('folder_id=' + "file_area" + '&folder_name=' + document.foldercreateform.foldername.value); - - } - - }else{ - - xmlHttp.send('folder_id=' + "file_area" + '&folder_name=' + document.foldercreateform.foldername.value); - - } - - }else{ - - xmlHttp.send('folder_id=' + "file_area" + '&folder_name=' + document.foldercreateform.foldername.value); - - } - - } - - }else{ - - alert("Sorry that is not a valid folder name. Please use only letters and numbers"); - - } - -} - - /** - * - * Function make new folder - * This function shows the new folder pop up - * @version 1.0 - * @author Patrick Lockley - */ - - -function make_new_folder(){ - - /* - * place the folder popup - */ - - tag = document.getElementById("file_area"); - - x=0; - y=0; - - while(tag.className!="pagecontainer"){ - - x += tag.offsetLeft; - y += tag.offsetTop; - - if(tag.parentNode){ - - tag = tag.parentNode; - - }else{ - - break; - - } - - } - - file_area_width = document.getElementById("file_area").offsetWidth; - - document.getElementById("message_box").style.left = x + (file_area_width/2) - 150 + "px"; - document.getElementById("message_box").style.top = y + 100 +"px"; - document.getElementById("message_box").style.display = "block"; - - document.getElementById("message_box").innerHTML = '

What would you like to call your folder?

'; - - - document.getElementById("message_box").style.zindex = 2; - - -} - - /** - * - * Function popup close - * This function closes the new folder pop up - * @version 1.0 - * @author Patrick Lockley - */ - -function popup_close(){ - - clearTimeout(folder_timeout); - - document.getElementById("message_box").style.display = "none"; - document.getElementById("message_box").style.zindex = 0; - -} - - /** - * - * Function copy to folder - * This function moves files and folders to other folders - * @param string items = the id of the item dropped - * @param string items_type = whether file or folder - * @param string items_parent = The previous parent for this item - * @param string destination - the target - * @version 1.0 - * @author Patrick Lockley - */ - -function copy_to_folder(items,items_type,items_parent,destination){ - - files_string = ""; - - for(x=0;x!=items.length;x++){ - - /* - * move through the array, formatting the string - */ - - if(document.getElementById(items[x]).parentNode!=document.getElementById(destination)){ - - if(String(items[x]).indexOf("_")!=-1){ - - items[x]=String(items[x]).substr(String(items[x]).indexOf("_")+1,String(items[x]).length); - - } - - /* - * create the string - file id, then the type, then its parent - */ - - if(files_string==""){ - files_string=items[x]+","+items_type[x]+","+items_parent[x]; - - }else{ - files_string+=","+items[x]+","+items_type[x]+","+items_parent[x]; - } - - - } - - } - - if(destination!="folder_workspace"){ - - if(destination=="folderchild_workspace"){ - - destination = "folder_workspace"; - - }else{ - - destination = destination.substr(destination.indexOf("_")+1,destination.length); - - } - - } - - if(setup_ajax()!=false){ - - var url="website_code/php/folders/copy_to_new_folder.php"; - - xmlHttp.open("post",url,true); - xmlHttp.onreadystatechange=file_status_stateChanged; - xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - - xmlHttp.send('files=' + files_string + '&destination=' + destination); - - } - -} \ No newline at end of file diff --git a/website_code/scripts/import.js b/website_code/scripts/import.js deleted file mode 100644 index 8e57905e3e..0000000000 --- a/website_code/scripts/import.js +++ /dev/null @@ -1,288 +0,0 @@ - /** - * - * import, javascript for the import action - * - * @author Patrick Lockley - * @version 1.0 - * @copyright Copyright (c) 2008,2009 University of Nottingham - * @package - */ - - /** - * - * Function iframe check upload - * This function looks at the iframe where the upload takes place for the end of string marker to see when the code has finished (used on the media upload page). - * @version 1.0 - * @author Patrick Lockley - */ - -var iframe_interval = 0; - -function iframe_check_upload(){ - - if(window["upload_iframe"].document.body.innerHTML!=""){ - - if(window["upload_iframe"].document.body.innerHTML.indexOf("****")!=-1){ - - clearInterval(iframe_interval); - - string = window["upload_iframe"].document.body.innerHTML.substr(window["upload_iframe"].document.body.innerHTML.indexOf(">")+1); - - string = string.substr(0,string.length-4); - - alert(string); - - media_and_quota_template(); - - window["upload_iframe"].document.body.innerHTML=""; - - }else{ - - clearInterval(iframe_interval); - - string = window["upload_iframe"].document.body.innerHTML.substr(window["upload_iframe"].document.body.innerHTML.indexOf(">")+1); - - alert("PHP reports the following error - " + string); - - } - - } - -} - - /** - * - * Function iframe check - * This function looks at the iframe where the upload takes place for the end of string marker to see when the code has finished - * @version 1.0 - * @author Patrick Lockley - */ - -var iframe_interval = 0; - -function iframe_check(){ - - if(window["upload_iframe"].document.body.innerHTML!=""){ - - if(window["upload_iframe"].document.body.innerHTML.indexOf("****")!=-1){ - - clearInterval(iframe_interval); - - string = window["upload_iframe"].document.body.innerHTML.substr(window["upload_iframe"].document.body.innerHTML.indexOf(">")+1); - - string = string.substr(0,string.length-4); - - alert(string); - - window_reference.screen_refresh(); - - window["upload_iframe"].document.body.innerHTML=""; - - }else{ - - clearInterval(iframe_interval); - - string = window["upload_iframe"].document.body.innerHTML.substr(window["upload_iframe"].document.body.innerHTML.indexOf(">")+1); - - alert("PHP reports the following error - " + string); - - } - - } - -} - - /** - * - * Function iframe upload check initialise - * This function starts checking the iframe for the response text every 5 seconds (used by the media quota import page). - * @version 1.0 - * @author Patrick Lockley - */ - -function iframe_upload_check_initialise(){ - - iframe_interval = setInterval("iframe_check_upload()",500); - -} - - - /** - * - * Function iframe check initialise - * This function starts checking the iframe for the response text every 5 seconds - * @version 1.0 - * @author Patrick Lockley - */ - -function iframe_check_initialise(){ - - iframe_interval = setInterval("iframe_check()",500); - -} - - /** - * - * Function import template pop up (OSBOLETE) - * This function repurposes the folder pop up for the import action - * @param string id_to_replace = the id of the template we might replace - * @version 1.0 - * @author Patrick Lockley - */ - -function import_template_pop_up(id_to_replace){ - - /* - * place the folder popup - */ - - tag = document.getElementById("file_area"); - - x=0; - y=0; - - while(tag.className!="pagecontainer"){ - - x += tag.offsetLeft; - y += tag.offsetTop; - - if(tag.parentNode){ - - tag = tag.parentNode; - - }else{ - - break; - - } - - } - - file_area_width = document.getElementById("file_area").offsetWidth; - - document.getElementById("message_box").style.left = x + (file_area_width/2) - 150 + "px"; - document.getElementById("message_box").style.top = y + 100 +"px"; - document.getElementById("message_box").style.display = "block"; - - if(id_to_replace!=undefined){ - - if(id_to_replace.indexOf("folder")!=-1){ - - /* - * Importing into a folder - */ - - document.getElementById(id_to_replace).open=true; - open_folders.push(document.getElementById(id_to_replace)); - - document.getElementById("message_box").innerHTML = '

Import


'; - - }else{ - - document.getElementById("message_box").style.height = "220px"; - - document.getElementById("message_box").innerHTML = '

You are about to replace an exisiting project with the one you are about to import


'; - - } - - }else{ - - document.getElementById("message_box").innerHTML = '

Import



New project name

'; - - } - - document.importform.submitBtn.disabled = true; - - document.getElementById("message_box").style.zindex = 2; - -} - - - /** - * - * Function new template name - * This function prevents imported names being invalid - * @version 1.0 - * @author Patrick Lockley - */ - -function new_template_name(){ - - if(document.importform.templatename.value!=""){ - - if(is_ok_name(document.importform.templatename.value)){ - - document.getElementById("name_wrong").innerHTML = ""; - document.importform.submitBtn.disabled = false; - - }else{ - - document.getElementById("name_wrong").innerHTML = "Sorry that is not a valid name"; - - } - - }else{ - - document.importform.submitBtn.disabled = true; - - } - -} - - /** - * - * Function import template - * This function handles the display of the import pop up - * @version 1.0 - * @author Patrick Lockley - */ - - -function import_template(){ - - if(drag_manager.selected_items.length>=2){ - - alert("Please select only the 1 template you'd like to update - or select no templates if you'd like to import a new version"); - - }else if(drag_manager.selected_items.length==1){ - - if(drag_manager.selected_items[0].className=="file"){ - - alert("Sorry you cannot import over a template"); - - /* - var answer = confirm("By selection this option you will replace this template with a new version - are you sure?"); - - if(answer){ - - import_template_pop_up(drag_manager.selected_items[0].id); - - }*/ - - }else{ - - var answer = confirm("By selection this option you will import a new template into this folder - are you sure?"); - - if(answer){ - - alert(drag_manager.selected_items[0].id); - - import_template_pop_up(drag_manager.selected_items[0].id); - - } - - } - - }else if(drag_manager.selected_items.length==0){ - - var answer = confirm("You are about to import a new template - are you sure?"); - - if(answer){ - - import_template_pop_up(); - - } - - } - -} \ No newline at end of file diff --git a/website_code/scripts/logout.js b/website_code/scripts/logout.js deleted file mode 100644 index c786441d80..0000000000 --- a/website_code/scripts/logout.js +++ /dev/null @@ -1,99 +0,0 @@ - /** - * - * logout, javascript for the code to log a user out - * - * @author Patrick Lockley - * @version 1.0 - * @copyright Copyright (c) 2008,2009 University of Nottingham - * @package - */ - - /** - * - * Function logout ajax send prepare - * This function sends the ajax request to handle the logging out PHP - * @param string url = the extra part of the url for this ajax query - * @version 1.0 - * @author Patrick Lockley - */ - -function logout_ajax_send_prepare(url){ - - xmlHttp.open("post", ajax_php_path + url,true); - xmlHttp.onreadystatechange=logout_stateChanged; - xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - -} - /** - * - * Function logout state changed - * This function redirects the user once logged out - * @param string url = the extra part of the url for this ajax query - * @version 1.0 - * @author Patrick Lockley - */ - -function logout_stateChanged(){ - - if (xmlHttp.readyState==4){ - - if(window.location){ - - window.location = site_url; - - }else{ - - window.location(site_url); - - } - - } -} - - /** - * - * Function logout - * This function sorts out the URL for most of the queries in the folder properties window - * @version 1.0 - * @author Patrick Lockley - */ - -function logout(){ - - /* - * Check no windows are open - */ - - if(edit_window_open.length!=0){ - - var answer = confirm("You currently have " + edit_window_open.length + " editor window(s) open. If you continue you are likely to lose work. Please check you have saved your work and then close these windows down. Are you sure you wish to continue?"); - - if(answer){ - - if(setup_ajax()!=false){ - - var url="logout.php"; - - logout_ajax_send_prepare(url); - - xmlHttp.send(null); - - } - - } - - }else{ - - if(setup_ajax()!=false){ - - var url="logout.php"; - - logout_ajax_send_prepare(url); - - xmlHttp.send(null); - - } - - } - -} diff --git a/website_code/scripts/management.js b/website_code/scripts/management.js deleted file mode 100644 index 567ebabea8..0000000000 --- a/website_code/scripts/management.js +++ /dev/null @@ -1,556 +0,0 @@ -var function_to_use = null; - -var management_ajax_php_path = "website_code/php/management/"; - -// Function properties ajax send prepare -// -// Version 1.0 University of Nottingham -// (pl) -// Generic ajax sender for this script - -function management_ajax_send_prepare(url){ - - xmlHttp.open("post",management_ajax_php_path + url,true); - xmlHttp.onreadystatechange=management_stateChanged; - xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - -} - -// Function management state changed update screen -// -// Version 1.0 University of Nottingham -// (pl) -// Generic ajax handler for this script - -function management_stateChanged(){ - - if (xmlHttp.readyState==4){ - - if(xmlHttp.responseText!=""){ - - document.getElementById('admin_area').innerHTML = xmlHttp.responseText; - - } - } -} - -// Function management state changed alert -// -// Version 1.0 University of Nottingham -// (pl) -// Generic ajax handler for this script - -function management_alert_stateChanged(){ - - if (xmlHttp.readyState==4){ - - if(xmlHttp.responseText!=""){ - - alert(xmlHttp.responseText); - - } - } -} - -// Function feeds list -// -// Version 1.0 University of Nottingham -// (pl) -// remove a share, and check who did it - -function feeds_list(){ - - if(setup_ajax()!=false){ - - var url="syndication.php"; - - management_ajax_send_prepare(url) - - xmlHttp.send('no_id=1'); - - } -} - -// Function remove licenses -// -// Version 1.0 University of Nottingham -// (pl) -// remove a share, and check who did it - -function remove_feed(id,type){ - - if(setup_ajax()!=false){ - - var url="syndication_remove.php"; - - management_ajax_send_prepare(url) - - if(type=="RSS"){ - - xmlHttp.send('template_id=' + id + '&rss=setfalse'); - - } - - if(type=="EXPORT"){ - - xmlHttp.send('template_id=' + id + '&export=setfalse'); - - } - - if(type=="SYND"){ - - xmlHttp.send('template_id=' + id + '&synd=setfalse'); - - } - - } -} - -// Function licenses list -// -// Version 1.0 University of Nottingham -// (pl) -// remove a share, and check who did it - -function licenses_list(){ - - if(setup_ajax()!=false){ - - var url="licenses.php"; - - management_ajax_send_prepare(url) - - xmlHttp.send('no_id=1'); - - } -} - -// Function remove licenses -// -// Version 1.0 University of Nottingham -// (pl) -// remove a share, and check who did it - -function remove_licenses(id){ - - if(setup_ajax()!=false){ - - var url="remove_license.php"; - - management_ajax_send_prepare(url) - - xmlHttp.send('remove=' + id); - - } -} - -// Function categories list -// -// Version 1.0 University of Nottingham -// (pl) -// remove a share, and check who did it - -function categories_list(){ - - function_to_use="user_templates"; - - if(setup_ajax()!=false){ - - var url="categories.php"; - - management_ajax_send_prepare(url) - - xmlHttp.send('no_id=1'); - - } -} - -// Function remove category -// -// Version 1.0 University of Nottingham -// (pl) -// remove a share, and check who did it - -function remove_category(id){ - - if(setup_ajax()!=false){ - - var url="remove_category.php"; - - management_ajax_send_prepare(url) - - xmlHttp.send('remove=' + id); - - } -} - -// Function user templates list -// -// Version 1.0 University of Nottingham -// (pl) -// remove a share, and check who did it - -function user_templates_list(){ - - function_to_use="user_templates"; - - if(setup_ajax()!=false){ - - var url="user_templates.php"; - - management_ajax_send_prepare(url) - - xmlHttp.send('no_id=1'); - - } -} - - -// Function users list -// -// Version 1.0 University of Nottingham -// (pl) -// remove a share, and check who did it - -function users_list(){ - - function_to_use="users"; - - if(setup_ajax()!=false){ - - var url="users.php"; - - management_ajax_send_prepare(url) - - xmlHttp.send('no_id=1'); - - } -} - -// Function site list -// -// Version 1.0 University of Nottingham -// (pl) -// remove a share, and check who did it - -function site_list(){ - - function_to_use="site"; - - if(setup_ajax()!=false){ - - var url="site.php"; - - management_ajax_send_prepare(url) - - xmlHttp.send('no_id=1'); - - } -} - -// Function delete sharing template -// -// Version 1.0 University of Nottingham -// (pl) -// remove a share, and check who did it - -function templates_list(){ - - function_to_use="templates"; - - if(setup_ajax()!=false){ - - var url="templates.php"; - - management_ajax_send_prepare(url) - - xmlHttp.send('no_id=1'); - - } -} - -// Function delete sharing template -// -// Version 1.0 University of Nottingham -// (pl) -// remove a share, and check who did it - -function update_template(){ - - if(setup_ajax()!=false){ - - var url="template_details_management.php"; - - xmlHttp.open("post",management_ajax_php_path + url,true); - xmlHttp.onreadystatechange=management_alert_stateChanged; - xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - - xmlHttp.send('template_id=' + active_section + '&desc=' + document.getElementById(active_section + "desc").value + '&display=' + document.getElementById(active_section + "display").value + '&example=' + document.getElementById(active_section + "example").value + '&access=' + document.getElementById(active_section + "access").value + '&active=' + document.getElementById(active_section + "active").value); - - } - -} - -// Function update play security -// -// Version 1.0 University of Nottingham -// (pl) -// remove a share, and check who did it - -function update_play_security(){ - - if(setup_ajax()!=false){ - - var url="play_security_management.php"; - - xmlHttp.open("post",management_ajax_php_path + url,true); - xmlHttp.onreadystatechange=management_alert_stateChanged; - xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - - xmlHttp.send('play_id=' + active_section + '&security=' + document.getElementById(active_section + "security").value + '&data=' + document.getElementById(active_section + "data").value + '&info=' + document.getElementById(active_section + "info").value); - - } - -} - -// Function remove security -// -// Version 1.0 University of Nottingham -// (pl) -// remove a share, and check who did it - -function remove_security(){ - - if(setup_ajax()!=false){ - - var answer = confirm("Are you sure you want to remove this setting?"); - - if(answer){ - - var url="remove_play_security.php"; - - xmlHttp.open("post",management_ajax_php_path + url,true); - xmlHttp.onreadystatechange=management_stateChanged; - xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - - xmlHttp.send('play_id=' + active_section ); - - } - } - -} - -// Function delete sharing template -// -// Version 1.0 University of Nottingham -// (pl) -// remove a share, and check who did it - -function update_site(){ - - if(setup_ajax()!=false){ - - var url="site_details_management.php"; - - xmlHttp.open("post",management_ajax_php_path + url,true); - xmlHttp.onreadystatechange=management_alert_stateChanged; - xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - - copyright = document.getElementById("copyright").value; - - copyright = copyright.split("©").join("AAA"); - - xmlHttp.send('site_url=' + document.getElementById("site_url").value + '&apache=' + document.getElementById("apache").value + '&site_title=' + document.getElementById("site_title").value + '&site_name=' + document.getElementById("site_name").value + '&site_logo=' + document.getElementById("site_logo").value + '&organisational_logo=' + document.getElementById("organisational_logo").value + '&welcome_message=' + document.getElementById("welcome_message").value + '&site_text=' + document.getElementById("site_text").value + '&news_text=' + document.getElementById("news_text").value + '&pod_one=' + document.getElementById("pod_one").value + '&pod_two=' + document.getElementById("pod_two").value + '©right=' + document.getElementById("copyright").value + '&demonstration_page=' + document.getElementById("demonstration_page").value + '&form_string=' + document.getElementById("form_string").value + '&peer_form_string=' + document.getElementById("peer_form_string").value + '&feedback_list=' + document.getElementById("feedback_list").value + '&rss_title=' + document.getElementById("rss_title").value + '&module_path=' + document.getElementById("module_path").value + '&website_code_path=' + document.getElementById("website_code_path").value + '&users_file_area_short=' + document.getElementById("users_file_area_short").value + '&php_library_path=' + document.getElementById("php_library_path").value + '&root_file_path=' + document.getElementById("root_file_path").value + '&play_edit_preview_query=' + document.getElementById("play_edit_preview_query").value + '&email_error_list=' + document.getElementById("email_error_list").value + '&error_log_message=' + document.getElementById("error_log_message").value + '&error_email_message=' + document.getElementById("error_email_message").value + '&ldap_host=' + document.getElementById("ldap_host").value + '&ldap_port=' + document.getElementById("ldap_port").value + '&bind_pwd=' + document.getElementById("bind_pwd").value + '&base_dn=' + document.getElementById("base_dn").value + '&bind_dn=' + document.getElementById("bind_dn").value + '&flash_save_path=' + document.getElementById("flash_save_path").value + '&flash_upload_path=' + document.getElementById("flash_upload_path").value + '&flash_preview_check_path=' + document.getElementById("flash_preview_check_path").value + '&flash_flv_skin=' + document.getElementById("flash_flv_skin").value + '&site_email_account=' + document.getElementById("site_email_account").value + '&headers=' + document.getElementById("headers").value + '&email_to_add_to_username=' + document.getElementById("email_to_add_to_username").value + '&proxy1=' + document.getElementById("proxy1").value + '&port1=' + document.getElementById("port1").value + '&site_session_name=' + document.getElementById("site_session_name").value + '&synd_publisher=' + document.getElementById("synd_publisher").value + '&synd_rights=' + document.getElementById("synd_rights").value + '&synd_license=' + document.getElementById("synd_license").value + '&import_path=' + document.getElementById("import_path").value + '&mimetypes=' + document.getElementById("mimetypes").value + '&LDAP_preference=' + document.getElementById("LDAP_preference").value + '&LDAP_filter=' + document.getElementById("LDAP_filter").value + '&integration_config_path=' + document.getElementById("integration_config_path").value + '&admin_username=' + document.getElementById("admin_username").value + '&admin_password=' + document.getElementById("admin_password").value); - - } - -} - -// Function delete sharing template -// -// Version 1.0 University of Nottingham -// (pl) -// remove a share, and check who did it - -function user_template(){ - - if(setup_ajax()!=false){ - - var url="user_details_management.php"; - - xmlHttp.open("post",management_ajax_php_path + url,true); - xmlHttp.onreadystatechange=management_alert_stateChanged; - xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - - xmlHttp.send('user_id=' + active_section + '&firstname=' + document.getElementById("firstname" + active_section).value + '&surname=' + document.getElementById("surname"+active_section).value + '&username=' + document.getElementById("username"+active_section).value ); - - } - -} - -// Function play security list -// -// Version 1.0 University of Nottingham -// (pl) -// remove a share, and check who did it - -function play_security_list(template){ - - function_to_use="playsecurity"; - - if(setup_ajax()!=false){ - - var url="play_security_list.php"; - - management_ajax_send_prepare(url); - - xmlHttp.send('logon_id=1'); - - } - -} - -// Function new security -// -// Version 1.0 University of Nottingham -// (pl) -// remove a share, and check who did it - -function new_security(){ - - if(setup_ajax()!=false){ - - var url="new_security.php"; - - xmlHttp.open("post",management_ajax_php_path + url,true); - xmlHttp.onreadystatechange=management_stateChanged; - xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - - xmlHttp.send('newsecurity=' + document.getElementById("newsecurity").value + '&newdata=' + document.getElementById("newdata").value + '&newdesc=' + document.getElementById("newdesc").value); - - } - -} - -// Function new category -// -// Version 1.0 University of Nottingham -// (pl) -// remove a share, and check who did it - -function new_category(){ - - if(setup_ajax()!=false){ - - var url="new_category.php"; - - xmlHttp.open("post",management_ajax_php_path + url,true); - xmlHttp.onreadystatechange=management_stateChanged; - xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - - xmlHttp.send('newcategory=' + document.getElementById("newcategory").value); - - } - -} - -// Function new category -// -// Version 1.0 University of Nottingham -// (pl) -// remove a share, and check who did it - -function new_license(){ - - if(setup_ajax()!=false){ - - var url="new_license.php"; - - xmlHttp.open("post",management_ajax_php_path + url,true); - xmlHttp.onreadystatechange=management_stateChanged; - xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - - xmlHttp.send('newlicense=' + document.getElementById("newlicense").value); - - } - -} - -// Function error list -// -// Version 1.0 University of Nottingham -// (pl) -// remove a share, and check who did it - -function errors_list(template){ - - if(setup_ajax()!=false){ - - var url="error_list.php"; - - management_ajax_send_prepare(url); - - xmlHttp.send('logon_id=1'); - - } - -} - -// Function delete sharing template -// -// Version 1.0 University of Nottingham -// (pl) -// remove a share, and check who did it - -function delete_template(template){ - - if(setup_ajax()!=false){ - - var url="delete_template.php"; - - management_ajax_send_prepare(url); - - xmlHttp.send('template_id=' + template); - - } - -} - -var active_section = null; - -function templates_display(tag){ - - new_tag = tag + "_child"; - - active_section = document.getElementById(tag).getAttribute("savevalue"); - - if(document.getElementById(new_tag).style.display=="block"){ - - document.getElementById(new_tag).style.display="none"; - - }else{ - - document.getElementById(new_tag).style.display="block"; - - } - -} - -function save_changes(){ - - switch(function_to_use){ - - case "templates":update_template(); - break; - case "users":user_template(); - break; - case "site":update_site(); - break; - case "playsecurity":update_play_security(); - break; - default: break; - - - } - -} \ No newline at end of file diff --git a/website_code/scripts/opencloseedit.js b/website_code/scripts/opencloseedit.js deleted file mode 100644 index c54d3c8915..0000000000 --- a/website_code/scripts/opencloseedit.js +++ /dev/null @@ -1,29 +0,0 @@ - /** - * - * open close edit, javascript for the version control - * - * @author Patrick Lockley - * @version 1.0 - * @copyright Copyright (c) 2008,2009 University of Nottingham - * @package - */ - - /** - * - * Function window close - * This function handles the closing of the editor window - * @param string url = the extra part of the url for this ajax query - * @version 1.0 - * @author Patrick Lockley - */ - -function window_close(string){ - - window_reference.close_edit_window(string); - - //close_edit_window(string); - -} - - - diff --git a/website_code/scripts/peer.js b/website_code/scripts/peer.js deleted file mode 100644 index 534e7f86fd..0000000000 --- a/website_code/scripts/peer.js +++ /dev/null @@ -1,52 +0,0 @@ - /** - * - * peer, javascript for the folder properties tab - * - * @author Patrick Lockley - * @version 1.0 - * @copyright Copyright (c) 2008,2009 University of Nottingham - * @package - */ - - /** - * - * Function peer state changed - * This function handle the response from the ajax query - * @version 1.0 - * @author Patrick Lockley - */ - -function peer_stateChanged(){ - - if (xmlHttp.readyState==4){ - - document.getElementById("feedback").innerHTML = xmlHttp.responseText; - - } -} - - /** - * - * Function send review - * This function handle the response from the ajax query - * @param string user = the user to provide feedback too - * @param string template_id = the id of the template - * @version 1.0 - * @author Patrick Lockley - */ - -function send_review(user,template_id){ - - if(setup_ajax()!=false){ - - url="website_code/php/peer/peer_review.php"; - - xmlHttp.open("post",url,true); - xmlHttp.onreadystatechange=peer_stateChanged; - xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - - xmlHttp.send('user=' + user + '&template_id=' + template_id + '&feedback=' + document.peer.response.value); - - } - -} \ No newline at end of file diff --git a/website_code/scripts/properties_tab.js b/website_code/scripts/properties_tab.js deleted file mode 100644 index bdbe898047..0000000000 --- a/website_code/scripts/properties_tab.js +++ /dev/null @@ -1,1298 +0,0 @@ - /** - * - * properties, javascript for the properties tab - * - * @author Patrick Lockley - * @version 1.0 - * @copyright Copyright (c) 2008,2009 University of Nottingham - * @package - */ - - /** - * - * Function properties ajax send prepare - * This function sorts out the URL for most of the queries in the properties window - * @param string url = the extra part of the url for this ajax query - * @version 1.0 - * @author Patrick Lockley - */ - -function properties_ajax_send_prepare(url){ - - xmlHttp.open("post",properties_ajax_php_path + url,true); - xmlHttp.onreadystatechange=properties_stateChanged; - xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - -} - - /** - * - * Function properties state changed - * This function sorts out the page display for most of the properties ajax queries - * @version 1.0 - * @author Patrick Lockley - */ - -function properties_stateChanged(){ - - if (xmlHttp.readyState==4){ - - if(xmlHttp.responseText!=""){ - - document.getElementById('dynamic_area').innerHTML = xmlHttp.responseText; - - } - } -} - -/** - * - * Function publish template - * This function displays the the welcome for the publish page - * @version 1.0 - * @author Patrick Lockley - */ - -function publish_template(){ - - if(setup_ajax()!=false){ - - var url="publish.php"; - - xmlHttp.open("post",properties_ajax_php_path + url,true); - xmlHttp.onreadystatechange=properties_stateChanged; - xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - xmlHttp.send('template_id=' + window.name); - - } - -} - - /** - * - * Function screen size state changed - * This function handles the embed code for the properties panel - * @version 1.0 - * @author Patrick Lockley - */ - -function screen_size_stateChanged(){ - - if (xmlHttp.readyState==4){ - - if(xmlHttp.responseText!=""){ - - temp = xmlHttp.responseText.toString().split("~"); - - document.getElementById('dynamic_area').innerHTML += "

This code will allow you to embed your project into a web page

"; - - - } - } -} - - /** - * - * Function name share state changed - * This function handles the display for the drop down name list for the sharing tab - * @version 1.0 - * @author Patrick Lockley - */ - -function name_share_stateChanged(){ - - if (xmlHttp.readyState==4){ - - if(xmlHttp.responseText!=""){ - - document.getElementById('area2').innerHTML = xmlHttp.responseText; - - } - } -} - - /** - * - * Function share this state changed - * This function handles the response from making a share request - * @version 1.0 - * @author Patrick Lockley - */ - -function share_this_stateChanged(){ - - if (xmlHttp.readyState==4){ - - if(xmlHttp.responseText!=""){ - - document.getElementById('area2').innerHTML = ""; - document.getElementById('area3').innerHTML = xmlHttp.responseText; - sharing_status_template(); - - } - } -} - - /** - * - * Function delete share state changed - * This function handles the deletion of a share - * @version 1.0 - * @author Patrick Lockley - */ - -function delete_share_stateChanged(){ - - if (xmlHttp.readyState==4){ - - sharing_status_template(); - - if(after_sharing_deleted){ - - window_reference.screen_refresh(); - - } - - } -} - - /** - * - * Function share rights state changed - * This function handles any change to sharing status - * @version 1.0 - * @author Patrick Lockley - */ - -function share_rights_stateChanged(){ - - if (xmlHttp.readyState==4){ - - sharing_status_template(); - - } -} - - /** - * - * Function rename state changed - * This function handles the results of a rename action - * @version 1.0 - * @author Patrick Lockley - */ - -function rename_stateChanged(){ - - if (xmlHttp.readyState==4){ - - if(xmlHttp.responseText!=""){ - - /* - * split the two returning bits of info (the html and the new file name) - */ - - array_response = xmlHttp.responseText.split("~~**~~"); - - document.getElementById('dynamic_area').innerHTML = array_response[2]; - - /* - * set the file name in the file_area - */ - - current_innerHTML = window_reference.document.getElementById("file_" + window.name).innerHTML; - - future_innerHTML = current_innerHTML.substr(0,current_innerHTML.lastIndexOf(">")+1) + array_response[1]; - - window_reference.document.getElementById("file_" + window.name).innerHTML = future_innerHTML; - - } - - } - -} - -var after_sharing_deleted = false; - - /** - * - * Function delete sharing template - * This function handles the deletion of a share by a user - * @param string template_id = window type to open - * @param string user_id = user we are removing - * @param string who_deleted_flag = obsolete ***** CHECK ****** - * @version 1.0 - * @author Patrick Lockley - */ - -function delete_sharing_template(template_id,user_id,who_deleted_flag){ - - var answer = confirm("Are you sure you wish to stop sharing this template?"); - - if(answer){ - - if(who_deleted_flag){ - - after_sharing_deleted = true; - - }else{ - - after_sharing_deleted = true; - - } - - if(setup_ajax()!=false){ - - var url="remove_sharing_template.php"; - - xmlHttp.open("post",properties_ajax_php_path + url,true); - xmlHttp.onreadystatechange=delete_share_stateChanged; - xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - - if(who_deleted_flag){ - - xmlHttp.send('template_id=' + template_id +'&user_id=' + user_id + '&user_deleting_self=true'); - - }else{ - - xmlHttp.send('template_id=' + template_id +'&user_id=' + user_id + '&user_deleting_self=false'); - - } - - } - - } - -} - - /** - * - * Function syndication template - * This function displays a templates syndication options - * @version 1.0 - * @author Patrick Lockley - */ - -function syndication_template(){ - - if(setup_ajax()!=false){ - - var url="syndication_template.php"; - - xmlHttp.open("post",properties_ajax_php_path + url,true); - xmlHttp.onreadystatechange=rss_stateChanged; - xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - - xmlHttp.send('tutorial_id=' + window.name); - - } - -} - - /** - * - * Function syndication change template - * This function handles the setting of syndication settings being changed - * @version 1.0 - * @author Patrick Lockley - */ - -function syndication_change_template(){ - - synd = "false"; - - if(document.getElementById("syndon").src==(site_url + "website_code/images/TickBoxOn.gif")){ - - synd="true"; - - } - - category_value = document.getElementById("category_list").value; - - license_value = document.getElementById("license_list").value; - - description = document.getElementById("description").value; - - keywords = document.getElementById("keywords").value; - - if(setup_ajax()!=false){ - - var url="syndication_change_template.php"; - - properties_ajax_send_prepare(url); - - xmlHttp.send('tutorial_id=' + window.name + '&synd=' + synd + '&description=' + description + '&keywords=' + keywords + '&category_value=' + category_value + '&license_value=' + license_value); - - } - -} - - /** - * - * Function rss template - * This function handles the setting of RSS templates - * @version 1.0 - * @author Patrick Lockley - */ - -function rss_template(){ - - if(setup_ajax()!=false){ - - var url="rss_template.php"; - - xmlHttp.open("post",properties_ajax_php_path + url,true); - xmlHttp.onreadystatechange=rss_stateChanged; - xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - - xmlHttp.send('tutorial_id=' + window.name); - - } - -} - - /** - * - * Function rss state changed - * This function handles the response from the ajax query - * @version 1.0 - * @author Patrick Lockley - */ - -function rss_stateChanged(){ - - if (xmlHttp.readyState==4){ - - if(xmlHttp.responseText!=""){ - - document.getElementById('dynamic_area').innerHTML=xmlHttp.responseText; - - - } - - } - -} - - /** - * - * Function screen size template - * This function gets a templates screen sizes - * @version 1.0 - * @author Patrick Lockley - */ - -function screen_size_template(){ - - if(setup_ajax()!=false){ - - var url="screen_size_template.php"; - - xmlHttp.open("post",properties_ajax_php_path + url,true); - xmlHttp.onreadystatechange=screen_size_stateChanged; - xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - - xmlHttp.send('tutorial_id=' + window.name); - - } - -} - - /** *********OBSOLETE*************** - * - * Function delete sharing template - * This function handles the deletion of a share by a user - * @param string template_id = window type to open - * @param string user_id = user we are removing - * @param string who_deleted_flag = obsolete ***** CHECK ****** - * @version 1.0 - * @author Patrick Lockley - */ - -function links_template(){ - - if(setup_ajax()!=false){ - - var url="links_template.php"; - - properties_ajax_send_prepare(url); - - xmlHttp.send('template_id=' + window.name); - - } - -} - - /** - * - * Function peer template - * This function handles the display of the templates peer review properties - * @version 1.0 - * @author Patrick Lockley - */ - -function peer_template(){ - - - if(setup_ajax()!=false){ - - var url="peer_template.php"; - - properties_ajax_send_prepare(url); - - xmlHttp.send('template_id=' + window.name); - - } - -} - - /** - * - * Function peer tick toggle - * This function handles the ticking and unticking on the peer review page - * @param string tag = the id of the image we are changing - * @version 1.0 - * @author Patrick Lockley - */ - -function peer_tick_toggle(tag){ - - if(tag=="peeron"){ - - document.getElementById("peeron").src = "website_code/images/TickBoxOn.gif"; - document.getElementById("peeroff").src = "website_code/images/TickBoxOff.gif"; - - }else{ - - document.getElementById("peeron").src = "website_code/images/TickBoxOff.gif"; - document.getElementById("peeroff").src = "website_code/images/TickBoxOn.gif"; - - } - -} - - /** - * - * Function peer change template - * This function handles the creation of peer review - * @version 1.0 - * @author Patrick Lockley - */ - -function peer_change_template(){ - - if(document.getElementById("peeron").src==site_url + "website_code/images/TickBoxOn.gif"){ - - if(document.peer.password.value!=""){ - - if(setup_ajax()!=false){ - - var url="peer_change_template.php"; - - properties_ajax_send_prepare(url); - - xmlHttp.send('template_id=' + window.name + '&peer_status=on' + '&password=' + document.peer.password.value); - - } - - }else{ - - alert("You must set a password"); - - } - - - }else{ - - if(setup_ajax()!=false){ - - var url="peer_change_template.php"; - - properties_ajax_send_prepare(url); - - xmlHttp.send('template_id=' + window.name + '&peer_status=off'); - - } - - } - -} - - /** - * - * Function rss tick toggle - * This function handles the ticking and unticking on the rss page - * @param string tag = the tick image clicked on - * @version 1.0 - * @author Patrick Lockley - */ - -function rss_tick_toggle(tag){ - - switch(tag){ - - case "rsson":document.getElementById(tag).src = "website_code/images/TickBoxOn.gif"; - document.getElementById("rssoff").src = "website_code/images/TickBoxOff.gif"; - break; - case "rssoff":document.getElementById(tag).src = "website_code/images/TickBoxOn.gif"; - document.getElementById("rsson").src = "website_code/images/TickBoxOff.gif"; - break; - case "exporton":document.getElementById(tag).src = "website_code/images/TickBoxOn.gif"; - document.getElementById("exportoff").src = "website_code/images/TickBoxOff.gif"; - break; - case "exportoff":document.getElementById(tag).src = "website_code/images/TickBoxOn.gif"; - document.getElementById("exporton").src = "website_code/images/TickBoxOff.gif"; - break; - case "syndon":document.getElementById(tag).src = "website_code/images/TickBoxOn.gif"; - document.getElementById("syndoff").src = "website_code/images/TickBoxOff.gif"; - break; - case "syndoff":document.getElementById(tag).src = "website_code/images/TickBoxOn.gif"; - document.getElementById("syndon").src = "website_code/images/TickBoxOff.gif"; - break; - - } - -} - - /** - * - * Function rss change template - * This function handles the changing of an RSS entry in the database - * @version 1.0 - * @author Patrick Lockley - */ - -function rss_change_template(){ - - rssing = "false"; - exporting = "false"; - - if(document.getElementById("rsson").src==(site_url + "website_code/images/TickBoxOn.gif")){ - - rssing="true"; - - } - - if(document.getElementById("exporton").src==(site_url + "website_code/images/TickBoxOn.gif")){ - - exporting="true"; - - } - - desc = document.getElementById("desc").value; - - if(setup_ajax()!=false){ - - var url="rss_change_template.php"; - - properties_ajax_send_prepare(url); - - xmlHttp.send('template_id=' + window.name + '&rss=' + rssing + '&export=' + exporting + '&desc=' + desc); - - } - - -} - - /** - * - * Function xml template - * This function handles the display of the templates XML sharing settings - * @version 1.0 - * @author Patrick Lockley - */ - -function xml_template(){ - - if(setup_ajax()!=false){ - - var url="xml_template.php"; - - properties_ajax_send_prepare(url); - - xmlHttp.send('template_id=' + window.name); - - } - -} - - /** - * - * Function xml tick toggle - * This function handles the ticking and unticking on the XML sharing page - * @version 1.0 - * @author Patrick Lockley - */ - -function xml_tick_toggle(tag){ - - if(tag=="xmlon"){ - - document.getElementById("xmlon").src = "website_code/images/TickBoxOn.gif"; - document.getElementById("xmloff").src = "website_code/images/TickBoxOff.gif"; - - }else{ - - document.getElementById("xmlon").src = "website_code/images/TickBoxOff.gif"; - document.getElementById("xmloff").src = "website_code/images/TickBoxOn.gif"; - - } - -} - - - - /** - * - * Function xml change template - * This function handles creation of an XML sharing record - * @version 1.0 - * @author Patrick Lockley - */ - -function xml_change_template(){ - - if(document.getElementById("xmlon").src==site_url + "website_code/images/TickBoxOn.gif"){ - - if(setup_ajax()!=false){ - - var url="xml_change_template.php"; - - properties_ajax_send_prepare(url); - - if(document.xmlshare.sitename.value!=""){ - - xmlHttp.send('template_id=' + window.name + '&xml_status=on' + '&address=' + document.xmlshare.sitename.value); - - }else{ - - xmlHttp.send('template_id=' + window.name + '&xml_status=on' + '&address=null'); - - } - - } - - }else{ - - var url="xml_change_template.php"; - - properties_ajax_send_prepare(url); - - xmlHttp.send('template_id=' + window.name + '&xml_status=off' + '&address=null'); - - } - -} - - /** - * - * Function properties template - * This function handles the display of the default properties page - * @version 1.0 - * @author Patrick Lockley - */ - - -function properties_template(){ - - if(setup_ajax()!=false){ - - var url="properties_template.php"; - - properties_ajax_send_prepare(url); - - xmlHttp.send('template_id=' + window.name); - - } - -} - - /** - * - * Function name template ********** OBSOLETE *************** - * This function handles the deletion of a share by a user - * @param string template_id = window type to open - * @param string user_id = user we are removing - * @param string who_deleted_flag = obsolete ***** CHECK ****** - * @version 1.0 - * @author Patrick Lockley - */ - -function name_template(){ - - if(setup_ajax()!=false){ - - var url="name_template.php"; - - properties_ajax_send_prepare(url); - - xmlHttp.send('template_id=' + window.name); - - } - -} - - /** - * - * Function notes template - * This function handles the display of a templates notes - * @version 1.0 - * @author Patrick Lockley - */ - -function notes_template(){ - - if(setup_ajax()!=false){ - - var url="notes_template.php"; - - properties_ajax_send_prepare(url); - - xmlHttp.send('template_id=' + window.name); - - } - -} - - /** - * - * Function change notes - * This function handles the changing of notes on a template - * @param string template_id = id of the template - * @param string form_tag - the form to get the value from - * @version 1.0 - * @author Patrick Lockley - */ - -function change_notes(template_id, form_tag){ - - new_notes = document.getElementById(form_tag).childNodes[0].value; - - if(is_ok_notes(new_notes)){ - - if(setup_ajax()!=false){ - - var url="notes_change_template.php"; - - properties_ajax_send_prepare(url); - - xmlHttp.send('template_id=' + template_id +'¬es=' + new_notes); - - } - - }else{ - - alert("Sorry they are not valid notes"); - - } - -} - - /** - * - * Function delete file - * This function handles the changing of notes on a template - * @param string file = id of the file to delete - * @version 1.0 - * @author Patrick Lockley - */ - -function delete_file(file){ - - var answer = confirm("Are you sure you want to delete this file?"); - - if(answer){ - - if(setup_ajax()!=false){ - - var url="delete_file_template.php"; - - xmlHttp.open("post",properties_ajax_php_path + url,true); - xmlHttp.onreadystatechange=delete_file_stateChanged; - xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - xmlHttp.send('file=' + file); - - } - - } - -} - - /** - * - * Function delete file state changed - * This function refreshes the file list when a file is deleted - * @version 1.0 - * @author Patrick Lockley - */ - -function delete_file_stateChanged(){ - - if (xmlHttp.readyState==4){ - - media_and_quota_template(); - - } - -} - - /** - * - * Function media and quota template - * This function handles the display of the media and quota for a file - * @version 1.0 - * @author Patrick Lockley - */ - -function media_and_quota_template(){ - - if(setup_ajax()!=false){ - - var url="media_and_quota_template.php"; - - properties_ajax_send_prepare(url); - - xmlHttp.send('template_id=' + window.name); - - } - -} - - /** - * - * Function rename_template - * This function handles the the renaming of a template - * @param string template_id = id of the template - * @param string form_tag - the form to get the value from - * @version 1.0 - * @author Patrick Lockley - */ - -function rename_template(template_id,form_tag){ - - new_name = document.getElementById(form_tag).childNodes[0].value; - - if(is_ok_name(new_name)){ - - if(setup_ajax()!=false){ - - var url="rename_template.php"; - - xmlHttp.open("post",properties_ajax_php_path + url,true); - xmlHttp.onreadystatechange=rename_stateChanged; - xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - - xmlHttp.send('template_id=' + template_id +'&template_name=' + new_name); - - } - - }else{ - - alert("This is not a valid name. Please use only letters and numbers"); - - } - -} - - /** - * - * Function access template - * This function handles the display of the access settings for a template - * @version 1.0 - * @author Patrick Lockley - */ - -function access_template(){ - - if(setup_ajax()!=false){ - - var url="access_template.php"; - - properties_ajax_send_prepare(url); - - xmlHttp.send('template_id=' + window.name); - - } - -} - - /** - * - * Function access change template - * This function handles the changing of an access settings for a template - * @param string template_id = id of the template - * @version 1.0 - * @author Patrick Lockley - */ - -function access_change_template(template_id){ - - path = site_url; - - z = document.getElementById('security_list').childNodes.length; - - x=0; - - access_value=""; - - while(x!=z){ - - if(document.getElementById('security_list').childNodes[x].id!=""){ - - if(document.getElementById('security_list').childNodes[x].childNodes[0].src== path + "website_code/images/TickBoxOn.gif"){ - - access_value = document.getElementById('security_list').childNodes[x].id; - - } - - } - - x++; - - } - - if(access_value=="Other"&&document.getElementById('url').value==""){ - - alert("Please enter a value for the site you wish to limit access to"); - - }else{ - - if(setup_ajax()!=false){ - - var url="access_change_template.php"; - - properties_ajax_send_prepare(url); - - if(access_value=="Other"){ - xmlHttp.send('template_id=' + template_id + '&access=' + access_value +'&server_string=' + document.getElementById('url').value); - }else{ - xmlHttp.send('template_id=' + template_id + '&access=' + access_value); - } - - } - - } - -} - - /** - * - * Function access tick toggle - * This function handles the ticking and unticking of images on the access page - * @param string imagepath - path to the image we've ticked - * @version 1.0 - * @author Patrick Lockley - */ - -function access_tick_toggle(imagepath){ - - path = site_url; - - z = document.getElementById('security_list').childNodes.length; - - x=0; - - while(x!=z){ - - if(document.getElementById('security_list').childNodes[x].id!=""){ - - if(document.getElementById('security_list').childNodes[x].childNodes[0].src== path + "website_code/images/TickBoxOn.gif"){ - - document.getElementById('security_list').childNodes[x].childNodes[0].src = path + "website_code/images/TickBoxOff.gif"; - - } - - } - - x++; - - } - - imagepath.src = path + "website_code/images/TickBoxOn.gif"; - -} - - /** - * - * Function gift state changed - * This function handles the display of the gift settings for this template - * @version 1.0 - * @author Patrick Lockley - */ - -function gift_stateChanged(){ - - if (xmlHttp.readyState==4){ - - document.getElementById('dynamic_area').innerHTML = xmlHttp.responseText; - - window_reference.screen_refresh(); - - } - -} - - /** - * - * Function gift this template - * This function handles the gifting of a template - * @param string tutorial_id = id of the template - * @param string user_id - the user to give it to - * @param string action - whether to give a copy or give this version - * @version 1.0 - * @author Patrick Lockley - */ - -function gift_this_template(tutorial_id, user_id, action){ - - if(setup_ajax()!=false){ - - var url="gift_this_template.php"; - - xmlHttp.open("post",properties_ajax_php_path + url,true); - xmlHttp.onreadystatechange=gift_stateChanged; - xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - - xmlHttp.send('tutorial_id=' + tutorial_id + '&user_id=' + user_id + '&action=' + action); - - } - -} - - /** - * - * Function name select gift template - * This function handles the display of names for people we may wish to gift this too - * @version 1.0 - * @author Patrick Lockley - */ - -function name_select_gift_template(){ - - if(setup_ajax()!=false){ - - search_string = document.getElementById('share_form').childNodes[0].value; - - if(search_string==""){ - document.getElementById('area2').innerHTML="

Names will appear here

"; - } - - if(is_ok_name(search_string)){ - - var url="name_select_gift_template.php"; - - xmlHttp.open("post",properties_ajax_php_path + url,true); - xmlHttp.onreadystatechange=name_share_stateChanged; - xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - - xmlHttp.send('search_string=' + search_string + '&template_id=' + window.name); - - }else{ - - document.getElementById('area2').innerHTML="

That is not a valid search term

"; - - } - - } - -} - - /** - * - * Function name select template - * This function handles the selecting of a name - * @version 1.0 - * @author Patrick Lockley - */ - -function name_select_template(){ - - if(setup_ajax()!=false){ - - search_string = document.getElementById('share_form').childNodes[0].value; - - if(search_string==""){ - document.getElementById('area2').innerHTML="

Names will appear here

"; - } - - if(is_ok_name(search_string)){ - - var url="name_select_template.php"; - - xmlHttp.open("post",properties_ajax_php_path + url,true); - xmlHttp.onreadystatechange=name_share_stateChanged; - xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - - xmlHttp.send('search_string=' + search_string + '&template_id=' + window.name); - - }else{ - - document.getElementById('area2').innerHTML="

That is not a valid search term

"; - - } - - } - -} - - /** - * - * Function gift template - * This function handles the display to allow for the gifting of a template - * @version 1.0 - * @author Patrick Lockley - */ - -function gift_template(){ - - if(setup_ajax()!=false){ - - var url="gift_template.php"; - - properties_ajax_send_prepare(url); - - xmlHttp.send('template_id=' + window.name); - - } - -} - - /** - * - * Function share this template - * This function handles the sharing of a template - * @param string template = id of the template - * @param string user - the user to give it to - * @version 1.0 - * @author Patrick Lockley - */ - -function share_this_template(template, user){ - - if(setup_ajax()!=false){ - - var url="share_this_template.php"; - - xmlHttp.open("post",properties_ajax_php_path + url,true); - xmlHttp.onreadystatechange=share_this_stateChanged; - xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - - xmlHttp.send('template_id=' + template + '&user_id=' + user); - - } - -} - - /** - * - * Function sharing statud template - * This function handles the display of the current sharing status - * @version 1.0 - * @author Patrick Lockley - */ - -function sharing_status_template(){ - - - if(setup_ajax()!=false){ - - var url="sharing_status_template.php"; - - properties_ajax_send_prepare(url); - - xmlHttp.send('template_id=' + window.name); - - } - -} - - /** - * - * Function export template - * This function handles the display of the export page for a template - * @version 1.0 - * @author Patrick Lockley - */ - -function export_template(){ - - if(setup_ajax()!=false){ - - var url="export_template.php"; - - properties_ajax_send_prepare(url); - - xmlHttp.send('template_id=' + window.name); - - } - -} - - /** - * - * Function set sharing rights - * This function handles the gifting of a template - * @param string rights = the rights to give - * @param string template - the template - * @param string user - the user id - * @version 1.0 - * @author Patrick Lockley - */ - -function set_sharing_rights_template(rights, template, user){ - - if(setup_ajax()!=false){ - - var url="set_sharing_rights_template.php"; - - xmlHttp.open("post",properties_ajax_php_path + url,true); - xmlHttp.onreadystatechange=share_rights_stateChanged; - xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - - xmlHttp.send('rights=' + rights + '&template_id=' + window.name + '&user_id=' + user); - - } - -} - -var last_selected=null; - - /** - * - * Function tab highlight - * This function handles the highlighting of tabs on the properties window - * @param string id = id of the tab to highlight - * @version 1.0 - * @author Patrick Lockley - */ - -function tab_highlight(id){ - - document.getElementById("tab"+id + "-1").style.borderTop="1px #b6b38a solid"; - document.getElementById("tab"+id + "-1").style.borderBottom="1px #b6b38a solid"; - document.getElementById("tab"+id + "-1").style.backgroundColor="#fff"; - document.getElementById("tab"+id + "-1").style.borderRight="1px #fff solid"; - document.getElementById("tab"+id + "-1").style.width = "1px"; - - document.getElementById("tab"+id).style.borderLeft="1px #b6b38a solid"; - document.getElementById("tab"+id).style.borderTop="1px #b6b38a solid"; - document.getElementById("tab"+id).style.borderBottom="1px #b6b38a solid"; - document.getElementById("tab"+id).style.backgroundColor="#fff"; - - if((last_selected!=null)&&(last_selected!=id)){ - - document.getElementById("tab" + last_selected + "-1").style.borderTop="1px solid #f4eee2"; - document.getElementById("tab" + last_selected + "-1").style.borderBottom="1px solid #f4eee2"; - document.getElementById("tab" + last_selected + "-1").style.backgroundColor="#f4eee2"; - document.getElementById("tab" + last_selected + "-1").style.borderRight="1px #b6b38a solid"; - - document.getElementById("tab" + last_selected).style.borderLeft="1px solid #f4eee2"; - document.getElementById("tab" + last_selected).style.borderTop="1px solid #f4eee2"; - document.getElementById("tab" +last_selected).style.borderBottom="1px solid #f4eee2"; - document.getElementById("tab" + last_selected).style.backgroundColor="#f9f7f2"; - - - } - - last_selected = id; - -} \ No newline at end of file diff --git a/website_code/scripts/screen_display.js b/website_code/scripts/screen_display.js deleted file mode 100644 index 0b6838813a..0000000000 --- a/website_code/scripts/screen_display.js +++ /dev/null @@ -1,429 +0,0 @@ - /** - * - * screen display, javascript for the various functions to do with screen display - * - * @author Patrick Lockley - * @version 1.0 - * @copyright Copyright (c) 2008,2009 University of Nottingham - * @package - */ - -var file_area_html = ""; - -var xmlHttp; - - /** - * - * Function disable selection - * This function prevents the selection on text on the index.php page - * @param string div - the div to prevent this om - * @version 1.0 - * @author Patrick Lockley - */ - -function disableSelection(div){ - - if (typeof div.onselectstart!="undefined") //IE route - div.onselectstart=function(){return false} - else if (typeof div.style.MozUserSelect!="undefined") //Firefox route - div.style.MozUserSelect="none" - else //All other route (ie: Opera) - div.onmousedown=function(){return false} - div.style.cursor = "default" -} - - /** - * - * Function file area height - * This function finds the vertical height of the file area div - * @version 1.0 - * @author Patrick Lockley - */ - -function file_area_height(){ - - total_height=0; - - current_node=document.getElementById("file_area"); - - while(current_node.className!="pagecontainer"){ - - total_height+=current_node.offsetTop; - - current_node = current_node.parentNode; - - } - - drag_manager.initial_scroll = drag_manager.scroll_value; - - return total_height; - -} - - /** - * - * Function page load sort - * This function handles the display of the page and setting up some configuration - * @version 1.0 - * @author Patrick Lockley - */ - -function page_load_sort(tag){ - - drag_manager.file_area_height = file_area_height(); - - for(var x=0;x!=document.getElementById(tag).childNodes.length;x++){ - - document.getElementById(tag).childNodes[x].highlight=false; - - disableSelection(document.getElementById(tag).childNodes[x]); - - if(document.getElementById(tag).childNodes[x].id.indexOf("child_")!=-1){ - page_load_sort(document.getElementById(tag).childNodes[x].id); - } - - } - -} - - /** - * - * Function folders re open - * This function re opens folders previously open before the screen refresh - * @version 1.0 - * @author Patrick Lockley - */ - -function folders_reopen(){ - - temp_folder_array = new Array(); - - temp_folder_array = open_folders.slice(); - - open_folders.splice(0,open_folders.length); - - if(temp_folder_array.length!=0){ - - while(x=temp_folder_array.pop()){ - - if(document.getElementById(x.id)!=null){ - - document.getElementById(x.id).open=true; - - if(x.id.indexOf("recycle")!=-1){ - - document.getElementById("folderchild_" + x.id).style.display="block"; - - image = "folder_recyclebin"; - - }else{ - - reopen = "folderchild_" + x.id.substr(x.id.indexOf("_")+1,x.id.length); - - document.getElementById(reopen).style.display="block"; - - image = "folder_" + x.id.substr(x.id.indexOf("_")+1,x.id.length) + "_image"; - - if(document.getElementById(image)!=null){ - - document.getElementById(image).src = "website_code/images/Icon_FolderOpen2.gif"; - - } - - } - - open_folders.push(x); - - } - - } - - } - -} - - /** - * - * Function file area redraw state changed - * This function handles changes in the file area div and the setting of values for this new content - * @param string url = the extra part of the url for this ajax query - * @version 1.0 - * @author Patrick Lockley - */ - -function file_area_redraw_stateChanged(){ - - if (xmlHttp.readyState==4){ - - document.getElementById("file_area").innerHTML = xmlHttp.responseText; - sort_display_settings(); - - } - -} - - /** - * - * Function sort display settings - * This function is an umbrella for most of the display settings for a page, and resets some system values - * @version 1.0 - * @author Patrick Lockley - */ - -function sort_display_settings(){ - - document.getElementById("folder_workspace").open = true; - - page_load_sort('file_area'); - - folders_reopen(); - - drag_manager.file_area_top = find_height(); - - drag_manager.file_area_bottom = drag_manager.file_area_top + document.getElementById("file_area").offsetHeight; - - /* - * reset some system values - */ - - drag_manager.active_key=null; - drag_manager.orig_y=0; - drag_manager.drag = ""; - drag_manager.start_x=0; - drag_manager.start_y=0; - drag_manager.selected=0; - drag_manager.inital_scroll=0; - drag_manager.new_scroll=0; - drag_manager.scroll_top = document.getElementById("file_area").scrollTop; - drag_manager.dragged = false; - drag_manager.last_selected = null; - drag_manager.last_mouse_over=null; - - /* - * delete arrays if not already empty - */ - - if(drag_manager.selected_items.length!=0){ - - drag_manager.selected_items.splice(0,drag_manager.selected_items.length); - - } - - if(folder_div_id.length!=0){ - - folder_div_id.splice(0,folder_div_id.length); - - } - - if(folder_position_top.length!=0){ - - folder_position_top.splice(0,folder_position_top.length); - - } - - if(folder_position_bottom.length!=0){ - - folder_position_bottom.splice(0,folder_position_bottom.length); - - } - - file_area_html = ""; - - file_area_html = document.getElementById("file_area").innerHTML; - - button_check(); - - -} - - /** - * - * Function screen refresh no ajax - * This function redisplays the html if no ajax query is needed - * @version 1.0 - * @author Patrick Lockley - */ - -function screen_refresh_no_ajax(){ - - document.getElementById("file_area").innerHTML = file_area_html; - - sort_display_settings(); - -} - - /** - * - * Function screen refresh - * This function sorts out the URL for most of the queries in the folder properties window - * @version 1.0 - * @author Patrick Lockley - */ - -function screen_refresh(){ - - if(setup_ajax()!=false){ - - var url="website_code/php/templates/your_templates.php"; - - xmlHttp.open("post",url,true); - xmlHttp.onreadystatechange=file_area_redraw_stateChanged; - xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - - xmlHttp.send('sort_type=' + document.sorting.type.value); - - } - -} - - /** - * - * Function button check - * This functions counts the number of highlighted items and configures the buttons accordingly - * @version 1.0 - * @author Patrick Lockley - */ - -function button_check(){ - - if(drag_manager.selected_items.length==0){ - - document.getElementById("edit").src="website_code/images/Bttn_EditDis.gif"; - document.getElementById("edit").onmousedown=""; - document.getElementById("edit").onmouseover=""; - document.getElementById("edit").onmouseout=""; - document.getElementById("edit").onclick=""; - - document.getElementById("preview").src="website_code/images/Bttn_PreviewDis.gif"; - document.getElementById("preview").onmousedown=""; - document.getElementById("preview").onmouseover=""; - document.getElementById("preview").onmouseout=""; - document.getElementById("preview").onclick=""; - - document.getElementById("delete").src="website_code/images/Bttn_DeleteDis.gif"; - document.getElementById("delete").onmousedown=""; - document.getElementById("delete").onmouseover=""; - document.getElementById("delete").onmouseout=""; - document.getElementById("delete").onclick=""; - - document.getElementById("duplicate").src="website_code/images/Bttn_DuplicateDis.gif"; - document.getElementById("duplicate").onmousedown=""; - document.getElementById("duplicate").onmouseover=""; - document.getElementById("duplicate").onmouseout=""; - document.getElementById("duplicate").onclick=""; - - document.getElementById("publish").src="website_code/images/Bttn_PublishDis.gif"; - document.getElementById("publish").onmousedown=""; - document.getElementById("publish").onmouseover=""; - document.getElementById("publish").onmouseout=""; - document.getElementById("publish").onclick=""; - - if(document.getElementById("folder_workspace").mainhighlight){ - - document.getElementById("properties").src="website_code/images/Bttn_PropertiesOff.gif"; - document.getElementById("properties").onmousedown= function(){ this.src="website_code/images/Bttn_PropertiesClick.gif"}; - document.getElementById("properties").onmouseover= function(){ this.src="website_code/images/Bttn_PropertiesOn.gif"}; - document.getElementById("properties").onmouseout= function(){ this.src="website_code/images/Bttn_PropertiesOff.gif"}; - document.getElementById("properties").onclick=function(){properties_window()}; - - }else{ - - document.getElementById("properties").src="website_code/images/Bttn_PropertiesDis.gif"; - document.getElementById("properties").onmousedown=""; - document.getElementById("properties").onmouseover=""; - document.getElementById("properties").onmouseout=""; - document.getElementById("properties").onclick=""; - - } - - if(document.getElementById("recyclebin").mainhighlight){ - - if(document.getElementById("folderchild_recyclebin").childNodes.length!=0){ - - document.getElementById("delete").src="website_code/images/Bttn_DeleteOff.gif"; - document.getElementById("delete").onmousedown=function(){ this.src="website_code/images/Bttn_DeleteClick.gif"}; - document.getElementById("delete").onmouseover=function(){ this.src="website_code/images/Bttn_DeleteOn.gif"}; - document.getElementById("delete").onmouseout=function(){ this.src="website_code/images/Bttn_DeleteOff.gif"}; - document.getElementById("delete").onclick=function(){remove_this()}; - - } - - } - - }else if(drag_manager.selected_items.length==1){ - - if(drag_manager.selected_items[0].id.indexOf("folder")==-1){ - - document.getElementById("edit").src="website_code/images/Bttn_EditOff.gif"; - document.getElementById("edit").onmousedown= function(){ this.src="website_code/images/Bttn_EditClick.gif"}; - document.getElementById("edit").onmouseover= function(){ this.src="website_code/images/Bttn_EditOn.gif"}; - document.getElementById("edit").onmouseout= function(){ this.src="website_code/images/Bttn_EditOff.gif"}; - document.getElementById("edit").onclick=function(){edit_window()}; - - document.getElementById("preview").src="website_code/images/Bttn_PreviewOff.gif"; - document.getElementById("preview").onmousedown=function(){ this.src="website_code/images/Bttn_PreviewClick.gif"}; - document.getElementById("preview").onmouseover=function(){ this.src="website_code/images/Bttn_PreviewOn.gif"}; - document.getElementById("preview").onmouseout=function(){ this.src="website_code/images/Bttn_PreviewOff.gif"}; - document.getElementById("preview").onclick=function(){preview_window()}; - - document.getElementById("publish").src="website_code/images/Bttn_PublishOff.gif"; - document.getElementById("publish").onmousedown=function(){ this.src="website_code/images/Bttn_PublishClick.gif"}; - document.getElementById("publish").onmouseover=function(){ this.src="website_code/images/Bttn_PublishOn.gif"}; - document.getElementById("publish").onmouseout=function(){ this.src="website_code/images/Bttn_PublishOff.gif"}; - document.getElementById("publish").onclick=function(){publish_this()}; - - document.getElementById("duplicate").src="website_code/images/Bttn_DuplicateOff.gif"; - document.getElementById("duplicate").onmousedown=function(){ this.src="website_code/images/Bttn_DuplicateClick.gif"}; - document.getElementById("duplicate").onmouseover=function(){ this.src="website_code/images/Bttn_DuplicateOn.gif"}; - document.getElementById("duplicate").onmouseout=function(){ this.src="website_code/images/Bttn_DuplicateOff.gif"}; - document.getElementById("duplicate").onclick=function(){duplicate_template()}; - - }else{ - - document.getElementById("edit").src="website_code/images/Bttn_EditDis.gif"; - document.getElementById("edit").onmousedown=""; - document.getElementById("edit").onmouseover=""; - document.getElementById("edit").onmouseout=""; - document.getElementById("edit").onclick=""; - - document.getElementById("preview").src="website_code/images/Bttn_PreviewDis.gif"; - document.getElementById("preview").onmousedown=""; - document.getElementById("preview").onmouseover=""; - document.getElementById("preview").onmouseout=""; - document.getElementById("preview").onclick=""; - - document.getElementById("delete").src="website_code/images/Bttn_DeleteDis.gif"; - document.getElementById("delete").onmousedown=""; - document.getElementById("delete").onmouseover=""; - document.getElementById("delete").onmouseout=""; - document.getElementById("delete").onclick=""; - - document.getElementById("duplicate").src="website_code/images/Bttn_DuplicateDis.gif"; - document.getElementById("duplicate").onmousedown=""; - document.getElementById("duplicate").onmouseover=""; - document.getElementById("duplicate").onmouseout=""; - document.getElementById("duplicate").onclick=""; - - document.getElementById("publish").src="website_code/images/Bttn_PublishDis.gif"; - document.getElementById("publish").onmousedown=""; - document.getElementById("publish").onmouseover=""; - document.getElementById("publish").onmouseout=""; - document.getElementById("publish").onclick=""; - - } - - document.getElementById("properties").src="website_code/images/Bttn_PropertiesOff.gif"; - document.getElementById("properties").onmousedown= function(){ this.src="website_code/images/Bttn_PropertiesClick.gif"}; - document.getElementById("properties").onmouseover= function(){ this.src="website_code/images/Bttn_PropertiesOn.gif"}; - document.getElementById("properties").onmouseout= function(){ this.src="website_code/images/Bttn_PropertiesOff.gif"}; - document.getElementById("properties").onclick=function(){properties_window()}; - - document.getElementById("delete").src="website_code/images/Bttn_DeleteOff.gif"; - document.getElementById("delete").onmousedown=function(){ this.src="website_code/images/Bttn_DeleteClick.gif"}; - document.getElementById("delete").onmouseover=function(){ this.src="website_code/images/Bttn_DeleteOn.gif"}; - document.getElementById("delete").onmouseout=function(){ this.src="website_code/images/Bttn_DeleteOff.gif"}; - document.getElementById("delete").onclick=function(){remove_this()}; - - } - -} \ No newline at end of file diff --git a/website_code/scripts/template_management.js b/website_code/scripts/template_management.js deleted file mode 100644 index 6d24f2e56d..0000000000 --- a/website_code/scripts/template_management.js +++ /dev/null @@ -1,1264 +0,0 @@ - /** - * - * template management, javascript for the management of the templates in the file area and their creation - * - * @author Patrick Lockley - * @version 1.0 - * @copyright Copyright (c) 2008,2009 University of Nottingham - * @package - */ - -var active_div=""; - -var edit_window_open = new Array(); - - /** - * - * Function url return - * This function sorts out the URL depending on whether the htaccess if off or on - * @param string url = the extra part of the url to make this URL from - * @param string parameter - the template id - * @version 1.0 - * @author Patrick Lockley - */ - -function url_return(url,parameter){ - - switch(url){ - - case "edit": if(site_apache=="true"){ - - return url + "_" + parameter; - - }else{ - - return url + ".php?template_id=" + parameter; - - } - break; - case "preview": if(site_apache=="true"){ - - return url + "_" + parameter; - - }else{ - - return url + ".php?template_id=" + parameter; - - } - break; - case "play": if(site_apache=="true"){ - - return url + "_" + parameter; - - }else{ - - return url + ".php?template_id=" + parameter; - - } - break; - case "example": if(site_apache=="true"){ - - return url + "_" + parameter; - - }else{ - - return url + ".php?template_id=" + parameter; - - } - break; - case "properties": if(site_apache=="true"){ - - return url + "_" + parameter; - - }else{ - - return url + ".php?template_id=" + parameter; - - } - break; - case "folderproperties": if(site_apache=="true"){ - - return url + "_" + parameter; - - }else{ - - return url + ".php?template_id=" + parameter; - - } - break; - case "workspaceproperties": if(site_apache=="true"){ - - return url; - - }else{ - - return url + ".php" - - } - case "publishproperties": if(site_apache=="true"){ - - return url + "_" + parameter; - - }else{ - - return url + ".php?template_id=" + parameter; - - } - break; - - - default:break; - - } -} - - - /* - * Function template toggle - * This function sorts out the display and hiding of the blank templates side of the screen - * @param string tag = the div to display - * @version 1.0 - * @author Patrick Lockley - */ - -function template_toggle(tag){ - - var temp = document.getElementById(tag); - - if((temp.style.display=="none")||(temp.style.display=="")){ - temp.style.display="block"; - }else{ - temp.style.display="none" - } - -} - -// Function toggle (obsolete) ********** CHECK *************** -// -// Version 1.0 University of Nottingham -// (pl) -// open and close template areas when creating a new one - - -function toggle(tag){ - - if(document.getElementById(tag).style.display=="none"){ - document.getElementById(tag).style.display="block"; - }else{ - document.getElementById(tag).style.display="none"; - } - -} - - /** - * - * Function edit window - * This function opens an edit window - * @param string admin = is the user an administrator - * @version 1.0 - * @author Patrick Lockley - */ - -function edit_window(admin){ - - if(!admin){ - - x=0; - - while(x!=drag_manager.selected_items.length){ - - if(drag_manager.selected_items[x].className=="file"){ - - if(drag_manager.selected_items[x].parentNode.id!="folderchild_recyclebin"){ - - var NewEditWindow = window.open(site_url + url_return("edit", (drag_manager.selected_items[x].id.substr(drag_manager.selected_items[x].id.indexOf("_")+1,drag_manager.selected_items[x].id.length))), "editwindow" + drag_manager.selected_items[x].id, "height=665, width=800" ); - - NewEditWindow.window_reference = self; - - try{ - - xmlHttp=new XMLHttpRequest(); - - }catch (e){ // Internet Explorer - - try{ - - xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); - - }catch (e){ - - try{ - - xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); - - }catch (e){ - - } - } - } - - - NewEditWindow.ajax_handle = xmlHttp; - - NewEditWindow.focus(); - - window_id = "editwindow" + drag_manager.selected_items[x].id; - - window_open = false; - - for(z=0;z