ページにモジュールを追加する
処理モジュールの追加では下記の処理が行われる。
(1) ページとモジュールの関連付けを blocks テーブルに格納する。
(2) 追加したモジュールのブロックを表示する。
ソースコードwebapp/modules/pages/files/js/default/pages.js addBlock()
webapp/modules/pages/actionblock/addblock/Addblock.class.php
表示この状態で実行されているものは、view プログラムです。
実行されるプログラムは
install.iniで定義されている。
hello/install.ini
action_name="hello_view_main_init"
hello_view_main_init は下記のプログラムに対応する。
hello/view/main/init/Init.class.php
function execute()
{
return 'success';
}
successが return した場合の処理は、
maple.iniで定義される。
hello/view/main/init/maple.ini
success = "hello_view_main_init.html"
hello_view_main_init.html は下記のテンプレートに対応する。
hello/templates/default/hello_view_main_init.html
<{include file="hello_script.html"}>
編集 ボタンonclick すると dialog_blockstyle_view_edit_init が実行される。
<a title="編集" class="th_classic_default_btn link" href="#"
onclick="commonCls.sendPopupView(event,{
'action':'dialog_blockstyle_view_edit_init','page_id':12,'block_id':123,
'parent_id_name':'_123','prefix_id_name':'dialog_blockstyle'});
Event.stop(event); return false;">
編集</a>
削除 ボタンonclick すると pagesCls.deleteBlock が実行される。
<a title="削除" class="th_classic_default_btn link" href="#"
onmouseover="if(typeof(commonCls) != 'undefined') {
commonCls.imgChange(this,'close.gif','close_over.gif');}"
onmouseout="if(typeof(commonCls) != 'undefined') {
commonCls.imgChange(this,'close_over.gif','close.gif');}"
onclick="pagesCls.deleteBlock(
event, '_123','%sを削除します。<br />よろしいですか?');
Event.stop(event); return false;">
削除</a>