function show_preview_code($row) { global $xerte_toolkits_site; $string_for_flash = $xerte_toolkits_site->users_file_area_short . $row['template_id'] . "-" . $row['username'] . "-" . $row['template_name'] . "/"; $xmlfile = $string_for_flash . "preview.xml"; $xmlFixer = new XerteXMLInspector(); $xmlFixer->loadTemplateXML($xmlfile); if (strlen($xmlFixer->getName()) > 0) { $title = $xmlFixer->getName(); } else { $title = XERTE_PREVIEW_TITLE; } $string_for_flash_xml = $xmlfile . "?time=" . time(); $string_for_flash = $xerte_toolkits_site->users_file_area_short . $row['template_id'] . "-" . $row['username'] . "-" . $row['template_name'] . "/"; $template_path_string = "modules/decision/parent_templates/" . $row['template_name'] . "/"; require_once "config.php"; _load_language_file("/modules/decision/preview.inc"); // $engine is assumed to be html5 if flash is NOT set $page_content = file_get_contents($xerte_toolkits_site->basic_template_path . $row['template_framework'] . "/player_html5/rloObject.htm"); $page_content = str_replace("%TITLE%", $title, $page_content); $page_content = str_replace("%TEMPLATEPATH%", $template_path_string, $page_content); $page_content = str_replace("%XMLPATH%", $string_for_flash, $page_content); $page_content = str_replace("%XMLFILE%", $string_for_flash_xml, $page_content); echo $page_content; }
function dont_show_template($optional = '') { global $xerte_toolkits_site; _load_language_file("/modules/xerte/module_functions.inc"); $edit_site_logo = $xerte_toolkits_site->site_logo; $pos = strrpos($edit_site_logo, '/') + 1; $edit_site_logo = substr($edit_site_logo, 0, $pos) . "edit_" . substr($edit_site_logo, $pos); $edit_organisational_logo = $xerte_toolkits_site->organisational_logo; $pos = strrpos($edit_organisational_logo, '/') + 1; $edit_organisational_logo = substr($edit_organisational_logo, 0, $pos) . "edit_" . substr($edit_organisational_logo, $pos); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script src="modules/Xerte/js/swfobject.js"></script> <script src="website_code/scripts/opencloseedit.js"></script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="website_code/styles/frontpage.css" media="screen" type="text/css" rel="stylesheet" /> </head> <body> <div style="margin:0 auto; width:800px"> <div class="edit_topbar" style="width:800px"> <img src="<?php echo $edit_site_logo; ?> " style="margin-left:10px; float:left" /> <img src="<?php echo $edit_organisational_logo; ?> " style="margin-right:10px; float:right" /> </div> <div style="margin:0 auto"> <?php echo XERTE_DISPLAY_FAIL; if ($optional !== '') { echo '</div><div>' . $optional; } ?> </div></div></body></html><?php die; }
<?php _load_language_file("/website_code/php/workspaceproperties/workspace_library.inc"); function workspace_templates_menu() { echo "<p class=\"header\"><span>My projects</span></p>"; echo "<div class=\"menu_holder\"><div class=\"menu_button\"><a href=\"javascript:workspace_templates_template()\">" . WORKSPACE_LIBRARY_MY . "</a></div>"; echo "<div class=\"menu_button\"><a href=\"javascript:shared_templates_template()\">" . WORKSPACE_LIBRARY_SHARED . "</a></div>"; echo "<div class=\"menu_button\"><a href=\"javascript:public_templates_template()\">" . WORKSPACE_LIBRARY_PUBLIC . "</a></div>"; echo "<div class=\"menu_button\"><a href=\"javascript:usage_templates_template()\">" . WORKSPACE_LIBRARY_USAGE . "</a></div>"; echo "<div class=\"menu_button\"><a href=\"javascript:rss_templates_template()\">" . WORKSPACE_LIBRARY_RSS . "</div>"; echo "<div class=\"menu_button\"><a href=\"javascript:syndication_templates_template()\">" . WORKSPACE_LIBRARY_OPEN . "</a></div>"; echo "<div class=\"menu_button\"><a href=\"javascript:peer_templates_template()\">" . WORKSPACE_LIBRARY_PEER . "</a></div>"; echo "<div class=\"menu_button\"><a href=\"javascript:xml_templates_template()\">" . WORKSPACE_LIBRARY_XML . "</a></div>"; echo "</div>"; } function workspace_menu_create($size) { echo "<div style=\"clear:left; margin-left:20px; margin-top:10px; width:90%; float:left;\">"; echo "<div style=\"float:left; width:" . $size . "%; height:20px;\">" . WORKSPACE_LIBRARY_TEMPLATE_NAME . "</div>"; }
<?php /** * * duplicate_template, allows the template to be duplicated * * @author Patrick Lockley * @version 1.0 * @copyright Copyright (c) 2008,2009 University of Nottingham * @package */ require_once "../../../config.php"; include "../user_library.php"; include "../template_library.php"; include "../template_status.php"; _load_language_file("/website_code/php/templates/duplicate_template.inc"); $database_connect_id = database_connect("new_template database connect success", "new_template database connect fail"); /* * get the root folder for this user */ if (is_numeric($_POST['template_id'])) { if (is_user_creator(mysql_real_escape_string($_POST['template_id']))) { if ($_POST['folder_id'] == "workspace") { $folder_id = get_user_root_folder(); } else { $folder_id = $_POST['folder_id']; } /* * get the maximum id number from templates, as the id for this template */ $maximum_template_id = get_maximum_template_number();
* Licensed to The Apereo Foundation under one or more contributor license * agreements. See the NOTICE file distributed with this work for * additional information regarding copyright ownership. * The Apereo Foundation licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ _load_language_file("/modules/xerte/export_page.inc"); echo "<p>" . XERTE_EXPORT_DESCRIPTION . "</p>"; if (get_default_engine($_POST['template_id']) == 'javascript') { echo "<p><img id=\"html5\" src=\"website_code/images/TickBoxOn.gif\" onclick=\"javascript:export_engine_toggle('html5')\" /> " . XERTE_EXPORT_HTML5 . "</p>"; echo "<p><img id=\"flash\" src=\"website_code/images/TickBoxOff.gif\" onclick=\"javascript:export_engine_toggle('flash')\" /> " . XERTE_EXPORT_FLASH . "</p>"; } else { echo "<p><img id=\"html5\" src=\"website_code/images/TickBoxOff.gif\" onclick=\"javascript:export_engine_toggle('html5')\" /> " . XERTE_EXPORT_HTML5 . "</p>"; echo "<p><img id=\"flash\" src=\"website_code/images/TickBoxOn.gif\" onclick=\"javascript:export_engine_toggle('flash')\" /> " . XERTE_EXPORT_FLASH . "</p>"; } echo "<ol type='1'>"; echo "<li>" . XERTE_EXPORT_ZIP . "<ul><li><button type=\"button\" class=\"xerte_button\" onclick=\"property_tab_download('download_frame', 'html5', 'flash', '" . $xerte_toolkits_site->site_url . url_return("export", $_POST['template_id']) . "')\"><i class=\"fa fa-download\"></i> " . XERTE_EXPORT_ZIP_LINK . "</button></li></ul></li><br />"; echo "<li>" . XERTE_EXPORT_SCORM; echo "<ol type='a'>"; echo "<li><button type=\"button\" class=\"xerte_button\" onclick=\"property_tab_download('download_frame', 'html5', 'flash', '" . $xerte_toolkits_site->site_url . url_return("scorm_rich", $_POST['template_id']) . "')\"><i class=\"fa fa-download\"></i> " . XERTE_EXPORT_SCORM_12_LINK . "</button></li><br/>"; echo "<li><button type=\"button\" class=\"xerte_button\" onclick=\"property_tab_download('download_frame', 'html5', 'flash', '" . $xerte_toolkits_site->site_url . url_return("scorm2004", $_POST['template_id']) . "')\"><i class=\"fa fa-download\"></i> " . XERTE_EXPORT_SCORM_2004_LINK . "</button></li><br /></ol></li>"; echo "<li>" . XERTE_EXPORT_ZIP_ARCHIVE . "<ul><li><button type=\"button\" class=\"xerte_button\" onclick=\"property_tab_download('download_frame', 'html5', 'flash', '" . $xerte_toolkits_site->site_url . url_return("export_full", $_POST['template_id']) . "')\"><i class=\"fa fa-download\"></i> " . XERTE_EXPORT_ZIP_ARCHIVE_LINK . "</button></li></ul><br /></li>";
* additional information regarding copyright ownership. * The Apereo Foundation licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ require_once dirname(__FILE__) . "/config.php"; require_once dirname(__FILE__) . "/website_code/php/template_library.php"; _load_language_file("/properties.inc"); ?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><?php echo PROPERTIES_TITLE; ?> </title> <!-- Properties HTML page Version 1.0
* The Apereo Foundation licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ require_once "../../../config.php"; require "../user_library.php"; if (is_user_admin()) { _load_language_file("/extend.inc"); if (file_exists($xerte_toolkits_site->root_file_path . "modules/" . $_POST['name'] . "/templates/")) { $dir = opendir($xerte_toolkits_site->root_file_path . "modules/" . $_POST['name'] . "/templates/"); while ($template = readdir($dir)) { if ($template != "." && $template != "..") { $data = file_get_contents($xerte_toolkits_site->root_file_path . "modules/" . $_POST['name'] . "/templates/" . $template . "/" . $template . ".info"); $info = explode("\n", $data); $template_object = array(); $template_name = array(); while ($attribute = array_pop($info)) { $attr_data = explode(":", $attribute); $template_object['name'] = trim($inner_folder); $template_name['name'] = trim($inner_folder); switch (trim(strtolower($attr_data[0]))) { case "display name": $template_object['display_name'] = trim($attr_data[1]);
dont_show_template(); } else { if ($row_play['access_to_whom'] == "Public") { /* * Public - Increment the number of users and show the template */ db_query("UPDATE {$xerte_toolkits_site->database_table_prefix}templatedetails SET number_of_uses=number_of_uses+1 WHERE template_id=?", array($safe_template_id)); show_template($row_play); } else { if ($row_play['access_to_whom'] == "Password") { /* * Password protected - Check if there has been a post */ // if ($_SERVER['REQUEST_METHOD'] == 'POST') { require_once $xerte_toolkits_site->php_library_path . "login_library.php"; _load_language_file("/website_code/php/display_library.inc"); if (!isset($mysqli)) { $mysqli = new mysqli($xerte_toolkits_site->database_host, $xerte_toolkits_site->database_username, $xerte_toolkits_site->database_password, $xerte_toolkits_site->database_name); if ($mysqli->error) { try { throw new Exception("0MySQL error {$mysqli->error} <br> Query:<br> {$query}", $mysqli->errno); } catch (Exception $e) { echo "Error No: " . $e->getCode() . " - " . $e->getMessage() . "<br />"; echo nl2br($e->getTraceAsString()); } } } if (!isset($lti)) { require_once 'LTI/ims-lti/UoN_LTI.php'; if (strlen($xerte_toolkits_site->database_table_prefix) > 0) { $lti = new UoN_LTI($mysqli, array('table_prefix' => $xerte_toolkits_site->database_table_prefix));
<?php require_once dirname(__FILE__) . "/config.php"; _load_language_file("/workspaceproperties.inc"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title><?php echo WORKSPACE_PROPERTIES_TITLE; ?> </title> <!-- University of Nottingham Xerte Online Toolkits Workspace properties HTML page Version 1.0 --> <link href="website_code/styles/workspacemanagement_tab.css" media="screen" type="text/css" rel="stylesheet" /> <link href="website_code/styles/properties_tab.css" media="screen" type="text/css" rel="stylesheet" /> <link href="website_code/styles/folderproperties_tab.css" media="screen" type="text/css" rel="stylesheet" /> <link href="website_code/styles/frontpage.css" media="screen" type="text/css" rel="stylesheet" /> <link href="website_code/styles/xerte_buttons.css" media="screen" type="text/css" rel="stylesheet" /> <?php
function show_preview_code2($row, $row_username) { global $xerte_toolkits_site, $youtube_api_key; _load_language_file("/modules/xerte/preview.inc"); $template_dir = $xerte_toolkits_site->users_file_area_full . $row['template_id'] . "-" . $row['username'] . "-" . $row['template_name'] . "/"; /* * Format the XML strings to provide data to the engine */ if (!file_exists($template_dir . '/preview.xml')) { $buffer = file_get_contents($template_dir . "/data.xml"); $fp = fopen($template_dir . "/preview.xml", "x"); fwrite($fp, $buffer); fclose($fp); } $string_for_flash = $xerte_toolkits_site->users_file_area_short . $row['template_id'] . "-" . $row_username['username'] . "-" . $row['template_name'] . "/"; $xmlfile = $string_for_flash . "preview.xml"; $xmlFixer = new XerteXMLInspector(); $xmlFixer->loadTemplateXML($xmlfile); if (strlen($xmlFixer->getName()) > 0) { $title = $xmlFixer->getName(); } else { $title = XERTE_PREVIEW_TITLE; } $string_for_flash_xml = $xmlfile . "?time=" . time(); $flash_js_dir = "modules/" . $row['template_framework'] . "/"; $template_path = "modules/" . $row['template_framework'] . "/parent_templates/" . $row['template_name'] . "/"; $rlo_file = $template_path . $row['template_name'] . ".rlt"; list($x, $y) = explode("~", get_template_screen_size($row['template_name'], $row['template_framework'])); // determine the correct engine to use $engine = 'flash'; $extra_flags = explode(";", $row['extra_flags']); foreach ($extra_flags as $flag) { $parameter = explode("=", $flag); switch ($parameter[0]) { case 'engine': $engine = $parameter[1]; break; } } // If given as a parameter, force this engine // If given as a parameter, force this engine if (isset($_REQUEST['engine'])) { if ($_REQUEST['engine'] == 'other') { if ($engine == 'flash') { $engine = 'javascript'; } else { $engine = 'flash'; } } else { $engine = $_REQUEST['engine']; } } if ($engine == 'flash') { $page_content = file_get_contents($xerte_toolkits_site->basic_template_path . $row['template_framework'] . "/player/rloObject.htm"); $page_content = str_replace("%WIDTH%", $x, $page_content); $page_content = str_replace("%HEIGHT%", $y, $page_content); $page_content = str_replace("%TITLE%", $title, $page_content); $page_content = str_replace("%RLOFILE%", $rlo_file, $page_content); $page_content = str_replace("%JSDIR%", $flash_js_dir, $page_content); $page_content = str_replace("%XMLPATH%", $string_for_flash, $page_content); $page_content = str_replace("%XMLFILE%", $string_for_flash_xml, $page_content); $page_content = str_replace("%SITE%", $xerte_toolkits_site->site_url, $page_content); $tracking = "<script type=\"text/javascript\" src=\"" . $flash_js_dir . "js/xttracking_noop.js\"></script>"; $page_content = str_replace("%TRACKING_SUPPORT%", $tracking, $page_content); } else { // $engine is assumed to be html5 if flash is NOT set $page_content = file_get_contents($xerte_toolkits_site->basic_template_path . $row['template_framework'] . "/player_html5/rloObject.htm"); $page_content = str_replace("%TITLE%", $title, $page_content); $page_content = str_replace("%TEMPLATEPATH%", $template_path, $page_content); $page_content = str_replace("%XMLPATH%", $string_for_flash, $page_content); $page_content = str_replace("%XMLFILE%", $string_for_flash_xml, $page_content); $page_content = str_replace("%THEMEPATH%", $xerte_toolkits_site->site_url . "themes/" . $row['template_name'] . "/", $page_content); // Handle offline variables $page_content = str_replace("%OFFLINESCRIPTS%", "", $page_content); $page_content = str_replace("%OFFLINEINCLUDES%", "", $page_content); $page_content = str_replace("%MATHJAXPATH%", "//cdn.mathjax.org/mathjax/latest/", $page_content); $tracking = "<script type=\"text/javascript\" src=\"" . $template_path . "common_html5/js/xttracking_noop.js\"></script>"; $page_content = str_replace("%TRACKING_SUPPORT%", $tracking, $page_content); $page_content = str_replace("%YOUTUBEAPIKEY%", $youtube_api_key, $page_content); } echo $page_content; }
function show_preview_code($row) { global $xerte_toolkits_site; $string_for_flash = $xerte_toolkits_site->users_file_area_short . $row['template_id'] . "-" . $row['username'] . "-" . $row['template_name'] . "/"; $xmlfile = $string_for_flash . "preview.xml"; $xmlFixer = new XerteXMLInspector(); $xmlFixer->loadTemplateXML($xmlfile); $string_for_flash_xml = $xmlfile . "?time=" . time(); $string_for_flash = $xerte_toolkits_site->users_file_area_short . $row['template_id'] . "-" . $row['username'] . "-" . $row['template_name'] . "/"; $template_path_string = "modules/site/parent_templates/" . $row['template_name']; require_once "config.php"; _load_language_file("/modules/site/preview.inc"); ?> <!DOCTYPE html> <html xmlns:fb="http://ogp.me/ns/fb#"> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta charset="utf-8"> <title><?php echo SITE_PREVIEW_TITLE; ?> </title> <link rel="icon" href="favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content=""> <meta name="author" content=""> <!--jquery--> <script src="<?php echo $template_path_string; ?> /common/js/jquery.js"></script> <!--styles --> <link href="<?php echo $template_path_string; ?> /common/css/bootstrap.css" rel="stylesheet"> <link href="<?php echo $template_path_string; ?> /common/css/bootstrap-responsive.css" rel="stylesheet"> <!--custom styles for this template--> <link href="<?php echo $template_path_string; ?> /common/css/custom.css" rel="stylesheet"> <!--support for IE < 6-8 --> <script src="<?php echo $template_path_string; ?> /common/js/html5shiv.js"></script> <!--media element and initialisation--> <script src="<?php echo $template_path_string; ?> /common/mediaelement/mediaelement-and-player.min.js"></script> <link rel="stylesheet" href="<?php echo $template_path_string; ?> /common/mediaelement/mediaelementplayer.min.css" /> <script type="text/javascript"> var FileLocation = "<?php echo $string_for_flash; ?> "; var templateLocation = "<?php echo $template_path_string; ?> /"; var projectXML = "<?php echo $string_for_flash_xml; ?> /"; //this is the file to read, not the xml </script> <script type="text/javascript" src="https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-MML-AM_HTMLorMML-full"></script> </head> <body data-twttr-rendered="true" data-spy="scroll" data-target="#contentTable" onunload="window.opener.innerWidth +=2;window.opener.innerWidth -=2;"> <!--facebookAPI--> <div id="fb-root"></div> <script src="<?php echo $template_path_string; ?> /common/js/initFB.js" defer></script> <div class="navbar navbar-inverse navbar-fixed-top"> <div class="navbar-inner"> <div class="container"> <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <div class="nav-collapse collapse"> <ul class="nav" id="nav"> <!--<li class=""><a href="./index.html">Home</a></li>--> </ul> </div> </div> </div> </div> <!--Learning Object Title--> <header class="jumbotron" id="overview"> <div class="container"> <h1 id="pageTitle">Learning Object Title</h1> <p id="pageSubTitle" class="lead">Overview title for the content below</p> </div> </header> <!--main page content: nav bar and sections--> <div class="container"> <div class="row-fluid"> <!--navigation--> <div class="span3 bs-docs-sidebar" id="contentTable"> <ul class="nav nav-list bs-docs-sidenav affix" id="toc"> <!--<li><a href="#section1ID">Section 1</a></li>--> </ul> </div> <!--content--> <div class="span9" id="mainContent"> </div> </div> </div> <footer class="footer"> <div class="container"> <div class="row-fluid"> <div class="span12"> <div class="addthis_toolbox addthis_default_style "> <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a> <a class="addthis_button_tweet"></a> <a class="addthis_button_google_plusone"></a> <a class="addthis_button_linkedin_counter"></a> <a class="addthis_button_pinterest_pinit"></a> <a class="addthis_counter addthis_pill_style"></a> </div> <!--<script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>--> <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-50f40a8436e8c4c5" defer></script> </div> </div> </div> </footer> <!--bootstrap script--> <script src="<?php echo $template_path_string; ?> /common/js/bootstrap.min.js"></script> <!--initialise the application specific code--> <script src="<?php echo $template_path_string; ?> /common/js/application.js"></script> <script type="text/javascript"> <?php echo "</script></body></html>"; }
/** * * Function create folder loop * This function outputs the xerte editor code * @param array $row_edit - the mysql query for this folder * @param number $xerte_toolkits_site - a number to make sure that we enter and leave each folder correctly * @param bool $read_status - a read only flag for this template * @param number $version_control - a setting to handle the delettion of lock files when the window is closed * @version 1.0 * @author Patrick Lockley */ function output_editor_code($row_edit, $xerte_toolkits_site, $read_status, $version_control) { require_once "config.php"; _load_language_file("/modules/xerte/edit.inc"); $row_username = db_query_one("select username from {$xerte_toolkits_site->database_table_prefix}logindetails where login_id=?", array($row_edit['user_id'])); if (empty($row_username)) { die("Invalid user id ?"); } /** * create the preview xml used for editing */ $preview = $xerte_toolkits_site->root_file_path . $xerte_toolkits_site->users_file_area_short . $row_edit['template_id'] . "-" . $row_username['username'] . "-" . $row_edit['template_name'] . "/preview.xml"; $data = $xerte_toolkits_site->root_file_path . $xerte_toolkits_site->users_file_area_short . $row_edit['template_id'] . "-" . $row_username['username'] . "-" . $row_edit['template_name'] . "/data.xml"; if (!file_exists($preview) && file_exists($data)) { copy($data, $preview); chmod($preview, 0777); } /** * set up the strings used in the flash vars */ $string_for_flash_xml = $xerte_toolkits_site->users_file_area_short . $row_edit['template_id'] . "-" . $row_username['username'] . "-" . $row_edit['template_name'] . "/preview.xml"; $string_for_flash_media = $xerte_toolkits_site->users_file_area_short . $row_edit['template_id'] . "-" . $row_username['username'] . "-" . $row_edit['template_name'] . "/media/"; $string_for_flash_xwd = "modules/" . $row_edit['template_framework'] . "/parent_templates/" . $row_edit['template_name'] . "/"; /** * sort of the screen sies required for the preview window */ $temp = explode("~", get_template_screen_size($row_edit['template_name'], $row_edit['template_framework'])); $edit_site_logo = $xerte_toolkits_site->site_logo; $pos = strrpos($edit_site_logo, '/') + 1; $edit_site_logo = substr($edit_site_logo, 0, $pos) . "edit_" . substr($edit_site_logo, $pos); $edit_organisational_logo = $xerte_toolkits_site->organisational_logo; $pos = strrpos($edit_organisational_logo, '/') + 1; $edit_organisational_logo = substr($edit_organisational_logo, 0, $pos) . "edit_" . substr($edit_organisational_logo, $pos); /** * set up the onunload function used in version control */ ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title><?php echo XERTE_EDIT_TITLE; ?> </title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="website_code/styles/frontpage.css" media="screen" type="text/css" rel="stylesheet" /> <link rel="icon" href="favicon_edit.ico" type="image/x-icon" /> <link rel="shortcut icon" href="favicon_edit.ico" type="image/x-icon" /> <script src="modules/xerte/js/swfobject.js"></script> <script src="website_code/scripts/opencloseedit.js"></script> <script src="website_code/scripts/template_management.js"></script> <script src="website_code/scripts/ajax_management.js"></script> <script type="text/javascript" language="javascript"> function getSessionID(){ var id; var auth = '<?php echo strtolower($xerte_toolkits_site->authentication_method); ?> '; var browser = (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) ? 'firefox' : ((navigator.userAgent.toLowerCase().indexOf('safari') > -1) ? 'safari' : 'other'); //Pass data to upload (Firefox Flash Cookie Bug) which we are //It first checks moodle, then defaults if (auth == 'moodle') { //Its Moodle integration so we need the whole cookie return 'BROWSER=' + browser + '&AUTH=moodle&COOKIE=' + escape(document.cookie); } else if ((id = document.cookie.match(/PHPSESSID=[^;]+/))) { // Its Default authentication so we only need session id return 'BROWSER=' + browser + '&AUTH=xerte&' + id; } return null; } function setunload(){ window.onbeforeunload = bunload; } function hideunload(){ window.onbeforeunload = function(){}; } window.onbeforeunload = bunload; function bunload(){ path = "<?php echo $row_edit['template_id'] . "-" . $row_username['username'] . "-" . $row_edit['template_name'] . "/"; ?> "; template = "<?php echo $row_edit['template_id']; ?> "; if(typeof window_reference==="undefined"){ window.opener.edit_window_close(path,template); }else{ window_reference.edit_window_close(path,template); } } function receive_picture(url){ alert(url); } </script> </head> <body> <div style="margin:0 auto; width:800px"> <div class="edit_topbar" style="width:800px"> <img src="<?php echo $edit_site_logo; ?> " style="margin-left:10px; float:left" /> <img src="<?php echo $edit_organisational_logo; ?> " style="margin-right:10px; float:right" /> </div> </div> <center> <div id="flashcontent" style="margin:0 auto"> This text is replaced by the Flash movie. </div> </center> <script type="text/javascript"> var so = new SWFObject("modules/xerte/engine/wizard.swf", "mymovie", "800", "600", "8,0,0,0", "#e0e0e0"); so.addParam("quality", "high");<?php /** * set up the flash vars the editor needs. */ echo "so.addVariable(\"xmlvariable\", \"{$string_for_flash_xml}\");"; echo "\n"; echo "so.addVariable(\"rlovariable\", \"{$string_for_flash_media}\");"; echo "\n"; echo "so.addVariable(\"languagecodevariable\", \"" . $_SESSION['toolkits_language'] . "\");"; echo "\n"; echo "so.addVariable(\"originalpathvariable\", \"{$string_for_flash_xwd}\");"; echo "\n"; echo "so.addVariable(\"template_id\", \"" . $row_edit['template_id'] . "\");"; echo "\n"; echo "so.addVariable(\"template_height\", \"" . $temp[1] . "\");"; echo "\n"; echo "so.addVariable(\"template_width\", \"" . $temp[0] . "\");"; echo "\n"; echo "so.addVariable(\"read_and_write\", \"" . $read_status . "\");"; echo "\n"; echo "so.addVariable(\"savepath\", \"" . $xerte_toolkits_site->flash_save_path . "\");"; echo "\n"; echo "so.addVariable(\"upload_path\", \"" . $xerte_toolkits_site->flash_upload_path . "\");"; echo "\n"; echo "so.addVariable(\"preview_path\", \"" . $xerte_toolkits_site->flash_preview_check_path . "\");"; echo "\n"; echo "so.addVariable(\"flv_skin\", \"" . $xerte_toolkits_site->flash_flv_skin . "\");"; echo "\n"; echo "so.addVariable(\"site_url\", \"" . $xerte_toolkits_site->site_url . "\");"; echo "\n"; echo "so.addVariable(\"apache\", \"" . $xerte_toolkits_site->apache . "\");"; echo "\n"; echo "so.write(\"flashcontent\");"; echo "\n"; echo "</script></body></html>"; echo "\n"; }
<?php require_once "../../../config.php"; _load_language_file("/website_code/php/management/user_templates.inc"); require "../user_library.php"; require "../url_library.php"; require "management_library.php"; if (is_user_admin()) { $database_id = database_connect("templates list connected", "template list failed"); $query = "select * from " . $xerte_toolkits_site->database_table_prefix . "logindetails order by surname,firstname,username"; $query_response = mysql_query($query); // Fetch users only once and put the results in a php array $logins = array(); while ($login = mysql_fetch_array($query_response, MYSQL_ASSOC)) { $logins[] = $login; } echo "<form name=\"user_templates\" action=\"javascript:list_templates_for_user('list_user')\"><select id=\"list_user\">"; foreach ($logins as $row_users) { echo "<option value=\"" . $row_users['login_id'] . "\">" . $row_users['firstname'] . " " . $row_users['surname'] . " (" . $row_users['username'] . ")</option>"; } echo "</select>"; //} echo "<button type=\"submit\" class=\"xerte_button\">" . USERS_MANAGEMENT_TEMPLATE_VIEW . "</button></form></div><div id=\"usertemplatelist\"></div>"; mysql_close($database_id); } else { management_fail(); }
<?php /** * Licensed to The Apereo Foundation under one or more contributor license * agreements. See the NOTICE file distributed with this work for * additional information regarding copyright ownership. * The Apereo Foundation licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ _load_language_file("/modules/decision/export_page.inc"); echo "<p>" . XERTE_EXPORT_DESCRIPTION . "</p>"; echo "<ol type='1'>"; echo "<li>" . XERTE_EXPORT_ZIP . "<ul><li><button type=\"button\" class=\"xerte_button\" onclick=\"property_tab_download('download_frame', '', '', '" . $xerte_toolkits_site->site_url . url_return("export", $_POST['template_id']) . "')\"><i class=\"fa fa-download\"></i> " . XERTE_EXPORT_ZIP_LINK . "</button></li></ul></li><br />"; echo "<li>" . XERTE_EXPORT_ZIP_ARCHIVE . "<ul><li><button type=\"button\" class=\"xerte_button\" onclick=\"property_tab_download('download_frame', '', '', '" . $xerte_toolkits_site->site_url . url_return("export_full", $_POST['template_id']) . "')\"><i class=\"fa fa-download\"></i> " . XERTE_EXPORT_ZIP_ARCHIVE_LINK . "</button></li></ul><br /></li>"; echo "</ol>";
* agreements. See the NOTICE file distributed with this work for * additional information regarding copyright ownership. * The Apereo Foundation licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ require_once "../../../config.php"; _load_language_file("/website_code/php/management/error_list.inc"); require "../user_library.php"; require "management_library.php"; if (is_user_admin()) { $path = $xerte_toolkits_site->error_log_path; $error_file_list = opendir($path); echo "<div style=\"float:left; margin:10px; width:100%; height:30px; position:relative; border-bottom:1px solid #999\"><button type=\"button\" class=\"xerte_button\" onclick=\"javascript:delete_error_logs()\"><i class=\"fa fa-trash-o\"></i> " . DELETE_ALL . "</button></div>"; while ($file = readdir($error_file_list)) { if (strpos($file, ".log") != 0) { $user_parameter = substr($file, 0, strlen($file) - 4); $prefix = $xerte_toolkits_site->database_table_prefix; $query_for_full_name = "select login_id, firstname, surname from {$prefix}logindetails where username= ?"; $params = array($user_parameter); $query_for_full_name_response = db_query($query_for_full_name, $params); if (sizeof($query_for_full_name_response) > 0) { $row_name = $query_for_full_name_response[0];
<?php /** * * name select template, displays usernames so people can choose to share a template * * @author Patrick Lockley * @version 1.0 * @copyright Copyright (c) 2008,2009 University of Nottingham * @package */ require_once "../../../config.php"; _load_language_file("/website_code/php/properties/name_select_template.inc"); if (is_numeric($_POST['template_id'])) { $search = mysql_real_escape_string($_POST['search_string']); $tutorial_id = mysql_real_escape_string($_POST['template_id']); $database_id = database_connect("Template name select share access database connect success", "Template name select share database connect failed"); /** * Search the list of user logins for user with that name */ if (strlen($search) != 0) { $query_for_names = "select login_id, firstname, surname from " . $xerte_toolkits_site->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 "<p>" . $row['firstname'] . " " . $row['surname'] . " (" . $row['login_id'] . ") - <button type=\"button\" class=\"xerte_button\" onclick=\"share_this_template('" . $tutorial_id . "', '" . $row['login_id'] . "')\">" . NAME_SELECT_CLICK . "</button></p>"; } } else { echo "<p>" . NAME_SELECT_DETAILS_FAIL . "</p>"; } }
<?php require_once "../../../config.php"; _load_language_file("/website_code/php/management/template_details_management.inc"); require "../user_library.php"; if (is_user_admin()) { $query = "update {$xerte_toolkits_site->database_table_prefix}originaltemplatesdetails set description=?,\r\n date_uploaded=?,\r\n display_name=?,\r\n display_id=?,\r\n access_rights=?,\r\n active=? WHERE template_type_id = ? "; $active = "0"; if ($_POST['active'] == true) { $active = "1"; } $res = db_query($query, array($_POST['desc'], $_POST['date_uploaded'], $_POST['display'], $_POST['example'], $_POST['access'], $active, $_POST['template_id'])); if ($res) { echo TEMPLATE_CHANGE_SUCCESS; } else { echo TEMPLATE_CHANGE_FAIL . " " . mysql_error(); } }
/** * * Function output_editor_code * This function outputs the xerte editor code * @param array $row_edit - the mysql query for this folder * @param number $xerte_toolkits_site - a number to make sure that we enter and leave each folder correctly * @param bool $read_status - a read only flag for this template * @param number $version_control - a setting to handle the delettion of lock files when the window is closed * @version 1.0 * @author Patrick Lockley */ function output_editor_code($row_edit, $xerte_toolkits_site, $read_status, $version_control) { require_once "config.php"; require_once "website_code/php/language_library.php"; _load_language_file("/modules/xerte/edit.inc"); $row_username = db_query_one("select username from {$xerte_toolkits_site->database_table_prefix}logindetails where login_id=?", array($row_edit['user_id'])); if (empty($row_username)) { die("Invalid user id ?"); } /** * create the preview xml used for editing */ $preview_filename = "preview.xml"; $rlo_path = $xerte_toolkits_site->users_file_area_full . $row_edit['template_id'] . "-" . $row_username['username'] . "-" . $row_edit['template_name']; $media_path = $rlo_path . "/media/"; $preview = $rlo_path . "/preview.xml"; $data = $rlo_path . "/data.xml"; if (!file_exists($preview) && file_exists($data)) { copy($data, $preview); chmod($preview, 0777); } $preview_url = $xerte_toolkits_site->users_file_area_short . $row_edit['template_id'] . "-" . $row_username['username'] . "-" . $row_edit['template_name'] . "/" . $preview_filename; $data_url = $xerte_toolkits_site->users_file_area_short . $row_edit['template_id'] . "-" . $row_username['username'] . "-" . $row_edit['template_name'] . "/data.xml"; $rlo_url = $xerte_toolkits_site->site_url . $xerte_toolkits_site->users_file_area_short . $row_edit['template_id'] . "-" . $row_username['username'] . "-" . $row_edit['template_name']; $xwd_url = "modules/" . $row_edit['template_framework'] . "/parent_templates/" . $row_edit['template_name'] . "/"; $xwd_path = $xerte_toolkits_site->root_file_path . "/modules/" . $row_edit['template_framework'] . "/parent_templates/" . $row_edit['template_name'] . "/"; if (file_exists($xwd_path . "wizards/" . $_SESSION['toolkits_language'] . "/data.xwd")) { $xwd_file_url = $xwd_url . "wizards/" . $_SESSION['toolkits_language'] . "/data.xwd"; } else { if (file_exists($xwd_path . "wizards/en-GB/data.xwd")) { $xwd_file_url = $xwd_url . "wizards/en-GB/data.xwd"; } else { if (file_exists($xwd_path . "data.xwd")) { $xwd_file_url = $xwd_url . "data.xwd"; } } } $module_url = "modules/" . $row_edit['template_framework'] . "/"; $jqgridlangfile = "editor/js/vendor/jqgrid/js/i18n/grid.locale-en.js"; $jqgridlangcode = strtolower($_SESSION['toolkits_language']); if (file_exists($xerte_toolkits_site->root_file_path . "editor/js/vendor/jqgrid/js/i18n/grid.locale-" . $jqgridlangcode . ".js")) { $jqgridlangfile = "editor/js/vendor/jqgrid/js/i18n/grid.locale-" . $jqgridlangcode . ".js"; } else { $jqgridlangcode = substr($jqgridlangcode, 0, 2); if (file_exists($xerte_toolkits_site->root_file_path . "editor/js/vendor/jqgrid/js/i18n/grid.locale-" . $jqgridlangcode . ".js")) { $jqgridlangfile = "editor/js/vendor/jqgrid/js/i18n/grid.locale-" . $jqgridlangcode . ".js"; } } /** * build an array of available themes for this template */ $theme_folder = $xerte_toolkits_site->root_file_path . "themes/" . $row_edit['template_name'] . "/"; $ThemeList = array(); // Add default theme $ThemeList[] = array('name' => "default", 'display_name' => "Xerte Online Toolkits", 'description' => "Xerte Online Toolkits", 'preview' => ""); if (file_exists($theme_folder)) { $d = opendir($theme_folder); while ($f = readdir($d)) { if (is_dir($theme_folder . $f)) { if (file_exists($theme_folder . $f . "/" . $f . ".info")) { $info = file($theme_folder . $f . "/" . $f . ".info", FILE_SKIP_EMPTY_LINES); $themeProperties = new StdClass(); foreach ($info as $line) { $attr_data = explode(":", $line, 2); if (empty($attr_data) || sizeof($attr_data) != 2) { continue; } switch (trim(strtolower($attr_data[0]))) { case "name": $themeProperties->name = trim($attr_data[1]); break; case "display name": $themeProperties->display_name = trim($attr_data[1]); break; case "description": $themeProperties->description = trim($attr_data[1]); break; case "enabled": $themeProperties->enabled = strtolower(trim($attr_data[1])); break; case "preview": $themeProperties->preview = $xerte_toolkits_site->site_url . "themes/" . $row_edit['template_name'] . "/" . $f . "/" . trim($attr_data[1]); break; } } if (substr($themeProperties->enabled, 0, 1) == "y") { $ThemeList[] = array('name' => $themeProperties->name, 'display_name' => $themeProperties->display_name, 'description' => $themeProperties->description, 'preview' => $themeProperties->preview); } } } } } /** * sort of the screen sies required for the preview window */ $temp = explode("~", get_template_screen_size($row_edit['template_name'], $row_edit['template_framework'])); //$edit_site_logo = $xerte_toolkits_site->site_logo; //$pos = strrpos($edit_site_logo, '/') + 1; //$edit_site_logo = substr($edit_site_logo,0,$pos) . "edit_" . substr($edit_site_logo,$pos); //$edit_organisational_logo = $xerte_toolkits_site->organisational_logo; //$pos = strrpos($edit_organisational_logo, '/') + 1; //$edit_organisational_logo = substr($edit_organisational_logo,0,$pos) . "edit_" . substr($edit_organisational_logo,$pos); /** * set up the onunload function used in version control */ ?> <!DOCTYPE html> <html lang="<?php echo $_SESSION['toolkits_language']; ?> "> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Xerte Online Toolkits Editor</title> <link rel="stylesheet" href="editor/css/jquery-ui.css"> <link rel="stylesheet" href="editor/js/vendor/themes/default/style.css" /> <link rel="stylesheet" type="text/css" href="website_code/styles/xerte_buttons.css" /> <link rel="stylesheet" type="text/css" href="editor/css/complex.css" /> <link rel="stylesheet" type="text/css" href="editor/js/vendor/featherlight/featherlight.min.css" /> <link rel="stylesheet" type="text/css" href="editor/js/vendor/imgareaselect/imgareaselect-default.css" /> <link rel="stylesheet" type="text/css" href="editor/js/vendor/jqgrid/css/ui.jqgrid.css" /> <link rel="stylesheet" type="text/css" href="editor/js/vendor/ckeditor/plugins/codemirror/css/codemirror.min.css" /> <link rel="stylesheet" type="text/css" href="modules/xerte/parent_templates/Nottingham/common_html5/font-awesome/css/font-awesome.min.css"> <link rel="stylesheet" type="text/css" href="modules/xerte/parent_templates/Nottingham/common_html5/font-awesome-4.3.0/css/font-awesome.min.css"> <link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'> <script src="website_code/scripts/template_management.js"></script> <!--[if lte IE 7]> <style type="text/css"> body { font-size: 85%; } </style> <![endif]--> </head> <body> <img id="loader" src="editor/img/loading16.gif" /> <div class="hide ui-layout-west"> <div class="header"></div> <div class="content"></div> <div class="footer"></div> </div> <div class="hide ui-layout-east"> <div class="header"><div id="optional_title">Optional parameters</div></div> <div id="optionalParams" class="content"> <p>...</p> </div> <div class="footer"></div> </div> <div class="hide ui-layout-north"> <div class="content" id="#header_images"> <?php if (file_exists($xerte_toolkits_site->root_file_path . "branding/logo_left.png")) { echo "<img src=\"branding/logo_left.png\" style=\"float:left\" />"; } else { echo "<img src=\"website_code/images/logo.png\" style=\"float:left\" />"; } if (file_exists($xerte_toolkits_site->root_file_path . "branding/logo_right.png")) { echo "<img src=\"branding/logo_right.png\" style=\"float:right\" />"; } else { echo "<img src=\"website_code/images/apereoLogo.png\" style=\"float:right\" />"; } ?> </div> </div> <div class="hide ui-layout-south"> <div class="header">Options</div> <div class="content"></div> </div> <div id="mainContent" class="hide ui-layout-center pane pane-center ui-layout-pane ui-layout-pane-center"> <div class="header"></div> <div id="content" class="content"> <div id="mainPanel"></div> <div id="languagePanel" style="display:none"> <hr> </div> <div id="insert_subnodes"> </div> <div class="nodeInfo" id="info"> </div> </div> <div id="main_footer" class="footer"> <div id="checkbox_outer"><table><tr><td id="checkbox_holder"></td></tr></table></div> </div> </div> <div id="shadow" class="dark" class="hide"></div> <div id="insert_menu" class="hide"></div> <!-- <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> --> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script>window.jQuery || document.write('<script src="editor/js/vendor/jquery-1.9.1.min.js"><\/script>')</script> <?php if (preg_match('~MSIE|Internet Explorer~i', $_SERVER['HTTP_USER_AGENT']) || strpos($_SERVER['HTTP_USER_AGENT'], 'Trident/7.0; rv:11.0') !== false) { ?> <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script> <?php } else { ?> <script type="text/javascript" src="editor/js/vendor/jquery.ui-1.10.4.js"></script> <?php } ?> <script type="text/javascript" src="editor/js/vendor/jquery.layout-1.3.0-rc30.79.min.js"></script> <script type="text/javascript" src="editor/js/vendor/jquery.ui.touch-punch.min.js"></script> <script type="text/javascript" src="editor/js/vendor/modernizr-latest.js"></script> <script type="text/javascript" src="editor/js/vendor/jstree.js"></script> <!-- <script type="text/javascript" src="https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-MML-AM_HTMLorMML-full"></script> --> <script type="text/javascript" src="editor/js/vendor/ckeditor/ckeditor.js"></script> <script type="text/javascript" src="editor/js/vendor/ckeditor/adapters/jquery.js"></script> <script type="text/javascript" src="editor/js/vendor/jscolor.js"></script> <script type="text/javascript" src="editor/js/vendor/xml2json.min.js"></script> <script type="text/javascript" src="editor/js/vendor/featherlight/featherlight.js"></script> <script type="text/javascript" src="editor/js/vendor/imgareaselect/jquery.imgareaselect.js"></script> <script type="text/javascript" src="editor/js/vendor/jqgrid/js/jquery-migrate-1.2.1.js"></script> <script type="text/javascript" src="<?php echo $jqgridlangfile; ?> "></script> <script type="text/javascript" src="editor/js/vendor/jqgrid/js/jquery.jqGrid.min.js"></script> <!-- load exactly the same codemirror scripts as needed by ckeditor --> <script type="text/javascript" src="editor/js/vendor/ckeditor/plugins/codemirror/js/codemirror.min.js"></script> <script type="text/javascript" src="editor/js/vendor/ckeditor/plugins/codemirror/js/codemirror.addons.min.js"></script> <script type="text/javascript" src="editor/js/vendor/ckeditor/plugins/codemirror/js/codemirror.mode.htmlmixed.min.js"></script> <script type="text/javascript" src="editor/js/vendor/ckeditor/plugins/codemirror/js/codemirror.mode.javascript.min.js"></script> <script type="text/javascript" src="editor/js/vendor/ckeditor/plugins/codemirror/js/beautify.min.js"></script> <script type="text/javascript" src="editor/js/vendor/ckeditor/plugins/codemirror/js/codemirror.addons.search.min.js"></script> <script> <?php echo "previewxmlurl=\"" . $preview_url . "\";\n"; echo "dataxmlurl=\"" . $data_url . "\";\n"; echo "mediavariable=\"" . $media_path . "\";\n"; echo "rlourlvariable=\"" . $rlo_url . "/\";\n"; echo "rlopathvariable=\"" . $rlo_path . "/\";\n"; echo "languagecodevariable=\"" . $_SESSION['toolkits_language'] . "\";\n"; echo "editorlanguagefile=\"" . getWizardfile($_SESSION['toolkits_language']) . "\";\n"; echo "originalpathvariable=\"" . $xwd_url . "\";\n"; echo "xwd_file_url=\"" . $xwd_file_url . "\";\n"; echo "moduleurlvariable=\"" . $module_url . "\";\n"; echo "template_id=\"" . $row_edit['template_id'] . "\";\n"; echo "template_height=\"" . $temp[1] . "\";\n"; echo "template_width=\"" . $temp[0] . "\";\n"; echo "read_and_write=\"" . $read_status . "\";\n"; echo "savepath=\"" . $xerte_toolkits_site->flash_save_path . "\";\n"; echo "upload_path=\"" . $xerte_toolkits_site->flash_upload_path . "\";\n"; echo "preview_path=\"" . $xerte_toolkits_site->flash_preview_check_path . "\";\n"; echo "site_url=\"" . $xerte_toolkits_site->site_url . "\";\n"; echo "theme_list=" . json_encode($ThemeList) . ";\n"; ?> function bunload(){ path = "<?php echo $row_edit['template_id'] . "-" . $row_username['username'] . "-" . $row_edit['template_name'] . "/"; ?> "; if(typeof window_reference==="undefined"){ window.opener.edit_window_close(path); }else{ window_reference.edit_window_close(path); } } </script> <script type="text/javascript" src="editor/js/data.js"></script> <script type="text/javascript" src="editor/js/application.js"></script> <script type="text/javascript" src="editor/js/toolbox.js"></script> <script type="text/javascript" src="editor/js/language.js"></script> <script type="text/javascript" src="editor/js/layout.js"></script> <script type="text/javascript" src="editor/js/tree.js"></script> </body> </html> <?php }
<?php /** * * preview page, brings up a preview page for the editor to see their changes * * @author Patrick Lockley * @version 1.0 * @copyright Copyright (c) 2008,2009 University of Nottingham * @package */ require_once dirname(__FILE__) . "/config.php"; _load_language_file("/preview.inc"); require $xerte_toolkits_site->php_library_path . "screen_size_library.php"; require $xerte_toolkits_site->php_library_path . "template_status.php"; require $xerte_toolkits_site->php_library_path . "user_library.php"; /* * Check the ID is numeric */ if (isset($_SESSION['toolkits_logon_id'])) { if (is_numeric($_GET['template_id'])) { $safe_template_id = (int) $_GET['template_id']; // Need to run a proper string replace on any embedded instances of '$xerte_toolkits_site->database_table_prefix' so it's actually expanded. $query_for_preview_content_strip = str_replace("\" . \$xerte_toolkits_site->database_table_prefix . \"", $xerte_toolkits_site->database_table_prefix, $xerte_toolkits_site->play_edit_preview_query); /* * Standard query */ $query_for_preview_content = str_replace("TEMPLATE_ID_TO_REPLACE", $safe_template_id, $query_for_preview_content_strip); $row = db_query_one($query_for_preview_content); // get their username from the db which matches their login_id from the $_SESSION $row_username = db_query_one("select username from {$xerte_toolkits_site->database_table_prefix}logindetails where login_id=?", array($row['user_id']));
* Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * export template, allows the site to display the html for the export panel * * @author Patrick Lockley * @version 1.0 * @package */ require_once "../../../config.php"; _load_language_file("/website_code/php/properties/export_template.inc"); require_once "../template_library.php"; include "../template_status.php"; include "../url_library.php"; include "../user_library.php"; $database_id = database_connect("Export template database connect success", "Export template database connect failed"); /* * check user has some rights to this template */ if (is_numeric($_POST['template_id'])) { if (is_user_creator($_POST['template_id'], $_SESSION['toolkits_logon_id']) || is_user_admin()) { echo "<p class=\"header\"><span>" . EXPORT_TITLE . "</span></p>"; $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); $safe_template_id = (int) $_POST['template_id']; $query_for_play_content = str_replace("TEMPLATE_ID_TO_REPLACE", $safe_template_id, $query_for_play_content_strip); $row_play = db_query_one($query_for_play_content);
* Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ if (file_exists('../../../config.php')) { require_once '../../../config.php'; } elseif (file_exists(dirname(__FILE__) . '/../../config.php')) { require_once dirname(__FILE__) . '/../../config.php'; } else { require_once 'config.php'; } include 'file_library.php'; include 'user_library.php'; _load_language_file("/website_code/php/folder_library.inc"); /** * * Function make new 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 make_new_folder($folder_id, $folder_name) { global $xerte_toolkits_site; $mysql_id = database_connect("New folder database connect success", "New folder database connect failed"); $prefix = $xerte_toolkits_site->database_table_prefix; if ($folder_id == "file_area") {
<?php /** * * peer page, allows for the peer review of a template * * @author Patrick Lockley * @version 1.0 * @copyright Copyright (c) 2008,2009 University of Nottingham * @package */ require_once dirname(__FILE__) . "/config.php"; _load_language_file("/peer.inc"); require $xerte_toolkits_site->php_library_path . "display_library.php"; /** * Check the template ID is a number */ if (empty($_GET['template_id']) || !is_numeric($_GET['template_id'])) { die("Invalid template id"); } $template_id = (int) $_GET['template_id']; $query_to_check_peer = "select * from " . $xerte_toolkits_site->database_table_prefix . "additional_sharing where sharing_type=\"peer\" and template_id=\"" . $template_id . "\""; $query_for_peer_response = db_query_one("SELECT * FROM {$xerte_toolkits_site->database_table_prefix}additional_sharing WHERE sharing_type = ? AND template_id = ?", array('peer', $template_id)); /** * The number of rows being not equal to 0, indicates peer review has been set up. */ if (!empty($query_for_peer_response)) { $query_for_play_content = "select otd.template_name, ld.username, otd.template_framework, tr.user_id, tr.folder, tr.template_id, td.access_to_whom, td.extra_flags"; $query_for_play_content .= " from " . $xerte_toolkits_site->database_table_prefix . "originaltemplatesdetails otd, " . $xerte_toolkits_site->database_table_prefix . "templaterights tr, " . $xerte_toolkits_site->database_table_prefix . "templatedetails td, " . $xerte_toolkits_site->database_table_prefix . "logindetails ld"; $query_for_play_content .= " where td.template_type_id = otd.template_type_id and td.creator_id = ld.login_id and tr.template_id = td.template_id and tr.template_id=" . $template_id . " and role='creator'"; $row_play = db_query_one($query_for_play_content);
<?php header("Content-Type: application/xml; charset=utf-8"); require_once dirname(__FILE__) . "/config.php"; _load_language_file("/syndicate.inc"); include $xerte_toolkits_site->php_library_path . "url_library.php"; $query = "SELECT {$xerte_toolkits_site->database_table_prefix}originaltemplatesdetails.template_name as origname, username, {$xerte_toolkits_site->database_table_prefix}logindetails.login_id, \r\n{$xerte_toolkits_site->database_table_prefix}templatedetails.template_id, keywords, creator_id, date_created, {$xerte_toolkits_site->database_table_prefix}templatedetails.template_name, \r\nlicense, category, export, {$xerte_toolkits_site->database_table_prefix}templatesyndication.description, firstname, surname \r\nFROM {$xerte_toolkits_site->database_table_prefix}templatedetails, {$xerte_toolkits_site->database_table_prefix}templatesyndication, {$xerte_toolkits_site->database_table_prefix}logindetails, \r\n{$xerte_toolkits_site->database_table_prefix}originaltemplatesdetails \r\nWHERE syndication='true'\r\nAND login_id = creator_id \r\nAND {$xerte_toolkits_site->database_table_prefix}templatedetails.template_id = {$xerte_toolkits_site->database_table_prefix}templatesyndication.template_id \r\nAND {$xerte_toolkits_site->database_table_prefix}templatedetails.template_type_id = {$xerte_toolkits_site->database_table_prefix}originaltemplatesdetails.template_type_id"; $rows = db_query($query); echo "<" . "?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n <rss version=\"2.0\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://web.resource.org/cc/\">\r\n <channel>\r\n <title>" . $xerte_toolkits_site->rss_title . "</title>\r\n <link>" . $xerte_toolkits_site->site_url . "</link><description>" . SYNDICATE_DESCRIPTION . $xerte_toolkits_site->synd_publisher . "</description><generator>Xerte Online Toolkits</generator><language>" . SYNDICATE_LANGUAGE . "</language><copyright>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/ </copyright><lastBuildDate>" . date(DATE_RSS, time() - 20000) . "</lastBuildDate><pubDate>" . date(DATE_RSS, time() - 20000) . "</pubDate><dc:publisher>" . $xerte_toolkits_site->synd_publisher . "</dc:publisher><cc:license>" . $xerte_toolkits_site->synd_license . "</cc:license>"; foreach ($rows as $row) { $_dataxml = $xerte_toolkits_site->root_file_path . $xerte_toolkits_site->users_file_area_short . $row['template_id'] . '-' . $row['username'] . '-' . $row['origname'] . '/data.xml'; echo "<item><title>" . str_replace("_", " ", $row['template_name']) . "</title>\r\n <link>" . $xerte_toolkits_site->site_url . url_return("play", $row['template_id']) . "</link>\r\n <dc:date>" . date(DATE_RSS, filemtime($_dataxml)) . "</dc:date>\r\n <description><![CDATA[" . $row['description'] . "<br>" . str_replace("_", " ", $row['template_name']) . " was developed by " . $row['firstname'] . " " . $row['surname'] . " <br/> This content has the following license - " . $row['license']; if ($row['export'] == "true") { echo "<br> " . SYNDICATE_DOWNLOAD . $xerte_toolkits_site->site_url . url_return("export", $row['template_id']); echo "<br> " . SYNDICATE_DOWNLOAD_SCORM . $xerte_toolkits_site->site_url . url_return("scorm", $row['template_id']); } echo "]]></description><guid isPermaLink=\"true\">" . $xerte_toolkits_site->site_url . url_return("play", $row['template_id']) . "</guid><dc:contributor>" . $xerte_toolkits_site->synd_publisher . "</dc:contributor><dc:creator>" . $row['surname'] . ", " . $row['firstname'] . " </dc:creator><dc:title>" . $row['template_name'] . "</dc:title><dc:type>Course</dc:type><dc:description><![CDATA[" . $row['description'] . "<br>" . str_replace("_", " ", $row['template_name']) . " was developed by " . $row['firstname'] . " " . $row['surname'] . "<Br> This content has the following license - " . $row['license']; if ($row['export'] == "true") { echo "<br> " . SYNDICATE_DOWNLOAD . $xerte_toolkits_site->site_url . url_return("export", $row['template_id']); echo "<br> " . SYNDICATE_DOWNLOAD_SCORM . $xerte_toolkits_site->site_url . url_return("scorm", $row['template_id']); } echo "]]></dc:description><dc:format>text/html</dc:format><dc:language>en-gb</dc:language><dc:relation><![CDATA["; if ($row['export'] == "true") { echo $xerte_toolkits_site->site_url . url_return("export", $row['template_id']) . "</dc:relation><dc:relation>"; echo $xerte_toolkits_site->site_url . url_return("scorm", $row['template_id']); } echo "]]></dc:relation><dc:publisher>" . $xerte_toolkits_site->synd_publisher . "</dc:publisher><dc:rights>" . $row['license'] . "</dc:rights>"; $new_array = explode(",", $row['keywords']); while ($word = array_pop($new_array)) { echo "<dc:subject>" . $word . "</dc:subject>"; }
* agreements. See the NOTICE file distributed with this work for * additional information regarding copyright ownership. * The Apereo Foundation licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ require_once dirname(__FILE__) . "/config.php"; _load_language_file("/management.inc"); /** * * Login page, self posts to become management page * * @author Patrick Lockley * @version 1.0 * @package */ function mgt_page($xerte_toolkits_site, $extra) { ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php /** * Requires a db table called user which contains fields called firstname, surname, password and username. * * CREATE TABLE user ( id int(11) primary key auto_increment, username varchar(50) not null, password varchar(50) not null, firstname varchar(50) not null, surname varchar(50) not null) ; * * Pass attention to the _hashAndSalt() method below - if you add any users into the above database, you will need to either use the same salt as defined below, or modify this code. * Furthermore you will need to ensure your passwords in the DB are hashed using the same mechanism (currently sha1). * * @see Xerte_Authentication_Abstract */ _load_language_file("/library/Xerte/Authentication/Db.inc"); class Xerte_Authentication_Db extends Xerte_Authentication_Abstract { private $_record = array(); public function getFirstname() { if (isset($this->_record['firstname'])) { return $this->_record['firstname']; } return null; } public function getUsername() { if (isset($this->_record['username'])) { return $this->_record['username']; } return null; } public function getSurname()
<?php /** * * workspace templates template page, used displays the User created * * @author Patrick Lockley * @version 1.0 * @copyright Copyright (c) 2008,2009 University of Nottingham * @package */ require_once "../../../config.php"; _load_language_file("/website_code/php/workspaceproperties/usage_templates_template.inc"); include "../display_library.php"; include "workspace_library.php"; /** * connect to the database */ workspace_templates_menu(); $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); workspace_menu_create(60); echo "<div style=\"float:left; width:40%; height:20px;\">" . USAGE_TEMPLATE_STATS . "</div>"; while ($row_template_name = mysql_fetch_array($query_shared_response)) { if (trim($row_template_name['number_of_uses']) != "") { $plays = $row_template_name['number_of_uses']; } else { $plays = 0; } echo "<div style=\"float:left; width:60%;\">" . str_replace("_", "", $row_template_name['template_name']) . "</div>";
* See the License for the specific language governing permissions and * limitations under the License. */ /** * * template close, code that runs when an editor window is closed to remove the lock file * * @author Patrick Lockley * @version 1.0 * @package */ require_once '../../../config.php'; if (empty($_SESSION) || !isset($_SESSION['toolkits_logon_id'])) { die("Session expired; please login again."); } _load_language_file("/website_code/php/versioncontrol/template_close.inc"); require '../template_status.php'; $temp_array = explode("-", $_POST['file_path']); database_connect("template close success", "template close fail"); if (file_exists($xerte_toolkits_site->users_file_area_full . $_POST['file_path'] . "lockfile.txt")) { /* * Code to delete the lock file */ $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']); $row_template_name = db_query_one("Select template_name from {$xerte_toolkits_site->database_table_prefix}templatedetails WHERE template_id = ?", array($template_id[0])); $user_list = $temp[1]; $users = explode(" ", $user_list); /*
* Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * folder rss page, used by the site to display a folder's rss settings * * @author Patrick Lockley * @version 1.0 * @package */ require_once "../../../config.php"; _load_language_file("/website_code/php/folderproperties/folder_rss_template.inc"); include "../url_library.php"; //connect to the database $parameters = explode("_", $_POST['folder_id']); if (count($parameters) != 1) { if (is_numeric($parameters[0]) && is_string($parameters[1])) { $database_connect_id = database_connect("Folder_rss_template.php database connect success", "Folder_rss_template.php database connect failed"); $prefix = $xerte_toolkits_site->database_table_prefix; $query_for_folder_name = "select folder_name from {$prefix}folderdetails where folder_id=?"; $params = array($_POST['folder_id']); $row_template_name = db_query_one($query_for_folder_name, $params); echo "<p class=\"header\"><span>" . FOLDER_RSS_FEEDS . "</span></p>"; echo "<p>" . FOLDER_RSS_PUBLIC . "</p>"; $query_for_name = "select firstname, surname from {$prefix}logindetails where login_id=?"; $params = array($_SESSION['toolkits_logon_id']); $row_name = db_query_one($query_for_name, $params);
* Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * share this template, gives a new user rights to a template * * @author Patrick Lockley * @version 1.0 * @package */ require_once "../../../config.php"; _load_language_file("/website_code/php/properties/share_this_template.inc"); $prefix = $xerte_toolkits_site->database_table_prefix; if (is_numeric($_POST['user_id']) && is_numeric($_POST['template_id'])) { $user_id = $_POST['user_id']; $tutorial_id = $_POST['template_id']; $database_id = database_connect("Share this template database connect success", "Share this template database connect success"); /** * find the user you are sharing with's root folder to add this template to */ $query_to_find_out_root_folder = "select folder_id from {$prefix}folderdetails where login_id = ? and folder_parent=? and folder_name!=?"; $params = array($user_id, '0', 'recyclebin'); $row_query_root = db_query_one($query_to_find_out_root_folder, $params); $query_to_insert_share = "INSERT INTO {$prefix}templaterights (template_id, user_id, role, folder) VALUES (?,?,?,?)"; $params = array($tutorial_id, $user_id, "editor", $row_query_root['folder_id']); if (db_query($query_to_insert_share, $params)) { /**
* Licensed to The Apereo Foundation under one or more contributor license * agreements. See the NOTICE file distributed with this work for * additional information regarding copyright ownership. * The Apereo Foundation licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ _load_language_file("/website_code/php/management/management_library.inc"); require_once "../language_library.php"; function category_list() { global $xerte_toolkits_site; $query = "select * from " . $xerte_toolkits_site->database_table_prefix . "syndicationcategories order by category_name ASC"; echo "<p>" . MANAGEMENT_LIBRARY_ADD_CATEGORY . "</p>"; echo "<p>" . MANAGEMENT_LIBRARY_NEW_CATEGORY . "<form><textarea cols=\"100\" rows=\"2\" id=\"newcategory\">" . MANAGEMENT_LIBRARY_NEW_CATEGORY_NAME . "</textarea></form></p>"; echo "<p><form action=\"javascript:new_category();\"><button class=\"xerte_button\" type=\"submit\"><i class=\"fa fa-plus-circle\"></i> " . MANAGEMENT_LIBRARY_NEW_LABEL . "</button></form></p>"; echo "<p>" . MANAGEMENT_LIBRARY_EXISTING_CATEGORIES . "</p>"; $query_response = db_query($query); foreach ($query_response as $row) { echo "<p>" . $row['category_name'] . " - <button type=\"button\" class=\"xerte_button\" onclick=\"javascript:remove_category('" . $row['category_id'] . "')\"><i class=\"fa fa-minus-circle\"></i> " . MANAGEMENT_LIBRARY_REMOVE . " </button></p>"; } } function syndication_list()