OSDN Git Service

Initial commit at SoulDrops 2nd season analyzer module.
authormumin <mumincacao@users.sourceforge.jp>
Wed, 17 Jun 2009 14:00:25 +0000 (23:00 +0900)
committermumin <mumincacao@users.sourceforge.jp>
Wed, 17 Jun 2009 14:00:25 +0000 (23:00 +0900)
177 files changed:
public_html/modules/sd2nd/admin/index.php [new file with mode: 0644]
public_html/modules/sd2nd/images/down.gif [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip1.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip10.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip11.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip12.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip13.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip14.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip15.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip16.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip17.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip18.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip19.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip2.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip20.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip21.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip22.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip23.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip24.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip25.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip26.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip27.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip28.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip29.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip3.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip30.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip31.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip32.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip33.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip34.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip35.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip4.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip5.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip6.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip7.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip8.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/icon/mapchip9.jpg [new file with mode: 0644]
public_html/modules/sd2nd/images/index.html [new file with mode: 0644]
public_html/modules/sd2nd/images/sd2nd.png [new file with mode: 0644]
public_html/modules/sd2nd/images/up.gif [new file with mode: 0644]
public_html/modules/sd2nd/index.php [new file with mode: 0644]
public_html/modules/sd2nd/language/english/admin.php [new file with mode: 0644]
public_html/modules/sd2nd/language/english/help/delegate.html [new file with mode: 0644]
public_html/modules/sd2nd/language/english/help/help.html [new file with mode: 0644]
public_html/modules/sd2nd/language/english/help/index.html [new file with mode: 0644]
public_html/modules/sd2nd/language/english/index.html [new file with mode: 0644]
public_html/modules/sd2nd/language/english/main.php [new file with mode: 0644]
public_html/modules/sd2nd/language/english/modinfo.php [new file with mode: 0644]
public_html/modules/sd2nd/language/index.html [new file with mode: 0644]
public_html/modules/sd2nd/language/ja_utf8/admin.php [new file with mode: 0644]
public_html/modules/sd2nd/language/ja_utf8/help/delegate.html [new file with mode: 0644]
public_html/modules/sd2nd/language/ja_utf8/help/help.html [new file with mode: 0644]
public_html/modules/sd2nd/language/ja_utf8/help/index.html [new file with mode: 0644]
public_html/modules/sd2nd/language/ja_utf8/index.html [new file with mode: 0644]
public_html/modules/sd2nd/language/ja_utf8/main.php [new file with mode: 0644]
public_html/modules/sd2nd/language/ja_utf8/modinfo.php [new file with mode: 0644]
public_html/modules/sd2nd/language/japanese/admin.php [new file with mode: 0644]
public_html/modules/sd2nd/language/japanese/help/delegate.html [new file with mode: 0644]
public_html/modules/sd2nd/language/japanese/help/help.html [new file with mode: 0644]
public_html/modules/sd2nd/language/japanese/help/index.html [new file with mode: 0644]
public_html/modules/sd2nd/language/japanese/index.html [new file with mode: 0644]
public_html/modules/sd2nd/language/japanese/main.php [new file with mode: 0644]
public_html/modules/sd2nd/language/japanese/modinfo.php [new file with mode: 0644]
public_html/modules/sd2nd/preload/AssetPreload.class.php [new file with mode: 0644]
public_html/modules/sd2nd/preload/index.html [new file with mode: 0644]
public_html/modules/sd2nd/xoops_version.php [new file with mode: 0644]
trust_path/modules/sd2nd/actions/AbilityListAction.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/actions/ActiveAbilityListAction.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/actions/CostumeListAction.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/actions/IndexAction.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/actions/LearnedAbilityListAction.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/actions/LearnedCostumeListAction.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/actions/LearnedSkillListAction.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/actions/MapViewAction.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/actions/SkillListAction.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/admin/class/Sd2ndAdminRenderSystem.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/admin/class/installer/Sd2ndInstallUtils.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/admin/class/installer/Sd2ndInstaller.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/admin/class/installer/Sd2ndUninstaller.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/admin/class/installer/Sd2ndUpdater.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/admin/index.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/AbstractAction.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/AbstractDeleteAction.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/AbstractEditAction.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/AbstractFilterForm.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/AbstractListAction.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/AbstractViewAction.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/AssetManager.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/Module.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/Sd2ndUtils.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/handler/Ability.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/handler/ActiveAbility.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/handler/Char.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/handler/Costume.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/handler/EnoPnoLink.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/handler/Icon.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/handler/Image.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/handler/Kind.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/handler/LearnedAbility.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/handler/LearnedCostume.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/handler/LearnedSkill.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/handler/Map.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/handler/MapCache.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/handler/MapName.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/handler/MapSpot.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/handler/Race.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/handler/Skill.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/handler/SkillElementLink.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/handler/Status.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/handler/Target.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/handler/Update.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/AbstractProcess.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/Sd2ndUpdateUtils.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/Sd2ndUpdater.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/dispose/Backup.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/dispose/GarbageCollection.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/dispose/MapCache.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/dispose/Update.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/execute/Chardata.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/execute/Charlist.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/execute/parser/Show_CharList.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/execute/parser/charParser/Costume_Data.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/execute/parser/charParser/Field_Data.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/execute/parser/charParser/Icon_Data.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/execute/parser/charParser/Map_Data.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/execute/parser/charParser/SAbility_Data.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/execute/parser/charParser/Show_Image.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/execute/parser/charParser/Show_Map.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/execute/parser/charParser/Show_Name.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/execute/parser/charParser/Show_Profile.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/execute/parser/charParser/Show_Status.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/execute/parser/charParser/WSkill_Data.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/prepare/AbilityList.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/prepare/CostumeList.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/prepare/DataConvert.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/prepare/KindList.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/prepare/MapCollection.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/prepare/RaceList.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/prepare/RefleshTable.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/prepare/Setup.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/prepare/SkillList.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/prepare/SpotList.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/class/updater/prepare/TargetList.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/forms/AbilityFilterForm.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/forms/ActiveAbilityFilterForm.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/forms/CostumeFilterForm.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/forms/LearnedAbilityFilterForm.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/forms/LearnedSkillFilterForm.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/forms/SkillFilterForm.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/index.php [new file with mode: 0644]
trust_path/modules/sd2nd/language/english/admin.php [new file with mode: 0644]
trust_path/modules/sd2nd/language/english/help/delegate.html [new file with mode: 0644]
trust_path/modules/sd2nd/language/english/help/help.html [new file with mode: 0644]
trust_path/modules/sd2nd/language/english/main.php [new file with mode: 0644]
trust_path/modules/sd2nd/language/english/modinfo.php [new file with mode: 0644]
trust_path/modules/sd2nd/language/ja_utf8/admin.php [new file with mode: 0644]
trust_path/modules/sd2nd/language/ja_utf8/help/delegate.html [new file with mode: 0644]
trust_path/modules/sd2nd/language/ja_utf8/help/help.html [new file with mode: 0644]
trust_path/modules/sd2nd/language/ja_utf8/main.php [new file with mode: 0644]
trust_path/modules/sd2nd/language/ja_utf8/modinfo.php [new file with mode: 0644]
trust_path/modules/sd2nd/language/japanese/admin.php [new file with mode: 0644]
trust_path/modules/sd2nd/language/japanese/help/delegate.html [new file with mode: 0644]
trust_path/modules/sd2nd/language/japanese/help/help.html [new file with mode: 0644]
trust_path/modules/sd2nd/language/japanese/main.php [new file with mode: 0644]
trust_path/modules/sd2nd/language/japanese/modinfo.php [new file with mode: 0644]
trust_path/modules/sd2nd/preload/AssetPreload.class.php [new file with mode: 0644]
trust_path/modules/sd2nd/sql/mysql.sql [new file with mode: 0644]
trust_path/modules/sd2nd/templates/sd2nd_ability_list.html [new file with mode: 0644]
trust_path/modules/sd2nd/templates/sd2nd_active_ability_list.html [new file with mode: 0644]
trust_path/modules/sd2nd/templates/sd2nd_costume_list.html [new file with mode: 0644]
trust_path/modules/sd2nd/templates/sd2nd_index.html [new file with mode: 0644]
trust_path/modules/sd2nd/templates/sd2nd_learned_ability_list.html [new file with mode: 0644]
trust_path/modules/sd2nd/templates/sd2nd_learned_skill_list.html [new file with mode: 0644]
trust_path/modules/sd2nd/templates/sd2nd_map_view.html [new file with mode: 0644]
trust_path/modules/sd2nd/templates/sd2nd_skill_list.html [new file with mode: 0644]
trust_path/modules/sd2nd/update.php [new file with mode: 0644]
trust_path/modules/sd2nd/xoops_version.php [new file with mode: 0644]

diff --git a/public_html/modules/sd2nd/admin/index.php b/public_html/modules/sd2nd/admin/index.php
new file mode 100644 (file)
index 0000000..923b23f
--- /dev/null
@@ -0,0 +1,13 @@
+<?php
+/**
+ * @file
+ * @brief The page controller in the directory
+ * @package sd2nd
+ * @version $Id$
+**/
+
+require_once '../../../mainfile.php';
+
+require_once XOOPS_TRUST_PATH . '/modules/sd2nd/admin/index.php';
+
+?>
diff --git a/public_html/modules/sd2nd/images/down.gif b/public_html/modules/sd2nd/images/down.gif
new file mode 100644 (file)
index 0000000..eef0c40
Binary files /dev/null and b/public_html/modules/sd2nd/images/down.gif differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip1.jpg b/public_html/modules/sd2nd/images/icon/mapchip1.jpg
new file mode 100644 (file)
index 0000000..c5956f5
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip1.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip10.jpg b/public_html/modules/sd2nd/images/icon/mapchip10.jpg
new file mode 100644 (file)
index 0000000..df67951
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip10.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip11.jpg b/public_html/modules/sd2nd/images/icon/mapchip11.jpg
new file mode 100644 (file)
index 0000000..fbf79ee
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip11.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip12.jpg b/public_html/modules/sd2nd/images/icon/mapchip12.jpg
new file mode 100644 (file)
index 0000000..56b17f7
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip12.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip13.jpg b/public_html/modules/sd2nd/images/icon/mapchip13.jpg
new file mode 100644 (file)
index 0000000..d5a9c8f
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip13.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip14.jpg b/public_html/modules/sd2nd/images/icon/mapchip14.jpg
new file mode 100644 (file)
index 0000000..7998a18
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip14.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip15.jpg b/public_html/modules/sd2nd/images/icon/mapchip15.jpg
new file mode 100644 (file)
index 0000000..e3e292d
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip15.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip16.jpg b/public_html/modules/sd2nd/images/icon/mapchip16.jpg
new file mode 100644 (file)
index 0000000..9913a2c
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip16.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip17.jpg b/public_html/modules/sd2nd/images/icon/mapchip17.jpg
new file mode 100644 (file)
index 0000000..8bc7c1f
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip17.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip18.jpg b/public_html/modules/sd2nd/images/icon/mapchip18.jpg
new file mode 100644 (file)
index 0000000..9f0024f
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip18.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip19.jpg b/public_html/modules/sd2nd/images/icon/mapchip19.jpg
new file mode 100644 (file)
index 0000000..99024d1
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip19.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip2.jpg b/public_html/modules/sd2nd/images/icon/mapchip2.jpg
new file mode 100644 (file)
index 0000000..2fe2816
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip2.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip20.jpg b/public_html/modules/sd2nd/images/icon/mapchip20.jpg
new file mode 100644 (file)
index 0000000..101282c
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip20.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip21.jpg b/public_html/modules/sd2nd/images/icon/mapchip21.jpg
new file mode 100644 (file)
index 0000000..bb6f163
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip21.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip22.jpg b/public_html/modules/sd2nd/images/icon/mapchip22.jpg
new file mode 100644 (file)
index 0000000..bb6f163
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip22.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip23.jpg b/public_html/modules/sd2nd/images/icon/mapchip23.jpg
new file mode 100644 (file)
index 0000000..bb6f163
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip23.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip24.jpg b/public_html/modules/sd2nd/images/icon/mapchip24.jpg
new file mode 100644 (file)
index 0000000..bb6f163
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip24.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip25.jpg b/public_html/modules/sd2nd/images/icon/mapchip25.jpg
new file mode 100644 (file)
index 0000000..bb6f163
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip25.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip26.jpg b/public_html/modules/sd2nd/images/icon/mapchip26.jpg
new file mode 100644 (file)
index 0000000..bb6f163
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip26.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip27.jpg b/public_html/modules/sd2nd/images/icon/mapchip27.jpg
new file mode 100644 (file)
index 0000000..bb6f163
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip27.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip28.jpg b/public_html/modules/sd2nd/images/icon/mapchip28.jpg
new file mode 100644 (file)
index 0000000..bb6f163
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip28.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip29.jpg b/public_html/modules/sd2nd/images/icon/mapchip29.jpg
new file mode 100644 (file)
index 0000000..bb6f163
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip29.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip3.jpg b/public_html/modules/sd2nd/images/icon/mapchip3.jpg
new file mode 100644 (file)
index 0000000..8d9d1db
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip3.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip30.jpg b/public_html/modules/sd2nd/images/icon/mapchip30.jpg
new file mode 100644 (file)
index 0000000..bb6f163
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip30.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip31.jpg b/public_html/modules/sd2nd/images/icon/mapchip31.jpg
new file mode 100644 (file)
index 0000000..bb6f163
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip31.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip32.jpg b/public_html/modules/sd2nd/images/icon/mapchip32.jpg
new file mode 100644 (file)
index 0000000..bb6f163
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip32.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip33.jpg b/public_html/modules/sd2nd/images/icon/mapchip33.jpg
new file mode 100644 (file)
index 0000000..bb6f163
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip33.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip34.jpg b/public_html/modules/sd2nd/images/icon/mapchip34.jpg
new file mode 100644 (file)
index 0000000..bb6f163
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip34.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip35.jpg b/public_html/modules/sd2nd/images/icon/mapchip35.jpg
new file mode 100644 (file)
index 0000000..bb6f163
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip35.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip4.jpg b/public_html/modules/sd2nd/images/icon/mapchip4.jpg
new file mode 100644 (file)
index 0000000..fbbc966
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip4.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip5.jpg b/public_html/modules/sd2nd/images/icon/mapchip5.jpg
new file mode 100644 (file)
index 0000000..0bf3dbc
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip5.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip6.jpg b/public_html/modules/sd2nd/images/icon/mapchip6.jpg
new file mode 100644 (file)
index 0000000..138dc37
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip6.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip7.jpg b/public_html/modules/sd2nd/images/icon/mapchip7.jpg
new file mode 100644 (file)
index 0000000..ab5ca74
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip7.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip8.jpg b/public_html/modules/sd2nd/images/icon/mapchip8.jpg
new file mode 100644 (file)
index 0000000..85d6838
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip8.jpg differ
diff --git a/public_html/modules/sd2nd/images/icon/mapchip9.jpg b/public_html/modules/sd2nd/images/icon/mapchip9.jpg
new file mode 100644 (file)
index 0000000..f9ba25a
Binary files /dev/null and b/public_html/modules/sd2nd/images/icon/mapchip9.jpg differ
diff --git a/public_html/modules/sd2nd/images/index.html b/public_html/modules/sd2nd/images/index.html
new file mode 100644 (file)
index 0000000..2c5cdd3
--- /dev/null
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
diff --git a/public_html/modules/sd2nd/images/sd2nd.png b/public_html/modules/sd2nd/images/sd2nd.png
new file mode 100644 (file)
index 0000000..225d105
Binary files /dev/null and b/public_html/modules/sd2nd/images/sd2nd.png differ
diff --git a/public_html/modules/sd2nd/images/up.gif b/public_html/modules/sd2nd/images/up.gif
new file mode 100644 (file)
index 0000000..dfc0ef5
Binary files /dev/null and b/public_html/modules/sd2nd/images/up.gif differ
diff --git a/public_html/modules/sd2nd/index.php b/public_html/modules/sd2nd/index.php
new file mode 100644 (file)
index 0000000..20e76a1
--- /dev/null
@@ -0,0 +1,13 @@
+<?php
+/**
+ * @file
+ * @brief The page controller in the directory
+ * @package sd2nd
+ * @version $Id$
+**/
+
+require_once '../../mainfile.php';
+
+require_once XOOPS_TRUST_PATH . '/modules/sd2nd/index.php';
+
+?>
diff --git a/public_html/modules/sd2nd/language/english/admin.php b/public_html/modules/sd2nd/language/english/admin.php
new file mode 100644 (file)
index 0000000..9f66454
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+require_once XOOPS_TRUST_PATH . '/modules/sd2nd/language/english/admin.php';
+
+?>
diff --git a/public_html/modules/sd2nd/language/english/help/delegate.html b/public_html/modules/sd2nd/language/english/help/delegate.html
new file mode 100644 (file)
index 0000000..8b13be9
--- /dev/null
@@ -0,0 +1,37 @@
+<h4>Delegate List</h4>
+
+<h5>Module.sd2nd.Global.Event.GetAssetManager</h5>
+<dl>
+  <dt>Sd2nd_AssetManager</dt><dd>&$obj</dd>
+  <dt>string</dt><dd>$dirname</dd>
+</dl>
+
+<h5>Module.sd2nd.Global.Event.Exception.ActionNotFound</h5>
+<dl>
+  <dt>string</dt><dd>$dirname</dd>
+</dl>
+
+<h5>Module.{dirname}.Event.Exception.ActionNotFound</h5>
+<dl>
+  <dt>void</dt>
+</dl>
+
+<h5>Module.sd2nd.Global.Event.Exception.Preparation</h5>
+<dl>
+  <dt>string</dt><dd>$dirname</dd>
+</dl>
+
+<h5>Module.{dirname}.Event.Exception.Preparation</h5>
+<dl>
+  <dt>void</dt>
+</dl>
+
+<h5>Module.sd2nd.Global.Event.Exception.Permission</h5>
+<dl>
+  <dt>string</dt><dd>$dirname</dd>
+</dl>
+
+<h5>Module.{dirname}.Event.Exception.Permission</h5>
+<dl>
+  <dt>void</dt>
+</dl>
diff --git a/public_html/modules/sd2nd/language/english/help/help.html b/public_html/modules/sd2nd/language/english/help/help.html
new file mode 100644 (file)
index 0000000..794fd16
--- /dev/null
@@ -0,0 +1,4 @@
+<h4>Input the title here</h4>
+<h5>Summary</h5>
+<p>Even if the help is poor, some information shall help users. Try writing. Take it easy.</p>
+<h5><a href="<{"delegate.html"|helpurl}>">Delegate List</a></h5>
diff --git a/public_html/modules/sd2nd/language/english/help/index.html b/public_html/modules/sd2nd/language/english/help/index.html
new file mode 100644 (file)
index 0000000..2c5cdd3
--- /dev/null
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
diff --git a/public_html/modules/sd2nd/language/english/index.html b/public_html/modules/sd2nd/language/english/index.html
new file mode 100644 (file)
index 0000000..2c5cdd3
--- /dev/null
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
diff --git a/public_html/modules/sd2nd/language/english/main.php b/public_html/modules/sd2nd/language/english/main.php
new file mode 100644 (file)
index 0000000..d1a2125
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+require_once XOOPS_TRUST_PATH . '/modules/sd2nd/language/english/main.php';
+
+?>
diff --git a/public_html/modules/sd2nd/language/english/modinfo.php b/public_html/modules/sd2nd/language/english/modinfo.php
new file mode 100644 (file)
index 0000000..4350f09
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+require_once XOOPS_TRUST_PATH . '/modules/sd2nd/language/english/modinfo.php';
+
+?>
diff --git a/public_html/modules/sd2nd/language/index.html b/public_html/modules/sd2nd/language/index.html
new file mode 100644 (file)
index 0000000..2c5cdd3
--- /dev/null
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
diff --git a/public_html/modules/sd2nd/language/ja_utf8/admin.php b/public_html/modules/sd2nd/language/ja_utf8/admin.php
new file mode 100644 (file)
index 0000000..7bde059
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+require_once XOOPS_TRUST_PATH . '/modules/sd2nd/language/ja_utf8/admin.php';
+
+?>
diff --git a/public_html/modules/sd2nd/language/ja_utf8/help/delegate.html b/public_html/modules/sd2nd/language/ja_utf8/help/delegate.html
new file mode 100644 (file)
index 0000000..8b13be9
--- /dev/null
@@ -0,0 +1,37 @@
+<h4>Delegate List</h4>
+
+<h5>Module.sd2nd.Global.Event.GetAssetManager</h5>
+<dl>
+  <dt>Sd2nd_AssetManager</dt><dd>&$obj</dd>
+  <dt>string</dt><dd>$dirname</dd>
+</dl>
+
+<h5>Module.sd2nd.Global.Event.Exception.ActionNotFound</h5>
+<dl>
+  <dt>string</dt><dd>$dirname</dd>
+</dl>
+
+<h5>Module.{dirname}.Event.Exception.ActionNotFound</h5>
+<dl>
+  <dt>void</dt>
+</dl>
+
+<h5>Module.sd2nd.Global.Event.Exception.Preparation</h5>
+<dl>
+  <dt>string</dt><dd>$dirname</dd>
+</dl>
+
+<h5>Module.{dirname}.Event.Exception.Preparation</h5>
+<dl>
+  <dt>void</dt>
+</dl>
+
+<h5>Module.sd2nd.Global.Event.Exception.Permission</h5>
+<dl>
+  <dt>string</dt><dd>$dirname</dd>
+</dl>
+
+<h5>Module.{dirname}.Event.Exception.Permission</h5>
+<dl>
+  <dt>void</dt>
+</dl>
diff --git a/public_html/modules/sd2nd/language/ja_utf8/help/help.html b/public_html/modules/sd2nd/language/ja_utf8/help/help.html
new file mode 100644 (file)
index 0000000..794fd16
--- /dev/null
@@ -0,0 +1,4 @@
+<h4>Input the title here</h4>
+<h5>Summary</h5>
+<p>Even if the help is poor, some information shall help users. Try writing. Take it easy.</p>
+<h5><a href="<{"delegate.html"|helpurl}>">Delegate List</a></h5>
diff --git a/public_html/modules/sd2nd/language/ja_utf8/help/index.html b/public_html/modules/sd2nd/language/ja_utf8/help/index.html
new file mode 100644 (file)
index 0000000..2c5cdd3
--- /dev/null
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
diff --git a/public_html/modules/sd2nd/language/ja_utf8/index.html b/public_html/modules/sd2nd/language/ja_utf8/index.html
new file mode 100644 (file)
index 0000000..2c5cdd3
--- /dev/null
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
diff --git a/public_html/modules/sd2nd/language/ja_utf8/main.php b/public_html/modules/sd2nd/language/ja_utf8/main.php
new file mode 100644 (file)
index 0000000..d142880
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+require_once XOOPS_TRUST_PATH . '/modules/sd2nd/language/ja_utf8/main.php';
+
+?>
diff --git a/public_html/modules/sd2nd/language/ja_utf8/modinfo.php b/public_html/modules/sd2nd/language/ja_utf8/modinfo.php
new file mode 100644 (file)
index 0000000..56a96ca
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+require_once XOOPS_TRUST_PATH . '/modules/sd2nd/language/ja_utf8/modinfo.php';
+
+?>
diff --git a/public_html/modules/sd2nd/language/japanese/admin.php b/public_html/modules/sd2nd/language/japanese/admin.php
new file mode 100644 (file)
index 0000000..7378151
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+require_once XOOPS_TRUST_PATH . '/modules/sd2nd/language/japanese/admin.php';
+
+?>
diff --git a/public_html/modules/sd2nd/language/japanese/help/delegate.html b/public_html/modules/sd2nd/language/japanese/help/delegate.html
new file mode 100644 (file)
index 0000000..8b13be9
--- /dev/null
@@ -0,0 +1,37 @@
+<h4>Delegate List</h4>
+
+<h5>Module.sd2nd.Global.Event.GetAssetManager</h5>
+<dl>
+  <dt>Sd2nd_AssetManager</dt><dd>&$obj</dd>
+  <dt>string</dt><dd>$dirname</dd>
+</dl>
+
+<h5>Module.sd2nd.Global.Event.Exception.ActionNotFound</h5>
+<dl>
+  <dt>string</dt><dd>$dirname</dd>
+</dl>
+
+<h5>Module.{dirname}.Event.Exception.ActionNotFound</h5>
+<dl>
+  <dt>void</dt>
+</dl>
+
+<h5>Module.sd2nd.Global.Event.Exception.Preparation</h5>
+<dl>
+  <dt>string</dt><dd>$dirname</dd>
+</dl>
+
+<h5>Module.{dirname}.Event.Exception.Preparation</h5>
+<dl>
+  <dt>void</dt>
+</dl>
+
+<h5>Module.sd2nd.Global.Event.Exception.Permission</h5>
+<dl>
+  <dt>string</dt><dd>$dirname</dd>
+</dl>
+
+<h5>Module.{dirname}.Event.Exception.Permission</h5>
+<dl>
+  <dt>void</dt>
+</dl>
diff --git a/public_html/modules/sd2nd/language/japanese/help/help.html b/public_html/modules/sd2nd/language/japanese/help/help.html
new file mode 100644 (file)
index 0000000..794fd16
--- /dev/null
@@ -0,0 +1,4 @@
+<h4>Input the title here</h4>
+<h5>Summary</h5>
+<p>Even if the help is poor, some information shall help users. Try writing. Take it easy.</p>
+<h5><a href="<{"delegate.html"|helpurl}>">Delegate List</a></h5>
diff --git a/public_html/modules/sd2nd/language/japanese/help/index.html b/public_html/modules/sd2nd/language/japanese/help/index.html
new file mode 100644 (file)
index 0000000..2c5cdd3
--- /dev/null
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
diff --git a/public_html/modules/sd2nd/language/japanese/index.html b/public_html/modules/sd2nd/language/japanese/index.html
new file mode 100644 (file)
index 0000000..2c5cdd3
--- /dev/null
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
diff --git a/public_html/modules/sd2nd/language/japanese/main.php b/public_html/modules/sd2nd/language/japanese/main.php
new file mode 100644 (file)
index 0000000..8b76e91
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+require_once XOOPS_TRUST_PATH . '/modules/sd2nd/language/japanese/main.php';
+
+?>
diff --git a/public_html/modules/sd2nd/language/japanese/modinfo.php b/public_html/modules/sd2nd/language/japanese/modinfo.php
new file mode 100644 (file)
index 0000000..5aa6db6
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+require_once XOOPS_TRUST_PATH . '/modules/sd2nd/language/japanese/modinfo.php';
+
+?>
diff --git a/public_html/modules/sd2nd/preload/AssetPreload.class.php b/public_html/modules/sd2nd/preload/AssetPreload.class.php
new file mode 100644 (file)
index 0000000..8b393ea
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+if(!class_exists('Sd2nd_AssetPreload'))
+{
+    require_once XOOPS_TRUST_PATH . '/modules/sd2nd/preload/AssetPreload.class.php';
+}
+
+?>
diff --git a/public_html/modules/sd2nd/preload/index.html b/public_html/modules/sd2nd/preload/index.html
new file mode 100644 (file)
index 0000000..2c5cdd3
--- /dev/null
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
diff --git a/public_html/modules/sd2nd/xoops_version.php b/public_html/modules/sd2nd/xoops_version.php
new file mode 100644 (file)
index 0000000..ffa2bbd
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+$myDirName = basename(dirname(__FILE__));
+require XOOPS_TRUST_PATH . '/modules/sd2nd/xoops_version.php';
+
+?>
diff --git a/trust_path/modules/sd2nd/actions/AbilityListAction.class.php b/trust_path/modules/sd2nd/actions/AbilityListAction.class.php
new file mode 100644 (file)
index 0000000..f91045b
--- /dev/null
@@ -0,0 +1,77 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+require_once SD2ND_TRUST_PATH . '/class/AbstractListAction.class.php';
+
+/**
+ * Sd2nd_AbilityListAction
+**/
+class Sd2nd_AbilityListAction extends Sd2nd_AbstractUpdateListAction
+{
+    /**
+     * &_getHandler
+     * 
+     * @param   void
+     * 
+     * @return  Sd2nd_AbilityHandler
+    **/
+    protected function &_getHandler()
+    {
+        $handler =& $this->mAsset->getObject('handler', 'ability');
+        return $handler;
+    }
+
+    /**
+     * &_getFilterForm
+     * 
+     * @param   void
+     * 
+     * @return  Sd2nd_AbilityFilterForm
+    **/
+    protected function &_getFilterForm()
+    {
+        // $filter =& new Sd2nd_AbilityFilterForm();
+        $filter =& $this->mAsset->getObject('filter', 'ability',false);
+        $filter->prepare($this->_getPageNavi(), $this->_getHandler());
+        return $filter;
+    }
+
+    /**
+     * _getBaseUrl
+     * 
+     * @param   void
+     * 
+     * @return  string
+    **/
+    protected function _getBaseUrl()
+    {
+        return './index.php?action=AbilityList';
+    }
+
+    /**
+     * executeViewIndex
+     * 
+     * @param   XCube_RenderTarget  &$render
+     * 
+     * @return  void
+    **/
+    public function executeViewIndex(/*** XCube_RenderTarget ***/ &$render)
+    {
+        $render->setTemplateName($this->mAsset->mDirname . '_ability_list.html');
+        #cubson::lazy_load_array('ability', $this->mObjects);
+        $render->setAttribute('objects', $this->mObjects);
+        $render->setAttribute('pageNavi', $this->mFilter->mNavi);
+        $render->setAttribute('updateHandler',$this->_mUpdateHandler);
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/actions/ActiveAbilityListAction.class.php b/trust_path/modules/sd2nd/actions/ActiveAbilityListAction.class.php
new file mode 100644 (file)
index 0000000..6d8ff5e
--- /dev/null
@@ -0,0 +1,94 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+require_once SD2ND_TRUST_PATH . '/class/AbstractListAction.class.php';
+
+/**
+ * Sd2nd_ActiveAbilityListAction
+**/
+class Sd2nd_ActiveAbilityListAction extends Sd2nd_AbstractListAction
+{
+    /**
+     * &_getHandler
+     * 
+     * @param   void
+     * 
+     * @return  Sd2nd_ActiveAbilityHandler
+    **/
+    protected function &_getHandler()
+    {
+        $handler =& $this->mAsset->getObject('handler', 'char');
+        return $handler;
+    }
+
+    /**
+     * &_getFilterForm
+     * 
+     * @param   void
+     * 
+     * @return  Sd2nd_ActiveAbilityFilterForm
+    **/
+    protected function &_getFilterForm()
+    {
+        // $filter =& new Sd2nd_ActiveAbilityFilterForm();
+        $filter =& $this->mAsset->getObject('filter', 'activeAbility',false);
+        $filter->prepare($this->_getPageNavi(), $this->_getHandler());
+        return $filter;
+    }
+
+    /**
+     * _getBaseUrl
+     * 
+     * @param   void
+     * 
+     * @return  string
+    **/
+    protected function _getBaseUrl()
+    {
+        return './index.php?action=ActiveAbilityList';
+    }
+
+    /**
+     * getDefaultView
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    public function getDefaultView()
+    {
+        $this->mFilter =& $this->_getFilterForm();
+        $this->mFilter->fetch();
+        
+        $handler =& $this->_getHandler();
+        $this->mObjects =& $handler->getActiveAbility($this->mFilter->getCriteria());
+        
+        return SD2ND_FRAME_VIEW_INDEX;
+    }
+
+    /**
+     * executeViewIndex
+     * 
+     * @param   XCube_RenderTarget  &$render
+     * 
+     * @return  void
+    **/
+    public function executeViewIndex(/*** XCube_RenderTarget ***/ &$render)
+    {
+        $render->setTemplateName($this->mAsset->mDirname . '_active_ability_list.html');
+        #cubson::lazy_load_array('active_ability', $this->mObjects);
+        $render->setAttribute('objects', $this->mObjects);
+        $render->setAttribute('pageNavi', $this->mFilter->mNavi);
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/actions/CostumeListAction.class.php b/trust_path/modules/sd2nd/actions/CostumeListAction.class.php
new file mode 100644 (file)
index 0000000..2d91eea
--- /dev/null
@@ -0,0 +1,77 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+require_once SD2ND_TRUST_PATH . '/class/AbstractListAction.class.php';
+
+/**
+ * Sd2nd_CostumeListAction
+**/
+class Sd2nd_CostumeListAction extends Sd2nd_AbstractUpdateListAction
+{
+    /**
+     * &_getHandler
+     * 
+     * @param   void
+     * 
+     * @return  Sd2nd_CostumeHandler
+    **/
+    protected function &_getHandler()
+    {
+        $handler =& $this->mAsset->getObject('handler', 'costume');
+        return $handler;
+    }
+
+    /**
+     * &_getFilterForm
+     * 
+     * @param   void
+     * 
+     * @return  Sd2nd_CostumeFilterForm
+    **/
+    protected function &_getFilterForm()
+    {
+        // $filter =& new Sd2nd_CostumeFilterForm();
+        $filter =& $this->mAsset->getObject('filter', 'costume',false);
+        $filter->prepare($this->_getPageNavi(), $this->_getHandler());
+        return $filter;
+    }
+
+    /**
+     * _getBaseUrl
+     * 
+     * @param   void
+     * 
+     * @return  string
+    **/
+    protected function _getBaseUrl()
+    {
+        return './index.php?action=CostumeList';
+    }
+
+    /**
+     * executeViewIndex
+     * 
+     * @param   XCube_RenderTarget  &$render
+     * 
+     * @return  void
+    **/
+    public function executeViewIndex(/*** XCube_RenderTarget ***/ &$render)
+    {
+        $render->setTemplateName($this->mAsset->mDirname . '_costume_list.html');
+        #cubson::lazy_load_array('costume', $this->mObjects);
+        $render->setAttribute('objects', $this->mObjects);
+        $render->setAttribute('pageNavi', $this->mFilter->mNavi);
+        $render->setAttribute('updateHandler',$this->_mUpdateHandler);
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/actions/IndexAction.class.php b/trust_path/modules/sd2nd/actions/IndexAction.class.php
new file mode 100644 (file)
index 0000000..6fd4175
--- /dev/null
@@ -0,0 +1,43 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+/**
+ * Sd2nd_IndexAction
+**/
+class Sd2nd_IndexAction extends Sd2nd_AbstractAction
+{
+    /**
+     * getDefaultView
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    public function getDefaultView()
+    {
+        return SD2ND_FRAME_VIEW_INDEX;
+    }
+    
+    /**
+     * executeViewIndex
+     * 
+     * @param   XCube_RenderTarget  &$render
+     * 
+     * @return  void
+    **/
+    public function executeViewIndex(/*** XCube_RenderTarget ***/ &$render)
+    {
+        $render->setTemplateName($this->mAsset->mDirname . '_index.html');
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/actions/LearnedAbilityListAction.class.php b/trust_path/modules/sd2nd/actions/LearnedAbilityListAction.class.php
new file mode 100644 (file)
index 0000000..42ab0cf
--- /dev/null
@@ -0,0 +1,94 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+require_once SD2ND_TRUST_PATH . '/class/AbstractListAction.class.php';
+
+/**
+ * Sd2nd_LearnedAbilityListAction
+**/
+class Sd2nd_LearnedAbilityListAction extends Sd2nd_AbstractListAction
+{
+    /**
+     * &_getHandler
+     * 
+     * @param   void
+     * 
+     * @return  Sd2nd_LearnedAbilityHandler
+    **/
+    protected function &_getHandler()
+    {
+        $handler =& $this->mAsset->getObject('handler', 'char');
+        return $handler;
+    }
+
+    /**
+     * &_getFilterForm
+     * 
+     * @param   void
+     * 
+     * @return  Sd2nd_LearnedAbilityFilterForm
+    **/
+    protected function &_getFilterForm()
+    {
+        // $filter =& new Sd2nd_LearnedAbilityFilterForm();
+        $filter =& $this->mAsset->getObject('filter', 'learnedAbility',false);
+        $filter->prepare($this->_getPageNavi(), $this->_getHandler());
+        return $filter;
+    }
+
+    /**
+     * _getBaseUrl
+     * 
+     * @param   void
+     * 
+     * @return  string
+    **/
+    protected function _getBaseUrl()
+    {
+        return './index.php?action=LearnedAbilityList';
+    }
+
+    /**
+     * getDefaultView
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    public function getDefaultView()
+    {
+        $this->mFilter =& $this->_getFilterForm();
+        $this->mFilter->fetch();
+        
+        $handler =& $this->_getHandler();
+        $this->mObjects =& $handler->getLearnedAbility($this->mFilter->getCriteria());
+        
+        return SD2ND_FRAME_VIEW_INDEX;
+    }
+
+    /**
+     * executeViewIndex
+     * 
+     * @param   XCube_RenderTarget  &$render
+     * 
+     * @return  void
+    **/
+    public function executeViewIndex(/*** XCube_RenderTarget ***/ &$render)
+    {
+        $render->setTemplateName($this->mAsset->mDirname . '_learned_ability_list.html');
+        #cubson::lazy_load_array('learned_ability', $this->mObjects);
+        $render->setAttribute('objects', $this->mObjects);
+        $render->setAttribute('pageNavi', $this->mFilter->mNavi);
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/actions/LearnedCostumeListAction.class.php b/trust_path/modules/sd2nd/actions/LearnedCostumeListAction.class.php
new file mode 100644 (file)
index 0000000..0f1b5e7
--- /dev/null
@@ -0,0 +1,76 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+require_once SD2ND_TRUST_PATH . '/class/AbstractListAction.class.php';
+
+/**
+ * Sd2nd_LearnedCostumeListAction
+**/
+class Sd2nd_LearnedCostumeListAction extends Sd2nd_AbstractListAction
+{
+    /**
+     * &_getHandler
+     * 
+     * @param   void
+     * 
+     * @return  Sd2nd_LearnedCostumeHandler
+    **/
+    protected function &_getHandler()
+    {
+        $handler =& $this->mAsset->getObject('handler', 'learned_costume');
+        return $handler;
+    }
+
+    /**
+     * &_getFilterForm
+     * 
+     * @param   void
+     * 
+     * @return  Sd2nd_LearnedCostumeFilterForm
+    **/
+    protected function &_getFilterForm()
+    {
+        // $filter =& new Sd2nd_LearnedCostumeFilterForm();
+        $filter =& $this->mAsset->getObject('filter', 'learned_costume',false);
+        $filter->prepare($this->_getPageNavi(), $this->_getHandler());
+        return $filter;
+    }
+
+    /**
+     * _getBaseUrl
+     * 
+     * @param   void
+     * 
+     * @return  string
+    **/
+    protected function _getBaseUrl()
+    {
+        return './index.php?action=LearnedCostumeList';
+    }
+
+    /**
+     * executeViewIndex
+     * 
+     * @param   XCube_RenderTarget  &$render
+     * 
+     * @return  void
+    **/
+    public function executeViewIndex(/*** XCube_RenderTarget ***/ &$render)
+    {
+        $render->setTemplateName($this->mAsset->mDirname . '_learned_costume_list.html');
+        #cubson::lazy_load_array('learned_costume', $this->mObjects);
+        $render->setAttribute('objects', $this->mObjects);
+        $render->setAttribute('pageNavi', $this->mFilter->mNavi);
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/actions/LearnedSkillListAction.class.php b/trust_path/modules/sd2nd/actions/LearnedSkillListAction.class.php
new file mode 100644 (file)
index 0000000..f50fead
--- /dev/null
@@ -0,0 +1,94 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+require_once SD2ND_TRUST_PATH . '/class/AbstractListAction.class.php';
+
+/**
+ * Sd2nd_LearnedSkillListAction
+**/
+class Sd2nd_LearnedSkillListAction extends Sd2nd_AbstractListAction
+{
+    /**
+     * &_getHandler
+     * 
+     * @param   void
+     * 
+     * @return  Sd2nd_LearnedSkillHandler
+    **/
+    protected function &_getHandler()
+    {
+        $handler =& $this->mAsset->getObject('handler', 'char');
+        return $handler;
+    }
+
+    /**
+     * &_getFilterForm
+     * 
+     * @param   void
+     * 
+     * @return  Sd2nd_LearnedSkillFilterForm
+    **/
+    protected function &_getFilterForm()
+    {
+        // $filter =& new Sd2nd_LearnedSkillFilterForm();
+        $filter =& $this->mAsset->getObject('filter', 'learnedSkill',false);
+        $filter->prepare($this->_getPageNavi(), $this->_getHandler());
+        return $filter;
+    }
+
+    /**
+     * _getBaseUrl
+     * 
+     * @param   void
+     * 
+     * @return  string
+    **/
+    protected function _getBaseUrl()
+    {
+        return './index.php?action=LearnedSkillList';
+    }
+
+    /**
+     * getDefaultView
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    public function getDefaultView()
+    {
+        $this->mFilter =& $this->_getFilterForm();
+        $this->mFilter->fetch();
+        
+        $handler =& $this->_getHandler();
+        $this->mObjects =& $handler->getLearnedSkill($this->mFilter->getCriteria());
+        
+        return SD2ND_FRAME_VIEW_INDEX;
+    }
+
+    /**
+     * executeViewIndex
+     * 
+     * @param   XCube_RenderTarget  &$render
+     * 
+     * @return  void
+    **/
+    public function executeViewIndex(/*** XCube_RenderTarget ***/ &$render)
+    {
+        $render->setTemplateName($this->mAsset->mDirname . '_learned_skill_list.html');
+        #cubson::lazy_load_array('learned_skill', $this->mObjects);
+        $render->setAttribute('objects', $this->mObjects);
+        $render->setAttribute('pageNavi', $this->mFilter->mNavi);
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/actions/MapViewAction.class.php b/trust_path/modules/sd2nd/actions/MapViewAction.class.php
new file mode 100644 (file)
index 0000000..acc7d1e
--- /dev/null
@@ -0,0 +1,73 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+
+/**
+ * Sd2nd_MapViewAction
+**/
+class Sd2nd_MapViewAction extends Sd2nd_AbstractAction
+{
+    protected /*** Sd2nd_UpdateHandler ***/ $_mUpdateHandler = null;
+    protected /*** Sd2nd_MapCollection ***/ $_mMapCollection = null;
+    protected /*** Sd2nd_MapNameHandler ***/ $_mMapNameHandler = null;
+    protected /*** Sd2nd_MapNameObject ***/ $_mMapNameObject = null;
+    
+    /**
+     * getDefaultView
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    public function getDefaultView()
+    {
+        $this->_mUpdateHandler =& $this->mAsset->getObject('handler','update');
+        $this->_mMapNameHandler =& $this->mAsset->getObject('handler','mapName');
+        if(!$this->_mMapNameHandler->isValid($mapId = $this->mRoot->mContext->mRequest->getRequest('map')))
+        {
+            $mapId = 1;
+        }
+        if(intval($updateTime = $this->mRoot->mContext->mRequest->getRequest('update_time')) == null)
+        {
+            $updateTime = $this->_mUpdateHandler->getLatestUpdate()->get('update_time');
+        }
+        if($updateTime == null)
+        {
+            $updateTime = 999999;
+        }
+        
+        $handler =& $this->mAsset->getObject('handler', 'map');
+        $this->_mMapCollection = $handler->getCollection($updateTime,$updateTime,$mapId);
+        $this->_mMapNameObject =& $this->_mMapNameHandler->get($mapId);
+        
+        return SD2ND_FRAME_VIEW_INDEX;
+    }
+    
+    /**
+     * executeViewIndex
+     * 
+     * @param   XCube_RenderTarget  &$render
+     * 
+     * @return  void
+    **/
+    public function executeViewIndex(/*** XCube_RenderTarget ***/ &$render)
+    {
+        $render->setTemplateName($this->mAsset->mDirname . '_map_view.html');
+        
+        $render->setAttribute('map',$this->_mMapCollection);
+        $render->setAttribute('updateHandler',$this->_mUpdateHandler);
+        $render->setAttribute('mapNameHandler',$this->_mMapNameHandler);
+        $render->setAttribute('mapName',$this->_mMapNameObject);
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/actions/SkillListAction.class.php b/trust_path/modules/sd2nd/actions/SkillListAction.class.php
new file mode 100644 (file)
index 0000000..a32d894
--- /dev/null
@@ -0,0 +1,101 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+require_once SD2ND_TRUST_PATH . '/class/AbstractListAction.class.php';
+
+/**
+ * Sd2nd_SkillListAction
+**/
+class Sd2nd_SkillListAction extends Sd2nd_AbstractUpdateListAction
+{
+    /**
+     * &_getHandler
+     * 
+     * @param   void
+     * 
+     * @return  Sd2nd_SkillHandler
+    **/
+    protected function &_getHandler()
+    {
+        $handler =& $this->mAsset->getObject('handler', 'skill');
+        return $handler;
+    }
+
+    /**
+     * &_getFilterForm
+     * 
+     * @param   void
+     * 
+     * @return  Sd2nd_SkillFilterForm
+    **/
+    protected function &_getFilterForm()
+    {
+        // $filter =& new Sd2nd_SkillFilterForm();
+        $filter =& $this->mAsset->getObject('filter', 'skill',false);
+        $filter->prepare($this->_getPageNavi(), $this->_getHandler());
+        return $filter;
+    }
+
+    /**
+     * _getBaseUrl
+     * 
+     * @param   void
+     * 
+     * @return  string
+    **/
+    protected function _getBaseUrl()
+    {
+        return './index.php?action=SkillList';
+    }
+
+    /**
+     * getDefaultView
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    public function getDefaultView()
+    {
+        $this->mFilter =& $this->_getFilterForm();
+        $this->mFilter->fetch();
+    
+        $handler =& $this->_getHandler();
+        $this->mObjects =& $handler->getObjects($this->mFilter->getCriteria(),null,null,true);
+    
+        return SD2ND_FRAME_VIEW_INDEX;
+    }
+
+    /**
+     * executeViewIndex
+     * 
+     * @param   XCube_RenderTarget  &$render
+     * 
+     * @return  void
+    **/
+    public function executeViewIndex(/*** XCube_RenderTarget ***/ &$render)
+    {
+        $render->setTemplateName($this->mAsset->mDirname . '_skill_list.html');
+        #cubson::lazy_load_array('skill', $this->mObjects);
+        $handler =& $this->mAsset->getObject('handler','SkillElementLink');
+        $handler->setupSkillElement($this->mObjects);
+        
+        $render->setAttribute('objects', $this->mObjects);
+        $render->setAttribute('pageNavi', $this->mFilter->mNavi);
+        $render->setAttribute('updateHandler',$this->_mUpdateHandler);
+        $render->setAttribute('targetHandler',$this->mAsset->getObject('handler','target'));
+        $render->setAttribute('kindHandler',$this->mAsset->getObject('handler','kind'));
+        $render->setAttribute('elementLinkHandler',$handler);
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/admin/class/Sd2ndAdminRenderSystem.class.php b/trust_path/modules/sd2nd/admin/class/Sd2ndAdminRenderSystem.class.php
new file mode 100644 (file)
index 0000000..0793c92
--- /dev/null
@@ -0,0 +1,304 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+define('SD2ND_ADMIN_RENDER_TEMPLATE_DIRNAME','templates');
+define('SD2ND_ADMIN_RENDER_FALLBACK_PATH',XOOPS_MODULE_PATH . '/legacy/admin/theme');    // TODO will be use other path
+define('SD2ND_ADMIN_RENDER_FALLBACK_URL',XOOPS_MODULE_URL . '/legacy/admin/theme');    // TODO will be use other url
+
+/**
+ * Sd2nd_AdminRenderSystem
+**/
+class Sd2nd_AdminRenderSystem extends Legacy_AdminRenderSystem
+{
+    /**
+     * prepare
+     * 
+     * @param   XCube_Controller  &$controller
+     * 
+     * @return  void
+    **/
+    public function prepare(/*** XCube_Controller ***/ &$controller)
+    {
+        $this->mController =& $controller;
+    
+        $this->mSmarty =& new Legacy_AdminSmarty();    // TODO will be use other class?
+        $this->mSmarty->register_modifier('theme',array($this,'modifierTheme'));
+        $this->mSmarty->register_function('stylesheet',array($this,'functionStylesheet'));
+    
+        $this->mSmarty->assign(
+            array(
+                'xoops_url'        => XOOPS_URL,
+                'xoops_rootpath'   => XOOPS_ROOT_PATH,
+                'xoops_langcode'   => _LANGCODE,
+                'xoops_charset'    => _CHARSET,
+                'xoops_version'    => XOOPS_VERSION,
+                'xoops_upload_url' => XOOPS_UPLOAD_URL
+            )
+        );
+    
+        // TODO event name is this?
+        XCube_DelegateUtils::call('XoopsTpl.New',new XCube_Ref($this->mSmarty));
+    
+        $this->mSmarty->force_compile = (
+            $controller->mRoot->mSiteConfig['Legacy_AdminRenderSystem']['ThemeDevelopmentMode'] ||
+            $controller->mRoot->mContext->getXoopsConfig('theme_fromfile')
+        );
+    }
+
+    /**
+     * renderBlock
+     * 
+     * @param   XCube_RenderTarget  &$target
+     * 
+     * @return  void
+    **/
+    public function renderBlock(/*** XCube_RenderTarget ***/ &$target)
+    {
+        parent::renderBlock($target);    // TODO will be use other method
+    }
+
+    /**
+     * renderTheme
+     * 
+     * @param   XCube_RenderTarget  &$target
+     * 
+     * @return  void
+    **/
+    public function renderTheme(/*** XCube_RenderTarget ***/ &$target)
+    {
+        $module =& $this->mController->getVirtualCurrentModule();
+        $context =& $this->mController->mRoot->getContext();
+        $this->mSmarty->assign($target->getAttributes());
+        $this->mSmarty->assign(
+            array(
+                'stdout_buffer'    => $this->_mStdoutBuffer,
+                'currentModule'       => $module,
+                'legacy_sitename'  => $context->getAttribute('legacy_sitename'),
+                'legacy_pagetitle' => $context->getAttribute('legacy_pagetitle'),
+                'legacy_slogan'    => $context->getAttribute('legacy_slogan')
+            )
+        );
+    
+        $blocks = array();
+        foreach($context->mAttributes['legacy_BlockContents'][0] as $block)
+        {
+            $blocks[$block['name']] = $block;
+        }
+        $this->mSmarty->assign('xoops_lblocks',$blocks);
+    
+        $info = Sd2nd_AdminRenderSystem::getOverrideFileInfo('admin_theme.html');
+        $this->mSmarty->template_dir = ($info['file'] != null) ?
+            substr($file['path'],0,-15) :
+            SD2ND_ADMIN_RENDER_FALLBACK_PATH;
+        $this->mSmarty->setModulePrefix('');
+    
+        $target->setResult($this->mSmarty->fetch('file:admin_theme.html'));
+    }
+
+    /**
+     * renderMain
+     * 
+     * @param   XCube_RenderTarget  &$target
+     * 
+     * @return  void
+    **/
+    public function renderMain(/*** XCube_RenderTarget ***/ &$target)
+    {
+        $info = Sd2nd_AdminRenderSystem::getOverrideFileInfo($target->getTemplateName());
+        $this->mSmarty->compile_id = $info['dirname'];
+        $this->mSmarty->assign($target->getAttributes());
+        $this->mSmarty->template_dir = substr($info['path'],0,-strlen($info['file']));
+    
+        $res =& $this->mSmarty->fetch('file:' . $info['file']);
+        $target->setResult($res);
+        $this->_mStdoutBuffer .= $target->getAttribute('stdout_buffer');
+    
+        foreach($target->getAttributes() as $key => $val)
+        {
+            $this->mSmarty->clear_assign($key);
+        }
+    }
+
+    /**
+     * getOverrideFileInfo
+     * 
+     * @param   string  $file
+     * @param   string  $prefix
+     * @param   bool  $isSpDirName
+     * 
+     * @return  {string 'theme',string 'file',string 'dirname'}
+    **/
+    public static function getOverrideFileInfo(/*** string ***/ $file,/*** string ***/ $prefix = null,/*** bool ***/ $isSpDirName = false)
+    {
+        $ret = array(
+            'url'     => null,
+            'path'    => null,
+            'theme'   => null,
+            'dirname' => null,
+            'file'    => null
+        );
+        if(strpos($file,'..') !== false || strpos($prefix,'..' !== false))
+        {
+            return $ret;
+        }
+        $root =& XCube_Root::getSingleton();
+    
+        $module =& $root->mContext->mXoopsModule;
+        $dirName = $root->mContext->mRequest->getRequest('dirname');
+        if($isSpDirName && preg_match('/^\w+$/',$dirName))
+        {
+            $handler =& Sd2nd_Utils::getXoopsHandler('module');
+            $module =& $handler->getByDirname($dirName);
+        }
+    
+        $isModule = is_object($module);
+        $theme = $root->mSiteConfig['Legacy']['Theme'];
+        $ret['theme'] = $theme;
+        $dirName = $isModule ? $module->get('dirname') : null;
+        $trustDirName = $isModule ? $module->getInfo('trust_dirname') : null;
+        $ret['file']  = $file;
+    
+        $file = $prefix . $file;
+    
+        switch(true)
+        {
+            case $isModule && file_exists(
+                $path = sprintf(
+                    '%s/modules/%s/%s',
+                    XOOPS_THEME_PATH,$theme,$dirName,$file
+                )
+            ):
+                $ret['url'] = sprintf(
+                    '%s/%s/modules/%s/%s',
+                    XOOPS_THEME_URL,$theme,$dirName,$file
+                );
+                $ret['path'] = $path;
+                return $ret;
+            case $isModule && file_exists(
+                $path = sprintf(
+                    '%s/themes/%s/modules/%s/%s',
+                    XOOPS_TRUST_PATH,$theme,$trustDirName,$file
+                )
+            ):
+                $ret['path'] = $path;
+                $ret['dirname'] = $trustDirName;
+                return $ret;
+            case file_exists(
+                $path = sprintf(
+                    '%s/%s/%s',
+                    XOOPS_THEME_PATH,$theme,$file
+                )
+            ):
+                $ret['url'] = sprintf(
+                    '%s/%s/%s',
+                    XOOPS_THEME_URL,$theme,$file
+                );
+                $ret['path'] = $path;
+                $ret['dirname'] = null;
+                return $ret;
+            case file_exists(
+                $path = sprintf(
+                    '%s/themes/%s/%s',
+                    XOOPS_TRUST_PATH,$theme,$file
+                )
+            ):
+                $ret['path'] = $path;
+                $ret['dirname'] = null;
+                return $ret;
+            case $isModule && file_exists(
+                $path = sprintf(
+                    '%s/%s/admin/templates/%s',
+                    XOOPS_MODULE_PATH,$dirName,$file
+                )
+            ):
+                $ret['url'] = sprintf(
+                    '%s/%s/admin/templates/%s',
+                    XOOPS_MODULE_URL,$dirName,$file
+                );
+                $ret['path'] = $path;
+                $ret['theme'] = null;
+                return $ret;
+            case $isModule && file_exists(
+                $path = sprintf(
+                    '%s/modules/%s/admin/templates/%s',
+                    XOOPS_TRUST_PATH,$trustDirName,$file
+                )
+            ):
+                $ret['path'] = $path;
+                $ret['theme'] = null;
+                $ret['dirname'] = $trustDirName;
+                return $ret;
+            case file_exists($path = SD2ND_ADMIN_RENDER_FALLBACK_PATH . '/' .$file):
+                $ret['url'] = SD2ND_ADMIN_RENDER_FALLBACK_URL . '/' . $file;
+                $ret['path'] = $path;
+                $ret['theme'] = null;
+                $ret['dirname'] = null;
+                return $ret;
+            default:
+                $ret['theme'] = null;
+                $ret['dirname'] = null;
+                $ret['file'] = null;
+                return $ret;
+        }
+    }
+
+    /**
+     * modifierTheme
+     * 
+     * @param   string  $str
+     * 
+     * @return  string
+    **/
+    public static function modifierTheme(/*** string ***/ $str)
+    {
+        $info = Sd2nd_AdminRenderSystem::getOverrideFileInfo($str);
+        if($info['url'] != null)
+        {
+            return $info['url'];
+        }
+        return SD2ND_ADMIN_RENDER_FALLBACK_URL . '/' . $str;
+    }
+
+    /**
+     * functionStylesheet
+     * 
+     * @param   {string 'file',string 'media'}  $param
+     * @param   Smarty  &$smarty
+     * 
+     * @return  void
+    **/
+    public static function functionStylesheet(/*** {string 'file',string 'media'} ***/ $param,/*** Smarty ***/ &$smarty)
+    {
+        if(!isset($params['file']) || strpos($params['file'],'..') !== false)
+        {
+            return;
+        }
+    
+        $info = Sd2nd_AdminRenderSystem::getOverrideFileInfo($params['file'],'stylesheets/');
+        if($info['file'] == null)
+        {
+            return;
+        }
+    
+        // TODO will be use other method
+        printf(
+            '<link rel="stylesheet" typw="text/css" media="%s" href="%s/legacy/admin/css.php?file=%s%s%s" />',
+            (isset($params['media']) ? $params['media'] : 'all'),
+            XOOPS_MODULE_URL,
+            $info['file'],
+            ($info['dirname'] != null ? '&amp;dirname=' . $info['dirname'] : ''),
+            ($info['theme'] != null ? '&amp;theme=' . $info['theme'] : '')
+        );
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/admin/class/installer/Sd2ndInstallUtils.class.php b/trust_path/modules/sd2nd/admin/class/installer/Sd2ndInstallUtils.class.php
new file mode 100644 (file)
index 0000000..be06ce5
--- /dev/null
@@ -0,0 +1,1234 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+if(class_exists('Sd2nd_InstallUtils'))
+{
+    return;
+}
+
+/**
+ * Sd2nd_InstallUtils
+**/
+class Sd2nd_InstallUtils
+{
+    /**
+     * installSQLAutomatically
+     * 
+     * @param   XoopsModule  &$module
+     * @param   Legacy_ModuleInstallLog  &$log
+     * 
+     * @return  bool
+    **/
+    public static function installSQLAutomatically(/*** XoopsModule ***/ &$module,/*** Legacy_ModuleInstallLog ***/ &$log)
+    {
+        $sqlFileInfo =& $module->getInfo('sqlfile');
+        if(!isset($sqlFileInfo[XOOPS_DB_TYPE]))
+        {
+            return true;
+        }
+        $sqlFile = $sqlFileInfo[XOOPS_DB_TYPE];
+    
+        $dirname = $module->getVar('dirname');
+        $sqlFilePath = sprintf('%s/%s/%s',XOOPS_MODULE_PATH,$dirname,$sqlFile);
+        if(!file_exists($sqlFilePath))
+        {
+            $sqlFilePath = sprintf(
+                '%s/modules/%s/%s',
+                XOOPS_TRUST_PATH,
+                $module->modinfo['trust_dirname'],
+                $sqlFile
+            );
+        }
+    
+        require_once XOOPS_MODULE_PATH . '/legacy/admin/class/Legacy_SQLScanner.class.php';    // TODO will be use other class?
+        $scanner =& new Legacy_SQLScanner();
+        $scanner->setDB_PREFIX(XOOPS_DB_PREFIX);
+        $scanner->setDirname($dirname);
+        if(!$scanner->loadFile($sqlFilePath))
+        {
+            $log->addError(
+                XCube_Utils::formatString(
+                    _MI_SD2ND_INSTALL_ERROR_SQL_FILE_NOT_FOUND,
+                    $sqlFile
+                )
+            );
+            return false;
+        }
+    
+        $scanner->parse();
+        $root =& XCube_Root::getSingleton();
+        $db =& $root->mController->getDB();
+    
+        foreach($scanner->getSQL() as $sql)
+        {
+            if(!$db->query($sql))
+            {
+                $log->addError($db->error());
+                return false;
+            }
+        }
+        $log->addReport(_MI_SD2ND_INSTALL_MSG_DB_SETUP_FINISHED);
+        return true;
+    }
+
+    /**
+     * DBquery
+     * 
+     * @param   string  $query
+     * @param   XoopsModule  &$module
+     * @param   Legacy_ModuleInstallLog  &$log
+     * 
+     * @return  bool
+    **/
+    public static function DBquery(/*** string ***/ $query,/*** XoopsModule ***/ &$module,/*** Legacy_ModuleInstallLog ***/ &$log)
+    {
+        require_once XOOPS_MODULE_PATH . '/legacy/admin/class/Legacy_SQLScanner.class.php';    // TODO will be use other class?
+        $scanner =& new Legacy_SQLScanner();
+        $scanner->setDB_PREFIX(XOOPS_DB_PREFIX);
+        $scanner->setDirname($module->get('dirname'));
+        $scanner->setBuffer($query);
+        $scanner->parse();
+        $sqls = $scanner->getSQL();
+    
+        $root =& XCube_Root::getSingleton();
+    
+        $successFlag = true;
+        foreach($sqls as $sql)
+        {
+            if($root->mController->mDB->query($sql))
+            {
+                $log->addReport(
+                    XCube_Utils::formatString(
+                        _MI_SD2ND_INSTALL_MSG_SQL_SUCCESS,
+                        $sql
+                    )
+                );
+            }
+            else
+            {
+                $log->addReport(
+                    XCube_Utils::formatString(
+                        _MI_SD2ND_INSTALL_MSG_SQL_ERROR,
+                        $sql
+                    )
+                );
+                $successFlag = false;
+            }
+        }
+        return $successFlag;
+    }
+
+    /**
+     * replaceDirname
+     * 
+     * @param   string  $from
+     * @param   string  $dirname
+     * @param   string  $trustDirname
+     * 
+     * @return  {string 'public',string 'trust'}
+    **/
+    public static function replaceDirname(/*** string ***/ $from,/*** string ***/ $dirname,/*** string ***/ $trustDirname = null)
+    {
+        return array(
+            'public' => str_replace('{dirname}',$dirname,$from),
+            'trust' => ($trustDirname != null) ? str_replace('{dirname}',$trustDirname,$from) : null
+        );
+    }
+
+    /**
+     * readTemplateFile
+     * 
+     * @param   string  $dirname
+     * @param   string  $trustDirname
+     * @param   string  $filename
+     * @param   bool  $isBlock
+     * 
+     * @return  string
+    **/
+    public static function readTemplateFile(/*** string ***/ $dirname,/*** string ***/ $trustDirname,/*** string ***/ $filename,/*** bool ***/ $isBlock = false)
+    {
+        $filePath = sprintf(
+            '%s/%s/templates/%s%s',
+            XOOPS_MODULE_PATH,
+            $dirname,
+            ($isBlock ? 'blocks/' : ''),
+            $filename
+        );
+    
+        if(!file_exists($filePath))
+        {
+            $filePath = sprintf(
+                '%s/modules/%s/templates/%s%s',
+                XOOPS_TRUST_PATH,
+                $trustDirname,
+                ($isBlock ? 'blocks/' : ''),
+                $filename
+            );
+            if(!file_exists($filePath))
+            {
+                return false;
+            }
+        }
+    
+        if(!($lines = file($filePath)))
+        {
+            return false;
+        }
+    
+        $tplData = '';
+        foreach($lines as $line)
+        {
+            $tplData .= str_replace("\n","\r\n",str_replace("\r\n","\n",$line));
+        }
+    
+        return $tplData;
+    }
+
+    /**
+     * installAllOfModuleTemplates
+     * 
+     * @param   XoopsModule  &$module
+     * @param   Legacy_ModuleInstallLog  &$log
+     * 
+     * @return  void
+    **/
+    public static function installAllOfModuleTemplates(/*** XoopsModule ***/ &$module,/*** Legacy_ModuleInstallLog ***/ &$log)
+    {
+        $templates =& $module->getInfo('templates');
+        if(is_array($templates) && count($templates) > 0)
+        {
+            foreach($templates as $template)
+            {
+                Sd2nd_InstallUtils::installModuleTemplate($module,$template,$log);
+            }
+        }
+    }
+
+    /**
+     * installModuleTemplate
+     * 
+     * @param   XoopsModule  &$module
+     * @param   string[]  $template
+     * @param   Legacy_ModuleInstallLog  &$log
+     * 
+     * @return  bool
+    **/
+    public static function installModuleTemplate(/*** XoopsModule ***/ &$module,/*** string[] ***/ $template,/*** Legacy_ModuleInstallLog ***/ &$log)
+    {
+        $dirname = $module->getVar('dirname');
+        $trustDirname =& $module->getInfo('trust_dirname');
+        $tplHandler =& Sd2nd_Utils::getXoopsHandler('tplfile');
+        $filename   =  Sd2nd_InstallUtils::replaceDirname(trim($template['file']),$dirname,$trustDirname);
+        $tplData    =  Sd2nd_InstallUtils::readTemplateFile($dirname,$trustDirname,$filename['trust']);
+    
+        if($tplData == false)
+        {
+            return false;
+        }
+    
+        $tplFile =& $tplHandler->create();
+        $tplFile->setVar('tpl_refid'       ,$module->getVar('mid'));
+        $tplFile->setVar('tpl_lastimported',0);
+        $tplFile->setVar('tpl_lastmodified',time());
+        $tplFile->setVar('tpl_type'        ,(substr($filename['trust'],-4) == '.css') ? 'css' : 'module');
+        $tplFile->setVar('tpl_source'      ,$tplData,true);
+        $tplFile->setVar('tpl_module'      ,$module->getVar('dirname'));
+        $tplFile->setVar('tpl_tplset'      ,'default');
+        $tplFile->setVar('tpl_file'        ,$filename['public'],true);
+        $tplFile->setVar('tpl_desc'        ,isset($template['desctiption']) ? $template['description'] : '',true);
+    
+        if($tplHandler->insert($tplFile))
+        {
+            $log->addReport(
+                XCube_Utils::formatString(
+                    _MI_SD2ND_INSTALL_MSG_TPL_INSTALLED,
+                    $filename['public']
+                )
+            );
+        }
+        else
+        {
+            $log->addError(
+                XCube_Utils::formatString(
+                    _MI_SD2ND_INSTALL_ERROR_TPL_INSTALLED,
+                    $filename['public']
+                )
+            );
+            return false;
+        }
+    
+        return true;
+    }
+
+    /**
+     * uninstallAllOfModuleTemplates
+     * 
+     * @param   XoopsModule  &$module
+     * @param   Legacy_ModuleInstallLog  &$log
+     * @param   bool  $defaultOnly
+     * 
+     * @return  void
+    **/
+    public static function uninstallAllOfModuleTemplates(/*** XoopsModule ***/ &$module,/*** Legacy_ModuleInstallLog ***/ &$log,/*** bool ***/ $defaultOnly = true)
+    {
+        $tplHandler   =& Sd2nd_Utils::getXoopsHandler('tplfile');
+    
+        $delTemplates =& $tplHandler->find($defaultOnly ? 'default' : null,'module',$module->get('mid'));
+    
+        if(is_array($delTemplates) && count($delTemplates) > 0)
+        {
+            $xoopsTpl =& new XoopsTpl();
+            $xoopsTpl->clear_cache(null,'mod_' . $module->get('dirname'));
+            foreach($delTemplates as $tpl)
+            {
+                if(!$tplHandler->delete($tpl))
+                {
+                    $log->addError(
+                        XCube_Utils::formatString(
+                            _MI_SD2ND_INSTALL_ERROR_TPL_UNINSTALLED,
+                            $tpl->get('tpl_file')
+                        )
+                    );
+                }
+            }
+        }
+    }
+
+    /**
+     * installAllOfBlocks
+     * 
+     * @param   XoopsModule  &$module
+     * @param   Legacy_ModuleInstallLog  &$log
+     * 
+     * @return  bool
+    **/
+    public static function installAllOfBlocks(/*** XoopsModule ***/ &$module,/*** Legacy_ModuleInstallLog ***/ &$log)
+    {
+        $blocks =& $module->getInfo('blocks');
+        if(is_array($blocks) && count($blocks) > 0)
+        {
+            foreach($blocks as $block)
+            {
+                $newBlock =& Sd2nd_InstallUtils::createBlockByInfo($module,$block);
+                Sd2nd_InstallUtils::installBlock($module,$newBlock,$block,$log);
+            }
+        }
+        return true;
+    }
+
+    /**
+     * &createBlockByInfo
+     * 
+     * @param   XoopsModule  &$module
+     * @param   string[]  $block
+     * 
+     * @return  XoopsBlock
+    **/
+    public static function &createBlockByInfo(/*** XoopsModule ***/ &$module,/*** string[] ***/ $block)
+    {
+        $visible = isset($block['visible']) ?
+            $block['visible'] :
+            (isset($block['visible_any']) ? $block['visible_any'] : 0);
+        $filename = isset($block['template']) ?
+            Sd2nd_InstallUtils::replaceDirname($block['template'],$module->get('dirname')) :
+            null;
+    
+        $blockHandler =& Sd2nd_Utils::getXoopsHandler('block');
+        $blockObj =& $blockHandler->create();
+    
+        $blockObj->set('mid',$module->getVar('mid'));
+        $blockObj->set('options',isset($block['options']) ? $block['options'] : null);
+        $blockObj->set('name',$block['name']);
+        $blockObj->set('title',$block['name']);
+        $blockObj->set('block_type','M');
+        $blockObj->set('c_type','1');
+        $blockObj->set('isactive',1);
+        $blockObj->set('dirname',$module->getVar('dirname'));
+        $blockObj->set('func_file',$block['file']);
+        $blockObj->set('show_func','cl::' . $block['class']);
+        $blockObj->set('template',$filename['public']);
+        $blockObj->set('last_modified',time());
+        $blockObj->set('visible',$visible);
+        $blockObj->set('func_num',intval($block['func_num']));
+        return $blockObj;
+    }
+
+    /**
+     * installBlock
+     * 
+     * @param   XoopsModule  &$module
+     * @param   XoopsBlock  &$blockObj
+     * @param   string[]  &$block
+     * @param   Legacy_ModuleInstallLog  &$log
+     * 
+     * @return  bool
+    **/
+    public static function installBlock(/*** XoopsModule ***/ &$module,/*** XoopsBlock ***/ &$blockObj,/*** string[] ***/ &$block,/*** Legacy_ModuleInstallLog ***/ &$log)
+    {
+        $isNew = $blockObj->isNew();
+        $blockHandler =& Sd2nd_Utils::getXoopsHandler('block');
+        $autoLink = isset($block['show_all_module']) ? $block['show_all_module'] : false;
+    
+        if(!$blockHandler->insert($blockObj,$autoLink))
+        {
+            $log->addError(
+                XCube_Utils::formatString(
+                    _MI_SNEWS_INSTALL_ERROR_BLOCK_INSTALLED,
+                    $blockObj->getVar('name')
+                )
+            );
+            return false;
+        }
+    
+        $log->addReport(
+            XCube_Utils::formatString(
+                _MI_SD2ND_INSTALL_MSG_BLOCK_INSTALLED,
+                $blockObj->getVar('name')
+            )
+        );
+    
+        Sd2nd_InstallUtils::installBlockTemplate($blockObj,$module,$log);
+    
+        if(!$isNew)
+        {
+            return true;
+        }
+    
+        if($autoLink)
+        {
+            $sql = sprintf(
+                'insert into `%s` set (`block_id`,`module_id`) values (%d,0);',
+                $blockHandler->db->prefix('block_module_link'),
+                $blockObj->getVar('bid')
+            );
+            if(!$blockHandler->db->query($sql))
+            {
+                $log->addWarning(
+                    XCube_Utils::formatString(
+                        _MI_SD2ND_INSTALL_ERROR_BLOCK_COULD_NOT_LINK,
+                        $blockObj->getVar('name')
+                    )
+                );
+            }
+        }
+    
+        $gpermHandler =& Sd2nd_Utils::getXoopsHandler('groupperm');
+        $perm =& $gpermHandler->create();
+        $perm->setVar('gperm_itemid',$blockObj->getVar('bid'));
+        $perm->setVar('gperm_name','block_read');
+        $perm->setVar('gperm_modid',1);
+        if(isset($block['visible_any']) && $block['visible_any'])
+        {
+            $memberHandler =& Sd2nd_Utils::getXoopsHandler('member');
+            $groups =& $memberHandler->getGroups();
+            foreach($groups as $group)
+            {
+                $perm->setVar('gperm_groupid',$group->getVar('groupid'));
+                $perm->setNew();
+                if(!$gpermHandler->insert($perm))
+                {
+                    $log->addWarning(
+                        XCube_Utils::formatString(
+                            _MI_SD2ND_INSTALL_ERROR_PERM_COULD_NOT_SET,
+                            $blockObj->getVar('name')
+                        )
+                    );
+                }
+            }
+        }
+        else
+        {
+            $root =& XCube_Root::getSingleton();
+            $groups = $root->mContext->mXoopsUser->getGroups();
+            foreach($groups as $group)
+            {
+                $perm->setVar('gperm_groupid',$group);
+                $perm->setNew();
+                if(!$gpermHandler->insert($perm))
+                {
+                    $log->addWarning(
+                        XCube_Utils::formatString(
+                            _MI_SD2ND_INSTALL_ERROR_BLOCK_PERM_SET,
+                            $blockObj->getVar('name')
+                        )
+                    );
+                }
+            }
+        }
+    
+        return true;
+    }
+
+    /**
+     * installBlockTemplate
+     * 
+     * @param   XoopsBlock  &$block
+     * @param   XoopsModule  &$module
+     * @param   Legacy_ModuleInstallLog  &$log
+     * 
+     * @return  bool
+    **/
+    public static function installBlockTemplate(/*** XoopsBlock ***/ &$block,/*** XoopsModule ***/ &$module,/*** Legacy_ModuleInstallLog ***/ &$log)
+    {
+        if($block->get('template') == null)
+        {
+            return true;
+        }
+    
+        $info =& $module->getInfo('blocks');
+        $filename = Sd2nd_InstallUtils::replaceDirname(
+            $info[$block->get('func_num')]['template'],
+            $module->get('dirname'),
+            $module->getInfo('trust_dirname')
+        );
+        $tplHandler =& Sd2nd_Utils::getXoopsHandler('tplfile');
+    
+        $cri =& new CriteriaCompo();
+        $cri->add(new Criteria('tpl_type','block'));
+        $cri->add(new Criteria('tpl_tplset','default'));
+        $cri->add(new Criteria('tpl_module',$module->get('dirname')));
+        $cri->add(new Criteria('tpl_file',$filename['public']));
+    
+        $tpls =& $tplHandler->getObjects($cri);
+    
+        if(count($tpls) > 0)
+        {
+            $tplFile =& $tpls[0];
+        }
+        else
+        {
+            $tplFile =& $tplHandler->create();
+            $tplFile->set('tpl_refid',$block->get('bid'));
+            $tplFile->set('tpl_tplset','default');
+            $tplFile->set('tpl_file',$filename['public']);
+            $tplFile->set('tpl_module',$module->get('dirname'));
+            $tplFile->set('tpl_type','block');
+            //$tplFile->set('tpl_desc',$block->get('description'));
+            $tplFile->set('tpl_lastimported',0);
+        }
+    
+        $tplSource = Sd2nd_InstallUtils::readTemplateFile(
+            $module->get('dirname'),
+            $module->getInfo('trust_dirname'),
+            $filename['trust'],
+            true
+        );
+    
+        $tplFile->set('tpl_source',$tplSource);
+        $tplFile->set('tpl_lastmodified',time());
+        if($tplHandler->insert($tplFile))
+        {
+            $log->addReport(
+                XCube_Utils::formatString(
+                    _MI_SD2ND_INSTALL_MSG_BLOCK_TPL_INSTALLED,
+                    $filename['public']
+                )
+            );
+            return true;
+        }
+    
+        $log->addError(
+            XCube_Utils::formatString(
+                _MI_SD2ND_INSTALL_ERROR_BLOCK_TPL_INSTALLED,
+                $filename['public']
+            )
+        );
+        return false;
+    }
+
+    /**
+     * uninstallAllOfBlocks
+     * 
+     * @param   XoopsModule  &$module
+     * @param   Legacy_ModuleInstallLog  &$log
+     * 
+     * @return  bool
+    **/
+    public static function uninstallAllOfBlocks(/*** XoopsModule ***/ &$module,/*** Legacy_ModuleInstallLog ***/ &$log)
+    {
+        $successFlag = true;
+    
+        $blockHandler =& Sd2nd_Utils::getXoopsHandler('block');
+        $gpermHandler =& Sd2nd_Utils::getXoopsHandler('groupperm');
+        $cri =& new Criteria('mid',$module->get('mid'));
+        $blocks =& $blockHandler->getObjectsDirectly($cri);
+    
+        foreach($blocks as $block)
+        {
+            if($blockHandler->delete($block))
+            {
+                $log->addReport(
+                    XCube_Utils::formatString(
+                        _MI_SD2ND_INSTALL_MSG_BLOCK_UNINSTALLED,
+                        $block->get('name')
+                    )
+                );
+            }
+            else
+            {
+                $log->addWarning(
+                    XCube_Utils::formatString(
+                        _MI_SD2ND_INSTALL_ERROR_BLOCK_UNINSTALLED,
+                        $block->get('name')
+                    )
+                );
+                $successFlag = false;
+            }
+            
+            $cri =& new CriteriaCompo();
+            $cri->add(new Criteria('gperm_name','block_read'));
+            $cri->add(new Criteria('gperm_itemid',$block->get('bid')));
+            $cri->add(new Criteria('gperm_modid',1));
+            if(!$gpermHandler->deleteAll($cri))
+            {
+                $log->addWarning(
+                    XCube_Utils::formatString(
+                        _MI_SD2ND_INSTALL_ERROR_BLOCK_PERM_DELETE,
+                        $block->get('name')
+                    )
+                );
+                $successFlag = false;
+            }
+        }
+    
+        return $successFlag;
+    }
+
+    /**
+     * smartUpdateAllOfBlocks
+     * 
+     * @param   XoopsModule  &$module
+     * @param   Legacy_ModuleInstallLog  &$log
+     * 
+     * @return  void
+    **/
+    public static function smartUpdateAllOfBlocks(/*** XoopsModule ***/ &$module,/*** Legacy_ModuleInstallLog ***/ &$log)
+    {
+        $dirname = $module->get('dirname');
+    
+        $fileReader =& new Legacy_ModinfoX2FileReader($dirname);
+        $dbReader =& new Legacy_ModinfoX2DBReader($dirname);
+    
+        $blocks =& $dbReader->loadBlockInformations();
+        $blocks->update($fileReader->loadBlockInformations());
+    
+        foreach($blocks->mBlocks as $block)
+        {
+            switch($block->mStatus)
+            {
+                case LEGACY_INSTALLINFO_STATUS_LOADED:
+                    Sd2nd_InstallUtils::updateBlockTemplateByInfo($block,$module,$log);
+                    break;
+                case LEGACY_INSTALLINFO_STATUS_UPDATED:
+                    Sd2nd_InstallUtils::updateBlockByInfo($block,$module,$log);
+                    break;
+                case LEGACY_INSTALLINFO_STATUS_NEW:
+                    Sd2nd_InstallUtils::installBlockByInfo($block,$module,$log);
+                    break;
+                case LEGACY_INSTALLINFO_STATUS_DELETED:
+                    Sd2nd_InstallUtils::uninstallBlockByFuncNum($block->mFuncNum,$module,$log);
+                    break;
+                default:
+                    break;
+            }
+        }
+    }
+
+    /**
+     * updateBlockTemplateByInfo
+     * 
+     * @param   Legacy_BlockInformation  &$info
+     * @param   XoopsModule  &$module
+     * @param   Legacy_ModuleInstallLog  &$log
+     * 
+     * @return  void
+    **/
+    public static function updateBlockTemplateByInfo(/*** Legacy_BlockInformation ***/ &$info,/*** XoopsModule ***/ &$module,/*** Legacy_ModuleInstallLog ***/ &$log)
+    {
+        $blockHandler =& Sd2nd_Utils::getModuleHandler('newblocks','legacy');
+        $cri =& new CriteriaCompo();
+        $cri->add(new Criteria('dirname',$module->get('dirname')));
+        $cri->add(new Criteria('func_num',$info->mFuncNum));
+        $blocks =& $blockHandler->getObjects($cri);
+    
+        foreach($blocks as $block)
+        {
+            Sd2nd_InstallUtils::uninstallBlockTemplate($block,$module,$log,true);
+            Sd2nd_InstallUtils::installBlockTemplate($block,$module,$log);
+        }
+    }
+
+    /**
+     * updateBlockByInfo
+     * 
+     * @param   Legacy_BlockInformation  &$info
+     * @param   XoopsModule  &$module
+     * @param   Legacy_ModuleInstallLog  &$log
+     * 
+     * @return  void
+    **/
+    public static function updateBlockByInfo(/*** Legacy_BlockInformation ***/ &$info,/*** XoopsModule ***/ &$module,/*** Legacy_ModuleInstallLog ***/ &$log)
+    {
+        $blockHandler =& Sd2nd_Utils::getModuleHandler('newblocks','legacy');
+        $cri =& new CriteriaCompo();
+        $cri->add(new Criteria('dirname',$module->get('dirname')));
+        $cri->add(new Criteria('func_num',$info->mFuncNum));
+        $blocks =& $blockHandler->getObjects($cri);
+    
+        foreach($blocks as $block)
+        {
+            $filename = Sd2nd_InstallUtils::replaceDirname(
+                $info->mTemplate,
+                $module->get('dirname'),
+                $module->getInfo('trust_dirname')
+            );
+            $block->set('options',$info->mOptions);
+            $block->set('name',$info->mName);
+            $block->set('func_file',$info->mFuncFile);
+            $block->set('show_func',$info->mShowFunc);
+            //$block->set('edit_func',$info->mEditFunc);
+            $block->set('template',$filename['public']);
+            if($blockHandler->insert($block))
+            {
+                $log->addReport(
+                    XCube_Utils::formatString(
+                        _MI_SD2ND_INSTALL_MSG_BLOCK_UPDATED,
+                        $block->get('name')
+                    )
+                );
+            }
+            else
+            {
+                $log->addError(
+                    XCube_Utils::formatString(
+                        _MI_SD2ND_INSTALL_ERROR_BLOCK_UPDATED,
+                        $block->get('name')
+                    )
+                );
+            }
+            Sd2nd_InstallUtils::uninstallBlockTemplate($block,$module,$log,true);
+            Sd2nd_InstallUtils::installBlockTemplate($block,$module,$log);
+        }
+    }
+
+    /**
+     * installBlockByInfo
+     * 
+     * @param   Legacy_BlockInformation  &$info
+     * @param   XoopsModule  &$module
+     * @param   Legacy_ModuleInstallLog  &$log
+     * 
+     * @return  bool
+    **/
+    public static function installBlockByInfo(/*** Legacy_BlockInformation ***/ &$info,/*** XoopsModule ***/ &$module,/*** Legacy_ModuleInstallLog ***/ &$log)
+    {
+        $filename = Sd2nd_InstallUtils::replaceDirname(
+            $info->mTemplate,
+            $module->get('dirname'),
+            $module->getInfo('trust_dirname')
+        );
+    
+        $blockHandler =& Sd2nd_Utils::getXoopsHandler('block');
+    
+        $block =& $blockHandler->create();
+        $block->set('mid',$module->get('mid'));
+        $block->set('func_num',$info->mFuncNum);
+        $block->set('options',$info->mOptions);
+        $block->set('name',$info->mName);
+        $block->set('title',$info->mName);
+        $block->set('dirname',$module->get('dirname'));
+        $block->set('func_file',$info->mFuncFile);
+        $block->set('show_func',$info->mShowFunc);
+        //$block->set('edit_func',$info->mEditFunc);
+        $block->set('template',$filename['public']);
+        $block->set('block_type','M');
+        $block->set('c_type',1);
+    
+        if(!$blockHandler->insert($block))
+        {
+            $log->addError(
+                XCube_Utils::formatString(
+                    _MI_SD2ND_INSTALL_ERROR_BLOCK_INSTALLED,
+                    $block->get('name')
+                )
+            );
+            return false;
+        }
+    
+        $log->addReport(
+            XCube_Utils::formatString(
+                _MI_SD2ND_INSTALL_MSG_BLOCK_INSTALLED,
+                $block->get('name')
+            )
+        );
+    
+        Sd2nd_InstallUtils::installBlockTemplate($block,$module,$log);
+        return true;
+    }
+
+    /**
+     * uninstallBlockByFuncNum
+     * 
+     * @param   int  $func_num
+     * @param   XoopsModule  &$module
+     * @param   Legacy_ModuleInstallLog  &$log
+     * 
+     * @return  bool
+    **/
+    public static function uninstallBlockByFuncNum(/*** int ***/ $func_num,/*** XoopsModule ***/ &$module,/*** Legacy_ModuleInstallLog ***/ &$log)
+    {
+        $blockHandler =& Sd2nd_Utils::getModuleHandler('newblocks','legacy');
+        $cri =& new CriteriaCompo();
+        $cri->add(new Criteria('dirname',$module->get('dirname')));
+        $cri->add(new Criteria('func_num',$func_num));
+        $blocks =& $blockHandler->getObjects($cri);
+    
+        $successFlag = true;
+        foreach($blocks as $block)
+        {
+            if($blockHandler->delete($block))
+            {
+                $log->addReport(
+                    XCube_Utils::formatString(
+                        _MI_SD2ND_INSTALL_MSG_BLOCK_UNINSTALLED,
+                        $block->get('name')
+                    )
+                );
+            }
+            else
+            {
+                $log->addError(
+                    XCube_Utils::formatString(
+                        _MI_SD2ND_INSTALL_ERROR_BLOCK_UNINSTALLED,
+                        $block->get('name')
+                    )
+                );
+                $successFlag = false;
+            }
+        }
+        return $successFlag;
+    }
+
+    /**
+     * uninstallBlockTemplate
+     * 
+     * @param   XoopsBlock  &$block
+     * @param   XoopsModule  &$module
+     * @param   Legacy_ModuleInstallLog  &$log
+     * @param   bool  $defaultOnly
+     * 
+     * @return  bool
+    **/
+    public static function uninstallBlockTemplate(/*** XoopsBlock ***/ &$block,/*** XoopsModule ***/ &$module,/*** Legacy_ModuleInstallLog ***/ &$log,/*** bool ***/ $defaultOnly = false)
+    {
+        $tplHandler =& Sd2nd_Utils::getXoopsHandler('tplfile');
+        $delTemplates =& $tplHandler->find($defaultOnly ? 'default' : null,'block',$module->get('mid'),$module->get('dirname'),$block->get('template'));
+    
+        if(is_array($delTemplates) && count($delTemplates) > 0)
+        {
+            foreach($delTemplates as $tpl)
+            {
+                if(!$tplHandler->delete($tpl))
+                {
+                    $log->addError(
+                        XCube_Utils::formatString(
+                            _MI_SD2ND_INSTALL_ERROR_TPL_UNINSTALLED,
+                            $tpl->get('tpl_file')
+                        )
+                    );
+                }
+            }
+        }
+    
+        $log->addReport(
+            XCube_Utils::formatString(
+                _MI_SD2ND_INSTALL_MSG_BLOCK_TPL_UNINSTALLED,
+                $block->get('template')
+            )
+        );
+        return true;
+    }
+
+    /**
+     * installAllOfConfigs
+     * 
+     * @param   XoopsModule  &$module
+     * @param   Legacy_ModuleInstallLog  &$log
+     * 
+     * @return  bool
+    **/
+    public static function installAllOfConfigs(/*** XoopsModule ***/ &$module,/*** Legacy_ModuleInstallLog ***/ &$log)
+    {
+        $successFlag = true;
+        $configHandler =& Sd2nd_Utils::getXoopsHandler('config');
+        $fileReader =& new Legacy_ModinfoX2FileReader($module->get('dirname'));    // TODO will be use other class?
+        $preferences =& $fileReader->loadPreferenceInformations();
+    
+        foreach($preferences->mPreferences as $info)
+        {
+            $config =& $configHandler->createConfig();
+            $config->set('conf_modid',$module->get('mid'));
+            $config->set('conf_catid',0);
+            $config->set('conf_name',$info->mName);
+            $config->set('conf_title',$info->mTitle);
+            $config->set('conf_desc',$info->mDescription);
+            $config->set('conf_formtype',$info->mFormType);
+            $config->set('conf_valuetype',$info->mValueType);
+            $config->setConfValueForInput($info->mDefault);
+            $config->set('conf_order',$info->mOrder);
+    
+            if(count($info->mOption->mOptions) > 0)
+            {
+                foreach($info->mOption->mOptions as $opt)
+                {
+                    $option = $configHandler->createConfigOption();
+                    $option->set('confop_name',$opt->mName);
+                    $option->set('confop_value',$opt->mValue);
+                    $config->setConfOptions($option);
+                    unset($option);
+                }
+            }
+    
+            if($configHandler->insertConfig($config))
+            {
+                $log->addReport(
+                    XCube_Utils::formatString(
+                        _MI_SD2ND_INSTALL_MSG_CONFIG_ADDED,
+                        $config->get('conf_name')
+                    )
+                );
+            }
+            else
+            {
+                $log->addError(
+                    XCube_Utils::formatString(
+                        _MI_SD2ND_INSTALL_ERROR_CONFIG_ADDED,
+                        $config->get('conf_name')
+                    )
+                );
+                $successFlag = false;
+            }
+        }
+    
+        return $successFlag;
+    }
+
+    /**
+     * installConfigByInfo
+     * 
+     * @param   Legacy_PreferenceInformation  &$info
+     * @param   XoopsModule  &$module
+     * @param   Legacy_ModuleInstallLog  &$log
+     * 
+     * @return  void
+    **/
+    public static function installConfigByInfo(/*** Legacy_PreferenceInformation ***/ &$info,/*** XoopsModule ***/ &$module,/*** Legacy_ModuleInstallLog ***/ &$log)
+    {
+        $configHandler =& Sd2nd_Utils::getXoopsHandler('config');
+        $config =& $configHandler->createConfig();
+        $config->set('conf_modid',$module->get('mid'));
+        $config->set('conf_catid',0);
+        $config->set('conf_name',$info->mName);
+        $config->set('conf_title',$info->mTitle);
+        $config->set('conf_desc',$info->mDescription);
+        $config->set('conf_formtype',$info->mFormType);
+        $config->set('conf_valuetype',$info->mValueType);
+        $config->setConfValueForInput($info->mDefault);
+        $config->set('conf_order',$info->mOrder);
+    
+        if(count($info->mOption->mOptions) > 0)
+        {
+            foreach($info->mOption->mOptions as $opt)
+            {
+                $option = $configHandler->createConfigOption();
+                $option->set('confop_name',$opt->mName);
+                $option->set('confop_value',$opt->mValue);
+                $config->setConfOptions($option);
+                unset($option);
+            }
+        }
+    
+        if($configHandler->insertConfig($config))
+        {
+            $log->addReport(
+                XCube_Utils::formatString(
+                    _MI_SD2ND_INSTALL_MSG_CONFIG_ADDED,
+                    $config->get('conf_name')
+                )
+            );
+        }
+        else
+        {
+            $log->addError(
+                XCube_Utils::formatString(
+                    _MI_SD2ND_INSTALL_ERROR_CONFIG_ADDED,
+                    $config->get('conf_name')
+                )
+            );
+        }
+        
+    }
+
+    /**
+     * uninstallAllOfConfigs
+     * 
+     * @param   XoopsModule  &$module
+     * @param   Legacy_ModuleInstallLog  &$log
+     * 
+     * @return  bool
+    **/
+    public static function uninstallAllOfConfigs(/*** XoopsModule ***/ &$module,/*** Legacy_ModuleInstallLog ***/ &$log)
+    {
+        if($module->get('hasconfig') == 0)
+        {
+            return true;
+        }
+    
+        $configHandler =& Sd2nd_Utils::getXoopsHandler('config');
+        $configs =& $configHandler->getConfigs(new Criteria('conf_mofid',$module->get('mid')));
+    
+        if(count($configs) == 0)
+        {
+            return true;
+        }
+    
+        $sucessFlag = true;
+        foreach($configs as $config)
+        {
+            if($configHandler->deleteConfig($config))
+            {
+                $log->addReport(
+                    XCube_Utils::formatString(
+                        _MI_SD2ND_INSTALL_MSG_CONFIG_DELETED,
+                        $config->getVar('conf_name')
+                    )
+                );
+            }
+            else
+            {
+                $log->addWarning(
+                    XCube_Utils::formatString(
+                        _MI_SD2ND_INSTALL_ERROR_CONFIG_DELETED,
+                        $config->getVar('conf_name')
+                    )
+                );
+                $sucessFlag = false;
+            }
+        }
+        return $sucessFlag;
+    }
+
+    /**
+     * uninstallConfigByOrder
+     * 
+     * @param   int  $order
+     * @param   XoopsModule  &$module
+     * @param   Legacy_ModuleInstallLog  &$log
+     * 
+     * @return  void
+    **/
+    public static function uninstallConfigByOrder(/*** int ***/ $order,/*** XoopsModule ***/ &$module,/*** Legacy_ModuleInstallLog ***/ &$log)
+    {
+        $configHandler =& Sd2nd_Utils::getXoopsHandler('config');
+    
+        $cri =& new CriteriaCompo();
+        $cri->add(new Criteria('conf_modid',$module->get('mid')));
+        $cri->add(new Criteria('conf_catid',0));
+        $cri->add(new Criteria('conf_order',$order));
+        $configs = $configHandler->getConfigs($cri);
+    
+        foreach($configs as $config)
+        {
+            if($configHandler->deleteConfig($config))
+            {
+                $log->addReport(
+                    XCube_Utils::formatString(
+                        _MI_SD2ND_INSTALL_MSG_CONFIG_DELETED,
+                        $config->get('conf_name')
+                    )
+                );
+            }
+            else
+            {
+                $log->addError(
+                    XCube_Utils::formatString(
+                        _MI_SD2ND_INSTALL_ERROR_CONFIG_DELETED,
+                        $config->get('conf_name')
+                    )
+                );
+            }
+        }
+    }
+
+    /**
+     * smartUpdateAllOfConfigs
+     * 
+     * @param   XoopsModule  &$module
+     * @param   Legacy_ModuleInstallLog  &$log
+     * 
+     * @return  void
+    **/
+    public static function smartUpdateAllOfConfigs(/*** XoopsModule ***/ &$module,/*** Legacy_ModuleInstallLog ***/ &$log)
+    {
+        $dirname = $module->get('dirname');
+    
+        $fileReader =& new Legacy_ModinfoX2FileReader($dirname);
+        $dbReader =& new Legacy_ModinfoX2DBReader($dirname);
+    
+        $configs  =& $dbReader->loadPreferenceInformations();
+        $configs->update($fileReader->loadPreferenceInformations());
+    
+        foreach($configs->mPreferences as $config)
+        {
+            switch($config->mStatus)
+            {
+                case LEGACY_INSTALLINFO_STATUS_UPDATED:
+                    Sd2nd_InstallUtils::updateConfigByInfo($config,$module,$log);
+                    break;
+                case LEGACY_INSTALLINFO_STATUS_ORDER_UPDATED:
+                    Sd2nd_InstallUtils::updateConfigOrderByInfo($config,$module,$log);
+                    break;
+                case LEGACY_INSTALLINFO_STATUS_NEW:
+                    Sd2nd_InstallUtils::installConfigByInfo($config,$module,$log);
+                    break;
+                case LEGACY_INSTALLINFO_STATUS_DELETED:
+                    Sd2nd_InstallUtils::uninstallConfigByOrder($config->mOrder,$module,$log);
+                    break;
+                default:
+                    break;
+            }
+        }
+    }
+
+    /**
+     * updateConfigByInfo
+     * 
+     * @param   Legacy_PreferenceInformation  &$info
+     * @param   XoopsModule  &$module
+     * @param   Legacy_ModuleInstallLog  &$log
+     * 
+     * @return  bool
+    **/
+    public static function updateConfigByInfo(/*** Legacy_PreferenceInformation ***/ &$info,/*** XoopsModule ***/ &$module,/*** Legacy_ModuleInstallLog ***/ &$log)
+    {
+        $configHandler =& Sd2nd_Utils::getXoopsHandler('config');
+        $cri =& new CriteriaCompo();
+        $cri->add(new Criteria('conf_modid',$module->get('mid')));
+        $cri->add(new Criteria('conf_catid',0));
+        $cri->add(new Criteria('conf_name',$info->mName));
+        $configs =& $configHandler->getConfigs($cri);
+    
+        if(!(count($configs) > 0 && is_object($configs[0])))
+        {
+            $log->addError(_MISD2ND_INSTALL_ERROR_CONFIG_NOT_FOUND);
+            return false;
+        }
+    
+        $config =& $configs[0];
+        $config->set('conf_title',$info->mTitle);
+        $config->set('conf_desc',$info->mDescription);
+        if($config->get('conf_formtype') != $info->mFormType && $config->get('conf_valuetype') != $info->mValueType)
+        {
+            $config->set('conf_formtype',$info->mFormType);
+            $config->set('conf_valuetype',$info->mValueType);
+            $config->setConfValueForInput($info->mDefault);
+        }
+        else
+        {
+            $config->set('conf_formtype',$info->mFormType);
+            $config->set('conf_valuetype',$info->mValueType);
+        }
+        $config->set('conf_order',$info->mOrder);
+    
+        $options =& $configHandler->getConfigOptions(new Criteria('conf_id',$config->get('conf_id')));
+        if(is_array($options))
+        {
+            foreach($options as $opt)
+            {
+                $configHandler->_oHandler->delete($opt);  // TODO will be use other method
+            }
+        }
+    
+        if(count($info->mOption->mOptions) > 0)
+        {
+            foreach($info->mOption->mOptions as $opt)
+            {
+                $option =& $configHandler->createConfigOption();
+                $option->set('confop_name',$opt->mName);
+                $option->set('confop_value',$opt->mValue);
+                $option->set('conf_id',$option->get('conf_id'));    // TODO check conf_id is right
+                $config->setConfOptions($option);
+                unset($option);
+            }
+        }
+    
+        if($configHandler->insertConfig($config))
+        {
+            $log->addReport(
+                XCube_Utils::formatString(
+                    _MI_SD2ND_INSTALL_MSG_CONFIG_UPDATED,
+                    $config->get('conf_name')
+                )
+            );
+            return true;
+        }
+    
+        $log->addError(
+            XCube_Utils::formatString(
+                _MI_SD2ND_INSTALL_ERROR_CONFIG_UPDATED,
+                $config->get('conf_name')
+            )
+        );
+        return false;
+    }
+
+    /**
+     * updateConfigOrderByInfo
+     * 
+     * @param   Legacy_PreferenceInformation  &$info
+     * @param   XoopsModule  &$module
+     * @param   Legacy_ModuleInstallLog  &$log
+     * 
+     * @return  bool
+    **/
+    public static function updateConfigOrderByInfo(/*** Legacy_PreferenceInformation ***/ &$info,/*** XoopsModule ***/ &$module,/*** Legacy_ModuleInstallLog ***/ &$log)
+    {
+        $configHandler =& Sd2nd_Utils::getXoopsHandler('config');
+        $cri =& new CriteriaCompo();
+        $cri->add(new Criteria('conf_modid',$module->get('mid')));
+        $cri->add(new Criteria('conf_catid',0));
+        $cri->add(new Criteria('conf_name',$info->mName));
+        $configs =& $configHandler->getConfigs($cri);
+    
+        if(!(count($configs) > 0 && is_object($configs[0])))
+        {
+            $log->addError(_MI_SD2ND_INSTALL_ERROR_CONFIG_NOT_FOUND);
+            return false;
+        }
+    
+        $config =& $configs[0];
+        $config->set('conf_order',$info->mOrder);
+        if(!$configHandler->insertConfig($config))
+        {
+            $log->addError(
+                XCube_Utils::formatString(
+                    _MI_SD2ND_INSTALL_ERROR_CONFIG_UPDATED,
+                    $config->get('conf_name')
+                )
+            );
+            return false;
+        }
+        return true;
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/admin/class/installer/Sd2ndInstaller.class.php b/trust_path/modules/sd2nd/admin/class/installer/Sd2ndInstaller.class.php
new file mode 100644 (file)
index 0000000..1bb13f4
--- /dev/null
@@ -0,0 +1,299 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+require_once SD2ND_TRUST_PATH . '/admin/class/installer/Sd2ndInstallUtils.class.php';
+
+/**
+ * Sd2nd_Installer
+**/
+class Sd2nd_Installer
+{
+    /**
+     * @brief   Legacy_ModuleInstallLog
+    **/
+    public $mLog = null;
+
+    /**
+     * @brief   bool
+    **/
+    private $_mForceMode = false;
+
+    /**
+     * @brief   XoopsModule
+    **/
+    private $_mXoopsModule = null;
+
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        $this->mLog =& new Legacy_ModuleInstallLog();
+    }
+
+    /**
+     * setCurrentXoopsModule
+     * 
+     * @param   XoopsModule  &$xoopsModule
+     * 
+     * @return  void
+    **/
+    public function setCurrentXoopsModule(/*** XoopsModule ***/ &$xoopsModule)
+    {
+        $this->_mXoopsModule =& $xoopsModule;
+    }
+
+    /**
+     * setForceMode
+     * 
+     * @param   bool  $isForceMode
+     * 
+     * @return  void
+    **/
+    public function setForceMode(/*** bool ***/ $isForceMode)
+    {
+        $this->_mForceMode = $isForceMode;
+    }
+
+    /**
+     * _installTables
+     * 
+     * @param   void
+     * 
+     * @return  bool
+    **/
+    private function _installTables()
+    {
+        return Sd2nd_InstallUtils::installSQLAutomatically(
+            $this->_mXoopsModule,
+            $this->mLog
+        );
+    }
+
+    /**
+     * _installModule
+     * 
+     * @param   void
+     * 
+     * @return  bool
+    **/
+    private function _installModule()
+    {
+        $moduleHandler =& Sd2nd_Utils::getXoopsHandler('module');
+        if(!$moduleHandler->insert($this->_mXoopsModule))
+        {
+            $this->mLog->addError(_MI_SD2ND_INSTALL_ERROR_MODULE_INSTALLED);
+            return false;
+        }
+    
+        $gpermHandler =& Sd2nd_Utils::getXoopsHandler('groupperm');
+    
+        if($this->_mXoopsModule->getInfo('hasAdmin'))
+        {
+            $adminPerm =& $this->_createPermission(XOOPS_GROUP_ADMIN);
+            $adminPerm->setVar('gperm_name','module_admin');
+            if(!$gpermHandler->insert($adminPerm))
+            {
+                $this->mLog->addError(_MI_SD2ND_INSTALL_ERROR_PERM_ADMIN_SET);
+            }
+        }
+    
+        if($this->_mXoopsModule->getInfo('hasMain'))
+        {
+            if($this->_mXoopsModule->getInfo('read_any'))
+            {
+                    $memberHandler =& Sd2nd_Utils::getXoopsHandler('member');
+                    $groupObjects =& $memberHandler->getGroups();
+                    foreach($groupObjects as $group)
+                    {
+                        $readPerm =& $this->_createPermission($group->getVar('groupid'));
+                        $readPerm->setVar('gperm_name','module_read');
+                        if(!$gpermHandler->insert($readPerm))
+                        {
+                            $this->mLog->addError(_MI_SD2ND_INSTALL_ERROR_PERM_READ_SET);
+                        }
+                    }
+            }
+            else
+            {
+                    $root =& XCube_Root::getSingleton();
+                    $groups = $root->mContext->mXoopsUser->getGroups();
+                    foreach($groups as $group)
+                    {
+                        $readPerm =& $this->_createPermission($group);
+                        $readPerm->setVar('gperm_name','module_read');
+                        if(!$gpermHandler->insert($readPerm))
+                        {
+                            $this->mLog->addError(_MI_SD2ND_INSTALL_ERROR_PERM_READ_SET);
+                        }
+                    }
+            }
+        }
+    
+        return true;
+    }
+
+    /**
+     * &_createPermission
+     * 
+     * @param   int  $group
+     * 
+     * @return  XoopsGroupPerm
+    **/
+    private function &_createPermission(/*** int ***/ $group)
+    {
+        $gpermHandler =& Sd2nd_Utils::getXoopsHandler('groupperm');
+        $perm =& $gpermHandler->create();
+        $perm->setVar('gperm_groupid',$group);
+        $perm->setVar('gperm_itemid',$this->_mXoopsModule->getVar('mid'));
+        $perm->setVar('gperm_modid',1);
+    
+        return $perm;
+    }
+
+    /**
+     * _installTemplates
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    private function _installTemplates()
+    {
+        Sd2nd_InstallUtils::installAllOfModuleTemplates(
+            $this->_mXoopsModule,
+            $this->mLog
+        );
+    }
+
+    /**
+     * _installBlocks
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    private function _installBlocks()
+    {
+        Sd2nd_InstallUtils::installAllOfBlocks(
+            $this->_mXoopsModule,
+            $this->mLog
+        );
+    }
+
+    /**
+     * _installPreferences
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    private function _installPreferences()
+    {
+        Sd2nd_InstallUtils::installAllOfConfigs(
+            $this->_mXoopsModule,
+            $this->mLog
+        );
+    }
+
+    /**
+     * _processReport
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    private function _processReport()
+    {
+        if(!$this->mLog->hasError())
+        {
+            $this->mLog->add(
+                XCube_Utils::formatString(
+                    _MI_SD2ND_INSTALL_MSG_MODULE_INSTALLED,
+                    $this->_mXoopsModule->getInfo('name')
+                )
+            );
+        }
+        else if(is_object($this->_mXoopsModule))
+        {
+            $this->mLog->addError(
+                XCube_Utils::formatString(
+                    _MI_SD2ND_INSTALL_ERROR_MODULE_INSTALLED,
+                    $this->_mXoopsModule->getInfo('name')
+                )
+            );
+        }
+        else
+        {
+            $this->mLog->addError(
+                XCube_Utils::formatString(
+                    _MI_SD2ND_INSTALL_ERROR_MODULE_INSTALLED,
+                    'something'
+                )
+            );
+        }
+    }
+
+    /**
+     * executeInstall
+     * 
+     * @param   void
+     * 
+     * @return  bool
+    **/
+    public function executeInstall()
+    {
+        $this->_installTables();
+        if(!$this->_mForceMode && $this->mLog->hasError())
+        {
+            $this->_processReport();
+            return false;
+        }
+    
+        $this->_installModule();
+        if(!$this->_mForceMode && $this->mLog->hasError())
+        {
+            $this->_processReport();
+            return false;
+        }
+    
+        $this->_installTemplates();
+        if(!$this->_mForceMode && $this->mLog->hasError())
+        {
+            $this->_processReport();
+            return false;
+        }
+    
+        $this->_installBlocks();
+        if(!$this->_mForceMode && $this->mLog->hasError())
+        {
+            $this->_processReport();
+            return false;
+        }
+    
+        $this->_installPreferences();
+        if(!$this->_mForceMode && $this->mLog->hasError())
+        {
+            $this->_processReport();
+            return false;
+        }
+    
+        $this->_processReport();
+        return true;
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/admin/class/installer/Sd2ndUninstaller.class.php b/trust_path/modules/sd2nd/admin/class/installer/Sd2ndUninstaller.class.php
new file mode 100644 (file)
index 0000000..6c6d8cc
--- /dev/null
@@ -0,0 +1,277 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+require_once SD2ND_TRUST_PATH . '/admin/class/installer/Sd2ndInstallUtils.class.php';
+
+/**
+ * Sd2nd_Uninstaller
+**/
+class Sd2nd_Uninstaller
+{
+    /**
+     * @brief   Legacy_ModuleInstallLog
+    **/
+    public $mLog = null;
+
+    /**
+     * @brief   bool
+    **/
+    private $_mForceMode = false;
+
+    /**
+     * @brief   XoopsModule
+    **/
+    private $_mXoopsModule = null;
+
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        $this->mLog =& new Legacy_ModuleInstallLog();
+    }
+
+    /**
+     * setCurrentXoopsModule
+     * 
+     * @param   XoopsModule  &$xoopsModule
+     * 
+     * @return  void
+    **/
+    public function setCurrentXoopsModule(/*** XoopsModule ***/ &$xoopsModule)
+    {
+        $this->_mXoopsModule =& $xoopsModule;
+    }
+
+    /**
+     * setForceMode
+     * 
+     * @param   bool  $isForceMode
+     * 
+     * @return  void
+    **/
+    public function setForceMode(/*** bool ***/ $isForceMode)
+    {
+        $this->_mForceMode = $isForceMode;
+    }
+
+    /**
+     * _uninstallModule
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    private function _uninstallModule()
+    {
+        $moduleHandler =& Sd2nd_Utils::getXoopsHandler('module');
+    
+        if($moduleHandler->delete($this->_mXoopsModule))
+        {
+            $this->mLog->addReport(_MI_SD2ND_INSTALL_MSG_MODULE_INFORMATION_DELETED);
+        }
+        else
+        {
+            $this->mLog->addError(_MI_SD2ND_INSTALL_ERROR_MODULE_INFORMATION_DELETED);
+        }
+    }
+
+    /**
+     * _uninstallTables
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    private function _uninstallTables()
+    {
+        $root =& XCube_Root::getSingleton();
+        $db =& $root->mController->getDB();
+        $dirname = $this->_mXoopsModule->get('dirname');
+    
+        $tables =& $this->_mXoopsModule->getInfo('tables');
+        if(is_array($tables))
+        {
+            foreach($tables as $table)
+            {
+                $tableName = str_replace(
+                    array('{prefix}','{dirname}'),
+                    array(XOOPS_DB_PREFIX,$dirname),
+                    $table
+                );
+                $sql = sprintf('drop table `%s`;',$tableName);
+                
+                if($db->query($sql))
+                {
+                    $this->mLog->addReport(
+                        XCube_Utils::formatString(
+                            _MI_SD2ND_INSTALL_MSG_TABLE_DOROPPED,
+                            $tableName
+                        )
+                    );
+                }
+                else
+                {
+                    $this->mLog->addError(
+                        XCube_Utils::formatString(
+                            _MI_SD2ND_INSTALL_ERROR_TABLE_DOROPPED,
+                            $tableName
+                        )
+                    );
+                }
+            }
+        }
+    }
+
+    /**
+     * _uninstallTemplates
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    private function _uninstallTemplates()
+    {
+        Sd2nd_InstallUtils::uninstallAllOfModuleTemplates($this->_mXoopsModule,$this->mLog,false);
+    }
+
+    /**
+     * _uninstallBlocks
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    private function _uninstallBlocks()
+    {
+        Sd2nd_InstallUtils::uninstallAllOfBlocks($this->_mXoopsModule,$this->mLog);
+    
+        $tplHandler =& Sd2nd_Utils::getXoopsHandler('tplfile');
+        $cri =& new Criteria('tpl_module',$this->_mXoopsModule->get('dirname'));
+        if(!$tplHandler->deleteAll($cri))
+        {
+            $this->mLog->addError(
+                XCube_Utils::formatString(
+                    _MI_SD2ND_INSTALL_ERROR_BLOCK_TPL_DELETED,
+                    $tplHandler->db->error()
+                )
+            );
+        }
+    }
+
+    /**
+     * _uninstallPreferences
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    private function _uninstallPreferences()
+    {
+        Sd2nd_InstallUtils::uninstallAllOfConfigs($this->_mXoopsModule,$this->mLog);
+    }
+
+    /**
+     * _processReport
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    private function _processReport()
+    {
+        if(!$this->mLog->hasError())
+        {
+            $this->mLog->add(
+                XCube_Utils::formatString(
+                    _MI_SD2ND_INSTALL_MSG_MODULE_UNINSTALLED,
+                    $this->_mXoopsModule->get('name')
+                )
+            );
+        }
+        else if(is_object($this->_mXoopsModule))
+        {
+            $this->mLog->addError(
+                XCube_Utils::formatString(
+                    _MI_SD2ND_INSTALL_ERROR_MODULE_UNINSTALLED,
+                    $this->_mXoopsModule->get('name')
+                )
+            );
+        }
+        else
+        {
+            $this->mLog->addError(
+                XCube_Utils::formatString(
+                    _MI_SD2ND_INSTALL_ERROR_MODULE_UNINSTALLED,
+                    'something'
+                )
+            );
+        }
+    }
+
+    /**
+     * executeUninstall
+     * 
+     * @param   void
+     * 
+     * @return  bool
+    **/
+    public function executeUninstall()
+    {
+        $this->_uninstallTables();
+        if(!$this->_mForceMode && $this->mLog->hasError())
+        {
+            $this->_processReport();
+            return false;
+        }
+    
+        if($this->_mXoopsModule->get('mid') != null)
+        {
+            $this->_uninstallModule();
+            if(!$this->_mForceMode && $this->mLog->hasError())
+            {
+                $this->_processReport();
+                return false;
+            }
+    
+            $this->_uninstallTemplates();
+            if(!$this->_mForceMode && $this->mLog->hasError())
+            {
+                $this->_processReport();
+                return false;
+            }
+    
+            $this->_uninstallBlocks();
+            if(!$this->_mForceMode && $this->mLog->hasError())
+            {
+                $this->_processReport();
+                return false;
+            }
+    
+            $this->_uninstallPreferences();
+            if(!$this->_mForceMode && $this->mLog->hasError())
+            {
+                $this->_processReport();
+                return false;
+            }
+        }
+    
+        $this->_processReport();
+        return true;
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/admin/class/installer/Sd2ndUpdater.class.php b/trust_path/modules/sd2nd/admin/class/installer/Sd2ndUpdater.class.php
new file mode 100644 (file)
index 0000000..e8e1df9
--- /dev/null
@@ -0,0 +1,357 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+require_once SD2ND_TRUST_PATH . '/admin/class/installer/Sd2ndInstallUtils.class.php';
+
+/**
+ * Sd2nd_Updater
+**/
+class Sd2nd_Updater
+{
+    /**
+     * @brief   Legacy_ModuleInstallLog
+    **/
+    public $mLog = null;
+
+    /**
+     * @brief   string[]
+    **/
+    private $_mMileStone = array();
+
+    /**
+     * @brief   XoopsModule
+    **/
+    private $_mCurrentXoopsModule = null;
+
+    /**
+     * @brief   XoopsModule
+    **/
+    private $_mTargetXoopsModule = null;
+
+    /**
+     * @brief   int
+    **/
+    private $_mCurrentVersion = 0;
+
+    /**
+     * @brief   int
+    **/
+    private $_mTargetVersion = 0;
+
+    /**
+     * @brief   bool
+    **/
+    private $_mForceMode = false;
+
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        $this->mLog =& new Legacy_ModuleInstallLog();
+    }
+
+    /**
+     * setForceMode
+     * 
+     * @param   bool  $isForceMode
+     * 
+     * @return  void
+    **/
+    public function setForceMode(/*** bool ***/ $isForceMode)
+    {
+        $this->_mForceMode = $isForceMode;
+    }
+
+    /**
+     * setCurrentXoopsModule
+     * 
+     * @param   XoopsModule  &$module
+     * 
+     * @return  void
+    **/
+    public function setCurrentXoopsModule(/*** XoopsModule ***/ &$module)
+    {
+        $moduleHandler =& Sd2nd_Utils::getXoopsHandler('module');
+        $cloneModule =& $moduleHandler->create();
+    
+        $cloneModule->unsetNew();
+        $cloneModule->set('mid',$module->get('mid'));
+        $cloneModule->set('name',$module->get('name'));
+        $cloneModule->set('version',$module->get('version'));
+        $cloneModule->set('last_update',$module->get('last_update'));
+        $cloneModule->set('weight',$module->get('weight'));
+        $cloneModule->set('isactive',$module->get('isactive'));
+        $cloneModule->set('dirname',$module->get('dirname'));
+        //$cloneModule->set('trust_dirname',$module->get('trust_dirname'));
+        $cloneModule->set('hasmain',$module->get('hasmain'));
+        $cloneModule->set('hasadmin',$module->get('hasadmin'));
+        $cloneModule->set('hasconfig',$module->get('hasconfig'));
+    
+        $this->_mCurrentXoopsModule =& $cloneModule;
+        $this->_mCurrentVersion = $cloneModule->get('version');
+    }
+
+    /**
+     * setTargetXoopsModule
+     * 
+     * @param   XoopsModule  &$module
+     * 
+     * @return  void
+    **/
+    public function setTargetXoopsModule(/*** XoopsModule ***/ &$module)
+    {
+        $this->_mTargetXoopsModule =& $module;
+        $this->_mTargetVersion = $this->getTargetPhase();
+    }
+
+    /**
+     * getCurrentVersion
+     * 
+     * @param   void
+     * 
+     * @return  int
+    **/
+    public function getCurrentVersion()
+    {
+        return intval($this->_mCurrentVersion);
+    }
+
+    /**
+     * getTargetPhase
+     * 
+     * @param   void
+     * 
+     * @return  int
+    **/
+    public function getTargetPhase()
+    {
+        ksort($this->_mMileStone);
+    
+        foreach($this->_mMileStone as $tVer => $tMethod)
+        {
+            if($tVer >= $this->getCurrentVersion())
+            {
+                return intval($tVer);
+            }
+        }
+    
+        return $this->_mTargetXoopsModule->get('version');
+    }
+
+    /**
+     * hasUpgradeMethod
+     * 
+     * @param   void
+     * 
+     * @return  bool
+    **/
+    public function hasUpgradeMethod()
+    {
+        ksort($this->_mMileStone);
+    
+        foreach($this->_mMileStone as $tVer => $tMethod)
+        {
+            if($tVer >= $this->getCurrentVersion() && is_callable(array($this,$tMethod)))
+            {
+                return true;
+            }
+        }
+    
+        return false;
+    }
+
+    /**
+     * isLatestUpgrade
+     * 
+     * @param   void
+     * 
+     * @return  bool
+    **/
+    public function isLatestUpgrade()
+    {
+        return ($this->_mTargetXoopsModule->get('version') == $this->getTargetPhase());
+    }
+
+    /**
+     * _updateModuleTemplates
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    private function _updateModuleTemplates()
+    {
+        Sd2nd_InstallUtils::uninstallAllOfModuleTemplates($this->_mTargetXoopsModule,$this->mLog);
+        Sd2nd_InstallUtils::installAllOfModuleTemplates($this->_mTargetXoopsModule,$this->mLog);
+    }
+
+    /**
+     * _updateBlocks
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    private function _updateBlocks()
+    {
+        Sd2nd_InstallUtils::smartUpdateAllOfBlocks($this->_mTargetXoopsModule,$this->mLog);
+    }
+
+    /**
+     * _updatePreferences
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    private function _updatePreferences()
+    {
+        Sd2nd_InstallUtils::smartUpdateAllOfConfigs($this->_mTargetXoopsModule,$this->mLog);
+    }
+
+    /**
+     * executeUpgrade
+     * 
+     * @param   void
+     * 
+     * @return  bool
+    **/
+    public function executeUpgrade()
+    {
+        return ($this->hasUpgradeMethod() ?
+            $this->_callUpgradeMethod() :
+            $this->executeAutomaticUpgrade());
+    }
+
+    /**
+     * _callUpgradeMethod
+     * 
+     * @param   void
+     * 
+     * @return  bool
+    **/
+    private function _callUpgradeMethod()
+    {
+        ksort($this->_mMileStone);
+    
+        foreach($this->_mMileStone as $tVer => $tMethod)
+        {
+            if($tVer >= $this->getCurrentVersion() && is_callable(array($this,$tMethod)))
+            {
+                return $this->$tMethod();
+            }
+        }
+    
+        return false;
+    }
+
+    /**
+     * executeAutomaticUpgrade
+     * 
+     * @param   void
+     * 
+     * @return  bool
+    **/
+    public function executeAutomaticUpgrade()
+    {
+        $this->mLog->addReport(_MI_SD2ND_INSTALL_MSG_UPDATE_STARTED);
+    
+        $this->_updateModuleTemplates();
+        if(!$this->_mForceMode && $this->mLog->hasError())
+        {
+            $this->_processReport();
+            return false;
+        }
+    
+        $this->_updateBlocks();
+        if(!$this->_mForceMode && $this->mLog->hasError())
+        {
+            $this->_processReport();
+            return false;
+        }
+    
+        $this->_updatePreferences();
+        if(!$this->_mForceMode && $this->mLog->hasError())
+        {
+            $this->_processReport();
+            return false;
+        }
+    
+        $this->saveXoopsModule($this->_mTargetXoopsModule);
+        if(!$this->_mForceMode && $this->mLog->hasError())
+        {
+            $this->_processReport();
+            return false;
+        }
+    
+        $this->_processReport();
+    
+        return true;
+    }
+
+    /**
+     * saveXoopsModule
+     * 
+     * @param   XoopsModule  &$module
+     * 
+     * @return  void
+    **/
+    public function saveXoopsModule(/*** XoopsModule ***/ &$module)
+    {
+        $moduleHandler =& Sd2nd_Utils::getXoopsHandler('module');
+    
+        if($moduleHandler->insert($module))
+        {
+            $this->mLog->addReport(_MI_SD2ND_INSTALL_MSG_UPDATE_FINISHED);
+        }
+        else
+        {
+            $this->mLog->addError(_MI_SD2ND_INSTALL_ERROR_UPDATE_FINISHED);
+        }
+    }
+
+    /**
+     * _processReport
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    private function _processReport()
+    {
+        if(!$this->mLog->hasError())
+        {
+            $this->mLog->add(
+                XCube_Utils::formatString(
+                    _MI_SD2ND_INSTALL_MSG_MODULE_UPDATED,
+                    $this->_mCurrentXoopsModule->get('name')
+                )
+            );
+        }
+        else
+        {
+            $this->mLog->add(
+                XCube_Utils::formatString(
+                    _MI_SD2ND_INSTALL_ERROR_MODULE_UPDATED,
+                    $this->_mCurrentXoopsModule->get('name')
+                )
+            );
+        }
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/admin/index.php b/trust_path/modules/sd2nd/admin/index.php
new file mode 100644 (file)
index 0000000..85bc48f
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+/**
+ * @file
+ * @brief The page controller in the directory
+ * @package sd2nd
+ * @version $Id$
+**/
+
+require_once XOOPS_ROOT_PATH . '/header.php';
+
+$root =& XCube_Root::getSingleton();
+
+$root->mContext->mModule->setAdminMode(true);
+$root->mController->execute();
+
+require_once XOOPS_ROOT_PATH . '/footer.php';
+
+?>
diff --git a/trust_path/modules/sd2nd/class/AbstractAction.class.php b/trust_path/modules/sd2nd/class/AbstractAction.class.php
new file mode 100644 (file)
index 0000000..a43812b
--- /dev/null
@@ -0,0 +1,162 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+/**
+ * Sd2nd_AbstractAction
+**/
+abstract class Sd2nd_AbstractAction
+{
+    /**
+     * @brief   XCube_Root
+    **/
+    public $mRoot = null;
+
+    /**
+     * @brief   Sd2nd_Module
+    **/
+    public $mModule = null;
+
+    /**
+     * @brief   Sd2nd_AssetManager
+    **/
+    public $mAsset = null;
+
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        $this->mRoot =& XCube_Root::getSingleton();
+        $this->mModule =& $this->mRoot->mContext->mModule;
+        $this->mAsset =& $this->mModule->mAssetManager;
+    }
+
+    /**
+     * prepare
+     * 
+     * @param   void
+     * 
+     * @return  bool
+    **/
+    public function prepare()
+    {
+        return true;
+    }
+
+    /**
+     * hasPermission
+     * 
+     * @param   void
+     * 
+     * @return  bool
+    **/
+    public function hasPermission()
+    {
+        return true;
+    }
+
+    /**
+     * getDefaultView
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    public function getDefaultView()
+    {
+        return SD2ND_FRAME_VIEW_NONE;
+    }
+
+    /**
+     * execute
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    public function execute()
+    {
+        return SD2ND_FRAME_VIEW_NONE;
+    }
+
+    /**
+     * executeViewSuccess
+     * 
+     * @param   XCube_RenderTarget  &$render
+     * 
+     * @return  void
+    **/
+    public function executeViewSuccess(/*** XCube_RenderTarget ***/ &$render)
+    {
+    }
+
+    /**
+     * executeViewError
+     * 
+     * @param   XCube_RenderTarget  &$render
+     * 
+     * @return  void
+    **/
+    public function executeViewError(/*** XCube_RenderTarget ***/ &$render)
+    {
+    }
+
+    /**
+     * executeViewIndex
+     * 
+     * @param   XCube_RenderTarget  &$render
+     * 
+     * @return  void
+    **/
+    public function executeViewIndex(/*** XCube_RenderTarget ***/ &$render)
+    {
+    }
+
+    /**
+     * executeViewInput
+     * 
+     * @param   XCube_RenderTarget  &$render
+     * 
+     * @return  void
+    **/
+    public function executeViewInput(/*** XCube_RenderTarget ***/ &$render)
+    {
+    }
+
+    /**
+     * executeViewPreview
+     * 
+     * @param   XCube_RenderTarget  &$render
+     * 
+     * @return  void
+    **/
+    public function executeViewPreview(/*** XCube_RenderTarget ***/ &$render)
+    {
+    }
+
+    /**
+     * executeViewCancel
+     * 
+     * @param   XCube_RenderTarget  &$render
+     * 
+     * @return  void
+    **/
+    public function executeViewCancel(/*** XCube_RenderTarget ***/ &$render)
+    {
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/AbstractDeleteAction.class.php b/trust_path/modules/sd2nd/class/AbstractDeleteAction.class.php
new file mode 100644 (file)
index 0000000..06e040d
--- /dev/null
@@ -0,0 +1,62 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+require_once SD2ND_TRUST_PATH . '/class/AbstractEditAction.class.php';
+
+/**
+ * Sd2nd_AbstractDeleteAction
+**/
+abstract class Sd2nd_AbstractDeleteAction extends Sd2nd_AbstractEditAction
+{
+    /**
+     * _isEnableCreate
+     * 
+     * @param   void
+     * 
+     * @return  bool
+    **/
+    protected function _isEnableCreate()
+    {
+        return false;
+    }
+
+    /**
+     * prepare
+     * 
+     * @param   void
+     * 
+     * @return  bool
+    **/
+    public function prepare()
+    {
+        return parent::prepare() && is_object($this->mObject);
+    }
+
+    /**
+     * _doExecute
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    protected function _doExecute()
+    {
+        if($this->mObjectHandler->delete($this->mObject))
+        {
+            return SD2ND_FRAME_VIEW_SUCCESS;
+        }
+    
+        return SD2ND_FRAME_VIEW_ERROR;
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/AbstractEditAction.class.php b/trust_path/modules/sd2nd/class/AbstractEditAction.class.php
new file mode 100644 (file)
index 0000000..a4dcd0f
--- /dev/null
@@ -0,0 +1,185 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+/**
+ * Sd2nd_AbstractEditAction
+**/
+abstract class Sd2nd_AbstractEditAction extends Sd2nd_AbstractAction
+{
+    /**
+     * @brief   XoopsSimpleObject
+    **/
+    public $mObject = null;
+
+    /**
+     * @brief   XoopsObjectGenericHandler
+    **/
+    public $mObjectHandler = null;
+
+    /**
+     * @brief   XCube_ActionForm
+    **/
+    public $mActionForm = null;
+
+    /**
+     * _getId
+     * 
+     * @param   void
+     * 
+     * @return  int
+    **/
+    protected function _getId()
+    {
+    }
+
+    /**
+     * &_getHandler
+     * 
+     * @param   void
+     * 
+     * @return  XoopsObjectGenericHandler
+    **/
+    protected function &_getHandler()
+    {
+    }
+
+    /**
+     * _setupActionForm
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    protected function _setupActionForm()
+    {
+    }
+
+    /**
+     * _setupObject
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    protected function _setupObject()
+    {
+        $id = $this->_getId();
+    
+        $this->mObjectHandler =& $this->_getHandler();
+    
+        $this->mObject =& $this->mObjectHandler->get($id);
+    
+        if($this->mObject == null && $this->_isEnableCreate())
+        {
+            $this->mObject =& $this->mObjectHandler->create();
+        }
+    }
+
+    /**
+     * _isEnableCreate
+     * 
+     * @param   void
+     * 
+     * @return  bool
+    **/
+    protected function _isEnableCreate()
+    {
+        return true;
+    }
+
+    /**
+     * prepare
+     * 
+     * @param   void
+     * 
+     * @return  bool
+    **/
+    public function prepare()
+    {
+        $this->_setupObject();
+        $this->_setupActionForm();
+    
+        return true;
+    }
+
+    /**
+     * getDefaultView
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    public function getDefaultView()
+    {
+        if($this->mObject == null)
+        {
+            return SD2ND_FRAME_VIEW_ERROR;
+        }
+    
+        $this->mActionForm->load($this->mObject);
+    
+        return SD2ND_FRAME_VIEW_INPUT;
+    }
+
+    /**
+     * execute
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    public function execute()
+    {
+        if ($this->mObject == null)
+        {
+            return SD2ND_FRAME_VIEW_ERROR;
+        }
+    
+        if ($this->mRoot->mContext->mRequest->getRequest('_form_control_cancel') != null)
+        {
+            return SD2ND_FRAME_VIEW_CANCEL;
+        }
+    
+        $this->mActionForm->load($this->mObject);
+    
+        $this->mActionForm->fetch();
+        $this->mActionForm->validate();
+    
+        if ($this->mActionForm->hasError())
+        {
+            return SD2ND_FRAME_VIEW_INPUT;
+        }
+    
+        $this->mActionForm->update($this->mObject);
+    
+        return $this->_doExecute();
+    }
+
+    /**
+     * _doExecute
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    protected function _doExecute()
+    {
+        if($this->mObjectHandler->insert($this->mObject))
+        {
+            return SD2ND_FRAME_VIEW_SUCCESS;
+        }
+    
+        return SD2ND_FRAME_VIEW_ERROR;
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/AbstractFilterForm.class.php b/trust_path/modules/sd2nd/class/AbstractFilterForm.class.php
new file mode 100644 (file)
index 0000000..2e82428
--- /dev/null
@@ -0,0 +1,184 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+/**
+ * Sd2nd_AbstractFilterForm
+**/
+abstract class Sd2nd_AbstractFilterForm
+{
+    /**
+     * @brief   Enum
+    **/
+    public $mSort = 0;
+
+    /**
+     * @brief   string[]
+    **/
+    public $mSortKeys = array();
+
+    /**
+     * @brief   XCube_PageNavigator
+    **/
+    public $mNavi = null;
+
+    /**
+     * @brief   XoopsObjectGenericHandler
+    **/
+    protected $_mHandler = null;
+
+    /**
+     * @brief   Criteria
+    **/
+    protected $_mCriteria = null;
+
+    /**
+     * _getId
+     * 
+     * @param   void
+     * 
+     * @return  int
+    **/
+    protected function _getId()
+    {
+    }
+
+    /**
+     * &_getHandler
+     * 
+     * @param   void
+     * 
+     * @return  XoopsObjectGenericHandler
+    **/
+    protected function &_getHandler()
+    {
+    }
+
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        $this->_mCriteria =& new CriteriaCompo();
+    }
+
+    /**
+     * prepare
+     * 
+     * @param   XCube_PageNavigator  &$navi
+     * @param   XoopsObjectGenericHandler  &$handler
+     * 
+     * @return  void
+    **/
+    public function prepare(/*** XCube_PageNavigator ***/ &$navi,/*** XoopsObjectGenericHandler ***/ &$handler)
+    {
+        $this->mNavi =& $navi;
+        $this->_mHandler =& $handler;
+    
+        $this->mNavi->mGetTotalItems->add(array(&$this, 'getTotalItems'));
+    }
+
+    /**
+     * getTotalItems
+     * 
+     * @param   int  &$total
+     * 
+     * @return  void
+    **/
+    public function getTotalItems(/*** int ***/ &$total)
+    {
+        $total = $this->_mHandler->getCount($this->getCriteria());
+    }
+
+    /**
+     * fetchSort
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    protected function fetchSort()
+    {
+        $root =& XCube_Root::getSingleton();
+        $this->mSort = intval($root->mContext->mRequest->getRequest($this->mNavi->mPrefix . 'sort'));
+    
+        if(!isset($this->mSortKeys[abs($this->mSort)]))
+        {
+            $this->mSort = $this->getDefaultSortKey();
+        }
+    
+        $this->mNavi->mSort[$this->mNavi->mPrefix . 'sort'] = $this->mSort;
+    }
+
+    /**
+     * fetch
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function fetch()
+    {
+        $this->mNavi->fetch();
+        $this->fetchSort();
+    }
+
+    /**
+     * getSort
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    public function getSort()
+    {
+        $sortkey = abs($this->mSort);
+        return $this->mSortKeys[$sortkey];
+    }
+
+    /**
+     * getOrder
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    public function getOrder()
+    {
+        return ($this->mSort < 0) ? 'desc' : 'asc';
+    }
+
+    /**
+     * &getCriteria
+     * 
+     * @param   int  $start
+     * @param   int  $limit
+     * 
+     * @return  Criteria
+    **/
+    public function &getCriteria(/*** int ***/ $start = null,/*** int ***/ $limit = null)
+    {
+        $t_start = ($start === null) ? $this->mNavi->getStart() : intval($start);
+        $t_limit = ($limit === null) ? $this->mNavi->getPerpage() : intval($limit);
+    
+        $criteria = $this->_mCriteria;
+    
+        $criteria->setStart($t_start);
+        $criteria->setLimit($t_limit);
+        return $criteria;
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/AbstractListAction.class.php b/trust_path/modules/sd2nd/class/AbstractListAction.class.php
new file mode 100644 (file)
index 0000000..ad111cb
--- /dev/null
@@ -0,0 +1,143 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+require_once XOOPS_ROOT_PATH . '/core/XCube_PageNavigator.class.php';
+
+/**
+ * Sd2nd_AbstractListAction
+**/
+abstract class Sd2nd_AbstractListAction extends Sd2nd_AbstractAction
+{
+    /**
+     * @brief   XoopsSimpleObject[]
+    **/
+    public $mObjects = null;
+
+    /**
+     * @brief   Sd2nd_AbstractFilterForm
+    **/
+    public $mFilter = null;
+
+    /**
+     * &_getHandler
+     * 
+     * @param   void
+     * 
+     * @return  &XoopsObjectGenericHandler
+    **/
+    protected function &_getHandler()
+    {
+    }
+
+    /**
+     * &_getFilterForm
+     * 
+     * @param   void
+     * 
+     * @return  &Sd2ndAbstractFilterForm
+    **/
+    protected function &_getFilterForm()
+    {
+    }
+
+    /**
+     * _getBaseUrl
+     * 
+     * @param   void
+     * 
+     * @return  string
+    **/
+    protected function _getBaseUrl()
+    {
+    }
+
+    /**
+     * &_getPageNavi
+     * 
+     * @param   void
+     * 
+     * @return  &XCube_PageNavigator
+    **/
+    protected function &_getPageNavi()
+    {
+        $navi =& new XCube_PageNavigator($this->_getBaseUrl(), XCUBE_PAGENAVI_START);
+        return $navi;
+    }
+
+    /**
+     * getDefaultView
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    public function getDefaultView()
+    {
+        $this->mFilter =& $this->_getFilterForm();
+        $this->mFilter->fetch();
+    
+        $handler =& $this->_getHandler();
+        $this->mObjects =& $handler->getObjects($this->mFilter->getCriteria());
+    
+        return SD2ND_FRAME_VIEW_INDEX;
+    }
+
+    /**
+     * execute
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    public function execute()
+    {
+        return $this->getDefaultView();
+    }
+}
+
+
+/**
+ * @class   Sd2nd_AbstractUpdateListAction
+**/
+class Sd2nd_AbstractUpdateListAction extends Sd2nd_AbstractListAction
+{
+    /**
+     * @brief   Sd2nd_UpdateHandler
+    **/
+    protected $_mUpdateHandler = null;
+    
+    /**
+     * prepare
+     * 
+     * @param   void
+     * 
+     * @return  bool
+    **/
+    public function prepare()
+    {
+        if(!parent::prepare())
+        {
+            return false;
+        }
+        
+        $this->_mUpdateHandler =& $this->mAsset->getObject('handler',Sd2nd_AssetManager::HANDLER_UPDATE);
+        if(!isset($_GET['regist_time']))
+        {
+            $update =& $this->_mUpdateHandler->getLatestUpdate();
+            $_GET['regist_time'] = $update->get('update_time');
+        }
+        
+        return true;
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/AbstractViewAction.class.php b/trust_path/modules/sd2nd/class/AbstractViewAction.class.php
new file mode 100644 (file)
index 0000000..c98e4b5
--- /dev/null
@@ -0,0 +1,109 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+/**
+ * Sd2nd_AbstractViewAction
+**/
+abstract class Sd2nd_AbstractViewAction extends Sd2nd_AbstractAction
+{
+    /**
+     * @brief   XoopsSimpleObject
+    **/
+    public $mObject = null;
+
+    /**
+     * @brief   XoopsObjectGenericHandler
+    **/
+    public $mObjectHandler = null;
+
+    /**
+     * _getId
+     * 
+     * @param   void
+     * 
+     * @return  int
+    **/
+    protected function _getId()
+    {
+    }
+
+    /**
+     * &_getHandler
+     * 
+     * @param   void
+     * 
+     * @return  &XoopsObjectGenericHandler
+    **/
+    protected function &_getHandler()
+    {
+    }
+
+    /**
+     * _setupObject
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    protected function _setupObject()
+    {
+        $id = $this->_getId();
+    
+        $this->mObjectHandler =& $this->_getHandler();
+    
+        $this->mObject =& $this->mObjectHandler->get($id);
+    }
+
+    /**
+     * prepare
+     * 
+     * @param   void
+     * 
+     * @return  bool
+    **/
+    public function prepare()
+    {
+        $this->_setupObject();
+        return is_object($this->mObject);
+    }
+
+    /**
+     * getDefaultView
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    public function getDefaultView()
+    {
+        if($this->mObject == null)
+        {
+            return SD2ND_FRAME_VIEW_ERROR;
+        }
+    
+        return SD2ND_FRAME_VIEW_SUCCESS;
+    }
+
+    /**
+     * execute
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    public function execute()
+    {
+        return $this->getDefaultView();
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/AssetManager.class.php b/trust_path/modules/sd2nd/class/AssetManager.class.php
new file mode 100644 (file)
index 0000000..b574f99
--- /dev/null
@@ -0,0 +1,295 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+/**
+ * Sd2nd_AssetManager
+**/
+class Sd2nd_AssetManager
+{
+    #region for Enum
+    const HANDLER_ABILITY = 'Ability';
+    const HANDLER_ACTIVE_ABILITY = 'ActiveAbility';
+    const HANDLER_CHAR = 'Char';
+    const HANDLER_COSTUME = 'Costume';
+    const HANDLER_ENO_PNO_LINK = 'EnoPnoLink';
+    const HANDLER_ICON = 'Icon';
+    const HANDLER_IMAGE = 'Image';
+    const HANDLER_KIND = 'Kind';
+    const HANDLER_LEARNED_ABILITY = 'LearnedAbility';
+    const HANDLER_LEARNED_COSTUME = 'LearnedCostume';
+    const HANDLER_LEARNED_SKILL = 'LearnedSkill';
+    const HANDLER_MAP = 'Map';
+    const HANDLER_MAP_CACHE = 'MapCache';
+    const HANDLER_MAP_NAME = 'MapName';
+    const HANDLER_MAP_SPOT = 'MapSpot';
+    const HANDLER_RACE = 'Race';
+    const HANDLER_SKILL = 'Skill';
+    const HANDLER_SKILL_ELEMENT_LINK = 'SkillElementLink';
+    const HANDLER_STATUS = 'Status';
+    const HANDLER_TARGET = 'Target';
+    const HANDLER_UPDATE = 'Update';
+    #endregion
+    
+    public /*** string ***/ $mDirname = '';
+    public /*** string ***/ $mTrustDirname = 'sd2nd';
+    public /*** string[][][] ***/ $mAssetList = array();
+    private /*** object[][] ***/ $_mCache = array();
+
+    /**
+     * __construct
+     * 
+     * @param   string  $dirname
+     * 
+     * @return  void
+    **/
+    public function __construct(/*** string ***/ $dirname)
+    {
+        $this->mDirname = $dirname;
+    }
+
+    /**
+     * &getInstance
+     * 
+     * @param   string  $dirname
+     * 
+     * @return  Sd2nd_AssetManager
+    **/
+    public function &getInstance(/*** string ***/ $dirname)
+    {
+        /**
+         *  @var    Sd2nd_AssetManager[]
+        **/
+        static $instance = array();
+    
+        if(!isset($instance[$dirname]))
+        {
+            $instance[$dirname] = new Sd2nd_AssetManager($dirname);
+        }
+    
+        return $instance[$dirname];
+    }
+
+    /**
+     * &getObject
+     * 
+     * @param   string  $type
+     * @param   string  $name
+     * @param   bool  $isAdmin
+     * @param   string  $mode
+     * 
+     * @return  &object<XCube_ActionFilter,XCube_ActionForm,XoopsObjectGenericHandler>
+    **/
+    public function &getObject(/*** string ***/ $type,/*** string ***/ $name,/*** bool ***/ $isAdmin = false,/*** string ***/ $mode = null)
+    {
+        if(isset($this->_mCache[$type][$name]))
+        {
+            return $this->_mCache[$type][$name];
+        }
+    
+        $instance = null;
+        
+        $methodName = 'create' . ucfirst($name) . ucfirst($mode) . ucfirst($type);
+        if(method_exists($this,$methodName))
+        {
+            $instance =& $this->$methodName();
+        }
+    
+        if($instance === null)
+        {
+            $instance =& $this->_fallbackCreate($type,$name,$isAdmin,$mode);
+        }
+    
+        $this->_mCache[$type][$name] =& $instance;
+    
+        return $instance;
+    }
+
+    /**
+     * getRoleName
+     * 
+     * @param   string  $role
+     * 
+     * @return  string
+    **/
+    public function getRoleName(/*** string ***/ $role)
+    {
+        return 'Module.' . $this->mDirname . '.' . $role;
+    }
+
+    /**
+     * &_fallbackCreate
+     * 
+     * @param   string  $type
+     * @param   string  $name
+     * @param   bool  $isAdmin
+     * @param   string  $mode
+     * 
+     * @return  &object<XCube_ActionFilter,XCube_ActionForm,XoopsObjectGenericHandler>
+    **/
+    private function &_fallbackCreate(/*** string ***/ $type,/*** string ***/ $name,/*** bool ***/ $isAdmin = false,/*** string ***/ $mode = null)
+    {
+        $className = null;
+        $instance = null;
+    
+        if(isset($this->mAssetList[$type][$name]['class']))
+        {
+            $asset = $this->mAssetList[$type][$name];
+            if(isset($asset['absPath']) && $this->_loadClassFile($asset['absPath'],$asset['class']))
+            {
+                $className = $asset['class'];
+            }
+    
+            if($className == null && isset($asset['path']))
+            {
+                if($this->_loadClassFile($this->_getPublicPath() . $asset['path'],$asset['class']))
+                {
+                    $className = $asset['class'];
+                }
+    
+                if($className == null && $this->_loadClassFile($this->_getTrustPath() . $asset['path'],$asset['class']))
+                {
+                    $className = $asset['class'];
+                }
+            }
+        }
+    
+        if($className == null)
+        {
+            switch($type)
+            {
+                case 'filter':
+                    $className = $this->_getFilterName($name,$isAdmin);
+                    break;
+                case 'form':
+                    $className = $this->_getActionFormName($name,$isAdmin,$mode);
+                    break;
+                case 'handler':
+                    $className = $this->_getHandlerName($name);
+                    break;
+                default:
+                    return $instance;
+            }
+        }
+    
+        if($type == 'handler')
+        {
+            $root =& XCube_Root::getSingleton();
+            $instance =& new $className($root->mController->getDB(),$this->mDirname);
+        }
+        else
+        {
+            $instance =& new $className();
+        }
+        return $instance;
+    }
+
+    /**
+     * _getFilterName
+     * 
+     * @param   string  $name
+     * @param   bool  $isAdmin
+     * 
+     * @return  string
+    **/
+    private function _getFilterName(/*** string ***/ $name,/*** bool ***/ $isAdmin = false)
+    {
+        $name = ucfirst($name) . 'FilterForm';
+        $path = 'forms/' . $name . '.class.php';
+        $className = ucfirst($this->mTrustDirname) . ($isAdmin ? '_Admin_' : '_') . $name;
+        return (
+            $this->_loadClassFile($this->_getPublicPath($isAdmin) . $path,$className) ||
+            $this->_loadClassFile($this->_getTrustPath($isAdmin) . $path,$className)
+        ) ? $className : null;
+    }
+
+    /**
+     * _getActionFormName
+     * 
+     * @param   string  $name
+     * @param   bool  $isAdmin
+     * @param   string  $mode
+     * 
+     * @return  string
+    **/
+    private function _getActionFormName(/*** string ***/ $name,/*** bool ***/ $isAdmin = false,/*** string ***/ $mode = null)
+    {
+        $name = ucfirst($name) . ucfirst($mode) . 'Form';
+        $path = 'forms/' . $name . '.class.php';
+        $className = ucfirst($this->mTrustDirname) . ($isAdmin ? '_Admin_' : '_') . $name;
+        return (
+            $this->_loadClassFile($this->_getPublicPath($isAdmin) . $path,$className) ||
+            $this->_loadClassFile($this->_getTrustPath($isAdmin) . $path,$className)
+        ) ? $className : null;
+    }
+
+    /**
+     * _getHandlerName
+     * 
+     * @param   string  $name
+     * 
+     * @return  string
+    **/
+    private function _getHandlerName(/*** string ***/ $name)
+    {
+        $path = 'class/handler/' . ucfirst($name) . '.class.php';
+        $className = ucfirst($this->mTrustDirname) . '_' . ucfirst($name) . 'Handler';
+        return (
+            $this->_loadClassFile($this->_getPublicPath() . $path,$className) ||
+            $this->_loadClassFile($this->_getTrustPath() . $path,$className)
+        ) ? $className : null;
+    }
+
+    /**
+     * _loadClassFile
+     * 
+     * @param   string  $path
+     * @param   string  $class
+     * 
+     * @return  bool
+    **/
+    private function _loadClassFile(/*** string ***/ $path,/*** string ***/ $class)
+    {
+        if(!file_exists($path))
+        {
+            return false;
+        }
+        require_once $path;
+    
+        return class_exists($class);
+    }
+
+    /**
+     * _getPublicPath
+     * 
+     * @param   bool  $isAdmin
+     * 
+     * @return  string
+    **/
+    private function _getPublicPath(/*** bool ***/ $isAdmin = false)
+    {
+        return XOOPS_MODULE_PATH . '/' . $this->mDirname . ($isAdmin ? '/admin/' : '/');
+    }
+
+    /**
+     * _getTrustPath
+     * 
+     * @param   bool  $isAdmin
+     * 
+     * @return  string
+    **/
+    private function _getTrustPath(/*** bool ***/ $isAdmin = false)
+    {
+        return SD2ND_TRUST_PATH . ($isAdmin ? '/admin/' : '/');
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/Module.class.php b/trust_path/modules/sd2nd/class/Module.class.php
new file mode 100644 (file)
index 0000000..be809b8
--- /dev/null
@@ -0,0 +1,461 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+require_once SD2ND_TRUST_PATH . '/class/AbstractAction.class.php';
+
+define('SD2ND_FRAME_PERFORM_SUCCESS', 1);
+define('SD2ND_FRAME_PERFORM_FAIL', 2);
+define('SD2ND_FRAME_INIT_SUCCESS', 3);
+
+define('SD2ND_FRAME_VIEW_NONE','none');
+define('SD2ND_FRAME_VIEW_SUCCESS','success');
+define('SD2ND_FRAME_VIEW_ERROR','error');
+define('SD2ND_FRAME_VIEW_INDEX','index');
+define('SD2ND_FRAME_VIEW_INPUT','input');
+define('SD2ND_FRAME_VIEW_PREVIEW','preview');
+define('SD2ND_FRAME_VIEW_CANCEL','cancel');
+
+/**
+ * Sd2nd_Module
+**/
+class Sd2nd_Module extends Legacy_ModuleAdapter
+{
+    /**
+     * @brief   string
+    **/
+    public $mActionName = null;
+
+    /**
+     * @brief   Sd2nd_AbstractAction
+    **/
+    public $mAction = null;
+
+    /**
+     * @brief   bool
+    **/
+    public $mAdminFlag = false;
+
+    /**
+     * @brief   Sd2nd_AssetManager
+    **/
+    public $mAssetManager = null;
+
+    /**
+     * @brief   string
+    **/
+    protected $_mPreferenceEditUrl = null;
+
+    /**
+     * @brief   string
+    **/
+    protected $_mHelpViewUrl = null;
+
+    /**
+     * @brief   Enum[]
+    **/
+    protected $_mAllowViewNames = array(
+        SD2ND_FRAME_VIEW_NONE,
+        SD2ND_FRAME_VIEW_SUCCESS,
+        SD2ND_FRAME_VIEW_ERROR,
+        SD2ND_FRAME_VIEW_INDEX,
+        SD2ND_FRAME_VIEW_INPUT,
+        SD2ND_FRAME_VIEW_PREVIEW,
+        SD2ND_FRAME_VIEW_CANCEL
+    );
+
+    /**
+     * startup
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function startup()
+    {
+        parent::startup();
+    
+        XCube_DelegateUtils::call('Module.sd2nd.Global.Event.GetAssetManager',new XCube_Ref($this->mAssetManager),$this->mXoopsModule->get('dirname'));
+    
+        $root =& XCube_Root::getSingleton();
+        $root->mController->mExecute->add(array(&$this, 'execute'));
+    
+        //
+        // TODO/Insert your initialization code.
+        //
+    }
+
+    /**
+     * setAdminMode
+     * 
+     * @param   bool  $flag
+     * 
+     * @return  void
+    **/
+    public function setAdminMode(/*** bool ***/ $flag)
+    {
+        $this->mAdminFlag = $flag;
+    }
+
+    /**
+     * _getDefaultActionName
+     * 
+     * @param   void
+     * 
+     * @return  string
+    **/
+    private function _getDefaultActionName()
+    {
+        // TODO insert your default action name
+        return 'index';
+    }
+
+    /**
+     * setActionName
+     * 
+     * @param   string  $name
+     * 
+     * @return  void
+    **/
+    public function setActionName(/*** string ***/ $name)
+    {
+        $this->mActionName = $name;
+    }
+
+    /**
+     * getRenderSystemName
+     * 
+     * @param   void
+     * 
+     * @return  string
+    **/
+    public function getRenderSystemName()
+    {
+        if(!$this->mAdminFlag)
+        {
+            return parent::getRenderSystemName();
+        }
+    
+        // TODO will be use site config
+        if(!defined('SD2ND_ADMIN_RENDER_REGISTED'))
+        {
+            define('SD2ND_ADMIN_RENDER_REGISTED',true);
+            $root =& XCube_Root::getSingleton();
+            $root->overrideSiteConfig(
+                array(
+                    'RenderSystems' => array(
+                        'Sd2nd_AdminRenderSystem' => 'Sd2nd_AdminRenderSystem'
+                    ),
+                    'Sd2nd_AdminRenderSystem' => array(
+                        'root' => SD2ND_TRUST_PATH,
+                        'path' => '/admin/class/Sd2ndAdminRenderSystem.class.php',
+                        'class' => 'Sd2nd_AdminRenderSystem'
+                    )
+                )
+            );
+        }
+    
+        return 'Sd2nd_AdminRenderSystem';
+    }
+
+    /**
+     * getAdminMenu
+     * 
+     * @param   void
+     * 
+     * @return  {string 'title',string 'link',string 'keywords',bool 'show',bool 'absolute'}[]
+    **/
+    public function getAdminMenu()
+    {
+        if(is_array($this->mAdminMenu))
+        {
+            return $this->mAdminMenu;
+        }
+    
+        $root =& XCube_Root::getSingleton();
+    
+        // load admin menu
+        $adminMenu = $this->mXoopsModule->getInfo('adminmenu');
+        if(!is_array($adminMenu))
+        {
+            $adminMenu = array();
+        }
+    
+        // add preference menu
+        if($url = $this->getPreferenceEditUrl())
+        {
+            $adminMenu[] = array(
+                'title'    => _PREFERENCES,
+                'link'     => $url,
+                'absolute' => true
+            );
+        }
+    
+        // add help menu
+        if($url = $this->getHelpViewUrl())
+        {
+            $adminMenu[] = array(
+                'title'    => _HELP,
+                'link'     => $url,
+                'absolute' => true
+            );
+        }
+    
+        $this->mAdminMenu = array();
+        foreach($adminMenu as $menu)
+        {
+            if(!(isset($menu['absolute']) && $menu['absolute']))
+            {
+                $menu['link'] = XOOPS_MODULE_URL . '/' . $this->mXoopsModule->get('dirname') . '/' . $menu['link'];
+            }
+            $this->mAdminMenu[] = $menu;
+        }
+    
+        return $this->mAdminMenu;
+    }
+
+    /**
+     * getPreferenceEditUrl
+     * 
+     * @param   void
+     * 
+     * @return  string
+    **/
+    public function getPreferenceEditUrl()
+    {
+        if($this->_mPreferenceEditUrl === null)
+        {
+            if(is_array($this->mXoopsModule->getInfo('config')) && count($this->mXoopsModule->getInfo('config')) > 0)
+            {
+                $root =& XCube_Root::getSingleton();
+                $this->_mPreferenceEditUrl = $root->mController->getPreferenceEditUrl($this->mXoopsModule);
+            }
+            else
+            {
+                $this->_mPreferenceEditUrl = false;
+            }
+        }
+    
+        return $this->_mPreferenceEditUrl;
+    }
+
+    /**
+     * getHelpViewUrl
+     * 
+     * @param   void
+     * 
+     * @return  string
+    **/
+    public function getHelpViewUrl()
+    {
+        if($this->_mHelpViewUrl === null)
+        {
+            if($this->mXoopsModule->hasHelp())
+            {
+                $root =& XCube_Root::getSingleton();
+                $this->_mHelpViewUrl = $root->mController->getHelpViewUrl($this->mXoopsModule);
+            }
+            else
+            {
+                $this->_mHelpViewUrl = false;
+            }
+        }
+    
+        return $this->_mHelpViewUrl;
+    }
+
+    /**
+     * execute
+     * 
+     * @param   XCube_Controller  &$controller
+     * 
+     * @return  void
+    **/
+    public function execute(/*** XCube_Controller ***/ &$controller)
+    {
+        if($this->_createAction() === false)
+        {
+            $this->doActionNotFoundError();
+            die();
+        }
+    
+        if($this->mAction->prepare() === false)
+        {
+            $this->doPreparationError();
+            die();
+        }
+    
+        if($this->mAction->hasPermission() === false)
+        {
+            $this->doPermissionError();
+            die();
+        }
+    
+        $viewStatus = (Sd2nd_Utils::getEnv('REQUEST_METHOD') == 'POST') ?
+            $this->mAction->execute() :
+            $this->mAction->getDefaultView();
+    
+        if(in_array($viewStatus,$this->_mAllowViewNames))
+        {
+            $methodName = 'executeView' . ucfirst($viewStatus);
+            if(is_callable(array($this->mAction,$methodName)))
+            {
+                $this->mAction->$methodName($this->getRenderTarget());
+            }
+        }
+    }
+
+    /**
+     * _createAction
+     * 
+     * @param   void
+     * 
+     * @return  bool
+    **/
+    private function _createAction()
+    {
+        $root =& XCube_Root::getSingleton();
+    
+        if($this->mActionName == null)
+        {
+            $this->mActionName = $root->mContext->mRequest->getRequest('action');
+            if($this->mActionName == null)
+            {
+                $this->mActionName = $this->_getDefaultActionName();
+            }
+        }
+    
+        if(!ctype_alnum($this->mActionName))
+        {
+            return false;
+        }
+    
+        $fileName = ($this->mAdminFlag ? '/admin' : '')
+            . '/actions/' . ucfirst($this->mActionName) . 'Action.class.php';
+        switch(true)
+        {
+            case file_exists(
+                $path = XOOPS_MODULE_PATH . '/' . $this->mXoopsModule->get('dirname') . $fileName
+            ):
+                break;
+            case file_exists(
+                $path = SD2ND_TRUST_PATH . '/' . $fileName
+            ):
+                break;
+            default:
+                return false;
+        }
+    
+        require_once $path;
+    
+        $className = 'Sd2nd_' . ($this->mAdminFlag ? 'Admin_' : '')
+            . ucfirst($this->mActionName) . 'Action';
+        if(class_exists($className))
+        {
+            $this->mAction =& new $className();
+        }
+        if(!$this->mAction instanceof Sd2nd_AbstractAction)
+        {
+            return false;
+        }
+    
+        return true;
+    }
+
+    /**
+     * doActionNotFoundError
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    private function doActionNotFoundError()
+    {
+        /**
+         * Module.sd2nd.Global.Event.Exception.ActionNotFound
+         * 
+         * @param   string  $dirname
+         * 
+         * @return  void
+        **/
+        XCube_DelegateUtils::call('Module.sd2nd.Global.Event.Exception.ActionNotFound',$this->mAssetManager->mDirname);
+        /**
+         * Module.{dirname}.Event.Exception.ActionNotFound
+         * 
+         * @param   void
+         * 
+         * @return  void
+        **/
+        XCube_DelegateUtils::call('Module.' . $this->mXoopsModule->get('dirname') . '.Event.Exception.ActionNotFound');
+        $root =& XCube_Root::getSingleton();
+        $root->mController->executeForward(XOOPS_URL);
+    }
+
+    /**
+     * doPreparationError
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    private function doPreparationError()
+    {
+        /**
+         * Module.sd2nd.Global.Event.Exception.Preparation
+         * 
+         * @param   string  $dirname
+         * 
+         * @return  void
+        **/
+        XCube_DelegateUtils::call('Module.sd2nd.Global.Event.Exception.Preparation',$this->mAssetManager->mDirname);
+        /**
+         * Module.{dirname}.Event.Exception.Preparation
+         * 
+         * @param   void
+         * 
+         * @return  void
+        **/
+        XCube_DelegateUtils::call('Module.' . $this->mXoopsModule->get('dirname') . '.Event.Exception.Preparation');
+        $root =& XCube_Root::getSingleton();
+        $root->mController->executeForward(XOOPS_URL);
+    }
+
+    /**
+     * doPermissionError
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    private function doPermissionError()
+    {
+        /**
+         * Module.sd2nd.Global.Event.Exception.Permission
+         * 
+         * @param   string  $dirname
+         * 
+         * @return  void
+        **/
+        XCube_DelegateUtils::call('Module.sd2nd.Global.Event.Exception.Permission',$this->mAssetManager->mDirname);
+        /**
+         * Module.{dirname}.Event.Exception.Permission
+         * 
+         * @param   void
+         * 
+         * @return  void
+        **/
+        XCube_DelegateUtils::call('Module.' . $this->mXoopsModule->get('dirname') . '.Event.Exception.Permission');
+        $root =& XCube_Root::getSingleton();
+        $root->mController->executeForward(XOOPS_URL);
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/Sd2ndUtils.class.php b/trust_path/modules/sd2nd/class/Sd2ndUtils.class.php
new file mode 100644 (file)
index 0000000..90f6ae0
--- /dev/null
@@ -0,0 +1,59 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+/**
+ * Sd2nd_Utils
+**/
+class Sd2nd_Utils
+{
+    /**
+     * &getXoopsHandler
+     * 
+     * @param   string  $name
+     * @param   bool  $optional
+     * 
+     * @return  XoopsObjectHandler
+    **/
+    public static function &getXoopsHandler(/*** string ***/ $name,/*** bool ***/ $optional = false)
+    {
+        // TODO will be emulated xoops_gethandler
+        return xoops_gethandler($name,$optional);
+    }
+
+    /**
+     * &getModuleHandler
+     * 
+     * @param   string  $name
+     * @param   string  $dirname
+     * 
+     * @return  XoopsObjectHandleer
+    **/
+    public static function &getModuleHandler(/*** string ***/ $name,/*** string ***/ $dirname)
+    {
+        // TODO will be emulated xoops_getmodulehandler
+        return xoops_getmodulehandler($name,$dirname);
+    }
+
+    /**
+     * getEnv
+     * 
+     * @param   string  $key
+     * 
+     * @return  string
+    **/
+    public static function getEnv(/*** string ***/ $key)
+    {
+        return getenv($key);
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/handler/Ability.class.php b/trust_path/modules/sd2nd/class/handler/Ability.class.php
new file mode 100644 (file)
index 0000000..5286630
--- /dev/null
@@ -0,0 +1,70 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+/**
+ * Sd2nd_AbilityObject
+**/
+class Sd2nd_AbilityObject extends XoopsSimpleObject
+{
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        $this->initVar('ability_id', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('ability_name', XOBJ_DTYPE_STRING, '', false, 50);
+        $this->initVar('description', XOBJ_DTYPE_STRING, '', false, 255);
+        $this->initVar('ability_cost', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('regist_time', XOBJ_DTYPE_INT, '', false);
+    }
+}
+
+/**
+ * Sd2nd_AbilityHandler
+**/
+class Sd2nd_AbilityHandler extends XoopsObjectGenericHandler
+{
+    /**
+     * @brief   string
+    **/
+    public $mTable = '{dirname}_ability';
+
+    /**
+     * @brief   string
+    **/
+    public $mPrimary = 'ability_id';
+
+    /**
+     * @brief   string
+    **/
+    public $mClass = 'Sd2nd_AbilityObject';
+
+    /**
+     * __construct
+     * 
+     * @param   XoopsDatabase  &$db
+     * @param   string  $dirname
+     * 
+     * @return  void
+    **/
+    public function __construct(/*** XoopsDatabase ***/ &$db,/*** string ***/ $dirname)
+    {
+        $this->mTable = str_replace('{dirname}',$dirname,$this->mTable);
+        parent::XoopsObjectGenericHandler($db);
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/handler/ActiveAbility.class.php b/trust_path/modules/sd2nd/class/handler/ActiveAbility.class.php
new file mode 100644 (file)
index 0000000..13faade
--- /dev/null
@@ -0,0 +1,68 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+/**
+ * Sd2nd_ActiveAbilityObject
+**/
+class Sd2nd_ActiveAbilityObject extends XoopsSimpleObject
+{
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        $this->initVar('eno', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('slot', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('ability_id', XOBJ_DTYPE_INT, '', false);
+    }
+}
+
+/**
+ * Sd2nd_ActiveAbilityHandler
+**/
+class Sd2nd_ActiveAbilityHandler extends XoopsObjectGenericHandler
+{
+    /**
+     * @brief   string
+    **/
+    public $mTable = '{dirname}_active_ability';
+
+    /**
+     * @brief   string
+    **/
+    public $mPrimary = 'eno';
+
+    /**
+     * @brief   string
+    **/
+    public $mClass = 'Sd2nd_ActiveAbilityObject';
+
+    /**
+     * __construct
+     * 
+     * @param   XoopsDatabase  &$db
+     * @param   string  $dirname
+     * 
+     * @return  void
+    **/
+    public function __construct(/*** XoopsDatabase ***/ &$db,/*** string ***/ $dirname)
+    {
+        $this->mTable = str_replace('{dirname}',$dirname,$this->mTable);
+        parent::XoopsObjectGenericHandler($db);
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/handler/Char.class.php b/trust_path/modules/sd2nd/class/handler/Char.class.php
new file mode 100644 (file)
index 0000000..47e84a2
--- /dev/null
@@ -0,0 +1,357 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+/**
+ * Sd2nd_CharObject
+**/
+class Sd2nd_CharObject extends XoopsSimpleObject
+{
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        $this->initVar('eno', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('full_name', XOBJ_DTYPE_STRING, '', false, 40);
+        $this->initVar('nick_name', XOBJ_DTYPE_STRING, '', false, 16);
+        $this->initVar('battle_name', XOBJ_DTYPE_STRING, '', false, 16);
+        $this->initVar('sex', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('age', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('height', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('weight', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('profile', XOBJ_DTYPE_TEXT, '', false);
+        $this->initVar('race', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('element_base', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('element_ext', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('active_costume', XOBJ_DTYPE_INT, '', false);
+    }
+}
+
+/**
+ * Sd2nd_DummyCharObject
+**/
+class Sd2nd_DummyCharObject extends XoopsSimpleObject
+{
+    /**
+     * __construct
+     * 
+     * @param   string[]    $columns
+     * 
+     * @return  void
+    **/
+    public function __construct(/*** string[] ***/ $columns = array())
+    {
+        $this->initVar('eno',XOBJ_DTYPE_INT);
+        $this->initVar('name',XOBJ_DTYPE_STRING);
+        foreach($columns as $col)
+        {
+            $this->initVar($col,XOBJ_DTYPE_STRING);
+        }
+    }
+}
+
+/**
+ * Sd2nd_CharHandler
+**/
+class Sd2nd_CharHandler extends XoopsObjectGenericHandler
+{
+    public /*** string ***/ $mTable = '{dirname}_char';
+    public /*** string ***/ $mPrimary = 'eno';
+    public /*** string ***/ $mClass = 'Sd2nd_CharObject';
+    protected /*** string ***/ $_mAbilityTable = '{dirname}_ability';
+    protected /*** string ***/ $_mSkillTable = '{dirname}_skill';
+    protected /*** string ***/ $_mActiveAbilityTable = '{dirname}_active_ability';
+    protected /*** string ***/ $_mLearnedAbilityTable = '{dirname}_learned_ability';
+    protected /*** string ***/ $_mLearnedSkillTable = '{dirname}_learned_skill';
+    
+    /**
+     * __construct
+     * 
+     * @param   XoopsDatabase  &$db
+     * @param   string  $dirname
+     * 
+     * @return  void
+    **/
+    public function __construct(/*** XoopsDatabase ***/ &$db,/*** string ***/ $dirname)
+    {
+        $replace = array('{dirname}' => $dirname);
+        $this->mTable = strtr($this->mTable,$replace);
+        $this->_mAbilityTable = $db->prefix(strtr($this->_mAbilityTable,$replace));
+        $this->_mSkillTable = $db->prefix(strtr($this->_mSkillTable,$replace));
+        $this->_mActiveAbilityTable = $db->prefix(strtr($this->_mActiveAbilityTable,$replace));
+        $this->_mLearnedAbilityTable = $db->prefix(strtr($this->_mLearnedAbilityTable,$replace));
+        $this->_mLearnedSkillTable = $db->prefix(strtr($this->_mLearnedSkillTable,$replace));
+        parent::XoopsObjectGenericHandler($db);
+    }
+    
+    /**
+     * _escape
+     * 
+     * @param   string  $str
+     * 
+     * @return  string
+    **/
+    protected function _escape(/*** string ***/ $str)
+    {
+        return mysql_real_escape_string($str,$this->db->conn);
+    }
+    
+    /**
+     * &getActiveAbility
+     * 
+     * @param   CriteriaElement $cri
+     * 
+     * @return  Sd2nd_DummyCharObject[]
+    **/
+    public function &getActiveAbility(CriteriaElement $cri)
+    {
+        $ret = array();
+        $sqlBase = 'SELECT `c`.`eno` AS eno,`c`.`full_name` AS name,{0} FROM `{1}` AS c {2} WHERE {3} GROUP BY `c`.`eno` ORDER BY `c`.`eno` ASC';
+        $columns = array();
+        $tables = array();
+        $where = array();
+        for($i = 1;$i <= 5;$i++)
+        {
+            $columns[] = XCube_Utils::formatString('`a{0}`.`ability_name` AS slot{0}',$i);
+            $tables[] = XCube_Utils::formatString(
+                'LEFT JOIN `{0}` AS s{1} ON `c`.`eno` = `s{1}`.`eno` AND `s{1}`.`slot` = {1} '
+              . 'LEFT JOIN `{2}` AS a{1} ON `a{1}`.`ability_id` = `s{1}`.`ability_id`',
+                $this->_mActiveAbilityTable,$i,$this->_mAbilityTable
+            );
+        }
+        for($i = 0;$i < $cri->getCountChildElements();$i++)
+        {
+            $c = $cri->getChildElement($i);
+            $tables[] = XCube_Utils::formatString(
+                'LEFT JOIN `{0}` AS w{1} ON `c`.`eno` = `w{1}`.`eno` '
+              . 'LEFT JOIN `{2}` AS n{1} ON `n{1}`.`ability_id` = `w{1}`.`ability_id`',
+                $this->_mActiveAbilityTable,$i,$this->_mAbilityTable
+            );
+            $where[] = XCube_Utils::formatString(
+                "`n{0}`.`ability_name` LIKE '{1}%'",
+                $i,$this->_escape($c->getValue())
+            );
+        }
+        $sql = XCube_Utils::formatString($sqlBase,implode(',',$columns),$this->mTable,implode(' ',$tables),implode(' AND ',$where));
+        if($res = $this->db->query($sql,$cri->getLimit(),$cri->getStart()))
+        {
+            while($row = $this->db->fetchArray($res))
+            {
+                $obj = new Sd2nd_DummyCharObject(array('slot1','slot2','slot3','slot4','slot5'));
+                $obj->setVars($row);
+                $ret[] =& $obj;
+                unset($obj);
+            }
+        }
+        return $ret;
+    }
+    
+    /**
+     * getActiveAbilityCount
+     * 
+     * @param   CriteriaElement $cri
+     * 
+     * @return  int
+    **/
+    public function getActiveAbilityCount(CriteriaElement $cri)
+    {
+        $ret = null;
+        $c = $cri->getChildElement(0);
+        $sql = XCube_Utils::formatString(
+            'SELECT COUNT(DISTINCT `w0`.`eno`) AS c FROM `{0}` AS w0 '
+          . 'LEFT JOIN `{1}` AS n0 ON `n0`.`ability_id` = `w0`.`ability_id` ',
+            $this->_mActiveAbilityTable,$this->_mAbilityTable
+        );
+        $where = "`n0`.`ability_name` LIKE '" . $this->_escape($c->getValue()) . "%' ";
+        for($i = 1;$i < $cri->getCountChildElements();$i++)
+        {
+            $c = $cri->getChildElement($i);
+            $sql .= XCube_Utils::formatString(
+                'LEFT JOIN `{0}` AS w{1} ON `w0`.`eno` = `w{1}`.`eno` '
+              . 'LEFT JOIN `{2}` AS n{1} ON `n{1}`.`ability_id` = `w{1}`.`ability_id` ',
+                $this->_mActiveAbilityTable,$i,$this->_mAbilityTable
+            );
+            $where .= XCube_Utils::formatString(
+                "AND `n{0}`.`ability_name` LIKE '{1}%' ",
+                $i,$this->_escape($c->getValue())
+            );
+        }
+        if($res = $this->db->query($sql . ' WHERE ' . $where))
+        {
+            $row = $this->db->fetchArray($res);
+            $ret = $row['c'];
+        }
+        return $ret;
+    }
+    
+    /**
+     * &getLearnedAbility
+     * 
+     * @param   CriteriaElement $cri
+     * 
+     * @return  Sd2nd_DummyCharObject[]
+    **/
+    public function &getLearnedAbility(CriteriaElement $cri)
+    {
+        $ret = array();
+        $sqlBase = 'SELECT `c`.`eno` AS eno,`c`.`full_name` AS name FROM `{0}` AS c {1} WHERE {2} GROUP BY `c`.`eno` ORDER BY `c`.`eno` ASC';
+        $tables = array();
+        $where = array();
+        for($i = 0;$i < $cri->getCountChildElements();$i++)
+        {
+            $c = $cri->getChildElement($i);
+            $tables[] = XCube_Utils::formatString(
+                'LEFT JOIN `{0}` AS w{1} ON `c`.`eno` = `w{1}`.`eno` '
+              . 'LEFT JOIN `{2}` AS n{1} ON `n{1}`.`ability_id` = `w{1}`.`ability_id`',
+                $this->_mLearnedAbilityTable,$i,$this->_mAbilityTable
+            );
+            $where[] = XCube_Utils::formatString(
+                "`n{0}`.`ability_name` LIKE '{1}%'",
+                $i,$this->_escape($c->getValue())
+            );
+        }
+        $sql = XCube_Utils::formatString($sqlBase,$this->mTable,implode(' ',$tables),implode(' AND ',$where));
+        if($res = $this->db->query($sql,$cri->getLimit(),$cri->getStart()))
+        {
+            while($row = $this->db->fetchArray($res))
+            {
+                $obj = new Sd2nd_DummyCharObject();
+                $obj->setVars($row);
+                $ret[] =& $obj;
+                unset($obj);
+            }
+        }
+        return $ret;
+    }
+    
+    /**
+     * getLearnedAbilityCount
+     * 
+     * @param   CriteriaElement $cri
+     * 
+     * @return  int
+    **/
+    public function getLearnedAbilityCount(CriteriaElement $cri)
+    {
+        $ret = null;
+        $c = $cri->getChildElement(0);
+        $sql = XCube_Utils::formatString(
+            'SELECT COUNT(DISTINCT `w0`.`eno`) AS c FROM `{0}` AS w0 '
+          . 'LEFT JOIN `{1}` AS n0 ON `n0`.`ability_id` = `w0`.`ability_id` ',
+            $this->_mLearnedAbilityTable,$this->_mAbilityTable
+        );
+        $where = "`n0`.`ability_name` LIKE '" . $this->_escape($c->getValue()) . "%' ";
+        for($i = 1;$i < $cri->getCountChildElements();$i++)
+        {
+            $c = $cri->getChildElement($i);
+            $sql .= XCube_Utils::formatString(
+                'LEFT JOIN `{0}` AS w{1} ON `w0`.`eno` = `w{1}`.`eno` '
+              . 'LEFT JOIN `{2}` AS n{1} ON `n{1}`.`ability_id` = `w{1}`.`ability_id` ',
+                $this->_mLearnedAbilityTable,$i,$this->_mAbilityTable
+            );
+            $where .= XCube_Utils::formatString(
+                "AND `n{0}`.`ability_name` LIKE '{1}%' ",
+                $i,$this->_escape($c->getValue())
+            );
+        }
+        if($res = $this->db->query($sql . ' WHERE ' . $where))
+        {
+            $row = $this->db->fetchArray($res);
+            $ret = $row['c'];
+        }
+        return $ret;
+    }
+    
+    /**
+     * &getLearnedSkill
+     * 
+     * @param   CriteriaElement $cri
+     * 
+     * @return  Sd2nd_DummyCharObject[]
+    **/
+    public function &getLearnedSkill(CriteriaElement $cri)
+    {
+        $ret = array();
+        $sqlBase = 'SELECT `c`.`eno` AS eno,`c`.`full_name` AS name FROM `{0}` AS c {1} WHERE {2} GROUP BY `c`.`eno` ORDER BY `c`.`eno` ASC';
+        $tables = array();
+        $where = array();
+        for($i = 0;$i < $cri->getCountChildElements();$i++)
+        {
+            $c = $cri->getChildElement($i);
+            $tables[] = XCube_Utils::formatString(
+                'LEFT JOIN `{0}` AS w{1} ON `c`.`eno` = `w{1}`.`eno` '
+              . 'LEFT JOIN `{2}` AS n{1} ON `n{1}`.`skill_id` = `w{1}`.`skill_id`',
+                $this->_mLearnedSkillTable,$i,$this->_mSkillTable
+            );
+            $where[] = XCube_Utils::formatString(
+                "`n{0}`.`skill_name` LIKE '{1}%'",
+                $i,$this->_escape($c->getValue())
+            );
+        }
+        $sql = XCube_Utils::formatString($sqlBase,$this->mTable,implode(' ',$tables),implode(' AND ',$where));
+        if($res = $this->db->query($sql,$cri->getLimit(),$cri->getStart()))
+        {
+            while($row = $this->db->fetchArray($res))
+            {
+                $obj = new Sd2nd_DummyCharObject();
+                $obj->setVars($row);
+                $ret[] =& $obj;
+                unset($obj);
+            }
+        }
+        return $ret;
+    }
+    
+    /**
+     * getLearnedSkillCount
+     * 
+     * @param   CriteriaElement $cri
+     * 
+     * @return  int
+    **/
+    public function getLearnedSkillCount(CriteriaElement $cri)
+    {
+        $ret = null;
+        $c = $cri->getChildElement(0);
+        $sql = XCube_Utils::formatString(
+            'SELECT COUNT(DISTINCT `w0`.`eno`) AS c FROM `{0}` AS w0 '
+          . 'LEFT JOIN `{1}` AS n0 ON `n0`.`skill_id` = `w0`.`skill_id` ',
+            $this->_mLearnedSkillTable,$this->_mSkillTable
+        );
+        $where = "`n0`.`skill_name` LIKE '" . $this->_escape($c->getValue()) . "%' ";
+        for($i = 1;$i < $cri->getCountChildElements();$i++)
+        {
+            $c = $cri->getChildElement($i);
+            $sql .= XCube_Utils::formatString(
+                'LEFT JOIN `{0}` AS w{1} ON `w0`.`eno` = `w{1}`.`eno` '
+              . 'LEFT JOIN `{2}` AS n{1} ON `n{1}`.`skill_id` = `w{1}`.`skill_id` ',
+                $this->_mLearnedSkillTable,$i,$this->_mSkillTable
+            );
+            $where .= XCube_Utils::formatString(
+                "AND `n{0}`.`ability_name` LIKE '{1}%' ",
+                $i,$this->_escape($c->getValue())
+            );
+        }
+        if($res = $this->db->query($sql . ' WHERE ' . $where))
+        {
+            $row = $this->db->fetchArray($res);
+            $ret = $row['c'];
+        }
+        return $ret;
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/handler/Costume.class.php b/trust_path/modules/sd2nd/class/handler/Costume.class.php
new file mode 100644 (file)
index 0000000..e376868
--- /dev/null
@@ -0,0 +1,85 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+/**
+ * Sd2nd_CostumeObject
+**/
+class Sd2nd_CostumeObject extends XoopsSimpleObject
+{
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        $this->initVar('costume_id', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('costume_name', XOBJ_DTYPE_STRING, '', false, 50);
+        $this->initVar('grow_life', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('grow_soul', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('grow_pow', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('grow_str', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('grow_dex', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('grow_speed', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('grow_mag', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('grow_reg', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('grow_con', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('modify_hp', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('modify_tp', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('modify_at', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('modify_df', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('modify_mat', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('modify_mdf', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('modify_act', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('move_cost', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('regist_time', XOBJ_DTYPE_INT, '', false);
+    }
+}
+
+/**
+ * Sd2nd_CostumeHandler
+**/
+class Sd2nd_CostumeHandler extends XoopsObjectGenericHandler
+{
+    /**
+     * @brief   string
+    **/
+    public $mTable = '{dirname}_costume';
+
+    /**
+     * @brief   string
+    **/
+    public $mPrimary = 'costume_id';
+
+    /**
+     * @brief   string
+    **/
+    public $mClass = 'Sd2nd_CostumeObject';
+
+    /**
+     * __construct
+     * 
+     * @param   XoopsDatabase  &$db
+     * @param   string  $dirname
+     * 
+     * @return  void
+    **/
+    public function __construct(/*** XoopsDatabase ***/ &$db,/*** string ***/ $dirname)
+    {
+        $this->mTable = str_replace('{dirname}',$dirname,$this->mTable);
+        parent::XoopsObjectGenericHandler($db);
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/handler/EnoPnoLink.class.php b/trust_path/modules/sd2nd/class/handler/EnoPnoLink.class.php
new file mode 100644 (file)
index 0000000..7fa0d46
--- /dev/null
@@ -0,0 +1,68 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+/**
+ * Sd2nd_EnoPnoLinkObject
+**/
+class Sd2nd_EnoPnoLinkObject extends XoopsSimpleObject
+{
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        $this->initVar('eno', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('pno', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('regist_time', XOBJ_DTYPE_INT, '', false);
+    }
+}
+
+/**
+ * Sd2nd_EnoPnoLinkHandler
+**/
+class Sd2nd_EnoPnoLinkHandler extends XoopsObjectGenericHandler
+{
+    /**
+     * @brief   string
+    **/
+    public $mTable = '{dirname}_eno_pno_link';
+
+    /**
+     * @brief   string
+    **/
+    public $mPrimary = 'eno';
+
+    /**
+     * @brief   string
+    **/
+    public $mClass = 'Sd2nd_EnoPnoLinkObject';
+
+    /**
+     * __construct
+     * 
+     * @param   XoopsDatabase  &$db
+     * @param   string  $dirname
+     * 
+     * @return  void
+    **/
+    public function __construct(/*** XoopsDatabase ***/ &$db,/*** string ***/ $dirname)
+    {
+        $this->mTable = str_replace('{dirname}',$dirname,$this->mTable);
+        parent::XoopsObjectGenericHandler($db);
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/handler/Icon.class.php b/trust_path/modules/sd2nd/class/handler/Icon.class.php
new file mode 100644 (file)
index 0000000..d0a8938
--- /dev/null
@@ -0,0 +1,97 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+/**
+ * Sd2nd_IconObject
+**/
+class Sd2nd_IconObject extends XoopsSimpleObject
+{
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        $this->initVar('icon_id', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('eno', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('slot', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('icon_url', XOBJ_DTYPE_STRING, '', false, 255);
+        $this->initVar('icon_height', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('icon_width', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('update_time', XOBJ_DTYPE_INT, '', false);
+    }
+}
+
+/**
+ * Sd2nd_IconHandler
+**/
+class Sd2nd_IconHandler extends XoopsObjectGenericHandler
+{
+    /**
+     * @brief   string
+    **/
+    public $mTable = '{dirname}_icon';
+
+    /**
+     * @brief   string
+    **/
+    public $mPrimary = 'icon_id';
+
+    /**
+     * @brief   string
+    **/
+    public $mClass = 'Sd2nd_IconObject';
+
+    /**
+     * __construct
+     * 
+     * @param   XoopsDatabase  &$db
+     * @param   string  $dirname
+     * 
+     * @return  void
+    **/
+    public function __construct(/*** XoopsDatabase ***/ &$db,/*** string ***/ $dirname)
+    {
+        $this->mTable = str_replace('{dirname}',$dirname,$this->mTable);
+        parent::XoopsObjectGenericHandler($db);
+    }
+
+    /**
+     * &getByUnique
+     * 
+     * @param   int $eno
+     * @param   int $slot
+     * 
+     * @return  Sd2nd_IconObject
+    **/
+    public function &getByUnique(/*** int ***/ $eno,/*** int ***/ $slot)
+    {
+        $cri = new CriteriaCompo();
+        $cri->add(new Criteria('eno',$eno));
+        $cri->add(new Criteria('slot',$slot));
+        $cri->setSort('update_time','desc');
+        $ret =& $this->getObjects($cri);
+        
+        if(!is_array($ret) || count($ret) != 1)
+        {
+            $ret = null;
+            return $ret;
+        }
+        
+        return $ret[0];
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/handler/Image.class.php b/trust_path/modules/sd2nd/class/handler/Image.class.php
new file mode 100644 (file)
index 0000000..cf76b56
--- /dev/null
@@ -0,0 +1,94 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+/**
+ * Sd2nd_ImageObject
+**/
+class Sd2nd_ImageObject extends XoopsSimpleObject
+{
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        $this->initVar('image_id', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('eno', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('image_url', XOBJ_DTYPE_STRING, '', false, 255);
+        $this->initVar('image_height', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('image_width', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('image_link', XOBJ_DTYPE_STRING, '', false, 255);
+        $this->initVar('update_time', XOBJ_DTYPE_INT, '', false);
+    }
+}
+
+/**
+ * Sd2nd_ImageHandler
+**/
+class Sd2nd_ImageHandler extends XoopsObjectGenericHandler
+{
+    /**
+     * @brief   string
+    **/
+    public $mTable = '{dirname}_image';
+
+    /**
+     * @brief   string
+    **/
+    public $mPrimary = 'image_id';
+
+    /**
+     * @brief   string
+    **/
+    public $mClass = 'Sd2nd_ImageObject';
+
+    /**
+     * __construct
+     * 
+     * @param   XoopsDatabase  &$db
+     * @param   string  $dirname
+     * 
+     * @return  void
+    **/
+    public function __construct(/*** XoopsDatabase ***/ &$db,/*** string ***/ $dirname)
+    {
+        $this->mTable = str_replace('{dirname}',$dirname,$this->mTable);
+        parent::XoopsObjectGenericHandler($db);
+    }
+
+    /**
+     * getByUnique
+     * 
+     * @paarm   int $eno
+     * 
+     * @return  Sd2nd_ImageObject
+    **/
+    public function getByUnique(/*** int ***/ $eno)
+    {
+        $cri = new Criteria('eno',$eno);
+        $cri->setSort('update_time','desc');
+        $ret =& $this->getObjects($cri);
+        
+        if(!is_array($ret) || count($ret) != 1)
+        {
+            $ret = null;
+            return $ret;
+        }
+        
+        return $ret[0];
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/handler/Kind.class.php b/trust_path/modules/sd2nd/class/handler/Kind.class.php
new file mode 100644 (file)
index 0000000..aa7df3c
--- /dev/null
@@ -0,0 +1,118 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+/**
+ * Sd2nd_KindObject
+**/
+class Sd2nd_KindObject extends XoopsSimpleObject
+{
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        $this->initVar('kind_id', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('kind_name', XOBJ_DTYPE_STRING, '', false, 20);
+        $this->initVar('kind_kind', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('weight', XOBJ_DTYPE_INT, '', false);
+    }
+}
+
+/**
+ * Sd2nd_KindHandler
+**/
+class Sd2nd_KindHandler extends XoopsObjectGenericHandler
+{
+    /**
+     * @brief   string
+    **/
+    public $mTable = '{dirname}_kind';
+
+    /**
+     * @brief   string
+    **/
+    public $mPrimary = 'kind_id';
+
+    /**
+     * @brief   string
+    **/
+    public $mClass = 'Sd2nd_KindObject';
+
+    /**
+     * @brief   Sd2nd_KindObject{}
+    **/
+    protected $_mConvertTable = null;
+
+    /**
+     * __construct
+     * 
+     * @param   XoopsDatabase  &$db
+     * @param   string  $dirname
+     * 
+     * @return  void
+    **/
+    public function __construct(/*** XoopsDatabase ***/ &$db,/*** string ***/ $dirname)
+    {
+        $this->mTable = str_replace('{dirname}',$dirname,$this->mTable);
+        parent::XoopsObjectGenericHandler($db);
+    }
+    
+    /**
+     * _setupConvertTable
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    protected function _setupConvertTable()
+    {
+        if($this->_mConvertTable == null)
+        {
+            $cri = new CriteriaCompo();
+            $cri->setSort('weight','ASC');
+            $cri->addSort('kind_name','ASC');
+            $this->_mConvertTable =& $this->getObjects($cri,null,null,true);
+        }
+    }
+    
+    /**
+     * getList
+     * 
+     * @param   void
+     * 
+     * @return  Sd2nd_KindObject{}
+    **/
+    public function getList()
+    {
+        $this->_setupConvertTable();
+        return $this->_mConvertTable;
+    }
+    
+    /**
+     * convertToView
+     * 
+     * @param   int $key
+     * 
+     * @return  string
+    **/
+    public function convertToView(/*** int ***/ $key)
+    {
+        $this->_setupConvertTable();
+        return isset($this->_mConvertTable[$key]) ? $this->_mConvertTable[$key]->getShow('kind_name') : null;
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/handler/LearnedAbility.class.php b/trust_path/modules/sd2nd/class/handler/LearnedAbility.class.php
new file mode 100644 (file)
index 0000000..b820ba6
--- /dev/null
@@ -0,0 +1,68 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+/**
+ * Sd2nd_LearnedAbilityObject
+**/
+class Sd2nd_LearnedAbilityObject extends XoopsSimpleObject
+{
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        $this->initVar('eno', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('ability_id', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('regist_time', XOBJ_DTYPE_INT, '', false);
+    }
+}
+
+/**
+ * Sd2nd_LearnedAbilityHandler
+**/
+class Sd2nd_LearnedAbilityHandler extends XoopsObjectGenericHandler
+{
+    /**
+     * @brief   string
+    **/
+    public $mTable = '{dirname}_learned_ability';
+
+    /**
+     * @brief   string
+    **/
+    public $mPrimary = 'eno';
+
+    /**
+     * @brief   string
+    **/
+    public $mClass = 'Sd2nd_LearnedAbilityObject';
+
+    /**
+     * __construct
+     * 
+     * @param   XoopsDatabase  &$db
+     * @param   string  $dirname
+     * 
+     * @return  void
+    **/
+    public function __construct(/*** XoopsDatabase ***/ &$db,/*** string ***/ $dirname)
+    {
+        $this->mTable = str_replace('{dirname}',$dirname,$this->mTable);
+        parent::XoopsObjectGenericHandler($db);
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/handler/LearnedCostume.class.php b/trust_path/modules/sd2nd/class/handler/LearnedCostume.class.php
new file mode 100644 (file)
index 0000000..22295ab
--- /dev/null
@@ -0,0 +1,74 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+/**
+ * Sd2nd_LearnedCostumeObject
+**/
+class Sd2nd_LearnedCostumeObject extends XoopsSimpleObject
+{
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        $this->initVar('eno', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('costume_id', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('costume_lv', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('costume_point', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('regist_time', XOBJ_DTYPE_INT, '', false);
+    }
+}
+
+/**
+ * Sd2nd_LearnedCostumeHandler
+**/
+class Sd2nd_LearnedCostumeHandler extends XoopsObjectGenericHandler
+{
+    public /*** string ***/ $mTable = '{dirname}_learned_costume';
+    public /*** string ***/ $mPrimary = 'eno';
+    public /*** string ***/ $mClass = 'Sd2nd_LearnedCostumeObject';
+
+    /**
+     * __construct
+     * 
+     * @param   XoopsDatabase  &$db
+     * @param   string  $dirname
+     * 
+     * @return  void
+    **/
+    public function __construct(/*** XoopsDatabase ***/ &$db,/*** string ***/ $dirname)
+    {
+        $this->mTable = str_replace('{dirname}',$dirname,$this->mTable);
+        parent::XoopsObjectGenericHandler($db);
+    }
+    
+    /**
+     * _update
+     * 
+     * @param   XoopsSimpleObject   $obj
+     * 
+     * @return  string
+    **/
+    public function _update(XoopsSimpleObject $obj)
+    {
+        return sprintf(
+            'UPDATE `%s` SET `costume_lv` = %d,`costume_point` = %d,`regist_time` = %d WHERE `eno` = %d AND `costume_id` = %d',
+            $this->mTable,$obj->get('costume_lv'),$obj->get('costume_point'),$obj->get('regist_time'),$obj->get('eno'),$obj->get('costume_id')
+        );
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/handler/LearnedSkill.class.php b/trust_path/modules/sd2nd/class/handler/LearnedSkill.class.php
new file mode 100644 (file)
index 0000000..ab3e7a5
--- /dev/null
@@ -0,0 +1,68 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+/**
+ * Sd2nd_LearnedSkillObject
+**/
+class Sd2nd_LearnedSkillObject extends XoopsSimpleObject
+{
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        $this->initVar('eno', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('skill_id', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('regist_time', XOBJ_DTYPE_INT, '', false);
+    }
+}
+
+/**
+ * Sd2nd_LearnedSkillHandler
+**/
+class Sd2nd_LearnedSkillHandler extends XoopsObjectGenericHandler
+{
+    /**
+     * @brief   string
+    **/
+    public $mTable = '{dirname}_learned_skill';
+
+    /**
+     * @brief   string
+    **/
+    public $mPrimary = 'eno';
+
+    /**
+     * @brief   string
+    **/
+    public $mClass = 'Sd2nd_LearnedSkillObject';
+
+    /**
+     * __construct
+     * 
+     * @param   XoopsDatabase  &$db
+     * @param   string  $dirname
+     * 
+     * @return  void
+    **/
+    public function __construct(/*** XoopsDatabase ***/ &$db,/*** string ***/ $dirname)
+    {
+        $this->mTable = str_replace('{dirname}',$dirname,$this->mTable);
+        parent::XoopsObjectGenericHandler($db);
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/handler/Map.class.php b/trust_path/modules/sd2nd/class/handler/Map.class.php
new file mode 100644 (file)
index 0000000..29a5ea8
--- /dev/null
@@ -0,0 +1,370 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+/**
+ * Sd2nd_MapObject
+**/
+class Sd2nd_MapObject extends XoopsSimpleObject
+{
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        $this->initVar('map_id', XOBJ_DTYPE_INT, 1, false);
+        $this->initVar('x', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('y', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('spot_id', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('update_time', XOBJ_DTYPE_INT, '', false);
+    }
+}
+
+
+/**
+ * @class   Sd2nd_MapCollection
+**/
+class Sd2nd_MapCollection implements Iterator
+{
+    const /*** Enum ***/ UNKNOWN_ID = 1;
+    const /*** Enum ***/ IGNORE_UDON_ID = 6;
+    const /*** Enum ***/ IGNORE_MOUNTAIN = 12;
+    const /*** Enum ***/ IGNORE_DUNGEON_ID = 19;
+    protected /*** int ***/ $_mMapId = null;
+    protected /*** int{} ***/ $_mRange = array('minX' => 0,'maxX' => 0,'minY' => 0,'maxY' => 0);
+    protected /*** Enum{}{} ***/ $_mMap = array();
+    protected /*** Sd2nd_MapCacheHandler ***/ $_mCacheHandler = null;
+    protected /*** Sd2nd_MapSpotObject{} ***/ $_mSpot = null;
+    protected /*** int ***/ $_mUpdateTime = null;
+    protected /*** int{} ***/ $_mCurrent = array('x' => null,'y' => null);
+    protected /*** bool ***/ $_mIsLast = false;
+    
+    /**
+     * __construct
+     * 
+     * @param   string  $dirname
+     * @param   int     $updateTime
+     * @param   int     $mapId
+     * 
+     * @return  void
+    **/
+    public function __construct(/*** string ***/ $dirname,/*** int ***/ $updateTime,/*** int ***/ $mapId = 1)
+    {
+        $asset =& Sd2nd_AssetManager::getInstance($dirname);
+        $this->_mMapId = $mapId;
+        $this->_mUpdateTime = $updateTime;
+        $this->_mCacheHandler =& $asset->getObject('handler',Sd2nd_AssetManager::HANDLER_MAP_CACHE);
+        $spotHandler =& $asset->getObject('handler',Sd2nd_AssetManager::HANDLER_MAP_SPOT);
+        $this->_mSpot =& $spotHandler->getObjects(null,null,null,true);
+    }
+    
+    /**
+     * add
+     * 
+     * @param   Sd2nd_MapObject $obj
+     * 
+     * @return  void
+    **/
+    public function add(Sd2nd_MapObject $obj)
+    {
+        $this->_add($obj->get('x'),$obj->get('y'),$obj->get('spot_id'));
+    }
+    
+    /**
+     * addBySpotList
+     * 
+     * @param   int     $baseX
+     * @param   int     $baseY
+     * @param   int[][] $spotList
+     * 
+     * @return  
+    **/
+    public function addBySpotList(/*** int ***/ $baseX,/*** int ***/ $baseY,/*** int[][] ***/ $spotList)
+    {
+        foreach($spotList as $relativeY => $line)
+        {
+            foreach($line as $relativeX => $spot)
+            {
+                $x = $baseX + $relativeX;
+                $y = $baseY + $relativeY;
+                if($spot != self::UNKNOWN_ID && (!isset($this->_mMap[$x][$y]) || !in_array($spot,array($this->_mMap[$x][$y],self::IGNORE_UDON_ID,self::IGNORE_MOUNTAIN,self::IGNORE_DUNGEON_ID))))
+                {
+                    $this->_add($x,$y,$spot);
+                    $map =& Sd2nd_UpdateUtils::createObject(Sd2nd_AssetManager::HANDLER_MAP);
+                    $map->setVars(array('map_id' => $this->_mMapId,'x' => $x,'y' => $y,'spot_id' => $spot,'update_time' => $this->_mUpdateTime));
+                    Sd2nd_UpdateUtils::insertObject(Sd2nd_AssetManager::HANDLER_MAP,$map);
+                }
+            }
+        }
+    }
+    
+    /**
+     * load
+     * 
+     * @param   int $updateTime
+     * @param   int $mapId
+     * 
+     * @return  bool
+    **/
+    public function load(/*** int ***/ $updateTime,/*** int ***/ $mapId)
+    {
+        if($cache =& $this->_mCacheHandler->getByUnique($mapId,$updateTime))
+        {
+            $this->_mMapId = $mapId;
+            $this->_mRange = unserialize($cache->get('map_range'));
+            $this->_mMap = unserialize($cache->get('map_body'));
+            return true;
+        }
+        
+        return false;
+    }
+    
+    /**
+     * _add
+     * 
+     * @param   int     $x
+     * @param   int     $y
+     * @param   Enum    $spot
+     * 
+     * @return  void
+    **/
+    protected function _add(/*** int ***/ $x,/*** int ***/ $y,/*** Enum ***/ $spot)
+    {
+        if($x < $this->_mRange['minX'])
+        {
+            $this->_mRange['minX'] = $x;
+        }
+        if($x > $this->_mRange['maxX'])
+        {
+            $this->_mRange['maxX'] = $x;
+        }
+        if($y < $this->_mRange['minY'])
+        {
+            $this->_mRange['minY'] = $y;
+        }
+        if($y > $this->_mRange['maxY'])
+        {
+            $this->_mRange['maxY'] = $y;
+        }
+        
+        $this->_mMap[$x][$y] = $spot;
+    }
+    
+    /**
+     * save
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function save()
+    {
+        $cache =& Sd2nd_UpdateUtils::createObject(Sd2nd_AssetManager::HANDLER_MAP_CACHE);
+        $cache->setVars(array('map_id' => $this->_mMapId,'update_time' => $this->_mUpdateTime,'map_range' => serialize($this->_mRange),'map_body' => serialize($this->_mMap)));
+        Sd2nd_UpdateUtils::insertObject(Sd2nd_AssetManager::HANDLER_MAP_CACHE,$cache);
+    }
+    
+    /**
+     * get
+     * 
+     * @param   int     $x
+     * @param   int     $y
+     * 
+     * @return  Sd2nd_MapSpotObject
+    **/
+    public function get(/*** int ***/ $x,/*** int ***/ $y)
+    {
+        $id = isset($this->_mMap[$x][$y]) ? $this->_mMap[$x][$y] : self::UNKNOWN_ID;
+        return isset($this->_mSpot[$id]) ? $this->_mSpot[$id] : $this->_mSpot[self::UNKNOWN_ID];
+    }
+    
+    /**
+     * current
+     * 
+     * @param   void
+     * 
+     * @return  Sd2nd_MapSpotObject
+    **/
+    public function current()
+    {
+        return $this->get($this->_mCurrent['x'],$this->_mCurrent['y']);
+    }
+    
+    /**
+     * key
+     * 
+     * @param   void
+     * 
+     * @return  int{}
+    **/
+    public function key()
+    {
+        return $this->_mCurrent;
+    }
+    
+    /**
+     * next
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function next()
+    {
+        $this->_mCurrent['x']++;
+        if($this->_mCurrent['x'] > $this->_mRange['maxX'])
+        {
+            $this->_mCurrent['x'] = $this->_mRange['minX'];
+            $this->_mCurrent['y']++;
+            if($this->_mCurrent['y'] > $this->_mRange['maxY'])
+            {
+                $this->_mIsLast = true;
+                $this->_mCurrent['y'] = $this->_mRange['maxY'];
+            }
+        }
+    }
+    
+    /**
+     * rewind
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function rewind()
+    {
+        $this->_mCurrent = array('x' => $this->_mRange['minX'],'y' => $this->_mRange['minY']);
+        $this->_mIsLast = false;
+    }
+    
+    /**
+     * seek
+     * 
+     * @param   int{}   $key
+     * 
+     * @return  void
+    **/
+    public function seek(/*** int{} ***/ $key)
+    {
+        if(!isset($key['x']) || !isset($key['y']))
+        {
+            return;
+        }
+        
+        $x = $key['x'];
+        $y = $key['y'];
+        if($x < $this->_mRange['minX'] || $x > $this->_mRange['maxX'] || $y < $this->_mRange['minY'] ||  $y > $this->_mMapSize['maxY'])
+        {
+            return;
+        }
+        
+        $this->_mCurrent = array('x' => $x,'y' => $y);
+        $this->_mIsLast = ($this->isMaxX() && $this->isMaxY());
+    }
+    
+    /**
+     * valid
+     * 
+     * @param   void
+     * 
+     * @return  bool
+    **/
+    public function valid()
+    {
+        return !$this->_mIsLast;
+    }
+    
+    /**
+     * isMaxX
+     * 
+     * @param   void
+     * 
+     * @return  bool
+    **/
+    public function isMaxX()
+    {
+        return $this->_mCurrent['x'] == $this->_mRange['maxX'];
+    }
+    
+    /**
+     * isMaxY
+     * 
+     * @param   void
+     * 
+     * @return  bool
+    **/
+    public function isMaxY()
+    {
+        return $this->_mCurrent['y'] == $this->_mRange['maxY'];
+    }
+    
+    /**
+     * getDistance
+     * 
+     * @param   void
+     * 
+     * @return  int
+    **/
+    public function getDistance()
+    {
+        return abs($this->_mCurrent['x']) + abs($this->_mCurrent['y']);
+    }
+}
+
+
+/**
+ * Sd2nd_MapHandler
+**/
+class Sd2nd_MapHandler extends XoopsObjectGenericHandler
+{
+    public /*** string ***/ $mTable = '{dirname}_map';
+    public /*** string ***/ $mPrimary = 'x';
+    public /*** string ***/ $mClass = 'Sd2nd_MapObject';
+    protected /*** string ***/ $_mDirname = null;
+
+    /**
+     * __construct
+     * 
+     * @param   XoopsDatabase  &$db
+     * @param   string  $dirname
+     * 
+     * @return  void
+    **/
+    public function __construct(/*** XoopsDatabase ***/ &$db,/*** string ***/ $dirname)
+    {
+        $this->_mDirname = $dirname;
+        $this->mTable = str_replace('{dirname}',$dirname,$this->mTable);
+        parent::XoopsObjectGenericHandler($db);
+    }
+    
+    /**
+     * getCollection
+     * 
+     * @param   int $baseTime
+     * @param   int $loadTime
+     * @param   int $mapId
+     * 
+     * @return  Sd2nd_MapCollection
+    **/
+    public function getCollection(/*** int ***/ $baseTime,/*** int ***/ $loadTime = null,/*** int ***/ $mapId = 1)
+    {
+        $collection = new Sd2nd_MapCollection($this->_mDirname,$baseTime,$mapId);
+        $collection->load($loadTime == null ? $baseTime : $loadTime,$mapId);
+        return $collection;
+    }
+}
+
+
+?>
diff --git a/trust_path/modules/sd2nd/class/handler/MapCache.class.php b/trust_path/modules/sd2nd/class/handler/MapCache.class.php
new file mode 100644 (file)
index 0000000..5b238e3
--- /dev/null
@@ -0,0 +1,76 @@
+<?php
+/**
+ * @file
+ * @package 
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+/**
+ * @class   Sd2nd_MapCacheObject
+**/
+class Sd2nd_MapCacheObject extends XoopsSimpleObject
+{
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        $this->initVar('map_id', XOBJ_DTYPE_INT, 1, false);
+        $this->initVar('update_time', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('map_range', XOBJ_DTYPE_STRING, '', false);
+        $this->initVar('map_body', XOBJ_DTYPE_TEXT, '', false);
+    }
+}
+
+
+/**
+ * Sd2nd_MapCacheHandler
+**/
+class Sd2nd_MapCacheHandler extends XoopsObjectGenericHandler
+{
+    public /*** string ***/ $mTable = '{dirname}_map_cache';
+    public /*** string ***/ $mPrimary = 'update_time';
+    public /*** string ***/ $mClass = 'Sd2nd_MapCacheObject';
+    
+    /**
+     * __construct
+     * 
+     * @param   XoopsDatabase  &$db
+     * @param   string  $dirname
+     * 
+     * @return  void
+    **/
+    public function __construct(/*** XoopsDatabase ***/ &$db,/*** string ***/ $dirname)
+    {
+        $this->mTable = str_replace('{dirname}',$dirname,$this->mTable);
+        parent::XoopsObjectGenericHandler($db);
+    }
+    
+    /**
+     * getByUnique
+     * 
+     * @param   int $mapId
+     * @param   int $updateTime
+     * 
+     * @return  Sd2nd_MapCacheObject
+    **/
+    public function getByUnique(/*** int ***/ $mapId,/*** int ***/ $updateTime)
+    {
+        $cri = new CriteriaCompo();
+        $cri->add(new Criteria('map_id',$mapId));
+        $cri->add(new Criteria('update_time',$updateTime));
+        $objs = $this->getObjects($cri);
+        return isset($objs[0]) ? $objs[0] : null;
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/handler/MapName.class.php b/trust_path/modules/sd2nd/class/handler/MapName.class.php
new file mode 100644 (file)
index 0000000..d4e85fa
--- /dev/null
@@ -0,0 +1,108 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+/**
+ * Sd2nd_MapNameObject
+**/
+class Sd2nd_MapNameObject extends XoopsSimpleObject
+{
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        $this->initVar('map_id', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('map_name', XOBJ_DTYPE_STRING, '', false, 50);
+        $this->initVar('base_spot', XOBJ_DTYPE_INT, '', false);
+    }
+}
+
+/**
+ * Sd2nd_MapNameHandler
+**/
+class Sd2nd_MapNameHandler extends XoopsObjectGenericHandler
+{
+    public /*** string ***/ $mTable = '{dirname}_map_name';
+    public /*** string ***/ $mPrimary = 'map_id';
+    public /*** string ***/ $mClass = 'Sd2nd_MapNameObject';
+    protected /*** Sd2nd_MapNameObject{} ***/ $_mList = null;
+
+    /**
+     * __construct
+     * 
+     * @param   XoopsDatabase  &$db
+     * @param   string  $dirname
+     * 
+     * @return  void
+    **/
+    public function __construct(/*** XoopsDatabase ***/ &$db,/*** string ***/ $dirname)
+    {
+        $this->mTable = strtr($this->mTable,array('{dirname}' => $dirname));
+        parent::XoopsObjectGenericHandler($db);
+    }
+    
+    /**
+     * _setupList
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    protected function _setupList()
+    {
+        $this->_mList =& $this->getObjects(null,null,null,true);
+    }
+    
+    /**
+     * getList
+     * 
+     * @param   void
+     * 
+     * @return  Sd2nd_MapNameObject{}
+    **/
+    public function getList()
+    {
+        $this->_setupList();
+        return $this->_mList;
+    }
+    
+    /**
+     * convertToShow
+     * 
+     * @param   int $key
+     * 
+     * @return  string
+    **/
+    public function convertToShow(/*** int ***/ $key)
+    {
+        return $this->isValid($key) ? $this->_mList[$key] : null;
+    }
+    
+    /**
+     * isValid
+     * 
+     * @param   int $key
+     * 
+     * @return  bool
+    **/
+    public function isValid(/*** int ***/ $key)
+    {
+        $this->_setupList();
+        return isset($this->_mList[$key]);
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/handler/MapSpot.class.php b/trust_path/modules/sd2nd/class/handler/MapSpot.class.php
new file mode 100644 (file)
index 0000000..1dde919
--- /dev/null
@@ -0,0 +1,69 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+/**
+ * Sd2nd_MapSpotObject
+**/
+class Sd2nd_MapSpotObject extends XoopsSimpleObject
+{
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        $this->initVar('spot_id', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('spot_name', XOBJ_DTYPE_STRING, '', false, 50);
+        $this->initVar('description', XOBJ_DTYPE_TEXT, '', false);
+        $this->initVar('regist_time', XOBJ_DTYPE_INT, '', false);
+    }
+}
+
+/**
+ * Sd2nd_MapSpotHandler
+**/
+class Sd2nd_MapSpotHandler extends XoopsObjectGenericHandler
+{
+    /**
+     * @brief   string
+    **/
+    public $mTable = '{dirname}_map_spot';
+
+    /**
+     * @brief   string
+    **/
+    public $mPrimary = 'spot_id';
+
+    /**
+     * @brief   string
+    **/
+    public $mClass = 'Sd2nd_MapSpotObject';
+
+    /**
+     * __construct
+     * 
+     * @param   XoopsDatabase  &$db
+     * @param   string  $dirname
+     * 
+     * @return  void
+    **/
+    public function __construct(/*** XoopsDatabase ***/ &$db,/*** string ***/ $dirname)
+    {
+        $this->mTable = str_replace('{dirname}',$dirname,$this->mTable);
+        parent::XoopsObjectGenericHandler($db);
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/handler/Race.class.php b/trust_path/modules/sd2nd/class/handler/Race.class.php
new file mode 100644 (file)
index 0000000..04385f5
--- /dev/null
@@ -0,0 +1,67 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+/**
+ * Sd2nd_RaceObject
+**/
+class Sd2nd_RaceObject extends XoopsSimpleObject
+{
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        $this->initVar('race_id', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('race_name', XOBJ_DTYPE_STRING, '', false, 50);
+    }
+}
+
+/**
+ * Sd2nd_RaceHandler
+**/
+class Sd2nd_RaceHandler extends XoopsObjectGenericHandler
+{
+    /**
+     * @brief   string
+    **/
+    public $mTable = '{dirname}_race';
+
+    /**
+     * @brief   string
+    **/
+    public $mPrimary = 'race_id';
+
+    /**
+     * @brief   string
+    **/
+    public $mClass = 'Sd2nd_RaceObject';
+
+    /**
+     * __construct
+     * 
+     * @param   XoopsDatabase  &$db
+     * @param   string  $dirname
+     * 
+     * @return  void
+    **/
+    public function __construct(/*** XoopsDatabase ***/ &$db,/*** string ***/ $dirname)
+    {
+        $this->mTable = str_replace('{dirname}',$dirname,$this->mTable);
+        parent::XoopsObjectGenericHandler($db);
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/handler/Skill.class.php b/trust_path/modules/sd2nd/class/handler/Skill.class.php
new file mode 100644 (file)
index 0000000..1cc09fe
--- /dev/null
@@ -0,0 +1,125 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+/**
+ * Sd2nd_SkillObject
+**/
+class Sd2nd_SkillObject extends XoopsSimpleObject
+{
+    /**
+     * @brief   Enum[]
+    **/
+    protected $_mElements = array();
+    
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        $this->initVar('skill_id', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('skill_name', XOBJ_DTYPE_STRING, '', false, 50);
+        $this->initVar('description', XOBJ_DTYPE_STRING, '', true, 255);
+        $this->initVar('range', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('target', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('kind', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('tp', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('regist_time', XOBJ_DTYPE_INT, '', false);
+    }
+    
+    /**
+     * getShow
+     * 
+     * @param   string  $key
+     * 
+     * @return  string
+    **/
+    public function getShow(/*** string ***/ $key)
+    {
+        $ret = null;
+        if($key == 'range')
+        {
+            $value = $this->get($key) * 0.1;
+            $ret = ($value == 0 ? _MD_SD2ND_LANG_ELEMENT_EMPTY : sprintf('%1.1f',$value));
+        }
+        else
+        {
+            $ret = parent::getShow($key);
+        }
+        
+        return $ret;
+    }
+    
+    /**
+     * addElement
+     * 
+     * @param   Enum    $element
+     * 
+     * @return  void
+    **/
+    public function addElement(/*** Enum ***/ $element)
+    {
+        $this->_mElements[] = $element;
+    }
+    
+    /**
+     * getElements
+     * 
+     * @param   void
+     * 
+     * @return  Enum[]
+    **/
+    public function getElements()
+    {
+        return $this->_mElements;
+    }
+}
+
+/**
+ * Sd2nd_SkillHandler
+**/
+class Sd2nd_SkillHandler extends XoopsObjectGenericHandler
+{
+    /**
+     * @brief   string
+    **/
+    public $mTable = '{dirname}_skill';
+
+    /**
+     * @brief   string
+    **/
+    public $mPrimary = 'skill_id';
+
+    /**
+     * @brief   string
+    **/
+    public $mClass = 'Sd2nd_SkillObject';
+
+    /**
+     * __construct
+     * 
+     * @param   XoopsDatabase  &$db
+     * @param   string  $dirname
+     * 
+     * @return  void
+    **/
+    public function __construct(/*** XoopsDatabase ***/ &$db,/*** string ***/ $dirname)
+    {
+        $this->mTable = str_replace('{dirname}',$dirname,$this->mTable);
+        parent::XoopsObjectGenericHandler($db);
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/handler/SkillElementLink.class.php b/trust_path/modules/sd2nd/class/handler/SkillElementLink.class.php
new file mode 100644 (file)
index 0000000..72fdc4b
--- /dev/null
@@ -0,0 +1,132 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+/**
+ * Sd2nd_SkillElementLinkObject
+**/
+class Sd2nd_SkillElementLinkObject extends XoopsSimpleObject
+{
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        $this->initVar('skill_id', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('element', XOBJ_DTYPE_INT, '', false);
+    }
+}
+
+/**
+ * Sd2nd_SkillElementLinkHandler
+**/
+class Sd2nd_SkillElementLinkHandler extends XoopsObjectGenericHandler
+{
+    /**
+     * @brief   string
+    **/
+    public $mTable = '{dirname}_skill_element_link';
+
+    /**
+     * @brief   string
+    **/
+    public $mPrimary = 'skill_id';
+
+    /**
+     * @brief   string
+    **/
+    public $mClass = 'Sd2nd_SkillElementLinkObject';
+
+    /**
+     * @brief   Enum{}
+    **/
+    protected $_mElements = array();
+
+    /**
+     * __construct
+     * 
+     * @param   XoopsDatabase  &$db
+     * @param   string  $dirname
+     * 
+     * @return  void
+    **/
+    public function __construct(/*** XoopsDatabase ***/ &$db,/*** string ***/ $dirname)
+    {
+        $this->mTable = str_replace('{dirname}',$dirname,$this->mTable);
+        parent::XoopsObjectGenericHandler($db);
+        
+        $this->_mElements = array(
+            -3 => _MD_SD2ND_LANG_ELEMENT_RANDOM,
+            -2 => _MD_SD2ND_LANG_ELEMENT_UNDEFINED,
+            -1 => _MD_SD2ND_LANG_ELEMENT_EMPTY
+        );
+        for($i = 0;$i <= 12;$i++)
+        {
+            $this->_mElements[$i] = constant('_MD_SD2ND_LANG_ELEMENT_' . $i);
+        }
+    }
+    
+    /**
+     * setupSkillElement
+     * 
+     * @param   Sd2nd_SkillObject{} &$obs
+     * 
+     * @return  void
+    **/
+    public function setupSkillElement(/*** Sd2nd_SkillElementLinkObject{} ***/ &$objs)
+    {
+        if(count($objs) < 1)
+        {
+            return;
+        }
+        
+        $cri = new CriteriaCompo();
+        foreach(array_keys($objs) as $key)
+        {
+            $cri->add(new Criteria('skill_id',$key),'or');
+        }
+        
+        foreach($this->getObjects($cri) as $obj)
+        {
+            $objs[$obj->get('skill_id')]->addElement($obj->get('element'));
+        }
+    }
+    
+    /**
+     * convertToData
+     * 
+     * @param   string  $value
+     * 
+     * @return  int
+    **/
+    public function convertToData(/*** string ***/ $value)
+    {
+        return array_search($value,$this->_mElements);
+    }
+    
+    /**
+     * convertToView
+     * 
+     * @param   int $value
+     * 
+     * @return  string
+    **/
+    public function convertToView(/*** int ***/ $value)
+    {
+        return isset($this->_mElements[$value]) ? $this->_mElements[$value] : null;
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/handler/Status.class.php b/trust_path/modules/sd2nd/class/handler/Status.class.php
new file mode 100644 (file)
index 0000000..c4298fb
--- /dev/null
@@ -0,0 +1,100 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+/**
+ * Sd2nd_StatusObject
+**/
+class Sd2nd_StatusObject extends XoopsSimpleObject
+{
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        $this->initVar('eno', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('lv', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('life', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('soul', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('pow', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('str', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('dex', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('speed', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('mag', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('reg', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('con', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('exp', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('money', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('sp', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('base_hp', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('base_at', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('base_df', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('base_mat', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('base_mdf', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('base_act', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('base_move', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('modify_hp', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('modify_at', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('modify_df', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('modify_mat', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('modify_mdf', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('modify_act', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('modify_move', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('equip_hp', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('equip_at', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('equip_df', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('equip_mat', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('equip_mdf', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('equip_act', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('equip_move', XOBJ_DTYPE_INT, '', false);
+    }
+}
+
+/**
+ * Sd2nd_StatusHandler
+**/
+class Sd2nd_StatusHandler extends XoopsObjectGenericHandler
+{
+    /**
+     * @brief   string
+    **/
+    public $mTable = '{dirname}_status';
+
+    /**
+     * @brief   string
+    **/
+    public $mPrimary = 'eno';
+
+    /**
+     * @brief   string
+    **/
+    public $mClass = 'Sd2nd_StatusObject';
+
+    /**
+     * __construct
+     * 
+     * @param   XoopsDatabase  &$db
+     * @param   string  $dirname
+     * 
+     * @return  void
+    **/
+    public function __construct(/*** XoopsDatabase ***/ &$db,/*** string ***/ $dirname)
+    {
+        $this->mTable = str_replace('{dirname}',$dirname,$this->mTable);
+        parent::XoopsObjectGenericHandler($db);
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/handler/Target.class.php b/trust_path/modules/sd2nd/class/handler/Target.class.php
new file mode 100644 (file)
index 0000000..16e5a59
--- /dev/null
@@ -0,0 +1,116 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+/**
+ * Sd2nd_TargetObject
+**/
+class Sd2nd_TargetObject extends XoopsSimpleObject
+{
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        $this->initVar('target_id', XOBJ_DTYPE_INT, '', false);
+        $this->initVar('target_name', XOBJ_DTYPE_STRING, '', false, 10);
+        $this->initVar('point', XOBJ_DTYPE_STRING, '', false, 40);
+    }
+}
+
+/**
+ * Sd2nd_TargetHandler
+**/
+class Sd2nd_TargetHandler extends XoopsObjectGenericHandler
+{
+    /**
+     * @brief   string
+    **/
+    public $mTable = '{dirname}_target';
+
+    /**
+     * @brief   string
+    **/
+    public $mPrimary = 'target_id';
+
+    /**
+     * @brief   string
+    **/
+    public $mClass = 'Sd2nd_TargetObject';
+
+    /**
+     * @brief   Sd2nd_TargetObject{}
+    **/
+    protected $_mConvertTable = null;
+
+    /**
+     * __construct
+     * 
+     * @param   XoopsDatabase  &$db
+     * @param   string  $dirname
+     * 
+     * @return  void
+    **/
+    public function __construct(/*** XoopsDatabase ***/ &$db,/*** string ***/ $dirname)
+    {
+        $this->mTable = str_replace('{dirname}',$dirname,$this->mTable);
+        parent::XoopsObjectGenericHandler($db);
+    }
+    
+    /**
+     * _setupConvertTable
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    protected function _setupConvertTable()
+    {
+        if($this->_mConvertTable == null)
+        {
+            $cri = new CriteriaCompo();
+            $cri->setSort('target_name','ASC');
+            $this->_mConvertTable =& $this->getObjects($cri,null,null,true);
+        }
+    }
+    
+    /**
+     * getList
+     * 
+     * @param   void
+     * 
+     * @return  Sd2nd_TargetObject{}
+    **/
+    public function getList()
+    {
+        $this->_setupConvertTable();
+        return $this->_mConvertTable;
+    }
+    
+    /**
+     * convertToView
+     * 
+     * @param   int $key
+     * 
+     * @return  string
+    **/
+    public function convertToView(/*** int ***/ $key)
+    {
+        $this->_setupConvertTable();
+        return isset($this->_mConvertTable[$key]) ? $this->_mConvertTable[$key]->getShow('target_name') : null;
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/handler/Update.class.php b/trust_path/modules/sd2nd/class/handler/Update.class.php
new file mode 100644 (file)
index 0000000..c0c4b62
--- /dev/null
@@ -0,0 +1,126 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+/**
+ * Sd2nd_UpdateObject
+**/
+class Sd2nd_UpdateObject extends XoopsSimpleObject
+{
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        $this->initVar('update_time', XOBJ_DTYPE_INT, '', false);
+    }
+    
+    /**
+     * getFormatDate
+     * 
+     * @param   string  $format
+     *              'Y' YYYY
+     *              'y' yy
+     *              'm' mm
+     *              'd' dd
+     * 
+     * @param   string
+    **/
+    public function getFormatDate(/*** string ***/ $format = 'Y/m/d')
+    {
+        $updateTime = $this->get('update_time') + 20000000;
+        $pat = array('Y','y','m','d');
+        $rep = array(
+            intval($updateTime / 10000),
+            substr($updateTime,2,2),
+            substr($updateTime,4,2),
+            substr($updateTime,6,2)
+        );
+        
+        return str_replace($pat,$rep,$format);
+    }
+}
+
+/**
+ * Sd2nd_UpdateHandler
+**/
+class Sd2nd_UpdateHandler extends XoopsObjectGenericHandler
+{
+    public /*** string ***/ $mTable = '{dirname}_update';
+    public /*** string ***/ $mPrimary = 'update_time';
+    public /*** string ***/ $mClass = 'Sd2nd_UpdateObject';
+    protected /*** Sd2nd_UpdateObject[] ***/ $_mUpdateTimes = null;
+
+    /**
+     * __construct
+     * 
+     * @param   XoopsDatabase  &$db
+     * @param   string  $dirname
+     * 
+     * @return  void
+    **/
+    public function __construct(/*** XoopsDatabase ***/ &$db,/*** string ***/ $dirname)
+    {
+        $this->mTable = str_replace('{dirname}',$dirname,$this->mTable);
+        parent::XoopsObjectGenericHandler($db);
+    }
+
+    /**
+     * _setupUpdateTimes
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    protected function _setupUpdateTimes()
+    {
+        if($this->_mUpdateTimes != null)
+        {
+            return;
+        }
+        
+        $cri = new Criteria(1,1);
+        $cri->setSort($this->mPrimary,'desc');
+        $this->_mUpdateTimes = $this->getObjects($cri);
+    }
+
+    /**
+     * getLatestUpdate
+     * 
+     * @param   void
+     * 
+     * @return  Sd2nd_UpdateObject
+    **/
+    public function getLatestUpdate()
+    {
+        $this->_setupUpdateTimes();
+        return isset($this->_mUpdateTimes[0]) ? $this->_mUpdateTimes[0] : null;
+    }
+
+    /**
+     * getUpdateTimeList
+     * 
+     * @param   void
+     * 
+     * @return  Sd2nd_UpdateObject[]
+    **/
+    public function getUpdateTimeList()
+    {
+        $this->_setupUpdateTimes();
+        return $this->_mUpdateTimes;
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/AbstractProcess.class.php b/trust_path/modules/sd2nd/class/updater/AbstractProcess.class.php
new file mode 100644 (file)
index 0000000..6d229fa
--- /dev/null
@@ -0,0 +1,291 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+
+/**
+ * @class   Sd2nd_AbstractProcess
+**/
+abstract class Sd2nd_AbstractProcess
+{
+    /**
+     * @breif   ReflectionMethod
+    **/
+    protected $_mFunc = null;
+    
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+    }
+    
+    /**
+     * prepare
+     * 
+     * @param   int $updateTime
+     * 
+     * @return  void
+    **/
+    public function prepare(/*** int ***/ $updateTime)
+    {
+        $class = new ReflectionClass($this);
+        $methods = $class->getMethods();
+        usort($methods,array('Sd2nd_AbstractProcess','compareMethodName'));
+        
+        foreach($methods as $method)
+        {
+            if(substr($name = $method->name,0,7) == 'execute' && ctype_digit($date = substr($name,7)) && $date >= $updateTime)
+            {
+                $this->_mFunc = $method;
+                break;
+            }
+        }
+        
+        if(!$this->_mFunc instanceof ReflectionMethod)
+        {
+            $this->_mFunc = new ReflectionMethod($this,'executeLatest');
+        }
+    }
+    
+    /**
+     * compareMethodName
+     * 
+     * @param   ReflactionMethod    $a
+     * @paramm  ReflectionMethod    $b
+     * 
+     * @return  bool
+    **/
+    public static function compareMethodName(ReflectionMethod $a,ReflectionMethod $b)
+    {
+        return ($a->name > $b->name);
+    }
+    
+    /**
+     * execute
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function execute()
+    {
+        $this->_mFunc->invoke($this);
+    }
+    
+    /**
+     * executeLatest
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    abstract public function executeLatest();
+}
+
+
+/**
+ * @class   Sd2nd_AbstractFilter
+**/
+abstract class Sd2nd_AbstractFilter extends Sd2nd_AbstractProcess
+{
+    /**
+     * getPriority
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    public function getPriority()
+    {
+        return XCUBE_DELEGATE_PRIORITY_NORMAL;
+    }
+}
+
+
+/**
+ * @class   Sd2nd_AbstractParser
+**/
+abstract class Sd2nd_AbstractParser extends Sd2nd_AbstractProcess
+{
+    /**
+     * @brief   int
+    **/
+    protected $_mActiveId = null;
+    
+    /**
+     * @brief   Sd2nd_AbstractExecute
+    **/
+    protected $_mExecute = null;
+    
+    /**
+     * @brief   string
+    **/
+    protected $_mLine = null;
+    
+    /**
+     * @brief   int
+    **/
+    protected $_mUpdateTime = null;
+    
+    /**
+     * prepare
+     * 
+     * @param   int $updateTime
+     * 
+     * @return  void
+    **/
+    public function prepare(/*** int ***/ $updateTime)
+    {
+        parent::prepare($updateTime);
+        $this->_mUpdateTime = $updateTime;
+    }
+    
+    /**
+     * reset
+     * 
+     * @param   int                     $id
+     * @param   Sd2nd_AbstractExecute   &$execute
+     * @param   string                  $line
+     * 
+     * @return  void
+    **/
+    public function reset(/*** int ***/ $id,Sd2nd_AbstractExecute &$execute,/*** string ***/ $line)
+    {
+        $this->_mActiveId = $id;
+        $this->_mExecute =& $execute;
+        $this->_mLine = $line;
+    }
+}
+
+
+/**
+ * @class   Sd2nd_AbstractExecute
+**/
+abstract class Sd2nd_AbstractExecute extends Sd2nd_AbstractProcess
+{
+    /**
+     * @brief   int
+    **/
+    protected $_mActiveId = null;
+    
+    /**
+     * @brief   string
+    **/
+    protected $_mText = null;
+    
+    /**
+     * @brief   string
+    **/
+    protected $_mParserPath = 'execute/parser';
+    
+    /**
+     * @brief   string
+    **/
+    protected $_mFilterPattern = '/^(?P<name>\w+)/';
+    
+    /**
+     * reset
+     * 
+     * @param   int     $id
+     * @param   string  $text
+     * 
+     * @return  void
+    **/
+    public function reset(/*** int ***/ $id,/*** string ***/ $text)
+    {
+        $this->_mActiveId = $id;
+        $this->_mText = $text;
+    }
+    
+    /**
+     * execute
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function execute()
+    {
+        $this->_mFunc->invoke($this);
+        $this->_save();
+    }
+    
+    /**
+     * executeLatest
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function executeLatest()
+    {
+        $this->_parse();
+    }
+    
+    /**
+     * _parse
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    protected function _parse()
+    {
+        foreach(explode("\n",$this->_mText) as $line)
+        {
+            $arr = array();
+            $line = trim($line);
+            if(preg_match($this->_mFilterPattern,$line,$arr))
+            {
+                $instance =& Sd2nd_UpdateUtils::getProcess($this->_mParserPath,$arr['name']);
+                if($instance instanceof Sd2nd_AbstractParser)
+                {
+                    $instance->reset($this->_mActiveId,$this,$line);
+                    try
+                    {
+                        $instance->execute();
+                    }
+                    catch(Sd2nd_Exception $e)
+                    {
+                        Sd2nd_UpdateUtils::displayError($e);
+                        if($e->isFatal())
+                        {
+                            throw $e;
+                        }
+                    }
+                    unset($instance);
+                }
+            }
+        }
+    }
+    
+    /**
+     * _save
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    abstract protected function _save();
+}
+
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/Sd2ndUpdateUtils.class.php b/trust_path/modules/sd2nd/class/updater/Sd2ndUpdateUtils.class.php
new file mode 100644 (file)
index 0000000..6b2893b
--- /dev/null
@@ -0,0 +1,393 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+require_once SD2ND_TRUST_PATH . '/class/updater/AbstractProcess.class.php';
+
+/**
+ * @class   Sd2nd_UpdateUtils
+**/
+class Sd2nd_UpdateUtils
+{
+    /**
+     * &getHandler
+     * 
+     * @param   Enum    $name
+     * 
+     * @return  XoopsObjectGenericHandler   $handler
+     * @throw   Sd2nd_Exception
+    **/
+    public static function &getHandler(/*** Enum ***/ $name)
+    {
+        static $asset = null;
+        
+        if(!$asset instanceof Sd2nd_AssetManager)
+        {
+            $asset =& Sd2nd_AssetManager::getInstance(SD2ND_PUBLIC_NAME);
+        }
+        
+        $ret =& $asset->getObject('handler',$name);
+        if(!$ret instanceof XoopsObjectGenericHandler)
+        {
+            throw new Sd2nd_Exception('Handler "' . $name . '" is not found.');
+        }
+        
+        return $ret;
+    }
+    
+    /**
+     * displayError
+     * 
+     * @param   Sd2nd_Exception    $e
+     * 
+     * @return  void
+    **/
+    public static function displayError(Sd2nd_Exception $e)
+    {
+        // htrace($e->__toString());
+        // echo mb_convert_encoding($e->__toString(),SD2ND_ECHO_ENCODING,mb_internal_encoding());
+        file_put_contents(SD2ND_TRUST_PATH . '/class/updater/backup/error.txt',$e->__toString());
+    }
+    
+    #region for sub process methods
+    /**
+     * executeFilter
+     * 
+     * @param   string  $kind
+     * 
+     * @return  void
+    **/
+    public static function executeFilter(/*** string ***/ $kind)
+    {
+        $process = new XCube_Delegate();
+        
+        foreach(glob(SD2ND_TRUST_PATH . '/class/updater/' . $kind . '/*.class.php') as $file)
+        {
+            require_once $file;
+            if(class_exists($class = Sd2nd_UpdateUtils::makeClassNameFromPath($kind,$file)))
+            {
+                $filter = new $class();
+                if($filter instanceof Sd2nd_AbstractFilter)
+                {
+                    $filter->prepare(SD2ND_UPDATE_TIME);
+                    $process->add(array($filter,'execute'),$filter->getPriority());
+                }
+                unset($filter);
+            }
+        }
+        
+        try
+        {
+            $process->call();
+        }
+        catch(Sd2nd_Exception $e)
+        {
+            Sd2nd_UpdateUtils::displayError($e);
+            if($e->isFatal())
+            {
+                die();
+            }
+        }
+    }
+    
+    /**
+     * &getProcess
+     * 
+     * @param   string  $kind
+     * @param   string  $name
+     * 
+     * @return  Sd2nd_AbstractProcess
+    **/
+    public static function &getProcess(/*** string ***/ $kind,/*** string ***/ $name)
+    {
+        static $processes = array();
+        $ret = null;
+        
+        if(!isset($processes[$kind]))
+        {
+            $processes[$kind] = array();
+            foreach(glob(SD2ND_TRUST_PATH . '/class/updater/' . $kind . '/*.class.php') as $file)
+            {
+                require_once $file;
+                $class = Sd2nd_UpdateUtils::makeClassNameFromPath($kind,$file);
+                if(class_exists($class))
+                {
+                    $instance = new $class();
+                    if($instance instanceof Sd2nd_AbstractProcess)
+                    {
+                        $processes[$kind][$class] =& $instance;
+                        $processes[$kind][$class]->prepare(SD2ND_UPDATE_TIME);
+                    }
+                    unset($instance);
+                }
+            }
+        }
+        
+        if(isset($processes[$kind][$name = Sd2nd_UpdateUtils::makeClassName($kind,$name)]))
+        {
+            $ret =& $processes[$kind][$name];
+        }
+        
+        return $ret;
+    }
+    
+    /**
+     * makeClassName
+     * 
+     * @param   string  $kind
+     * @param   string  $name
+     * 
+     * @return  string
+    **/
+    public static function makeClassName(/*** string ***/ $kind,/*** string ***/ $name)
+    {
+        return 'Sd2nd_' . ucfirst($name) . ucfirst(basename($kind));
+    }
+    
+    /**
+     * makeClassNameFromPath
+     * 
+     * @param   string  $kind
+     * @param   string  $path
+     * 
+     * @return  string
+    **/
+    public static function makeClassNameFromPath(/*** string ***/ $kind,/*** string ***/ $path)
+    {
+        return Sd2nd_UpdateUtils::makeClassName($kind,substr(basename($path),0,-10));
+    }
+    #endregion
+    
+    #region for convert methods
+    /**
+     * convertString
+     * 
+     * @param   string  $str
+     * 
+     * @return  string
+    **/
+    public static function convertString(/*** string ***/ $str)
+    {
+        return mb_convert_kana($str,'as',mb_internal_encoding());
+    }
+    
+    /**
+     * convertTableName
+     * 
+     * @param   Enum  $type
+     * 
+     * @return  string
+    **/
+    public static function convertTableName(/*** Enum ***/ $type)
+    {
+        $handler =& Sd2nd_UpdateUtils::getHandler($type);
+        return $handler->mTable;
+    }
+    #endregion
+    
+    #region for parse methods
+    /**
+     * parseByRegex
+     * 
+     * @param   string  $line
+     * @param   string  $pattern
+     * 
+     * @return  string[]
+     * @throw   Sd2nd_Exception
+    **/
+    public static function parseByRegex(/*** string ***/ $line,/*** string ***/ $pattern)
+    {
+        $ret = array();
+        if(!preg_match($pattern,$line,$ret))
+        {
+            throw new Sd2nd_Exception(array('line' => $line,'pattern' => $pattern));
+        }
+        
+        return $ret;
+    }
+    
+    /**
+     * parseByExplode
+     * 
+     * @param   string      $line
+     * @param   int         $count
+     * @param   int         $offset
+     * @param   int         $end
+     * @param   string[]    $column
+     * @param   string      $spliter
+     * 
+     * @return  string[]
+     * @throw   Sd2nd_Exception
+    **/
+    public static function parseByExplode(/*** string ***/ $line,/*** int ***/ $count,/*** int ***/ $offset,/*** int ***/ $end = null,/*** string[] ***/ $column = null,/*** string ***/ $spliter = ',')
+    {
+        $ret = $end != null ? explode($spliter,substr($line,$offset,$end)) : explode($spliter,substr($line,$offset));
+        if(count($ret) != $count)
+        {
+            throw new Sd2nd_Exception(array('line' => $line,'count' => $count,'offset' => $offset,'end' => $end,'column' => $column,'spliter' => $spliter,'result' => $ret));
+        }
+        
+        if(is_array($column) && count($column) && $count)
+        {
+            $ret = array_combine($column,$ret);
+        }
+        
+        return $ret;
+    }
+    #endregion
+    
+    #region for query methods
+    /**
+     * &createObject
+     * 
+     * @param   Enum    $type
+     * 
+     * @return  XoopsSimpleObject
+    **/
+    public static function &createObject(/*** Enum ***/ $type)
+    {
+        $handler =& Sd2nd_UpdateUtils::getHandler($type);
+        return $handler->create(true);
+    }
+    
+    /**
+     * insertObject
+     * 
+     * @param   Enum                $type
+     * @param   XoopsSimpleObject   &$obj
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public static function insertObject(/*** Enum ***/ $type,XoopsSimpleObject &$obj)
+    {
+        $handler =& Sd2nd_UpdateUtils::getHandler($type);
+        if(!$handler->insert($obj,true))
+        {
+            throw new Sd2nd_QueryException(array('type' => $type,'object' => $obj));
+        }
+    }
+    
+    /**
+     * deleteObject
+     * 
+     * @param   Enum                $type
+     * @param   XoopsSimpleObject   $obj
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public static function deleteObject(/*** Enum ***/ $type,XoopsSimpleObject $obj)
+    {
+        $handler =& Sd2nd_UpdateUtils::getHandler($type);
+        if(!$handler->delete($obj,true))
+        {
+            throw new Sd2nd_QueryException(array('type' => $type,'object' => $obj));
+        }
+    }
+    
+    /**
+     * deleteMultiObjects
+     * 
+     * @param   Enum            $type
+     * @param   CriteriaElement $cri
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public static function deleteMultiObjects(/*** Enum ***/ $type,CriteriaElement $cri)
+    {
+        $handler =& Sd2nd_UpdateUtils::getHandler($type);
+        if(!$handler->deleteAll($cri,true))
+        {
+            throw new Sd2nd_QueryException(array('type' => $type,'criteria' => $cri));
+        }
+    }
+    #endregion
+}
+
+
+
+/**
+ * @class   Sd2nd_Exception
+**/
+class Sd2nd_Exception extends Exception
+{
+    /**
+     * __construct
+     * 
+     * @param   string/mixed{}  $message
+     * 
+     * @return  void
+    **/
+    public function __construct(/*** string/mixed{} ***/ $message = null)
+    {
+        if(is_array($message))
+        {
+            $message = print_r($message,true);
+        }
+        
+        parent::__construct($message);
+    }
+    
+    /**
+     * isFatal
+     * 
+     * @param   void
+     * 
+     * @return  bool
+    **/
+    public function isFatal()
+    {
+        return true;
+    }
+    
+    /**
+     * __toString
+     * 
+     * @param   void
+     * 
+     * @return  string
+    **/
+    public function __toString()
+    {
+        return print_r($this,true);
+    }
+}
+
+/**
+ * @class   Sd2nd_QueryException
+**/
+class Sd2nd_QueryException extends Sd2nd_Exception
+{
+    /**
+     * @brief   string{}
+    **/
+    protected $_mQuery = null;
+    
+    /**
+     * __construct
+     * 
+     * @param   string/mixed{}  $message
+     * 
+     * @return  void
+    **/
+    public function __construct(/*** string/mixed{} ***/ $message)
+    {
+        parent::__construct($message);
+        
+        $root =& XCube_Root::getSingleton();
+        $this->_mQuery = end($root->mController->mLogger->queries);
+    }
+}
+
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/Sd2ndUpdater.class.php b/trust_path/modules/sd2nd/class/updater/Sd2ndUpdater.class.php
new file mode 100644 (file)
index 0000000..725bb7d
--- /dev/null
@@ -0,0 +1,151 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+require_once SD2ND_TRUST_PATH . '/class/updater/Sd2ndUpdateUtils.class.php';
+
+/**
+ * @class   Sd2nd_Updater
+**/
+class Sd2nd_Updater
+{
+    /**
+     * @brief   string
+    **/
+    protected $_mZipName = null;
+    
+    /**
+     * @brief   string{}
+    **/
+    protected $_mMessages = array(
+        'start'   => 'process started...',
+        'prepare' => 'execute prepare process...',
+        'execute' => 'execute main process...',
+        'dispose' => 'execute dispose process...',
+        'finish'  => 'process completed.'
+    );
+    
+    /**
+     * @brief   int
+    **/
+    const PROGRESS_NORMAL = 100;
+    
+    /**
+     * @brief   int
+    **/
+    const PROGRESS_SPECIAL = 1000;
+    
+    /**
+     * __construct
+     * 
+     * @param   string  $zipName
+     * 
+     * @return  void
+    **/
+    public function __construct(/*** string ***/ $zipName)
+    {
+        $this->_showMessage('start');
+        $this->_mZipName = $zipName;
+    }
+    
+    /**
+     * prepare
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function prepare()
+    {
+        $this->_showMessage('prepare');
+        Sd2nd_UpdateUtils::executeFilter('prepare');
+    }
+    
+    /**
+     * execute
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function execute()
+    {
+        $this->_showMessage('execute');
+        $zip = new ZipArchive();
+        $zip->open($this->_mZipName);
+        
+        for($i = 0;$i < $zip->numFiles;$i++)
+        {
+            $arr = array();
+            if(preg_match(SD2ND_EXTRACTION_PATTERN,$zip->getNameIndex($i),$arr))
+            {
+                $instance =& Sd2nd_UpdateUtils::getProcess('execute',ucfirst($arr['name']));
+                if($instance instanceof Sd2nd_AbstractExecute)
+                {
+                    $instance->reset(intval($arr['id']),mb_convert_encoding($zip->getFromIndex($i),mb_internal_encoding(),SD2ND_RESULT_ENCODING));
+                    try
+                    {
+                        $instance->execute();
+                    }
+                    catch(Sd2nd_Exception $e)
+                    {
+                        Sd2nd_UpdateUtils::displayError($e);
+                        if($e->isFatal())
+                        {
+                            $zip->close();
+                            die();
+                        }
+                    }
+                }
+                unset($instance);
+            }
+            
+            if($i % self::PROGRESS_NORMAL == 0)
+            {
+                echo ($i % self::PROGRESS_SPECIAL == 0 ? '+' : '*');
+            }
+        }
+        echo "\n";
+        
+        $zip->close();
+    }
+    
+    /**
+     * dispose
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function dispose()
+    {
+        $this->_showMessage('dispose');
+        Sd2nd_UpdateUtils::executeFilter('dispose');
+        $this->_showMessage('finish');
+    }
+    
+    /**
+     * _showMessage
+     * 
+     * @param   Enum    $key
+     * 
+     * @return  void
+    **/
+    protected function _showMessage(/*** Enum ***/ $key)
+    {
+        if(isset($this->_mMessages[$key]) && $this->_mMessages[$key] != null)
+        {
+            echo $this->_mMessages[$key],"\n";
+        }
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/dispose/Backup.class.php b/trust_path/modules/sd2nd/class/updater/dispose/Backup.class.php
new file mode 100644 (file)
index 0000000..a777c9e
--- /dev/null
@@ -0,0 +1,221 @@
+<?php
+/**
+ * @file
+ * @package Sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+/**
+ * @class   Sd2nd_BackupDispose
+**/
+class Sd2nd_BackupDispose extends Sd2nd_AbstractFilter
+{
+    const MAX_INSERT_ROWS = 500;
+    const EXPORT_PATH = '/class/updater/backup';
+    protected /*** string ***/ $_mFileName = 'sd2nd_%06d.sql';
+    protected /*** Enum ***/ $_mTableName = array();
+    protected /*** resource ***/ $_mHandler = null;
+    
+    /**
+     * prepare
+     * 
+     * @param   int $updateTime
+     * 
+     * @return  void
+    **/
+    public function prepare(/*** int ***/ $updateTime)
+    {
+        parent::prepare($updateTime);
+        
+        $this->_mFileName = SD2ND_TRUST_PATH . self::EXPORT_PATH . '/' . sprintf($this->_mFileName,$updateTime);
+    }
+    
+    /**
+     * getPriority
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    public function getPriority()
+    {
+        return XCUBE_DELEGATE_PRIORITY_FINAL;
+    }
+    
+    /**
+     * _export
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    protected function _export()
+    {
+        $this->_mTableName = array_map(array('Sd2nd_UpdateUtils','convertTableName'),$this->_mTableName);
+        $this->_mHandler = fopen($this->_mFileName,'wb');
+        $this->_exportHeader();
+        $this->_exportMain();
+        $this->_exportFooter();
+        fclose($this->_mHandler);
+    }
+    
+    /**
+     * _save
+     * 
+     * @param   string  $str
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    protected function _save(/*** string ***/ $str)
+    {
+        if(!is_resource($this->_mHandler))
+        {
+            throw new Sd2nd_Exception('Backup file "' . $this->_mFileName . '" cannot opened.');
+        }
+        
+        fwrite($this->_mHandler,$str);
+    }
+    
+    /**
+     * _exportHeader
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    protected function _exportHeader()
+    {
+        $clear = array();
+        $disable = array();
+        $sql = sprintf("-- %s\n\nSET NAMES %s;\n\n-- reflesh tables\n",basename($this->_mFileName),SD2ND_DATABASE_ENCODING);
+        
+        foreach($this->_mTableName as $name)
+        {
+            $clear[] = 'TRUNCATE TABLE `' . $name . '`;';
+            $disable[] = 'ALTER TABLE `' . $name . '` DISABLE KEYS;';
+        }
+        
+        $this->_save($sql . implode("\n",$clear) . "\n-- disable keys\n" . implode("\n",$disable) . "\n");
+    }
+    
+    /**
+     * _exportMain
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    protected function _exportMain()
+    {
+        $root =& XCube_Root::getSingleton();
+        $db =& $root->mController->mDB;
+        
+        $this->_save("-- SQL dump\n");
+        
+        foreach($this->_mTableName as $name)
+        {
+            if(!$res = $db->query(sprintf('select * from `%s`',$name)))
+            {
+                throw new Sd2nd_QueryException('Table "' . $name . '" is not readable.');
+            }
+            
+            $cols = array();
+            $type = array();
+            for($i = 0;$i < $db->getFieldsNum($res);$i++)
+            {
+                $cols[] = $db->getFieldName($res,$i);
+                $type[] = $db->getFieldType($res,$i);
+            }
+            
+            $base = sprintf("insert delayed into `%s` (`%s`) values \n",$name,implode('`,`',$cols));
+            $sql = array();
+            $cnt = 0;
+            while($row = $db->fetchArray($res))
+            {
+                $row = array_map(array($db,'quoteString'),$row);
+                $sql[] = '(' . implode(',',$row) . ')';
+                $cnt++;
+                
+                if($cnt >= self::MAX_INSERT_ROWS)
+                {
+                    $this->_save($base . implode(",\n",$sql) . ";\n");
+                    $sql = array();
+                    $cnt = 0;
+                }
+            }
+            
+            if(count($sql) > 0)
+            {
+                $this->_save($base . implode(",\n",$sql) . ";\n\n");
+            }
+        }
+    }
+    
+    /**
+     * _exportFooter
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    protected function _exportFooter()
+    {
+        $enable = array();
+        $optimize = array();
+        foreach($this->_mTableName as $name)
+        {
+            $enable[] = 'ALTER TABLE `' . $name . '` ENABLE KEYS;';
+            $optimize[] = '`' . $name . "`";
+        }
+        
+        $this->_save("-- enable keys\n" . implode("\n",$enable) . "\n\n-- optimize tables\nOPTIMIZE TABLE \n" . implode(",\n",$optimize) . "\n");
+    }
+    
+    /**
+     * executeLatest
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_QueryException
+    **/
+    public function executeLatest()
+    {
+        $this->_mTableName = array(
+            Sd2nd_AssetManager::HANDLER_ABILITY,
+            Sd2nd_AssetManager::HANDLER_ACTIVE_ABILITY,
+            Sd2nd_AssetManager::HANDLER_CHAR,
+            Sd2nd_AssetManager::HANDLER_COSTUME,
+            Sd2nd_AssetManager::HANDLER_ENO_PNO_LINK,
+            Sd2nd_AssetManager::HANDLER_ICON,
+            Sd2nd_AssetManager::HANDLER_IMAGE,
+            Sd2nd_AssetManager::HANDLER_KIND,
+            Sd2nd_AssetManager::HANDLER_LEARNED_ABILITY,
+            Sd2nd_AssetManager::HANDLER_LEARNED_COSTUME,
+            Sd2nd_AssetManager::HANDLER_LEARNED_SKILL,
+            Sd2nd_AssetManager::HANDLER_MAP,
+            Sd2nd_AssetManager::HANDLER_MAP_CACHE,
+            Sd2nd_AssetManager::HANDLER_MAP_NAME,
+            Sd2nd_AssetManager::HANDLER_MAP_SPOT,
+            Sd2nd_AssetManager::HANDLER_RACE,
+            Sd2nd_AssetManager::HANDLER_SKILL,
+            Sd2nd_AssetManager::HANDLER_SKILL_ELEMENT_LINK,
+            Sd2nd_AssetManager::HANDLER_STATUS,
+            Sd2nd_AssetManager::HANDLER_TARGET,
+            Sd2nd_AssetManager::HANDLER_UPDATE
+        );
+        $this->_export();
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/dispose/GarbageCollection.class.php b/trust_path/modules/sd2nd/class/updater/dispose/GarbageCollection.class.php
new file mode 100644 (file)
index 0000000..f738958
--- /dev/null
@@ -0,0 +1,100 @@
+<?php
+/**
+ * @file
+ * @package Sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+/**
+ * @class   Sd2nd_GarbageCollectionDispose
+**/
+class Sd2nd_GarbageCollectionDispose extends Sd2nd_AbstractFilter
+{
+    /**
+     * @brief   Enum
+    **/
+    const ACTIVE_TABLE = Sd2nd_AssetManager::HANDLER_LEARNED_ABILITY;
+    
+    /**
+     * @brief   Enum
+    **/
+    const CHAR_TABLE = Sd2nd_AssetManager::HANDLER_CHAR;
+    
+    /**
+     * @brief   string[]
+    **/
+    protected $_mTableName = array();
+    
+    /**
+     * getPriority
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    public function getPriority()
+    {
+        return XCUBE_DELEGATE_PRIORITY_FIRST;
+    }
+    
+    /**
+     * _executeGC
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_QueryException
+    **/
+    protected function _executeGC()
+    {
+        $root =& XCube_Root::getSingleton();
+        $db =& $root->mController->mDB;
+        
+        if(!$res = $db->query('select `m`.`eno` as `eno` from `' . Sd2nd_UpdateUtils::convertTableName(self::ACTIVE_TABLE) . '` as m left join `' . Sd2nd_UpdateUtils::convertTableName(self::CHAR_TABLE) . '` as c on `m`.`eno` = `c`.`eno` where isnull(`c`.`full_name`) group by `m`.`eno`'))
+        {
+            throw new Sd2nd_QueryException(array('active' => self::ACTIVE_TABLE,'char' => self::CHAR_TABLE));
+        }
+        
+        $cri = new CriteriaCompo();
+        while($row = $db->fetchArray($res))
+        {
+            $cri->add(new Criteria('eno',$row['eno']));
+        }
+        
+        if($cri->hasChildElements())
+        {
+            foreach($this->_mTableName as $type)
+            {
+                Sd2nd_UpdateUtils::deleteMultiObjects($type,$cri);
+            }
+        }
+    }
+    
+    /**
+     * executeLatest
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_QueryException
+    **/
+    public function executeLatest()
+    {
+        $this->_mTableName = array(
+            Sd2nd_AssetManager::HANDLER_ICON,
+            Sd2nd_AssetManager::HANDLER_IMAGE,
+            Sd2nd_AssetManager::HANDLER_LEARNED_ABILITY,
+            Sd2nd_AssetManager::HANDLER_LEARNED_COSTUME,
+            Sd2nd_AssetManager::HANDLER_LEARNED_SKILL
+        );
+        
+        $this->_executeGC();
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/dispose/MapCache.class.php b/trust_path/modules/sd2nd/class/updater/dispose/MapCache.class.php
new file mode 100644 (file)
index 0000000..8097cf5
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * @file
+ * @package Sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+/**
+ * @class   Sd2nd_MapCacheDispose
+**/
+class Sd2nd_MapCacheDispose extends Sd2nd_AbstractFilter
+{
+    /**
+     * executeLatest
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_QueryException
+    **/
+    public function executeLatest()
+    {
+        $maps =& XCube_Root::getSingleton()->mContext->mAttributes['sd2nd.mapCollection'];
+        foreach(array_keys($maps) as $key)
+        {
+            $maps[$key]->save();
+        }
+    }
+    
+    /**
+     * execute090211
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_QueryException
+    **/
+    public function execute090211()
+    {
+        $root =& XCube_Root::getSingleton();
+        $root->mContext->mAttributes['sd2nd.mapCollection']->save();
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/dispose/Update.class.php b/trust_path/modules/sd2nd/class/updater/dispose/Update.class.php
new file mode 100644 (file)
index 0000000..b97ed8b
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/**
+ * @file
+ * @package Sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+/**
+ * @class   Sd2nd_UpdateDispose
+**/
+class Sd2nd_UpdateDispose extends Sd2nd_AbstractFilter
+{
+    /**
+     * @brief   int
+    **/
+    protected $_mUpdateTime = null;
+    
+    /**
+     * prepare
+     * 
+     * @param   int $updateTime
+     * 
+     * @return  void
+    **/
+    public function prepare(/*** int ***/ $updateTime)
+    {
+        parent::prepare($updateTime);
+        
+        $this->_mUpdateTime = $updateTime;
+    }
+    
+    /**
+     * executeLatest
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_QueryException
+    **/
+    public function executeLatest()
+    {
+        $update =& Sd2nd_UpdateUtils::createObject(Sd2nd_AssetManager::HANDLER_UPDATE);
+        $update->set('update_time',$this->_mUpdateTime);
+        Sd2nd_UpdateUtils::insertObject(Sd2nd_AssetManager::HANDLER_UPDATE,$update);
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/execute/Chardata.class.php b/trust_path/modules/sd2nd/class/updater/execute/Chardata.class.php
new file mode 100644 (file)
index 0000000..f4bf2e8
--- /dev/null
@@ -0,0 +1,132 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+
+/**
+ * @class   Sd2nd_ChardataExecute
+**/
+class Sd2nd_ChardataExecute extends Sd2nd_AbstractExecute
+{
+    public /*** XoopsSimpleObject{} ***/ $mCharData = array(
+        Sd2nd_AssetManager::HANDLER_CHAR => null,
+        Sd2nd_AssetManager::HANDLER_STATUS => null
+    );
+    public /*** XoopsSimpleObject{}[] ***/ $mCharDataList = array(
+        Sd2nd_AssetManager::HANDLER_ICON => array(),
+        Sd2nd_AssetManager::HANDLER_LEARNED_ABILITY => array(),
+        Sd2nd_AssetManager::HANDLER_LEARNED_COSTUME => array(),
+        Sd2nd_AssetManager::HANDLER_LEARNED_SKILL => array()
+    );
+    public /*** string ***/ $mActiveCostume = null;
+    public /*** string{} ***/ $mActiveAbilities = array();
+    public /*** string{}[] ***/ $mWeaponLv = array();
+    public /*** Sd2nd_ImageObject ***/ $mImage = null;
+    public /*** int{} ***/ $mSpots = array();
+    public /*** int[] ***/ $mMaps = array();
+    public /*** int{} ***/ $mPoint = array('x' => 0,'y' => 0);
+    protected /*** string ***/ $_mParserPath = 'execute/parser/charParser';
+    protected /*** string ***/ $_mFilterPattern = '/^(?P<name>\w+)[\(\[]/';
+    protected /*** XCube_HttpContext ***/ $_mContext = null;
+    
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return   void
+    **/
+    public function __construct()
+    {
+        parent::__construct();
+        
+        $root =& XCube_Root::getSingleton();
+        $this->_mContext =& $root->mContext;
+    }
+    
+    /**
+     * reset
+     * 
+     * @param   int     $id
+     * @param   string  $text
+     * 
+     * @return  void
+    **/
+    public function reset(/*** int ***/ $id,/*** string ***/ $text)
+    {
+        parent::reset($id,$text);
+        
+        foreach(array_keys($this->mCharData) as $type)
+        {
+            $this->mCharData[$type] =& Sd2nd_UpdateUtils::createObject($type);
+            $this->mCharData[$type]->set('eno',$id);
+        }
+        
+        foreach(array_keys($this->mCharDataList) as $type)
+        {
+            $this->mCharDataList[$type] = array();
+        }
+
+        $this->mActiveCostume = null;
+        $this->mActiveAbilities = array();
+        $this->mWeaponLv = array();
+        $this->mImage = null;
+        $this->mSpots = array();
+        $this->mMaps = array();
+        $this->mPoint = array('x' => 0,'y' => 0);
+    }
+    
+    /**
+     * _save
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    protected function _save()
+    {
+        foreach(array_keys($this->mCharData) as $type)
+        {
+            if($this->mCharData[$type] instanceof XoopsSimpleObject)
+            {
+                Sd2nd_UpdateUtils::insertObject($type,$this->mCharData[$type]);
+            }
+        }
+        
+        foreach(array_keys($this->mCharDataList) as $type)
+        {
+            foreach(array_keys($this->mCharDataList[$type]) as $key)
+            {
+                Sd2nd_UpdateUtils::insertObject($type,$this->mCharDataList[$type][$key]);
+            }
+        }
+        
+        foreach($this->mActiveAbilities as $key => $abilityName)
+        {
+            $ability =& Sd2nd_UpdateUtils::createObject(Sd2nd_AssetManager::HANDLER_ACTIVE_ABILITY);
+            $ability->setVars(array('eno' => $this->_mActiveId,'slot' => $key,'ability_id' => $this->_mContext->mAttributes['sd2nd.ability'][$abilityName]));
+            Sd2nd_UpdateUtils::insertObject(Sd2nd_AssetManager::HANDLER_ACTIVE_ABILITY,$ability);
+        }
+        
+        foreach(array_keys($this->mWeaponLv) as $key)
+        {
+        }
+        
+        if($this->mImage instanceof Sd2nd_ImageObject)
+        {
+            Sd2nd_UpdateUtils::insertObject(Sd2nd_AssetManager::HANDLER_IMAGE,$this->mImage);
+        }
+    }
+}
+
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/execute/Charlist.class.php b/trust_path/modules/sd2nd/class/updater/execute/Charlist.class.php
new file mode 100644 (file)
index 0000000..dbb234f
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+
+/**
+ * @class   Sd2nd_CharlistExecute
+**/
+class Sd2nd_CharlistExecute extends Sd2nd_AbstractExecute
+{
+    /**
+     * @brief   string
+    **/
+    protected $_mFilterPattern = '/^(?P<name>Show_CharList)\(/';
+    
+    /**
+     * _save
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    protected function _save()
+    {
+    }
+}
+
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/execute/parser/Show_CharList.class.php b/trust_path/modules/sd2nd/class/updater/execute/parser/Show_CharList.class.php
new file mode 100644 (file)
index 0000000..ef76ef3
--- /dev/null
@@ -0,0 +1,37 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+
+/**
+ * @class   Sd2nd_Show_CharListParser
+**/
+class Sd2nd_Show_CharListParser extends Sd2nd_AbstractParser
+{
+    /**
+     * executeLatest
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function executeLatest()
+    {
+        $arr = Sd2nd_UpdateUtils::parseByExplode($this->_mLine,3,14,-1,array('eno','pno','name'));
+        $obj =& Sd2nd_UpdateUtils::createObject(Sd2nd_AssetManager::HANDLER_ENO_PNO_LINK);
+        $obj->setVars(array('eno' => $arr['eno'],'pno' => $arr['pno'],'regist_time' => $this->_mUpdateTime));
+        Sd2nd_UpdateUtils::insertObject(Sd2nd_AssetManager::HANDLER_ENO_PNO_LINK,$obj);
+    }
+}
+
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/execute/parser/charParser/Costume_Data.class.php b/trust_path/modules/sd2nd/class/updater/execute/parser/charParser/Costume_Data.class.php
new file mode 100644 (file)
index 0000000..2aefebb
--- /dev/null
@@ -0,0 +1,130 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+
+/**
+ * @class   Sd2nd_Costume_DataCharParser
+**/
+class Sd2nd_Costume_DataCharParser extends Sd2nd_AbstractParser
+{
+    protected /*** mixed{} ***/ $_mAttrs =null;
+    protected /*** XoopsDatabase ***/ $_mDB = null;
+    protected /*** int{} ***/ $_mLearnedCostume = array();
+    
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  voud
+    **/
+    public function __construct()
+    {
+        parent::__construct();
+        
+        $root =& XCube_Root::getSingleton();
+        $this->_mAttrs =& $root->mContext->mAttributes;
+        $this->_mDB =& $root->mController->mDB;
+    }
+    
+    /**
+     * reset
+     * 
+     * @param   int                     $id
+     * @param   Sd2nd_AbstractExecute   &$execute
+     * @param   string                  $line
+     * 
+     * @return  void
+     * @throw   Sd2nd_QueryException
+    **/
+    public function reset(/*** int ***/ $id,Sd2nd_AbstractExecute &$execute,/*** string ***/ $line)
+    {
+        parent::reset($id,$execute,$line);
+        
+        $this->_mLearnedCostume = array();
+        if(!$res = $this->_mDB->query('select `costume_id`,`costume_lv`,`costume_point` from `' . Sd2nd_UpdateUtils::convertTableName(Sd2nd_AssetManager::HANDLER_LEARNED_COSTUME) . '` where `eno` = ' . intval($this->_mActiveId)))
+        {
+            throw new Sd2nd_QueryException('LearnedCostume data is not readable.');
+        }
+        
+        while($row = $this->_mDB->fetchArray($res))
+        {
+            $this->_mLearnedCostume[$row['costume_id']] = array('costume_lv' => $row['costume_lv'],'costume_point' => $row['costume_point']);
+        }
+    }
+    
+    /**
+     * executeLatest
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function executeLatest()
+    {
+        $arr = Sd2nd_UpdateUtils::parseByExplode($this->_mLine,22,strpos($this->_mLine,'(') + 1,-1,array('costume_id','costume_name','costume_lv','costume_exp','costume_point','grow_life','grow_soul','grow_pow','grow_str','grow_dex','grow_speed','grow_mag','grow_reg','grow_con','modify_hp','modify_tp','modify_at','modify_df','modify_mat','modify_mdf','modify_act','move_cost'));
+        $arr['costume_name'] = trim($arr['costume_name'],"'");
+        if(!isset($this->_mAttrs['sd2nd.costume'][$arr['costume_name']]))
+        {
+            $this->_appendCostume($arr);
+        }
+        if(!isset($this->_mLearnedCostume[$arr['costume_id']]) || $this->_mLearnedCostume[$arr['costume_id']]['costume_lv'] != $arr['costume_lv'] || $this->_mLearnedCostume[$arr['costume_id']]['costume_point'] != $arr['costume_point'])
+        {
+            $this->_appendLearnedCostume($arr['costume_id'],$arr['costume_lv'],$arr['costume_point']);
+        }
+    }
+    
+    /**
+     * _appendCostume
+     * 
+     * @param   mixed{} $params
+     * 
+     * @return  void
+    **/
+    protected function _appendCostume(/*** mixed{} ***/ $params)
+    {
+        $this->_mAttrs['sd2nd.costume'][$params['costume_name']] = $params['costume_id'];
+        $obj =& Sd2nd_UpdateUtils::createObject(Sd2nd_AssetManager::HANDLER_COSTUME);
+        unset($params['costume_lv'],$params['costume_exp'],$params['costume_point']);
+        $obj->setVars($params);
+        $obj->set('regist_time',$this->_mUpdateTime);
+        Sd2nd_UpdateUtils::insertObject(Sd2nd_AssetManager::HANDLER_COSTUME,$obj);
+    }
+    
+    /**
+     * _appendLearnedCostume
+     * 
+     * @param   int $id
+     * @param   int $lv
+     * @param   int $point
+     * 
+     * @return  void
+    **/
+    protected function _appendLearnedCostume(/*** int ***/ $id,/*** int ***/ $lv,/*** int ***/ $point)
+    {
+        $obj =& Sd2nd_UpdateUtils::createObject(Sd2nd_AssetManager::HANDLER_LEARNED_COSTUME);
+        $obj->set('eno',$this->_mActiveId);
+        $obj->set('costume_id',$id);
+        $obj->set('costume_lv',$lv);
+        $obj->set('costume_point',$point);
+        $obj->set('regist_time',$this->_mUpdateTime);
+        if(isset($this->_mLearnedCostume[$id]))
+        {
+            $obj->unsetNew();
+        }
+        Sd2nd_UpdateUtils::insertObject(Sd2nd_AssetManager::HANDLER_LEARNED_COSTUME,$obj);
+    }
+}
+
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/execute/parser/charParser/Field_Data.class.php b/trust_path/modules/sd2nd/class/updater/execute/parser/charParser/Field_Data.class.php
new file mode 100644 (file)
index 0000000..4d6f139
--- /dev/null
@@ -0,0 +1,81 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+
+/**
+ * @class   Sd2nd_Field_DataCharParser
+**/
+class Sd2nd_Field_DataCharParser extends Sd2nd_AbstractParser
+{
+    /**
+     * executeLatest
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function executeLatest()
+    {
+    }
+    
+    /**
+     * execute081217
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function execute081217()
+    {
+        static $map = null;
+        $arr = Sd2nd_UpdateUtils::parseByRegex($this->_mLine,"/\[(?P<id>\d+)\] = new TableData_Set\('(?P<spot_name>[^']+)','(?P<pos>[^']+)',(?P<buy_flag>\d+),(?P<transe_flag>\d+)\)/");
+        if($arr['id'] == 0)
+        {
+            $dir = array();
+            $x = 0;
+            $y = 0;
+            if(preg_match_all('/(?P<direction>\D+)(?P<distance>\d+)+/',$arr['pos'],$dir,PREG_SET_ORDER))
+            {
+                foreach($dir as $d)
+                {
+                    switch($d['direction'])
+                    {
+                        case _MD_SD2ND_LANG_DIRECTION_NORTH:
+                            $y = $d['distance'];
+                            break;
+                        case _MD_SD2ND_LANG_DIRECTION_EAST:
+                            $x = -$d['distance'];
+                            break;
+                        case _MD_SD2ND_LANG_DIRECTION_SOUTH:
+                            $y = -$d['distance'];
+                            break;
+                        case _MD_SD2ND_LANG_DIRECTION_WEST:
+                            $x = $d['distance'];
+                            break;
+                    }
+                }
+            }
+            if($map == null)
+            {
+                $map =& XCube_Root::getSingleton()->mContext->mAttributes['sd2nd.mapCollection'];
+            }
+            $map->addBySpotList($x - 4,$y - 4,array_chunk($this->_mExecute->mMaps,9));
+        }
+        
+        /// @todo set eno field link data?
+    }
+}
+
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/execute/parser/charParser/Icon_Data.class.php b/trust_path/modules/sd2nd/class/updater/execute/parser/charParser/Icon_Data.class.php
new file mode 100644 (file)
index 0000000..fd52320
--- /dev/null
@@ -0,0 +1,80 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+
+/**
+ * @class   Sd2nd_Icon_DataCharParser
+**/
+class Sd2nd_Icon_DataCharParser extends Sd2nd_AbstractParser
+{
+    protected /*** Sd2nd_IconHandler ***/ $_mHandler = null;
+    
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        parent::__construct();
+        $this->_mHandler =& Sd2nd_UpdateUtils::getHandler(Sd2nd_AssetManager::HANDLER_ICON);
+    }
+    
+    /**
+     * executeLatest
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function executeLatest()
+    {
+        try
+        {
+            $arr = Sd2nd_UpdateUtils::parseByRegex($this->_mLine,'/Icon_Data\[(?P<slot>\d+)\] = new TableData_Set\("(?P<icon_url>.+)",(?P<icon_width>\d+),(?P<icon_height>\d+)\)/');
+        }
+        catch(Exception $ex)
+        {
+            return;
+        }
+        $obj =& $this->_mHandler->getByUnique($this->_mActiveId,$arr['slot']);
+        if(!$obj instanceof $this->_mHandler->mClass || $obj->get('icon_url') != $arr['icon_url'] || $obj->get('icon_width') != $arr['icon_width'] || $obj->get('icon_height') != $arr['icon_height'])
+        {
+            $this->_appendIcon($arr);
+        }
+    }
+    
+    /**
+     * _appendIcon
+     * 
+     * @param   mixed{} $params
+     * 
+     * @return  void
+    **/
+    protected function _appendIcon(/*** mixed{} ***/ $params)
+    {
+        $obj =& Sd2nd_UpdateUtils::createObject(Sd2nd_AssetManager::HANDLER_ICON);
+        $obj->set('eno',$this->_mActiveId);
+        $obj->set('slot',$params['slot']);
+        $obj->set('icon_url',$params['icon_url']);
+        $obj->set('icon_height',$params['icon_height']);
+        $obj->set('icon_width',$params['icon_width']);
+        $obj->set('update_time',$this->_mUpdateTime);
+        Sd2nd_UpdateUtils::insertObject(Sd2nd_AssetManager::HANDLER_ICON,$obj);
+    }
+}
+
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/execute/parser/charParser/Map_Data.class.php b/trust_path/modules/sd2nd/class/updater/execute/parser/charParser/Map_Data.class.php
new file mode 100644 (file)
index 0000000..e39adc6
--- /dev/null
@@ -0,0 +1,61 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+
+/**
+ * @class   Sd2nd_Map_DataCharParser
+**/
+class Sd2nd_Map_DataCharParser extends Sd2nd_AbstractParser
+{
+    protected /*** int{} ***/ $_mSpot = null;
+    
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  voud
+    **/
+    public function __construct()
+    {
+        parent::__construct();
+        $this->_mSpot =& XCube_Root::getSingleton()->mContext->mAttributes['sd2nd.spot'];
+    }
+    
+    /**
+     * executeLatest
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function executeLatest()
+    {
+        $arr = Sd2nd_UpdateUtils::parseByRegex($this->_mLine,"/\[(?P<id>\d+)\] = new TableData_Set\('#[\dA-F]{6}','(?P<spot_name>[^']+)'\)/");
+        $arr['spot_name'] = trim($arr['spot_name'],"'");
+        $arr['regist_time'] = $this->_mUpdateTime;
+        
+        if(!isset($this->_mSpot[$arr['spot_name']]))
+        {
+            $spot =& Sd2nd_UpdateUtils::createObject(Sd2nd_AssetManager::HANDLER_MAP_SPOT);
+            $spot->setVars($arr);
+            Sd2nd_UpdateUtils::insertObject(Sd2nd_AssetManager::HANDLER_MAP_SPOT,$spot);
+            $this->_mSpot[$arr['spot_name']] = $spot->get('spot_id');
+        }
+        
+        $this->_mExecute->mSpots[$arr['id']] = $this->_mSpot[$arr['spot_name']];
+    }
+}
+
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/execute/parser/charParser/SAbility_Data.class.php b/trust_path/modules/sd2nd/class/updater/execute/parser/charParser/SAbility_Data.class.php
new file mode 100644 (file)
index 0000000..95309c6
--- /dev/null
@@ -0,0 +1,122 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+
+/**
+ * @class   Sd2nd_SAbility_DataCharParser
+**/
+class Sd2nd_SAbility_DataCharParser extends Sd2nd_AbstractParser
+{
+    protected /*** mixed{} ***/ $_mAttrs = null;
+    protected /*** XoopsDatabase ***/ $_mDB = null;
+    protected /*** int{} ***/ $_mLearnedAbility = array();
+    
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  voud
+    **/
+    public function __construct()
+    {
+        parent::__construct();
+        
+        $root =& XCube_Root::getSingleton();
+        $this->_mAttrs =& $root->mContext->mAttributes;
+        $this->_mDB =& $root->mController->mDB;
+    }
+    
+    /**
+     * reset
+     * 
+     * @param   int                     $id
+     * @param   Sd2nd_AbstractExecute   &$execute
+     * @param   string                  $line
+     * 
+     * @return  void
+    **/
+    public function reset(/*** int ***/ $id,Sd2nd_AbstractExecute &$execute,/*** string ***/ $line)
+    {
+        parent::reset($id,$execute,$line);
+        
+        $this->_mLearnedAbility = array();
+        if(!$res = $this->_mDB->query('select `ability_id` from `' . Sd2nd_UpdateUtils::convertTableName(Sd2nd_AssetManager::HANDLER_LEARNED_ABILITY) . '` where `eno` = ' . intval($this->_mActiveId)))
+        {
+            throw new Sd2nd_QueryException('LearnedAbility data is not readable.');
+        }
+        
+        while($row = $this->_mDB->fetchArray($res))
+        {
+            $this->_mLearnedAbility[$row['ability_id']] = $row['ability_id'];
+        }
+    }
+    
+    /**
+     * executeLatest
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function executeLatest()
+    {
+        $arr = Sd2nd_UpdateUtils::parseByExplode($this->_mLine,4,strpos($this->_mLine,'(') + 1,-1,array('ability_id','ability_name','description','ability_cost'));
+        $arr['ability_name'] = trim($arr['ability_name'],"'");
+        if(!isset($this->_mAttrs['sd2nd.ability'][$arr['ability_name']]))
+        {
+            $this->_appendAbility($arr);
+        }
+        if(!isset($this->_mLearnedAbility[$arr['ability_id']]))
+        {
+            $this->_appendLearnedAbility($arr['ability_id']);
+        }
+    }
+    
+    /**
+     * _appendAbility
+     * 
+     * @param   string{}    $params
+     * 
+     * @return  void
+    **/
+    protected function _appendAbility(/*** string{} ***/ $params)
+    {
+        $this->_mAttrs['sd2nd.ability'][$params['ability_name']] = $params['ability_id'];
+        $obj =& Sd2nd_UpdateUtils::createObject(Sd2nd_AssetManager::HANDLER_ABILITY);
+        $obj->set('ability_id',$params['ability_id']);
+        $obj->set('ability_name',$params['ability_name']);
+        $obj->set('description',strtr(trim($params['description'],"'"),array('<br>' => "\n")));
+        $obj->set('ability_cost',$params['ability_cost']);
+        $obj->set('regist_time',$this->_mUpdateTime);
+        Sd2nd_UpdateUtils::insertObject(Sd2nd_AssetManager::HANDLER_ABILITY,$obj);
+    }
+    
+    /**
+     * _appendLearnedAbility
+     * 
+     * @param   int $id
+     * 
+     * @return  void
+    **/
+    protected function _appendLearnedAbility(/*** int ***/ $id)
+    {
+        $obj =& Sd2nd_UpdateUtils::createObject(Sd2nd_AssetManager::HANDLER_LEARNED_ABILITY);
+        $obj->set('eno',$this->_mActiveId);
+        $obj->set('ability_id',$id);
+        $obj->set('regist_time',$this->_mUpdateTime);
+        Sd2nd_UpdateUtils::insertObject(Sd2nd_AssetManager::HANDLER_LEARNED_ABILITY,$obj);
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/execute/parser/charParser/Show_Image.class.php b/trust_path/modules/sd2nd/class/updater/execute/parser/charParser/Show_Image.class.php
new file mode 100644 (file)
index 0000000..3a2b6dd
--- /dev/null
@@ -0,0 +1,73 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+
+/**
+ * @class   Sd2nd_Show_ImageCharParser
+**/
+class Sd2nd_Show_ImageCharParser extends Sd2nd_AbstractParser
+{
+    protected /*** Sd2nd_ImageHandler ***/ $_mHandler = null;
+    
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        parent::__construct();
+        $this->_mHandler =& Sd2nd_UpdateUtils::getHandler(Sd2nd_AssetManager::HANDLER_IMAGE);
+    }
+    
+    /**
+     * executeLatest
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function executeLatest()
+    {
+        $arr = Sd2nd_UpdateUtils::parseByRegex($this->_mLine,'/\((?P<image_width>\d+),(?P<image_height>\d+),"(?P<image_url>[^"]+)","(?P<image_link>[^"]*)"\);/');
+        $obj =& $this->_mHandler->getByUnique($this->_mActiveId);
+        if(!$obj instanceof $this->_mHandler->mClass || $obj->get('image_url') != $arr['image_url'] || $obj->get('image_width') != $arr['image_width'] || $obj->get('image_height') != $arr['image_height'] || $obj->get('image_link') != $arr['image_link'])
+        {
+            $this->_appendImage($arr);
+        }
+    }
+    
+    /**
+     * _appendImage
+     * 
+     * @param   mixed{} $params
+     * 
+     * @return  void
+    **/
+    protected function _appendImage(/*** mixed{} ***/ $params)
+    {
+        $obj =& Sd2nd_UpdateUtils::createObject(Sd2nd_AssetManager::HANDLER_IMAGE);
+        $obj->set('eno',$this->_mActiveId);
+        $obj->set('image_url',$params['image_url']);
+        $obj->set('image_height',$params['image_height']);
+        $obj->set('image_width',$params['image_width']);
+        $obj->set('image_link',$params['image_link']);
+        $obj->set('update_time',$this->_mUpdateTime);
+        Sd2nd_UpdateUtils::insertObject(Sd2nd_AssetManager::HANDLER_IMAGE,$obj);
+    }
+}
+
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/execute/parser/charParser/Show_Map.class.php b/trust_path/modules/sd2nd/class/updater/execute/parser/charParser/Show_Map.class.php
new file mode 100644 (file)
index 0000000..0f0c94e
--- /dev/null
@@ -0,0 +1,183 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+
+/**
+ * @class   Sd2nd_Show_MapCharParser
+**/
+class Sd2nd_Show_MapCharParser extends Sd2nd_AbstractParser
+{
+    const /*** int ***/ BASE_SPOT = 3;
+    
+    /**
+     * executeLatest
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function executeLatest()
+    {
+        static $attr = null;
+        $x = 0;
+        $y = 0;
+        $maps = array();
+        $arr = explode(',',substr($this->_mLine,9,-1));
+        list($name,$flag,$width,$point) = array_splice($arr,0,4);
+        $name = trim($name,"'");
+        $len = count($arr);
+        if($attr == null)
+        {
+            $attr =& XCube_Root::getSingleton()->mContext->mAttributes;
+        }
+        $baseSpot = $attr['sd2nd.mapName'][$name]->get('base_spot');
+        /// @todo
+        if($baseSpot != 3)
+        {
+            return;
+        }
+        for($i = 0;$i < $len;$i += 2)
+        {
+            $key = $i >> 1;
+            $maps[] = ($id = $this->_mExecute->mSpots[$arr[$i]]);
+            if($id == $baseSpot)
+            {
+                $x = - ($key % $width);
+                $y = - intval($key / $width);
+            }
+        }
+        $attr['sd2nd.mapCollection'][$name]->addBySpotList($x,$y,array_chunk($maps,$width));
+    }
+    
+    /**
+     * execute090211
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function execute090211()
+    {
+        static $map = null;
+        $x = 0;
+        $y = 0;
+        $maps = array();
+        $arr = explode(',',substr($this->_mLine,9,-1));
+        list($name,$flag,$width,$point) = array_splice($arr,0,4);
+        $len = count($arr);
+        for($i = 0;$i < $len;$i += 2)
+        {
+            $key = $i >> 1;
+            $maps[] = ($id = $this->_mExecute->mSpots[$arr[$i]]);
+            if($id == self::BASE_SPOT)
+            {
+                $x = - ($key % $width);
+                $y = - intval($key / $width);
+            }
+        }
+        if($map == null)
+        {
+            $map =& XCube_Root::getSingleton()->mContext->mAttributes['sd2nd.mapCollection'];
+        }
+        $map->addBySpotList($x,$y,array_chunk($maps,$width));
+    }
+    
+    /**
+     * execute090128
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function execute090128()
+    {
+        static $map = null;
+        $x = 0;
+        $y = 0;
+        $maps = array();
+        $arr = explode(',',substr($this->_mLine,9,-1));
+        list($flag,$width,$point) = array_splice($arr,0,3);
+        $len = count($arr);
+        for($i = 0;$i < $len;$i += 2)
+        {
+            $key = $i >> 1;
+            $maps[] = ($id = $this->_mExecute->mSpots[$arr[$i]]);
+            if($id == self::BASE_SPOT)
+            {
+                $x = - ($key % $width);
+                $y = - intval($key / $width);
+            }
+        }
+        if($map == null)
+        {
+            $map =& XCube_Root::getSingleton()->mContext->mAttributes['sd2nd.mapCollection'];
+        }
+        $map->addBySpotList($x,$y,array_chunk($maps,$width));
+    }
+    
+    /**
+     * execute090107
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function execute090107()
+    {
+        static $map = null;
+        $x = 0;
+        $y = 0;
+        $maps = array();
+        $arr = explode(',',substr($this->_mLine,9,-1));
+        list($flag,$width,$point) = array_splice($arr,0,3);
+        foreach($arr as $i => $spot)
+        {
+            $maps[] = ($id = $this->_mExecute->mSpots[$spot]);
+            if($id == self::BASE_SPOT)
+            {
+                $x = - ($i % $width);
+                $y = - intval($i / $width);
+            }
+        }
+        if($map == null)
+        {
+            $map =& XCube_Root::getSingleton()->mContext->mAttributes['sd2nd.mapCollection'];
+        }
+        $map->addBySpotList($x,$y,array_chunk($maps,$width));
+    }
+    
+    /**
+     * execute081217
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function execute081217()
+    {
+        $arr = Sd2nd_UpdateUtils::parseByExplode($this->_mLine,82,9,-1);
+        $flag = array_shift($arr);
+        
+        foreach($arr as $spot)
+        {
+            $this->_mExecute->mMaps[] = $this->_mExecute->mSpots[$spot];
+        }
+    }
+}
+
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/execute/parser/charParser/Show_Name.class.php b/trust_path/modules/sd2nd/class/updater/execute/parser/charParser/Show_Name.class.php
new file mode 100644 (file)
index 0000000..6136acb
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+
+/**
+ * @class   Sd2nd_Show_NameCharParser
+**/
+class Sd2nd_Show_NameCharParser extends Sd2nd_AbstractParser
+{
+    /**
+     * executeLatest
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function executeLatest()
+    {
+        $this->_mExecute->mCharData[Sd2nd_AssetManager::HANDLER_CHAR]->set('full_name',substr($this->_mLine,11,-2));
+    }
+}
+
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/execute/parser/charParser/Show_Profile.class.php b/trust_path/modules/sd2nd/class/updater/execute/parser/charParser/Show_Profile.class.php
new file mode 100644 (file)
index 0000000..701ae56
--- /dev/null
@@ -0,0 +1,57 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+/**
+ * @class   Sd2nd_Show_ProfileCharParser
+**/
+class Sd2nd_Show_ProfileCharParser extends Sd2nd_AbstractParser
+{
+    protected /*** int{} ***/ $_mSexList = array();
+    protected /*** string ***/ $_mPattern = null;
+    
+    /**
+     * prepare
+     * 
+     * @param   int $updateTime
+     * 
+     * @return  void
+    **/
+    public function prepare(/*** int ***/ $updateTime)
+    {
+        parent::prepare($updateTime);
+        $i = 1;
+        while(defined($value = '_MD_SD2ND_LANG_SEX_' . $i))
+        {
+            $this->_mSexList[constant($value)] = $i++;
+        }
+        $this->_mPattern = sprintf("/\('.*(?P<sex>%s) ?(?:(?P<age>\d+)%s )?(?:(?P<height>\d+)%s )?(?:(?P<weight>\d+)%s )?','(?P<profile>[^']*)'\)/",implode('|',array_keys($this->_mSexList)),_MD_SD2ND_LANG_AGE_UNIT,_MD_SD2ND_LANG_HEIGHT_UNIT,_MD_SD2ND_LANG_WEIGTH_UNIT);
+    }
+    
+    /**
+     * executeLatest
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function executeLatest()
+    {
+        $arr = Sd2nd_UpdateUtils::parseByRegex($this->_mLine,$this->_mPattern);
+        $arr['sex'] = $this->_mSexList[$arr['sex']];
+        $arr['profile'] = strtr($arr['profile'],array('<br>' => "\n"));
+        $this->_mExecute->mCharData[Sd2nd_AssetManager::HANDLER_CHAR]->setVars($arr);
+    }
+}
+
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/execute/parser/charParser/Show_Status.class.php b/trust_path/modules/sd2nd/class/updater/execute/parser/charParser/Show_Status.class.php
new file mode 100644 (file)
index 0000000..7ad2eba
--- /dev/null
@@ -0,0 +1,112 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+
+/**
+ * @class   Sd2nd_Show_StatusCharParser
+**/
+class Sd2nd_Show_StatusCharParser extends Sd2nd_AbstractParser
+{
+    /**
+     * @brief   XCube_HttpContext
+    **/
+    protected $_mContext = null;
+    
+    /**
+     * @brief   int{}
+    **/
+    protected $_mElements = array();
+    
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function __construct()
+    {
+        parent::__construct();
+        
+        $root =& XCube_Root::getSingleton();
+        $this->_mContext =& $root->mContext;
+        
+        $i = 0;
+        while(defined($value = '_MD_SD2ND_LANG_ELEMENT_' . $i))
+        {
+            $this->_mElements[constant($value)] = $i++;
+        }
+    }
+    
+    /**
+     * executeLatest
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function executeLatest()
+    {
+        $arr = Sd2nd_UpdateUtils::parseByRegex($this->_mLine,"/\(\d+,'(?P<params>[\d,]+)','(?P<grows>[\d,]+)','(?P<nick_name>[^']+)','(?P<battle_name>[^']+)','(?P<profile>[^']+)','(?P<class>[^']+)Lv\.\d+','\d\/\d,(?P<ability>[^']+)','(?P<weapon>[^']+)'\)/");
+        $params = Sd2nd_UpdateUtils::parseByExplode($arr['params'],13,0,null,array('lv','life','soul','pow','str','dex','speed','mag','reg','con','exp','money','sp'));
+        $grows = Sd2nd_UpdateUtils::parseByExplode($arr['grows'],10,0,null,array('lv','life','soul','pow','str','dex','speed','mag','reg','con'));
+        $elementBase = mb_substr($arr['profile'],0,1);
+        $elementExtra = mb_substr($arr['profile'],2,1);
+        $raceName = mb_substr($arr['profile'],4);
+        $ability = explode(',',$arr['ability']);
+        $weapon = explode(',',$arr['weapon']);
+        
+        if(!isset($this->_mContext->mAttributes['sd2nd.race'][$raceName]))
+        {
+            $race =& Sd2nd_UpdateUtils::createObject(Sd2nd_AssetManager::HANDLER_RACE);
+            $race->set('race_name',$raceName);
+            Sd2nd_UpdateUtils::insertObject(Sd2nd_AssetManager::HANDLER_RACE,$race);
+            $this->_mContext->mAttributes['sd2nd.race'][$raceName] = $race->get('race_id');
+        }
+        
+        if(!isset($this->_mElements[$elementBase]))
+        {
+            throw new Sd2nd_Exception('Base element "' . $elementBase . '" is not defined.');
+        }
+        
+        if(!isset($this->_mElements[$elementExtra]))
+        {
+            throw new Sd2nd_Exception('Base element "' . $elementExtra . '" is not defined.');
+        }
+        
+        $this->_mExecute->mCharData[Sd2nd_AssetManager::HANDLER_CHAR]->setVars(array('nick_name' => $arr['nick_name'],'battle_name' => $arr['battle_name'],'race' => $this->_mContext->mAttributes['sd2nd.race'][$raceName],'element_base' => $this->_mElements[$elementBase],'element_ext' => $this->_mElements[$elementExtra]));
+        $this->_mExecute->mCharData[Sd2nd_AssetManager::HANDLER_STATUS]->setVars($params);
+        $this->_mExecute->mActiveCostume = $arr['class'];
+        
+        foreach($ability as $key => $val)
+        {
+            if($val != null)
+            {
+                $this->_mExecute->mActiveAbilities[$key + 1] = substr($val,0,strrpos($val,'('));
+            }
+        }
+        
+        $cnt = count($weapon);
+        for($i = 1;$i < $cnt;$i++)
+        {
+            $weaponLv = array();
+            if(preg_match('/^(?P<name>.+)Lv(?P<lv>\d+)$/',$weapon[$i],$weaponLv))
+            {
+                $this->_mExecute->mWeaponLv[] = $weaponLv;
+            }
+        }
+    }
+}
+
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/execute/parser/charParser/WSkill_Data.class.php b/trust_path/modules/sd2nd/class/updater/execute/parser/charParser/WSkill_Data.class.php
new file mode 100644 (file)
index 0000000..d28c042
--- /dev/null
@@ -0,0 +1,183 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+
+/**
+ * @class   Sd2nd_WSkill_DataCharParser
+**/
+class Sd2nd_WSkill_DataCharParser extends Sd2nd_AbstractParser
+{
+    protected /*** mixed{} ***/ $_mAttributes = null;
+    protected /*** XoopsDatabase ***/ $_mDB = null;
+    protected /*** int{} ***/ $_mLearnedSkill = array();
+    
+    /**
+     * __construct
+     * 
+     * @param   void
+     * 
+     * @return  voud
+    **/
+    public function __construct()
+    {
+        parent::__construct();
+        
+        $root =& XCube_Root::getSingleton();
+        $this->_mAttributes =& $root->mContext->mAttributes;
+        $this->_mDB =& $root->mController->mDB;
+    }
+    
+    /**
+     * reset
+     * 
+     * @param   int                     $id
+     * @param   Sd2nd_AbstractExecute   &$execute
+     * @param   string                  $line
+     * 
+     * @return  void
+    **/
+    public function reset(/*** int ***/ $id,Sd2nd_AbstractExecute &$execute,/*** string ***/ $line)
+    {
+        parent::reset($id,$execute,$line);
+        
+        $this->_mLearnedSkill = array();
+        if(!$res = $this->_mDB->query('select `skill_id` from `' . Sd2nd_UpdateUtils::convertTableName(Sd2nd_AssetManager::HANDLER_LEARNED_SKILL) . '` where `eno` = ' . intval($this->_mActiveId)))
+        {
+            throw new Sd2nd_QueryException('LearnedSkill data is not readable.');
+        }
+        
+        while($row = $this->_mDB->fetchArray($res))
+        {
+            $this->_mLearnedSkill[$row['skill_id']] = $row['skill_id'];
+        }
+    }
+    
+    /**
+     * executeLatest
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function executeLatest()
+    {
+        $arr = Sd2nd_UpdateUtils::parseByRegex($this->_mLine,"/TableData_Set\((?P<skill_id>\d+),'(?P<skill_name>[^']+)','(?P<description>[^']*)',(?P<range>[^,]+),'(?P<target>[^']+)',(?P<point>'?[\d,]+'?),(?P<element>'?[\-\d,]+'?),'(?P<kind>[^']+)',(?P<tp>\d+)\)/");
+        if(!isset($this->_mLearnedSkill[$arr['skill_id']]))
+        {
+            $this->_registLearnedSkill($arr);
+        }
+    }
+    
+    /**
+     * _registLearnedSkill
+     * 
+     * @param   mixed{} $param
+     * 
+     * @return  void
+    **/
+    protected function _registLearnedSkill(/*** mixed{} ***/ $param)
+    {
+        if(!isset($this->_mAttributes['sd2nd.skill'][$param['skill_name']]))
+        {
+            $this->_registSkill($param);
+        }
+        $obj =& Sd2nd_UpdateUtils::createObject(Sd2nd_AssetManager::HANDLER_LEARNED_SKILL);
+        $obj->setVars(array('eno' => $this->_mActiveId,'skill_id' => $param['skill_id'],'regist_time' => $this->_mUpdateTime));
+        Sd2nd_UpdateUtils::insertObject(Sd2nd_AssetManager::HANDLER_LEARNED_SKILL,$obj);
+    }
+    
+    /**
+     * _registSkill
+     * 
+     * @param   mixed{} $param
+     * 
+     * @return  void
+    **/
+    protected function _registSkill(/*** mixed{} ***/ $param)
+    {
+        if(!isset($this->_mAttributes['sd2nd.target'][$param['target']]))
+        {
+            $this->_registTarget($param['target'],trim($param['point'],"'"));
+        }
+        if(!isset($this->_mAttributes['sd2nd.kind'][$param['kind']]))
+        {
+            $this->_registKind($param['kind']);
+        }
+        $this->_mAttributes['sd2nd.skill'][$param['skill_name']] = $param['skill_id'];
+        $skill =& Sd2nd_UpdateUtils::createObject(Sd2nd_AssetManager::HANDLER_SKILL);
+        $skill->set('skill_id',$param['skill_id']);
+        $skill->set('skill_name',$param['skill_name']);
+        $skill->set('description',strtr($param['description'],array('<br>' => "\n")));
+        $skill->set('range',$param['range'] * 10);
+        $skill->set('target',$this->_mAttributes['sd2nd.target'][$param['target']]);
+        $skill->set('kind',$this->_mAttributes['sd2nd.kind'][$param['kind']]);
+        $skill->set('tp',$param['tp']);
+        $skill->set('regist_time',$this->_mUpdateTime);
+        Sd2nd_UpdateUtils::insertObject(Sd2nd_AssetManager::HANDLER_SKILL,$skill);
+        $this->_registSkillElement($param['skill_id'],explode(',',$param['element']));
+    }
+    
+    /**
+     * _registTarget
+     * 
+     * @param   string  $target
+     * @param   string  $point
+     * 
+     * @return  void
+    **/
+    protected function _registTarget(/*** string ***/ $target,/*** string ***/ $point)
+    {
+        $obj =& Sd2nd_UpdateUtils::createObject(Sd2nd_AssetManager::HANDLER_TARGET);
+        $obj->set('target_name',$target);
+        $obj->set('point',$point);
+        Sd2nd_UpdateUtils::insertObject(Sd2nd_AssetManager::HANDLER_TARGET,$obj);
+        $this->_mAttributes['sd2nd.target'][$target] = $obj->get('target_id');
+    }
+    
+    /**
+     * _registKind
+     * 
+     * @param   string  $kind
+     * 
+     * @return  void
+    **/
+    protected function _registKind(/*** string ***/ $kind)
+    {
+        $obj =& Sd2nd_UpdateUtils::createObject(Sd2nd_AssetManager::HANDLER_KIND);
+        $obj->set('kind_name',$kind);
+        Sd2nd_UpdateUtils::insertObject(Sd2nd_AssetManager::HANDLER_KIND,$obj);
+        $this->_mAttributes['sd2nd.kind'][$kind] = $obj->get('kind_id');
+    }
+    
+    /**
+     * _registSkillElement
+     * 
+     * @param   int     $id
+     * @param   int[]   $elements
+     * 
+     * @return  void
+    **/
+    protected function _registSkillElement(/*** int ***/ $id,/*** int[] ***/ $elements)
+    {
+        $obj =& Sd2nd_UpdateUtils::createObject(Sd2nd_AssetManager::HANDLER_SKILL_ELEMENT_LINK);
+        $obj->set('skill_id',$id);
+        foreach($elements as $e)
+        {
+            $obj->set('element',$e);
+            Sd2nd_UpdateUtils::insertObject(Sd2nd_AssetManager::HANDLER_SKILL_ELEMENT_LINK,$obj);
+        }
+    }
+}
+
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/prepare/AbilityList.class.php b/trust_path/modules/sd2nd/class/updater/prepare/AbilityList.class.php
new file mode 100644 (file)
index 0000000..b141bca
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+/**
+ * @class   Sd2nd_AbilityListPrepare
+**/
+class Sd2nd_AbilityListPrepare extends Sd2nd_AbstractFilter
+{
+    /**
+     * getPriority
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    public function getPriority()
+    {
+        return XCUBE_DELEGATE_PRIORITY_FINAL;
+    }
+    
+    /**
+     * executeLatest
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function executeLatest()
+    {
+        $root =& XCube_Root::getSingleton();
+        $db =& $root->mController->mDB;
+        $arr = array();
+        
+        if(!$res = $db->query('select `ability_id`,`ability_name` from `' . Sd2nd_UpdateUtils::convertTableName(Sd2nd_AssetManager::HANDLER_ABILITY) . '`'))
+        {
+            throw new Sd2nd_QueryException('Ability data is not readable.');
+        }
+        
+        while($row = $db->fetchArray($res))
+        {
+            $arr[$row['ability_name']] = $row['ability_id'];
+        }
+        
+        $root->mContext->setAttribute('sd2nd.ability',$arr);
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/prepare/CostumeList.class.php b/trust_path/modules/sd2nd/class/updater/prepare/CostumeList.class.php
new file mode 100644 (file)
index 0000000..a26cc79
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+/**
+ * @class   Sd2nd_CostumeListPrepare
+**/
+class Sd2nd_CostumeListPrepare extends Sd2nd_AbstractFilter
+{
+    /**
+     * getPriority
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    public function getPriority()
+    {
+        return XCUBE_DELEGATE_PRIORITY_FINAL;
+    }
+    
+    /**
+     * executeLatest
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function executeLatest()
+    {
+        $root =& XCube_Root::getSingleton();
+        $db =& $root->mController->mDB;
+        $arr = array();
+        
+        if(!$res = $db->query('select `costume_id`,`costume_name` from `' . Sd2nd_UpdateUtils::convertTableName(Sd2nd_AssetManager::HANDLER_COSTUME) . '`'))
+        {
+            throw new Sd2nd_QueryException('Costume data is not readable.');
+        }
+        
+        while($row = $db->fetchArray($res))
+        {
+            $arr[$row['costume_name']] = $row['costume_id'];
+        }
+        
+        $root->mContext->setAttribute('sd2nd.costume',$arr);
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/prepare/DataConvert.class.php b/trust_path/modules/sd2nd/class/updater/prepare/DataConvert.class.php
new file mode 100644 (file)
index 0000000..4ce81c7
--- /dev/null
@@ -0,0 +1,216 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+/**
+ * @class   Sd2nd_DataConvertPrepare
+**/
+class Sd2nd_DataConvertPrepare extends Sd2nd_AbstractFilter
+{
+    const BASE_SPOT_WORLD = 3;
+    const BASE_SPOT_TUNNEL = 33;
+    
+    /**
+     * getPriority
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    public function getPriority()
+    {
+        return XCUBE_DELEGATE_PRIORITY_2;
+    }
+    
+    /**
+     * prepare
+     * 
+     * @param   int $updateTime
+     * 
+     * @return  void
+    **/
+    public function prepare(/*** int ***/ $updateTime)
+    {
+        $class = new ReflectionClass($this);
+        $methods = $class->getMethods();
+        usort($methods,array('Sd2nd_AbstractProcess','compareMethodName'));
+        
+        foreach($methods as $method)
+        {
+            if($method->name == 'execute' . $updateTime)
+            {
+                $this->_mFunc = $method;
+                break;
+            }
+        }
+        
+        if(!$this->_mFunc instanceof ReflectionMethod)
+        {
+            $this->_mFunc = new ReflectionMethod($this,'executeLatest');
+        }
+    }
+    
+    /**
+     * executeLatest
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function executeLatest()
+    {
+    }
+    
+    /**
+     * execute090415
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function execute090415()
+    {
+        $obj =& Sd2nd_UpdateUtils::createObject(Sd2nd_AssetManager::HANDLER_MAP_NAME);
+        $obj->setVars(
+            array(
+                'map_id' => 3,
+                'map_name' => _MD_SD2ND_MAP_NAME_TUNNEL_B1F,
+                'base_spot' => 0
+            )
+        );
+        Sd2nd_UpdateUtils::insertObject(Sd2nd_AssetManager::HANDLER_MAP_NAME,$obj);
+    }
+    
+    /**
+     * execute090214
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function execute090214()
+    {
+        $handler =& Sd2nd_UpdateUtils::getHandler(Sd2nd_AssetManager::HANDLER_MAP_NAME);
+        $obj =& $handler->create();
+        $obj->setVars(
+            array(
+                'map_id' => 2,
+                'map_name' => _MD_SD2ND_MAP_NAME_TUNNEL,
+                'base_spot' => self::BASE_SPOT_TUNNEL
+            )
+        );
+        /// @ todo backup convert
+        $handler->db->queryF('UPDATE `' . Sd2nd_UpdateUtils::getHandler(Sd2nd_AssetManager::HANDLER_MAP)->mTable . '` SET `map_id` = 1');
+        $handler->db->queryF('UPDATE `' . Sd2nd_UpdateUtils::getHandler(Sd2nd_AssetManager::HANDLER_MAP_CACHE)->mTable . '` SET `map_id` = 1');
+    }
+    
+    /**
+     * execute090121
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function execute090121()
+    {
+        $cri = new Criteria('skill_id',456);
+        Sd2nd_UpdateUtils::deleteMultiObjects(Sd2nd_AssetManager::HANDLER_SKILL,$cri);
+        Sd2nd_UpdateUtils::deleteMultiObjects(Sd2nd_AssetManager::HANDLER_SKILL_ELEMENT_LINK,$cri);
+    }
+    
+    /**
+     * execute090117
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function execute090117()
+    {
+        $cri = new Criteria('skill_id',456);
+        Sd2nd_UpdateUtils::deleteMultiObjects(Sd2nd_AssetManager::HANDLER_SKILL,$cri);
+        Sd2nd_UpdateUtils::deleteMultiObjects(Sd2nd_AssetManager::HANDLER_SKILL_ELEMENT_LINK,$cri);
+    }
+    
+    /**
+     * execute081004
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function execute081004()
+    {
+        $cri = new CriteriaCompo();
+        $cri->add(new Criteria('skill_id',807));
+        Sd2nd_UpdateUtils::deleteMultiObjects(Sd2nd_AssetManager::HANDLER_SKILL,$cri);
+        Sd2nd_UpdateUtils::deleteMultiObjects(Sd2nd_AssetManager::HANDLER_SKILL_ELEMENT_LINK,$cri);
+    }
+    
+    /**
+     * execute080903
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function execute080903()
+    {
+        $cri = new CriteriaCompo();
+        $cri->add(new Criteria('ability_id',1,'>='));
+        $cri->add(new Criteria('ability_id',5,'<='));
+        Sd2nd_UpdateUtils::deleteMultiObjects(Sd2nd_AssetManager::HANDLER_ABILITY,$cri);
+    }
+    
+    /**
+     * execute080625
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function execute080625()
+    {
+        $cri = new Criteria('ability_id',1220);
+        Sd2nd_UpdateUtils::deleteMultiObjects(Sd2nd_AssetManager::HANDLER_ABILITY,$cri);
+    }
+    
+    /**
+     * execute080524
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function execute080524()
+    {
+        $handler =& Sd2nd_UpdateUtils::getHandler(Sd2nd_AssetManager::HANDLER_MAP_NAME);
+        $obj =& $handler->create();
+        $obj->setVars(
+            array(
+                'map_id' => 1,
+                'map_name' => _MD_SD2ND_MAP_NAME_WORLD,
+                'base_spot' => self::BASE_SPOT_WORLD
+            )
+        );
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/prepare/KindList.class.php b/trust_path/modules/sd2nd/class/updater/prepare/KindList.class.php
new file mode 100644 (file)
index 0000000..6cf3016
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+/**
+ * @class   Sd2nd_KindListPrepare
+**/
+class Sd2nd_KindListPrepare extends Sd2nd_AbstractFilter
+{
+    /**
+     * getPriority
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    public function getPriority()
+    {
+        return XCUBE_DELEGATE_PRIORITY_FINAL;
+    }
+    
+    /**
+     * executeLatest
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function executeLatest()
+    {
+        $root =& XCube_Root::getSingleton();
+        $db =& $root->mController->mDB;
+        $arr = array();
+        
+        if(!$res = $db->query('select `kind_id`,`kind_name` from `' . Sd2nd_UpdateUtils::convertTableName(Sd2nd_AssetManager::HANDLER_KIND) . '`'))
+        {
+            throw new Sd2nd_QueryException('Kind data is not readable.');
+        }
+        
+        while($row = $db->fetchArray($res))
+        {
+            $arr[$row['kind_name']] = $row['kind_id'];
+        }
+        
+        $root->mContext->setAttribute('sd2nd.kind',$arr);
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/prepare/MapCollection.class.php b/trust_path/modules/sd2nd/class/updater/prepare/MapCollection.class.php
new file mode 100644 (file)
index 0000000..e69066e
--- /dev/null
@@ -0,0 +1,71 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+/**
+ * @class   Sd2nd_MapCollectionPrepare
+**/
+class Sd2nd_MapCollectionPrepare extends Sd2nd_AbstractFilter
+{
+    /**
+     * getPriority
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    public function getPriority()
+    {
+        return XCUBE_DELEGATE_PRIORITY_FINAL;
+    }
+    
+    /**
+     * executeLatest
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function executeLatest()
+    {
+        $attr =& XCube_Root::getSingleton()->mContext->mAttributes;
+        $attr['sd2nd.mapName'] = array();
+        $attr['sd2nd.mapCollection'] = array();
+        $mapHandler =& Sd2nd_UpdateUtils::getHandler(Sd2nd_AssetManager::HANDLER_MAP);
+        $update = Sd2nd_UpdateUtils::getHandler(Sd2nd_AssetManager::HANDLER_UPDATE)->getLatestUpdate();
+        foreach(Sd2nd_UpdateUtils::getHandler(Sd2nd_AssetManager::HANDLER_MAP_NAME)->getObjects() as $name)
+        {
+            $attr['sd2nd.mapName'][$name->get('map_name')] = $name;
+            $attr['sd2nd.mapCollection'][$name->get('map_name')] = $mapHandler->getCollection(SD2ND_UPDATE_TIME,$update->get('update_time'),$name->get('map_id'));
+        }
+    }
+    
+    /**
+     * execute090211
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function execute090211()
+    {
+        $update = Sd2nd_UpdateUtils::getHandler(Sd2nd_AssetManager::HANDLER_UPDATE)->getLatestUpdate();
+        if($update == null)
+        {
+            $update = SD2ND_UPDATE_TIME;
+        }
+        XCube_Root::getSingleton()->mContext->setAttribute('sd2nd.mapCollection',Sd2nd_UpdateUtils::getHandler(Sd2nd_AssetManager::HANDLER_MAP)->getCollection(SD2ND_UPDATE_TIME,$update->get('update_time')));
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/prepare/RaceList.class.php b/trust_path/modules/sd2nd/class/updater/prepare/RaceList.class.php
new file mode 100644 (file)
index 0000000..4e498f4
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+/**
+ * @class   Sd2nd_RaceListPrepare
+**/
+class Sd2nd_RaceListPrepare extends Sd2nd_AbstractFilter
+{
+    /**
+     * getPriority
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    public function getPriority()
+    {
+        return XCUBE_DELEGATE_PRIORITY_FINAL;
+    }
+    
+    /**
+     * executeLatest
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function executeLatest()
+    {
+        $root =& XCube_Root::getSingleton();
+        $db =& $root->mController->mDB;
+        $arr = array();
+        
+        if(!$res = $db->query('select `race_id`,`race_name` from `' . Sd2nd_UpdateUtils::convertTableName(Sd2nd_AssetManager::HANDLER_RACE) . '`'))
+        {
+            throw new Sd2nd_QueryException('Race data is not readable.');
+        }
+        
+        while($row = $db->fetchArray($res))
+        {
+            $arr[$row['race_name']] = $row['race_id'];
+        }
+        
+        $root->mContext->setAttribute('sd2nd.race',$arr);
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/prepare/RefleshTable.class.php b/trust_path/modules/sd2nd/class/updater/prepare/RefleshTable.class.php
new file mode 100644 (file)
index 0000000..7d75d95
--- /dev/null
@@ -0,0 +1,152 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+/**
+ * @class   Sd2nd_RefleshTablePrepare
+**/
+class Sd2nd_RefleshTablePrepare extends Sd2nd_AbstractFilter
+{
+    protected /*** Enum[] ***/ $_mRegistTableName = array();
+    protected /*** Enum[] ***/ $_mUpdateTableName = array();
+    protected /*** Enum[] ***/ $_mTruncateTableName = array();
+    
+    /**
+     * getPriority
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    public function getPriority()
+    {
+        return XCUBE_DELEGATE_PRIORITY_9;
+    }
+    
+    /**
+     * _reflesh
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_QueryException
+    **/
+    protected function _reflesh()
+    {
+        $root =& XCube_Root::getSingleton();
+        $db =& $root->mController->mDB;
+        
+        $arr = array_map(array('Sd2nd_UpdateUtils','convertTableName'),$this->_mRegistTableName);
+        foreach($arr as $table)
+        {
+            if(!$db->queryF('delete from `' . $table . '` where `regist_time` >= ' . SD2ND_UPDATE_TIME))
+            {
+                throw new Sd2nd_QueryException('Table "' . $table . '" cannot reflesh.');
+            }
+        }
+        
+        $arr = array_map(array('Sd2nd_UpdateUtils','convertTableName'),$this->_mUpdateTableName);
+        foreach($arr as $table)
+        {
+            if(!$db->queryF('delete from `' . $table .'` where `update_time` >= ' . SD2ND_UPDATE_TIME))
+            {
+                throw new Sd2nd_QueryException('Table "' . $table . '" cannot reflesh.');
+            }
+        }
+        
+        $arr = array_map(array('Sd2nd_UpdateUtils','convertTableName'),$this->_mTruncateTableName);
+        foreach($arr as $table)
+        {
+            if(!$db->queryF('truncate `' . $table . '`'))
+            {
+                throw new Sd2nd_QueryException('Table "' . $table . '" cannot truncate.');
+            }
+        }
+    }
+    
+    /**
+     * executeLatest
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function executeLatest()
+    {
+        /*
+            Sd2nd_AssetManager::HANDLER_SKILL_ELEMENT_LINK,
+        */
+        $this->_mRegistTableName = array(
+            Sd2nd_AssetManager::HANDLER_ABILITY,
+            Sd2nd_AssetManager::HANDLER_COSTUME,
+            Sd2nd_AssetManager::HANDLER_ENO_PNO_LINK,
+            Sd2nd_AssetManager::HANDLER_LEARNED_ABILITY,
+            Sd2nd_AssetManager::HANDLER_LEARNED_COSTUME,
+            Sd2nd_AssetManager::HANDLER_LEARNED_SKILL,
+            Sd2nd_AssetManager::HANDLER_MAP_SPOT,
+            Sd2nd_AssetManager::HANDLER_SKILL
+        );
+        
+        $this->_mUpdateTableName = array(
+            Sd2nd_AssetManager::HANDLER_ICON,
+            Sd2nd_AssetManager::HANDLER_IMAGE,
+            Sd2nd_AssetManager::HANDLER_MAP,
+            Sd2nd_AssetManager::HANDLER_MAP_CACHE,
+            Sd2nd_AssetManager::HANDLER_UPDATE
+        );
+        
+        $this->_mTruncateTableName = array(
+            Sd2nd_AssetManager::HANDLER_ACTIVE_ABILITY,
+            Sd2nd_AssetManager::HANDLER_CHAR,
+            Sd2nd_AssetManager::HANDLER_STATUS
+        );
+        
+        $this->_reflesh();
+    }
+    
+    /**
+     * execute080524
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function execute080524()
+    {
+        $this->_mTruncateTableName = array(
+            Sd2nd_AssetManager::HANDLER_ABILITY,
+            Sd2nd_AssetManager::HANDLER_ACTIVE_ABILITY,
+            Sd2nd_AssetManager::HANDLER_CHAR,
+            Sd2nd_AssetManager::HANDLER_COSTUME,
+            Sd2nd_AssetManager::HANDLER_ENO_PNO_LINK,
+            Sd2nd_AssetManager::HANDLER_ICON,
+            Sd2nd_AssetManager::HANDLER_IMAGE,
+            Sd2nd_AssetManager::HANDLER_LEARNED_ABILITY,
+            Sd2nd_AssetManager::HANDLER_LEARNED_COSTUME,
+            Sd2nd_AssetManager::HANDLER_LEARNED_SKILL,
+            Sd2nd_AssetManager::HANDLER_MAP,
+            Sd2nd_AssetManager::HANDLER_MAP_CACHE,
+            Sd2nd_AssetManager::HANDLER_MAP_SPOT,
+            Sd2nd_AssetManager::HANDLER_RACE,
+            Sd2nd_AssetManager::HANDLER_SKILL,
+            Sd2nd_AssetManager::HANDLER_SKILL_ELEMENT_LINK,
+            Sd2nd_AssetManager::HANDLER_STATUS,
+            Sd2nd_AssetManager::HANDLER_TARGET,
+            Sd2nd_AssetManager::HANDLER_UPDATE
+        );
+        
+        $this->_reflesh();
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/prepare/Setup.class.php b/trust_path/modules/sd2nd/class/updater/prepare/Setup.class.php
new file mode 100644 (file)
index 0000000..3984d0c
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+define('SD2ND_RESULT_ENCODING','SJIS');
+define('SD2ND_ECHO_ENCODING','SJIS');
+// define('SD2ND_DATABASE_ENCODING','ujis');
+define('SD2ND_DATABASE_ENCODING','utf8');
+
+define('SD2ND_EXTRACTION_PATTERN','/(?P<name>[a-zA-Z]+)(?P<id>\d*)\.html?$/');
+
+/**
+ * @class   Sd2nd_SetupPrepare
+**/
+class Sd2nd_SetupPrepare extends Sd2nd_AbstractFilter
+{
+    /**
+     * getPriority
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    public function getPriority()
+    {
+        return XCUBE_DELEGATE_PRIORITY_FIRST;
+    }
+    
+    /**
+     * executeLatest
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd_Exception
+    **/
+    public function executeLatest()
+    {
+        $root =& XCube_Root::getSingleton();
+        if(!mysql_set_charset(SD2ND_DATABASE_ENCODING,$root->mController->mDB->conn))
+        {
+            throw new Sd2nd_QueryException('set charset "' .  SD2ND_DATABASE_ENCODING. '" is not valid.');
+        }
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/prepare/SkillList.class.php b/trust_path/modules/sd2nd/class/updater/prepare/SkillList.class.php
new file mode 100644 (file)
index 0000000..db6e9af
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+/**
+ * @class   Sd2nd_SkillListPrepare
+**/
+class Sd2nd_SkillListPrepare extends Sd2nd_AbstractFilter
+{
+    /**
+     * getPriority
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    public function getPriority()
+    {
+        return XCUBE_DELEGATE_PRIORITY_FINAL;
+    }
+    
+    /**
+     * executeLatest
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function executeLatest()
+    {
+        $root =& XCube_Root::getSingleton();
+        $db =& $root->mController->mDB;
+        $arr = array();
+        
+        if(!$res = $db->query('select `skill_id`,`skill_name` from `' . Sd2nd_UpdateUtils::convertTableName(Sd2nd_AssetManager::HANDLER_SKILL) . '`'))
+        {
+            throw new Sd2nd_QueryException('Skill data is not readable.');
+        }
+        
+        while($row = $db->fetchArray($res))
+        {
+            $arr[$row['skill_name']] = $row['skill_id'];
+        }
+        
+        $root->mContext->setAttribute('sd2nd.skill',$arr);
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/prepare/SpotList.class.php b/trust_path/modules/sd2nd/class/updater/prepare/SpotList.class.php
new file mode 100644 (file)
index 0000000..69236df
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+/**
+ * @class   Sd2nd_SpotListPrepare
+**/
+class Sd2nd_SpotListPrepare extends Sd2nd_AbstractFilter
+{
+    /**
+     * getPriority
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    public function getPriority()
+    {
+        return XCUBE_DELEGATE_PRIORITY_FINAL;
+    }
+    
+    /**
+     * executeLatest
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function executeLatest()
+    {
+        $root =& XCube_Root::getSingleton();
+        $db =& $root->mController->mDB;
+        $arr = array();
+        
+        if(!$res = $db->query('select `spot_id`,`spot_name` from `' . Sd2nd_UpdateUtils::convertTableName(Sd2nd_AssetManager::HANDLER_MAP_SPOT) . '`'))
+        {
+            throw new Sd2nd_QueryException('MapSpot data is not readable.');
+        }
+        
+        while($row = $db->fetchArray($res))
+        {
+            $arr[$row['spot_name']] = $row['spot_id'];
+        }
+        
+        $root->mContext->setAttribute('sd2nd.spot',$arr);
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/class/updater/prepare/TargetList.class.php b/trust_path/modules/sd2nd/class/updater/prepare/TargetList.class.php
new file mode 100644 (file)
index 0000000..5f5ff78
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit();
+}
+
+/**
+ * @class   Sd2nd_TargetListPrepare
+**/
+class Sd2nd_TargetListPrepare extends Sd2nd_AbstractFilter
+{
+    /**
+     * getPriority
+     * 
+     * @param   void
+     * 
+     * @return  Enum
+    **/
+    public function getPriority()
+    {
+        return XCUBE_DELEGATE_PRIORITY_FINAL;
+    }
+    
+    /**
+     * executeLatest
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * @throw   Sd2nd_Exception
+    **/
+    public function executeLatest()
+    {
+        $root =& XCube_Root::getSingleton();
+        $db =& $root->mController->mDB;
+        $arr = array();
+        
+        if(!$res = $db->query('select `target_id`,`target_name` from `' . Sd2nd_UpdateUtils::convertTableName(Sd2nd_AssetManager::HANDLER_TARGET) . '`'))
+        {
+            throw new Sd2nd_QueryException('Target data is not readable.');
+        }
+        
+        while($row = $db->fetchArray($res))
+        {
+            $arr[$row['target_name']] = $row['target_id'];
+        }
+        
+        $root->mContext->setAttribute('sd2nd.target',$arr);
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/forms/AbilityFilterForm.class.php b/trust_path/modules/sd2nd/forms/AbilityFilterForm.class.php
new file mode 100644 (file)
index 0000000..6417238
--- /dev/null
@@ -0,0 +1,83 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+require_once SD2ND_TRUST_PATH . '/class/AbstractFilterForm.class.php';
+
+define('SD2ND_ABILITY_SORT_KEY_ABILITY_ID', 1);
+define('SD2ND_ABILITY_SORT_KEY_ABILITY_NAME', 2);
+define('SD2ND_ABILITY_SORT_KEY_DESCRIPTION', 3);
+define('SD2ND_ABILITY_SORT_KEY_ABILITY_COST', 4);
+define('SD2ND_ABILITY_SORT_KEY_REGIST_TIME', 5);
+define('SD2ND_ABILITY_SORT_KEY_DEFAULT', SD2ND_ABILITY_SORT_KEY_ABILITY_ID);
+
+/**
+ * Sd2nd_AbilityFilterForm
+**/
+class Sd2nd_AbilityFilterForm extends Sd2nd_AbstractFilterForm
+{
+    /**
+     * @var  string[]
+     * 
+     * @public
+    **/
+    var $mSortKeys = array(
+        SD2ND_ABILITY_SORT_KEY_ABILITY_ID => 'ability_id',
+        SD2ND_ABILITY_SORT_KEY_ABILITY_NAME => 'ability_name',
+        SD2ND_ABILITY_SORT_KEY_DESCRIPTION => 'description',
+        SD2ND_ABILITY_SORT_KEY_ABILITY_COST => 'ability_cost',
+        SD2ND_ABILITY_SORT_KEY_REGIST_TIME => 'regist_time'
+    );
+
+    /**
+     * getDefaultSortKey
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function getDefaultSortKey()
+    {
+        return SD2ND_ABILITY_SORT_KEY_DEFAULT;
+    }
+
+    /**
+     * fetch
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function fetch()
+    {
+        parent::fetch();
+    
+        $request =& XCube_Root::getSingleton()->mContext->mRequest;
+    
+        if (($value = $request->getRequest('regist_time')) != null) {
+            $this->_mCriteria->add(new Criteria('regist_time', $value));
+        }
+        $this->mNavi->addExtra('regist_time', $value);
+    
+        if (ctype_digit($value = $request->getRequest('ability_cost'))) {
+            $this->_mCriteria->add(new Criteria('ability_cost', $value));
+        }
+        else
+        {
+            $value = null;
+        }
+        $this->mNavi->addExtra('ability_cost', $value);
+    
+        $this->_mCriteria->addSort($this->getSort(), $this->getOrder());
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/forms/ActiveAbilityFilterForm.class.php b/trust_path/modules/sd2nd/forms/ActiveAbilityFilterForm.class.php
new file mode 100644 (file)
index 0000000..349070e
--- /dev/null
@@ -0,0 +1,76 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+require_once SD2ND_TRUST_PATH . '/class/AbstractFilterForm.class.php';
+
+/**
+ * Sd2nd_ActiveAbilityFilterForm
+**/
+class Sd2nd_ActiveAbilityFilterForm extends Sd2nd_AbstractFilterForm
+{
+    /**
+     * getTotalItems
+     * 
+     * @param   int  &$total
+     * 
+     * @return  void
+     * 
+     * @protected
+    **/
+    function getTotalItems(&$total)
+    {
+        $total = $this->_mHandler->getActiveAbilityCount($this->getCriteria());
+    }
+
+    /**
+     * fetch
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * 
+     * @public
+    **/
+    function fetch()
+    {
+        $this->mNavi->fetch();
+    
+        $root =& XCube_Root::getSingleton();
+    
+        if (($value = $root->mContext->mRequest->getRequest('eno')) !== null) {
+            $this->mNavi->addExtra('eno', $value);
+            $this->_mCriteria->add(new Criteria('eno', $value));
+        }
+    
+        if (($value = $root->mContext->mRequest->getRequest('ability_name')) !== null) {
+            $ext = array();
+            foreach(explode(' ',mb_convert_kana($value,'as')) as $v)
+            {
+                if($v != null)
+                {
+                    $ext[] = $v;
+                    $this->_mCriteria->add(new Criteria('ability_name',$v));
+                }
+            }
+            $this->mNavi->addExtra('ability_name',implode(' ',$ext));
+        }
+    
+        if(!$this->_mCriteria->hasChildElements())
+        {
+            $this->_mCriteria->add(new Criteria('ability_name','dummy'));
+        }
+    
+        $this->_mCriteria->addSort('`c`.`eno`', 'ASC');
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/forms/CostumeFilterForm.class.php b/trust_path/modules/sd2nd/forms/CostumeFilterForm.class.php
new file mode 100644 (file)
index 0000000..70bfb6a
--- /dev/null
@@ -0,0 +1,104 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+require_once SD2ND_TRUST_PATH . '/class/AbstractFilterForm.class.php';
+
+define('SD2ND_COSTUME_SORT_KEY_COSTUME_ID', 1);
+define('SD2ND_COSTUME_SORT_KEY_COSTUME_NAME', 2);
+define('SD2ND_COSTUME_SORT_KEY_GROW_LIFE', 3);
+define('SD2ND_COSTUME_SORT_KEY_GROW_SOUL', 4);
+define('SD2ND_COSTUME_SORT_KEY_GROW_POW', 5);
+define('SD2ND_COSTUME_SORT_KEY_GROW_STR', 6);
+define('SD2ND_COSTUME_SORT_KEY_GROW_DEX', 7);
+define('SD2ND_COSTUME_SORT_KEY_GROW_SPEED', 8);
+define('SD2ND_COSTUME_SORT_KEY_GROW_MAG', 9);
+define('SD2ND_COSTUME_SORT_KEY_GROW_REG', 10);
+define('SD2ND_COSTUME_SORT_KEY_GROW_CON', 11);
+define('SD2ND_COSTUME_SORT_KEY_MODIFY_HP', 12);
+define('SD2ND_COSTUME_SORT_KEY_MODIFY_TP', 13);
+define('SD2ND_COSTUME_SORT_KEY_MODIFY_AT', 14);
+define('SD2ND_COSTUME_SORT_KEY_MODIFY_DF', 15);
+define('SD2ND_COSTUME_SORT_KEY_MODIFY_MAT', 16);
+define('SD2ND_COSTUME_SORT_KEY_MODIFY_MDF', 17);
+define('SD2ND_COSTUME_SORT_KEY_MODIFY_ACT', 18);
+define('SD2ND_COSTUME_SORT_KEY_MOVE_COST', 19);
+define('SD2ND_COSTUME_SORT_KEY_REGIST_TIME', 20);
+define('SD2ND_COSTUME_SORT_KEY_DEFAULT', SD2ND_COSTUME_SORT_KEY_COSTUME_ID);
+
+/**
+ * Sd2nd_CostumeFilterForm
+**/
+class Sd2nd_CostumeFilterForm extends Sd2nd_AbstractFilterForm
+{
+    /**
+     * @var  string[]
+     * 
+     * @public
+    **/
+    var $mSortKeys = array(
+        SD2ND_COSTUME_SORT_KEY_COSTUME_ID => 'costume_id',
+        SD2ND_COSTUME_SORT_KEY_COSTUME_NAME => 'costume_name',
+        SD2ND_COSTUME_SORT_KEY_GROW_LIFE => 'grow_life',
+        SD2ND_COSTUME_SORT_KEY_GROW_SOUL => 'grow_soul',
+        SD2ND_COSTUME_SORT_KEY_GROW_POW => 'grow_pow',
+        SD2ND_COSTUME_SORT_KEY_GROW_STR => 'grow_str',
+        SD2ND_COSTUME_SORT_KEY_GROW_DEX => 'grow_dex',
+        SD2ND_COSTUME_SORT_KEY_GROW_SPEED => 'grow_speed',
+        SD2ND_COSTUME_SORT_KEY_GROW_MAG => 'grow_mag',
+        SD2ND_COSTUME_SORT_KEY_GROW_REG => 'grow_reg',
+        SD2ND_COSTUME_SORT_KEY_GROW_CON => 'grow_con',
+        SD2ND_COSTUME_SORT_KEY_MODIFY_HP => 'modify_hp',
+        SD2ND_COSTUME_SORT_KEY_MODIFY_TP => 'modify_tp',
+        SD2ND_COSTUME_SORT_KEY_MODIFY_AT => 'modify_at',
+        SD2ND_COSTUME_SORT_KEY_MODIFY_DF => 'modify_df',
+        SD2ND_COSTUME_SORT_KEY_MODIFY_MAT => 'modify_mat',
+        SD2ND_COSTUME_SORT_KEY_MODIFY_MDF => 'modify_mdf',
+        SD2ND_COSTUME_SORT_KEY_MODIFY_ACT => 'modify_act',
+        SD2ND_COSTUME_SORT_KEY_MOVE_COST => 'move_cost',
+        SD2ND_COSTUME_SORT_KEY_REGIST_TIME => 'regist_time'
+    );
+
+    /**
+     * getDefaultSortKey
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function getDefaultSortKey()
+    {
+        return SD2ND_COSTUME_SORT_KEY_DEFAULT;
+    }
+
+    /**
+     * fetch
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function fetch()
+    {
+        parent::fetch();
+    
+        $root =& XCube_Root::getSingleton();
+    
+        if (($value = $root->mContext->mRequest->getRequest('regist_time')) != null) {
+            $this->_mCriteria->add(new Criteria('regist_time', $value));
+        }
+        $this->mNavi->addExtra('regist_time', $value);
+    
+        $this->_mCriteria->addSort($this->getSort(), $this->getOrder());
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/forms/LearnedAbilityFilterForm.class.php b/trust_path/modules/sd2nd/forms/LearnedAbilityFilterForm.class.php
new file mode 100644 (file)
index 0000000..606f896
--- /dev/null
@@ -0,0 +1,76 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+require_once SD2ND_TRUST_PATH . '/class/AbstractFilterForm.class.php';
+
+/**
+ * Sd2nd_LearnedAbilityFilterForm
+**/
+class Sd2nd_LearnedAbilityFilterForm extends Sd2nd_AbstractFilterForm
+{
+    /**
+     * getTotalItems
+     * 
+     * @param   int  &$total
+     * 
+     * @return  void
+     * 
+     * @protected
+    **/
+    function getTotalItems(&$total)
+    {
+        $total = $this->_mHandler->getLearnedAbilityCount($this->getCriteria());
+    }
+
+    /**
+     * fetch
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * 
+     * @public
+    **/
+    function fetch()
+    {
+        $this->mNavi->fetch();
+    
+        $root =& XCube_Root::getSingleton();
+    
+        if (($value = $root->mContext->mRequest->getRequest('eno')) !== null) {
+            $this->mNavi->addExtra('eno', $value);
+            $this->_mCriteria->add(new Criteria('eno', $value));
+        }
+    
+        if (($value = $root->mContext->mRequest->getRequest('ability_name')) !== null) {
+            $ext = array();
+            foreach(explode(' ',mb_convert_kana($value,'as')) as $v)
+            {
+                if($v != null)
+                {
+                    $ext[] = $v;
+                    $this->_mCriteria->add(new Criteria('ability_name',$v));
+                }
+            }
+            $this->mNavi->addExtra('ability_name',implode(' ',$ext));
+        }
+    
+        if(!$this->_mCriteria->hasChildElements())
+        {
+            $this->_mCriteria->add(new Criteria('ability_name','dummy'));
+        }
+    
+        $this->_mCriteria->addSort('`c`.`eno`', 'ASC');
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/forms/LearnedSkillFilterForm.class.php b/trust_path/modules/sd2nd/forms/LearnedSkillFilterForm.class.php
new file mode 100644 (file)
index 0000000..d617090
--- /dev/null
@@ -0,0 +1,76 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+require_once SD2ND_TRUST_PATH . '/class/AbstractFilterForm.class.php';
+
+/**
+ * Sd2nd_LearnedSkillFilterForm
+**/
+class Sd2nd_LearnedSkillFilterForm extends Sd2nd_AbstractFilterForm
+{
+    /**
+     * getTotalItems
+     * 
+     * @param   int  &$total
+     * 
+     * @return  void
+     * 
+     * @protected
+    **/
+    function getTotalItems(&$total)
+    {
+        $total = $this->_mHandler->getLearnedSkillCount($this->getCriteria());
+    }
+
+    /**
+     * fetch
+     * 
+     * @param   void
+     * 
+     * @return  void
+     * 
+     * @public
+    **/
+    function fetch()
+    {
+        $this->mNavi->fetch();
+    
+        $root =& XCube_Root::getSingleton();
+    
+        if (($value = $root->mContext->mRequest->getRequest('eno')) !== null) {
+            $this->mNavi->addExtra('eno', $value);
+            $this->_mCriteria->add(new Criteria('eno', $value));
+        }
+    
+        if (($value = $root->mContext->mRequest->getRequest('skill_name')) !== null) {
+            $ext = array();
+            foreach(explode(' ',mb_convert_kana($value,'as')) as $v)
+            {
+                if($v != null)
+                {
+                    $ext[] = $v;
+                    $this->_mCriteria->add(new Criteria('skill_name',$v));
+                }
+            }
+            $this->mNavi->addExtra('skill_name',implode(' ',$ext));
+        }
+    
+        if(!$this->_mCriteria->hasChildElements())
+        {
+            $this->_mCriteria->add(new Criteria('skill_name','dummy'));
+        }
+    
+        $this->_mCriteria->addSort('`c`.`eno`', 'ASC');
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/forms/SkillFilterForm.class.php b/trust_path/modules/sd2nd/forms/SkillFilterForm.class.php
new file mode 100644 (file)
index 0000000..2622548
--- /dev/null
@@ -0,0 +1,99 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+require_once SD2ND_TRUST_PATH . '/class/AbstractFilterForm.class.php';
+
+define('SD2ND_SKILL_SORT_KEY_SKILL_ID', 1);
+define('SD2ND_SKILL_SORT_KEY_SKILL_NAME', 2);
+define('SD2ND_SKILL_SORT_KEY_DESCRIPTION', 3);
+define('SD2ND_SKILL_SORT_KEY_RANGE', 4);
+define('SD2ND_SKILL_SORT_KEY_TARGET', 5);
+define('SD2ND_SKILL_SORT_KEY_KIND', 6);
+define('SD2ND_SKILL_SORT_KEY_TP', 7);
+define('SD2ND_SKILL_SORT_KEY_REGIST_TIME', 8);
+define('SD2ND_SKILL_SORT_KEY_DEFAULT', SD2ND_SKILL_SORT_KEY_SKILL_ID);
+
+/**
+ * Sd2nd_SkillFilterForm
+**/
+class Sd2nd_SkillFilterForm extends Sd2nd_AbstractFilterForm
+{
+    /**
+     * @var  string[]
+     * 
+     * @public
+    **/
+    var $mSortKeys = array(
+        SD2ND_SKILL_SORT_KEY_SKILL_ID => 'skill_id',
+        SD2ND_SKILL_SORT_KEY_SKILL_NAME => 'skill_name',
+        SD2ND_SKILL_SORT_KEY_DESCRIPTION => 'description',
+        SD2ND_SKILL_SORT_KEY_RANGE => 'range',
+        SD2ND_SKILL_SORT_KEY_TARGET => 'target',
+        SD2ND_SKILL_SORT_KEY_KIND => 'kind',
+        SD2ND_SKILL_SORT_KEY_TP => 'tp',
+        SD2ND_SKILL_SORT_KEY_REGIST_TIME => 'regist_time'
+    );
+
+    /**
+     * getDefaultSortKey
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function getDefaultSortKey()
+    {
+        return SD2ND_SKILL_SORT_KEY_DEFAULT;
+    }
+
+    /**
+     * fetch
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function fetch()
+    {
+        parent::fetch();
+    
+        $request =& XCube_Root::getSingleton()->mContext->mRequest;
+    
+        if (($value = $request->getRequest('regist_time')) != null) {
+            $this->_mCriteria->add(new Criteria('regist_time', $value));
+        }
+        $this->mNavi->addExtra('regist_time', $value);
+    
+        if (ctype_digit($value = $request->getRequest('range'))) {
+            $this->_mCriteria->add(new Criteria('range', $value));
+        }
+        else
+        {
+            $value = null;
+        }
+        $this->mNavi->addExtra('range', $value);
+    
+        if (($value = $request->getRequest('target')) != null) {
+            $this->_mCriteria->add(new Criteria('target', $value));
+        }
+        $this->mNavi->addExtra('target', $value);
+    
+        if (($value = $request->getRequest('kind')) != null) {
+            $this->_mCriteria->add(new Criteria('kind', $value));
+        }
+        $this->mNavi->addExtra('kind', $value);
+    
+        $this->_mCriteria->addSort($this->getSort(), $this->getOrder());
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/index.php b/trust_path/modules/sd2nd/index.php
new file mode 100644 (file)
index 0000000..cdf2ef5
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+/**
+ * @file
+ * @brief The page controller in the directory
+ * @package sd2nd
+ * @version $Id$
+**/
+
+require_once XOOPS_ROOT_PATH . '/header.php';
+
+$root =& XCube_Root::getSingleton();
+
+$root->mController->execute();
+
+require_once XOOPS_ROOT_PATH . '/footer.php';
+
+?>
diff --git a/trust_path/modules/sd2nd/language/english/admin.php b/trust_path/modules/sd2nd/language/english/admin.php
new file mode 100644 (file)
index 0000000..6d4a5b1
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+?>
diff --git a/trust_path/modules/sd2nd/language/english/help/delegate.html b/trust_path/modules/sd2nd/language/english/help/delegate.html
new file mode 100644 (file)
index 0000000..8b13be9
--- /dev/null
@@ -0,0 +1,37 @@
+<h4>Delegate List</h4>
+
+<h5>Module.sd2nd.Global.Event.GetAssetManager</h5>
+<dl>
+  <dt>Sd2nd_AssetManager</dt><dd>&$obj</dd>
+  <dt>string</dt><dd>$dirname</dd>
+</dl>
+
+<h5>Module.sd2nd.Global.Event.Exception.ActionNotFound</h5>
+<dl>
+  <dt>string</dt><dd>$dirname</dd>
+</dl>
+
+<h5>Module.{dirname}.Event.Exception.ActionNotFound</h5>
+<dl>
+  <dt>void</dt>
+</dl>
+
+<h5>Module.sd2nd.Global.Event.Exception.Preparation</h5>
+<dl>
+  <dt>string</dt><dd>$dirname</dd>
+</dl>
+
+<h5>Module.{dirname}.Event.Exception.Preparation</h5>
+<dl>
+  <dt>void</dt>
+</dl>
+
+<h5>Module.sd2nd.Global.Event.Exception.Permission</h5>
+<dl>
+  <dt>string</dt><dd>$dirname</dd>
+</dl>
+
+<h5>Module.{dirname}.Event.Exception.Permission</h5>
+<dl>
+  <dt>void</dt>
+</dl>
diff --git a/trust_path/modules/sd2nd/language/english/help/help.html b/trust_path/modules/sd2nd/language/english/help/help.html
new file mode 100644 (file)
index 0000000..794fd16
--- /dev/null
@@ -0,0 +1,4 @@
+<h4>Input the title here</h4>
+<h5>Summary</h5>
+<p>Even if the help is poor, some information shall help users. Try writing. Take it easy.</p>
+<h5><a href="<{"delegate.html"|helpurl}>">Delegate List</a></h5>
diff --git a/trust_path/modules/sd2nd/language/english/main.php b/trust_path/modules/sd2nd/language/english/main.php
new file mode 100644 (file)
index 0000000..a87e569
--- /dev/null
@@ -0,0 +1,93 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+define('_MD_SD2ND_INFO_ABILITY_LIST', "ABILITY_LIST");
+define('_MD_SD2ND_INFO_ACTIVE_ABILITY_LIST', "ACTIVE_ABILITY_LIST");
+define('_MD_SD2ND_INFO_COSTUME_LIST', "COSTUME_LIST");
+define('_MD_SD2ND_INFO_LEARNED_ABILITY_LIST', "LEARNED_ABILITY_LIST");
+define('_MD_SD2ND_INFO_LEARNED_SKILL_LIST', "LEARNED_SKILL_LIST");
+define('_MD_SD2ND_INFO_SKILL_LIST', "SKILL_LIST");
+define('_MD_SD2ND_LANG_ABILITY_LIST', "ABILITY_LIST");
+define('_MD_SD2ND_LANG_ACTIVE_ABILITY_LIST', "ACTIVE_ABILITY_LIST");
+define('_MD_SD2ND_LANG_AGE_UNIT', "AGE_UNIT");
+define('_MD_SD2ND_LANG_COSTUME_ID', "COSTUME_ID");
+define('_MD_SD2ND_LANG_COSTUME_LIST', "COSTUME_LIST");
+define('_MD_SD2ND_LANG_COSTUME_NAME', "COSTUME_NAME");
+define('_MD_SD2ND_LANG_DESC', "DESC");
+define('_MD_SD2ND_LANG_DIRECTION_EAST', "DIRECTION_EAST");
+define('_MD_SD2ND_LANG_DIRECTION_NORTH', "DIRECTION_NORTH");
+define('_MD_SD2ND_LANG_DIRECTION_SOUTH', "DIRECTION_SOUTH");
+define('_MD_SD2ND_LANG_DIRECTION_WEST', "DIRECTION_WEST");
+define('_MD_SD2ND_LANG_ELEMENT', "ELEMENT");
+define('_MD_SD2ND_LANG_ELEMENT_0', "ELEMENT_0");
+define('_MD_SD2ND_LANG_ELEMENT_1', "ELEMENT_1");
+define('_MD_SD2ND_LANG_ELEMENT_10', "ELEMENT_10");
+define('_MD_SD2ND_LANG_ELEMENT_11', "ELEMENT_11");
+define('_MD_SD2ND_LANG_ELEMENT_12', "ELEMENT_12");
+define('_MD_SD2ND_LANG_ELEMENT_2', "ELEMENT_2");
+define('_MD_SD2ND_LANG_ELEMENT_3', "ELEMENT_3");
+define('_MD_SD2ND_LANG_ELEMENT_4', "ELEMENT_4");
+define('_MD_SD2ND_LANG_ELEMENT_5', "ELEMENT_5");
+define('_MD_SD2ND_LANG_ELEMENT_6', "ELEMENT_6");
+define('_MD_SD2ND_LANG_ELEMENT_7', "ELEMENT_7");
+define('_MD_SD2ND_LANG_ELEMENT_8', "ELEMENT_8");
+define('_MD_SD2ND_LANG_ELEMENT_9', "ELEMENT_9");
+define('_MD_SD2ND_LANG_ELEMENT_EMPTY', "ELEMENT_EMPTY");
+define('_MD_SD2ND_LANG_ELEMENT_RANDOM', "ELEMENT_RANDOM");
+define('_MD_SD2ND_LANG_ELEMENT_UNDEFINED', "ELEMENT_UNDEFINED");
+define('_MD_SD2ND_LANG_FULL_NAME', "FULL_NAME");
+define('_MD_SD2ND_LANG_GENERAL', "GENERAL");
+define('_MD_SD2ND_LANG_GROW_CON', "GROW_CON");
+define('_MD_SD2ND_LANG_GROW_DEX', "GROW_DEX");
+define('_MD_SD2ND_LANG_GROW_LIFE', "GROW_LIFE");
+define('_MD_SD2ND_LANG_GROW_MAG', "GROW_MAG");
+define('_MD_SD2ND_LANG_GROW_POW', "GROW_POW");
+define('_MD_SD2ND_LANG_GROW_REG', "GROW_REG");
+define('_MD_SD2ND_LANG_GROW_SOUL', "GROW_SOUL");
+define('_MD_SD2ND_LANG_GROW_SPEED', "GROW_SPEED");
+define('_MD_SD2ND_LANG_GROW_STR', "GROW_STR");
+define('_MD_SD2ND_LANG_HEIGHT_UNIT', "HEIGHT_UNIT");
+define('_MD_SD2ND_LANG_HP', "HP");
+define('_MD_SD2ND_LANG_KIND', "KIND");
+define('_MD_SD2ND_LANG_LEARNED_ABILITY_LIST', "LEARNED_ABILITY_LIST");
+define('_MD_SD2ND_LANG_LEARNED_SKILL_LIST', "LEARNED_SKILL_LIST");
+define('_MD_SD2ND_LANG_MAP', "MAP");
+define('_MD_SD2ND_LANG_MODIFY_ACT', "MODIFY_ACT");
+define('_MD_SD2ND_LANG_MODIFY_AT', "MODIFY_AT");
+define('_MD_SD2ND_LANG_MODIFY_DF', "MODIFY_DF");
+define('_MD_SD2ND_LANG_MODIFY_HP', "MODIFY_HP");
+define('_MD_SD2ND_LANG_MODIFY_MAT', "MODIFY_MAT");
+define('_MD_SD2ND_LANG_MODIFY_MDF', "MODIFY_MDF");
+define('_MD_SD2ND_LANG_MODIFY_TP', "MODIFY_TP");
+define('_MD_SD2ND_LANG_MOVE_COST', "MOVE_COST");
+define('_MD_SD2ND_LANG_NAME', "NAME");
+define('_MD_SD2ND_LANG_PERSONAL', "PERSONAL");
+define('_MD_SD2ND_LANG_RANGE', "RANGE");
+define('_MD_SD2ND_LANG_REGIST_DATE', "REGIST_DATE");
+define('_MD_SD2ND_LANG_SEX_1', "SEX_1");
+define('_MD_SD2ND_LANG_SEX_2', "SEX_2");
+define('_MD_SD2ND_LANG_SEX_3', "SEX_3");
+define('_MD_SD2ND_LANG_SEX_4', "SEX_4");
+define('_MD_SD2ND_LANG_SEX_5', "SEX_5");
+define('_MD_SD2ND_LANG_SEX_6', "SEX_6");
+define('_MD_SD2ND_LANG_SKILL_LIST', "SKILL_LIST");
+define('_MD_SD2ND_LANG_SLOT', "SLOT");
+define('_MD_SD2ND_LANG_TARGET', "TARGET");
+define('_MD_SD2ND_LANG_TP', "TP");
+define('_MD_SD2ND_LANG_WEAPON', "WEAPON");
+define('_MD_SD2ND_LANG_WEIGTH_UNIT', "WEIGTH_UNIT");
+define('_MD_SD2ND_MAP_NAME_TUNNEL', "TUNNEL");
+define('_MD_SD2ND_MAP_NAME_TUNNEL_B1F', "NAME_TUNNEL_B1F");
+define('_MD_SD2ND_MAP_NAME_WORLD', "WORLD");
+define('_MD_SD2ND_MES_ABILITY_LIST', "ABILITY_LIST");
+define('_MD_SD2ND_MES_ACTIVE_ABILITY_LIST', "ACTIVE_ABILITY_LIST");
+define('_MD_SD2ND_MES_COSTUME_LIST', "COSTUME_LIST");
+define('_MD_SD2ND_MES_LEARNED_ABILITY_LIST', "LEARNED_ABILITY_LIST");
+define('_MD_SD2ND_MES_LEARNED_SKILL_LIST', "LEARNED_SKILL_LIST");
+define('_MD_SD2ND_MES_SKILL_LIST', "SKILL_LIST");
+
+?>
diff --git a/trust_path/modules/sd2nd/language/english/modinfo.php b/trust_path/modules/sd2nd/language/english/modinfo.php
new file mode 100644 (file)
index 0000000..7725acc
--- /dev/null
@@ -0,0 +1,69 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+define('_MI_SD2ND_DESC_SD2ND', "SD2ND");
+define('_MI_SD2ND_INSTALL_ERROR_BLOCK_COULD_NOT_LINK', "Block '{0}' could not link to module.");
+define('_MI_SD2ND_INSTALL_ERROR_BLOCK_INSTALLED', "Block '{0}' could not installed.");
+define('_MI_SD2ND_INSTALL_ERROR_BLOCK_PERM_DELETE', "Block permission of '{0}' could not deleted.");
+define('_MI_SD2ND_INSTALL_ERROR_BLOCK_PERM_SET', "Block permission of '{0}' could not set.");
+define('_MI_SD2ND_INSTALL_ERROR_BLOCK_TPL_DELETED', "Block template could not deleted.<br />{0}");
+define('_MI_SD2ND_INSTALL_ERROR_BLOCK_TPL_INSTALLED', "Block template '{0}' could not installed.");
+define('_MI_SD2ND_INSTALL_ERROR_BLOCK_UNINSTALLED', "Block '{0}' could not uninstalled.");
+define('_MI_SD2ND_INSTALL_ERROR_BLOCK_UPDATED', "Block '{0}' could not updated.");
+define('_MI_SD2ND_INSTALL_ERROR_CONFIG_ADDED', "Config '{0}' could not added.");
+define('_MI_SD2ND_INSTALL_ERROR_CONFIG_DELETED', "Config '{0}' could not deleted.");
+define('_MI_SD2ND_INSTALL_ERROR_CONFIG_NOT_FOUND', "Config is not found.");
+define('_MI_SD2ND_INSTALL_ERROR_CONFIG_UPDATED', "Config '{0}' could not updated.");
+define('_MI_SD2ND_INSTALL_ERROR_MODULE_INFORMATION_DELETED', "Module information could not deleted.");
+define('_MI_SD2ND_INSTALL_ERROR_MODULE_INSTALLED', "Module not installed.");
+define('_MI_SD2ND_INSTALL_ERROR_MODULE_UPDATED', "Module '{0}' could not updated.");
+define('_MI_SD2ND_INSTALL_ERROR_MODULOE_UNINSTALLED', "Module '{0}' could not uninstalled.");
+define('_MI_SD2ND_INSTALL_ERROR_PERM_ADMIN_SET', "Module admin permission could not set.");
+define('_MI_SD2ND_INSTALL_ERROR_PERM_COULD_NOT_SET', "Block permission of '{0}' could not set.");
+define('_MI_SD2ND_INSTALL_ERROR_PERM_READ_SET', "Module read permission could not set.");
+define('_MI_SD2ND_INSTALL_ERROR_SQL_FILE_NOT_FOUND', "SQL file '{0}' is not found.");
+define('_MI_SD2ND_INSTALL_ERROR_TABLE_DOROPPED', "Table '{0}' could not doropped.");
+define('_MI_SD2ND_INSTALL_ERROR_TPL_INSTALLED', "Template '{0}' could not installed.");
+define('_MI_SD2ND_INSTALL_ERROR_TPL_UNINSTALLED', "Template '{0}' could not uninstalled.");
+define('_MI_SD2ND_INSTALL_ERROR_UPDATE_FINISHED', "Module could not updated.");
+define('_MI_SD2ND_INSTALL_MSG_BLOCK_INSTALLED', "Block '{0}' is installed.");
+define('_MI_SD2ND_INSTALL_MSG_BLOCK_TPL_INSTALLED', "Block template '{0}' is installed.");
+define('_MI_SD2ND_INSTALL_MSG_BLOCK_TPL_UNINSTALLED', "Block template '{0}' is uninstalled.");
+define('_MI_SD2ND_INSTALL_MSG_BLOCK_UNINSTALLED', "Block '{0}' is uninstalled.");
+define('_MI_SD2ND_INSTALL_MSG_BLOCK_UPDATED', "Block '{0}' is updated.");
+define('_MI_SD2ND_INSTALL_MSG_CONFIG_ADDED', "Config '{0}' is added.");
+define('_MI_SD2ND_INSTALL_MSG_CONFIG_DELETED', "Config '{0}' is deleted.");
+define('_MI_SD2ND_INSTALL_MSG_CONFIG_UPDATED', "Config '{0}' is updated.");
+define('_MI_SD2ND_INSTALL_MSG_DB_SETUP_FINISHED', "Database setup is finished.");
+define('_MI_SD2ND_INSTALL_MSG_MODULE_INFORMATION_DELETED', "Module information is deleted.");
+define('_MI_SD2ND_INSTALL_MSG_MODULE_INSTALLED', "Module '{0}' has installed.");
+define('_MI_SD2ND_INSTALL_MSG_MODULE_UNINSTALLED', "Module '{0}' is uninstalled.");
+define('_MI_SD2ND_INSTALL_MSG_MODULE_UPDATED', "Module '{0}' is updated.");
+define('_MI_SD2ND_INSTALL_MSG_SQL_ERROR', "SQL error : {0}");
+define('_MI_SD2ND_INSTALL_MSG_SQL_SUCCESS', "SQL success : {0}");
+define('_MI_SD2ND_INSTALL_MSG_TABLE_DOROPPED', "Table '{0}' is doropped.");
+define('_MI_SD2ND_INSTALL_MSG_TPL_INSTALLED', "Template '{0}' is installed.");
+define('_MI_SD2ND_INSTALL_MSG_UPDATE_FINISHED', "Module update is finished.");
+define('_MI_SD2ND_INSTALL_MSG_UPDATE_STARTED', "Module update started.");
+define('_MI_SD2ND_LANG_AUTHOR', "AUTHOR");
+define('_MI_SD2ND_LANG_CREDITS', "CREDITS");
+define('_MI_SD2ND_LANG_SD2ND', "SD2ND");
+define('_MI_SD2ND_TPL_ABILITY_LIST', "ABILITY_LIST");
+define('_MI_SD2ND_TPL_ACTIVE_ABILITY_LIST', "ACTIVE_ABILITY_LIST");
+define('_MI_SD2ND_TPL_COSTUME_LIST', "COSTUME_LIST");
+define('_MI_SD2ND_TPL_DROP_LIST', "DROP_LIST");
+define('_MI_SD2ND_TPL_INDEX', "INDEX");
+define('_MI_SD2ND_TPL_KIND_LIST', "KIND_LIST");
+define('_MI_SD2ND_TPL_LEARNED_ABILITY_LIST', "LEARNED_ABILITY_LIST");
+define('_MI_SD2ND_TPL_LEARNED_COSTUME_LIST', "LEARNED_COSTUME_LIST");
+define('_MI_SD2ND_TPL_LEARNED_SKILL_LIST', "LEARNED_SKILL_LIST");
+define('_MI_SD2ND_TPL_MAP_VIEW', "MAP_VIEW");
+define('_MI_SD2ND_TPL_RACE_LIST', "RACE_LIST");
+define('_MI_SD2ND_TPL_SKILL_LIST', "SKILL_LIST");
+define('_MI_SD2ND_TPL_TARGET_LIST', "TARGET_LIST");
+
+?>
diff --git a/trust_path/modules/sd2nd/language/ja_utf8/admin.php b/trust_path/modules/sd2nd/language/ja_utf8/admin.php
new file mode 100644 (file)
index 0000000..6d4a5b1
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+?>
diff --git a/trust_path/modules/sd2nd/language/ja_utf8/help/delegate.html b/trust_path/modules/sd2nd/language/ja_utf8/help/delegate.html
new file mode 100644 (file)
index 0000000..8b13be9
--- /dev/null
@@ -0,0 +1,37 @@
+<h4>Delegate List</h4>
+
+<h5>Module.sd2nd.Global.Event.GetAssetManager</h5>
+<dl>
+  <dt>Sd2nd_AssetManager</dt><dd>&$obj</dd>
+  <dt>string</dt><dd>$dirname</dd>
+</dl>
+
+<h5>Module.sd2nd.Global.Event.Exception.ActionNotFound</h5>
+<dl>
+  <dt>string</dt><dd>$dirname</dd>
+</dl>
+
+<h5>Module.{dirname}.Event.Exception.ActionNotFound</h5>
+<dl>
+  <dt>void</dt>
+</dl>
+
+<h5>Module.sd2nd.Global.Event.Exception.Preparation</h5>
+<dl>
+  <dt>string</dt><dd>$dirname</dd>
+</dl>
+
+<h5>Module.{dirname}.Event.Exception.Preparation</h5>
+<dl>
+  <dt>void</dt>
+</dl>
+
+<h5>Module.sd2nd.Global.Event.Exception.Permission</h5>
+<dl>
+  <dt>string</dt><dd>$dirname</dd>
+</dl>
+
+<h5>Module.{dirname}.Event.Exception.Permission</h5>
+<dl>
+  <dt>void</dt>
+</dl>
diff --git a/trust_path/modules/sd2nd/language/ja_utf8/help/help.html b/trust_path/modules/sd2nd/language/ja_utf8/help/help.html
new file mode 100644 (file)
index 0000000..794fd16
--- /dev/null
@@ -0,0 +1,4 @@
+<h4>Input the title here</h4>
+<h5>Summary</h5>
+<p>Even if the help is poor, some information shall help users. Try writing. Take it easy.</p>
+<h5><a href="<{"delegate.html"|helpurl}>">Delegate List</a></h5>
diff --git a/trust_path/modules/sd2nd/language/ja_utf8/main.php b/trust_path/modules/sd2nd/language/ja_utf8/main.php
new file mode 100644 (file)
index 0000000..876664c
--- /dev/null
@@ -0,0 +1,93 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+define('_MD_SD2ND_INFO_ABILITY_LIST', "誰かひとりでも取得したことのあるあびりてぃの一覧");
+define('_MD_SD2ND_INFO_ACTIVE_ABILITY_LIST', "特定のあびをせっとしてるひとを検索");
+define('_MD_SD2ND_INFO_COSTUME_LIST', "誰かひとりでも取得したことのあるこすちゅ~むの一覧");
+define('_MD_SD2ND_INFO_LEARNED_ABILITY_LIST', "特定のあびを取得してるひとを検索");
+define('_MD_SD2ND_INFO_LEARNED_SKILL_LIST', "特定のすきるを取得してるひとを検索");
+define('_MD_SD2ND_INFO_SKILL_LIST', "誰かひとりでも取得したことのあるすきるの一覧");
+define('_MD_SD2ND_LANG_ABILITY_LIST', "あびりすと");
+define('_MD_SD2ND_LANG_ACTIVE_ABILITY_LIST', "せっとあびりすと");
+define('_MD_SD2ND_LANG_AGE_UNIT', "歳");
+define('_MD_SD2ND_LANG_COSTUME_ID', "ID");
+define('_MD_SD2ND_LANG_COSTUME_LIST', "こすりすと");
+define('_MD_SD2ND_LANG_COSTUME_NAME', "こす名");
+define('_MD_SD2ND_LANG_DESC', "効果");
+define('_MD_SD2ND_LANG_DIRECTION_EAST', "東");
+define('_MD_SD2ND_LANG_DIRECTION_NORTH', "北");
+define('_MD_SD2ND_LANG_DIRECTION_SOUTH', "南");
+define('_MD_SD2ND_LANG_DIRECTION_WEST', "西");
+define('_MD_SD2ND_LANG_ELEMENT', "属性");
+define('_MD_SD2ND_LANG_ELEMENT_0', "水");
+define('_MD_SD2ND_LANG_ELEMENT_1', "炎");
+define('_MD_SD2ND_LANG_ELEMENT_10', "闇");
+define('_MD_SD2ND_LANG_ELEMENT_11', "花");
+define('_MD_SD2ND_LANG_ELEMENT_12', "無");
+define('_MD_SD2ND_LANG_ELEMENT_2', "木");
+define('_MD_SD2ND_LANG_ELEMENT_3', "風");
+define('_MD_SD2ND_LANG_ELEMENT_4', "鉄");
+define('_MD_SD2ND_LANG_ELEMENT_5', "命");
+define('_MD_SD2ND_LANG_ELEMENT_6', "地");
+define('_MD_SD2ND_LANG_ELEMENT_7', "雷");
+define('_MD_SD2ND_LANG_ELEMENT_8', "光");
+define('_MD_SD2ND_LANG_ELEMENT_9', "星");
+define('_MD_SD2ND_LANG_ELEMENT_EMPTY', "武器");
+define('_MD_SD2ND_LANG_ELEMENT_RANDOM', "?");
+define('_MD_SD2ND_LANG_ELEMENT_UNDEFINED', "-");
+define('_MD_SD2ND_LANG_FULL_NAME', "ふるね~む");
+define('_MD_SD2ND_LANG_GENERAL', "総合りすと");
+define('_MD_SD2ND_LANG_GROW_CON', "集中");
+define('_MD_SD2ND_LANG_GROW_DEX', "器用");
+define('_MD_SD2ND_LANG_GROW_LIFE', "命力");
+define('_MD_SD2ND_LANG_GROW_MAG', "魔力");
+define('_MD_SD2ND_LANG_GROW_POW', "腕力");
+define('_MD_SD2ND_LANG_GROW_REG', "抗魔");
+define('_MD_SD2ND_LANG_GROW_SOUL', "魂力");
+define('_MD_SD2ND_LANG_GROW_SPEED', "速さ");
+define('_MD_SD2ND_LANG_GROW_STR', "体力");
+define('_MD_SD2ND_LANG_HEIGHT_UNIT', "cm");
+define('_MD_SD2ND_LANG_HP', "HP");
+define('_MD_SD2ND_LANG_KIND', "攻種");
+define('_MD_SD2ND_LANG_LEARNED_ABILITY_LIST', "取得あびりすと");
+define('_MD_SD2ND_LANG_LEARNED_SKILL_LIST', "取得すきるりすと");
+define('_MD_SD2ND_LANG_MAP', "まっぷ");
+define('_MD_SD2ND_LANG_MODIFY_ACT', "行動");
+define('_MD_SD2ND_LANG_MODIFY_AT', "攻撃");
+define('_MD_SD2ND_LANG_MODIFY_DF', "防御");
+define('_MD_SD2ND_LANG_MODIFY_HP', "HP");
+define('_MD_SD2ND_LANG_MODIFY_MAT', "魔攻");
+define('_MD_SD2ND_LANG_MODIFY_MDF', "魔防");
+define('_MD_SD2ND_LANG_MODIFY_TP', "TP");
+define('_MD_SD2ND_LANG_MOVE_COST', "移動");
+define('_MD_SD2ND_LANG_NAME', "名前");
+define('_MD_SD2ND_LANG_PERSONAL', "個別りすと");
+define('_MD_SD2ND_LANG_RANGE', "射程");
+define('_MD_SD2ND_LANG_REGIST_DATE', "発見日");
+define('_MD_SD2ND_LANG_SEX_1', "男性");
+define('_MD_SD2ND_LANG_SEX_2', "女性");
+define('_MD_SD2ND_LANG_SEX_3', "不明");
+define('_MD_SD2ND_LANG_SEX_4', "秘密");
+define('_MD_SD2ND_LANG_SEX_5', "男装");
+define('_MD_SD2ND_LANG_SEX_6', "女装");
+define('_MD_SD2ND_LANG_SKILL_LIST', "すきるりすと");
+define('_MD_SD2ND_LANG_SLOT', "すろっと");
+define('_MD_SD2ND_LANG_TARGET', "対象");
+define('_MD_SD2ND_LANG_TP', "TP");
+define('_MD_SD2ND_LANG_WEAPON', "武器");
+define('_MD_SD2ND_LANG_WEIGTH_UNIT', "kg");
+define('_MD_SD2ND_MAP_NAME_TUNNEL', "ダンジョンマップ(坑道跡)");
+define('_MD_SD2ND_MAP_NAME_TUNNEL_B1F', "ダンジョンマップ(坑道跡 B1F)");
+define('_MD_SD2ND_MAP_NAME_WORLD', "ワールドマップ");
+define('_MD_SD2ND_MES_ABILITY_LIST', "使い方は古いのとおんなじ・・・だよね?");
+define('_MD_SD2ND_MES_ACTIVE_ABILITY_LIST', "前方一致の空白区切りで検索☆");
+define('_MD_SD2ND_MES_COSTUME_LIST', "使い方はたぶんきっといつも通り");
+define('_MD_SD2ND_MES_LEARNED_ABILITY_LIST', "前方一致の空白区切りで検索☆");
+define('_MD_SD2ND_MES_LEARNED_SKILL_LIST', "前方一致の空白区切りで検索☆");
+define('_MD_SD2ND_MES_SKILL_LIST', "使い方はいつもどおり?");
+
+?>
diff --git a/trust_path/modules/sd2nd/language/ja_utf8/modinfo.php b/trust_path/modules/sd2nd/language/ja_utf8/modinfo.php
new file mode 100644 (file)
index 0000000..7400117
--- /dev/null
@@ -0,0 +1,69 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+define('_MI_SD2ND_DESC_SD2ND', "SD2ND");
+define('_MI_SD2ND_INSTALL_ERROR_BLOCK_COULD_NOT_LINK', "ぶろっく『{0}』をもじゅーると関連付けできませんでした。");
+define('_MI_SD2ND_INSTALL_ERROR_BLOCK_INSTALLED', "ぶろっく『{0}』がいんすとーるできませんでした。");
+define('_MI_SD2ND_INSTALL_ERROR_BLOCK_PERM_DELETE', "ぶろっく『{0}』の権限を削除できませんでした。");
+define('_MI_SD2ND_INSTALL_ERROR_BLOCK_PERM_SET', "ぶろっく『{0}』に権限を付加できませんでした。");
+define('_MI_SD2ND_INSTALL_ERROR_BLOCK_TPL_DELETED', "ぶろっくてんぷれが削除できませんでした。<br />{0}");
+define('_MI_SD2ND_INSTALL_ERROR_BLOCK_TPL_INSTALLED', "ぶろっくてんぷれ『{0}』がいんすとーるできませんでした。");
+define('_MI_SD2ND_INSTALL_ERROR_BLOCK_UNINSTALLED', "ぶろっく『{0}』があんいんすとーるできませんでした。");
+define('_MI_SD2ND_INSTALL_ERROR_BLOCK_UPDATED', "ぶろっく『{0}』があっぷでーとできませんでした。");
+define('_MI_SD2ND_INSTALL_ERROR_CONFIG_ADDED', "一般設定『{0}』が追加できませんでした。");
+define('_MI_SD2ND_INSTALL_ERROR_CONFIG_DELETED', "一般設定『{0}』が削除できませんでした。");
+define('_MI_SD2ND_INSTALL_ERROR_CONFIG_NOT_FOUND', "一般設定が見つかりません。");
+define('_MI_SD2ND_INSTALL_ERROR_CONFIG_UPDATED', "一般設定『{0}』があっぷでーとできませんでした。");
+define('_MI_SD2ND_INSTALL_ERROR_MODULE_INFORMATION_DELETED', "もじゅーる情報が削除できませんでした。");
+define('_MI_SD2ND_INSTALL_ERROR_MODULE_INSTALLED', "もじゅーるのいんすとーるができませんでした。");
+define('_MI_SD2ND_INSTALL_ERROR_MODULE_UPDATED', "もじゅーる『{0}』があっぷでーとできませんでした。");
+define('_MI_SD2ND_INSTALL_ERROR_MODULOE_UNINSTALLED', "もじゅーる『{0}』があんいんすとーるできませんでした。");
+define('_MI_SD2ND_INSTALL_ERROR_PERM_ADMIN_SET', "もじゅーるの管理権限を付加できませんでした。");
+define('_MI_SD2ND_INSTALL_ERROR_PERM_COULD_NOT_SET', "ぶろっく『{0}』に権限を付加できませんでした。");
+define('_MI_SD2ND_INSTALL_ERROR_PERM_READ_SET', "もじゅーるのあくせす権限を付加できませんでした。");
+define('_MI_SD2ND_INSTALL_ERROR_SQL_FILE_NOT_FOUND', "SQLふぁいる『{0}』が見つかりませんでした。");
+define('_MI_SD2ND_INSTALL_ERROR_TABLE_DOROPPED', "てーぶる『{0}』が削除できませんでした。");
+define('_MI_SD2ND_INSTALL_ERROR_TPL_INSTALLED', "てんぷれ『{0}』のいんすとーるができませんでした。");
+define('_MI_SD2ND_INSTALL_ERROR_TPL_UNINSTALLED', "てんぷれ『{0}』のあんいんすとーるができませんでした。");
+define('_MI_SD2ND_INSTALL_ERROR_UPDATE_FINISHED', "もじゅーるのあっぷでーとに失敗しました。");
+define('_MI_SD2ND_INSTALL_MSG_BLOCK_INSTALLED', "ぶろっく『{0}』をいんすとーるしました。");
+define('_MI_SD2ND_INSTALL_MSG_BLOCK_TPL_INSTALLED', "ぶろっくてんぷれ『{0}』をいんすとーるしました。");
+define('_MI_SD2ND_INSTALL_MSG_BLOCK_TPL_UNINSTALLED', "ぶろっくてんぷれ『{0}』をあんいんすとーるしました。");
+define('_MI_SD2ND_INSTALL_MSG_BLOCK_UNINSTALLED', "ぶろっく『{0}』をあんいんすとーるしました。");
+define('_MI_SD2ND_INSTALL_MSG_BLOCK_UPDATED', "ぶろっく『{0}』をあっぷでーとしました。");
+define('_MI_SD2ND_INSTALL_MSG_CONFIG_ADDED', "一般設定『{0}』を追加しました。");
+define('_MI_SD2ND_INSTALL_MSG_CONFIG_DELETED', "一般設定『{0}』を削除しました。");
+define('_MI_SD2ND_INSTALL_MSG_CONFIG_UPDATED', "一般設定『{0}』をあっぷでーとしました。");
+define('_MI_SD2ND_INSTALL_MSG_DB_SETUP_FINISHED', "でーたべーすのせっとあっぷが完了しました。");
+define('_MI_SD2ND_INSTALL_MSG_MODULE_INFORMATION_DELETED', "もじゅーる情報を削除しました。");
+define('_MI_SD2ND_INSTALL_MSG_MODULE_INSTALLED', "もじゅーる『{0}』をいんすとーるしました。");
+define('_MI_SD2ND_INSTALL_MSG_MODULE_UNINSTALLED', "もじゅーる『{0}』をあんいんすとーるしました。");
+define('_MI_SD2ND_INSTALL_MSG_MODULE_UPDATED', "もじゅーる『{0}』をあっぷでーとしました。");
+define('_MI_SD2ND_INSTALL_MSG_SQL_ERROR', "SQL error : {0}");
+define('_MI_SD2ND_INSTALL_MSG_SQL_SUCCESS', "SQL success : {0}");
+define('_MI_SD2ND_INSTALL_MSG_TABLE_DOROPPED', "てーぶる『{0}』を削除しました。");
+define('_MI_SD2ND_INSTALL_MSG_TPL_INSTALLED', "てんぷれ『{0}』をいんすとーるしました。");
+define('_MI_SD2ND_INSTALL_MSG_UPDATE_FINISHED', "もじゅーるのあっぷでーとが終了しました。");
+define('_MI_SD2ND_INSTALL_MSG_UPDATE_STARTED', "もじゅーるのあっぷでーとを開始します。");
+define('_MI_SD2ND_LANG_AUTHOR', "AUTHOR");
+define('_MI_SD2ND_LANG_CREDITS', "CREDITS");
+define('_MI_SD2ND_LANG_SD2ND', "SD2ND");
+define('_MI_SD2ND_TPL_ABILITY_LIST', "ABILITY_LIST");
+define('_MI_SD2ND_TPL_COSTUME_LIST', "COSTUME_LIST");
+define('_MI_SD2ND_TPL_DROP_LIST', "DROP_LIST");
+define('_MI_SD2ND_TPL_INDEX', "INDEX");
+define('_MI_SD2ND_TPL_KIND_LIST', "KIND_LIST");
+define('_MI_SD2ND_TPL_MAP_VIEW', "MAP_VIEW");
+define('_MI_SD2ND_TPL_RACE_LIST', "RACE_LIST");
+define('_MI_SD2ND_TPL_SKILL_LIST', "SKILL_LIST");
+define('_MI_SD2ND_TPL_TARGET_LIST', "TARGET_LIST");
+define('_MI_SD2ND_TPL_ACTIVE_ABILITY_LIST', "ACTIVE_ABILITY_LIST");
+define('_MI_SD2ND_TPL_LEARNED_ABILITY_LIST', "LEARNED_ABILITY_LIST");
+define('_MI_SD2ND_TPL_LEARNED_SKILL_LIST', "LEARNED_SKILL_LIST");
+define('_MI_SD2ND_TPL_LEARNED_COSTUME_LIST', "LEARNED_COSTUME_LIST");
+
+?>
diff --git a/trust_path/modules/sd2nd/language/japanese/admin.php b/trust_path/modules/sd2nd/language/japanese/admin.php
new file mode 100644 (file)
index 0000000..6d4a5b1
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+?>
diff --git a/trust_path/modules/sd2nd/language/japanese/help/delegate.html b/trust_path/modules/sd2nd/language/japanese/help/delegate.html
new file mode 100644 (file)
index 0000000..8b13be9
--- /dev/null
@@ -0,0 +1,37 @@
+<h4>Delegate List</h4>
+
+<h5>Module.sd2nd.Global.Event.GetAssetManager</h5>
+<dl>
+  <dt>Sd2nd_AssetManager</dt><dd>&$obj</dd>
+  <dt>string</dt><dd>$dirname</dd>
+</dl>
+
+<h5>Module.sd2nd.Global.Event.Exception.ActionNotFound</h5>
+<dl>
+  <dt>string</dt><dd>$dirname</dd>
+</dl>
+
+<h5>Module.{dirname}.Event.Exception.ActionNotFound</h5>
+<dl>
+  <dt>void</dt>
+</dl>
+
+<h5>Module.sd2nd.Global.Event.Exception.Preparation</h5>
+<dl>
+  <dt>string</dt><dd>$dirname</dd>
+</dl>
+
+<h5>Module.{dirname}.Event.Exception.Preparation</h5>
+<dl>
+  <dt>void</dt>
+</dl>
+
+<h5>Module.sd2nd.Global.Event.Exception.Permission</h5>
+<dl>
+  <dt>string</dt><dd>$dirname</dd>
+</dl>
+
+<h5>Module.{dirname}.Event.Exception.Permission</h5>
+<dl>
+  <dt>void</dt>
+</dl>
diff --git a/trust_path/modules/sd2nd/language/japanese/help/help.html b/trust_path/modules/sd2nd/language/japanese/help/help.html
new file mode 100644 (file)
index 0000000..794fd16
--- /dev/null
@@ -0,0 +1,4 @@
+<h4>Input the title here</h4>
+<h5>Summary</h5>
+<p>Even if the help is poor, some information shall help users. Try writing. Take it easy.</p>
+<h5><a href="<{"delegate.html"|helpurl}>">Delegate List</a></h5>
diff --git a/trust_path/modules/sd2nd/language/japanese/main.php b/trust_path/modules/sd2nd/language/japanese/main.php
new file mode 100644 (file)
index 0000000..697b775
--- /dev/null
@@ -0,0 +1,93 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+define('_MD_SD2ND_INFO_ABILITY_LIST', "狼¤Ò¤È¤ê¤Ç¤â¼èÆÀ¤·¤¿¤³¤È¤Î¤¢¤ë¤¢¤Ó¤ê¤Æ¤£¤Î°ìÍ÷");
+define('_MD_SD2ND_INFO_ACTIVE_ABILITY_LIST', "ÆÃÄê¤Î¤¢¤Ó¤ò¤»¤Ã¤È¤·¤Æ¤ë¤Ò¤È¤ò¸¡º÷");
+define('_MD_SD2ND_INFO_COSTUME_LIST', "狼¤Ò¤È¤ê¤Ç¤â¼èÆÀ¤·¤¿¤³¤È¤Î¤¢¤ë¤³¤¹¤Á¤å¡Á¤à¤Î°ìÍ÷");
+define('_MD_SD2ND_INFO_LEARNED_ABILITY_LIST', "ÆÃÄê¤Î¤¢¤Ó¤ò¼èÆÀ¤·¤Æ¤ë¤Ò¤È¤ò¸¡º÷");
+define('_MD_SD2ND_INFO_LEARNED_SKILL_LIST', "ÆÃÄê¤Î¤¹¤­¤ë¤ò¼èÆÀ¤·¤Æ¤ë¤Ò¤È¤ò¸¡º÷");
+define('_MD_SD2ND_INFO_SKILL_LIST', "狼¤Ò¤È¤ê¤Ç¤â¼èÆÀ¤·¤¿¤³¤È¤Î¤¢¤ë¤¹¤­¤ë¤Î°ìÍ÷");
+define('_MD_SD2ND_LANG_ABILITY_LIST', "¤¢¤Ó¤ê¤¹¤È");
+define('_MD_SD2ND_LANG_ACTIVE_ABILITY_LIST', "¤»¤Ã¤È¤¢¤Ó¤ê¤¹¤È");
+define('_MD_SD2ND_LANG_AGE_UNIT', "ºÐ");
+define('_MD_SD2ND_LANG_COSTUME_ID', "ID");
+define('_MD_SD2ND_LANG_COSTUME_LIST', "¤³¤¹¤ê¤¹¤È");
+define('_MD_SD2ND_LANG_COSTUME_NAME', "¤³¤¹Ì¾");
+define('_MD_SD2ND_LANG_DESC', "¸ú²Ì");
+define('_MD_SD2ND_LANG_DIRECTION_EAST', "Åì");
+define('_MD_SD2ND_LANG_DIRECTION_NORTH', "ËÌ");
+define('_MD_SD2ND_LANG_DIRECTION_SOUTH', "Æî");
+define('_MD_SD2ND_LANG_DIRECTION_WEST', "À¾");
+define('_MD_SD2ND_LANG_ELEMENT', "°À­");
+define('_MD_SD2ND_LANG_ELEMENT_0', "¿å");
+define('_MD_SD2ND_LANG_ELEMENT_1', "±ê");
+define('_MD_SD2ND_LANG_ELEMENT_10', "°Ç");
+define('_MD_SD2ND_LANG_ELEMENT_11', "²Ö");
+define('_MD_SD2ND_LANG_ELEMENT_12', "̵");
+define('_MD_SD2ND_LANG_ELEMENT_2', "ÌÚ");
+define('_MD_SD2ND_LANG_ELEMENT_3', "É÷");
+define('_MD_SD2ND_LANG_ELEMENT_4', "Ŵ");
+define('_MD_SD2ND_LANG_ELEMENT_5', "̿");
+define('_MD_SD2ND_LANG_ELEMENT_6', "ÃÏ");
+define('_MD_SD2ND_LANG_ELEMENT_7', "Íë");
+define('_MD_SD2ND_LANG_ELEMENT_8', "¸÷");
+define('_MD_SD2ND_LANG_ELEMENT_9', "À±");
+define('_MD_SD2ND_LANG_ELEMENT_EMPTY', "Éð´ï");
+define('_MD_SD2ND_LANG_ELEMENT_RANDOM', "¡©");
+define('_MD_SD2ND_LANG_ELEMENT_UNDEFINED', "¡Ý");
+define('_MD_SD2ND_LANG_FULL_NAME', "¤Õ¤ë¤Í¡Á¤à");
+define('_MD_SD2ND_LANG_GENERAL', "Áí¹ç¤ê¤¹¤È");
+define('_MD_SD2ND_LANG_GROW_CON', "½¸Ãæ");
+define('_MD_SD2ND_LANG_GROW_DEX', "´ïÍÑ");
+define('_MD_SD2ND_LANG_GROW_LIFE', "Ì¿ÎÏ");
+define('_MD_SD2ND_LANG_GROW_MAG', "ËâÎÏ");
+define('_MD_SD2ND_LANG_GROW_POW', "ÏÓÎÏ");
+define('_MD_SD2ND_LANG_GROW_REG', "¹³Ëâ");
+define('_MD_SD2ND_LANG_GROW_SOUL', "º²ÎÏ");
+define('_MD_SD2ND_LANG_GROW_SPEED', "®¤µ");
+define('_MD_SD2ND_LANG_GROW_STR', "ÂÎÎÏ");
+define('_MD_SD2ND_LANG_HEIGHT_UNIT', "cm");
+define('_MD_SD2ND_LANG_HP', "HP");
+define('_MD_SD2ND_LANG_KIND', "¹¶¼ï");
+define('_MD_SD2ND_LANG_LEARNED_ABILITY_LIST', "¼èÆÀ¤¢¤Ó¤ê¤¹¤È");
+define('_MD_SD2ND_LANG_LEARNED_SKILL_LIST', "¼èÆÀ¤¹¤­¤ë¤ê¤¹¤È");
+define('_MD_SD2ND_LANG_MAP', "¤Þ¤Ã¤×");
+define('_MD_SD2ND_LANG_MODIFY_ACT', "¹ÔÆ°");
+define('_MD_SD2ND_LANG_MODIFY_AT', "¹¶·â");
+define('_MD_SD2ND_LANG_MODIFY_DF', "Ëɸæ");
+define('_MD_SD2ND_LANG_MODIFY_HP', "HP");
+define('_MD_SD2ND_LANG_MODIFY_MAT', "Ë⹶");
+define('_MD_SD2ND_LANG_MODIFY_MDF', "ËâËÉ");
+define('_MD_SD2ND_LANG_MODIFY_TP', "TP");
+define('_MD_SD2ND_LANG_MOVE_COST', "°ÜÆ°");
+define('_MD_SD2ND_LANG_NAME', "̾Á°");
+define('_MD_SD2ND_LANG_PERSONAL', "¸ÄÊ̤ꤹ¤È");
+define('_MD_SD2ND_LANG_RANGE', "¼ÍÄø");
+define('_MD_SD2ND_LANG_REGIST_DATE', "ȯ¸«Æü");
+define('_MD_SD2ND_LANG_SEX_1', "ÃËÀ­");
+define('_MD_SD2ND_LANG_SEX_2', "½÷À­");
+define('_MD_SD2ND_LANG_SEX_3', "ÉÔÌÀ");
+define('_MD_SD2ND_LANG_SEX_4', "ÈëÌ©");
+define('_MD_SD2ND_LANG_SEX_5', "ÃËÁõ");
+define('_MD_SD2ND_LANG_SEX_6', "½÷Áõ");
+define('_MD_SD2ND_LANG_SKILL_LIST', "¤¹¤­¤ë¤ê¤¹¤È");
+define('_MD_SD2ND_LANG_SLOT', "¤¹¤í¤Ã¤È");
+define('_MD_SD2ND_LANG_TARGET', "ÂоÝ");
+define('_MD_SD2ND_LANG_TP', "TP");
+define('_MD_SD2ND_LANG_WEAPON', "Éð´ï");
+define('_MD_SD2ND_LANG_WEIGTH_UNIT', "kg");
+define('_MD_SD2ND_MAP_NAME_TUNNEL', "¥À¥ó¥¸¥ç¥ó¥Þ¥Ã¥×(¹£Æ»À×)");
+define('_MD_SD2ND_MAP_NAME_TUNNEL_B1F', "¥À¥ó¥¸¥ç¥ó¥Þ¥Ã¥×(¹£Æ»À× B1F)");
+define('_MD_SD2ND_MAP_NAME_WORLD', "¥ï¡¼¥ë¥É¥Þ¥Ã¥×");
+define('_MD_SD2ND_MES_ABILITY_LIST', "»È¤¤Êý¤Ï¸Å¤¤¤Î¤È¤ª¤ó¤Ê¤¸¡¦¡¦¡¦¤À¤è¤Í¡©");
+define('_MD_SD2ND_MES_ACTIVE_ABILITY_LIST', "Á°Êý°ìÃפζõÇò¶èÀÚ¤ê¤Ç¸¡º÷¡ù");
+define('_MD_SD2ND_MES_COSTUME_LIST', "»È¤¤Êý¤Ï¤¿¤Ö¤ó¤­¤Ã¤È¤¤¤Ä¤âÄ̤ê");
+define('_MD_SD2ND_MES_LEARNED_ABILITY_LIST', "Á°Êý°ìÃפζõÇò¶èÀÚ¤ê¤Ç¸¡º÷¡ù");
+define('_MD_SD2ND_MES_LEARNED_SKILL_LIST', "Á°Êý°ìÃפζõÇò¶èÀÚ¤ê¤Ç¸¡º÷¡ù");
+define('_MD_SD2ND_MES_SKILL_LIST', "»È¤¤Êý¤Ï¤¤¤Ä¤â¤É¤ª¤ê¡©");
+
+?>
diff --git a/trust_path/modules/sd2nd/language/japanese/modinfo.php b/trust_path/modules/sd2nd/language/japanese/modinfo.php
new file mode 100644 (file)
index 0000000..5f34755
--- /dev/null
@@ -0,0 +1,69 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+define('_MI_SD2ND_DESC_SD2ND', "SD2ND");
+define('_MI_SD2ND_INSTALL_ERROR_BLOCK_COULD_NOT_LINK', "¤Ö¤í¤Ã¤¯¡Ø{0}¡Ù¤ò¤â¤¸¤å¡¼¤ë¤È´ØÏ¢ÉÕ¤±¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_ERROR_BLOCK_INSTALLED', "¤Ö¤í¤Ã¤¯¡Ø{0}¡Ù¤¬¤¤¤ó¤¹¤È¡¼¤ë¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_ERROR_BLOCK_PERM_DELETE', "¤Ö¤í¤Ã¤¯¡Ø{0}¡Ù¤Î¸¢¸Â¤òºï½ü¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_ERROR_BLOCK_PERM_SET', "¤Ö¤í¤Ã¤¯¡Ø{0}¡Ù¤Ë¸¢¸Â¤òÉղäǤ­¤Þ¤»¤ó¤Ç¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_ERROR_BLOCK_TPL_DELETED', "¤Ö¤í¤Ã¤¯¤Æ¤ó¤×¤ì¤¬ºï½ü¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£<br />{0}");
+define('_MI_SD2ND_INSTALL_ERROR_BLOCK_TPL_INSTALLED', "¤Ö¤í¤Ã¤¯¤Æ¤ó¤×¤ì¡Ø{0}¡Ù¤¬¤¤¤ó¤¹¤È¡¼¤ë¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_ERROR_BLOCK_UNINSTALLED', "¤Ö¤í¤Ã¤¯¡Ø{0}¡Ù¤¬¤¢¤ó¤¤¤ó¤¹¤È¡¼¤ë¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_ERROR_BLOCK_UPDATED', "¤Ö¤í¤Ã¤¯¡Ø{0}¡Ù¤¬¤¢¤Ã¤×¤Ç¡¼¤È¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_ERROR_CONFIG_ADDED', "°ìÈÌÀßÄê¡Ø{0}¡Ù¤¬ÄɲäǤ­¤Þ¤»¤ó¤Ç¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_ERROR_CONFIG_DELETED', "°ìÈÌÀßÄê¡Ø{0}¡Ù¤¬ºï½ü¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_ERROR_CONFIG_NOT_FOUND', "°ìÈÌÀßÄ꤬¸«¤Ä¤«¤ê¤Þ¤»¤ó¡£");
+define('_MI_SD2ND_INSTALL_ERROR_CONFIG_UPDATED', "°ìÈÌÀßÄê¡Ø{0}¡Ù¤¬¤¢¤Ã¤×¤Ç¡¼¤È¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_ERROR_MODULE_INFORMATION_DELETED', "¤â¤¸¤å¡¼¤ë¾ðÊ󤬺ï½ü¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_ERROR_MODULE_INSTALLED', "¤â¤¸¤å¡¼¤ë¤Î¤¤¤ó¤¹¤È¡¼¤ë¤¬¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_ERROR_MODULE_UPDATED', "¤â¤¸¤å¡¼¤ë¡Ø{0}¡Ù¤¬¤¢¤Ã¤×¤Ç¡¼¤È¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_ERROR_MODULOE_UNINSTALLED', "¤â¤¸¤å¡¼¤ë¡Ø{0}¡Ù¤¬¤¢¤ó¤¤¤ó¤¹¤È¡¼¤ë¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_ERROR_PERM_ADMIN_SET', "¤â¤¸¤å¡¼¤ë¤Î´ÉÍý¸¢¸Â¤òÉղäǤ­¤Þ¤»¤ó¤Ç¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_ERROR_PERM_COULD_NOT_SET', "¤Ö¤í¤Ã¤¯¡Ø{0}¡Ù¤Ë¸¢¸Â¤òÉղäǤ­¤Þ¤»¤ó¤Ç¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_ERROR_PERM_READ_SET', "¤â¤¸¤å¡¼¤ë¤Î¤¢¤¯¤»¤¹¸¢¸Â¤òÉղäǤ­¤Þ¤»¤ó¤Ç¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_ERROR_SQL_FILE_NOT_FOUND', "SQL¤Õ¤¡¤¤¤ë¡Ø{0}¡Ù¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_ERROR_TABLE_DOROPPED', "¤Æ¡¼¤Ö¤ë¡Ø{0}¡Ù¤¬ºï½ü¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_ERROR_TPL_INSTALLED', "¤Æ¤ó¤×¤ì¡Ø{0}¡Ù¤Î¤¤¤ó¤¹¤È¡¼¤ë¤¬¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_ERROR_TPL_UNINSTALLED', "¤Æ¤ó¤×¤ì¡Ø{0}¡Ù¤Î¤¢¤ó¤¤¤ó¤¹¤È¡¼¤ë¤¬¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_ERROR_UPDATE_FINISHED', "¤â¤¸¤å¡¼¤ë¤Î¤¢¤Ã¤×¤Ç¡¼¤È¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_MSG_BLOCK_INSTALLED', "¤Ö¤í¤Ã¤¯¡Ø{0}¡Ù¤ò¤¤¤ó¤¹¤È¡¼¤ë¤·¤Þ¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_MSG_BLOCK_TPL_INSTALLED', "¤Ö¤í¤Ã¤¯¤Æ¤ó¤×¤ì¡Ø{0}¡Ù¤ò¤¤¤ó¤¹¤È¡¼¤ë¤·¤Þ¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_MSG_BLOCK_TPL_UNINSTALLED', "¤Ö¤í¤Ã¤¯¤Æ¤ó¤×¤ì¡Ø{0}¡Ù¤ò¤¢¤ó¤¤¤ó¤¹¤È¡¼¤ë¤·¤Þ¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_MSG_BLOCK_UNINSTALLED', "¤Ö¤í¤Ã¤¯¡Ø{0}¡Ù¤ò¤¢¤ó¤¤¤ó¤¹¤È¡¼¤ë¤·¤Þ¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_MSG_BLOCK_UPDATED', "¤Ö¤í¤Ã¤¯¡Ø{0}¡Ù¤ò¤¢¤Ã¤×¤Ç¡¼¤È¤·¤Þ¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_MSG_CONFIG_ADDED', "°ìÈÌÀßÄê¡Ø{0}¡Ù¤òÄɲä·¤Þ¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_MSG_CONFIG_DELETED', "°ìÈÌÀßÄê¡Ø{0}¡Ù¤òºï½ü¤·¤Þ¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_MSG_CONFIG_UPDATED', "°ìÈÌÀßÄê¡Ø{0}¡Ù¤ò¤¢¤Ã¤×¤Ç¡¼¤È¤·¤Þ¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_MSG_DB_SETUP_FINISHED', "¤Ç¡¼¤¿¤Ù¡¼¤¹¤Î¤»¤Ã¤È¤¢¤Ã¤×¤¬´°Î»¤·¤Þ¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_MSG_MODULE_INFORMATION_DELETED', "¤â¤¸¤å¡¼¤ë¾ðÊó¤òºï½ü¤·¤Þ¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_MSG_MODULE_INSTALLED', "¤â¤¸¤å¡¼¤ë¡Ø{0}¡Ù¤ò¤¤¤ó¤¹¤È¡¼¤ë¤·¤Þ¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_MSG_MODULE_UNINSTALLED', "¤â¤¸¤å¡¼¤ë¡Ø{0}¡Ù¤ò¤¢¤ó¤¤¤ó¤¹¤È¡¼¤ë¤·¤Þ¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_MSG_MODULE_UPDATED', "¤â¤¸¤å¡¼¤ë¡Ø{0}¡Ù¤ò¤¢¤Ã¤×¤Ç¡¼¤È¤·¤Þ¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_MSG_SQL_ERROR', "SQL error : {0}");
+define('_MI_SD2ND_INSTALL_MSG_SQL_SUCCESS', "SQL success : {0}");
+define('_MI_SD2ND_INSTALL_MSG_TABLE_DOROPPED', "¤Æ¡¼¤Ö¤ë¡Ø{0}¡Ù¤òºï½ü¤·¤Þ¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_MSG_TPL_INSTALLED', "¤Æ¤ó¤×¤ì¡Ø{0}¡Ù¤ò¤¤¤ó¤¹¤È¡¼¤ë¤·¤Þ¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_MSG_UPDATE_FINISHED', "¤â¤¸¤å¡¼¤ë¤Î¤¢¤Ã¤×¤Ç¡¼¤È¤¬½ªÎ»¤·¤Þ¤·¤¿¡£");
+define('_MI_SD2ND_INSTALL_MSG_UPDATE_STARTED', "¤â¤¸¤å¡¼¤ë¤Î¤¢¤Ã¤×¤Ç¡¼¤È¤ò³«»Ï¤·¤Þ¤¹¡£");
+define('_MI_SD2ND_LANG_AUTHOR', "AUTHOR");
+define('_MI_SD2ND_LANG_CREDITS', "CREDITS");
+define('_MI_SD2ND_LANG_SD2ND', "SD2ND");
+define('_MI_SD2ND_TPL_ABILITY_LIST', "ABILITY_LIST");
+define('_MI_SD2ND_TPL_COSTUME_LIST', "COSTUME_LIST");
+define('_MI_SD2ND_TPL_DROP_LIST', "DROP_LIST");
+define('_MI_SD2ND_TPL_INDEX', "INDEX");
+define('_MI_SD2ND_TPL_KIND_LIST', "KIND_LIST");
+define('_MI_SD2ND_TPL_MAP_VIEW', "MAP_VIEW");
+define('_MI_SD2ND_TPL_RACE_LIST', "RACE_LIST");
+define('_MI_SD2ND_TPL_SKILL_LIST', "SKILL_LIST");
+define('_MI_SD2ND_TPL_TARGET_LIST', "TARGET_LIST");
+define('_MI_SD2ND_TPL_ACTIVE_ABILITY_LIST', "ACTIVE_ABILITY_LIST");
+define('_MI_SD2ND_TPL_LEARNED_ABILITY_LIST', "LEARNED_ABILITY_LIST");
+define('_MI_SD2ND_TPL_LEARNED_SKILL_LIST', "LEARNED_SKILL_LIST");
+define('_MI_SD2ND_TPL_LEARNED_COSTUME_LIST', "LEARNED_COSTUME_LIST");
+
+?>
diff --git a/trust_path/modules/sd2nd/preload/AssetPreload.class.php b/trust_path/modules/sd2nd/preload/AssetPreload.class.php
new file mode 100644 (file)
index 0000000..275919d
--- /dev/null
@@ -0,0 +1,108 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+if(!defined('SD2ND_TRUST_PATH'))
+{
+    define('SD2ND_TRUST_PATH',XOOPS_TRUST_PATH . '/modules/sd2nd');
+}
+
+require_once SD2ND_TRUST_PATH . '/class/Sd2ndUtils.class.php';
+
+Sd2nd_AssetPreloadBase::prepare();
+
+
+/**
+ * Sd2nd_AssetPreloadBase
+**/
+class Sd2nd_AssetPreloadBase extends XCube_ActionFilter
+{
+    /**
+     * prepare
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public static function prepare()
+    {
+        $root =& XCube_Root::getSingleton();
+        $instance = new Sd2nd_AssetPreloadBase($root->mController);
+        $root->mController->addActionFilter($instance);
+    }
+
+    /**
+     * preBlockFilter
+     * 
+     * @param   void
+     * 
+     * @return  void
+    **/
+    public function preBlockFilter()
+    {
+        $this->mRoot->mDelegateManager->add('Module.sd2nd.Global.Event.GetAssetManager','Sd2nd_AssetPreloadBase::getManager');
+        $this->mRoot->mDelegateManager->add('Legacy_Utils.CreateModule','Sd2nd_AssetPreloadBase::getModule');
+        $this->mRoot->mDelegateManager->add('Legacy_Utils.CreateBlockProcedure','Sd2nd_AssetPreloadBase::getBlock');
+    }
+
+    /**
+     * getManager
+     * 
+     * @param   Sd2nd_AssetManager  &$obj
+     * @param   string  $dirname
+     * 
+     * @return  void
+    **/
+    public static function getManager(/*** Sd2nd_AssetManager ***/ &$obj,/*** string ***/ $dirname)
+    {
+        require_once SD2ND_TRUST_PATH . '/class/AssetManager.class.php';
+        $obj = Sd2nd_AssetManager::getInstance($dirname);
+    }
+
+    /**
+     * getModule
+     * 
+     * @param   Legacy_AbstractModule  &$obj
+     * @param   XoopsModule  $module
+     * 
+     * @return  void
+    **/
+    public static function getModule(/*** Legacy_AbstractModule ***/ &$obj,/*** XoopsModule ***/ $module)
+    {
+        if($module->getInfo('trust_dirname') == 'sd2nd')
+        {
+            require_once SD2ND_TRUST_PATH . '/class/Module.class.php';
+            $obj = new Sd2nd_Module($module);
+        }
+    }
+
+    /**
+     * getBlock
+     * 
+     * @param   Legacy_AbstractBlockProcedure  &$obj
+     * @param   XoopsBlock  $block
+     * 
+     * @return  void
+    **/
+    public static function getBlock(/*** Legacy_AbstractBlockProcedure ***/ &$obj,/*** XoopsBlock ***/ $block)
+    {
+        $moduleHandler =& Sd2nd_Utils::getXoopsHandler('module');
+        $module =& $moduleHandler->get($block->get('mid'));
+        if(is_object($module) && $module->getInfo('trust_dirname') == 'sd2nd')
+        {
+            require_once SD2ND_TRUST_PATH . '/blocks/' . $block->get('func_file');
+            $className = 'Sd2nd_' . substr($block->get('show_func'), 4);
+            $obj = new $className($block);
+        }
+    }
+}
+
+?>
diff --git a/trust_path/modules/sd2nd/sql/mysql.sql b/trust_path/modules/sd2nd/sql/mysql.sql
new file mode 100644 (file)
index 0000000..707df5d
--- /dev/null
@@ -0,0 +1,246 @@
+CREATE TABLE `{prefix}_{dirname}_ability` (
+  `ability_id` smallint(5) unsigned NOT NULL,
+  `ability_name` varchar(50) NOT NULL,
+  `description` varchar(255) NOT NULL,
+  `ability_cost` tinyint(4) NOT NULL,
+  `regist_time` mediumint(8) unsigned NOT NULL,
+  PRIMARY KEY  (`ability_id`),
+  UNIQUE KEY `ability_name` (`ability_name`),
+  KEY `regist_time` (`regist_time`,`ability_id`)
+) ENGINE=MyISAM;
+
+CREATE TABLE `{prefix}_{dirname}_active_ability` (
+  `eno` smallint(5) unsigned NOT NULL,
+  `slot` tinyint(3) unsigned NOT NULL,
+  `ability_id` smallint(5) unsigned NOT NULL,
+  PRIMARY KEY  (`ability_id`,`eno`),
+  UNIQUE KEY `eno` (`eno`,`slot`)
+) ENGINE=MyISAM;
+
+CREATE TABLE `{prefix}_{dirname}_char` (
+  `eno` smallint(5) unsigned NOT NULL,
+  `full_name` varchar(40) NOT NULL,
+  `nick_name` varchar(16) NOT NULL,
+  `battle_name` varchar(16) NOT NULL,
+  `sex` tinyint(3) unsigned NOT NULL,
+  `age` smallint(5) unsigned NOT NULL,
+  `height` smallint(5) unsigned NOT NULL,
+  `weight` smallint(5) unsigned NOT NULL,
+  `profile` text NOT NULL,
+  `race` tinyint(3) unsigned NOT NULL,
+  `element_base` tinyint(3) unsigned NOT NULL,
+  `element_ext` tinyint(3) unsigned NOT NULL,
+  `active_costume` smallint(5) unsigned NOT NULL,
+  PRIMARY KEY  (`eno`)
+) ENGINE=MyISAM;
+
+CREATE TABLE `{prefix}_{dirname}_costume` (
+  `costume_id` smallint(5) unsigned NOT NULL,
+  `costume_name` varchar(50) NOT NULL,
+  `grow_life` tinyint(4) NOT NULL,
+  `grow_soul` tinyint(4) NOT NULL,
+  `grow_pow` tinyint(4) NOT NULL,
+  `grow_str` tinyint(4) NOT NULL,
+  `grow_dex` tinyint(4) NOT NULL,
+  `grow_speed` tinyint(4) NOT NULL,
+  `grow_mag` tinyint(4) NOT NULL,
+  `grow_reg` tinyint(4) NOT NULL,
+  `grow_con` tinyint(4) NOT NULL,
+  `modify_hp` tinyint(4) NOT NULL,
+  `modify_tp` tinyint(4) NOT NULL,
+  `modify_at` tinyint(4) NOT NULL,
+  `modify_df` tinyint(4) NOT NULL,
+  `modify_mat` tinyint(4) NOT NULL,
+  `modify_mdf` tinyint(4) NOT NULL,
+  `modify_act` tinyint(4) NOT NULL,
+  `move_cost` tinyint(3) unsigned NOT NULL,
+  `regist_time` mediumint(8) unsigned NOT NULL,
+  PRIMARY KEY  (`costume_id`),
+  KEY `regist_time` (`regist_time`,`costume_id`)
+) ENGINE=MyISAM;
+
+CREATE TABLE `{prefix}_{dirname}_eno_pno_link` (
+  `eno` smallint(5) unsigned NOT NULL,
+  `pno` smallint(5) unsigned NOT NULL,
+  `regist_time` mediumint(8) unsigned NOT NULL,
+  PRIMARY KEY  (`eno`,`regist_time`),
+  KEY `pno` (`pno`)
+) ENGINE=MyISAM;
+
+CREATE TABLE `{prefix}_{dirname}_icon` (
+  `icon_id` smallint(5) unsigned NOT NULL auto_increment,
+  `eno` smallint(5) unsigned NOT NULL,
+  `slot` tinyint(3) unsigned NOT NULL,
+  `icon_url` varchar(255) NOT NULL,
+  `icon_height` tinyint(3) unsigned NOT NULL,
+  `icon_width` tinyint(3) unsigned NOT NULL,
+  `update_time` mediumint(8) unsigned NOT NULL,
+  PRIMARY KEY  (`icon_id`),
+  UNIQUE KEY `eno` (`eno`,`slot`,`update_time`),
+  KEY `update_time` (`update_time`,`eno`)
+) ENGINE=MyISAM;
+
+CREATE TABLE `{prefix}_{dirname}_image` (
+  `image_id` smallint(5) unsigned NOT NULL auto_increment,
+  `eno` smallint(5) unsigned NOT NULL,
+  `image_url` varchar(255) NOT NULL,
+  `image_height` smallint(5) unsigned NOT NULL,
+  `image_width` smallint(5) unsigned NOT NULL,
+  `image_link` varchar(255) NOT NULL,
+  `update_time` mediumint(8) unsigned NOT NULL,
+  PRIMARY KEY  (`image_id`),
+  UNIQUE KEY `eno` (`eno`,`update_time`),
+  KEY `update_time` (`update_time`)
+) ENGINE=MyISAM;
+
+CREATE TABLE `{prefix}_{dirname}_kind` (
+  `kind_id` tinyint(3) unsigned NOT NULL auto_increment,
+  `kind_name` varchar(20) NOT NULL,
+  `kind_kind` tinyint(3) unsigned NOT NULL,
+  `weight` tinyint(3) unsigned NOT NULL,
+  PRIMARY KEY  (`kind_id`),
+  UNIQUE KEY `kind_name` (`kind_name`)
+) ENGINE=MyISAM;
+
+CREATE TABLE `{prefix}_{dirname}_learned_ability` (
+  `eno` smallint(5) unsigned NOT NULL,
+  `ability_id` smallint(5) unsigned NOT NULL,
+  `regist_time` mediumint(8) unsigned NOT NULL,
+  PRIMARY KEY  (`eno`,`ability_id`),
+  KEY `ability_id` (`ability_id`),
+  KEY `regist_time` (`regist_time`,`eno`)
+) ENGINE=MyISAM;
+
+CREATE TABLE `{prefix}_{dirname}_learned_costume` (
+  `eno` smallint(5) unsigned NOT NULL,
+  `costume_id` smallint(5) unsigned NOT NULL,
+  `costume_lv` tinyint(3) unsigned NOT NULL,
+  `costume_point` tinyint(3) unsigned NOT NULL,
+  `regist_time` mediumint(8) unsigned NOT NULL,
+  PRIMARY KEY  (`eno`,`costume_id`),
+  KEY `costume_id` (`costume_id`),
+  KEY `regist_time` (`regist_time`,`eno`)
+) ENGINE=MyISAM;
+
+CREATE TABLE `{prefix}_{dirname}_learned_skill` (
+  `eno` smallint(5) unsigned NOT NULL,
+  `skill_id` smallint(5) unsigned NOT NULL,
+  `regist_time` mediumint(8) unsigned NOT NULL,
+  PRIMARY KEY  (`eno`,`skill_id`),
+  KEY `skill_id` (`skill_id`),
+  KEY `regist_time` (`regist_time`,`eno`)
+) ENGINE=MyISAM;
+
+CREATE TABLE `{prefix}_{dirname}_map` (
+  `map_id` tinyint(3) unsigned NOT NULL,
+  `x` tinyint(4) NOT NULL,
+  `y` tinyint(4) NOT NULL,
+  `spot_id` tinyint(3) unsigned NOT NULL,
+  `update_time` mediumint(8) unsigned NOT NULL,
+  PRIMARY KEY  (`map_id`,`x`,`y`,`update_time`),
+  KEY `spot_id` (`spot_id`)
+) ENGINE=MyISAM;
+
+CREATE TABLE `{prefix}_{dirname}_map_cache` (
+  `map_id` tinyint(3) unsigned NOT NULL,
+  `update_time` int(10) unsigned NOT NULL,
+  `map_range` varchar(255) NOT NULL,
+  `map_body` text NOT NULL,
+  PRIMARY KEY  (`map_id`,`update_time`)
+) ENGINE=MyISAM;
+
+CREATE TABLE `{prefix}_{dirname}_map_name` (
+  `map_id` tinyint(3) unsigned NOT NULL,
+  `map_name` varchar(50) NOT NULL,
+  `base_spot` tinyint(3) unsigned NOT NULL,
+  PRIMARY KEY  (`map_id`)
+) ENGINE=MyISAM;
+
+CREATE TABLE `{prefix}_{dirname}_map_spot` (
+  `spot_id` tinyint(3) unsigned NOT NULL auto_increment,
+  `spot_name` varchar(50) NOT NULL,
+  `description` text NOT NULL,
+  `regist_time` mediumint(8) unsigned NOT NULL,
+  PRIMARY KEY  (`spot_id`),
+  UNIQUE KEY `spot_name` (`spot_name`),
+  KEY `regist_time` (`regist_time`)
+) ENGINE=MyISAM;
+
+CREATE TABLE `{prefix}_{dirname}_race` (
+  `race_id` tinyint(4) unsigned NOT NULL auto_increment,
+  `race_name` varchar(50) NOT NULL,
+  PRIMARY KEY  (`race_id`),
+  UNIQUE KEY `race_name` (`race_name`)
+) ENGINE=MyISAM;
+
+CREATE TABLE `{prefix}_{dirname}_skill` (
+  `skill_id` smallint(5) unsigned NOT NULL,
+  `skill_name` varchar(50) NOT NULL,
+  `description` varchar(255) default NULL,
+  `range` tinyint(3) unsigned NOT NULL,
+  `target` tinyint(3) unsigned NOT NULL,
+  `kind` tinyint(3) unsigned NOT NULL,
+  `tp` smallint(5) unsigned NOT NULL,
+  `regist_time` mediumint(8) unsigned NOT NULL,
+  PRIMARY KEY  (`skill_id`),
+  KEY `kind` (`kind`,`tp`),
+  KEY `regist_time` (`regist_time`,`kind`)
+) ENGINE=MyISAM;
+
+CREATE TABLE `{prefix}_{dirname}_skill_element_link` (
+  `skill_id` smallint(5) unsigned NOT NULL,
+  `element` tinyint(4) NOT NULL,
+  PRIMARY KEY  (`skill_id`,`element`)
+) ENGINE=MyISAM;
+
+CREATE TABLE `{prefix}_{dirname}_status` (
+  `eno` smallint(5) unsigned NOT NULL,
+  `lv` tinyint(3) unsigned NOT NULL,
+  `life` smallint(5) unsigned NOT NULL,
+  `soul` smallint(5) unsigned NOT NULL,
+  `pow` smallint(5) unsigned NOT NULL,
+  `str` smallint(5) unsigned NOT NULL,
+  `dex` smallint(5) unsigned NOT NULL,
+  `speed` smallint(5) unsigned NOT NULL,
+  `mag` smallint(5) unsigned NOT NULL,
+  `reg` smallint(5) unsigned NOT NULL,
+  `con` smallint(5) unsigned NOT NULL,
+  `exp` smallint(5) unsigned NOT NULL,
+  `money` smallint(5) unsigned NOT NULL,
+  `sp` smallint(5) unsigned NOT NULL,
+  `base_hp` smallint(5) unsigned NOT NULL,
+  `base_at` smallint(5) unsigned NOT NULL,
+  `base_df` smallint(5) unsigned NOT NULL,
+  `base_mat` smallint(5) unsigned NOT NULL,
+  `base_mdf` smallint(5) unsigned NOT NULL,
+  `base_act` smallint(5) unsigned NOT NULL,
+  `base_move` smallint(5) unsigned NOT NULL,
+  `modify_hp` smallint(6) NOT NULL,
+  `modify_at` smallint(6) NOT NULL,
+  `modify_df` smallint(6) NOT NULL,
+  `modify_mat` smallint(6) NOT NULL,
+  `modify_mdf` smallint(6) NOT NULL,
+  `modify_act` smallint(6) NOT NULL,
+  `modify_move` smallint(6) NOT NULL,
+  `equip_hp` smallint(6) NOT NULL,
+  `equip_at` smallint(6) NOT NULL,
+  `equip_df` smallint(6) NOT NULL,
+  `equip_mat` smallint(6) NOT NULL,
+  `equip_mdf` smallint(6) NOT NULL,
+  `equip_act` smallint(6) NOT NULL,
+  `equip_move` smallint(6) NOT NULL,
+  PRIMARY KEY  (`eno`)
+) ENGINE=MyISAM;
+
+CREATE TABLE `{prefix}_{dirname}_target` (
+  `target_id` tinyint(3) unsigned NOT NULL auto_increment,
+  `target_name` varchar(10) NOT NULL,
+  `point` varchar(40) NOT NULL,
+  PRIMARY KEY  (`target_id`),
+  UNIQUE KEY `target_name` (`target_name`)
+) ENGINE=MyISAM;
+
+CREATE TABLE `{prefix}_{dirname}_update` (
+  `update_time` mediumint(8) unsigned NOT NULL,
+  PRIMARY KEY  (`update_time`)
+) ENGINE=MyISAM;
diff --git a/trust_path/modules/sd2nd/templates/sd2nd_ability_list.html b/trust_path/modules/sd2nd/templates/sd2nd_ability_list.html
new file mode 100644 (file)
index 0000000..74d2ef9
--- /dev/null
@@ -0,0 +1,48 @@
+<h3><{$smarty.const._MD_SD2ND_LANG_ABILITY_LIST}></h3>
+<p><{$smarty.const._MD_SD2ND_MES_ABILITY_LIST}></p>
+
+<form action="./index.php" method="get">
+  <fieldset>
+    <input type="hidden" name="action" value="AbilityList" />
+    <label for="ability_register_date">Date</label> : 
+    <select name="regist_time" id="ability_register_date">
+      <option value=""<{if $pageNavi->mExtra.regist_time == null}> selected="selected"<{/if}>>--</option>
+      <{foreach from=$updateHandler->getUpdateTimeList() item=t}>
+        <option value="<{$t->getShow('update_time')}>"<{if $pageNavi->mExtra.regist_time == $t->get('update_time')}> selected="selected"<{/if}>><{$t->getFormatDate()}></option>
+      <{/foreach}>
+    </select>
+    <label for="ability_cost">AC</label> : 
+    <select name="ability_cost" id="ability_cost">
+      <option value=""<{if $pageNavi->mExtra.ability_cost === null}> selected="selected"<{/if}>>--</option>
+      <{foreach from=0|range:8 item=ac}>
+        <option value="<{$ac|xoops_escape}>"<{if strval($ac) === $pageNavi->mExtra.ability_cost}> selected="selected"<{/if}>><{$ac|xoops_escape}></option>
+      <{/foreach}>
+    </select>
+    <input type="submit" />
+  </fieldset>
+</form>
+
+<{if count($objects) > 0}>
+  <div class="pagenavi"><{xoops_pagenavi pagenavi=$pageNavi}></div>
+  <table>
+    <thead>
+      <tr>
+        <th>ID</th>
+        <th>Name</th>
+        <th>Description</th>
+        <th>Cost</th>
+      </tr>
+    </thead>
+    <tbody>
+      <{foreach from=$objects item=obj}>
+        <tr class="<{cycle values='odd,even'}>">
+          <td><{$obj->getShow('ability_id')}></td>
+          <td><a href="./index.php?action=LearnedAbilityList&amp;ability_name=<{$obj->get('ability_name')|urlencode}>"><{$obj->getShow('ability_name')}></a></td>
+          <td><{$obj->getShow('description')}></td>
+          <td><{$obj->getShow('ability_cost')}></td>
+        </tr>
+      <{/foreach}>
+    </tbody>
+  </table>
+  <div class="pagenavi"><{xoops_pagenavi pagenavi=$pageNavi}></div>
+<{/if}>
\ No newline at end of file
diff --git a/trust_path/modules/sd2nd/templates/sd2nd_active_ability_list.html b/trust_path/modules/sd2nd/templates/sd2nd_active_ability_list.html
new file mode 100644 (file)
index 0000000..2f1ee39
--- /dev/null
@@ -0,0 +1,38 @@
+<h3><{$smarty.const._MD_SD2ND_LANG_ACTIVE_ABILITY_LIST}></h3>
+<p><{$smarty.const._MD_SD2ND_MES_ACTIVE_ABILITY_LIST}></p>
+<form action="./index.php" method="get">
+  <fieldset>
+    <input type="hidden" name="action" value="ActiveAbilityList" />
+    <input type="text" name="ability_name" value="<{$pageNavi->mExtra.ability_name|xoops_escape}>" />
+    <input type="submit" />
+  </fieldset>
+</form>
+
+<{if count($objects) > 0}>
+  <div class="pagenavi"><{xoops_pagenavi pagenavi=$pageNavi}></div>
+  <table class="outer">
+    <thead>
+      <tr>
+        <th><{$smarty.const._MD_SD2ND_LANG_FULL_NAME}></th>
+        <th><{$smarty.const._MD_SD2ND_LANG_SLOT}>1</th>
+        <th><{$smarty.const._MD_SD2ND_LANG_SLOT}>2</th>
+        <th><{$smarty.const._MD_SD2ND_LANG_SLOT}>3</th>
+        <th><{$smarty.const._MD_SD2ND_LANG_SLOT}>4</th>
+        <th><{$smarty.const._MD_SD2ND_LANG_SLOT}>5</th>
+      </tr>
+    </thead>
+    <tbody>
+      <{foreach from=$objects item=obj}>
+        <tr class="<{cycle values='odd,even'}>">
+          <td><a href="http://ragnarek.sakura.ne.jp/sd/rep/result/Chardata<{$obj->getShow('eno')}>.htm"><{$obj->getShow('name')}>&nbsp;(<{$obj->getShow('eno')}>)</a></td>
+          <td><{$obj->getShow('slot1')}></td>
+          <td><{$obj->getShow('slot2')}></td>
+          <td><{$obj->getShow('slot3')}></td>
+          <td><{$obj->getShow('slot4')}></td>
+          <td><{$obj->getShow('slot5')}></td>
+        </tr>
+      <{/foreach}>
+    </tbody>
+  </table>
+  <div class="pagenavi"><{xoops_pagenavi pagenavi=$pageNavi}></div>
+<{/if}>
diff --git a/trust_path/modules/sd2nd/templates/sd2nd_costume_list.html b/trust_path/modules/sd2nd/templates/sd2nd_costume_list.html
new file mode 100644 (file)
index 0000000..423f08e
--- /dev/null
@@ -0,0 +1,70 @@
+<h3><{$smarty.const._MD_SD2ND_LANG_COSTUME_LIST}></h3>
+<p><{$smarty.const._MD_SD2ND_MES_COSTUME_LIST}></p>
+
+<form action="./index.php" method="get">
+  <fieldset>
+    <input type="hidden" name="action" value="CostumeList" />
+    <select name="regist_time">
+      <option value=""<{if $pageNavi->mExtra.regist_time == null}> selected="selected"<{/if}>>--</option>
+      <{foreach from=$updateHandler->getUpdateTimeList() item=t}>
+        <option value="<{$t->getShow('update_time')}>"<{if $pageNavi->mExtra.regist_time == $t->get('update_time')}> selected="selected"<{/if}>><{$t->getFormatDate()}></option>
+      <{/foreach}>
+    </select>
+    <input type="submit" />
+  </fieldset>
+</form>
+
+<{if count($objects) > 0}>
+  <div class="pagenavi"><{xoops_pagenavi pagenavi=$pageNavi}></div>
+  <table summary="Costume List">
+    <thead>
+      <tr>
+        <th><{$smarty.const._MD_SD2ND_LANG_COSTUME_ID}></th>
+        <th><{$smarty.const._MD_SD2ND_LANG_COSTUME_NAME}></th>
+        <th><{$smarty.const._MD_SD2ND_LANG_GROW_LIFE}></th>
+        <th><{$smarty.const._MD_SD2ND_LANG_GROW_SOUL}></th>
+        <th><{$smarty.const._MD_SD2ND_LANG_GROW_POW}></th>
+        <th><{$smarty.const._MD_SD2ND_LANG_GROW_STR}></th>
+        <th><{$smarty.const._MD_SD2ND_LANG_GROW_DEX}></th>
+        <th><{$smarty.const._MD_SD2ND_LANG_GROW_SPEED}></th>
+        <th><{$smarty.const._MD_SD2ND_LANG_GROW_MAG}></th>
+        <th><{$smarty.const._MD_SD2ND_LANG_GROW_REG}></th>
+        <th><{$smarty.const._MD_SD2ND_LANG_GROW_CON}></th>
+        <th><{$smarty.const._MD_SD2ND_LANG_MODIFY_HP}></th>
+        <th><{$smarty.const._MD_SD2ND_LANG_MODIFY_TP}></th>
+        <th><{$smarty.const._MD_SD2ND_LANG_MODIFY_AT}></th>
+        <th><{$smarty.const._MD_SD2ND_LANG_MODIFY_DF}></th>
+        <th><{$smarty.const._MD_SD2ND_LANG_MODIFY_MAT}></th>
+        <th><{$smarty.const._MD_SD2ND_LANG_MODIFY_MDF}></th>
+        <th><{$smarty.const._MD_SD2ND_LANG_MODIFY_ACT}></th>
+        <th><{$smarty.const._MD_SD2ND_LANG_MOVE_COST}></th>
+      </tr>
+    </thead>
+    <tbody>
+      <{foreach from=$objects item=obj}>
+        <tr class="<{cycle values='odd,even'}>">
+          <td><{$obj->getShow('costume_id')}></td>
+          <td><{$obj->getShow('costume_name')}></td>
+          <td><{$obj->getShow('grow_life')}></td>
+          <td><{$obj->getShow('grow_soul')}></td>
+          <td><{$obj->getShow('grow_pow')}></td>
+          <td><{$obj->getShow('grow_str')}></td>
+          <td><{$obj->getShow('grow_dex')}></td>
+          <td><{$obj->getShow('grow_speed')}></td>
+          <td><{$obj->getShow('grow_mag')}></td>
+          <td><{$obj->getShow('grow_reg')}></td>
+          <td><{$obj->getShow('grow_con')}></td>
+          <td><{$obj->getShow('modify_hp')}></td>
+          <td><{$obj->getShow('modify_tp')}></td>
+          <td><{$obj->getShow('modify_at')}></td>
+          <td><{$obj->getShow('modify_df')}></td>
+          <td><{$obj->getShow('modify_mat')}></td>
+          <td><{$obj->getShow('modify_mdf')}></td>
+          <td><{$obj->getShow('modify_act')}></td>
+          <td><{$obj->getShow('move_cost')}></td>
+        </tr>
+      <{/foreach}>
+    </tbody>
+  </table>
+  <div class="pagenavi"><{xoops_pagenavi pagenavi=$pageNavi}></div>
+<{/if}>
diff --git a/trust_path/modules/sd2nd/templates/sd2nd_index.html b/trust_path/modules/sd2nd/templates/sd2nd_index.html
new file mode 100644 (file)
index 0000000..7649254
--- /dev/null
@@ -0,0 +1,21 @@
+<h3 id="map"><a href="index.php?action=MapView"><{$smarty.const._MD_SD2ND_LANG_MAP}></a></h3>
+
+<h3 id="char"><{$smarty.const._MD_SD2ND_LANG_PERSONAL}></h3>
+<dl>
+  <dt><a href="index.php?action=ActiveAbilityList"><{$smarty.const._MD_SD2ND_LANG_ACTIVE_ABILITY_LIST}></a></dt>
+  <dd><{$smarty.const._MD_SD2ND_INFO_ACTIVE_ABILITY_LIST}></dd>
+  <dt><a href="index.php?action=LearnedAbilityList"><{$smarty.const._MD_SD2ND_LANG_LEARNED_ABILITY_LIST}></a></dt>
+  <dd><{$smarty.const._MD_SD2ND_INFO_LEARNED_ABILITY_LIST}></dd>
+  <dt><a href="index.php?action=LearnedSkillList"><{$smarty.const._MD_SD2ND_LANG_LEARNED_SKILL_LIST}></a></dt>
+  <dd><{$smarty.const._MD_SD2ND_INFO_LEARNED_SKILL_LIST}></dd>
+</dl>
+
+<h3 id="general"><{$smarty.const._MD_SD2ND_LANG_GENERAL}></h3>
+<dl>
+  <dt><a href="index.php?action=AbilityList"><{$smarty.const._MD_SD2ND_LANG_ABILITY_LIST}></a></dt>
+  <dd><{$smarty.const._MD_SD2ND_INFO_ABILITY_LIST}></dd>
+  <dt><a href="index.php?action=CostumeList"><{$smarty.const._MD_SD2ND_LANG_COSTUME_LIST}></a></dt>
+  <dd><{$smarty.const._MD_SD2ND_INFO_COSTUME_LIST}></dd>
+  <dt><a href="index.php?action=SkillList"><{$smarty.const._MD_SD2ND_LANG_SKILL_LIST}></a></dt>
+  <dd><{$smarty.const._MD_SD2ND_INFO_SKILL_LIST}></dd>
+</dl>
diff --git a/trust_path/modules/sd2nd/templates/sd2nd_learned_ability_list.html b/trust_path/modules/sd2nd/templates/sd2nd_learned_ability_list.html
new file mode 100644 (file)
index 0000000..bc4a778
--- /dev/null
@@ -0,0 +1,19 @@
+<h3><{$smarty.const._MD_SD2ND_LANG_LEARNED_ABILITY_LIST}></h3>
+<p><{$smarty.const._MD_SD2ND_MES_LEARNED_ABILITY_LIST}></p>
+<form action="./index.php" method="get">
+  <fieldset>
+    <input type="hidden" name="action" value="LearnedAbilityList" />
+    <input type="text" name="ability_name" value="<{$pageNavi->mExtra.ability_name|xoops_escape}>" />
+    <input type="submit" />
+  </fieldset>
+</form>
+
+<{if count($objects) > 0}>
+  <div class="pagenavi"><{xoops_pagenavi pagenavi=$pageNavi}></div>
+  <ul>
+    <{foreach from=$objects item=obj}>
+      <li><a href="http://ragnarek.sakura.ne.jp/sd/rep/result/Chardata<{$obj->getShow('eno')}>.htm"><{$obj->getShow('name')}>&nbsp;(<{$obj->getShow('eno')}>)</a></li>
+    <{/foreach}>
+  </ul>
+  <div class="pagenavi"><{xoops_pagenavi pagenavi=$pageNavi}></div>
+<{/if}>
diff --git a/trust_path/modules/sd2nd/templates/sd2nd_learned_skill_list.html b/trust_path/modules/sd2nd/templates/sd2nd_learned_skill_list.html
new file mode 100644 (file)
index 0000000..17b237c
--- /dev/null
@@ -0,0 +1,19 @@
+<h3><{$smarty.const._MD_SD2ND_LANG_LEARNED_SKILL_LIST}></h3>
+<p><{$smarty.const._MD_SD2ND_MES_LEARNED_SKILL_LIST}></p>
+<form action="./index.php" method="get">
+  <fieldset>
+    <input type="hidden" name="action" value="LearnedSkillList" />
+    <input type="text" name="skill_name" value="<{$pageNavi->mExtra.skill_name|xoops_escape}>" />
+    <input type="submit" />
+  </fieldset>
+</form>
+
+<{if count($objects) > 0}>
+  <div class="pagenavi"><{xoops_pagenavi pagenavi=$pageNavi}></div>
+  <ul>
+    <{foreach from=$objects item=obj}>
+      <li><a href="http://ragnarek.sakura.ne.jp/sd/rep/result/Chardata<{$obj->getShow('eno')}>.htm"><{$obj->getShow('name')}>&nbsp;(<{$obj->getShow('eno')}>)</a></li>
+    <{/foreach}>
+  </ul>
+  <div class="pagenavi"><{xoops_pagenavi pagenavi=$pageNavi}></div>
+<{/if}>
diff --git a/trust_path/modules/sd2nd/templates/sd2nd_map_view.html b/trust_path/modules/sd2nd/templates/sd2nd_map_view.html
new file mode 100644 (file)
index 0000000..f39f0be
--- /dev/null
@@ -0,0 +1,30 @@
+<h3><{$smarty.const._MD_SD2ND_LANG_MAP}> &raquo; <{$mapName->getShow('map_name')}></h3>
+
+<form action="./index.php" method="get">
+  <fieldset>
+    <input type="hidden" name="action" value="MapView" />
+    Type : <select name="map">
+      <{foreach from=$mapNameHandler->getList() item=name}>
+        <option value="<{$name->getShow('map_id')}>"<{if $name->get('map_id') == $mapName->get('map_id')}> selected="selected"<{/if}>><{$name->getShow('map_name')}></option>
+      <{/foreach}>
+    </select>
+    Date : <select name="update_time">
+      <{foreach from=$updateHandler->getUpdateTimeList() item=obj name=dloop}>
+        <option value="<{$obj->getShow('update_time')}>"<{if (!isset($smarty.get.update_time) && $smarty.foreach.dloop.first) || isset($smarty.get.update_time) && $smarty.get.update_time == $obj->get('update_time')}> selected="selected"<{/if}>><{$obj->getFormatDate()}></option>
+      <{/foreach}>
+    </select>
+    <input type="submit" />
+  </fieldset>
+</form>
+
+<table id="sd_map" summary="map">
+  <tr>
+    <{foreach from=$map item=spot}>
+      <td class="map_spot_<{$spot->getShow('spot_id')}>"><img src="./images/icon/mapchip<{$spot->getShow('spot_id')}>.jpg" width="20" height="20" alt="<{$spot->getShow('spot_name')}>(<{$map->getDistance()}>)" title="<{$spot->getShow('spot_name')}>(<{$map->getDistance()}>)" /></td>
+      <{if $map->isMaxX() && !$map->isMaxY()}>
+        </tr>
+        <tr>
+      <{/if}>
+    <{/foreach}>
+  </tr>
+</table>
\ No newline at end of file
diff --git a/trust_path/modules/sd2nd/templates/sd2nd_skill_list.html b/trust_path/modules/sd2nd/templates/sd2nd_skill_list.html
new file mode 100644 (file)
index 0000000..13894f2
--- /dev/null
@@ -0,0 +1,73 @@
+<h3><{$smarty.const._MD_SD2ND_LANG_SKILL_LIST}></h3>
+<p><{$smarty.const._MD_SD2ND_MES_SKILL_LIST}></p>
+
+<form action="./index.php" method="get">
+  <fieldset>
+    <input type="hidden" name="action" value="SkillList" />
+    <label for="skill_register_date"><{$smarty.const._MD_SD2ND_LANG_REGIST_DATE}></label> : 
+    <select name="regist_time" id="skill_register_date">
+      <option value=""<{if $pageNavi->mExtra.regist_time == null}> selected="selected"<{/if}>>--</option>
+      <{foreach from=$updateHandler->getUpdateTimeList() item=t}>
+        <option value="<{$t->getShow('update_time')}>"<{if $pageNavi->mExtra.regist_time == $t->get('update_time')}> selected="selected"<{/if}>><{$t->getFormatDate()}></option>
+      <{/foreach}>
+    </select>
+    <label for="skill_range"><{$smarty.const._MD_SD2ND_LANG_RANGE}></label> : 
+    <select name="range" id="skill_range">
+      <option value=""<{if $pageNavi->mExtra.range === null}> selected="selected"<{/if}>>--</option>
+      <option value="0"<{if $pageNavi->mExtra.range === '0'}> selected="selected"<{/if}>><{$smarty.const._MD_SD2ND_LANG_WEAPON}></option>
+      <{foreach from='10'|range:40:5 item=r}>
+        <option value="<{$r|xoops_escape}>"<{if $r == $pageNavi->mExtra.range}> selected="selected"<{/if}>><{'%1.1f'|sprintf:$r*0.1}></option>
+      <{/foreach}>
+    </select>
+    <label for="skill_target"><{$smarty.const._MD_SD2ND_LANG_TARGET}></label> : 
+    <select name="target" id="skill_target">
+      <option value=""<{if $pageNavi->mExtra.target == null}> selected="selected"<{/if}>>--</option>
+      <{foreach from=$targetHandler->getList() item=t}>
+        <option value="<{$t->getShow('target_id')}>"<{if $t->get('target_id') == $pageNavi->mExtra.target}> selected="selected"<{/if}>><{$t->getShow('target_name')}></option>
+      <{/foreach}>
+    </select>
+    <label for="skill_kind"><{$smarty.const._MD_SD2ND_LANG_KIND}></label> : 
+    <select name="kind" id="skill_kind">
+      <option value=""<{if $pageNavi->mExtra.kind == null}> selected="selected"<{/if}>>--</option>
+      <{foreach from=$kindHandler->getList() item=k}>
+        <option value="<{$k->getShow('kind_id')}>"<{if $k->get('kind_id') == $pageNavi->mExtra.kind}> selected="selected"<{/if}>><{$k->getShow('kind_name')}></option>
+      <{/foreach}>
+    </select>
+    <input type="submit" />
+  </fieldset>
+</form>
+
+<{if count($objects) > 0}>
+  <div class="pagenavi"><{xoops_pagenavi pagenavi=$pageNavi}></div>
+  <table summary="Skill List">
+    <thead>
+      <th><{$smarty.const._MD_SD2ND_LANG_HP}></th>
+      <th><{$smarty.const._MD_SD2ND_LANG_NAME}></th>
+      <th><{$smarty.const._MD_SD2ND_LANG_DESC}></th>
+      <th><{$smarty.const._MD_SD2ND_LANG_RANGE}></th>
+      <th><{$smarty.const._MD_SD2ND_LANG_TARGET}></th>
+      <th><{$smarty.const._MD_SD2ND_LANG_ELEMENT}></th>
+      <th><{$smarty.const._MD_SD2ND_LANG_KIND}></th>
+      <th><{$smarty.const._MD_SD2ND_LANG_TP}></th>
+    </thead>
+    <tbody>
+      <{foreach from=$objects item=obj}>
+        <tr class="<{cycle values='odd,even'}>">
+          <td><{$obj->getShow('skill_id')}></td>
+          <td><a href="./index.php?action=LearnedSkillList&amp;skill_name=<{$obj->get('skill_name')|urlencode}>"><{$obj->getShow('skill_name')}></a></td>
+          <td><{$obj->getShow('description')}></td>
+          <td><{$obj->getShow('range')}></td>
+          <td><{$targetHandler->convertToView($obj->get('target'))}></td>
+          <td>
+            <{foreach from=$obj->getElements() item=elem}>
+              <{$elementLinkHandler->convertToView($elem)}>
+            <{/foreach}>
+          </td>
+          <td><{$kindHandler->convertToView($obj->get('kind'))}></td>
+          <td><{$obj->getShow('tp')}></td>
+        </tr>
+      <{/foreach}>
+    </tbody>
+  </table>
+  <div class="pagenavi"><{xoops_pagenavi pagenavi=$pageNavi}></div>
+<{/if}>
\ No newline at end of file
diff --git a/trust_path/modules/sd2nd/update.php b/trust_path/modules/sd2nd/update.php
new file mode 100644 (file)
index 0000000..05c1113
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!isset($argv[1]))
+{
+    die('Sorry, this script lanched command line only.');
+}
+
+error_reporting(E_ALL);
+
+define('SD2ND_UPDATE_TIME',isset($argv[2]) ? $argv[2] : substr($argv[1],-10,-4));
+define('SD2ND_PUBLIC_NAME','sd2nd');
+define('SD2ND_TRUST_PATH',dirname(__FILE__));
+define('_LEGACY_PREVENT_EXEC_COMMON_',true);
+
+require_once dirname(dirname(dirname(SD2ND_TRUST_PATH))) . '/public_html/mainfile.php';
+
+$_SERVER['REQUEST_METHOD'] = null;
+$root =& XCube_Root::getSingleton();
+$root->mController->executeCommonSubset();
+$root->mController->_setupLanguage();
+require_once XOOPS_ROOT_PATH . '/preload/lib/mydebugutils/htrace.php';
+require_once SD2ND_TRUST_PATH . '/class/AssetManager.class.php';
+require_once SD2ND_TRUST_PATH . '/class/updater/Sd2ndUpdater.class.php';
+require_once SD2ND_TRUST_PATH . '/language/japanese/main.php';
+
+$updater = new Sd2nd_Updater($argv[1]);
+$updater->prepare();
+$updater->execute();
+$updater->dispose();
+
+file_put_contents(SD2ND_TRUST_PATH . '/class/updater/backup/queries.txt',var_export($root->mController->mLogger->queries,true));
+
+?>
diff --git a/trust_path/modules/sd2nd/xoops_version.php b/trust_path/modules/sd2nd/xoops_version.php
new file mode 100644 (file)
index 0000000..023fca2
--- /dev/null
@@ -0,0 +1,181 @@
+<?php
+/**
+ * @file
+ * @package sd2nd
+ * @version $Id$
+**/
+
+if(!defined('XOOPS_ROOT_PATH'))
+{
+    exit;
+}
+
+if(!defined('SD2ND_TRUST_PATH'))
+{
+    define('SD2ND_TRUST_PATH',XOOPS_TRUST_PATH . '/modules/sd2nd');
+}
+
+require_once SD2ND_TRUST_PATH . '/class/Sd2ndUtils.class.php';
+
+//
+// Define a basic manifesto.
+//
+$modversion['name'] = _MI_SD2ND_LANG_SD2ND;
+$modversion['version'] = 0.01;
+$modversion['description'] = _MI_SD2ND_DESC_SD2ND;
+$modversion['author'] = _MI_SD2ND_LANG_AUTHOR;
+$modversion['credits'] = _MI_SD2ND_LANG_CREDITS;
+$modversion['help'] = 'help.html';
+$modversion['license'] = 'GPL';
+$modversion['official'] = 0;
+$modversion['image'] = 'images/sd2nd.png';
+$modversion['dirname'] = $myDirName;
+$modversion['trust_dirname'] = 'sd2nd';
+
+$modversion['cube_style'] = true;
+$modversion['legacy_installer'] = array(
+    'installer'   => array(
+        'class'     => 'Installer',
+        'namespace' => 'Sd2nd',
+        'filepath'  => SD2ND_TRUST_PATH . '/admin/class/installer/Sd2ndInstaller.class.php'
+    ),
+    'uninstaller' => array(
+        'class'     => 'Uninstaller',
+        'namespace' => 'Sd2nd',
+        'filepath'  => SD2ND_TRUST_PATH . '/admin/class/installer/Sd2ndUninstaller.class.php'
+    ),
+    'updater' => array(
+        'class'     => 'Updater',
+        'namespace' => 'Sd2nd',
+        'filepath'  => SD2ND_TRUST_PATH . '/admin/class/installer/Sd2ndUpdater.class.php'
+    )
+);
+$modversion['disable_legacy_2nd_installer'] = false;
+
+$modversion['sqlfile']['mysql'] = 'sql/mysql.sql';
+$modversion['tables'] = array(
+//    '{prefix}_{dirname}_xxxx',
+   '{prefix}_{dirname}_ability',
+   '{prefix}_{dirname}_active_ability',
+   '{prefix}_{dirname}_char',
+   '{prefix}_{dirname}_costume',
+   '{prefix}_{dirname}_eno_pno_link',
+   '{prefix}_{dirname}_icon',
+   '{prefix}_{dirname}_image',
+   '{prefix}_{dirname}_kind',
+   '{prefix}_{dirname}_learned_ability',
+   '{prefix}_{dirname}_learned_costume',
+   '{prefix}_{dirname}_learned_skill',
+   '{prefix}_{dirname}_map',
+   '{prefix}_{dirname}_map_cache',
+   '{prefix}_{dirname}_map_name',
+   '{prefix}_{dirname}_map_spot',
+   '{prefix}_{dirname}_race',
+   '{prefix}_{dirname}_skill',
+   '{prefix}_{dirname}_skill_element_link',
+   '{prefix}_{dirname}_status',
+   '{prefix}_{dirname}_target',
+   '{prefix}_{dirname}_update',
+##[cubson:tables]
+##[/cubson:tables]
+);
+
+//
+// Templates. You must never change [cubson] chunk to get the help of cubson.
+//
+$modversion['templates'] = array(
+/*
+    array(
+        'file'        => '{dirname}_xxx.html',
+        'description' => _MI_SD2ND_TPL_XXX
+    ),
+*/
+##[cubson:templates]
+    array('file' => '{dirname}_index.html','description' => _MI_SD2ND_TPL_INDEX),
+    array('file' => '{dirname}_map_view.html','description' => _MI_SD2ND_TPL_MAP_VIEW),
+    array('file' => '{dirname}_active_ability_list.html','description' => _MI_SD2ND_TPL_ACTIVE_ABILITY_LIST),
+    array('file' => '{dirname}_learned_ability_list.html','description' => _MI_SD2ND_TPL_LEARNED_ABILITY_LIST),
+    array('file' => '{dirname}_learned_skill_list.html','description' => _MI_SD2ND_TPL_LEARNED_SKILL_LIST),
+    array('file' => '{dirname}_learned_costume_list.html','description' => _MI_SD2ND_TPL_LEARNED_COSTUME_LIST),
+    array('file' => '{dirname}_ability_list.html','description' => _MI_SD2ND_TPL_ABILITY_LIST),
+    array('file' => '{dirname}_costume_list.html','description' => _MI_SD2ND_TPL_COSTUME_LIST),
+    array('file' => '{dirname}_skill_list.html','description' => _MI_SD2ND_TPL_SKILL_LIST),
+##[/cubson:templates]
+);
+
+//
+// Admin panel setting
+//
+$modversion['hasAdmin'] = 1;
+$modversion['adminindex'] = 'admin/index.php';
+$modversion['adminmenu'] = array(
+/*
+    array(
+        'title'    => _MI_SD2ND_LANG_XXXX,
+        'link'     => 'admin/index.php?action=xxx',
+        'keywords' => _MI_SD2ND_KEYWORD_XXX,
+        'show'     => true,
+        'absolute' => false
+    ),
+*/
+##[cubson:adminmenu]
+##[/cubson:adminmenu]
+);
+
+//
+// Public side control setting
+//
+$modversion['hasMain'] = 1;
+$modversion['hasSearch'] = 0;
+$modversion['sub'] = array(
+/*
+    array(
+        'name' => _MI_SD2ND_LANG_SUB_XXX,
+        'url'  => 'index.php?action=XXX'
+    ),
+*/
+##[cubson:submenu]
+##[/cubson:submenu]
+);
+
+//
+// Config setting
+//
+$modversion['config'] = array(
+/*
+    array(
+        'name'          => 'xxxx',
+        'title'         => '_MI_SD2ND_TITLE_XXXX',
+        'description'   => '_MI_SD2ND_DESC_XXXX',
+        'formtype'      => 'xxxx',
+        'valuetype'     => 'xxx',
+        'options'       => array(xxx => xxx,xxx => xxx),
+        'default'       => 0
+    ),
+*/
+##[cubson:config]
+##[/cubson:config]
+);
+
+//
+// Block setting
+//
+$modversion['blocks'] = array(
+/*
+    x => array(
+        'func_num'          => x,
+        'file'              => 'xxxBlock.class.php',
+        'class'             => 'xxx',
+        'name'              => _MI_SD2ND_BLOCK_NAME_xxx,
+        'description'       => _MI_SD2ND_BLOCK_DESC_xxx,
+        'options'           => '',
+        'template'          => '{dirname}_block_xxx.html',
+        'show_all_module'   => true,
+        'visible_any'       => true
+    ),
+*/
+##[cubson:block]
+##[/cubson:block]
+);
+
+?>