public function do_execute() { $this->cliEcho("Importing articles ... \n", 'white', 'bold'); \thebuggenie\core\framework\Event::listen('publish', 'fixture_article_loaded', array($this, 'listenPublishFixtureArticleCreated')); $overwrite = (bool) ($this->getProvidedArgument('overwrite', 'no') == 'yes'); \thebuggenie\core\framework\Context::getModule('publish')->loadFixturesArticles(\thebuggenie\core\framework\Context::getScope()->getID(), $overwrite); }
protected function _addListeners() { framework\Event::listen('core', 'layout.php::header-begins', array($this, 'addMobileContent')); // framework\Event::listen('core', 'header_submenu_decider', array($this, 'hideTopMenu')); // framework\Event::listen('core', 'header_mainmenu_decider', array($this, 'hideTopMenu')); // framework\Event::listen('core', 'header_usermenu_decider', array($this, 'hideTopMenu')); framework\Event::listen('core', 'header_before_logo', array($this, 'addMobileMenuAnchor')); framework\Event::listen('core', 'header_menu_end', array($this, 'addMobileMenu')); framework\Event::listen('core', 'viewissue_left_bottom', array($this, 'disableDetailsResizing')); }
protected function _addListeners() { framework\Event::listen('core', 'project_sidebar_links', array($this, 'listen_project_links')); framework\Event::listen('core', 'breadcrumb_project_links', array($this, 'listen_breadcrumb_links')); framework\Event::listen('core', 'get_backdrop_partial', array($this, 'listen_getcommit')); framework\Event::listen('core', 'viewissue_left_after_attachments', array($this, 'listen_viewissue_panel')); framework\Event::listen('core', 'config_project_tabs_other', array($this, 'listen_projectconfig_tab')); framework\Event::listen('core', 'config_project_panes', array($this, 'listen_projectconfig_panel')); framework\Event::listen('core', 'project_header_buttons', array($this, 'listen_projectheader')); framework\Event::listen('core', '_notification_view', array($this, 'listen_notificationview')); framework\Event::listen('core', 'thebuggenie\\core\\entities\\Notification::getTarget', array($this, 'listen_thebuggenie_core_entities_Notification_getTarget')); }
protected function _addListeners() { framework\Event::listen('core', 'index_left', array($this, 'listen_frontpageLeftmenu')); framework\Event::listen('core', 'index_right_top', array($this, 'listen_frontpageArticle')); if ($this->isWikiTabsEnabled()) { framework\Event::listen('core', 'project_overview_item_links', array($this, 'listen_projectLinks')); framework\Event::listen('core', 'breadcrumb_main_links', array($this, 'listen_BreadcrumbMainLinks')); framework\Event::listen('core', 'breadcrumb_project_links', array($this, 'listen_BreadcrumbProjectLinks')); } framework\Event::listen('core', 'thebuggenie\\core\\entities\\Project::_postSave', array($this, 'listen_createNewProject')); framework\Event::listen('core', 'thebuggenie\\core\\entities\\File::hasAccess', array($this, 'listen_fileHasAccess')); framework\Event::listen('core', 'thebuggenie\\core\\entities\\User::__getStarredArticles', array($this, 'User__getStarredArticles')); framework\Event::listen('core', 'thebuggenie\\core\\entities\\User::__isArticleStarred', array($this, 'User__isArticleStarred')); framework\Event::listen('core', 'thebuggenie\\core\\entities\\User::__addStarredArticle', array($this, 'User__addStarredArticle')); framework\Event::listen('core', 'thebuggenie\\core\\entities\\User::__removeStarredArticle', array($this, 'User__removeStarredArticle')); framework\Event::listen('core', 'upload', array($this, 'listen_upload')); framework\Event::listen('core', 'quicksearch_dropdown_firstitems', array($this, 'listen_quicksearchDropdownFirstItems')); framework\Event::listen('core', 'quicksearch_dropdown_founditems', array($this, 'listen_quicksearchDropdownFoundItems')); framework\Event::listen('core', 'rolepermissionsedit', array($this, 'listen_rolePermissionsEdit')); }
protected function _addListeners() { framework\Event::listen('core', 'thebuggenie\\core\\entities\\User::_postSave', array($this, 'listen_registerUser')); framework\Event::listen('core', 'password_reset', array($this, 'listen_forgottenPassword')); framework\Event::listen('core', 'login_form_pane', array($this, 'listen_loginPane')); framework\Event::listen('core', 'login_button_container', array($this, 'listen_loginButtonContainer')); framework\Event::listen('core', 'thebuggenie\\core\\entities\\User::addScope', array($this, 'listen_addScope')); framework\Event::listen('core', 'thebuggenie\\core\\entities\\Issue::createNew', array($this, 'listen_issueCreate')); framework\Event::listen('core', 'thebuggenie\\core\\entities\\User::_postSave', array($this, 'listen_createUser')); framework\Event::listen('core', 'thebuggenie\\core\\entities\\Issue::save', array($this, 'listen_issueSave')); framework\Event::listen('core', 'thebuggenie\\core\\entities\\Comment::createNew', array($this, 'listen_thebuggenie_core_entities_Comment_createNew')); framework\Event::listen('core', 'thebuggenie\\modules\\publish\\entities\\Article::doSave', array($this, 'listen_Article_doSave')); framework\Event::listen('core', 'viewissue', array($this, 'listen_viewissue')); framework\Event::listen('core', 'issue_subscribe_user', array($this, 'listen_issueSubscribeUser')); framework\Event::listen('core', 'user_dropdown_anon', array($this, 'listen_userDropdownAnon')); framework\Event::listen('core', 'config_project_tabs_settings', array($this, 'listen_projectconfig_tab_settings')); framework\Event::listen('core', 'config_project_tabs_other', array($this, 'listen_projectconfig_tab_other')); framework\Event::listen('core', 'config_project_panes', array($this, 'listen_projectconfig_panel')); framework\Event::listen('core', 'account_pane_notificationsettings', array($this, 'listen_accountNotificationSettings')); framework\Event::listen('core', 'config.createuser.email', array($this, 'listen_configCreateuserEmail')); framework\Event::listen('core', 'config.createuser.save', array($this, 'listen_configCreateuserSave')); framework\Event::listen('core', 'mainActions::myAccount::saveNotificationSettings', array($this, 'listen_accountSaveNotificationSettings')); }
/** * @covers \thebuggenie\core\framework\Event::listen * @covers \thebuggenie\core\framework\Event::trigger * @covers \thebuggenie\core\framework\Event::triggerUntilProcessed * @depends testListening */ public function testTriggeringAndProcessing(\thebuggenie\core\framework\Event $event) { $this->wastriggered = false; \thebuggenie\core\framework\Event::clearListeners('modulename', 'identifier'); \thebuggenie\core\framework\Event::listen('modulename', 'identifier', array($this, 'listenerCallback')); $event->trigger(); $this->assertAttributeEquals(true, 'wastriggered', $this); \thebuggenie\core\framework\Event::clearListeners('modulename', 'identifier'); \thebuggenie\core\framework\Event::listen('modulename', 'identifier', array($this, 'listenerCallbackNonProcessingFirst')); \thebuggenie\core\framework\Event::listen('modulename', 'identifier', array($this, 'listenerCallbackNonProcessingSecond')); \thebuggenie\core\framework\Event::listen('modulename', 'identifier', array($this, 'listenerCallbackProcessing')); $this->wasprocessed = array(); $event->triggerUntilProcessed(); $this->assertAttributeNotEmpty('wasprocessed', $this); $this->assertAttributeContains(1, 'wasprocessed', $this); $this->assertAttributeContains(2, 'wasprocessed', $this); $this->assertAttributeNotContains(3, 'wasprocessed', $this); }
protected static function loadEventListeners($event_listeners) { Logging::log('Loading event listeners'); foreach ($event_listeners as $listener) { list($event_module, $event_identifier, $module, $method) = $listener; Event::listen($event_module, $event_identifier, array(self::getModule($module), $method)); } Logging::log('... done (loading event listeners)'); }
protected function _addListeners() { framework\Event::listen('core', 'thebuggenie\\core\\modules\\configuration\\Actions\\getAuthenticationMethodForAction', array($this, 'listen_configurationAuthenticationMethod')); }
protected function _addListeners() { framework\Event::listen('core', 'project_sidebar_links', array($this, 'listen_project_links')); framework\Event::listen('core', 'breadcrumb_project_links', array($this, 'listen_breadcrumb_links')); framework\Event::listen('core', 'get_backdrop_partial', array($this, 'listen_getcommit')); framework\Event::listen('core', 'viewissue_left_after_attachments', array($this, 'listen_viewissue_panel')); framework\Event::listen('core', 'config_project_tabs_other', array($this, 'listen_projectconfig_tab')); framework\Event::listen('core', 'config_project_panes', array($this, 'listen_projectconfig_panel')); framework\Event::listen('core', 'project_header_buttons', array($this, 'listen_projectheader')); framework\Event::listen('core', '_notification_view', array($this, 'listen_notificationview')); framework\Event::listen('core', '_notification_view_text', array($this, 'listen_notificationviewtext')); framework\Event::listen('core', 'thebuggenie\\core\\entities\\Notification::getTarget', array($this, 'listen_thebuggenie_core_entities_Notification_getTarget')); framework\Event::listen('core', 'thebuggenie\\core\\entities\\Notification::getTargetUrl', array($this, 'listen_thebuggenie_core_entities_Notification_getTargetUrl')); framework\Event::listen('core', 'thebuggenie\\core\\framework\\helpers\\TextParser::_parse_line::char_regexes', array($this, 'listen_thebuggenie_core_helpers_textparser_char_regexes')); framework\Event::listen('core', 'thebuggenie\\core\\framework\\helpers\\TextParserMarkdown::transform', array($this, 'listen_thebuggenie_core_helpers_textparser_char_regexes')); }
/** * Unlock the issue * * @param \thebuggenie\core\framework\Request $request */ public function runLockIssue(framework\Request $request) { if ($issue_id = $request['issue_id']) { try { $issue = entities\Issue::getB2DBTable()->selectById($issue_id); } catch (\Exception $e) { $this->getResponse()->setHttpStatus(400); return $this->renderJSON(array('message' => framework\Context::getI18n()->__('This issue does not exist'))); } if (!$issue->canEditAccessPolicy()) { $this->forward403($this->getI18n()->__("You don't have access to update the issue access policy")); return; } framework\Event::listen('core', 'thebuggenie\\core\\entities\\Issue::save_pre_notifications', array($this, 'listen_issueSaveLock')); $issue->setLocked(); $issue->save(); } else { $this->getResponse()->setHttpStatus(400); return $this->renderJSON(array('message' => framework\Context::getI18n()->__('This issue does not exist'))); } return $this->renderJSON(array('message' => $this->getI18n()->__('Issue access policy updated'))); }