~ubuntu-branches/ubuntu/natty/moodle/natty

« back to all changes in this revision

Viewing changes to search/documents/wiki_document.php

  • Committer: Bazaar Package Importer
  • Author(s): Tomasz Muras
  • Date: 2010-10-30 12:19:28 UTC
  • mfrom: (1.1.12 upstream) (3.1.10 squeeze)
  • Revision ID: james.westby@ubuntu.com-20101030121928-qzobi6mctpnk4dif
Tags: 1.9.9.dfsg2-2
* Added Romanian translation
* Updated Japanese translation (closes: #596820)
* Backporting security fixes from Moodle 1.9.10 (closes: #601384)
   - Updated embedded CAS to 1.1.3
   - Added patch for MDL-24523:
     clean_text() not filtering text in markdown format
   - Added patch for MDL-24810 and upgraded customized HTML Purifier to 4.2.0 
   - Added patch for MDL-24258:
     students can delete their forum posts later than $CFG->maxeditingtime 
     under certain conditions
   - Added patch for MDL-23377:
     Can't delete quiz attempts in course without enrolled students

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
* @category core
7
7
* @subpackage document_wrappers
8
8
* @author Michael Campanis (mchampan) [cynnical@gmail.com], Valery Fremaux [valery.fremaux@club-internet.fr] > 1.8
 
9
* @contributor Tatsuva Shirai 20090530
9
10
* @date 2008/03/31
10
11
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
11
12
*
240
241
    global $CFG;
241
242
    
242
243
    // get the wiki object and all related stuff
243
 
    $page = get_record('wiki_pages', 'id', $id);
244
 
    $entry = get_record('wiki_entries', 'id', $page->wiki);
245
 
    $course = get_record('course', 'id', $entry->course);
 
244
    $page = get_record('wiki_pages', 'id', $this_id);
 
245
    $wiki = get_record('wiki', 'id', $page->wiki);
 
246
    $course = get_record('course', 'id', $wiki->course);
246
247
    $context = get_record('context', 'id', $context_id);
247
248
    $cm = get_record('course_modules', 'id', $context->instanceid);
248
 
    // $cm = get_coursemodule_from_instance('wiki', $wiki->id, $wiki->course);
249
 
    // $context = get_record('context', 'id', $cm->id);
 
249
    if (empty($cm)) return false; // Shirai 20090530 - MDL19342 - course module might have been delete
 
250
 
250
251
    if (!$cm->visible and !has_capability('moodle/course:viewhiddenactivities', $context)) {
251
252
        if (!empty($CFG->search_access_debug)) echo "search reject : hidden wiki ";
252
253
        return false;