<?php



class UserMonitor extends CWidget
{
    public function run()
    {
        $users = app()->user->sudoUserInstance->getMonitorUsers();
        usort($users, 'userSort');
        $this->render('baseWindow', array('users'=>$users));
    }
    
    public function render($view, $data=null, $return=false)
    {
        if(app()->controller->showMobileVersion) {
            $view = "mobile_$view";
        }
        return parent::render($view, $data, $return);
    }
}




function userSort($a, $b) {
    return (int)$a->extension == (int)$b->extension ? 0 : ((int)$a->extension > (int)$b->extension) ? 1 : -1;
}
?>
