本文整理汇总了PHP中EventManager::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP EventManager::instance方法的具体用法?PHP EventManager::instance怎么用?PHP EventManager::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventManager
的用法示例。
在下文中一共展示了EventManager::instance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display_remove_button
/**
* Say if we can display the remove button on a wiki page
*
* The wiki page may be driven by another item in the forge (eg a docman document),
* therefore wiki administrator shouldn't be able to remove the page.
*
* @return bool
*/
function display_remove_button($pagename)
{
$display_remove_button = true;
$em = EventManager::instance();
$em->processEvent(Event::WIKI_DISPLAY_REMOVE_BUTTON, array('display_remove_button' => &$display_remove_button, 'group_id' => GROUP_ID, 'wiki_page' => $pagename));
return $display_remove_button;
}
示例2: service_replace_template_name_in_link
/**
* @return string
*/
function service_replace_template_name_in_link($link, array $template, Project $project)
{
$link = preg_replace('#(/www/|/projects/|group=)' . $template['name'] . '(/|&|$)#', '$1' . $project->getUnixName() . '$2', $link);
$link = preg_replace('/group_id=' . $template['id'] . '([^\\d]|$)/', 'group_id=' . $project->getGroupId() . '$1', $link);
EventManager::instance()->processEvent(Event::SERVICE_REPLACE_TEMPLATE_NAME_IN_LINK, array('link' => &$link, 'template' => $template, 'project' => $project));
return $link;
}
示例3: _content
function _content($params)
{
if (isset($params['version_number'])) {
$version_factory =& $this->_getVersionFactory($params);
$version =& $version_factory->getSpecificVersion($params['item'], $params['version_number']);
} else {
$version =& $params['item']->getCurrentVersion();
}
if ($version) {
if (file_exists($version->getPath())) {
$event_manager =& EventManager::instance();
$event_manager->processEvent('plugin_docman_event_access', array('group_id' => $params['group_id'], 'item' => &$params['item'], 'version' => $version->getNumber(), 'user' => &$params['user']));
$mime = explode('/', $version->getFiletype());
if (in_array($mime[1], array('plain', 'css', 'javascript'))) {
$balise = 'pre';
} else {
$balise = 'div';
}
echo '<' . $balise . ' class="docman_embedded_file_content">';
echo $this->hp->purify(file_get_contents($version->getPath()), CODENDI_PURIFIER_FULL);
echo '</' . $balise . '>';
} else {
$this->_controller->feedback->log('error', $GLOBALS['Language']->getText('plugin_docman', 'error_filenotfound'));
$v =& new Docman_View_DocmanError($this->_controller);
$v->display($params);
}
}
}
示例4: __construct
public function __construct(ProjectUGroup $ugroup)
{
parent::__construct($ugroup);
$this->permissions_manager = PermissionsManager::instance();
$this->event_manager = EventManager::instance();
$this->html_purifier = Codendi_HTMLPurifier::instance();
}
示例5: getContent
public function getContent()
{
$request =& HTTPRequest::instance();
$group_id = $request->get('group_id');
$pm = ProjectManager::instance();
$project = $pm->getProject($group_id);
$res_admin = db_query("SELECT user.user_id AS user_id,user.user_name AS user_name, user.realname as realname " . "FROM user,user_group " . "WHERE user_group.user_id=user.user_id AND user_group.group_id=" . db_ei($group_id) . " AND " . "user_group.admin_flags = 'A'");
if (db_numrows($res_admin) > 0) {
$user_helper = UserHelper::instance();
$hp = Codendi_HTMLPurifier::instance();
$em = EventManager::instance();
echo '<span class="develtitle">' . $GLOBALS['Language']->getText('include_project_home', 'proj_admins') . ':</span><br />';
while ($row_admin = db_fetch_array($res_admin)) {
$display_name = '';
$em->processEvent('get_user_display_name', array('user_id' => $row_admin['user_id'], 'user_name' => $row_admin['user_name'], 'realname' => $row_admin['realname'], 'user_display_name' => &$display_name));
if (!$display_name) {
$display_name = $hp->purify($user_helper->getDisplayNameFromUserId($row_admin['user_id']));
}
echo '<a href="/users/' . $row_admin['user_name'] . '/">' . $display_name . '</a><br />';
}
}
echo '<span class="develtitle">' . $GLOBALS['Language']->getText('include_project_home', 'proj_members') . ':</span><br />';
// count of developers on this project
$res_count = db_query("SELECT user_id FROM user_group WHERE group_id=" . db_ei($group_id));
echo db_numrows($res_count);
echo ' <a href="/project/memberlist.php?group_id=' . $group_id . '">[' . $GLOBALS['Language']->getText('include_project_home', 'view_members') . ']</a>';
}
示例6: __construct
protected function __construct()
{
$this->charts = null;
$this->chart_factories = array();
$em = EventManager::instance();
$em->processEvent('graphontrackersv5_load_chart_factories', array('factories' => &$this->chart_factories));
}
示例7: buildAdditionnalPanesInfo
private function buildAdditionnalPanesInfo(Planning_Milestone $milestone, array &$panes_info)
{
if (!$milestone->getArtifact()) {
return;
}
EventManager::instance()->processEvent(AGILEDASHBOARD_EVENT_ADDITIONAL_PANES_INFO_ON_MILESTONE, array('milestone' => $milestone, 'user' => $this->user, 'pane_info_list' => &$panes_info));
}
示例8: instance
/**
* The singleton method
*
* @return EventManager
*/
public static function instance()
{
if (!self::$instance) {
self::$instance = new EventManager();
}
return self::$instance;
}
示例9: instance
public static function instance()
{
if (!self::$instance) {
self::$instance = new PluginManager(PluginFactory::instance(), EventManager::instance(), new SiteCache());
}
return self::$instance;
}
示例10: build
/** @return User_LoginPresenter */
public function build($return_to, $printer_version, $form_loginname)
{
$presenter = new User_LoginPresenter($return_to, $printer_version, $form_loginname, $this->getToggleSSL());
$authoritative = false;
EventManager::instance()->processEvent('login_presenter', array('presenter' => &$presenter, 'authoritative' => &$authoritative));
return $presenter;
}
示例11: instance
public static function instance()
{
if (!self::$instance) {
self::$instance = new PluginManager(PluginFactory::instance(), EventManager::instance(), new SiteCache(), new ForgeUpgradeConfig(new System_Command()));
}
return self::$instance;
}
示例12: testCanBeDisplayedReturnsTrueIfPlatformCanUseGerritAndGerritServersSet
public function testCanBeDisplayedReturnsTrueIfPlatformCanUseGerritAndGerritServersSet()
{
$plugin = new GitViews_RepoManagement_Pane_GerritTest_LDAP_FakePlugin();
EventManager::instance()->addListener(GIT_EVENT_PLATFORM_CAN_USE_GERRIT, $plugin, 'git_event_platform_can_use_gerrit', false);
$gerrit_servers = array('IAmAServer');
$pane = new GitViews_RepoManagement_Pane_Gerrit($this->repository, $this->request, $this->driver_factory, $gerrit_servers, array());
$this->assertTrue($pane->canBeDisplayed());
}
示例13: getCombinedScripts
protected function getCombinedScripts()
{
$arr = array('/scripts/polyphills/json2.js', '/scripts/polyphills/storage.js', '/scripts/prototype/prototype.js', '/scripts/protocheck/protocheck.js', '/scripts/scriptaculous/scriptaculous.js', '/scripts/scriptaculous/builder.js', '/scripts/scriptaculous/effects.js', '/scripts/scriptaculous/dragdrop.js', '/scripts/scriptaculous/controls.js', '/scripts/scriptaculous/slider.js', '/scripts/scriptaculous/sound.js', '/scripts/jquery/jquery-1.9.1.min.js', '/scripts/jquery/jquery-ui.min.js', '/scripts/jquery/jquery-noconflict.js', '/scripts/tuleap/browser-compatibility.js', '/scripts/tuleap/project-history.js', '/scripts/bootstrap/bootstrap-dropdown.js', '/scripts/bootstrap/bootstrap-button.js', '/scripts/bootstrap/bootstrap-modal.js', '/scripts/bootstrap/bootstrap-collapse.js', '/scripts/bootstrap/bootstrap-tooltip.js', '/scripts/bootstrap/bootstrap-tooltip-fix-prototypejs-conflict.js', '/scripts/bootstrap/bootstrap-popover.js', '/scripts/bootstrap/bootstrap-select/bootstrap-select.js', '/scripts/bootstrap/bootstrap-tour/bootstrap-tour.min.js', '/scripts/bootstrap/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js', '/scripts/bootstrap/bootstrap-datetimepicker/js/bootstrap-datetimepicker.fr.js', '/scripts/bootstrap/bootstrap-datetimepicker/js/bootstrap-datetimepicker-fix-prototypejs-conflict.js', '/scripts/jscrollpane/jquery.mousewheel.js', '/scripts/jscrollpane/jquery.jscrollpane.min.js', '/scripts/select2/select2.min.js', '/scripts/vendor/at/js/caret.min.js', '/scripts/vendor/at/js/atwho.min.js', '/scripts/viewportchecker/viewport-checker.js', '/scripts/clamp.js', '/scripts/codendi/common.js', '/scripts/tuleap/massmail_initialize_ckeditor.js', '/scripts/tuleap/is-at-top.js', '/scripts/tuleap/get-style-class-property.js', '/scripts/tuleap/listFilter.js', '/scripts/codendi/feedback.js', '/scripts/codendi/CreateProject.js', '/scripts/codendi/cross_references.js', '/scripts/codendi/Tooltip.js', '/scripts/codendi/Toggler.js', '/scripts/codendi/LayoutManager.js', '/scripts/codendi/DropDownPanel.js', '/scripts/codendi/colorpicker.js', '/scripts/autocomplete.js', '/scripts/textboxlist/multiselect.js', '/scripts/tablekit/tablekit.js', '/scripts/lytebox/lytebox.js', '/scripts/lightwindow/lightwindow.js', '/scripts/codendi/RichTextEditor.js', '/scripts/codendi/Tracker.js', '/scripts/codendi/TreeNode.js', '/scripts/tuleap/tuleap-modal.js', '/scripts/tuleap/tuleap-tours.js', '/scripts/tuleap/tuleap-standard-homepage.js', '/scripts/placeholder/jquery.placeholder.js', '/scripts/tuleap/datetimepicker.js', '/scripts/tuleap/svn.js', '/scripts/tuleap/account-maintenance.js', '/scripts/tuleap/search.js', '/scripts/tuleap/tuleap-mention.js', '/scripts/tuleap/project-privacy-tooltip.js', '/scripts/tuleap/massmail_project_members.js', '/scripts/tuleap/manage-allowed-projects-on-resource.js', '/scripts/admin/system_events.js');
EventManager::instance()->processEvent(Event::COMBINED_SCRIPTS, array('scripts' => &$arr));
$arr[] = '/scripts/d3/d3.min.js';
//last - incompatible with IE7
return $arr;
}
示例14: save
public function save(Tracker_Permission_PermissionRequest $request, Tracker_Permission_PermissionSetter $permission_setter)
{
$tracker = $permission_setter->getTracker();
if ($this->checkPermissionValidity($request, $tracker)) {
$this->getChainOfResponsability()->apply($request, $permission_setter);
EventManager::instance()->processEvent(TRACKER_EVENT_TRACKER_PERMISSIONS_CHANGE, array('tracker' => $tracker));
}
}
示例15: getContent
public function getContent()
{
$pane = null;
EventManager::instance()->processEvent(AGILEDASHBOARD_EVENT_INDEX_PAGE, array('milestone' => $this->milestone, 'user' => $this->user, 'pane' => &$pane, 'milestone_factory' => $this->milestone_factory));
if ($pane) {
return $pane->getMinimalContent();
}
return '';
}