/************************************************************************/ /* AContent */ /************************************************************************/ /* Copyright (c) 2010 */ /* Inclusive Design Institute */ /* */ /* This program is free software. You can redistribute it and/or */ /* modify it under the terms of the GNU General Public License */ /* as published by the Free Software Foundation. */ /************************************************************************/ $page = 'form_editor'; define('TR_INCLUDE_PATH', '../include/'); require_once TR_INCLUDE_PATH . 'vitals.inc.php'; require_once TR_INCLUDE_PATH . 'lib/tinymce.inc.php'; require_once TR_INCLUDE_PATH . 'classes/Utility.class.php'; Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE); $area = $_GET['area']; $number = null; $parts = explode('_', $area, 2); if (is_numeric($parts[1])) { $parts[1]++; $title = _AT($parts[0]) . ' ' . $parts[1]; } else { $title = _AT($area); } $onload = 'onload="init();"'; global $myLang; global $page; global $savant; global $errors, $onload; global $_user_location;
/** * Set top pages array based on login user's priviledge. If there's no login user, use priviledges that are open to public. * @access private * @param none * @return true * @author Cindy Qi Li */ private function setTopPages() { global $_base_path, $_course_id, $_content_id; $priviledgesDAO = new PrivilegesDAO(); if (isset($_SESSION['user_id']) && $_SESSION['user_id'] != 0) { $rows = $priviledgesDAO->getUserPrivileges($_SESSION['user_id']); } else { $rows = $priviledgesDAO->getPublicPrivileges(); } if (is_array($rows)) { foreach ($rows as $id => $row) { // replace the required constants in link $row['link'] = Utility::replaceConstants($row['link']); list($url, $param) = Utility::separateURLAndParam($row['link']); if (Utility::authenticate($row['user_requirement'], false)) { $this->pages[TR_NAV_TOP][] = array('url' => $_base_path . $row['link'], 'title' => _AT($row['title_var']), 'param' => $param); } // add section pages if it has not been defined in $this->pages if (!isset($this->pages[$url])) { $this->pages = array_merge($this->pages, array($url => array('title_var' => $row['title_var'], 'parent' => TR_NAV_TOP, 'param' => $param))); } else { $this->pages[$url]['param'] = $param; } } } return true; }
/* AContent */ /************************************************************************/ /* Copyright (c) 2010 */ /* Inclusive Design Institute */ /* */ /* This program is free software. You can redistribute it and/or */ /* modify it under the terms of the GNU General Public License */ /* as published by the Free Software Foundation. */ /************************************************************************/ define('TR_INCLUDE_PATH', '../../include/'); require_once TR_INCLUDE_PATH . 'vitals.inc.php'; require_once TR_INCLUDE_PATH . '../home/editor/editor_tab_functions.inc.php'; require_once TR_INCLUDE_PATH . '../home/classes/ContentUtility.class.php'; global $_content_id, $_content_id, $contentManager, $_course_id; $cid = $_content_id; Utility::authenticate(TR_PRIV_ISAUTHOR); if (isset($_GET['pid'])) { $pid = intval($_GET['pid']); } if (defined('TR_FORCE_GET_FILE') && TR_FORCE_GET_FILE) { $course_base_href = 'get.php/'; } else { $course_base_href = 'content/' . $_course_id . '/'; } if ($cid > 0 && isset($contentManager)) { $content_row = $contentManager->getContentPage($cid); } // save changes if ($_POST['submit']) { if ($_POST['title'] == '') { $msg->addError(array('EMPTY_FIELDS', _AT('title')));
$_pages['tests/edit_question_multianswer.php']['parent'] = 'tests/question_db.php'; $_pages['tests/edit_question_long.php']['title_var'] = 'edit_question'; $_pages['tests/edit_question_long.php']['parent'] = 'tests/question_db.php'; $_pages['tests/edit_question_likert.php']['title_var'] = 'edit_question'; $_pages['tests/edit_question_likert.php']['parent'] = 'tests/question_db.php'; $_pages['tests/edit_question_matching.php']['title_var'] = 'edit_question'; $_pages['tests/edit_question_matching.php']['parent'] = 'tests/question_db.php'; $_pages['tests/edit_question_matchingdd.php']['title_var'] = 'edit_question'; $_pages['tests/edit_question_matchingdd.php']['parent'] = 'tests/question_db.php'; $_pages['tests/edit_question_ordering.php']['title_var'] = 'edit_question'; $_pages['tests/edit_question_ordering.php']['parent'] = 'tests/question_db.php'; $_pages['tests/delete_question.php']['title_var'] = 'delete'; $_pages['tests/delete_question.php']['parent'] = 'tests/question_db.php'; } // file manager if (array_key_exists(TR_PRIV_FILE_MANAGER, $privs) && Utility::authenticate($privs[TR_PRIV_FILE_MANAGER], false)) { $_pages['file_manager/index.php']['title_var'] = 'file_manager'; $_pages['file_manager/index.php']['parent'] = TR_NAV_TOP; $_pages['file_manager/index.php']['guide'] = 'instructor/?p=file_manager.php'; $_pages['file_manager/index.php']['children'] = array('file_manager/new.php'); $_pages['file_manager/new.php']['title_var'] = 'create_new_file'; $_pages['file_manager/new.php']['parent'] = 'file_manager/index.php'; $_pages['file_manager/zip.php']['title_var'] = 'zip_file_manager'; $_pages['file_manager/zip.php']['parent'] = 'file_manager/index.php'; $_pages['file_manager/rename.php']['title_var'] = 'rename'; $_pages['file_manager/rename.php']['parent'] = 'file_manager/index.php'; $_pages['file_manager/move.php']['title_var'] = 'move'; $_pages['file_manager/move.php']['parent'] = 'file_manager/index.php'; $_pages['file_manager/edit.php']['title_var'] = 'edit'; $_pages['file_manager/edit.php']['parent'] = 'file_manager/index.php'; $_pages['file_manager/delete.php']['title_var'] = 'delete';