public function onCollectList(BASE_CLASS_EventCollector $event) { $language = OW::getLanguage(); $action = array('key' => self::ACTION_VIEW_TAGS, 'pluginKey' => $this->plugin->getKey(), 'label' => $language->text($this->plugin->getKey(), 'privacy_action_view_tags'), 'description' => '', 'defaultValue' => 'everybody'); $event->add($action); $action = array('key' => self::ACTION_TAG_MY_PHOTO, 'pluginKey' => $this->plugin->getKey(), 'label' => $language->text($this->plugin->getKey(), 'privacy_action_tag_my_photo'), 'description' => '', 'defaultValue' => 'everybody'); $event->add($action); }
public function onCollectActions(BASE_CLASS_EventCollector $e) { $e->add(array('section' => $this->plugin->getKey(), 'action' => self::ACTION_COMMENT, 'sectionIcon' => 'ow_ic_picture', 'sectionLabel' => OW::getLanguage()->text($this->plugin->getKey(), 'notifications_section_label'), 'description' => OW::getLanguage()->text($this->plugin->getKey(), 'notifications_setting_comment'), 'selected' => true)); if (UHEADER_CLASS_NewsfeedBridge::getInstance()->isActive()) { $e->add(array('section' => $this->plugin->getKey(), 'action' => self::ACTION_LIKE, 'sectionIcon' => 'ow_ic_picture', 'sectionLabel' => OW::getLanguage()->text($this->plugin->getKey(), 'notifications_section_label'), 'description' => OW::getLanguage()->text($this->plugin->getKey(), 'notifications_setting_like'), 'selected' => true)); } }
public function onCollectActions(BASE_CLASS_EventCollector $e) { $sectionLabel = OW::getLanguage()->text('groups', 'email_notification_section_label'); $sectionIcon = 'ow_ic_files'; $e->add(array('section' => 'groups', 'action' => self::ACTION_COMMENT, 'sectionIcon' => $sectionIcon, 'sectionLabel' => $sectionLabel, 'description' => OW::getLanguage()->text($this->plugin->getKey(), 'notifications_setting_comment'), 'selected' => true)); $e->add(array('section' => 'groups', 'action' => self::ACTION_ADD, 'sectionIcon' => $sectionIcon, 'sectionLabel' => $sectionLabel, 'description' => OW::getLanguage()->text($this->plugin->getKey(), 'notifications_setting_add'), 'selected' => true)); if (GHEADER_CLASS_NewsfeedBridge::getInstance()->isActive()) { $e->add(array('section' => 'groups', 'action' => self::ACTION_LIKE, 'sectionIcon' => $sectionIcon, 'sectionLabel' => $sectionLabel, 'description' => OW::getLanguage()->text($this->plugin->getKey(), 'notifications_setting_like'), 'selected' => true)); } }
public function onGroupEdit(OW_Event $event) { $params = $event->getParams(); $groupId = (int) $params['groupId']; $cover = GHEADER_BOL_Service::getInstance()->findCoverByGroupId($groupId); if ($cover === null) { return; } $eventParams = array('pluginKey' => $this->plugin->getKey(), 'entityType' => GHEADER_CLASS_CommentsBridge::ENTITY_TYPE, 'entityId' => $cover->id); $event = new OW_Event('feed.action', $eventParams); OW::getEventManager()->trigger($event); }
public function onLike(OW_Event $event) { $params = $event->getParams(); if ($params['entityType'] != UHEADER_CLASS_CommentsBridge::ENTITY_TYPE) { return; } $userId = $params['userId']; $coverId = $params['entityId']; $cover = UHEADER_BOL_Service::getInstance()->findCoverById($coverId); $string = null; if ($cover->userId == $userId) { $string = array("key" => 'uheader+activity_string_cover_like_self'); } else { $userName = BOL_UserService::getInstance()->getDisplayName($cover->userId); $userUrl = BOL_UserService::getInstance()->getUserUrl($cover->userId); $userEmbed = '<a href="' . $userUrl . '">' . $userName . '</a>'; $string = array("key" => 'uheader+activity_string_cover_like', "vars" => array('user' => $userEmbed)); } OW::getEventManager()->trigger(new OW_Event('feed.activity', array('activityType' => 'like', 'activityId' => $userId, 'entityId' => $params['entityId'], 'entityType' => $params['entityType'], 'userId' => $userId, 'pluginKey' => $this->plugin->getKey()), array('string' => $string))); }
private function getAlbumName() { $albumName = OW::getLanguage()->text($this->plugin->getKey(), 'default_photo_album_name'); return empty($albumName) ? $this->defaultPhotoAlbumName : $albumName; }
public function initPlugin(OW_Plugin $pluginObject) { $this->addPackagePointers($pluginObject->getDto()); $initDirPath = $pluginObject->getRootDir(); if (OW::getApplication()->getContext() == OW::CONTEXT_MOBILE) { $initDirPath = $pluginObject->getMobileDir(); } else { if (OW::getApplication()->getContext() == OW::CONTEXT_API) { $initDirPath = $pluginObject->getApiDir(); } } if (file_exists($initDirPath . 'init.php')) { OW::getEventManager()->trigger(new OW_Event("core.performance_test", array("key" => "plugin_init.start", "pluginKey" => $pluginObject->getKey()))); include $initDirPath . 'init.php'; OW::getEventManager()->trigger(new OW_Event("core.performance_test", array("key" => "plugin_init.end", "pluginKey" => $pluginObject->getKey()))); } }
/** * Adds platform predefined package pointers * * @param BOL_Plugin $pluginDto */ public function addPackagePointers(BOL_Plugin $pluginDto) { $plugin = new OW_Plugin($pluginDto); $upperedKey = mb_strtoupper($plugin->getKey()); $autoloader = OW::getAutoloader(); $predefinedPointers = array("CMP" => $plugin->getCmpDir(), "CTRL" => $plugin->getCtrlDir(), "BOL" => $plugin->getBolDir(), "CLASS" => $plugin->getClassesDir(), "MCMP" => $plugin->getMobileCmpDir(), "MCTRL" => $plugin->getMobileCtrlDir(), "MBOL" => $plugin->getMobileBolDir(), "MCLASS" => $plugin->getMobileClassesDir(), "ACTRL" => $plugin->getApiCtrlDir(), "ABOL" => $plugin->getApiBolDir(), "ACLASS" => $plugin->getApiClassesDir()); foreach ($predefinedPointers as $pointer => $dirPath) { $autoloader->addPackagePointer($upperedKey . "_" . $pointer, $dirPath); } }
public function onCollectList(BASE_CLASS_EventCollector $event) { $language = OW::getLanguage(); $action = array('key' => self::PRIVACY_ACTION, 'pluginKey' => $this->plugin->getKey(), 'label' => $language->text($this->plugin->getKey(), 'privacy_action_view_cover'), 'description' => '', 'defaultValue' => 'everybody'); $event->add($action); }