mình có 3 file global block như sau:
global.hotro.ini
<block> <info> <name>BlockHotro</name> </info> <config> <sonhanvien>1</sonhanvien> <bophan>0</bophan> <tennhanvien>0</tennhanvien> <sodienthoai>0</sodienthoai> <email>0</email> <skype></skype> </config> <datafunction>hotro_config</datafunction> <submitfunction>hotro_submit</submitfunction> <language> <sonhanvien>Số Nhân Viên </sonhanvien> <tennhanvien>Tên Nhân Viên</tennhanvien> <sodienthoai>Số Điện Thoại</sodienthoai> <bophan>Bộ Phận</bophan> <skype>tài khoản skype</skype> <email>tài khoản email/email> </language> </block>
global.hotro.php
<?php if (! defined('NV_MAINFILE')) { die('Stop!!!'); } if (! nv_function_exists('nv_hotro')) { function hotro_config($module, $data_block, $lang_block) { global $db, $site_mods; $html = ''; $html .= '<tr>'; $html .= ' <td><span>test</span></td>'; $html .= ' <td><input type="text" name="test" value="test">'; $html .= ' </td>'; $html .= '</tr>'; } function hotro_submit($module, $lang_block)//hotro_submit duoc dat giong voi ten trong the submitfunction trong file hotro.ini { global $nv_Request; $return = array(); $return['error'] = array(); $return['config'] = array(); $return['config']['test'] = $nv_Request->get_int('name thuoc tinh1', 'post', 0); return $return; } function nv_hotro($block_config) { global $global_config, $lang_global; if (file_exists(NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/blocks/global.hotro.tpl')) { $block_theme = $global_config['module_theme']; } elseif (file_exists(NV_ROOTDIR . '/themes/' . $global_config['site_theme'] . '/blocks/global.hotro.tpl')) { $block_theme = $global_config['site_theme']; } else { $block_theme = 'default'; } $xtpl = new XTemplate('global.hotro.tpl', NV_ROOTDIR . '/themes/' . $block_theme . '/blocks'); $xtpl->assign('DATA',$block_config); $xtpl->parse('main'); return $xtpl->text('main'); } } if (defined('NV_SYSTEM')){ $content=nv_hotro($block_config);}
và 1 file
global.hotro.tpl
mình đã khai báo hàm "function hotro_config($module, $data_block, $lang_block)" trong global.hotro.ini nhưng khi mở kéo thả block thì lại không thấy xuất hiện bảng cài đặt html. các bác test xem sai ở chỗ nào nhé