Some problems with my plugin
Posted: Mon Oct 23, 2006 7:52 pm
Hi. I`m stating to write my first plugin- currently, I`m studying http://s9y.org/43.html that document, and looking on staticpages plugin. My problem is -howto write engine, that display me some content in ACP- curently, i`ve got something like this
but http://localhost/seren/serendipity_admi ... newsletter that link (and any other) didn`t output any effect :/
Could someone help me?
Code: Select all
function event_hook($event, &$bag, &$eventData, $addData = null) {
global $serendipity;
$hooks = &$bag->get('event_hooks');
if (isset($hooks[$event])) {
switch ($event) {
case 'backend_sidebar_entries':
echo '<li><a href="?serendipity[adminModule]=event_display&serendipity[adminAction]=newsletter">' . PLUGIN_NEWSLETTER_ADMIN . '</a></li>';
break;
case 'backend_sidebar_entries_event_display_newsletter':
$this->showBackend();
break;
}
}
}
function showBackend(){
global $serendipity;
$spcat = !empty($serendipity['GET']['action']) ? $serendipity['GET']['action'] : $serendipity['POST']['action'];
switch($spcat) {
case 'something':
echo 'it works';
break;
case 'other':
default:
echo 'it works, too :)';
break;
}
}
Could someone help me?