3 * StatusNet - the distributed open-source microblogging tool
4 * Copyright (C) 2009, StatusNet, Inc.
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 * @package SamplePlugin
22 * @maintainer Your Name <you@example.com>
25 if (!defined('STATUSNET') && !defined('LACONICA')) {
26 // This check helps protect against security problems;
27 // your code file can't be executed directly from the web.
31 class SamplePlugin extends Plugin
33 function onInitializePlugin()
35 // Event handlers normally return true to indicate that all is well.
37 // Returning false will cancel further processing of any other
38 // plugins or core code hooking the same event.
43 * Hook for RouterInitialized event.
45 * @param Net_URL_Mapper $m path-to-action mapper
46 * @return boolean hook return
49 function onRouterInitialized($m)
51 $m->connect(':nickname/samples',
52 array('action' => 'showsamples'),
53 array('feed' => '[A-Za-z0-9_-]+'));
54 $m->connect('settings/sample',
55 array('action' => 'samplesettings'));