</tr>
<% db.transaction do
entry = nil
- db["entry"].each_with_index { |e, i|
- entry = db["entry"][i] if e.entryid == session["delid"]
+ session["entry"].each_with_index { |e, i|
+ entry = session["entry"][i] if e.entryid == session["delid"]
}
entry.paramlist.each do |val| %>
<tr style="display: <%= entry.display[val] %>;">
最終更新時間
</td>
</tr>
- <% db["entry"].each_with_index do |entry, i| %>
+ <% session["entry"].each_with_index do |entry, i| %>
<tr>
<td class="forminput" style="width: 30px; text-align: center;">
<input type="radio" name="delid" value="<%= entry.send("entryid") %>">
</tbody>
</table>
<br>
- <% if db["entry"].length != 0 %>
+ <% if session["entry"].length != 0 %>
<input type="hidden" name="mode" value="delentry"><input type="hidden" name="action" value="confirm"><input type="submit" value="確認"><% else %>
削除対象となる記事が存在しません。
<br>
</td>
</tr>
<% db.transaction do
- entry = db["editentry"]
+ entry = session["editentry"]
entry.paramlist.each do |val| %>
<tr style="display: <%= entry.display[val] %>;">
<td class="formnavi" style="width: 140px;">
<%= entry.name[val] %>
</td>
<td class="forminput">
- <% if val != "content" %><%= entry.send(val) %><% else %><%= entry.content_for_view %><% end %>
+ <input type="hidden" name="<%= val %>" value="<%= entry.send(val) %>"><% if val != "content" %><%= entry.send(val) %><% else %><%= entry.content_for_view %><% end %>
</td>
</tr>
<% end %>
</tr>
<% db.transaction do
entry = nil
- db["entry"].each_with_index { |e, i|
- entry = db["entry"][i] if e.entryid == session["editid"]
+ session["entry"].each_with_index { |e, i|
+ entry = session["entry"][i] if e.entryid == session["editid"]
}
entry.paramlist.each do |val| %>
<tr style="display: <%= entry.display[val] %>;">
</td>
</tr>
<% db.transaction do
- entry = nil
- db["entry"].each_with_index { |e, i|
- entry = db["entry"][i] if e.entryid == session["editid"]
- }
+ entry = session["editentry"]
entry.paramlist.each do |val| %>
<tr style="display: <%= entry.display[val] %>;">
<td class="formnavi" style="width: 140px;">
最終更新時間
</td>
</tr>
- <% db["entry"].each_with_index do |entry, i| %>
+ <% session["entry"].each_with_index do |entry, i| %>
<tr>
<td class="forminput" style="width: 30px; text-align: center;">
<input type="radio" name="editid" value="<%= entry.send("entryid") %>">
</tbody>
</table>
<br>
- <% if db["entry"].length != 0 %>
+ <% if session["entry"].length != 0 %>
<input type="hidden" name="mode" value="editentry"><input type="hidden" name="action" value="edit"><input type="submit" value="編集"><% else %>
編集対象となる記事が存在しません。
<br>
form.submit();
}
- function autocomp_feedid() {
+ function autocomp_feedid(){
document.getElementsByName("feedid").item(0).value = document.getElementsByName("url").item(0).value;
}
</script>
</td>
</tr>
<% db.transaction do
- feed = db["feed"]
+ feed = session["feed"]
feed.paramlist.each do |val| %>
<tr style="display: <%= feed.display[val] %>;">
<td class="formnavi" style="width: 200px;">
</td>
<td class="forminput">
<%= feed.send(val) %>
+ <input type="hidden" name="<%= val %>" value="<%= feed.send(val) %>">
</td>
- </tr>
- <% end %>
+ </tr><% end %>
<% end %>
</tbody>
</table>
<br>
- <input type="hidden" name="mode" value="editfeed"><input type="hidden" name="action" value=""><input type="button" value="戻る" onclick="switchsubmit(this.form, 'back')"> <input type="button" value="確定" onclick="switchsubmit(this.form, 'exec')">
- <% when "exec" %>
+ <input type="hidden" name="mode" value="editfeed"><input type="hidden" name="action" value=""><input type="button" value="戻る" onclick="switchsubmit(this.form, 'back')"> <input type="button" value="確定" onclick="switchsubmit(this.form, 'exec')"><% when "exec" %>
<table align="center" style="width: <%= (TABLEWIDTH - 20) %>px;">
<tbody>
<tr>
<tbody>
<tr>
<td colspan="2" class="formheader">
- ■ XML情報編集<br>
+ ■ XML情報編集
+ <br>
</td>
</tr>
<% db.transaction do
- feed = db["feed"]
+ feed = session["feed"]
feed.paramlist.each do |val| %>
<tr style="display: <%= feed.display[val] %>;">
<td class="formnavi" style="width: 200px;">
<td class="forminput">
<% date = Time.now.iso8601 %>
<% if val == "updated" %>
- <input type="text" name="<%= val %>" value="<%= date %>" style="width: 100%">
- <% elsif val == "url" %>
- <input type="text" name="<%= val %>" value="<%= feed.send(val) %>" style="width: 100%" onchange="autocomp_feedid();">
- <% elsif val == "feedid" %>
+ <input type="text" name="<%= val %>" value="<%= date %>" style="width: 100%"><% elsif val == "url" %>
+ <input type="text" name="<%= val %>" value="<%= feed.send(val) %>" style="width: 100%" onchange="autocomp_feedid();"><% elsif val == "feedid" %>
<input type="text" name="<%= val %>" value="<%= feed.send(val) %>" style="width: 100%">
<br>
<span style="font-style: italic;">通常ウェブページのidはあなたのウェブページURLと同一のものを使用してください。</span>
</td>
</tr>
<% written = false %>
- <% db["loglist"].path.each_with_index do |log, i| %>
- <% if i == db["loginsertindex"] %>
+ <% session["loglist"].path.each_with_index do |log, i| %>
+ <% if i == session["loginsertindex"] %>
<tr>
<td style="text-align: center;" class="forminputhilight">
- <%= db["logpath"] %>
+ <%= session["logpath"] %>
</td>
<td style="text-align: center;" class="forminputhilight">
- <%= db["logdisplay"] %>
+ <%= session["logdisplay"] %>
</td>
</tr>
<% written = true %>
<%= log %>
</td>
<td style="text-align: center;" class="forminput">
- <%= db["loglist"].display[i] %>
+ <%= session["loglist"].display[i] %>
</td>
</tr>
<% end %>
<% if written == false %>
<tr>
<td style="text-align: center;" class="forminputhilight">
- <%= db["logpath"] %>
+ <%= session["logpath"] %>
</td>
<td style="text-align: center;" class="forminputhilight">
- <%= db["logdisplay"] %>
+ <%= session["logdisplay"] %>
</td>
</tr>
<% end %>
</td>
</tr>
<% index = 1 %>
- <% db["loglist"].path.each_with_index do |log, i| %>
+ <% session["loglist"].path.each_with_index do |log, i| %>
<tr>
<td style="text-align: center; width: 30px;" class="forminput">
<% if index == 1 %>
<%= log %>
</td>
<td style="text-align: center;" class="forminput">
- <%= db["loglist"].display[i] %>
+ <%= session["loglist"].display[i] %>
</td>
</tr>
<% index = index + 1 %>
</td>
</tr>
</tbody>
- </table><%= db["error"] %>
+ </table><%= session["error"] %>
<br>
<input type="hidden" name="mode" value="insert"><input type="hidden" name="action" value=""><input type="button" value="確認" onclick="switchsubmit(this.form, 'confirm')">
<br>
<div class="divstyle" style="width: <%= TABLEWIDTH %>px;">
<form action="<%= cgi.script_name %>" method="POST">
<% case params["action"] when "addconfirm" %>
+ <% db.transaction do %>
+ <table align="center" style="width: <%= (TABLEWIDTH - 20) %>px;">
+ <tbody>
+ <tr>
+ <td colspan="2" class="formheader">
+ ■ 赤枠の位置に現在の記事をログとして保存します
+ </td>
+ </tr>
+ <tr>
+ <td style="width: 306px; text-align: center;" class="formnavi">
+ ログファイルのパス
+ </td>
+ <td style="text-align: center;" class="formnavi">
+ ログの表示名
+ </td>
+ </tr>
+ <% session["loglist"].path.each_with_index do |log, i| %>
+ <tr>
+ <td style="text-align: center;" class="forminput">
+ <%= log %>
+ </td>
+ <td style="text-align: center;" class="forminput">
+ <%= session["loglist"].display[i] %>
+ </td>
+ </tr>
+ <% if i == 0 %>
+ <tr>
+ <td style="text-align: center;" class="forminputhilight">
+ <%= session["logpath"] %>
+ <input type="hidden" name="logpath" value="<%= session["logpath"] %>">
+ </td>
+ <td style="text-align: center;" class="forminputhilight">
+ <%= session["logdisplay"] %>
+ <input type="hidden" name="logdisplay" value="<%= session["logdisplay"] %>">
+ </td>
+ </tr><% end %>
+ <% end %>
+ <% end %>
+ </tbody>
+ </table>
+ <br>
+ <input type="hidden" name="mode" value="log"><input type="hidden" name="action" value=""><input type="button" value="戻る" onclick="switchsubmit(this.form, 'back')"> <input type="button" value="確定" onclick="switchsubmit(this.form, 'addexec')"><% when "addexec" %>
+ <table align="center" style="width: <%= (TABLEWIDTH - 20) %>px;">
+ <tbody>
+ <tr>
+ <td class="forminput" style="text-align: center;">
+ ログファイルの作成が完了しました。
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <br>
+ <a href="<%= cgi.script_name %>">メニューに戻る</a>
+ <% when "delconfirm" %>
+ <div class="divstyle" align="center">
<% db.transaction do %>
<table align="center" style="width: <%= (TABLEWIDTH - 20) %>px;">
<tbody>
<tr>
<td colspan="2" class="formheader">
- â\96 赤æ\9e ã\81®ä½\8dç½®ã\81«ç\8f¾å\9c¨ã\81®è¨\98äº\8bã\82\92ã\83ã\82°ã\81¨ã\81\97ã\81¦ä¿\9då\98ã\81\97ã\81¾ã\81\99
+ â\96 赤æ\9e ã\81®ä½\8dç½®ã\81®ã\83ã\82°ã\82\92å\89\8aé\99¤ã\81\97ã\81¾ã\81\99ã\80\82ã\82\88ã\82\8dã\81\97ã\81\84ã\81§ã\81\99ã\81\8bï¼\9f
</td>
</tr>
<tr>
ログの表示名
</td>
</tr>
- <% db["loglist"].path.each_with_index do |log, i| %>
+ <% session["loglist"].path.each_with_index do |log, i| %>
+ <% if session["logdelindex"] != i %>
<tr>
<td style="text-align: center;" class="forminput">
<%= log %>
</td>
<td style="text-align: center;" class="forminput">
- <%= db["loglist"].display[i] %>
+ <%= session["loglist"].display[i] %>
</td>
</tr>
- <% if i == 0 %>
+ <% else %>
<tr>
<td style="text-align: center;" class="forminputhilight">
- <%= db["logpath"] %>
+ <%= log %>
</td>
<td style="text-align: center;" class="forminputhilight">
- <%= db["logdisplay"] %>
+ <%= session["loglist"].display[i] %>
</td>
</tr>
<% end %>
</tbody>
</table>
<br>
- <input type="hidden" name="mode" value="log"><input type="hidden" name="action" value=""><input type="button" value="戻る" onclick="switchsubmit(this.form, 'back')"> <input type="button" value="確定" onclick="switchsubmit(this.form, 'addexec')">
- <% when "addexec" %>
+ <input type="hidden" name="logdelindex" value="<%= session["logdelindex"] %>"><input type="hidden" name="mode" value="log"><input type="hidden" name="action" value=""><input type="button" value="戻る" onclick="switchsubmit(this.form, 'back')"> <input type="button" value="確定" onclick="switchsubmit(this.form, 'delexec')"><% when "delexec" %>
<table align="center" style="width: <%= (TABLEWIDTH - 20) %>px;">
<tbody>
<tr>
<td class="forminput" style="text-align: center;">
- ログファイルの作成が完了しました。
+ ログファイルの削除が完了しました。
</td>
</tr>
</tbody>
</table>
<br>
<a href="<%= cgi.script_name %>">メニューに戻る</a>
- <% when "delconfirm" %>
- <div class="divstyle" align="center">
- <% db.transaction do %>
- <table align="center" style="width: <%= (TABLEWIDTH - 20) %>px;">
- <tbody>
- <tr>
- <td colspan="2" class="formheader">
- ■ 赤枠の位置のログを削除します。よろしいですか?
- </td>
- </tr>
- <tr>
- <td style="width: 306px; text-align: center;" class="formnavi">
- ログファイルのパス
- </td>
- <td style="text-align: center;" class="formnavi">
- ログの表示名
- </td>
- </tr>
- <% db["loglist"].path.each_with_index do |log, i| %>
- <% if db["logdelindex"] != i %>
- <tr>
- <td style="text-align: center;" class="forminput">
- <%= log %>
- </td>
- <td style="text-align: center;" class="forminput">
- <%= db["loglist"].display[i] %>
- </td>
- </tr>
- <% else %>
- <tr>
- <td style="text-align: center;" class="forminputhilight">
- <%= log %>
- </td>
- <td style="text-align: center;" class="forminputhilight">
- <%= db["loglist"].display[i] %>
- </td>
- </tr>
- <% end %>
- <% end %>
- <% end %>
- </tbody>
- </table>
- <br>
- <input type="hidden" name="mode" value="log"><input type="hidden" name="action" value=""><input type="button" value="戻る" onclick="switchsubmit(this.form, 'back')"> <input type="button" value="確定" onclick="switchsubmit(this.form, 'delexec')"><% when "delexec" %>
- <table align="center" style="width: <%= (TABLEWIDTH - 20) %>px;">
- <tbody>
+ <% when "edit" %>
+ <% db.transaction do %>
+ <table align="center" style="width: <%= (TABLEWIDTH - 20) %>px;">
+ <tbody>
+ <tr>
+ <td colspan="3" class="formheader">
+ ■ ログファイル管理
+ <br>
+ 赤枠のログを入力された名前で、チェックされたログの後に挿入します。
+ <br>
+ </td>
+ </tr>
+ <tr>
+ <td class="formnavi">
+
+ </td>
+ <td style="text-align: center;" class="formnavi">
+ ログファイルのパス
+ </td>
+ <td style="text-align: center;" class="formnavi">
+ ログの表示名
+ </td>
+ </tr>
+ <% editcounter = 0 %>
+ <% session["loglist"].path.each_with_index do |log, i| %>
+ <% if session["logeditindex"] != i %>
+ <tr>
+ <td style="text-align: center; width: 30px;" class="forminput">
+ <% if session["logeditindex"] == (i + 1) %>
+ <input type="radio" name="loginsertindex" value="<%= editcounter %>" checked="checked"><% else %>
+ <input type="radio" name="loginsertindex" value="<%= editcounter %>"><% end %>
+ </td>
+ <td style="text-align: center;" class="forminput">
+ <%= log %>
+ </td>
+ <td style="text-align: center;" class="forminput">
+ <%= session["loglist"].display[i] %>
+ </td>
+ </tr>
+ <% editcounter = editcounter + 1 %>
+ <% else %>
+ <tr>
+ <td style="text-align: center; width: 30px;" class="forminputhilight">
+
+ </td>
+ <td style="text-align: center;" class="forminputhilight">
+ <%= log %>
+ </td>
+ <td style="text-align: center;" class="forminputhilight">
+ <%= session["loglist"].display[i] %>
+ </td>
+ </tr>
+ <% end %>
+ <% end %>
+ </tbody>
+ </table>
+ <br>
+ <table align="center">
+ <tbody>
+ <tr>
+ <td colspan="2" class="forminput">
+ ■ <%= session["logpath"] %>の新しい情報を入力してください
+ </td>
<tr>
- <td class="forminput" style="text-align: center;">
- ã\83ã\82°ã\83\95ã\82¡ã\82¤ã\83«ã\81®å\89\8aé\99¤ã\81\8cå®\8cäº\86ã\81\97ã\81¾ã\81\97ã\81\9fã\80\82
+ <td style="text-align: right;">
+ ã\83ã\82°ã\81®ã\83\91ã\82¹
</td>
- </tr>
- </tbody>
- </table>
- <br>
- <a href="<%= cgi.script_name %>">メニューに戻る</a>
- <% when "edit" %>
- <% db.transaction do %>
- <table align="center" style="width: <%= (TABLEWIDTH - 20) %>px;">
- <tbody>
- <tr>
- <td colspan="3" class="formheader">
- ■ ログファイル管理
- <br>
- 赤枠のログを入力された名前で、チェックされたログの後に挿入します。
- <br>
+ <td>
+ <input type="text" name="logpath" style="width: 100%" value="<%= session["logpath"] %>">
</td>
</tr>
<tr>
- <td class="formnavi">
-
- </td>
- <td style="text-align: center;" class="formnavi">
- ログファイルのパス
- </td>
- <td style="text-align: center;" class="formnavi">
+ <td style="text-align: right;">
ログの表示名
</td>
- </tr>
- <% editcounter = 0 %>
- <% db["loglist"].path.each_with_index do |log, i| %>
- <% if db["logeditindex"] != i %>
- <tr>
- <td style="text-align: center; width: 30px;" class="forminput">
- <% if db["logeditindex"] == (i + 1) %>
- <input type="radio" name="loginsertindex" value="<%= editcounter %>" checked="checked"><% else %>
- <input type="radio" name="loginsertindex" value="<%= editcounter %>"><% end %>
- </td>
- <td style="text-align: center;" class="forminput">
- <%= log %>
- </td>
- <td style="text-align: center;" class="forminput">
- <%= db["loglist"].display[i] %>
+ <td>
+ <input type="text" name="logdisplay" style="width: 100%" value="<%= session["logdisplay"] %>">
</td>
</tr>
- <% editcounter = editcounter + 1 %>
- <% else %>
- <tr>
- <td style="text-align: center; width: 30px;" class="forminputhilight">
-
- </td>
- <td style="text-align: center;" class="forminputhilight">
- <%= log %>
- </td>
- <td style="text-align: center;" class="forminputhilight">
- <%= db["loglist"].display[i] %>
- </td>
- </tr>
- <% end %>
- <% end %>
- </tbody>
- </table>
- <br>
- <table align="center">
- <tbody>
- <tr>
- <td colspan="2" class="forminput">
- ■ <%= db["logpath"] %>の新しい情報を入力してください
- </td>
+ </tbody>
+ </table><%= session["error"] %>
+ <br>
+ <input type="hidden" name="logeditindex" value="<%= session["logeditindex"] %>"><input type="hidden" name="mode" value="log"><input type="hidden" name="action" value=""><input type="button" value="戻る" onclick="switchsubmit(this.form, 'back')"> <input type="button" value="確認" onclick="switchsubmit(this.form, 'editconfirm')"><% end %>
+ <% when "editconfirm" %>
+ <% db.transaction do %>
+ <table align="center" style="width: <%= (TABLEWIDTH - 20) %>px;">
+ <tbody>
<tr>
- <td style="text-align: right;">
- ログのパス
+ <td colspan="3" class="formheader">
+ ■ 確認
+ <br>
+ 以下のように変更を適用します。よろしいですか?
+ <br>
</td>
- <td>
- <input type="text" name="logpath" style="width: 100%" value="<%= db["logpath"] %>">
+ </tr>
+ <tr>
+ <td style="text-align: center;" class="formnavi">
+ ログファイルのパス
+ </td>
+ <td style="text-align: center;" class="formnavi">
+ ログの表示名
+ </td>
+ </tr>
+ <% editcounter = 0 %>
+ <% session["loglist"].path.each_with_index do |log, i| %>
+ <% if session["logeditindex"] != i %>
+ <tr>
+ <td style="text-align: center;" class="forminput">
+ <%= log %>
+ </td>
+ <td style="text-align: center;" class="forminput">
+ <%= session["loglist"].display[i] %>
</td>
</tr>
+ <% if editcounter == session["loginsertindex"] %>
<tr>
- <td style="text-align: right;">
+ <td style="text-align: center;" class="forminputhilight">
+ <%= session["logpath"] %>
+ <input type="hidden" name="logpath" value="<%= session["logpath"] %>">
+ </td>
+ <td style="text-align: center;" class="forminputhilight">
+ <%= session["logdisplay"] %>
+ <input type="hidden" name="logdisplay" value="<%= session["logdisplay"] %>">
+ </td>
+ </tr><% end %>
+ <% editcounter = editcounter + 1 %>
+ <% end %>
+ <% end %>
+ </tbody>
+ </table>
+ <br>
+ <br>
+ <input type="hidden" name="logeditindex" value="<%= session["logeditindex"] %>"><input type="hidden" name="loginsertindex" value="<%= session["loginsertindex"] %>"><input type="hidden" name="mode" value="log"><input type="hidden" name="action" value=""><input type="button" value="戻る" onclick="switchsubmit(this.form, 'edit')"> <input type="button" value="確定" onclick="switchsubmit(this.form, 'editexec')"><% end %>
+ <% when "editexec" %>
+ <table align="center" style="width: <%= (TABLEWIDTH - 20) %>px;">
+ <tbody>
+ <tr>
+ <td class="forminput" style="text-align: center;">
+ ログファイルの編集が完了しました。
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <br>
+ <a href="<%= cgi.script_name %>">メニューに戻る</a>
+ <% else %>
+ <% db.transaction do %>
+ <table align="center" style="width: <%= (TABLEWIDTH - 20) %>px;">
+ <tbody>
+ <tr>
+ <td colspan="3" class="formheader">
+ ■ ログファイル管理
+ <br>
+ (現在の<%= session["loglist"].path[0] %>をログとして保存します。その後loglist.xmlを変更します。)
+ <br>
+ </td>
+ </tr>
+ <tr>
+ <td class="formnavi">
+
+ </td>
+ <td colspan="" style="text-align: center;" class="formnavi">
+ ログファイルのパス
+ </td>
+ <td style="text-align: center;" class="formnavi">
ログの表示名
</td>
- <td>
- <input type="text" name="logdisplay" style="width: 100%" value="<%= db["logdisplay"] %>">
+ </tr>
+ <% session["loglist"].path.each_with_index do |log, i| %>
+ <tr>
+ <td style="text-align: center; width: 30px;" class="forminput">
+ <% if i != 0 %>
+ <input type="radio" name="logdelindex" value="<%= i %>"><% else %> <% end %>
+ </td>
+ <td style="text-align: center;" class="forminput">
+ <%= log %>
+ </td>
+ <td style="text-align: center;" class="forminput">
+ <%= session["loglist"].display[i] %>
</td>
</tr>
- </tbody>
- </table><%= db["error"] %>
- <br>
- <input type="hidden" name="mode" value="log"><input type="hidden" name="action" value=""><input type="button" value="戻る" onclick="switchsubmit(this.form, 'back')"> <input type="button" value="確認" onclick="switchsubmit(this.form, 'editconfirm')"><% end %>
- <% when "editconfirm" %>
- <% db.transaction do %>
- <table align="center" style="width: <%= (TABLEWIDTH - 20) %>px;">
- <tbody>
- <tr>
- <td colspan="3" class="formheader">
- ■ 確認
- <br>
- 以下のように変更を適用します。よろしいですか?
- <br>
- </td>
- </tr>
- <tr>
- <td style="text-align: center;" class="formnavi">
- ログファイルのパス
- </td>
- <td style="text-align: center;" class="formnavi">
- ログの表示名
- </td>
- </tr>
- <% editcounter = 0 %>
- <% db["loglist"].path.each_with_index do |log, i| %>
- <% if db["logeditindex"] != i %>
- <tr>
- <td style="text-align: center;" class="forminput">
- <%= log %>
- </td>
- <td style="text-align: center;" class="forminput">
- <%= db["loglist"].display[i] %>
- </td>
- </tr>
- <% if editcounter == db["loginsertindex"] %>
- <tr>
- <td style="text-align: center;" class="forminputhilight">
- <%= db["logpath"] %>
- </td>
- <td style="text-align: center;" class="forminputhilight">
- <%= db["logdisplay"] %>
- </td>
- </tr>
- <% end %>
- <% editcounter = editcounter + 1 %>
- <% end %>
- <% end %>
- </tbody>
- </table>
- <br>
- <br>
- <input type="hidden" name="logdelindex" value="<%= db["logeditindex"] %>"><input type="hidden" name="mode" value="log"><input type="hidden" name="action" value=""><input type="button" value="戻る" onclick="switchsubmit(this.form, 'edit')"> <input type="button" value="確定" onclick="switchsubmit(this.form, 'editexec')"><% end %>
- <% when "editexec" %>
- <table align="center" style="width: <%= (TABLEWIDTH - 20) %>px;">
- <tbody>
+ <% end %>
+ </tbody>
+ </table>
+ <br>
+ <input type="button" value="編集" onclick="switchsubmit(this.form, 'edit')"> <input type="button" value="削除" onclick="switchsubmit(this.form, 'delconfirm')">
+ <br>
+ <br>
+ <table align="center">
+ <tbody>
+ <tr>
+ <td colspan="2" class="forminput">
+ ■ 現在のdiary.xmlを保存する情報を設定してください
+ </td>
<tr>
- <td class="forminput" style="text-align: center;">
- ã\83ã\82°ã\83\95ã\82¡ã\82¤ã\83«ã\81®ç·¨é\9b\86ã\81\8cå®\8cäº\86ã\81\97ã\81¾ã\81\97ã\81\9fã\80\82
+ <td style="text-align: right;">
+ ã\83ã\82°ã\81®ã\83\91ã\82¹
</td>
- </tr>
- </tbody>
- </table>
- <br>
- <a href="<%= cgi.script_name %>">メニューに戻る</a>
- <% else %>
- <% db.transaction do %>
- <table align="center" style="width: <%= (TABLEWIDTH - 20) %>px;">
- <tbody>
- <tr>
- <td colspan="3" class="formheader">
- ■ ログファイル管理
- <br>
- (現在の<%= db["loglist"].path[0] %>をログとして保存します。その後loglist.xmlを変更します。)
- <br>
+ <td>
+ <input type="text" name="logpath" style="width: 100%" value="<%= session["logpath"] %>">
</td>
</tr>
<tr>
- <td class="formnavi">
-
- </td>
- <td colspan="" style="text-align: center;" class="formnavi">
- ログファイルのパス
- </td>
- <td style="text-align: center;" class="formnavi">
+ <td style="text-align: right;">
ログの表示名
</td>
- </tr>
- <% db["loglist"].path.each_with_index do |log, i| %>
- <tr>
- <td style="text-align: center; width: 30px;" class="forminput">
- <% if i != 0 %>
- <input type="radio" name="logdelindex" value="<%= i %>"><% else %> <% end %>
- </td>
- <td style="text-align: center;" class="forminput">
- <%= log %>
- </td>
- <td style="text-align: center;" class="forminput">
- <%= db["loglist"].display[i] %>
+ <td>
+ <input type="text" name="logdisplay" style="width: 100%" value="<%= session["logdisplay"] %>">
</td>
</tr>
- <% end %>
- </tbody>
- </table>
- <br>
- <input type="button" value="編集" onclick="switchsubmit(this.form, 'edit')"> <input type="button" value="削除" onclick="switchsubmit(this.form, 'delconfirm')">
- <br>
- <br>
- <table align="center">
- <tbody>
- <tr>
- <td colspan="2" class="forminput">
- ■ 現在のdiary.xmlを保存する情報を設定してください
- </td>
- <tr>
- <td style="text-align: right;">
- ログのパス
- </td>
- <td>
- <input type="text" name="logpath" style="width: 100%" value="<%= db["logpath"] %>">
- </td>
- </tr>
- <tr>
- <td style="text-align: right;">
- ログの表示名
- </td>
- <td>
- <input type="text" name="logdisplay" style="width: 100%" value="<%= db["logdisplay"] %>">
- </td>
- </tr>
- </tbody>
- </table><%= db["error"] %>
- <br>
- <input type="hidden" name="mode" value="log"><input type="hidden" name="action" value=""><input type="button" value="確定" onclick="switchsubmit(this.form, 'addconfirm')"><% end %>
- <% end %>
- </form>
- </div>
+ </tbody>
+ </table><%= session["error"] %>
<br>
- <div class="divstyle" style="border: none;">
- <%= APPVERSION %>
- </div>
- </body>
- </html>
+ <input type="hidden" name="mode" value="log"><input type="hidden" name="action" value=""><input type="button" value="確定" onclick="switchsubmit(this.form, 'addconfirm')"><% end %>
+ <% end %>
+ </form>
+ </div>
+ <br>
+ <div class="divstyle" style="border: none;">
+ <%= APPVERSION %>
+ </div>
+ </body>
+ </html>
</td>
</tr>
<% db.transaction do
- entry = db["newentry"]
+ entry = session["newentry"]
entry.paramlist.each do |val| %>
<tr style="display: <%= entry.display[val] %>;">
<td class="formnavi" style="width: 140px;">
<%= entry.name[val] %>
</td>
- <td class="forminput"><% if val != "content" %><%= entry.send(val) %><% else %><%= entry.content_for_view %><% end %></td>
+ <td class="forminput"><input type="hidden" name="<%= val %>" value="<%= entry.send(val) %>"><% if val != "content" %><%= entry.send(val) %><% else %><%= entry.content_for_view %><% end %></td>
</tr>
<% end %>
<% end %>
</tr>
<% db.transaction do
if cgi["action"] == "back"
- entry = db["newentry"]
+ entry = session["newentry"]
else
entry = Entry.new({})
end
</tr>
<% db.transaction do
if cgi["action"] == "back"
- entry = db["newentry"]
+ entry = session["newentry"]
else
entry = Entry.new({})
end
<% if val == "content" %>
<textarea name="<%= val %>" rows="10" style="width: 100%" id="contenteditor"><%= entry.content_for_generator %></textarea>
<% elsif val == "entryid" %>
- <input type="text" name="<%= val %>" value="<%= db["feed"].feedid %>?<%= date %>" style="width: 100%"><% elsif val == "updated" || val == "published" %>
+ <input type="text" name="<%= val %>" value="<%= session["feed"].feedid %>?<%= date %>" style="width: 100%"><% elsif val == "updated" || val == "published" %>
<input type="text" name="<%= val %>" value="<%= date %>" style="width: 100%"><% elsif val == "url" %>
- <input type="text" name="<%= val %>" value="<%= db["feed"].url %>#<%= db["feed"].feedid %>?<%= date %>" style="width: 100%"><% else %>
+ <input type="text" name="<%= val %>" value="<%= session["feed"].url %>#<%= session["feed"].feedid %>?<%= date %>" style="width: 100%"><% else %>
<input type="text" name="<%= val %>" value="<%= entry.send(val) %>" style="width: 100%"><% end %>
</td>
</tr><% end %>
ログの表示名
</td>
</tr>
- <% db["loglist"].path.each_with_index do |log, i| %>
+ <% session["loglist"].path.each_with_index do |log, i| %>
<tr>
<td style="text-align: center;" class="forminput">
<%= log %>
</td>
<td style="text-align: center;" class="forminput">
- <%= db["loglist"].display[i] %>
+ <%= session["loglist"].display[i] %>
</td>
</tr>
<% if i == 0 %>
<tr>
<td style="text-align: center;" class="forminputhilight">
- <%= db["logpath"] %>
+ <%= session["logpath"] %>
</td>
<td style="text-align: center;" class="forminputhilight">
- <%= db["logdisplay"] %>
+ <%= session["logdisplay"] %>
</td>
</tr>
<% end %>
</td>
</tr>
</tbody>
- </table><%= db["error"] %>
+ </table><%= session["error"] %>
<br>
<input type="hidden" name="mode" value="replace"><input type="hidden" name="action" value=""><input type="button" value="確認" onclick="switchsubmit(this.form, 'confirm')">
<br>
[ <%= XMLPATH %>] ディレクトリ内部のファイル一覧
</td>
</tr>
- <% db["filelist"].each do |fname| %>
+ <% session["filelist"].each do |fname| %>
<tr>
<td class="forminput" style="text-align: center; padding: 3px;">
<a href="<%= XMLPATH %><%= fname %>" target="_blank"><%= fname %></a>
</td>
</tr>
<% db.transaction do %>
- <% db["loglist"].display.each_with_index do |val, i| %>
+ <% session["loglist"].display.each_with_index do |val, i| %>
<tr>
<td style="text-align: center; width: 25px;" class="forminput">
- <input type="radio" name="logpath" value="<%= db["loglist"].path[i] %>"<% if db["loglist"].path[i] == session["filepath"] %>checked="checked"<% end %>>
+ <input type="radio" name="logpath" value="<%= session["loglist"].path[i] %>"<% if session["loglist"].path[i] == session["filepath"] %>checked="checked"<% end %>>
</td>
<td style="text-align: center;" class="forminput">
- <%= db["loglist"].display[i] %>
+ <%= session["loglist"].display[i] %>
</td>
<td style="text-align: center;" class="forminput">
- <%= db["loglist"].path[i] %>
+ <%= session["loglist"].path[i] %>
</td>
<td style="text-align: center;" class="forminput">
- [ <a href="<%= XMLPATH + db["loglist"].path[i].match(/[^\/]*?$/).to_a[0] %>" target="_blank">OPEN</a>
+ [ <a href="<%= XMLPATH + session["loglist"].path[i].match(/[^\/]*?$/).to_a[0] %>" target="_blank">OPEN</a>
]
</td>
</tr>
# ログ選択画面
when "logselect"
session["filepath"] = params["logpath"]
- db["loglist"] = LogList.readxml(LISTXMLPATH)
+ session["loglist"] = LogList.readxml(LISTXMLPATH)
# 初期状態で選択されるログは「loglist.xml」の最上に位置するログになります
- session["filepath"] = db["loglist"].path[0] if session["filepath"] == nil
- db["feed"] = Feed.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0])
- db["entry"] = Entry.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0])
+ session["filepath"] = session["loglist"].path[0] if session["filepath"] == nil
+ session["feed"] = Feed.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0])
+ session["entry"] = Entry.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0])
# 新規記事追加部分
when "newentry"
case params["action"]
# 確認画面
when "confirm"
- db["newentry"] = Entry.new(params)
- db["newentry"].content = db["newentry"].content_for_blog
+ session["newentry"] = Entry.new(params)
+ session["newentry"].content = session["newentry"].content_for_blog
# 記事の追記を実際にファイルに反映
when "exec"
- db["entry"].unshift db["newentry"]
+ session["newentry"] = Entry.new(params)
+ session["entry"].unshift session["newentry"]
feedwriter = FeedWriter.new(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0])
- feedwriter.to_xml(db["feed"], db["entry"])
+ feedwriter.to_xml(session["feed"], session["entry"])
+ # 確認画面から戻った場合
+ when "back"
+ session["newentry"] = Entry.new(params)
else
# New Diary - Default
- db["feed"] = Feed.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0])
- db["entry"] = Entry.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0])
+ session["feed"] = Feed.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0])
+ session["entry"] = Entry.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0])
end
# 記事編集部分
# 確認画面
when "confirm"
session["editid"] = cgi["editid"].to_s
- db["editentry"] = Entry.new(params)
- db["editentry"].content = db["editentry"].content_for_blog
+ session["editentry"] = Entry.new(params)
+ session["editentry"].content = session["editentry"].content_for_blog
# 記事の変更を実際にファイルに反映
when "exec"
- db["entry"].each_with_index { |e, i|
- db["entry"][i] = db["editentry"] if e.entryid == cgi["editid"].to_s
+ session["editentry"] = Entry.new(params)
+ session["entry"].each_with_index { |e, i|
+ session["entry"][i] = session["editentry"] if e.entryid == cgi["editid"].to_s
}
feedwriter = FeedWriter.new(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0])
- feedwriter.to_xml(db["feed"], db["entry"])
+ feedwriter.to_xml(session["feed"], session["entry"])
+ # 確認画面から戻った場合
+ when "back"
+ session["editid"] = cgi["editid"].to_s
+ session["editentry"] = Entry.new(params)
else
# Edit Diary - Default
- db["feed"] = Feed.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0])
- db["entry"] = Entry.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0])
+ session["feed"] = Feed.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0])
+ session["entry"] = Entry.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0])
end
# 記事削除部分
# 記事の削除を実際にファイルに反映
when "exec"
delindex = nil
- db["entry"].each_with_index { |e, i|
+ session["entry"].each_with_index { |e, i|
delindex = i if e.entryid == cgi["delid"].to_s
}
- db["entry"].delete_at(delindex) unless delindex == nil
+ session["entry"].delete_at(delindex) unless delindex == nil
feedwriter = FeedWriter.new(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0])
- feedwriter.to_xml(db["feed"], db["entry"])
+ feedwriter.to_xml(session["feed"], session["entry"])
else
# Delete Diary - Default
- db["feed"] = Feed.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0])
- db["entry"] = Entry.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0])
+ session["feed"] = Feed.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0])
+ session["entry"] = Entry.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0])
end
# Feed情報変更部分
case params["action"]
# 確認画面
when "confirm"
- db["feed"] = Feed.new(params)
+ session["feed"] = Feed.new(params)
# 実際にFeed情報の変更をファイルに反映
when "exec"
+ session["feed"] = Feed.new(params)
feedwriter = FeedWriter.new(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0])
- feedwriter.to_xml(db["feed"], db["entry"])
+ feedwriter.to_xml(session["feed"], session["entry"])
+ # 確認画面から戻った場合
+ when "back"
+ session["feed"] = Feed.new(params)
else
end
case params["action"]
# ログファイルの編集を実際にファイルに反映
when "addexec"
+ # 入力されたログが既に存在するかを確認
+ session["loglist"].path.each do |val|
+ if val == cgi["logpath"]
+ # 重複していた場合エラーメッセージを表示し、処理を行わない
+ params["action"] = ""
+ error = "<span style='color: #ff0000'>同一のファイルが存在します!別の名前を指定してください。</span><br>"
+ break;
+ end
+ end
+
+ session["logpath"] = cgi["logpath"]
+ session["logdisplay"] = cgi["logdisplay"]
+
# 入力された内容を保持する配列に追加
- db["loglist"].path[1, 0] = db["logpath"]
- db["loglist"].display[1, 0] = db["logdisplay"]
- db["loglist"].to_xml
+ session["loglist"].path[1, 0] = session["logpath"]
+ session["loglist"].display[1, 0] = session["logdisplay"]
+ session["loglist"].to_xml
+
# 既存のdiary.xmlを指定された名称でコピーして保存
- FileUtils.copy_file(XMLPATH + db["loglist"].path[0].match(/[^\/]*?$/).to_a[0], XMLPATH + db["logpath"].match(/[^\/]*?$/).to_a[0], true)
+ FileUtils.copy_file(XMLPATH + session["loglist"].path[0].match(/[^\/]*?$/).to_a[0], XMLPATH + session["logpath"].match(/[^\/]*?$/).to_a[0], true)
+
# 保持している情報を更新する
- db["loglist"] = LogList.readxml(LISTXMLPATH)
- db["entry"] = []
+ session["loglist"] = LogList.readxml(LISTXMLPATH)
+ session["entry"] = []
+
# 新たなdiary.xmlを生成。この際保持する情報は同一のFeedオブジェクト
- writer = FeedWriter.new(XMLPATH + db["loglist"].path[0].match(/[^\/]*?$/).to_a[0])
- writer.to_xml(db["feed"], [])
+ writer = FeedWriter.new(XMLPATH + session["loglist"].path[0].match(/[^\/]*?$/).to_a[0])
+ writer.to_xml(session["feed"], [])
+
# 確認画面
when "addconfirm"
# 入力されたログが既に存在するかを確認
- db["loglist"].path.each do |val|
+ session["loglist"].path.each do |val|
if val == cgi["logpath"]
# 重複していた場合エラーメッセージを表示し、処理を行わない
params["action"] = ""
end
end
- db["logpath"] = cgi["logpath"]
- db["logdisplay"] = cgi["logdisplay"]
+ session["logpath"] = cgi["logpath"]
+ session["logdisplay"] = cgi["logdisplay"]
- if db["logpath"].blank? || db["logdisplay"].blank?
+ if session["logpath"].blank? || session["logdisplay"].blank?
params["action"] = ""
end
when "back"
# 削除確認画面
when "delconfirm"
- db["logdelindex"] = params["logdelindex"].to_i
+ session["logdelindex"] = params["logdelindex"].to_i
- if db["logdelindex"] == 0
+ if session["logdelindex"] == 0
params["action"] = ""
end
# 削除処理
when "delexec"
- if db["logdelindex"] == 0
+ session["logdelindex"] = params["logdelindex"].to_i
+ if session["logdelindex"] == 0
params["action"] = ""
else
# 記事ファイルを削除します
- File.delete(XMLPATH + db["loglist"].path[db["logdelindex"]].match(/[^\/]*?$/).to_s)
+ File.delete(XMLPATH + session["loglist"].path[session["logdelindex"]].match(/[^\/]*?$/).to_s)
# ログリストから削除します
- db["loglist"].path.delete_at(db["logdelindex"])
- db["loglist"].display.delete_at(db["logdelindex"])
- db["loglist"].to_xml
+ session["loglist"].path.delete_at(session["logdelindex"])
+ session["loglist"].display.delete_at(session["logdelindex"])
+ session["loglist"].to_xml
# 保持している情報を更新する
- db["loglist"] = LogList.readxml(LISTXMLPATH)
- db["entry"] = []
+ session["loglist"] = LogList.readxml(LISTXMLPATH)
+ session["entry"] = []
end
# 編集画面
when "edit"
- db["logeditindex"] = params["logdelindex"].to_i
+ session["logeditindex"] = params["logdelindex"].to_i
- db["logpath"] = db["loglist"].path[db["logeditindex"]]
- db["logdisplay"] = db["loglist"].display[db["logeditindex"]]
+ session["logpath"] = session["loglist"].path[session["logeditindex"]]
+ session["logdisplay"] = session["loglist"].display[session["logeditindex"]]
- if db["logeditindex"] == 0
+ if session["logeditindex"] == 0
params["action"] = ""
end
# 編集確認画面
when "editconfirm"
-
+ session["logeditindex"] = params["logeditindex"].to_i
checkflag = true
- db["loglist"].path.each_with_index do |val, i|
- if db["logeditindex"] != i
- if params["logpath"].to_s == db["loglist"].path[i].to_s
+ session["loglist"].path.each_with_index do |val, i|
+ if session["logeditindex"] != i
+ if params["logpath"].to_s == session["loglist"].path[i].to_s
checkflag = false
end
end
if checkflag == false
params["action"] = "edit"
- db["error"] = "<span style='color: #ff0000'>同一のファイルが存在します!別の名前を指定してください。</span><br>"
+ session["error"] = "<span style='color: #ff0000'>同一のファイルが存在します!別の名前を指定してください。</span><br>"
else
- db["loginsertindex"] = params["loginsertindex"].to_i
+ session["loginsertindex"] = params["loginsertindex"].to_i
- db["logpath"] = params["logpath"].to_s
- db["logdisplay"] = params["logdisplay"].to_s
+ session["logpath"] = params["logpath"].to_s
+ session["logdisplay"] = params["logdisplay"].to_s
end
# 編集実行
when "editexec"
+ session["logeditindex"] = params["logeditindex"].to_i
+ checkflag = true
+ session["loglist"].path.each_with_index do |val, i|
+ if session["logeditindex"] != i
+ if params["logpath"].to_s == session["loglist"].path[i].to_s
+ checkflag = false
+ end
+ end
+ end
+
+ if checkflag == false
+ params["action"] = "edit"
+ session["error"] = "<span style='color: #ff0000'>同一のファイルが存在します!別の名前を指定してください。</span><br>"
+ return
+ else
+ session["loginsertindex"] = params["loginsertindex"].to_i
+
+ session["logpath"] = params["logpath"].to_s
+ session["logdisplay"] = params["logdisplay"].to_s
+ end
+
# ファイルを移動します
- if XMLPATH + db["loglist"].path[db["logeditindex"]].match(/[^\/]*?$/).to_s != XMLPATH + db["logpath"].match(/[^\/]*?$/).to_s
- FileUtils.move(XMLPATH + db["loglist"].path[db["logeditindex"]].match(/[^\/]*?$/).to_s, XMLPATH + db["logpath"].match(/[^\/]*?$/).to_s)
+ if XMLPATH + session["loglist"].path[session["logeditindex"]].match(/[^\/]*?$/).to_s != XMLPATH + session["logpath"].match(/[^\/]*?$/).to_s
+ FileUtils.move(XMLPATH + session["loglist"].path[session["logeditindex"]].match(/[^\/]*?$/).to_s, XMLPATH + session["logpath"].match(/[^\/]*?$/).to_s)
end
# ログリストを更新します
- db["loglist"].path.delete_at(db["logeditindex"])
- db["loglist"].display.delete_at(db["logeditindex"])
- db["loglist"].path.insert(db["loginsertindex"] + 1, db["logpath"])
- db["loglist"].display.insert(db["loginsertindex"] + 1, db["logdisplay"])
- db["loglist"].to_xml
+ session["loglist"].path.delete_at(session["logeditindex"])
+ session["loglist"].display.delete_at(session["logeditindex"])
+ session["loglist"].path.insert(session["loginsertindex"] + 1, session["logpath"])
+ session["loglist"].display.insert(session["loginsertindex"] + 1, session["logdisplay"])
+ session["loglist"].to_xml
# 初期表示画面
else
# 初期表示の際に内部保持データをリフレッシュ
- db["loglist"] = LogList.readxml(LISTXMLPATH)
+ session["loglist"] = LogList.readxml(LISTXMLPATH)
# 現在編集中のデータを強制的に最上のファイルパスに変更
- session["filepath"] = db["loglist"].path[0]
+ session["filepath"] = session["loglist"].path[0]
# 前月の時刻を作成します
prevmonth = (DateTime.now << 1)
# 前月の時刻を元に、ディフォルト書式を生成します
- db["logpath"] = FEEDXMLDIR + prevmonth.strftime("%Y%m") + ".xml"
- db["logdisplay"] = prevmonth.strftime("%Y年%m月").gsub("年0", "年")
+ session["logpath"] = FEEDXMLDIR + prevmonth.strftime("%Y%m") + ".xml"
+ session["logdisplay"] = prevmonth.strftime("%Y年%m月").gsub("年0", "年")
end
# インポートモードの場合の処理
when "import"
- db["loglist"] = LogList.readxml(LISTXMLPATH)
+ session["loglist"] = LogList.readxml(LISTXMLPATH)
# リセットモードの場合の処理
when "reset"
writer = FeedWriter.new(XMLPATH + loglist.path[0].match(/[^\/]*?$/).to_a[0])
writer.to_xml(Feed.new({}), [])
- db["loglist"] = LogList.readxml(LISTXMLPATH)
+ session["loglist"] = LogList.readxml(LISTXMLPATH)
# diary.xmlの初期化
- writer = FeedWriter.new(XMLPATH + db["loglist"].path[0].match(/[^\/]*?$/).to_a[0])
+ writer = FeedWriter.new(XMLPATH + session["loglist"].path[0].match(/[^\/]*?$/).to_a[0])
writer.to_xml(Feed.new({}), [])
# 初期の編集ファイルはloglist.xml上の最も上のファイル
- session["filepath"] = db["loglist"].path[0]
- db["feed"] = Feed.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0].to_s)
- db["entry"] = Entry.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0].to_s)
+ session["filepath"] = session["loglist"].path[0]
+ session["feed"] = Feed.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0].to_s)
+ session["entry"] = Entry.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0].to_s)
# 画面の遷移先をトップページにする
params["mode"] = ""
filelist = FileUploader.new.filelist()
# タイプがファイルのみリストとして取得する
- db["filelist"] = []
- filelist.each { |fname| db["filelist"] << fname if File.ftype(XMLPATH + fname) == "file"}
+ session["filelist"] = []
+ filelist.each { |fname| session["filelist"] << fname if File.ftype(XMLPATH + fname) == "file"}
end
# ログイン時の画面
writer.to_xml(Feed.new({}), [])
end
- db["loglist"] = LogList.readxml(LISTXMLPATH)
+ session["loglist"] = LogList.readxml(LISTXMLPATH)
# diary.xmlが存在するかチェック
- if File.exist?(XMLPATH + db["loglist"].path[0].match(/[^\/]*?$/).to_a[0]) == false
+ if File.exist?(XMLPATH + session["loglist"].path[0].match(/[^\/]*?$/).to_a[0]) == false
# なかった場合はdiary.xmlを自動生成
- writer = FeedWriter.new(XMLPATH + db["loglist"].path[0].match(/[^\/]*?$/).to_a[0])
+ writer = FeedWriter.new(XMLPATH + session["loglist"].path[0].match(/[^\/]*?$/).to_a[0])
writer.to_xml(Feed.new({}), [])
end
# 初期の編集ファイルはloglist.xml上の最も上のファイル
- session["filepath"] = db["loglist"].path[0] if session["filepath"] == nil
- db["feed"] = Feed.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0].to_s)
- db["entry"] = Entry.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0].to_s)
+ session["filepath"] = session["loglist"].path[0] if session["filepath"] == nil
+ session["feed"] = Feed.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0].to_s)
+ session["entry"] = Entry.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0].to_s)
end
end
end
when "exec"
# ファイルを実際にアップロードします
file = FileUploader.new
- file.upload(db["logpath"], db["importxml"])
+ file.upload(session["logpath"], session["importxml"])
# loglist.xmlを更新します
- db["loglist"].path[db["loginsertindex"], 0] = db["logpath"]
- db["loglist"].display[db["loginsertindex"], 0] = db["logdisplay"]
- db["loglist"].to_xml
+ session["loglist"].path[session["loginsertindex"], 0] = session["logpath"]
+ session["loglist"].display[session["loginsertindex"], 0] = session["logdisplay"]
+ session["loglist"].to_xml
# 情報を更新します
- db["loglist"] = LogList.readxml(LISTXMLPATH)
- session["filepath"] = db["loglist"].path[0] if session["filepath"] == nil
- db["feed"] = Feed.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0].to_s)
- db["entry"] = Entry.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0].to_s)
+ session["loglist"] = LogList.readxml(LISTXMLPATH)
+ session["filepath"] = session["loglist"].path[0] if session["filepath"] == nil
+ session["feed"] = Feed.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0].to_s)
+ session["entry"] = Entry.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0].to_s)
when "confirm"
# 入力されたログファイルパスが既に存在するかを確認
checkflag = true
- db["logpath"] = Controller.get_mpart_value(cgi["logpath"])
- db["loglist"].path.each do |val|
- if val == db["logpath"]
+ session["logpath"] = Controller.get_mpart_value(cgi["logpath"])
+ session["loglist"].path.each do |val|
+ if val == session["logpath"]
# 重複していた場合エラーメッセージを表示し、処理を行わない
- db["logpath"] = ""
+ session["logpath"] = ""
params["action"] = ""
- db["error"] = "<br><span style='color: #ff0000'>同一のファイルが存在します!別の名前を指定してください。</span><br>"
+ session["error"] = "<br><span style='color: #ff0000'>同一のファイルが存在します!別の名前を指定してください。</span><br>"
checkflag = false
break;
end
end
if checkflag == true
- db["loginsertindex"] = cgi["loginsertindex"].read.to_i
- db["logdisplay"] = Controller.get_mpart_value(cgi["logdisplay"])
- db["importxml"] = cgi["updata"].read
+ session["loginsertindex"] = cgi["loginsertindex"].read.to_i
+ session["logdisplay"] = Controller.get_mpart_value(cgi["logdisplay"])
+ session["importxml"] = cgi["updata"].read
# XMLの整合性をチェックします
begin
- REXML::Document.new(Controller.fix_updata_enc(db["importxml"].to_s))
+ REXML::Document.new(Controller.fix_updata_enc(session["importxml"].to_s))
rescue => exception
- db["error"] = "<br><span style='color: #ff0000'>不正な整形のXMLです!ファイルを見直してください。</span><br>"
- db["error"] << "<div class='divstyle' style='width: 560px; color: #ff0000; text-align: left;'>"
- db["error"] << CGI.escapeHTML(exception.to_s).gsub("\n", "<br>")
- db["error"] << "</div>"
+ session["error"] = "<br><span style='color: #ff0000'>不正な整形のXMLです!ファイルを見直してください。</span><br>"
+ session["error"] << "<div class='divstyle' style='width: 560px; color: #ff0000; text-align: left;'>"
+ session["error"] << CGI.escapeHTML(exception.to_s).gsub("\n", "<br>")
+ session["error"] << "</div>"
params["action"] = ""
end
end
# 0位置への挿入防止
- if db["loginsertindex"] == 0
+ if session["loginsertindex"] == 0
params["action"] = ""
- db["error"] = "<br><span style='color: #ff0000'>ラジオボックスでログの挿入位置を選択してください!</span><br>"
+ session["error"] = "<br><span style='color: #ff0000'>ラジオボックスでログの挿入位置を選択してください!</span><br>"
end
- if db["logpath"] == FEEDXMLDIR || db["logdisplay"].blank?
+ if session["logpath"] == FEEDXMLDIR || session["logdisplay"].blank?
params["action"] = ""
- db["error"] = "<br><span style='color: #ff0000'>インポートファイル、及び、ログの表示名は空欄にできません。</span><br>"
+ session["error"] = "<br><span style='color: #ff0000'>インポートファイル、及び、ログの表示名は空欄にできません。</span><br>"
end
else
# loglist.xmlをロードします
- db["loglist"] = LogList.readxml(LISTXMLPATH)
+ session["loglist"] = LogList.readxml(LISTXMLPATH)
end
# diary.xmlを入れ替える処理
case params["action"]
when "exec"
# diary.xmlを移動します
- FileUtils.move(XMLPATH + "diary.xml", XMLPATH + db["logpath"].match(/[^\/]*?$/).to_s)
+ FileUtils.move(XMLPATH + "diary.xml", XMLPATH + session["logpath"].match(/[^\/]*?$/).to_s)
# ファイルをアップロードします
file = FileUploader.new
- file.upload("diary.xml", db["importxml"])
+ file.upload("diary.xml", session["importxml"])
# loglist.xmlを更新します
- db["loglist"].path[1, 0] = db["logpath"]
- db["loglist"].display[1, 0] = db["logdisplay"]
- db["loglist"].to_xml
+ session["loglist"].path[1, 0] = session["logpath"]
+ session["loglist"].display[1, 0] = session["logdisplay"]
+ session["loglist"].to_xml
# 情報を更新します
- db["loglist"] = LogList.readxml(LISTXMLPATH)
- session["filepath"] = db["loglist"].path[0] if session["filepath"] == nil
- db["feed"] = Feed.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0].to_s)
- db["entry"] = Entry.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0].to_s)
+ session["loglist"] = LogList.readxml(LISTXMLPATH)
+ session["filepath"] = session["loglist"].path[0] if session["filepath"] == nil
+ session["feed"] = Feed.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0].to_s)
+ session["entry"] = Entry.readxml(XMLPATH + session["filepath"].match(/[^\/]*?$/).to_a[0].to_s)
when "confirm"
# 入力されたログファイルパスが既に存在するかを確認
checkflag = true
- db["logpath"] = Controller.get_mpart_value(cgi["logpath"])
- db["loglist"].path.each do |val|
- if val == db["logpath"]
+ session["logpath"] = Controller.get_mpart_value(cgi["logpath"])
+ session["loglist"].path.each do |val|
+ if val == session["logpath"]
# 重複していた場合エラーメッセージを表示し、処理を行わない
params["action"] = ""
- db["error"] = "<br><span style='color: #ff0000'>同一のファイルが存在します!別の名前を指定してください。</span><br>"
+ session["error"] = "<br><span style='color: #ff0000'>同一のファイルが存在します!別の名前を指定してください。</span><br>"
checkflag = false
break;
end
end
if checkflag == true
- db["logdisplay"] = Controller.get_mpart_value(cgi["logdisplay"])
- db["importxml"] = cgi["updata"].read
+ session["logdisplay"] = Controller.get_mpart_value(cgi["logdisplay"])
+ session["importxml"] = cgi["updata"].read
# XMLの整合性をチェックします
begin
- REXML::Document.new(Controller.fix_updata_enc(db["importxml"].to_s))
+ REXML::Document.new(Controller.fix_updata_enc(session["importxml"].to_s))
rescue => exception
- db["error"] = "<br><span style='color: #ff0000'>不正な整形のXMLです!ファイルを見直してください。</span><br>"
- db["error"] << "<div class='divstyle' style='width: 560px; color: #ff0000; text-align: left;'>"
- db["error"] << CGI.escapeHTML(exception.to_s).gsub("\n", "<br>")
- db["error"] << "</div>"
+ session["error"] = "<br><span style='color: #ff0000'>不正な整形のXMLです!ファイルを見直してください。</span><br>"
+ session["error"] << "<div class='divstyle' style='width: 560px; color: #ff0000; text-align: left;'>"
+ session["error"] << CGI.escapeHTML(exception.to_s).gsub("\n", "<br>")
+ session["error"] << "</div>"
params["action"] = ""
end
end
- if db["logpath"].blank? || db["logdisplay"].blank? || db["importxml"].blank?
+ if session["logpath"].blank? || session["logdisplay"].blank? || session["importxml"].blank?
params["action"] = ""
- db["error"] = "<span style='color: #ff0000'>インポートファイル、及び、ログの表示名、ログのパスは空欄にできません。</span><br>"
+ session["error"] = "<span style='color: #ff0000'>インポートファイル、及び、ログの表示名、ログのパスは空欄にできません。</span><br>"
end
else
# loglist.xmlをロードします
- db["loglist"] = LogList.readxml(LISTXMLPATH)
+ session["loglist"] = LogList.readxml(LISTXMLPATH)
end
else
# loglist.xmlをロードします
- db["loglist"] = LogList.readxml(LISTXMLPATH)
+ session["loglist"] = LogList.readxml(LISTXMLPATH)
end
end
end
# PStore破損チェック!
begin
db = PStore.new("./work/#{session.session_id}.dat")
- db.transaction do
- db["error"] = ""
- end
rescue
# PStoreファイルを破棄する
File.delete("./work/#{session.session_id}.dat")
# フォームによって挙動を変更します
if cgi["mode"].respond_to?(:read) && cgi["action"].respond_to?(:read)
+ session["error"] = ""
params["mode"] = cgi["mode"].read
params["action"] = cgi["action"].read
Controller.MultiForm(cgi, session, params, db)
end
# メニューとして表示されるHTML文字列です
-=begin
if USEFILEMANAGER == true
menu = "<div class=\"divstyle\" style=\"width: #{TABLEWIDTH}px;\"><div class=\"divstyle\" align=\"center\" style=\"margin-bottom: 5px;\">現在編集中のファイル : #{session["filepath"]} [ <a href=\"#{cgi.script_name}?mode=selectlog\">他のファイルを選択</a> ]</div>[ <a href=\"#{cgi.script_name}\">トップページ</a> | 記事管理 ( <a href=\"#{cgi.script_name}?mode=newentry\">作成</a> | <a href=\"#{cgi.script_name}?mode=editentry\">編集</a> | <a href=\"#{cgi.script_name}?mode=delentry\">消去</a> ) | <a href=\"#{cgi.script_name}?mode=editfeed\">XML情報編集</a> | <a href=\"#{cgi.script_name}?mode=log\">ログ管理</a> | <a href=\"#{cgi.script_name}?mode=import\">インポート</a> | <a href=\"#{FILEMANAGER}\" target=\"_blank\">ファイル管理</a> | <a href=\"#{cgi.script_name}?mode=reset\">初期化</a> | <a href=\"#{cgi.script_name}?mode=logout\">ログアウト</a> ]</div>"
else
menu = "<div class=\"divstyle\" style=\"width: #{TABLEWIDTH}px;\"><div class=\"divstyle\" align=\"center\" style=\"margin-bottom: 5px;\">現在編集中のファイル : #{session["filepath"]} [ <a href=\"#{cgi.script_name}?mode=selectlog\">他のファイルを選択</a> ]</div>[ <a href=\"#{cgi.script_name}\">トップページ</a> | 記事管理 ( <a href=\"#{cgi.script_name}?mode=newentry\">作成</a> | <a href=\"#{cgi.script_name}?mode=editentry\">編集</a> | <a href=\"#{cgi.script_name}?mode=delentry\">消去</a> ) | <a href=\"#{cgi.script_name}?mode=editfeed\">XML情報編集</a> | <a href=\"#{cgi.script_name}?mode=log\">ログ管理</a> | <a href=\"#{cgi.script_name}?mode=import\">インポート</a> | <a href=\"#{cgi.script_name}?mode=reset\">初期化</a> | <a href=\"#{cgi.script_name}?mode=logout\">ログアウト</a> ]</div>"
end
-=end
-
- # メニューとして表示されるHTML文字列です
- if USEFILEMANAGER == true
- menu = "<div class=\"divstyle\" style=\"width: #{TABLEWIDTH}px;\"><div class=\"divstyle\" align=\"center\" style=\"margin-bottom: 5px;\">現在編集中のファイル : #{session["filepath"]} [ <a class=\"menu_link\" onclick=\"location.href ='#{cgi.script_name}?mode=selectlog'\">他のファイルを選択</a> ]</div>[ <a class=\"menu_link\" onclick=\"location.href ='#{cgi.script_name}'\">トップページ</a> | 記事管理 ( <a class=\"menu_link\" onclick=\"location.href ='#{cgi.script_name}?mode=newentry'\">作成</a> | <a class=\"menu_link\" onclick=\"location.href ='#{cgi.script_name}?mode=editentry'\">編集</a> | <a class=\"menu_link\" onclick=\"location.href ='#{cgi.script_name}?mode=delentry'\">消去</a> ) | <a class=\"menu_link\" onclick=\"location.href ='#{cgi.script_name}?mode=editfeed'\">XML情報編集</a> | <a class=\"menu_link\" onclick=\"location.href ='#{cgi.script_name}?mode=log'\">ログ管理</a> | <a class=\"menu_link\" onclick=\"location.href ='#{cgi.script_name}?mode=import'\">インポート</a> | <a href=\"#{FILEMANAGER}\" target=\"_blank\">ファイル管理</a> | <a class=\"menu_link\" onclick=\"location.href ='#{cgi.script_name}?mode=reset'\">初期化</a> | <a class=\"menu_link\" onclick=\"location.href ='#{cgi.script_name}?mode=logout'\">ログアウト</a> ]</div>"
- else
- menu = "<div class=\"divstyle\" style=\"width: #{TABLEWIDTH}px;\"><div class=\"divstyle\" align=\"center\" style=\"margin-bottom: 5px;\">現在編集中のファイル : #{session["filepath"]} [ <a class=\"menu_link\" onclick=\"location.href ='#{cgi.script_name}?mode=selectlog'\">他のファイルを選択</a> ]</div>[ <a class=\"menu_link\" onclick=\"location.href ='#{cgi.script_name}'\">トップページ</a> | 記事管理 ( <a class=\"menu_link\" onclick=\"location.href ='#{cgi.script_name}?mode=newentry'\">作成</a> | <a class=\"menu_link\" onclick=\"location.href ='#{cgi.script_name}?mode=editentry'\">編集</a> | <a class=\"menu_link\" onclick=\"location.href ='#{cgi.script_name}?mode=delentry'\">消去</a> ) | <a class=\"menu_link\" onclick=\"location.href ='#{cgi.script_name}?mode=editfeed'\">XML情報編集</a> | <a class=\"menu_link\" onclick=\"location.href ='#{cgi.script_name}?mode=log'\">ログ管理</a> | <a class=\"menu_link\" onclick=\"location.href ='#{cgi.script_name}?mode=import'\">インポート</a> | <a class=\"menu_link\" onclick=\"location.href ='#{cgi.script_name}?mode=reset'\">初期化</a> | <a class=\"menu_link\" onclick=\"location.href ='#{cgi.script_name}?mode=logout\">ログアウト</a> ]</div>"
- end
# ビュー部分
# modeとactionの相関図は以下のようになります。