ARAGO for Internet Wiki Project AkuAku

This web site is powered by Arago for Internet v7.0 UTF-8 edition on FreeBSD
SPC main menu Expand/Fold
Products 取扱商品 Expand/Fold
SouthWind  Expand/Fold
Q&A Technical support Expand/Fold
BBS 掲示板 Expand/Fold
Easy PC life Expand/Fold

Last Edit Date: 06/05/2008
編集メニューの解説

基本的な部分はindexプログラムと同じです。 異なるところのみ解説します。
表示されるメニュー項目は、AUTHで確認したクライアントの権限により、必要なものを表示する。

編集メニューの画面

#!/usr/local/aragoi/aragoi.exe editmenu.prg
THISPAGE = "editmenu"
THISPAGETITLE = "AkuAku menu selection edit"
AUTHOR = "Southern Pacific Computer Inc."
WEBURL = "www.soupacific.com" && web url for  favicon
SUBDIR = "" && ""  "en/" "tch/" "sch/"
CGINAME ="akuaku/"
HOMEPAGE ="index.prg"
*******ordinary basic setting
SET COMPATIBLE OFF
SET LANGUAGE TO UTF8
SET DATE TO ANSI
SET CENTURY ON
SET DELETE ON
****Get premade FORM data
B1FORM= GETFORM("B1")
G1FORM= GETFORM("group1")
S1FORM= GETFORM("Selection1")
USERIP =GETENV("REMOTE_ADDR")
&&language info, we select proper language page from db
REMOTELANG  =GETENV("HTTP_ACCEPT_LANGUAGE")
DATE=DATE()
CTIME = TIME()
**********pass page info***********
&&using this for security, where this call came and also set return page to
toppage = HOMEPAGE &&top page is named as index.prg
gparents = GETFORM("parents")
parents = GETFORM("mypage")
mypage = thispage
コメント行はデバッグ用のデータの残り
&&following values are passed by upper program which called this
&&parents = "index" &&debug
&&name = "debug" &&debug
&&SUPERUSER = .T. &&debug
&&value S1FORM will be passed too
&&B1FORM = "GO"
&&G1FORM = "movesmen"
***********************************
***********************************************
***protect nobody can call this through upper page auth
***********************************************
このページを呼び出したページでの認証を見ています。 変数parentsが空白だとindexページを表示して終了します。

IF EMPTY(parents)
    DO rewrite2.prg with "index"
    RETURN
ENDIF
***********************************************
IF B1FORM = "GO"
    IF G1FORM= "create"
        DO rewrite2.prg with "createpage"                 <-ページの新規作成
    ELSEIF G1FORM= "medit"
        DO rewrite2.prg with "medit"                        <- ページの本文編集
    ELSEIF G1FORM = "ledit"                             
        DO rewrite2.prg with "ledit"                           <- 左メニューの編集
    ELSEIF G1FORM = "redit"
        DO rewrite2.prg with "redit"                           <- 右メニューの編集
    ELSEIF G1FORM = "pedit"
        DO rewrite2.prg with "pedit"                           <- ページソースプログラムの編集
    ELSEIF G1FORM = "bedit"
        DO rewrite2.prg with "bedit"                           <- 下部の表示データの編集
    ELSEIF G1FORM = "password"
        DO rewrite2.prg  with "password"                  <-   パスワードの編集
    ELSEIF G1FORM = "sedit"
        DO rewrite2.prg with "sedit"                           <- スケルトンソースプログラムの編集
    ELSEIF G1FORM = "pdelete"
        DO rewrite2.prg with "pdelete"                        <- ページの削除
    ELSEIF G1FORM = "mdelete"                          
        DO rewrite2.prg with "mdelete"                        <- メニュからの削除
    ELSEIF G1FORM = "recover"
        DO rewrite2.prg with "recover"                        <- 削除ページの回復
    ELSEIF G1FORM = "chmode"
        DO rewrite2.prg with "mode"                           <- ページのモードの編集
    ELSEIF G1FORM = "mmorder"
        DO rewrite2.prg with "mmorder"                     <- メインメニューの順番の変更
    ELSEIF G1FORM = "submenu"
        DO rewrite2.prg with "submenu"                     <- サブメニューの順番の変更
    ELSEIF G1FORM = "movesmen"                    
        DO rewrite2.prg with "movesmen"                  <- サブメニューを別のメインメニューに移動
        ENDIF
    RETURN
ELSEIF B1FORM = "title"
    DO rewrite2.prg with "title"                                 <- ページタイトルの変更
ELSEIF B1FORM = "content"
    DO rewrite2.prg with "content"                           <- not used
ENDIF
USE content INDEX pagename, laccess, topmenu ALIAS maindb
**master index is PAGENAME
**Locate right record
IF .NOT. SEEK(THISPAGE)
  OUTPUT('Content-type: text/html;CHARSET=utf-8 ')
  OUTPUT("",1)
  OUTPUT("",1)
  OUTPUT("page not found")
  RETURN
ENDIF

&&open database with inde  index on time
&&use temp index temp
*****for giving happiness for Apache 2.x cgi
OUTPUT('Content-type: text/html;CHARSET=utf-8 ')
OUTPUT("",1)
OUTPUT("",1)
OUTPUT('<html>',2) &&here we need carriage return
OUTPUT("<HEAD>")
OUTPUT('<meta name="Robots" content="All">')
OUTPUT('<meta http-equiv="Content-Type" content="text/html; charset=utf-8">')
*****web name, page title set in above
OUTPUT('<meta name="author" content="' + AUTHOR  + '">')
OUTPUT('<link rel="SHORTCUT ICON" href="http://' + WEBURL + '/favicon.ico">')
OUTPUT("<TITLE>" + THISPAGETITLE + "</TITLE>")
****need to set location for css file and javascript file
OUTPUT('<link rel="stylesheet" type="text/css" href="http://' + WEBURL + '/spcneat.css" />') && for css link
OUTPUT('<script src="http://' + WEBURL + '/spcneat.js"></script></HEAD>') && for javascript link
**********end of head
OUTPUT('<body class="spc_wiki">')
**Show project name
OUTPUT('<TABLE BORDER="1" CELLSPACING="1" WIDTH="100%" HEIGHT="24"><TR>')
OUTPUT('<TD WIDTH="100%" VALIGN="MIDDLE" BGCOLOR="#FFFF00"><H3 ALIGN="CENTER">ARAGO for Internet Wiki Project AkuAku</H3></TD></TR></TABLE>')
** define FORM action
OUTPUT('<FORM NAME = "' + THISPAGE + '" ACTION="http://' + WEBURL + '/'+ CGINAME  + SUBDIR +  'rewrite.prg?' + THISPAGE  + '" METHOD="POST" ENCTYPE="application/x-www-form-urlencoded">')

*************send parents information
OUTPUT('<INPUT TYPE="HIDDEN" NAME="parents" VALUE="'+ parents + '">')
OUTPUT('<INPUT TYPE="HIDDEN" NAME="mypage" VALUE="'+ mypage + '">')
OUTPUT('<INPUT TYPE="HIDDEN" NAME="username" VALUE="'+ name + '">')
OUTPUT('<INPUT TYPE="HIDDEN" NAME="selection" VALUE="'+ S1FORM + '">')
*************
**top site header
OUTPUT('<div id="siteheader">')
*** first header table
output('<div style="padding: 0pt 10px; background-color: rgb(34, 34, 34); color: rgb(255, 255, 255); font-weight: bold; font-size: 12px;"><b style="float: right; color: rgb(51, 255, 0);">Commercial Software is ALSO good for you</b>')
OUTPUT('<a href="http://' + WEBURL + '/" style="color: rgb(255, 255, 255); text-decoration: none;">Southern Pacific Computer Inc. </a> </div></div>')
OUTPUT('<div id="spc-top">This web site is powered by Arago for Internet v7.0 UTF-8  edition on FreeBSD </div>')
** end header table

OUTPUT('<tbody>') && starting body
 
************************************
OUTPUT('<div id="spc-mid"><table id="spc-midtbl" border="0" cellpadding="0" cellspacing="0"> ')
&&show button to write & save
output(' <td id="centercolumn" valign="top"> <div id="spc-center">')
OUTPUT('<P><h1>Select what you want </h1></p><BR>')
OUTPUT('<P><h3>Currently editing by:' + name + '  ip: ' + USERIP + '   ' + DTOC(DATE) + '  ' + CTIME + '</h3></p><BR>')
OUTPUT('<FONT COLOR="#0066FF"><B>Current Page is :' + PARENTS + '</B></FONT><br></P>')
OUTPUT('<FONT COLOR="#0066FF"><B><br>Please select what protion to edit or create new page ?</B></FONT></P>')
OUTPUT('NEED to work to selecxt follwoing selection upon account security level')
OUTPUT('<div align="left">')
OUTPUT('<hr><input type="radio" name="group1" value="create" checked>Create new page<br>')
OUTPUT('<input type="radio" name="group1" value="medit" >edit content<br>')
IF SUPERUSER = .T.
  OUTPUT('<input type="radio" name="group1" value="ledit">edit left menu<br>')
  OUTPUT('<input type="radio" name="group1" value="redit">edit right menu<br>')
  OUTPUT('<input type="radio" name="group1" value="bedit">edit bottom<br>')
  OUTPUT('<input type="radio" name="group1" value="pedit">edit this page program<br> ')
  IF toppage <> parents && nobody can delete toppage !!
    OUTPUT('<input type="radio" name="group1" value="pdelete">delete this page<br> ')
    OUTPUT('<input type="radio" name="group1" value="mdelete">delete this page from menu<br>')
    OUTPUT('<input type="radio" name="group1" value="chmode">change display mode<br>')
  ENDIF
  OUTPUT('<input type="radio" name="group1" value="recover">Recover deleted page<br>')
  OUTPUT('<input type="radio" name="group1" value="sedit">edit system files<br> ')
     OUTPUT('<BR><TABLE BORDER="1" CELLSPACING="1" WIDTH="100%" HEIGHT="24"><TR>')
     OUTPUT('<TD WIDTH="100%" >')
     OUTPUT('<BR><FONT COLOR="#0066FF"><B><H3 ALIGN="CENTER">AkuAku Menu manager')

    OUTPUT(' <BR>     Select Mainmenu ( which Submenu belongs to )</FONT></B><SELECT NAME="SELMAINMENU"></H3> ')
    OUTPUT('<OPTION SELECTED>Select MainMenu</OPTION>')

    SELECT 5
    USE menuorder
    GO TOP

    DO WHILE .NOT. EOF()    
        IF DELETED = .F.
            OUTPUT('<OPTION >' + RTRIM(MENUTITLE)  +'</OPTION>')
        ENDIF    
        SKIP
    ENDDO    
    
    USE


    OUTPUT('</SELECT><br>')

    OUTPUT('<div align="left">')
    OUTPUT('<table> <tr><td>')
    OUTPUT('<hr><input type="radio" name="group1" value="mmorder" >Change MainMenu Order <br>')
    OUTPUT('</tr></td><tr><td>')
    OUTPUT('<input type="radio" name="group1" value="submenu" >Change Submenu order in same Mainmenu <br></tr></td><tr><td>')

    OUTPUT('<input type="radio" name="group1" value="movesmen">Move Submenu to under other Mainmenu<br>')
    OUTPUT('</tr></td>')
    OUTPUT('<tr><td>')

    OUTPUT('<input type="radio" name="group1" value="redit">Move Mainmenu to under other Mainmenu')
    OUTPUT('<FONT COLOR="#FF0000"><B> not yet support </B></FONT><br>')
    OUTPUT('</tr></td></table>')
    OUTPUT('</TD></TR></TABLE>')  
ENDIF
OUTPUT('<BR><input type="radio" name="group1" value="password">Manage password<br>')
OUTPUT('<BR><span style=text-align: right;><INPUT TYPE="submit"name="B1" VALUE="GO"></span><hr>')

OUTPUT('<br></div>')
OUTPUT('<td id="rightcolumn" valign="top"><div class="box box-upcoming_events"><div class="box-title"> <table class="box-title"> <tbody> <tr><td><span class="box-titletext">Advertisement</span></td>')
OUTPUT('<td width="11"><a title="Advertisement"  href="javascript: toggle(' + "'right_box'" + ');"><img src="http://' + WEBURL + '/tree.jpg" width=12 height=12 border=0 alt="Expand/Fold"> </a></td> </tr></tbody> </table></div>')
OUTPUT('<div id="right_box" style="display: block;" class="box-data">' + maindb->RMTXT + '</div>')
OUTPUT('</div></tr></tbody></table></div>')
OUTPUT('</tr></tbody></table></div>')
IF maindb->BOTTOM = .T.
  OUTPUT('<div id="spc-bot">')
  OUTPUT('<small>' + maindb->BMTXT + '</small></div>')
ENDIF
OUTPUT('</DIV></FORM></HTML>')
*********end all html process********

***** each procedure start
Advertisement Expand/Fold