⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 manager.pm

📁 codestriker is a develop useful tool to review code on web user interface.
💻 PM
字号:
################################################################################ Codestriker: Copyright (c) 2001, 2002 David Sitsky.  All rights reserved.# sits@users.sourceforge.net## This program is free software; you can redistribute it and modify it under# the terms of the GPL.# Object to create and call all of the lister objects.use strict;package Codestriker::TopicListeners::Manager;use Codestriker::TopicListeners::Email;use Codestriker::TopicListeners::BugTracking;use Codestriker::TopicListeners::HistoryRecorder;my @topic_listeners;sub topic_pre_create {    _create_listeners();    # Call all of the topic listeners that are created. If any of the    # topic listeners return a non-empty string, it is treated as a    # request to reject the creation of the new topic.  Display the    # returned string as the user error message.    my $returnValue = '';    foreach my $listener (@topic_listeners) {        $returnValue .= $listener->topic_pre_create(@_);        last if length($returnValue);    }    return $returnValue;}sub topic_create {    _create_listeners();    # Call all of the topic listeners that are created. If any of the    # topic listeners return a non-empty string, it is treated as a    # request to reject the requested state change, and display the    # returned string as the user error message.    my $returnValue = '';    foreach my $listener (@topic_listeners) {        $returnValue .= $listener->topic_create(@_);        last if length($returnValue);    }    return $returnValue;}sub topic_pre_changed {    _create_listeners();    # Call all of the topic listeners that are created. If any of the    # topic listeners return a non-empty string, it is treated as a    # request to reject the requested state change, and display the    # returned string as the user error message.    my $returnValue = '';    foreach my $listener (@topic_listeners) {        $returnValue .= $listener->topic_pre_changed(@_);        last if length($returnValue);    }    return $returnValue;}sub topic_changed {    _create_listeners();    # Call all of the topic listeners that are created. If any of the    # topic listeners return a non-empty string, it is treated as a    # request to reject the requested state change, and display the    # returned string as the user error message.    my $returnValue = '';    foreach my $listener (@topic_listeners) {        $returnValue .= $listener->topic_changed(@_);        last if length($returnValue);    }    return $returnValue;}sub topic_viewed {    _create_listeners();    # Call all of the topic listeners that are created. If any of the    # topic listeners return a non-empty string, it is treated as a    # request to reject the requested state change, and display the    # returned string as the user error message.    my $returnValue = '';    foreach my $listener (@topic_listeners) {        $returnValue .= $listener->topic_viewed(@_);        last if length($returnValue);    }    return $returnValue;}sub comment_create {    _create_listeners();    # Call all of the topic listeners that are created. If any of the    # topic listeners return a non-empty string, it is treated as a    # request to reject the requested state change, and display the    # returned string as the user error message.    my $returnValue = '';    foreach my $listener (@topic_listeners) {        $returnValue .= $listener->comment_create(@_);        last if length($returnValue);    }    return $returnValue;}sub comment_state_change {    _create_listeners();    # Call all of the topic listeners that are created. If any of the    # topic listeners return a non-empty string, it is treated as a    # request to reject the requested state change, and display the    # returned string as the user error message.    my $returnValue = '';    foreach my $listener (@topic_listeners) {        $returnValue .= $listener->comment_state_change(@_);        last if length($returnValue);    }    return $returnValue;}# Private function to create all of the listener objects, and stuff# them into module variable @topic_listeners.sub _create_listeners {    if (scalar(@topic_listeners) == 0) {        push @topic_listeners,          Codestriker::TopicListeners::BugTracking->new();        push @topic_listeners,          Codestriker::TopicListeners::Email->new();        push @topic_listeners,          Codestriker::TopicListeners::HistoryRecorder->new();    }}1;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -