-<?php //$Id$
+<?php
//This php script contains all the stuff to backup/restore
//choice mods
FROM {choice_answers} s
WHERE s.choiceid = ?", array($instanceid));
}
-?>
+
-<?php //$Id$
+<?php
// This file replaces:
// * STATEMENTS section in db/install.xml
-<?php //$Id$
+<?php
-// This file keeps track of upgrades to
+// This file keeps track of upgrades to
// the choice module
//
// Sometimes, changes between versions involve
return $result;
}
-?>
+
echo $OUTPUT->footer();
-?>
+
/**
* Implementation of the function for printing the form elements that control
* whether the course reset functionality affects the choice.
- *
+ *
* @param object $mform form passed by reference
*/
function choice_reset_course_form_definition(&$mform) {
}
echo $OUTPUT->footer();
-?>
\ No newline at end of file
-<?php //$Id$
+<?php
//This php script contains all the stuff to backup/restore
//choice mods
}
return $status;
}
-?>
+
-<?php // $Id$
+<?php
////////////////////////////////////////////////////////////////////////////////
// Code fragment to define the module version etc.
$module->requires = 2009041700; // Requires this Moodle version
$module->cron = 0;
-?>
+
/// Mark as viewed
$completion=new completion_info($course);
$completion->set_module_viewed($cm);
-?>
+
-<?php //Id:$
+<?php
//This php script contains all the stuff to backup/restore data mod
data_print_comments($data, $record, $page, $mform);
echo $OUTPUT->footer();
-?>
\ No newline at end of file
-<?php //$Id$
+<?php
require_once $CFG->libdir.'/formslib.php';
}
}
-?>
\ No newline at end of file
-<?php //$Id$
+<?php
// This file replaces:
// * STATEMENTS section in db/install.xml
-<?php //$Id$
+<?php
// This file keeps track of upgrades to
// the data module
return $result;
}
-?>
+
}
echo $OUTPUT->footer();
-?>
\ No newline at end of file
}
die();
-?>
\ No newline at end of file
-<?php // $Id$
+<?php
if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden!');
}
-?>
+
/// Finish the page
echo $OUTPUT->footer();
-?>
\ No newline at end of file
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
$options[$key] = $key; //Build following indicies from the sql.
}
}
- return $OUTPUT->select(html_select::make($options, 'f_'.$this->field->id, $value));
+ return $OUTPUT->select(html_select::make($options, 'f_'.$this->field->id, $value));
}
-
+
function parse_search_field() {
return optional_param('f_'.$this->field->id, '', PARAM_NOTAGS);
}
-
+
function generate_sql($tablealias, $value) {
static $i=0;
$i++;
$name = "df_checkbox_$i";
- return array(" ({$tablealias}.fieldid = {$this->field->id} AND {$tablealias}.content = :$name) ", array($name=>$value));
+ return array(" ({$tablealias}.fieldid = {$this->field->id} AND {$tablealias}.content = :$name) ", array($name=>$value));
}
function update_content($recordid, $value, $name='') {
return $str;
}
}
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
return $str;
}
-
+
//Enable the following three functions once core API issues have been addressed.
function display_search_field($value=0) {
return false;
//return print_date_selector('f_'.$this->field->id.'_d', 'f_'.$this->field->id.'_m', 'f_'.$this->field->id.'_y', $value, true);
}
-
+
function generate_sql($tablealias, $value) {
return array(' 1=1 ', array());
- //return " ({$tablealias}.fieldid = {$this->field->id} AND {$tablealias}.content = '$value') ";
+ //return " ({$tablealias}.fieldid = {$this->field->id} AND {$tablealias}.content = '$value') ";
}
-
+
function parse_search_field() {
return '';
- /*
+ /*
$day = optional_param('f_'.$this->field->id.'_d', 0, PARAM_INT);
$month = optional_param('f_'.$this->field->id.'_m', 0, PARAM_INT);
$year = optional_param('f_'.$this->field->id.'_y', 0, PARAM_INT);
}
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
}
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
}
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
$options[$option] = $option;
}
}
-
+
$select = html_select::make($options, 'field_'.$this->field->id, $content, get_string('menuchoose', 'data'));
$select->nothingvalue = '';
return $str;
}
-
+
function display_search_field($content = '') {
global $CFG, $DB, $OUTPUT;
return '';
}
- return $OUTPUT->select(html_select::make($options, 'f_'.$this->field->id, $content, ' '));
+ return $OUTPUT->select(html_select::make($options, 'f_'.$this->field->id, $content, ' '));
}
function parse_search_field() {
static $i=0;
$i++;
$name = "df_menu_$i";
- return array(" ({$tablealias}.fieldid = {$this->field->id} AND {$tablealias}.content = :$name) ", array($name=>$value));
+ return array(" ({$tablealias}.fieldid = {$this->field->id} AND {$tablealias}.content = :$name) ", array($name=>$value));
}
}
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
return false;
}
}
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
function parse_search_field() {
return optional_param('f_'.$this->field->id, '', PARAM_NOTAGS);
}
-
+
// need to cast?
function generate_sql($tablealias, $value) {
static $i=0;
$i++;
$name = "df_number_$i";
- return array(" ({$tablealias}.fieldid = {$this->field->id} AND {$tablealias}.content = :$name) ", array($name=>$value));
+ return array(" ({$tablealias}.fieldid = {$this->field->id} AND {$tablealias}.content = :$name) ", array($name=>$value));
}
function get_sort_sql($fieldname) {
}
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
}
}
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
$str .= '</div>';
return $str;
}
-
+
function display_search_field($value = '') {
global $CFG, $DB, $OUTPUT;
$temp = $DB->get_records_sql_menu('SELECT id, content FROM {data_content} WHERE fieldid=? GROUP BY content ORDER BY content', array($this->field->id));
function parse_search_field() {
return optional_param('f_'.$this->field->id, '', PARAM_NOTAGS);
}
-
+
function generate_sql($tablealias, $value) {
static $i=0;
$i++;
$name = "df_number_$i";
- return array(" ({$tablealias}.fieldid = {$this->field->id} AND {$tablealias}.content = :$name) ", array($name=>$value));
+ return array(" ({$tablealias}.fieldid = {$this->field->id} AND {$tablealias}.content = :$name) ", array($name=>$value));
}
}
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
var $type = 'text';
function display_search_field($value = '') {
- return '<input type="text" size="16" name="f_'.$this->field->id.'" value="'.$value.'" />';
+ return '<input type="text" size="16" name="f_'.$this->field->id.'" value="'.$value.'" />';
}
-
+
function parse_search_field() {
return optional_param('f_'.$this->field->id, '', PARAM_NOTAGS);
}
-
+
function generate_sql($tablealias, $value) {
global $DB;
$name = "df_picture_$i";
return array(" ({$tablealias}.fieldid = {$this->field->id} AND {$tablealias}.content $ILIKE :$name) ", array($name=>"%$value%"));
}
-
+
}
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
$str .= '</div>';
return $str;
}
-
-
+
+
function display_search_field($value = '') {
- return '<input type="text" size="16" name="f_'.$this->field->id.'" value="'.$value.'" />';
+ return '<input type="text" size="16" name="f_'.$this->field->id.'" value="'.$value.'" />';
}
-
+
function parse_search_field() {
return optional_param('f_'.$this->field->id, '', PARAM_NOTAGS);
}
-
+
function generate_sql($tablealias, $value) {
global $DB;
$name = "df_picture_$i";
return array(" ({$tablealias}.fieldid = {$this->field->id} AND {$tablealias}.content $ILIKE :$name) ", array($name=>"%$value%"));
}
-
+
function gen_textarea($usehtmleditor, $text='') {
return print_textarea($usehtmleditor, $this->field->param3, $this->field->param2,
'', '', 'field_'.$this->field->id, $text, '', true, 'field_' . $this->field->id);
}
}
}
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
}
-?>
+
-<?php // $Id$
+<?php
//
// This function provides automatic linking to data contents of text
// fields where these fields have autolink enabled.
return filter_phrases($text, $contentlist); // Look for all these links in the text
}
-?>
+
echo $OUTPUT->table($table);
echo $OUTPUT->footer();
-?>
\ No newline at end of file
$optionsyes = array('fullname' => $userid.'/'.$shortname,
'action' => 'delete',
'd' => $data->id);
-
+
$optionsno = array('d' => $data->id);
echo $OUTPUT->confirm($strwarning, new moodle_url('preset.php', $optionsyes), new moodle_url('preset.php', $optionsno));
echo $OUTPUT->footer();
return $exportfile;
}
-?>
+
}
}
-?>
\ No newline at end of file
echo $OUTPUT->close_window_button();
echo $OUTPUT->footer();
-?>
\ No newline at end of file
-<?php //$Id$
+<?php
if (empty($CFG->enablerssfeeds)) {
$options = array(0 => get_string('rssglobaldisabled', 'admin'));
$settings->add(new admin_setting_configselect('data_enablerssfeeds', get_string('enablerssfeeds', 'admin'),
$str, 0, $options));
-?>
+
-<?php // $Id$
+<?php
require_once("$CFG->libdir/simpletest/portfolio_testclass.php");
require_once("$CFG->dirroot/mod/data/lib.php");
require_once("$CFG->dirroot/$CFG->admin/generator.php");
parent::test_caller_with_plugins();
}
}
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
}
}
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
$row = array();
$row[] = new tabobject('list', $CFG->wwwroot.'/mod/data/view.php?d='.$data->id, get_string('list','data'));
-
+
if (isset($record)) {
$row[] = new tabobject('single', $CFG->wwwroot.'/mod/data/view.php?d='.$data->id.'&rid='.$record->id, get_string('single','data'));
} else {
}
if (has_capability(DATA_CAP_EXPORT, $context)) {
// The capability required to Export database records is centrally defined in 'lib.php'
- // and should be weaker than those required to edit Templates, Fields and Presets.
+ // and should be weaker than those required to edit Templates, Fields and Presets.
$row[] = new tabobject('export', $CFG->wwwroot.'/mod/data/export.php?d='.$data->id,
get_string('export', 'data'));
}
// Print out the tabs and continue!
print_tabs($tabs, $currenttab, $inactive, $activetwo);
-?>
+
/// Finish the page
echo $OUTPUT->footer();
-?>
\ No newline at end of file
-<?php // $Id$
+<?php
////////////////////////////////////////////////////////////////////////////////
// Code fragment to define the module version etc.
$module->requires = 2009041700; // Requires this Moodle version
$module->cron = 60;
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
$PAGE->set_heading($course->fullname);
$PAGE->set_button($buttons);
echo $OUTPUT->header();
-
+
/// Check to see if groups are being used here
$returnurl = 'view.php?d='.$data->id.'&search='.s($search).'&sort='.s($sort).'&order='.s($order).'&';
groups_print_activity_menu($cm, $returnurl);
$completion->set_module_viewed($cm);
echo $OUTPUT->footer();
-?>
+
------------
Moodle 1.9 or later
-Installation
+Installation
------------
The zip-archive includes the same directory hierarchy as moodle
So you only have to copy the files to the correspondent place.
echo $OUTPUT->footer();
-?>
\ No newline at end of file
echo $OUTPUT->footer();
-?>
\ No newline at end of file
require_once('easy_excel.php');
$id = required_param('id', PARAM_INT); //the POST dominated the GET
-$coursefilter = optional_param('coursefilter', '0', PARAM_INT);
+$coursefilter = optional_param('coursefilter', '0', PARAM_INT);
$url = new moodle_url($CFG->wwwroot.'/mod/feedback/analysis_to_excel.php', array('id'=>$id));
if ($coursefilter !== '0') {
$workbook->close();
exit;
-////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
//functions
-////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
function feedback_excelprint_detailed_head(&$worksheet, $items, $rowOffset) {
}
return $rowOffset + 1;
}
-?>
\ No newline at end of file
-<?php // $Id$
+<?php
//This php script contains all the stuff to backup/restore
//feedback mods
}
}
}
- return $status;
+ return $status;
}
function feedback_backup_one_mod($bf,$preferences,$feedback) {
global $CFG, $DB;
-
+
if (is_numeric($feedback)) {
$feedback = $DB->get_record('feedback', array('id'=>$feedback));
}
-
+
$status = true;
fwrite ($bf,start_tag("MOD",3,true));
//Print feedback data
fwrite ($bf,full_tag("TIMEOPEN",4,false,$feedback->timeopen));
fwrite ($bf,full_tag("TIMECLOSE",4,false,$feedback->timeclose));
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$feedback->timemodified));
-
+
//backup the items of each feedback
feedback_backup_data($bf, $preferences, $feedback->id);
-
+
//End mod
$status =fwrite ($bf,end_tag("MOD",3,true));
return $status;
}
-
+
function feedback_backup_data($bf, $preferences, $feedbackid) {
global $CFG, $DB;
fwrite ($bf,full_tag("HASVALUE",6,false,$feedbackitem->hasvalue));
fwrite ($bf,full_tag("POSITION",6,false,$feedbackitem->position));
fwrite ($bf,full_tag("REQUIRED",6,false,$feedbackitem->required));
-
+
if ($backup_userdata) {
//backup the values of items
$feedbackvalues = $DB->get_records('feedback_value', array('item'=>$feedbackitem->id));
}
$status =fwrite ($bf,end_tag("ITEMS",4,true));
}
-
+
if($backup_userdata) {
//backup of feedback-completeds
$feedbackcompleteds = $DB->get_records('feedback_completed', array('feedback'=>$feedbackid));
fwrite ($bf,full_tag("TIMEMODIFIED",6,false,$feedbackcompleted->timemodified));
fwrite ($bf,full_tag("RANDOMRESPONSE",6,false,$feedbackcompleted->random_response));
fwrite ($bf,full_tag("ANONYMOUSRESPONSE",6,false,$feedbackcompleted->anonymous_response));
-
+
//End completed
$status =fwrite ($bf,end_tag("COMPLETED",5,true));
}
$status =fwrite ($bf,end_tag("COMPLETEDS",4,true));
}
-
+
//backup of tracking-data
$feedbacktrackings = $DB->get_records('feedback_tracking', array('feedback'=>$feedbackid));
if($feedbacktrackings) {
fwrite ($bf,full_tag("USERID",6,false,$feedbacktracking->userid));
fwrite ($bf,full_tag("FEEDBACK",6,false,$feedbacktracking->feedback));
fwrite ($bf,full_tag("COMPLETED",6,false,$feedbacktracking->completed));
-
+
//End completed
$status =fwrite ($bf,end_tag("TRACKING",5,true));
}
$status =fwrite ($bf,end_tag("TRACKINGS",4,true));
}
-
+
}
}
fwrite ($bf,full_tag("HASVALUE",7,false,$templateitem->hasvalue));
fwrite ($bf,full_tag("POSITION",7,false,$templateitem->position));
fwrite ($bf,full_tag("REQUIRED",7,false,$templateitem->required));
-
+
//End item
$status =fwrite ($bf,end_tag("ITEM",6,true));
}
//First the course data
$info[0][0] = get_string("modulenameplural","feedback");
$info[0][1] = feedback_count($course);
-
+
//Now, if requested, the user_data
-
+
if ($user_data) {
$info[1][0] = get_string('ready_feedbacks','feedback');
$info[1][1] = feedback_completed_count($course);
}
-
+
return $info;
}
///////////////////////////////////////////////////////////////
//// INTERNAL FUNCTIONS. BASED IN THE MOD STRUCTURE
- //Returns an array of feedbacks ids
+ //Returns an array of feedbacks ids
function feedback_count ($course) {
global $DB;
return $DB->count_records('feedback', array('course'=>$course));
}
-
+
function feedback_completed_count($course) {
global $DB;
}
return $count;
}
-
-?>
+
+
-<?php // $Id$
+<?php
/**
* prints the form to choose the group you want to analyse
*
class feedback_choose_group_form extends moodleform {
var $feedbackdata;
-
+
function definition() {
$this->feedbackdata = new object();
//this function can not be called, because not all data are available at this time
//I use set_form_elements instead
}
-
+
//this function set the data used in set_form_elements()
//in this form the only value have to set is course
//eg: array('course' => $course)
}
}
}
-
+
//here the elements will be set
//this function have to be called manually
//the advantage is that the data are already set
function set_form_elements(){
$mform =& $this->_form;
-
+
$elementgroup = array();
//headline
// $mform->addElement('header', 'general', get_string('choose_group', 'feedback'));
$mform->setType('id', PARAM_INT);
$mform->addElement('hidden', 'do_show');
$mform->setType('do-show', PARAM_INT);
-
+
// visible elements
$groups_options = array();
if(isset($this->feedbackdata->groups)){
// buttons
$elementgroup[] =& $mform->createElement('submit', 'switch_group', get_string('switch_group', 'feedback'));
$mform->addGroup($elementgroup, 'elementgroup', '', array(' '), false);
-
+
//-------------------------------------------------------------------------------
}
}
-?>
+
echo $OUTPUT->footer();
-?>
\ No newline at end of file
echo $OUTPUT->footer();
-?>
\ No newline at end of file
'admin' => CAP_ALLOW
)
),
-
+
'mod/feedback:complete' => array(
'riskbitmask' => RISK_SPAM,
'admin' => CAP_PREVENT
)
),
-
+
'mod/feedback:viewanalysepage' => array(
'riskbitmask' => RISK_PERSONAL,
'admin' => CAP_ALLOW
)
),
-
+
'mod/feedback:deletesubmissions' => array(
'captype' => 'write',
),
'mod/feedback:viewreports' => array(
-
+
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
),
'mod/feedback:receivemail' => array(
-
+
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
);
-?>
+
-<?php //$Id$
+<?php
// This file replaces:
// * STATEMENTS section in db/install.xml
-<?php //$Id$
+<?php
// This file keeps track of upgrades to
// the feedback module
return $result;
}
-?>
+
echo $OUTPUT->footer();
-?>
+
-<?php // $Id$
+<?php
/**
* prints the form to confirm delete a completed
*
//headline
//$mform->addElement('header', 'general', '');
-
+
// hidden elements
$mform->addElement('hidden', 'id');
$mform->setType('id', PARAM_INT);
}
}
-?>
+
-<?php // $Id$
+<?php
/**
* deletes an item of the feedback
*
echo $OUTPUT->footer();
-?>
+
-<?php // $Id$
+<?php
/**
* prints the form to confirm delete a completed
*
//headline
//$mform->addElement('header', 'general', '');
-
+
// hidden elements
$mform->addElement('hidden', 'id');
$mform->setType('id', PARAM_INT);
}
}
-?>
+
-<?php // $Id$
+<?php
/**
* prints the form to confirm delete a completed
*
//headline
//$mform->addElement('header', 'general', '');
-
+
// hidden elements
$mform->addElement('hidden', 'id');
$mform->setType('id', PARAM_INT);
}
}
-?>
+
class EasyWorkbook extends Spreadsheet_Excel_Writer {
function &addWorksheet($name = ''){
global $CFG;
-
+
$index = count($this->_worksheets);
$sheetname = $this->_sheetname;
function set_workbook(&$workbook) {
$this->m_workbook =& $workbook;
}
-
+
function write($row, $col, $token)
{
parent::write($row, $col, $token, $this->m_format);
parent::writeUrl($row, $col, $url, $string, $this->m_format);
}
- /**
+ /**
* Setz das aktuelle Format, dass zum Schreiben verwendet wird
* Der Formatstring setzt sich aus den folgenden Buchstaben mit folgender Bedeutung zusammen.
* <f> = Fett
if((count($this->m_formatbox) > 0) AND array_key_exists($signature, $this->m_formatbox)) {
$this->m_format = $this->m_formatbox[$signature];
}else {
-
+
$this->m_format = &$this->m_workbook->addFormat();
if($textWrap)
{
}
$this->m_format->setSize($size);
-
+
//save the format with its signature
$this->m_formatbox[$signature] = $this->m_format;
}
static $textlib;
static $newwincharset;
static $oldcharset;
-
+
if(!isset($textlib)) {
$textlib = textlib_get_instance();
}
-
+
if(!isset($newwincharset)) {
if(!isset($CFG->latinexcelexport) || !$CFG->latinexcelexport) {
$newwincharset = 'UTF-16LE';
}
}
}
-
+
if(!isset($oldcharset)) {
$oldcharset = get_string('thischarset');
}
-
+
//converting <br /> into newline
$newtext = str_ireplace('<br />', "\n", $text);
$newtext = str_ireplace('<br>', "\n", $newtext);
-
+
return $textlib->convert($newtext, $oldcharset, $newwincharset);
}
-?>
+
echo '<input type="hidden" name="id" value="'.$id.'" />';
echo '<input type="hidden" name="do_show" value="'.$tab.'" />';
}
-?>
\ No newline at end of file
-<?php // $Id$
+<?php
/**
* prints the forms to choose an item-typ to create items and to choose a template to use
*
// $feedback_names_options[$fn] = get_string($fn,'feedback');
// }
$feedback_names_options = feedback_load_feedback_items_options();
-
+
$attributes = 'onChange="this.form.submit()"';
$mform->addElement('select', 'typ', '', $feedback_names_options, $attributes);
class feedback_edit_use_template_form extends moodleform {
var $feedbackdata;
-
+
function definition() {
$this->feedbackdata = new object();
//this function can not be called, because not all data are available at this time
//I use set_form_elements instead
}
-
+
//this function set the data used in set_form_elements()
//in this form the only value have to set is course
//eg: array('course' => $course)
}
}
}
-
+
//here the elements will be set
//this function have to be called manually
//the advantage is that the data are already set
function set_form_elements(){
$mform =& $this->_form;
-
+
$elementgroup = array();
//headline
$mform->addElement('header', '', get_string('using_templates', 'feedback'));
// hidden elements
$mform->addElement('hidden', 'id');
$mform->setType('id', PARAM_INT);
-
+
// visible elements
$templates_options = array();
if($templates = feedback_get_template_list($this->feedbackdata->course)){//get the templates
$mform->addElement('static', 'info', get_string('no_templates_available_yet', 'feedback'));
}
$mform->addGroup($elementgroup, 'elementgroup', '', array(' '), false);
-
+
//-------------------------------------------------------------------------------
}
}
class feedback_edit_create_template_form extends moodleform {
var $feedbackdata;
-
+
function definition() {
}
-
+
function data_preprocessing(&$default_values){
$default_values['templatename'] = '';
}
-
+
function set_feedbackdata($data) {
if(is_array($data)) {
foreach($data as $key => $val) {
}
}
}
-
+
function set_form_elements(){
$mform =& $this->_form;
$capabilities = $this->feedbackdata->capabilities;
//headline
$mform->addElement('header', '', get_string('creating_templates', 'feedback'));
-
+
// visible elements
$elementgroup = array();
-
+
$elementgroup[] =& $mform->createElement('static', 'templatenamelabel', get_string('name', 'feedback'));
$elementgroup[] =& $mform->createElement('text', 'templatename', get_string('name', 'feedback'), array('size'=>'40', 'maxlength'=>'200'));
if($capabilities->createpublictemplate) {
$elementgroup[] =& $mform->createElement('checkbox', 'ispublic', get_string('public', 'feedback'), get_string('public', 'feedback'));
}
-
+
// buttons
$elementgroup[] =& $mform->createElement('submit', 'create_template', get_string('save_as_new_template', 'feedback'));
$mform->addGroup($elementgroup, 'elementgroup', get_string('name', 'feedback'), array(' '), false);
-
+
$mform->setType('templatename', PARAM_TEXT);
-
+
//-------------------------------------------------------------------------------
}
}
-?>
+
echo $OUTPUT->footer();
-?>
\ No newline at end of file
require_once("lib.php");
// get parameters
-$id = required_param('id', PARAM_INT);
+$id = required_param('id', PARAM_INT);
$action = optional_param('action', false, PARAM_ALPHA);
$url = new moodle_url($CFG->wwwroot.'/mod/feedback/export.php', array('id'=>$id));
@header('Content-Disposition: attachment; filename='.$filename);
print($data);
}
-?>
\ No newline at end of file
echo $OUTPUT->footer();
-?>
\ No newline at end of file
var $itemname;
var $itemlabel;
var $select;
-
+
function definition() {
$mform =& $this->_form;
-
+
$mform->addElement('header', 'general', get_string($this->type, 'feedback'));
$this->requiredcheck = $mform->addElement('checkbox', 'required', get_string('required', 'feedback'));
-
+
$this->itemname = $mform->addElement('text', 'itemname', get_string('item_name', 'feedback'), array('size="'.FEEDBACK_ITEM_NAME_TEXTBOX_SIZE.'"','maxlength="255"'));
$this->itemlabel = $mform->addElement('text', 'itemlabel', get_string('item_label', 'feedback'), array('size="'.FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE.'"','maxlength="255"'));
-
+
$this->select = $mform->addElement('select',
- 'count_of_nums',
- get_string('count_of_nums', 'feedback').' ',
+ 'count_of_nums',
+ get_string('count_of_nums', 'feedback').' ',
array_slice(range(0,10),3,10,true));
-
+
}
}
-?>
+
-<?PHP // $Id$
+<?php
defined('FEEDBACK_INCLUDE_TEST') OR die('not allowed');
require_once($CFG->dirroot.'/mod/feedback/item/feedback_item_class.php');
return rand($min, $max);
}
-?>
+
-<?PHP // $Id$
+<?php
class feedback_item_base {
var $type;
function __construct() {
$this->feedback_item_base();
}
-
+
/**
* prints the item-related sequenz on the edit-item form
- *
+ *
* @param $item the db-object from feedback_item
* @param $usehtmleditor defines whether the editor should be shown or not
*/
class feedback_item_pagebreak extends feedback_item_base {
var $type = "pagebreak";
function init() {
-
+
}
}
-?>
+
return $this->_form;
}
}
-?>
+
var $itemname;
var $itemlabel;
var $infotype;
-
+
function definition() {
$mform =& $this->_form;
-
+
$mform->addElement('header', 'general', get_string($this->type, 'feedback'));
$this->requiredcheck = &$mform->addElement('hidden', 'required');
$mform->setType('required', PARAM_INT);
-
+
$this->itemname = &$mform->addElement('text', 'itemname', get_string('item_name', 'feedback'), array('size="'.FEEDBACK_ITEM_NAME_TEXTBOX_SIZE.'"','maxlength="255"'));
$this->itemlabel = $mform->addElement('text', 'itemlabel', get_string('item_label', 'feedback'), array('size="'.FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE.'"','maxlength="255"'));
-
+
$options=array();
$options[1] = get_string('responsetime', 'feedback');
$options[2] = get_string('coursename', 'feedback');
}
}
-?>
+
-<?php // $Id$
+<?php
defined('FEEDBACK_INCLUDE_TEST') OR die('not allowed');
require_once($CFG->dirroot.'/mod/feedback/item/feedback_item_class.php');
class feedback_label_form extends feedback_item_form {
var $type = "label";
var $area;
-
+
function definition() {
$mform =& $this->_form;
-
+
$mform->addElement('header', 'general', get_string($this->type, 'feedback'));
-
+
$mform->addElement('hidden', 'itemname', $this->type);
$mform->setType('itemname', PARAM_INT);
$this->area = $mform->addElement('htmleditor', 'presentation', '', array('rows'=>20));
}
}
-?>
+
-<?PHP // $Id$
+<?php
defined('FEEDBACK_INCLUDE_TEST') OR die('not allowed');
require_once($CFG->dirroot.'/mod/feedback/item/feedback_item_class.php');
class feedback_item_label extends feedback_item_base {
var $type = "label";
function init() {
-
+
}
-
+
function show_edit($item) {
global $CFG;
-
+
require_once('label_form.php');
-
+
$item_form = new feedback_label_form();
-
+
$item->presentation = isset($item->presentation) ? $item->presentation : '';
-
+
$item_form->area->setValue($item->presentation);
return $item_form;
}
-<?php // $Id$
+<?php
defined('FEEDBACK_INCLUDE_TEST') OR die('not allowed');
require_once($CFG->dirroot.'/mod/feedback/item/feedback_item_class.php');
var $selectadjust;
var $selecttype;
var $values;
-
+
function definition() {
$mform =& $this->_form;
-
+
$mform->addElement('header', 'general', get_string($this->type, 'feedback'));
-
+
$this->requiredcheck = $mform->addElement('checkbox', 'required', get_string('required', 'feedback'));
-
+
$this->itemname = $mform->addElement('text', 'itemname', get_string('item_name', 'feedback'), array('size="'.FEEDBACK_ITEM_NAME_TEXTBOX_SIZE.'"','maxlength="255"'));
$this->itemlabel = $mform->addElement('text', 'itemlabel', get_string('item_label', 'feedback'), array('size="'.FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE.'"','maxlength="255"'));
$this->selectadjust = $mform->addElement('select',
- 'horizontal',
- get_string('adjustment', 'feedback').' ',
+ 'horizontal',
+ get_string('adjustment', 'feedback').' ',
array(0 => get_string('vertical', 'feedback'), 1 => get_string('horizontal', 'feedback')));
-
+
$this->selecttype = $mform->addElement('select',
- 'subtype',
- get_string('multichoicetype', 'feedback').' ',
+ 'subtype',
+ get_string('multichoicetype', 'feedback').' ',
array('r'=>get_string('radio', 'feedback'),
'c'=>get_string('check', 'feedback'),
'd'=>get_string('dropdown', 'feedback')));
$mform->addElement('static', 'hint', get_string('multichoice_values', 'feedback'), get_string('use_one_line_for_each_value', 'feedback'));
-
+
$this->values = $mform->addElement('textarea', 'itemvalues', '', 'wrap="virtual" rows="10" cols="65"');
}
}
-?>
+
-<?php // $Id$
+<?php
defined('FEEDBACK_INCLUDE_TEST') OR die('not allowed');
require_once($CFG->dirroot.'/mod/feedback/item/feedback_item_class.php');
var $selectadjust;
var $selecttype;
var $values;
-
+
function definition() {
$mform =& $this->_form;
-
+
$mform->addElement('header', 'general', get_string($this->type, 'feedback'));
-
+
$this->requiredcheck = $mform->addElement('checkbox', 'required', get_string('required', 'feedback'));
-
+
$this->itemname = $mform->addElement('text', 'itemname', get_string('item_name', 'feedback'), array('size="'.FEEDBACK_ITEM_NAME_TEXTBOX_SIZE.'"','maxlength="255"'));
$this->itemlabel = $mform->addElement('text', 'itemlabel', get_string('item_label', 'feedback'), array('size="'.FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE.'"','maxlength="255"'));
$this->selectadjust = $mform->addElement('select',
- 'horizontal',
- get_string('adjustment', 'feedback').' ',
+ 'horizontal',
+ get_string('adjustment', 'feedback').' ',
array(0 => get_string('vertical', 'feedback'), 1 => get_string('horizontal', 'feedback')));
-
+
$this->selecttype = $mform->addElement('select',
- 'subtype',
- get_string('multichoicetype', 'feedback').' ',
+ 'subtype',
+ get_string('multichoicetype', 'feedback').' ',
array('r'=>get_string('radio', 'feedback'),
'd'=>get_string('dropdown', 'feedback')));
$mform->addElement('static', 'hint', get_string('multichoice_values', 'feedback'), get_string('use_one_line_for_each_value', 'feedback'));
-
+
$this->values = $mform->addElement('textarea', 'itemvalues', '', 'wrap="virtual" rows="10" cols="65"');
}
}
-?>
+
-<?php // $Id$
+<?php
defined('FEEDBACK_INCLUDE_TEST') OR die('not allowed');
require_once($CFG->dirroot.'/mod/feedback/item/feedback_item_class.php');
var $itemlabel;
var $selectfrom;
var $selectto;
-
+
function definition() {
$mform =& $this->_form;
-
+
$mform->addElement('header', 'general', get_string($this->type, 'feedback'));
$this->requiredcheck = $mform->addElement('checkbox', 'required', get_string('required', 'feedback'));
-
+
$this->itemname = $mform->addElement('text', 'itemname', get_string('item_name', 'feedback'), array('size="'.FEEDBACK_ITEM_NAME_TEXTBOX_SIZE.'"','maxlength="255"'));
$this->itemlabel = $mform->addElement('text', 'itemlabel', get_string('item_label', 'feedback'), array('size="'.FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE.'"','maxlength="255"'));
-
+
$this->selectfrom = $mform->addElement('text', 'numericrangefrom', get_string('numeric_range_from', 'feedback'), array('size="10"','maxlength="10"'));
-
+
$this->selectto = $mform->addElement('text', 'numericrangeto', get_string('numeric_range_to', 'feedback'), array('size="10"','maxlength="10"'));
}
}
-?>
+
-<?php // $Id$
+<?php
defined('FEEDBACK_INCLUDE_TEST') OR die('not allowed');
require_once($CFG->dirroot.'/mod/feedback/item/feedback_item_class.php');
var $itemlabel;
var $selectwidth;
var $selectheight;
-
+
function definition() {
$mform =& $this->_form;
-
+
$mform->addElement('header', 'general', get_string($this->type, 'feedback'));
$this->requiredcheck = $mform->addElement('checkbox', 'required', get_string('required', 'feedback'));
-
+
$this->itemname = $mform->addElement('text', 'itemname', get_string('item_name', 'feedback'), array('size="'.FEEDBACK_ITEM_NAME_TEXTBOX_SIZE.'"','maxlength="255"'));
$this->itemlabel = $mform->addElement('text', 'itemlabel', get_string('item_label', 'feedback'), array('size="'.FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE.'"','maxlength="255"'));
-
+
$this->selectwidth = $mform->addElement('select',
- 'itemwidth',
- get_string('textarea_width', 'feedback').' ',
+ 'itemwidth',
+ get_string('textarea_width', 'feedback').' ',
array_slice(range(0,80),5,80,true));
$this->selectheight = $mform->addElement('select',
- 'itemheight',
- get_string('textarea_height', 'feedback').' ',
+ 'itemheight',
+ get_string('textarea_height', 'feedback').' ',
array_slice(range(0,40),5,40,true));
}
}
-?>
+
-<?php // $Id$
+<?php
defined('FEEDBACK_INCLUDE_TEST') OR die('not allowed');
require_once($CFG->dirroot.'/mod/feedback/item/feedback_item_class.php');
var $itemlabel;
var $selectwith;
var $selectheight;
-
+
function definition() {
$mform =& $this->_form;
-
+
$mform->addElement('header', 'general', get_string($this->type, 'feedback'));
$this->requiredcheck = $mform->addElement('checkbox', 'required', get_string('required', 'feedback'));
-
+
$this->itemname = $mform->addElement('text', 'itemname', get_string('item_name', 'feedback'), array('size="'.FEEDBACK_ITEM_NAME_TEXTBOX_SIZE.'"','maxlength="255"'));
$this->itemlabel = $mform->addElement('text', 'itemlabel', get_string('item_label', 'feedback'), array('size="'.FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE.'"','maxlength="255"'));
-
+
$this->selectwith = $mform->addElement('select',
- 'itemsize',
- get_string('textfield_size', 'feedback').' ',
+ 'itemsize',
+ get_string('textfield_size', 'feedback').' ',
array_slice(range(0,255),5,255,true));
$this->selectheight = $mform->addElement('select',
- 'itemmaxlength',
- get_string('textfield_maxlength', 'feedback').' ',
+ 'itemmaxlength',
+ get_string('textfield_maxlength', 'feedback').' ',
array_slice(range(0,255),5,255,true));
}
}
-?>
+
echo $OUTPUT->footer();
-?>
\ No newline at end of file
-<?php // $Id$
+<?php
/**
* print the form to add or edit a feedback-instance
*
$mform->addElement('htmleditor', 'page_after_submit', get_string("page_after_submit", "feedback"), array('rows' => 20));
$mform->setType('page_after_submit', PARAM_RAW);
-
+
$mform->addElement('text', 'site_after_submit', get_string('url_for_continue_button', 'feedback'), array('size'=>'64','maxlength'=>'255'));
$mform->setType('site_after_submit', PARAM_TEXT);
$mform->setHelpButton('site_after_submit', array('url_for_continue', get_string('url_for_continue_button', 'feedback'), 'feedback'));
}
}
-?>
\ No newline at end of file
echo $OUTPUT->footer();
-?>
\ No newline at end of file
-<?php // $Id$
+<?php
//This php script contains all the stuff to backup/restore
//feedback mods
// message->text of each feedback_posting
//
//-----------------------------------------------------------
-
+
define('FEEDBACK_MULTICHOICERESTORE_TYPE_SEP', '>>>>>');
function feedback_restore_mods($mod,$restore) {
global $CFG, $DB;
-
+
// $allValues = array();
// $allTrackings = array();
$status = true;
$restore_userdata = restore_userdata_selected($restore,'feedback',$mod->id);
-
+
//Get record from backup_ids
$data = backup_getid($restore->backup_unique_code,$mod->modtype,$mod->id);
if ($data) {
- //Now get completed xmlized object
+ //Now get completed xmlized object
$info = $data->info;
-
+
//check of older backupversion of feedback
$version = intval(backup_todb($info['MOD']['#']['VERSION']['0']['#']));
-
+
//Now, build the feedback record structure
$feedback->course = $restore->course_id;
$feedback->name = backup_todb($info['MOD']['#']['NAME']['0']['#']);
//The structure is equal to the db, so insert the feedback
$newid = $DB->insert_record ("feedback",$feedback);
-
+
//create events
// the open-event
if($feedback->timeopen > 0) {
} else {
$event->timeduration = 0;
}
-
+
add_event($event);
}
-
+
// the close-event
if($feedback->timeclose > 0) {
$event = NULL;
$event->timestart = $feedback->timeclose;
$event->visible = instance_is_visible('feedback', $feedback);
$event->timeduration = 0;
-
+
add_event($event);
}
- //Do some output
+ //Do some output
echo "<ul><li>".get_string("modulename","feedback")." \"".$feedback->name."\"<br />";
backup_flush(300);
$tracking->userid = $user->new_id;
}
}
-
+
//save the tracking
$newtrackingid = $DB->insert_record('feedback_tracking', $tracking);
$tracking->id = $newtrackingid;
// $allTrackings[] = $tracking;
}
}
-
+
//restore completeds
if(isset($info['MOD']['#']['COMPLETEDS']['0']['#']['COMPLETED'])) {
$completeds = $info['MOD']['#']['COMPLETEDS']['0']['#']['COMPLETED'];
}
//later this have to be changed
$oldcompletedid = backup_todb($completed_info['#']['ID']['0']['#']);
-
+
//save the completed
$newcompletedid = $DB->insert_record('feedback_completed', $completed);
-
+
//the newcompletedid have to be changed at every values
$tochangevals = $DB->get_records('feedback_value', array('tmp_completed'=>$oldcompletedid));
if($tochangevals) {
$DB->update_record('feedback_value', $tmpVal);
}
}
-
+
//the newcompletedid have to be changed at every tracking
$tochangetracks = $DB->get_records('feedback_tracking', array('completed'=>$oldcompletedid));
if($tochangetracks) {
}
}
}
-
+
//We have the newid, update backup_ids
backup_putid($restore->backup_unique_code,$mod->modtype, $mod->id, $newid);
} else {
$status = false;
}
- //Finalize ul
+ //Finalize ul
echo "</ul>";
-
+
} else {
$status = false;
}
function feedback_restore_logs($restore,$log) {
$status = false;
-
+
//Depending of the action, we recode different things
switch ($log->action) {
case "add":
return $status;
}
-?>
+
-<?php // $Id$
+<?php
/**
* prints the tabbed bar
*
}
$row[] = new tabobject('view', $CFG->wwwroot.htmlspecialchars('/mod/feedback/view.php?id='.$id.'&do_show=view'), get_string('overview', 'feedback'));
-
+
if($capabilities->edititems) {
$row[] = new tabobject('edit', $CFG->wwwroot.htmlspecialchars('/mod/feedback/edit.php?id='.$id.'&do_show=edit'), get_string('edit_items', 'feedback'));
$row[] = new tabobject('templates', $CFG->wwwroot.htmlspecialchars('/mod/feedback/edit.php?id='.$id.'&do_show=templates'), get_string('templates', 'feedback'));
}
-
+
if($capabilities->viewreports) {
if($feedback->course == SITEID){
$row[] = new tabobject('analysis', $CFG->wwwroot.htmlspecialchars('/mod/feedback/analysis_course.php?id='.$id.'&courseid='.$courseid.'&do_show=analysis'), get_string('analysis', 'feedback'));
$row[] = new tabobject('analysis', $CFG->wwwroot.htmlspecialchars('/mod/feedback/analysis.php?id='.$id.'&courseid='.$courseid.'&do_show=analysis'), get_string('analysis', 'feedback'));
}
}
-
+
if($capabilities->viewreports) {
$row[] = new tabobject('showentries', $CFG->wwwroot.htmlspecialchars('/mod/feedback/show_entries.php?id='.$id.'&do_show=showentries'), get_string('show_entries', 'feedback'));
}
-
+
if(count($row) > 1) {
$tabs[] = $row;
print_tabs($tabs, $current_tab, $inactive, $activated);
}
-?>
+
print_error('cannotunmap', 'feedback');
}
-?>
\ No newline at end of file
echo $OUTPUT->footer();
-?>
\ No newline at end of file
-<?php // $Id$
+<?php
/**
* prints the form to confirm use template
*
//headline
$mform->addElement('header', 'general', '');
-
+
// visible elements
$mform->addElement('radio', 'deleteolditems', get_string('delete_old_items', 'feedback'), '', 1);
$mform->addElement('radio', 'deleteolditems', get_string('append_new_items', 'feedback'), '', 0);
}
}
-?>
+
-<?php // $Id$
+<?php
/**
* Code fragment to define the version of feedback
* This fragment is called by moodle_needs_upgrading() and /admin/index.php
* @package feedback
*/
-
+
$module->version = 2009052701; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2009041700; // Requires this Moodle version
$feedback_version_intern = 1; //this version is used for restore older backups
$module->cron = 0; // Period for cron to check this module (secs)
-?>
+
echo $OUTPUT->footer();
-?>
\ No newline at end of file
-<?php //$Id$
+<?php
//This php script contains all the stuff to backup/restore
//forum mods
p.discussion = s.id AND
r.post = p.id", array($instanceid));
}
-?>
+
-<?php //$Id$
+<?php
// This file replaces:
// * STATEMENTS section in db/install.xml
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// Defines message providers (types of messages being sent) //
);
-?>
+
-<?php //$Id$
+<?php
// This file keeps track of upgrades to
// the forum module
return $result;
}
-?>
+
-<?php // $Id$
+<?php
// Displays a post, and all the posts below it.
// If no post is given, displays all posts in a discussion
echo $OUTPUT->footer();
-?>
+
echo $OUTPUT->footer();
-?>
\ No newline at end of file
$link = html_link::make("/mod/forum/report.php?id=$postid", $agg);
$link->add_action(new popup_action('click', $link->url, 'ratings', array('height' => 400, 'width' => 600)));
- $strratings .= $OUTPUT->link($link);
+ $strratings .= $OUTPUT->link($link);
} else {
$strratings .= "$agg ";
}
if (!$cm = get_coursemodule_from_instance('forum', $cminfo->instance, $course->id)) {
return false;
}
-
+
require_course_login($course, true, $cm);
-
+
if (!$post = $DB->get_record('forum_posts', array('id'=>$postid))) {
return false;
}
/**
* If its an old post, do nothing. If the record exists, the maintenance will clear it up later.
- *
+ *
* @return bool
*/
function forum_tp_mark_post_read($userid, $post, $forumid) {
// if possible, avoid expensive
// queries
- if (empty($CFG->forum_trackreadposts)) {
+ if (empty($CFG->forum_trackreadposts)) {
return false;
}
global $CFG, $OUTPUT, $USER;
$limit = 5;
-
+
$discussions = forum_get_discussions($cm,"d.timemodified DESC", false, -1, $limit);
$discussioncount = forum_get_discussions_count($cm);
if (!is_array($discussions) || count($discussions)==0) {
$url = new moodle_url($CFG->wwwroot.'/mod/forum/subscribers.php', array('id'=>$forumobject->id));
$forum->add(get_string('showsubscribers', 'forum'), $url, navigation_node::TYPE_SETTING);
}
-
+
if (forum_is_forcesubscribed($forumobject) || ($forumobject->forcesubscribe == FORUM_DISALLOWSUBSCRIBE && !has_capability('mod/forum:managesubscriptions', $PAGE->cm->context))) {
// Do nothing
} else {
redirect($returnto);
-?>
\ No newline at end of file
echo $OUTPUT->footer();
-?>
\ No newline at end of file
-<?php // $Id$
+<?php
require_once($CFG->libdir.'/formslib.php');
print_error('invalidaccess', 'forum');
}
-?>
\ No newline at end of file
-// $Id$
-
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
$response['message'] = $rateinfo;
echo json_encode($response);
-?>
\ No newline at end of file
echo $OUTPUT->close_window_button();
echo $OUTPUT->footer();
-?>
\ No newline at end of file
-<?php //$Id$
+<?php
//This php script contains all the stuff to backup/restore
//forum mods
return $status;
}
-?>
+
-<?php // $Id$
+<?php
//This file adds support to rss feeds generation
//This function is the main entry point to forum
}
return $items;
}
-?>
+
return $menu;
}
-?>
\ No newline at end of file
-<?php //$Id$
+<?php
require_once($CFG->dirroot.'/mod/forum/lib.php');
$settings->add(new admin_setting_configcheckbox('forum_ajaxrating', get_string('ajaxrating', 'forum'),
get_string('configajaxrating', 'forum'), 0));
-?>
+
-<?php // $Id$
+<?php
require_once("$CFG->libdir/simpletest/portfolio_testclass.php");
require_once("$CFG->dirroot/mod/forum/lib.php");
require_once("$CFG->dirroot/$CFG->admin/generator.php");
parent::test_caller_with_plugins();
}
}
-?>
+
-<?php // $Id$
+<?php
///////////////////////////////////////////////////////////////////////////
// //
}
}
-?>
+
}
}
-?>
\ No newline at end of file
echo $OUTPUT->footer();
-?>
\ No newline at end of file
// Get the posts.
if ($posts = forum_search_posts($searchterms, $searchcourse, $page*$perpage, $perpage,
$totalcount, $extrasql)) {
-
+
$baseurl = new moodle_url('user.php', array('id' => $user->id, 'course' => $course->id, 'mode' => $mode, 'perpage' => $perpage));
echo $OUTPUT->paging_bar(moodle_paging_bar::make($totalcount, $page, $perpage, $baseurl));
echo '</div>';
echo $OUTPUT->footer();
-?>
\ No newline at end of file
-<?php // $Id$
+<?php
////////////////////////////////////////////////////////////////////////////////
// Code fragment to define the module version etc.
$module->requires = 2009041700; // Requires this Moodle version
$module->cron = 60;
-?>
+
-<?php // $Id$
+<?php
require_once('../../config.php');
require_once('lib.php');
$completion->set_module_viewed($cm);
echo $OUTPUT->footer($course);
-?>
+
redirect("view.php?id=$cm->id&mode=$mode&hook=$hook",get_string("entryapproved","glossary"),1);
die;
-?>
\ No newline at end of file
-<?php //$Id$
+<?php
//This php script contains all the stuff to backup/restore
//glossary mods
FROM {glossary_entries} s
WHERE s.glossaryid = ?", array($instanceid));
}
-?>
+
$PAGE->set_title(format_string($glossary->name));
$PAGE->set_button($OUTPUT->update_module_button($cm->id, 'glossary'));
echo $OUTPUT->header();
-
+
/// print original glossary entry for any comment action (add, update, delete)
glossary_print_entry($course, $cm, $glossary, $entry, 'approval', '', false);
}
-<?php //$Id$
+<?php
require_once $CFG->libdir.'/formslib.php';
echo $OUTPUT->footer();
-?>
\ No newline at end of file
echo $OUTPUT->footer();
}
-?>
\ No newline at end of file
-<?php // $Id$
+<?php
require_once('../../config.php');
require_once('lib.php');
-<?php // $Id$
+<?php
require_once ($CFG->dirroot.'/lib/formslib.php');
class mod_glossary_entry_form extends moodleform {
return $errors;
}
}
-?>
+
-<?php // $Id$
+<?php
global $CFG;
require_once("../../config.php");
?>
<table border="0" width="100">
<tr>
- <td align="right" style="width:50%">
+ <td align="right" style="width:50%">
<form id="form" method="post" action="editcategories.php">
<div>
<input type="hidden" name="id" value="<?php p($cm->id) ?>" />
</tr>
<tr><td style="width:100%" colspan="2">
-
+
<?php
$categories = $DB->get_records("glossary_categories", array("glossaryid"=>$glossary->id), "name ASC");
</tr>
<?php
-
+
}
echo '</table>';
}
</form>
-<?php
+<?php
echo $OUTPUT->footer();
redirect ($returnurl);
}
-?>
\ No newline at end of file
-<?php // $Id$
+<?php
function glossary_filter($courseid, $text) {
global $CFG, $DB;
if (!isset($cachedcourseid) || $cachedcourseid !== (int)$courseid) {
$conceptlist = array();
$nothingtodo = false;
- }
+ }
$cachedcourseid = (int)$courseid;
if ($nothingtodo === true) {
/// Make a list of glossary IDs for searching
$glossarylist = implode(',', array_keys($glossaries));
-
+
/// Pull out all the raw data from the database for entries, categories and aliases
$entries = $DB->get_records_select('glossary_entries',
}
- $conceptlist[] = new filterobject($concept->concept, $href_tag_begin, '</a>',
+ $conceptlist[] = new filterobject($concept->concept, $href_tag_begin, '</a>',
$concept->casesensitive, $concept->fullmatch);
}
$conceptlist = filter_remove_duplicates($conceptlist);
}
-
+
global $GLOSSARY_EXCLUDECONCEPTS;
if(!empty($GLOSSARY_EXCLUDECONCEPTS)) {
$reducedconceptlist=array();
}
-?>
+
<?php
echo '(';
print_string("maxsize", "", display_size(get_max_upload_file_size($CFG->maxbytes, $course->maxbytes)));
- echo ') ';
- echo $OUTPUT->help_icon(moodle_help_icon::make("filetoimport", get_string("filetoimport", "glossary"), "glossary"));
+ echo ') ';
+ echo $OUTPUT->help_icon(moodle_help_icon::make("filetoimport", get_string("filetoimport", "glossary"), "glossary"));
?>
</b></td>
<td style="width:70%">
- <?php
+ <?php
require_once($CFG->dirroot.'/lib/uploadlib.php');
upload_print_form_fragment(1,array('file'),null,false,null,0,0);
?>
<option value="new"><?php print_string("newglossary","glossary") ?></option>
</select> <?php echo $OUTPUT->help_icon(moodle_help_icon::make("destination", get_string("destination", "glossary"), "glossary")) ?></td>
<td style="width:25%" align="right"><?php print_string("importcategories","glossary") ?>:</td>
- <td style="width:25%"><input type="checkbox" name="catsincl" value="1" alt="<?php print_string("importcategories","glossary") ?>" />
+ <td style="width:25%"><input type="checkbox" name="catsincl" value="1" alt="<?php print_string("importcategories","glossary") ?>" />
<?php echo $OUTPUT->help_icon(moodle_help_icon::make("importcategories", get_string("importcategories", "glossary"), "glossary")) ?>
</td>
</tr>
<input type="hidden" name="id" value="<?php p($id) ?>" />
<input type="hidden" name="step" value="1" />
</div>
-</form>
+</form>
/// Finish the page
echo $OUTPUT->footer();
-?>
\ No newline at end of file
echo $OUTPUT->footer();
-?>
\ No newline at end of file
/**
* Delete grade item for given glossary
- *
+ *
* @global object
* @param object $glossary object
*/
}
require_course_login($course, true, $cm);
-
+
if (!$entry = $DB->get_record('glossary_entries', array('id'=>$entryid))) {
return false;
}
}
echo '</b></td>';
echo '<td align="center" style="width:20%">';
-
+
$select = html_select::make_popup_form("$CFG->wwwroot/mod/glossary/view.php?id=$cm->id&mode=cat", 'hook', $menu, "catmenu", $selected);
$select->nothinglabel = false;
echo $OUTPUT->select($select);
* @param int $entryid
* @param array $scale
*/
-function glossary_print_ratings_mean($entryid, $scale) {
+function glossary_print_ratings_mean($entryid, $scale) {
global $OUTPUT;
static $strrate;
echo "$strratings: ";
$link = html_link::make("/mod/glossary/report.php?id=$entryid", $mean);
$link->add_action(new popup_action('click', $link->url, "ratings"));
- echo $OUTPUT->link($link);
+ echo $OUTPUT->link($link);
}
}
* @param int $page page currently selected (0 based)
* @param int $perpage number of records per page
* @param string $baseurl url to link in each page, the string 'page=XX' will be added automatically.
- *
+ *
* @param int $maxpageallowed Optional maximum number of page allowed.
* @param int $maxdisplay Optional maximum number of page links to show in the bar
* @param string $separator Optional string to be used between pages in the bar
}
echo $OUTPUT->footer();
-?>
\ No newline at end of file
-<?php // $Id$
+<?php
// Collect ratings, store them, then return to where we came from
print_error('invalidaccess');
}
-?>
+
echo $OUTPUT->close_window_button();
echo $OUTPUT->footer();
-?>
\ No newline at end of file
-<?php //$Id$
+<?php
//This php script contains all the stuff to backup/restore
//glossary mods
}
return $status;
}
-?>
+
-<?php // $Id$
+<?php
//This file adds support to rss feeds generation
//This function is the main entry point to glossary
return $items;
}
-?>
+
-<?php //$Id$
+<?php
require_once($CFG->dirroot.'/mod/glossary/lib.php');
/// Show one reduced footer
echo $OUTPUT->footer();
-?>
\ No newline at end of file
/**
* SQL.PHP
* This file is include from view.php and print.php
- * @version $Id$
* @copyright 2003
**/
}
$allentries = $DB->get_records_sql("$sqlselect $sqlfrom $sqlwhere $sqlorderby", $params, $limitfrom, $limitnum);
-?>
+