require('strict')localyesno=require('Module:Yesno')localmakeMessageBox=require('Module:Message box').mainlocalgetArgslocalactiveBox-- lazily initialized if we get an active request------------------------------------------------------------------------ Box class definition----------------------------------------------------------------------localbox={}box.__index=boxfunctionbox.new(protectionType,args)localobj={}setmetatable(obj,box)obj.tmboxArgs={}-- Used to store arguments to be passed to tmbox by the box:export method.-- Set data fields.obj.tmboxArgs.attrs={['data-origlevel']=protectionType}returnobjendfunctionbox:setArg(key,value)-- This sets a value to be passed to tmbox.ifkeythenself.tmboxArgs[key]=valueendendfunctionbox:export()ifnotmw.title.getCurrentTitle().isTalkPageandnotself.demothenreturn'<span class="error">錯誤:保護頁面編輯請求僅能在討論頁提出。</span>[[Category:有編輯請求模板的非討論頁面]]'endself:setArg('smalltext',"本次[[Wikipedia:編輯請求|編輯請求]]已得到回應。請將 <code style=\"white-space: nowrap;\">|answered=</code> 或 <code style=\"white-space: nowrap;\">|ans=</code> 參數刪除來重啟您的請求。")self:setArg('small',true)self:setArg('class','editrequest')returnmakeMessageBox('tmbox',self.tmboxArgs)end------------------------------------------------------------------------ Process arguments and initialise objects----------------------------------------------------------------------localp={}functionp._main(protectionType,args)localboxType=boxifnotyesno(args.answeredorargs.ans,true)thenifnotactiveBoxthenactiveBox=require('Module:Protected edit request/active')(box,yesno,makeMessageBox)endboxType=activeBoxendlocalrequestBox=boxType.new(protectionType,args)returnrequestBox:export()endlocalmt={}functionmt.__index(t,k)ifnotgetArgsthengetArgs=require('Module:Arguments').getArgsendreturnfunction(frame)returnt._main(k,getArgs(frame,{wrappers={'Template:Editprotected'}))endendreturnsetmetatable(p,mt)