Using Button Functions
Jamroom Developers
this is what you're after:
{jrCore_item_list_buttons module="xxTrackme" item=$item exclude="jrCore_item_update_button,jrCore_item_delete_button"}as a template function.
OR you can use a listener to do it for your own module too.
code from the modules include.php file
<?php
defined('APP_DIR') or exit();
function xxTrackme_meta(){
$_tmp = array(
'name' => 'Trackme',
'url' => 'trackme',
'version' => '1.0.1',
'developer' => 'Noone, ©' . strftime('%Y'),
'description' => 'Just adds some icons and its own buttons to lists',
'category' => 'custom'
);
return $_tmp;
}
function xxTrackme_init(){
jrCore_register_module_feature('jrCore', 'quota_support', 'xxTrackme', 'on');
$_tmp = array(
'title' => 'Item Halt Button',
'icon' => 'halt',
'active' => 'on'
);
jrCore_register_module_feature('jrCore', 'item_list_button', 'xxTrackme', 'xxTrackme_item_halt_button', $_tmp);
jrCore_register_event_listener('jrCore', 'exclude_item_list_buttons', 'xxTrackme_exclude_item_list_buttons_listener');
return true;
}
function xxTrackme_item_halt_button($module, $_item, $_args, $smarty, $test_only = false){
if ($test_only) {
return true;
}
$_rt = array(
'url' => '#',
'onclick' => "alert('hello world')",
'icon' => 'halt',
'alt' => 'the alt text for the halt button here'
);
return $_rt;
}
function xxTrackme_exclude_item_list_buttons_listener($_data, $_user, $_conf, $_args, $event)
{
$_data['jrCore_item_update_button'] = true;
$_data['jrCore_item_delete_button'] = true;
return $_data;
}