Say you want to change a field label on list page, side search panel, add, edit, view, etc (any page).
Add this to your After Application Initialized event:
function setFieldLabel($table, $field, $custom_label )
{
global $field_labels;
if(!array_key_exists($table,$field_labels))
return "";
@$field_labels[$table][mlang_getcurrentlang()][$field] = $custom_label;
}
Now in whichever page you need to update label simply add to before display event:
setFieldLabel('db_table_name', 'db_field_name', 'My Cool New Label');
I had to come up with this because the $xt->assign('fieldname', 'new_value'); example in manuals simply do not work for $label vars shown inside out html templates (when viewing them in visual editor in html mode).
Hope this helps folks
Marcelo Ramagem