static function wikiView($args) { $tikilib = TikiLib::lib('tiki'); static $FutureLink_PageLookup = 0; ++$FutureLink_PageLookup; $wikiAttributes = (new Tracker_Query('Wiki Attributes'))->byName()->excludeDetails()->filter(array('field' => 'Type', 'value' => 'FutureLink'))->filter(array('field' => 'Page', 'value' => $args['object']))->render(false)->query(); $futureLinks = array(); foreach ($wikiAttributes as $wikiAttribute) { $futureLinks[] = $futureLink = json_decode($wikiAttribute['Value']); if (isset($futureLink->href)) { $futureLink->href = urldecode($futureLink->href); //TODO: this shouldn't work, need to upgrade $result = FutureLink_SendToFuture::send(array('futureLink' => $futureLink, 'pastlink' => array('body' => $args['data'], 'href' => $tikilib->tikiUrl() . 'tiki-index.php?page=' . $args['object']))); } } }
static function wikiView() { global $page; $headerlib = TikiLib::lib('header'); $me = new self(); $phrase = !empty($_REQUEST['phrase']) ? $_REQUEST['phrase'] : ''; FutureLink_Search::restorePastLinkPhrasesInWikiPage($me->getItems(), $phrase); //if we have an awaiting PastLink that needs sent, we do so here $result = (new Tracker_Query('Wiki Attributes'))->byName()->render(false)->filterFieldByValue('Page', $page)->filterFieldByValue('Type', 'PastLink Send')->query(); if (count($result) > 0) { foreach (FutureLink_SendToFuture::sendAll() as $text => $received) { $receivedJSON = json_decode($received); if (isset($receivedJSON->feed) && $receivedJSON->feed == 'success') { (new Tracker_Query('Wiki Attributes'))->byName()->render(false)->filterFieldByValue('Page', $page)->filterFieldByValue('Type', 'PastLink Send')->filterFieldByValue('Attribute', $text)->delete(true); $headerlib->add_jq_onready("\$.notify('" . tr("PastLink and FutureLink created...") . "');"); } } } }