+ $this->elementStart('fb:if-section-not-added', array('section' => 'profile'));
+ $this->elementStart('span', array('id' => 'add_to_profile'));
+ $this->element('fb:add-section-button', array('section' => 'profile'));
+ $this->elementEnd('span');
+ $this->elementEnd('fb:if-section-not-added');
+
+ }
+
+
+ // Make this into a widget later
+ function showLocalNav()
+ {
+ $this->elementStart('ul', array('class' => 'nav'));
+
+ $this->elementStart('li', array('class' =>
+ ($this->action == 'facebookhome') ? 'current' : 'facebook_home'));
+ $this->element('a',
+ array('href' => 'index.php', 'title' => _('Home')), _('Home'));
+ $this->elementEnd('li');
+
+ if (common_config('invite', 'enabled')) {
+ $this->elementStart('li',
+ array('class' =>
+ ($this->action == 'facebookinvite') ? 'current' : 'facebook_invite'));
+ $this->element('a',
+ array('href' => 'invite.php', 'title' => _('Invite')), _('Invite'));
+ $this->elementEnd('li');
+ }
+
+ $this->elementStart('li',
+ array('class' =>
+ ($this->action == 'facebooksettings') ? 'current' : 'facebook_settings'));
+ $this->element('a',
+ array('href' => 'settings.php',
+ 'title' => _('Settings')), _('Settings'));
+ $this->elementEnd('li');
+
+ $this->elementEnd('ul');
+ }
+
+ /**
+ * Show header of the page.
+ *
+ * Calls template methods
+ *
+ * @return nothing
+ */
+ function showHeader()
+ {
+ $this->elementStart('div', array('id' => 'header'));
+ $this->showLogo();
+ $this->showNoticeForm();
+ $this->elementEnd('div');
+ }
+
+ /**
+ * Show page, a template method.
+ *
+ * @return nothing
+ */
+ function showPage($error = null, $success = null)
+ {
+ $this->startHTML();
+ $this->showHead($error, $success);
+ $this->showBody();
+ $this->endHTML();
+ }
+
+
+ function showInstructions()
+ {
+
+ $this->elementStart('div', array('class' => 'facebook_guide'));
+
+ $this->elementStart('dl', array('class' => 'system_notice'));
+ $this->element('dt', null, 'Page Notice');
+
+ $loginmsg_part1 = _('To use the %s Facebook Application you need to login ' .
+ 'with your username and password. Don\'t have a username yet? ');
+ $loginmsg_part2 = _(' a new account.');
+
+ $this->elementStart('dd');
+ $this->elementStart('p');
+ $this->text(sprintf($loginmsg_part1, common_config('site', 'name')));
+ if (!common_config('site', 'openidonly')) {
+ $this->element('a',
+ array('href' => common_local_url('register')), _('Register'));
+ } else {
+ $this->element('a',
+ array('href' => common_local_url('openidlogin')), _('Register'));
+ }
+ $this->text($loginmsg_part2);
+ $this->elementEnd('p');
+ $this->elementEnd('dd');
+
+ $this->elementEnd('dl');
+ $this->elementEnd('div');
+ }
+
+
+ function showLoginForm($msg = null)
+ {
+
+ $this->elementStart('div', array('id' => 'content'));
+ $this->element('h1', null, _('Login'));
+
+ if ($msg) {
+ $this->element('fb:error', array('message' => $msg));
+ }
+
+ $this->showInstructions();
+
+ $this->elementStart('div', array('id' => 'content_inner'));
+
+ $this->elementStart('form', array('method' => 'post',
+ 'class' => 'form_settings',
+ 'id' => 'login',
+ 'action' => 'index.php'));
+
+ $this->elementStart('fieldset');
+
+ $this->elementStart('ul', array('class' => 'form_datas'));
+ $this->elementStart('li');
+ $this->input('nickname', _('Nickname'));
+ $this->elementEnd('li');
+ $this->elementStart('li');
+ $this->password('password', _('Password'));
+ $this->elementEnd('li');
+ $this->elementEnd('ul');
+
+ $this->submit('submit', _('Login'));
+ $this->elementEnd('fieldset');
+ $this->elementEnd('form');
+
+ $this->elementStart('p');
+ $this->element('a', array('href' => common_local_url('recoverpassword')),
+ _('Lost or forgotten password?'));
+ $this->elementEnd('p');
+
+ $this->elementEnd('div');
+ $this->elementEnd('div');
+
+ }
+
+
+ function updateProfileBox($notice)
+ {
+
+ // Need to include inline CSS for styling the Profile box
+
+ $app_props = $this->facebook->api_client->Admin_getAppProperties(array('icon_url'));
+ $icon_url = $app_props['icon_url'];
+
+ $style = '<style>
+ .entry-title *,
+ .entry-content * {
+ font-size:14px;
+ font-family:"Lucida Sans Unicode", "Lucida Grande", sans-serif;
+ }
+ .entry-title a,
+ .entry-content a {
+ color:#002E6E;
+ }
+
+ .entry-title .vcard .photo {
+ float:left;
+ display:inline;
+ margin-right:11px;
+ margin-bottom:11px