Example #1
0
 static function wikiView($args)
 {
     if (isset($_REQUEST['protocol'], $_REQUEST['contribution']) && $_REQUEST['protocol'] == 'forwardlink') {
         $me = new self();
         $forwardLink = Feed_ForwardLink::forwardLink($args['object']);
         //here we do the confirmation that another wiki is trying to talk with this one
         $_REQUEST['contribution'] = json_decode($_REQUEST['contribution']);
         $_REQUEST['contribution']->origin = $_SERVER['REMOTE_ADDR'];
         if ($forwardLink->addItem($_REQUEST['contribution']) == true) {
             $me->response = 'success';
         } else {
             $me->response = 'failure';
         }
         echo json_encode($me->feed(TikiLib::tikiUrl() . 'tiki-index.php?page=' . $args['object']));
         exit;
     }
 }
Example #2
0
 static function wikiView($args)
 {
     //TODO: abstract
     if (isset($_POST['protocol']) && $_POST['protocol'] == 'futurelink' && isset($_POST['metadata'])) {
         $me = new self($args['object']);
         $futureLink = new FutureLink_FutureUI($args['object']);
         //here we do the confirmation that another wiki is trying to talk with this one
         $metadata = json_decode($_POST['metadata']);
         $metadata->origin = $_POST['REMOTE_ADDR'];
         if ($futureLink->addItem($metadata) == true) {
             $me->response = 'success';
         } else {
             $me->response = 'failure';
         }
         $feed = $me->feed(TikiLib::tikiUrl() . 'tiki-index.php?page=' . $args['object']);
         if ($me->response == 'failure' && $futureLink == true) {
             $feed->reason = $futureLink->verifications;
         }
         echo json_encode($feed);
         exit;
     }
 }