RecentChanges
  FrontPage
TitleIndex  |  RecentChanges
 

Chat


Chat macro/action...
moovtree : Mokko



[[Chat(Chat)]] 를 열고... 다음 두 화일 추가..

macro/Chat.py
import sys, string, re, cStringIO
from MoinMoin import user
from MoinMoin.Page import Page
from MoinMoin.i18n import _
from MoinMoin import wikiutil
from MoinMoin import config, webapi
import cgi



def execute(macro, text):
    ret = '<form method="POST" action="%s/%s">'%(webapi.getScriptname(), cgi.escape(text, 1))
    ret = ret + '<input type="hidden" name="action" value="Chat">'
    ret = ret + '<input style="font-family:Verdana; font-size:9pt;" type="text" name="text_title" value="" size="80" maxlength="400">'
    ret = ret + '<input type="image" src="/img/moin-search.gif" name="button_title"  alt="[?]" hspace="3" width="12" height="12" border="0">'
    ret = ret + '</form>'
    return ret 

action/Chat.py
import string, sys, os
from MoinMoin import config, wikiutil, webapi, wikiaction
from MoinMoin.PageEditor import PageEditor
from MoinMoin.i18n import _
from time import strftime, gmtime


def execute(pagename, request):

    form = request.form
    if request.form.has_key("text_title"):
        text = request.form["text_title"].value
    else:
        text = "Mokko"

    chat = PageEditor(pagename)
    if config.edit_requires_login and ( not user.current.valid ) :
        chat.send_page(form,msg='<strong>%s</strong>' % user.current.text('<b>Please <a href="UserPreferences">log in</a> before Chat</b>'))
        return

    body = chat.get_raw_body()
    body = body + "'''" +request.user.name+ "'''" +" : "+text + "\n\n"
    chat.save_text(request, body, "0")
    chat.send_page(request)



Powered by MoniWiki
xhtml1 | css2 | rss