<?php
class Plugg_User_Main_Identity_Friend_Index extends Sabai_Application_Controller
{
    protected function _doExecute(Sabai_Application_Context $context)
    {
        if ($tab_id = $context->plugin->isTabActive($context->plugin->getName(), 'friends')) {
            $identity = $this->_parent->getRequestedUserIdentity($context);
            $context->response->setSuccess(null, array('base' => '/user', 'path' => '/' . $identity->getId(), 'params' => array('tab_id' => $tab_id)));
            return;
        }
        $context->response->setError($context->plugin->_('Invalid request'), array('base' => '/'));
        return;
    }
}