/** * Returns class instance * * @return HINT_CLASS_ParseManager */ public static function getInstance() { if (null === self::$classInstance) { self::$classInstance = new self(); } return self::$classInstance; }
public function rsp() { if (!OW::getRequest()->isAjax()) { throw new Redirect404Exception(); } if (empty($_GET['url'])) { exit; } $url = trim($_GET['url']); $parser = HINT_CLASS_ParseManager::getInstance()->getParser($url); if ($parser === null) { exit; } $params = $parser->parse($url); $hint = $parser->renderHint($params); $topCorner = empty($hint['topCorner']) ? null : $hint['topCorner']; $bottomCorner = empty($hint['bottomCorner']) ? null : $hint['bottomCorner']; $rightCorner = empty($hint['rightCorner']) ? null : $hint['rightCorner']; $out = array('markup' => $this->getMarkup($hint['body'], $topCorner, $bottomCorner, $rightCorner)); echo json_encode($out); exit; }
<?php /** * Copyright (c) 2012, Sergey Kambalin * All rights reserved. * ATTENTION: This commercial software is intended for use with Oxwall Free Community Software http://www.oxwall.org/ * and is licensed under Oxwall Store Commercial License. * Full text of this license can be found at http://www.oxwall.org/store/oscl */ OW::getRouter()->addRoute(new OW_Route('hint-configuration', 'admin/plugins/hint', 'HINT_CTRL_Admin', 'index')); HINT_CLASS_ParseManager::getInstance()->init(); HINT_CLASS_ParseManager::getInstance()->addParser(new HINT_CLASS_UserParser()); HINT_CLASS_FriendsBridge::getInstance()->init(); HINT_CLASS_NewsfeedBridge::getInstance()->init(); HINT_CLASS_BaseBridge::getInstance()->init(); HINT_CLASS_GiftBridge::getInstance()->init(); HINT_CLASS_McomposeBridge::getInstance()->init(); HINT_CLASS_UheaderBridge::getInstance()->init(); HINT_CLASS_UserCreditsBridge::getInstance()->init(); HINT_CLASS_PhotoBridge::getInstance()->init(); HINT_CLASS_VideoBridge::getInstance()->init(); function hint_add_admin_notification(BASE_CLASS_EventCollector $e) { if (HINT_BOL_Service::getInstance()->getConfig("admin_notified")) { return; } $pluginTitle = OW::getPluginManager()->getPlugin("hint")->getDto()->title; $pluginUrl = OW::getRouter()->urlForRoute('hint-configuration'); $pluginEmbed = '<a href="' . $pluginUrl . '">' . $pluginTitle . '</a>'; $language = OW::getLanguage(); $e->add($language->text('hint', 'admin_notification', array('plugin' => $pluginEmbed, "settingsUrl" => $pluginUrl)));