<?php
/**
 * @version $Id: Myuploader_Imagemanager.class.php 679 2012-08-20 12:41:35Z hodaka $
 */

if (!defined('XOOPS_ROOT_PATH')) exit();

class Myuploader_Imagemanager extends XCube_ActionFilter
{
    /**
     * @public
     */
    function preBlockFilter()
    {
        $root = XCube_Root::getSingleton();
//      if ($root->mContext->mUser->isInRole('Site.RegisteredUser')) {
            $root = XCube_Root::getSingleton();
            $root->mDelegateManager->add('Module.myuploader.Event.Imagemanager', 'Myuploader_Imagemanager::imagemanager');
//      }
    }

    /**
     * @private
     */
    function imagemanager() {
        $root = XCube_Root::getSingleton();
        $target = $root->mContext->mRequest->getRequest('target');
        $category_id = $root->mContext->mRequest->getRequest('category_id');
        $ruri = '';
        if(!empty($category_id)) {
            $ruri .= '&category_id='.intval($category_id);
        }
        $root->mController->executeForward(XOOPS_MODULE_URL.'/myuploader/index.php?op=ImageBoard&target='.$target.$ruri);
    }

}

?>