echo '<div class="form_send_contacts">';
 $multi_action_icon = get_icon('multi_action', 'imgtag', array('style' => 'margin:0 2px 0 14px;position:relative;top:-5px;'));
 $Form->button_input(array('type' => 'button', 'value' => $module_contacts_list_params['title_selected'], 'onclick' => 'location.href=\'' . $module_contacts_list_params['recipients_link'] . '\'', 'id' => 'send_selected_recipients', 'input_prefix' => $multi_action_icon));
 echo '</div>';
 $Form->switch_layout('none');
 $Form->switch_template_parts(array('formstart' => '<div class="form_add_contacts">', 'labelstart' => '<span class="label">', 'labelend' => '</span> <span class="controls">', 'formend' => '</div>'));
 $Form->begin_form();
 $Form->add_crumb('messaging_contacts');
 $Form->hidden('users', '');
 if (isset($module_contacts_list_params['form_hiddens']) && !empty($module_contacts_list_params['form_hiddens'])) {
     // Append the hidden input elements from module
     foreach ($module_contacts_list_params['form_hiddens'] as $hidden_input) {
         $Form->hidden($hidden_input['name'], $hidden_input['value']);
     }
 }
 $Form->combo_box('group', param('group_combo', 'string', ''), get_contacts_groups_options(param('group', 'string', '-1'), false), $multi_action_icon . T_('Add all selected contacts to this group'), array('new_field_size' => '8'));
 $Form->buttons(array(array('submit', 'actionArray[add_group]', T_('Add'), 'SaveButton btn-primary btn-sm')));
 echo '</span>';
 if (isset($group_filtered)) {
     // Contacts list is filtered by group
     echo '<div id="edit_group_contacts" style="white-space:normal">';
     $Form->hidden('group_ID', $group_filtered->ID);
     echo '<p class="center">' . sprintf(T_('Selected group: <b>%s</b>'), $group_filtered->name) . '</p>';
     echo '<input id="send_group_recipients" type="button" onclick="location.href=\'' . $module_contacts_list_params['recipients_link'] . '&amp;group_ID=' . $group_filtered->ID . '\'" value="' . sprintf($module_contacts_list_params['title_group'], $group_filtered->count_users, $group_filtered->name) . '" style="margin: 1ex 0" /><br />';
     $Form->text_input('name', $group_filtered->name, 20, T_('Rename this group to'));
     $Form->button_input(array('name' => 'actionArray[rename_group]', 'value' => T_('Rename'), 'class' => 'SaveButton'));
     echo ' &nbsp; <b class="nowrap" style="padding-top:1em;line-height:32px">' . T_('or') . ' &nbsp; ';
     $Form->button_input(array('name' => 'actionArray[delete_group]', 'value' => T_('Delete this group'), 'class' => 'SaveButton', 'onclick' => 'return confirm("' . TS_('Are you sure want to delete this group?') . '")'));
     echo '</b>';
     echo '</div>';
 }
Example #2
0
    $ProfileForm->add_crumb('messaging_contacts');
    $ProfileForm->hidden('user_ID', $User->ID);
    $ProfileForm->output = false;
    $button_add_group = $ProfileForm->submit_input(array('name' => 'actionArray[add_user]', 'value' => T_('Add'), 'class' => 'SaveButton'));
    $ProfileForm->output = true;
    if (!empty($contacts_groups)) {
        // Display contacts groups for current User
        $ProfileForm->custom_content('<p><strong>' . T_('You can organize your contacts into groups. You can decide in which groups to put this user here:') . '</strong></p>');
        $ProfileForm->info(sprintf(T_('%s is'), $User->login), $contacts_groups);
        // Form to create a new group
        $ProfileForm->hidden('group_ID', 'new');
        $ProfileForm->text_input('group_ID_combo', param('group_ID_combo', 'string', ''), 18, T_('Create a new group'), '', array('field_suffix' => $button_add_group, 'maxlength' => 50));
    } else {
        if ($User->ID != $current_User->ID) {
            // Form to add this user into the group
            $ProfileForm->combo_box('group_ID', param('group_ID_combo', 'string', ''), get_contacts_groups_options(param('group', 'string', '-1'), false), T_('Add this user to a group'), array('new_field_size' => '8', 'field_suffix' => $button_add_group));
        }
    }
}
// Display Report User part
user_report_form(array('Form' => $ProfileForm, 'user_ID' => $User->ID, 'crumb_name' => 'messaging_contacts', 'cancel_url' => url_add_param($Blog->get('url'), 'disp=contacts&amp;user_ID=' . $User->ID . '&amp;action=remove_report&amp;' . url_crumb('messaging_contacts'))));
$ProfileForm->end_fieldset();
// Load the user fields:
$User->userfields_load();
// fp> TODO: have some clean iteration support
$group_ID = 0;
foreach ($User->userfields as $userfield) {
    if ($group_ID != $userfield->ufgp_ID) {
        // Start new group
        if ($group_ID > 0) {
            // End previous group