<?php

    include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
    include_once( PLOG_CLASS_PATH."class/plugin/pluginmanager.class.php" );
    
    class AdminEventListView extends AdminPluginTemplatedView
    {
    
        var $_currentEvents;
    
        function AdminEventListView( $blogInfo, $currentEvents = Array())
        {
            $this->AdminPluginTemplatedView( $blogInfo, "adminnotifier", "eventlist" );
            
            $this->_currentEvents = $currentEvents;
        }
        
        function render()
        {
            // get a list with the defined events
            $events = PluginManager::getDefinedEvents();
            $this->setValue( "events", $events );
            
            // and now a list with the events that should trigger notifications
            $config =& Config::getConfig();
            $currentEvents = $config->getValue( "plugin_adminnotifier_events", Array());
            if( !is_array( $currentEvents ))
                $currentEvents = Array();
            $this->setValue( "currentEvents", $currentEvents );
        
            // finally, render the view
            parent::render();
        }
    }
?>