summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/action.php25
-rw-r--r--lib/disfavorform.php12
-rw-r--r--lib/favorform.php11
-rw-r--r--lib/form.php12
-rw-r--r--lib/noticelist.php6
5 files changed, 53 insertions, 13 deletions
diff --git a/lib/action.php b/lib/action.php
index 52eee6d6a..4a164d8b0 100644
--- a/lib/action.php
+++ b/lib/action.php
@@ -235,6 +235,7 @@ class Action extends HTMLOutputter // lawsuit
{
$this->elementStart('dl', array('id' => 'site_nav_global_primary'));
$this->element('dt', null, _('Primary site navigation'));
+ $this->elementStart('dd');
$user = common_current_user();
$this->elementStart('ul', array('id' => 'nav'));
if ($user) {
@@ -259,21 +260,23 @@ class Action extends HTMLOutputter // lawsuit
$this->menuItem(common_local_url('doc', array('title' => 'help')),
_('Help'));
$this->elementEnd('ul');
+ $this->elementEnd('dd');
$this->elementEnd('dl');
}
// Revist. Should probably do an hAtom pattern here
function showSiteNotice()
{
- $this->elementStart('dl', array('id' => 'site_notice',
- 'class' => 'system_notice'));
- $this->element('dt', null, _('Site notice'));
- $this->elementStart('dd', null);
- // Output a bunch of paragraphs here
- $this->elementEnd('dd');
- $this->elementEnd('dl');
+ $text = common_config('site', 'notice');
+ if ($text) {
+ $this->elementStart('dl', array('id' => 'site_notice',
+ 'class' => 'system_notice'));
+ $this->element('dt', null, _('Site notice'));
+ $this->element('dd', null, $text);
+ $this->elementEnd('dl');
+ }
}
-
+
// MAY overload if no notice form needed... or direct message box????
function showNoticeForm()
@@ -404,7 +407,7 @@ class Action extends HTMLOutputter // lawsuit
}
$instr .= sprintf(_('It runs the [Laconica](http://laconi.ca/) microblogging software, version %s, available under the [GNU Affero General Public License](http://www.fsf.org/licensing/licenses/agpl-3.0.html).'), LACONICA_VERSION);
$output = common_markup_to_html($instr);
- common_raw($output);
+ $this->raw($output);
$this->elementEnd('dd');
// do it
}
@@ -414,12 +417,12 @@ class Action extends HTMLOutputter // lawsuit
$this->element('dt', array('id' => 'site_content_license'), _('Laconica software license'));
$this->elementStart('dd', array('id' => 'site_content_license_cc'));
$this->elementStart('p');
- common_text(_('Unless otherwise specified, contents of this site are copyright by the contributors and available under the '));
+ $this->text(_('Unless otherwise specified, contents of this site are copyright by the contributors and available under the '));
$this->element('a', array('class' => 'license',
'rel' => 'external license',
'href' => $config['license']['url']),
$config['license']['title']);
- common_text(_('. Contributors should be attributed by full name or nickname.'));
+ $this->text(_('. Contributors should be attributed by full name or nickname.'));
$this->elementEnd('p');
$this->element('img', array('id' => 'license_cc',
'src' => $config['license']['image'],
diff --git a/lib/disfavorform.php b/lib/disfavorform.php
index 25f99f43c..ffca0cd8b 100644
--- a/lib/disfavorform.php
+++ b/lib/disfavorform.php
@@ -127,4 +127,16 @@ class DisfavorForm extends Form
$this->out->submit('disfavor-submit-' . $this->notice->id,
_('Disfavor favorite'));
}
+
+ /**
+ * Class of the form.
+ *
+ * @return string the form's class
+ */
+
+ function formClass()
+ {
+ return 'disfavor';
+ }
+
} \ No newline at end of file
diff --git a/lib/favorform.php b/lib/favorform.php
index c67e18697..4f4fd72a9 100644
--- a/lib/favorform.php
+++ b/lib/favorform.php
@@ -127,4 +127,15 @@ class FavorForm extends Form
$this->out->submit('favor-submit-' . $this->notice->id,
_('Make a favorite'));
}
+
+ /**
+ * Class of the form.
+ *
+ * @return string the form's class
+ */
+
+ function formClass()
+ {
+ return 'favor';
+ }
} \ No newline at end of file
diff --git a/lib/form.php b/lib/form.php
index 5c75bb65f..bd68fb0c5 100644
--- a/lib/form.php
+++ b/lib/form.php
@@ -65,6 +65,7 @@ class Form extends Widget
{
$this->out->elementStart('form',
array('id' => $this->id(),
+ 'class' => $this->formClass(),
'method' => 'POST',
'action' => $this->action()));
$this->out->elementStart('fieldset');
@@ -153,4 +154,15 @@ class Form extends Widget
function action()
{
}
+
+ /**
+ * Class of the form.
+ *
+ * @return string the form's class
+ */
+
+ function formClass()
+ {
+ return 'form';
+ }
}
diff --git a/lib/noticelist.php b/lib/noticelist.php
index fb3e66f9f..0fc6d513f 100644
--- a/lib/noticelist.php
+++ b/lib/noticelist.php
@@ -229,9 +229,11 @@ class NoticeListItem extends Widget
$user = common_current_user();
if ($user) {
if ($user->hasFave($this->notice)) {
- common_disfavor_form($this->notice);
+ $disfavor = new DisfavorForm($this->out, $this->notice);
+ $disfavor->show();
} else {
- common_favor_form($this->notice);
+ $favor = new FavorForm($this->out, $this->notice);
+ $favor->show();
}
}
}