public function setUp() { parent::setUp(); PluginManager::instance()->invalidateCache(); PluginFactory::clearInstance(); $this->old_globals = $GLOBALS; $GLOBALS['feedback'] = ''; $GLOBALS['svn_prefix'] = '/tmp'; $GLOBALS['cvs_prefix'] = '/tmp'; $GLOBALS['grpdir_prefix'] = '/tmp'; $GLOBALS['ftp_frs_dir_prefix'] = '/tmp'; $GLOBALS['ftp_anon_dir_prefix'] = '/tmp'; $GLOBALS['sys_default_domain'] = ''; $GLOBALS['sys_cookie_prefix'] = ''; $GLOBALS['sys_force_ssl'] = 0; ForgeConfig::store(); $this->old_sys_pluginsroot = $GLOBALS['sys_pluginsroot']; $this->old_sys_custompluginsroot = $GLOBALS['sys_custompluginsroot']; $GLOBALS['sys_pluginsroot'] = dirname(__FILE__) . '/../../plugins/'; $GLOBALS['sys_custompluginsroot'] = "/tmp"; ForgeConfig::set('tuleap_dir', __DIR__ . '/../../'); ForgeConfig::set('codendi_log', "/tmp/"); /** * HACK */ require_once dirname(__FILE__) . '/../../plugins/fusionforge_compat/include/fusionforge_compatPlugin.class.php'; $ff_plugin = new fusionforge_compatPlugin(); $ff_plugin->loaded(); PluginManager::instance()->installAndActivate('mediawiki'); $plugin = PluginManager::instance()->getPluginByName('mediawiki'); EventManager::instance()->addListener(Event::IMPORT_XML_PROJECT, $plugin, 'importXmlProject', false); EventManager::instance()->addListener('register_project_creation', $plugin, 'register_project_creation', false); EventManager::instance()->addListener(Event::SERVICES_ALLOWED_FOR_PROJECT, $plugin, 'services_allowed_for_project', false); putenv('TULEAP_LOCAL_INC=' . dirname(__FILE__) . '/_fixtures/local.inc'); }
function __construct($id = 0) { $this->Plugin($id); $this->name = "mediawiki"; $this->text = "Mediawiki"; // To show in the tabs, use... $this->_addHook("groupmenu"); // To put into the project tabs $this->_addHook("groupisactivecheckbox"); // The "use ..." checkbox in editgroupinfo $this->_addHook("groupisactivecheckboxpost"); // $this->_addHook("project_public_area"); $this->_addHook("role_get"); $this->_addHook("role_normalize"); $this->_addHook("role_translate_strings"); $this->_addHook("role_has_permission"); $this->_addHook("role_get_setting"); $this->_addHook("list_roles_by_permission"); $this->_addHook("project_admin_plugins"); // to show up in the admin page for group $this->_addHook("clone_project_from_template"); $this->_addHook('group_delete'); $this->_addHook('cssfile'); $this->addHook(Event::SERVICE_ICON); $this->addHook(Event::SERVICES_ALLOWED_FOR_PROJECT); $this->addHook(Event::PROCCESS_SYSTEM_CHECK); $this->addHook('permission_get_name'); $this->_addHook('service_is_used'); $this->_addHook('register_project_creation'); $this->_addHook(Event::SERVICE_REPLACE_TEMPLATE_NAME_IN_LINK); $this->_addHook(Event::RENAME_PROJECT, 'rename_project'); $this->_addHook(Event::GET_SYSTEM_EVENT_CLASS, 'getSystemEventClass'); $this->_addHook(Event::SYSTEM_EVENT_GET_TYPES_FOR_DEFAULT_QUEUE); //User permissions $this->_addHook('project_admin_remove_user'); $this->_addHook('project_admin_change_user_permissions'); $this->_addHook('SystemEvent_USER_RENAME', 'systemevent_user_rename'); $this->_addHook('project_admin_ugroup_remove_user'); $this->_addHook('project_admin_remove_user_from_project_ugroups'); $this->_addHook('project_admin_ugroup_deletion'); $this->_addHook(Event::HAS_USER_BEEN_DELEGATED_ACCESS, 'has_user_been_delegated_access'); $this->addHook(Event::IS_SCRIPT_HANDLED_FOR_RESTRICTED); $this->addHook(Event::GET_SERVICES_ALLOWED_FOR_RESTRICTED); // Search $this->addHook(Event::LAYOUT_SEARCH_ENTRY); $this->addHook(Event::SEARCH_TYPES_PRESENTERS); $this->addHook(Event::SEARCH_TYPE); $this->_addHook('plugin_statistics_service_usage'); $this->addHook(Event::SERVICE_CLASSNAMES); $this->addHook(Event::GET_PROJECTID_FROM_URL); // Stats plugin $this->addHook('plugin_statistics_disk_usage_collect_project'); $this->addHook('plugin_statistics_disk_usage_service_label'); $this->addHook('plugin_statistics_color'); // Site admin link $this->_addHook('site_admin_option_hook', 'site_admin_option_hook', false); $this->addHook(Event::PROJECT_ACCESS_CHANGE); $this->addHook(Event::SITE_ACCESS_CHANGE); /** * HACK */ require_once MEDIAWIKI_BASE_DIR . '/../../fusionforge_compat/include/fusionforge_compatPlugin.class.php'; $ff_plugin = new fusionforge_compatPlugin(); $ff_plugin->loaded(); }
* but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Tuleap. If not, see <http://www.gnu.org/licenses/ */ require_once 'pre.php'; require_once dirname(__FILE__) . '/../include/MediawikiAdminController.class.php'; require_once dirname(__FILE__) . '/../include/MediawikiSiteAdminController.class.php'; /** * HACK */ require_once MEDIAWIKI_BASE_DIR . '/../../fusionforge_compat/include/fusionforge_compatPlugin.class.php'; $ff_plugin = new fusionforge_compatPlugin(); $ff_plugin->loaded(); $vWhiteList = new Valid_WhiteList('action', array('save', 'index', 'site_index', 'site_update_allowed_project_list')); $vWhiteList->required(); $action = $request->getValidated('action', $vWhiteList, 'index'); switch ($action) { case 'index': case 'save': $service = $request->getProject()->getService('plugin_mediawiki'); $controller = new MediawikiAdminController(); $controller->{$action}($service, $request); break; case 'site_index': case 'site_update_allowed_project_list': $controller = new MediawikiSiteAdminController(); $controller->{$action}($request); break;