/** * Renders the user pictur and name rendering the appropriate icons * * @param Ai1ec_Facebook_Current_User $user the User currently logged into Facebook * * @return string the generated HTML */ private function render_user_pic_and_icons(Ai1ec_Facebook_Current_User $user) { $name = $user->get_name(); $id = $user->get_id(); $username = $user->get_username(); $alt_img = esc_attr__('Profile image', AI1EC_PLUGIN_NAME); $logged_in_text = esc_html__('Hi, you are signed in as:', AI1EC_PLUGIN_NAME); $type = Ai1ec_Facebook_Graph_Object_Collection::FB_USER; $cat_tag_html = $this->render_category_tag_div($user->get_category(), $user->get_tag(), $user->get_enable_comments(), $user->get_display_map()); $refresh_label = esc_attr__(' Refresh', AI1EC_PLUGIN_NAME); $remove_label = esc_attr__(' Unsubscribe', AI1EC_PLUGIN_NAME); $refresh_tip = esc_attr__('Refresh my events', AI1EC_PLUGIN_NAME); $remove_tip = esc_attr__('Unsubscribe from my events', AI1EC_PLUGIN_NAME); if (!$user->get_subscribed()) { $cat_tag_html = ''; } $html = <<<HTML <div id="profile-name">{$logged_in_text}</div> <div class="row-fluid"> \t<div class="ai1ec-facebook-subscriber ai1ec-facebook-items well pull-left" data-type="{$type}"> \t\t<img id="profile-img" class="ai1ec-facebook-pic pull-left" alt="{$alt_img}" src="https://graph.facebook.com/{$username}/picture" /> HTML; if ($user->get_subscribed()) { $html .= <<<HTML \t\t<div class="pull-right btn-group ai1ec-facebook-buttons"> \t\t\t<a class="ai1ec-facebook-refresh btn btn-mini" data-id="{$id}" title="{$refresh_tip}"><i class="icon-refresh"></i>{$refresh_label}</a> \t\t\t<a class="ai1ec-facebook-remove btn btn-mini logged" data-id="{$id}" title="{$remove_tip}"><i class="icon-remove"></i>{$remove_label}</a> \t\t</div> HTML; } $html .= <<<HTML \t\t<img src="images/wpspin_light.gif" class="ajax-loading-user hide pull-right" alt="" /> \t\t<div class="ai1ec-facebook-name"><big>{$name}</big></div> \t\t{$cat_tag_html} \t</div> </div> HTML; return $html; }