~ubuntu-branches/ubuntu/hoary/moodle/hoary

« back to all changes in this revision

Viewing changes to mod/wiki/ewiki/plugins/page/pageindex.php

  • Committer: Bazaar Package Importer
  • Author(s): Isaac Clerencia
  • Date: 2004-12-29 00:49:52 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20041229004952-gliyqzpj2w3e7clx
Tags: 1.4.3-1
* Urgency high as upstream release fixes several security bugs
* New upstream release
* Write database creation errors and warn the user about it, 
closes: #285842, #285842

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
 
 
3
 # this plugins provides the internal page "PageIndex", which lists all
 
4
 # pages alphabetically
 
5
 
 
6
 
 
7
define("EWIKI_PAGE_PAGEINDEX", "PageIndex");
 
8
$ewiki_plugins["page"][EWIKI_PAGE_PAGEINDEX] = "ewiki_page_index";
 
9
 
 
10
 
 
11
function ewiki_page_index($id=0, $data=0, $action=0, $args=array()) {
 
12
 
 
13
   global $ewiki_plugins;
 
14
 
 
15
   $o = ewiki_make_title($id, $id, 2);
 
16
 
 
17
   $sorted = array();
 
18
   $sorted = array_merge($sorted, array_keys($ewiki_plugins["page"]));
 
19
 
 
20
   $exclude = "\n" . implode("\n",
 
21
      preg_split("/\s*[,;:\|]\s*/", $args["exclude"])) .
 
22
      "\n";
 
23
 
 
24
   $result = ewiki_database("GETALL", array("flags"));
 
25
   while ($row = $result->get()) {
 
26
    if (EWIKI_PROTECTED_MODE && EWIKI_PROTECTED_MODE_HIDING && !ewiki_auth($row["id"], $uu, "view")) {
 
27
        continue;
 
28
    }   
 
29
    if (($row["flags"] & EWIKI_DB_F_TYPE) == EWIKI_DB_F_TEXT) {
 
30
        if (!stristr($exclude, "\n".$row["id"]."\n")) {
 
31
            $sorted[] = $row["id"];
 
32
        }
 
33
    }
 
34
   }
 
35
 
 
36
   natcasesort($sorted);
 
37
 
 
38
   $o .= ewiki_list_pages($sorted, 0, 0, $ewiki_plugins["list_dict"][0]);
 
39
 
 
40
   return($o);
 
41
}
 
42
 
 
43
 
 
44
?>
 
 
b'\\ No newline at end of file'