Пример #1
0
// check if there is unsaved User object stored in Session
$edited_User = $Session->get('core.unsaved_User');
if ($edited_User == NULL) {
    // edited_User is the current_User
    $edited_User = $current_User;
} else {
    // unsaved user exists, delete it from Session
    $Session->delete('core.unsaved_User');
    if ($edited_User->ID != $current_User->ID) {
        // edited user ID must be the same as current User
        debug_die('Inconsistent state, you are allowed to edit only your profile');
    }
}
// Display tabs
echo '<div class="tabs">';
$entries = get_user_sub_entries(false, NULL);
foreach ($entries as $entry => $entry_data) {
    if ($entry == $disp) {
        echo '<div class="selected">';
    } else {
        echo '<div class="option">';
    }
    echo '<a href=' . $entry_data['href'] . '>' . $entry_data['text'] . '</a>';
    echo '</div>';
}
echo '</div>';
echo '<div class="clear"></div>';
// Display form
switch ($disp) {
    case 'profile':
        require $inc_path . 'users/views/_user_identity.form.php';
Пример #2
0
/**
 * Get usertab header. Contains the user avatar image, the user tab title, and the user menu.
 *
 * @param object edited User
 * @param string user tab name
 * @param string user tab title
 * @return string tab header
 */
function get_usertab_header($edited_User, $user_tab, $user_tab_title)
{
    global $AdminUI;
    // user status
    $user_status_icons = get_user_status_icons();
    $user_status_titles = get_user_statuses();
    $user_status = ' <small>(' . $user_status_icons[$edited_User->get('status')] . ' ' . $user_status_titles[$edited_User->get('status')] . ')</small>';
    // set title
    $form_title = '<h2 class="user_title">' . $edited_User->get_colored_login() . $user_status . ' &ndash; ' . $user_tab_title . '</h2>';
    // set avatar tag
    $avatar_tag = $edited_User->get_avatar_imgtag('crop-top-48x48', 'floatleft', '', true);
    // build menu3
    $AdminUI->add_menu_entries(array('users', 'users'), get_user_sub_entries(true, $edited_User->ID));
    $AdminUI->set_path('users', 'users', $user_tab);
    $user_menu3 = $AdminUI->get_html_menu(array('users', 'users'), 'menu3');
    $result = $avatar_tag . '<div class="user_header_content">' . $form_title . $user_menu3 . '</div>';
    return '<div class="user_header">' . $result . '</div>' . '<div class="clear"></div>';
}