changed git call from https to git readonly
[atutor.git] / mods / wiki / plugins / lib / page_delegator.php
1 <?php
2
3 /* Calls a series of ewiki handlers until one returns a page, if no page is 
4 returned serves pagename_default.
5
6 Written By:  Andy Fundinger (Andy@burgiss.com)
7 */
8
9 $ewiki_config['LoggedInPage']='LoginDelegator';
10 $ewiki_plugins["page"]["LoginDelegator"] = "ewiki_page_delegator";
11 $ewiki_config["delegator_default"]["LoginDelegator"]="Welcome";
12
13 function ewiki_page_delegator($id, $data, $action) {
14   global $ewiki_plugins,$ewiki_config;
15
16   #-- handlers
17   $handler_o = "";
18   if ($pf_a = @$ewiki_plugins["delegator"][$id]) {
19     ksort($pf_a);
20     foreach ($pf_a as $pf) {
21       if ($handler_o = $pf($id, $data, $action)) { break; }
22     }
23   }
24   
25   if(isset($handler_o)){
26     return($handler_o);
27   }
28
29   //Authentication for the default page is handled inside ewiki_page
30   // this may result in an access denied page.
31   $o=ewiki_page('view/'.$ewiki_config["delegator_default"][$id]);
32     
33   //page_final plugins have been run, unset them
34         unset($ewiki_plugins["page_final"]);    
35   
36   return($o);
37 }
38
39
40 ?>