public function wikilingo_flp_view($args) { $headerlib = TikiLib::lib('header'); $page = $args['object']; $version = $args['version']; $body = $args['data']; require_once 'lib/wikiLingo_tiki/WikiEvents.php'; $events = new WikiEvents($page, $version, $body); //listener $events->listen(); //redirect start $events->direct(); //futurelink $events->load(); //pastlink now happens inside of wikiLingo //view for wiki //need partial metadata $metadataLookup = new WikiMetadataLookup($page); $partialMetadata = $metadataLookup->getPartial(); $headerlib->add_jsfile('vendor/rangy/rangy/uncompressed/rangy-core.js')->add_jsfile('vendor/rangy/rangy/uncompressed/rangy-cssclassapplier.js')->add_jsfile('vendor/rangy/rangy/uncompressed/rangy-selectionsaverestore.js')->add_jsfile('vendor/flp/flp/Phraser/rangy-phraser.js')->add_jsfile('vendor/flp/flp/Phraser/Phraser.js')->add_jsfile('vendor/jquery/md5/js/md5.js')->add_jsfile('lib/wikiLingo_tiki/tiki_wikiLingo_flp_view.js')->add_jsfile('lib/ZeroClipboard.js')->add_jsfile('vendor/flp/flp/scripts/flp.js')->add_jsfile('vendor/flp/flp/scripts/flp.Link.js')->add_jsfile('lib/wikiLingo_tiki/tiki_flp.Link.js')->add_jsfile('vendor/jquery/plugins/tablesorter/js/jquery.tablesorter.js')->add_cssfile('vendor/jquery/plugins/tablesorter/css/theme.dropbox.css')->add_jq_onready('(new WikiLingoFLPView($("#page-data"), ' . json_encode($partialMetadata) . '));'); }
public function __construct(WikiLingo\Parser &$wikiLingoParser, $bindFLP = true) { global $prefs, $page; $headerlib = TikiLib::lib('header'); if ($page == null && $bindFLP) { throw new \Exception("Page undefined"); } require_once 'lib/wikiLingo_tiki/WikiPluginBridge.php'; $bridge = self::$bridge = new WikiPluginBridge(); $events = Type::Events($wikiLingoParser->events); $events->bind(new Event\Expression\Plugin\Exists(function (Plugin &$plugin) use($wikiLingoParser, $bridge) { if (!$plugin->exists) { switch ($plugin->classType) { case "WikiLingo\\Plugin\\Maketoc": if (self::$toc == null) { self::$toc = new WikiLingo\Plugin\Toc(); } $plugin->exists = true; $plugin->class = self::$toc; $wikiLingoParser->pluginInstances[$plugin->classType] = self::$toc; break; default: $plugin->exists = true; $plugin->class = $bridge; $wikiLingoParser->pluginInstances[$plugin->classType] = $bridge; } } })); if ($bindFLP) { //FutureLink-Protocol Events FLP\Events::bind(new FLP\Event\MetadataLookup(function ($linkType, &$metadata) use($page, $headerlib) { $metadataLookup = new WikiMetadataLookup($page); $metadataTemp = $metadataLookup->getPartial(); $metadataTemp->href = TikiLib::tikiUrl('tiki-index.php') . '?page=' . $page; $metadataTemp->text = $metadata->text; $metadata = $metadataTemp; })); } }
public function save() { $metadataLookup = new WikiMetadataLookup($this->title); $metadata = $metadataLookup->getPartial(); FLP\Data::createArticle($this->title, $this->body, $metadata, $this->version); }