Is there a way to add a default where statement for a SubPanelTopSelectButton?
Say for a Users Subpanel, any search returns all but current user (AND users.id != $current_user->id)
layout_defs file to add subpanel:
PHP Code:'users' => array(
'order' => 40,
'module' => 'Users',
'subpanel_name' => 'ForUsers',
'get_subpanel_data' => 'users',
'add_subpanel_data' => 'access_id',
'title_key' => 'LBL_USERS_ACCESS_SUBPANEL_TITLE',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect')
),
subpanel file used:
PHP Code:
$subpanel_layout = array(
'top_buttons' => array(
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Users'),
),
'where' => '',
'default_order_by' => '',
....
I've tried this in the subpanel file:
But it still returns the current user in results.PHP Code:global $current_user;
$subpanel_layout = array(
'top_buttons' => array(
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Users'),
),
'where' => "users.id != '" . $current_user->id . "'",
'default_order_by' => '',
....
Thanks,
Rey


LinkBack URL
About LinkBacks



Reply With Quote
Bookmarks