コード例 #1
0
 function markRevisionsPatrolled($article)
 {
     global $wgOut;
     $request = $this->getRequest();
     // some sanity checks
     $rcid = $request->getInt('rcid');
     $rc = RecentChange::newFromId($rcid);
     if (is_null($rc)) {
         throw new ErrorPageError('markedaspatrollederror', 'markedaspatrollederrortext');
     }
     $user = $this->getUser();
     if (!$user->matchEditToken($request->getVal('token'), $rcid)) {
         throw new ErrorPageError('sessionfailure-title', 'sessionfailure');
     }
     // check if skip has been passed to us
     if ($request->getInt('skip') != 1) {
         // find his and lows
         $rcids = array();
         $rcids[] = $rcid;
         if ($request->getVal('rchi', null) && $request->getVal('rclow', null)) {
             $hilos = wfGetRCPatrols($rcid, $request->getVal('rchi'), $request->getVal('rclow'), $article->mTitle->getArticleID());
             $rcids = array_merge($rcids, $hilos);
         }
         $rcids = array_unique($rcids);
         foreach ($rcids as $id) {
             RecentChange::markPatrolled($id, false);
         }
         wfRunHooks('MarkPatrolledBatchComplete', array(&$article, &$rcids, &$user));
     } else {
         RCPatrol::skipPatrolled($article);
     }
 }