Example #1
0
 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;
         }));
     }
 }
Example #2
0
</p>
Source;
$scripts = (new WikiLingo\Utilities\Scripts())->addCssLocation("//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css")->addScriptLocation("//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js")->addScriptLocation("http://code.jquery.com/ui/1.10.3/jquery-ui.js");
$parser = new WikiLingo\Parser($scripts);
$msg = '';
FLP\Events::bind(new FLP\Event\MetadataLookup(function ($linkType, &$value) {
    $value = new FLP\Metadata();
    $value->author = "Robert Plummer";
    $value->authorInstitution = "Visual Interop Development llc";
    $value->authorProfession = "Software Engineer";
    $value->moderator = "Robert Plummer";
    $value->moderatorInstitution = "Visual Interop Development llc";
    $value->moderatorProfession = "Software Engineer";
    $value->answers = array();
    $value->categories = array();
    $value->count = 0;
    $value->dateLastUpdated = time();
    $value->dateOriginated = time();
    $value->href = "http://www.github.com/FutureLink-Protocol/php";
    $value->keywords = array();
    $value->language = "English";
    $value->minimumMathNeeded = "";
    $value->minimumStatisticsNeeded = "";
    $value->scientificField = "";
    $value->websiteTitle = "FutureLink-Protocol Demo";
    $value->websiteSubtitle = "In php";
}));
$page = $parser->parse($source);
echo $page . $scripts->renderScript();
?>
</body>
</html>