Esempio n. 1
0
 /**
  * Get the side-wide ModeratedPage status, reading the action-page args.
  * Who are the moderators? What actions should be moderated?
  */
 function getSiteStatus(&$request, &$action_page)
 {
     $loader = new WikiPluginLoader();
     $rev = $action_page->getCurrentRevision();
     $content = $rev->getPackedContent();
     list($pi) = explode("\n", $content, 2);
     // plugin ModeratedPage must be first line!
     if ($parsed = $loader->parsePI($pi)) {
         $plugin =& $parsed[1];
         if ($plugin->getName() != _("ModeratedPage")) {
             return $this->error(sprintf(_("<?plugin ModeratedPage ... ?> not found in first line of %s"), $action_page->getName()));
         }
         if (!$action_page->get('locked')) {
             return $this->error(sprintf(_("%s is not locked!"), $action_page->getName()));
         }
         return $plugin->resolve_argstr($request, $parsed[2]);
     } else {
         return $this->error(sprintf(_("<?plugin ModeratedPage ... ?> not found in first line of %s"), $action_page->getName()));
     }
 }