예제 #1
0
        $m->microtime = microtime(true);
        $m->store();
        $page->setMimeType('text/plain');
        echo 'OK';
        break;
    case 'show':
        // child = room id
        $cr = ChatRoom::get($this->child);
        echo '<h2>Chat in ' . $cr->name . '</h2>';
        if ($cr->locked_by) {
            echo 'The chatroom is locked!';
            return;
        }
        $div_name = 'chatroom_txt';
        $form_id = 'chatfrm';
        ChatRoomUpdater::init($this->child, $div_name, $form_id);
        $css = 'width:500px;' . 'height:300px;' . 'background-color:#eee;' . 'overflow:auto;';
        echo '<div id="' . $div_name . '" style="' . $css . '"></div>';
        $form = new XhtmlForm();
        $form->setId($form_id);
        $form->addInput('msg', $session->username . ':', '', 445);
        $form->setFocus('msg');
        $form->disableAutocomplete();
        echo $form->render();
        YuiTooltip::init();
        echo UserLink::render(27, "martin") . ' ';
        echo UserLink::render(32, "kotte");
        break;
    default:
        echo 'No handler for view ' . $this->owner;
}