<?php
/**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
*
* Low-level generator for HTML
*
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @category Faceboook
- * @package Laconica
- * @author Zach Copley <zach@controlyourself.ca>
- * @copyright 2008 Control Yourself, Inc.
+ * @package StatusNet
+ * @author Zach Copley <zach@status.net>
+ * @copyright 2008 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
-if (!defined('LACONICA'))
+if (!defined('STATUSNET') && !defined('LACONICA'))
{
exit(1);
}
require_once INSTALLDIR.'/lib/facebookutil.php';
require_once INSTALLDIR.'/lib/noticeform.php';
-
class FacebookAction extends Action
{
}
-
// Make this into a widget later
function showLocalNav()
{
$this->endHTML();
}
-
function showInstructions()
{
$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->element('a',
+ array('href' => common_local_url('register')), _('Register'));
$this->text($loginmsg_part2);
$this->elementEnd('p');
$this->elementEnd('dd');
$this->elementEnd('div');
}
-
function showLoginForm($msg = null)
{
}
-
function updateProfileBox($notice)
{
display:inline-block;
}
- #facebook_laconica_app {
+ #facebook_statusnet_app {
text-indent:-9999px;
height:16px;
width:16px;
$this->xw->openURI('php://output');
}
-
/**
* Generate pagination links
*
} else {
$content_shortened = common_shorten_links($content);
- if (mb_strlen($content_shortened) > 140) {
- $this->showPage(_('That\'s too long. Max notice size is 140 chars.'));
+ if (Notice::contentTooLong($content_shortened)) {
+ $this->showPage(sprintf(_('That\'s too long. Max notice size is %d chars.'),
+ Notice::maxContent()));
return;
}
}
$replyto = $this->trimmed('inreplyto');
- $notice = Notice::saveNew($user->id, $content,
- 'web', 1, ($replyto == 'false') ? null : $replyto);
-
- if (is_string($notice)) {
- $this->showPage($notice);
+ try {
+ $notice = Notice::saveNew($user->id, $content,
+ 'web', 1, ($replyto == 'false') ? null : $replyto);
+ } catch (Exception $e) {
+ $this->showPage($e->getMessage());
return;
}
$this->app_uri = 'http://apps.facebook.com/' . $app_props['canvas_name'];
$this->app_name = $app_props['application_name'];
- $this->out->elementStart('a', array('id' => 'facebook_laconica_app',
+ $this->out->elementStart('a', array('id' => 'facebook_statusnet_app',
'href' => $this->app_uri));
$this->out->text($this->app_name);
$this->out->elementEnd('a');