<?php

    include_once( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
    include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );

    include_once( PLOG_CLASS_PATH."plugins/currentlyaddictedto/class/dao/cat_item.class.php" );

    foreach (glob(PLOG_CLASS_PATH . "/plugins/currentlyaddictedto/class/dao/cat_*.php") as $filename) {
        include_once($filename);
    }

    class PluginCurrentlyaddictedtoSelectAction extends AdminAction {

       
        function PluginCurrentlyaddictedtoSelectAction( $actionInfo, $request ) {
            $this->AdminAction( $actionInfo, $request );
        }
        
        function perform() {
            // create a view and export the settings to the template
            $this->_view = new AdminPluginTemplatedView( $this->_blogInfo, "currentlyaddictedto", "select", true );

            foreach (glob(PLOG_CLASS_PATH . "/plugins/currentlyaddictedto/class/dao/cat_*.php") as $filename) {
                $className = "CAT_" . ucfirst(str_replace('cat_', '', basename(str_replace('.class.php', '', $filename))));
                if($className != 'CAT_Item') {
                    eval("\$item = new $className();");
                    $banners[$className] = $item->getBanner();
                }
            }

            $this->_view->setValue("banners", $banners);
            
            $this->setCommonData();
            
            return true;
        }
}
?>