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))); }
public function onCollectButtonsConfig(BASE_CLASS_EventCollector $event) { $params = $event->getParams(); if ($params["entityType"] != HINT_BOL_Service::ENTITY_TYPE_USER) { return; } $label = OW::getLanguage()->text("hint", "button_view_profile_config"); $active = HINT_BOL_Service::getInstance()->isActionActive(HINT_BOL_Service::ENTITY_TYPE_USER, "view"); $button = array("key" => "view", "active" => $active === null ? false : $active, "label" => $label); $event->add($button); }
public function onCollectButtonsConfig(BASE_CLASS_EventCollector $event) { $params = $event->getParams(); if ($params["entityType"] != HINT_BOL_Service::ENTITY_TYPE_USER) { return; } $label = OW::getLanguage()->text("virtualgifts", "profile_toolbar_item_send_gift"); $active = HINT_BOL_Service::getInstance()->isActionActive(HINT_BOL_Service::ENTITY_TYPE_USER, "virtualgift"); $button = array("key" => "virtualgift", "active" => $active === null ? true : $active, "label" => $label); $event->add($button); }
public function getInfo() { $out = array(); $line0question = empty($this->params["info"][HINT_BOL_Service::INFO_LINE0]["question"]) ? null : $this->params["info"][HINT_BOL_Service::INFO_LINE0]["question"]; $line0key = empty($this->params["info"][HINT_BOL_Service::INFO_LINE0]["key"]) ? null : $this->params["info"][HINT_BOL_Service::INFO_LINE0]["key"]; $out[HINT_BOL_Service::INFO_LINE0] = HINT_BOL_Service::getInstance()->getInfoLinePreview($this->entityType, $line0key, $line0question, HINT_BOL_Service::INFO_LINE0); $line1question = empty($this->params["info"][HINT_BOL_Service::INFO_LINE1]["question"]) ? null : $this->params["info"][HINT_BOL_Service::INFO_LINE1]["question"]; $line1key = empty($this->params["info"][HINT_BOL_Service::INFO_LINE1]["key"]) ? null : $this->params["info"][HINT_BOL_Service::INFO_LINE1]["key"]; $out[HINT_BOL_Service::INFO_LINE1] = HINT_BOL_Service::getInstance()->getInfoLinePreview($this->entityType, $line1key, $line1question, HINT_BOL_Service::INFO_LINE1); $line2question = empty($this->params["info"][HINT_BOL_Service::INFO_LINE2]["question"]) ? null : $this->params["info"][HINT_BOL_Service::INFO_LINE2]["question"]; $line2key = empty($this->params["info"][HINT_BOL_Service::INFO_LINE2]["key"]) ? null : $this->params["info"][HINT_BOL_Service::INFO_LINE2]["key"]; $out[HINT_BOL_Service::INFO_LINE2] = HINT_BOL_Service::getInstance()->getInfoLinePreview($this->entityType, $line2key, $line2question, HINT_BOL_Service::INFO_LINE2); return $out; }
public function onCollectButtonsConfig(BASE_CLASS_EventCollector $event) { $params = $event->getParams(); if ($params["entityType"] != HINT_BOL_Service::ENTITY_TYPE_USER) { return; } $label = OW::getLanguage()->text('mailbox', 'create_conversation_button'); $active = HINT_BOL_Service::getInstance()->isActionActive(HINT_BOL_Service::ENTITY_TYPE_USER, "mcompose"); $mcomposeInstalled = $this->isActive(); $button = array("key" => "mcompose", "active" => $active === null ? $mcomposeInstalled : $active, "label" => $label); if (!$mcomposeInstalled) { $button["requirements"]["short"] = OW::getLanguage()->text("hint", "mcompose_required_short", array("plugin" => '<a href="' . self::PLUGIN_URL . '" target="_blank">' . self::PLUGIN_TITLE . '</a>')); $button["requirements"]["long"] = OW::getLanguage()->text("hint", "mcompose_required_long", array("plugin" => '<a href="' . self::PLUGIN_URL . '" target="_blank">' . self::PLUGIN_TITLE . '</a>', "feature" => $label)); } $event->add($button); }
public function process() { $service = HINT_BOL_Service::getInstance(); $values = $this->getValues(); foreach ($this->actions as $action) { $service->setActionActive($this->entityType, $action["key"], !empty($values["action-" . $action["key"]])); } HINT_CLASS_UheaderBridge::getInstance()->setEnabled($values["uheader_enabled"]); $this->saveInfoLine(HINT_BOL_Service::INFO_LINE0, $values); $this->saveInfoLine(HINT_BOL_Service::INFO_LINE1, $values); $this->saveInfoLine(HINT_BOL_Service::INFO_LINE2, $values); }
public function getInfo() { return array(HINT_BOL_Service::INFO_LINE0 => HINT_BOL_Service::getInstance()->getInfoLine(HINT_BOL_Service::ENTITY_TYPE_USER, $this->userId, HINT_BOL_Service::INFO_LINE0), HINT_BOL_Service::INFO_LINE1 => HINT_BOL_Service::getInstance()->getInfoLine(HINT_BOL_Service::ENTITY_TYPE_USER, $this->userId, HINT_BOL_Service::INFO_LINE1), HINT_BOL_Service::INFO_LINE2 => HINT_BOL_Service::getInstance()->getInfoLine(HINT_BOL_Service::ENTITY_TYPE_USER, $this->userId, HINT_BOL_Service::INFO_LINE2)); }
/** * @param BASE_CLASS_EventCollector $event */ public function onCollectButtonsConfig(BASE_CLASS_EventCollector $event) { $params = $event->getParams(); if ($params["entityType"] != HINT_BOL_Service::ENTITY_TYPE_USER) { return; } $label = OW::getLanguage()->text("ocsfavorites", "add_favorite_button"); $active = HINT_BOL_Service::getInstance()->isActionActive(HINT_BOL_Service::ENTITY_TYPE_USER, "ocsfavorites"); $button = array("key" => "ocsfavorites", "active" => $active === null ? true : $active, "label" => $label); $event->add($button); }
public function setEnabled($yes = true) { HINT_BOL_Service::getInstance()->saveConfig("uhint_enabled", $yes ? 1 : 0); }