function showBody()
{
$this->elementStart('body');
- $this->elementStart('wrap');
+ $this->elementStart('div', 'wrap');
$this->showHeader();
$this->showCore();
$this->showFooter();
- $this->elementEnd('wrap');
+ $this->elementEnd('div', 'wrap');
$this->elementEnd('body');
}
$this->showLogo();
$this->showPrimaryNav();
$this->showSiteNotice();
- $this->showNoticeForm();
+ if (common_logged_in()) {
+ $this->showNoticeForm();
+ } else {
+ $this->showAnonymousMessage();
+ }
$this->elementEnd('div');
}
{
$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'));
+ $this->elementStart('ul', array('class' => 'nav'));
if ($user) {
$this->menuItem(common_local_url('all', array('nickname' => $user->nickname)),
_('Home'));
$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()
$notice_form->show();
}
+ function showAnonymousMessage()
+ {
+ // needs to be defined by the class
+ }
+
function showCore()
{
- $this->elementStart('div', array('class' => 'core'));
+ $this->elementStart('div', array('id' => 'core'));
$this->showLocalNav();
$this->showContentBlock();
$this->showAside();
{
$this->elementStart('div', array('id' => 'content'));
$this->showPageTitle();
- $this->showPageNotice();
+ $this->showPageNoticeBlock();
+ $this->elementStart('div', array('id' => 'content_inner'));
+ // show the actual content (forms, lists, whatever)
$this->showContent();
$this->elementEnd('div');
+ $this->elementEnd('div');
}
function showPageTitle() {
$this->element('h1', NULL, $this->title());
}
+ function showPageNoticeBlock()
+ {
+ $this->elementStart('dl', array('id' => 'page_notice',
+ 'class' => 'system_notice'));
+ $this->element('dt', null, _('Page notice'));
+ $this->elementStart('dd', null);
+ $this->showPageNotice();
+ $this->elementEnd('dd');
+ $this->elementEnd('dl');
+ }
+ }
+
// SHOULD overload (unless there's not a notice)
function showPageNotice()
{
- $this->elementStart('dl', array('id' => 'page_notice',
- 'class' => 'system_notice'));
- $this->element('dt', null, _('Page notice'));
- $this->elementStart('dd', null);
- // Output a bunch of paragraphs here
- $this->elementEnd('dd');
- $this->elementEnd('dl');
}
-
+
// MUST overload
function showContent()
{
- // show the actual content (forms, lists, whatever)
- $this->elementStart('div', array('id' => 'content_inner'));
- $this->elementEnd('div');
}
function showAside()
{
+ $this->elementStart('div', array('id' => 'aside_primary',
+ 'class' => 'aside'));
$this->showExportData();
$this->showSections();
+ $this->elementEnd('div');
}
// MAY overload if there are feeds
function showSecondaryNav()
{
- $this->elementStart('ul', array('id' => 'nav_sub'));
+ $this->elementStart('dl', array('id' => 'site_nav_global_secondary'));
+ $this->element('dt', null, _('Secondary site navigation'));
+ $this->elementStart('dd', null);
+ $this->elementStart('ul', array('class' => 'nav'));
$this->menuItem(common_local_url('doc', array('title' => 'help')),
_('Help'));
$this->menuItem(common_local_url('doc', array('title' => 'about')),
$this->menuItem(common_local_url('doc', array('title' => 'contact')),
_('Contact'));
$this->elementEnd('ul');
+ $this->elementEnd('dd');
+ $this->elementEnd('dl');
}
function showLicenses()
}
$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
}
$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.'));
+ 'href' => common_config('license', 'url')),
+ common_config('license', 'title'));
+ $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'],
- 'alt' => $config['license']['title']));
+ 'src' => common_config('license', 'image'),
+ 'alt' => common_config('license', 'title')));
$this->elementEnd('dd');
}
return null;
}
- function is_readonly()
+ function isReadOnly()
{
return false;
}
}
}
- function server_error($msg, $code=500)
+ function serverError($msg, $code=500)
{
$action = $this->trimmed('action');
common_debug("Server error '$code' on '$action': $msg", __FILE__);
common_server_error($msg, $code);
}
- function client_error($msg, $code=400)
+ function clientError($msg, $code=400)
{
$action = $this->trimmed('action');
common_debug("User error '$code' on '$action': $msg", __FILE__);
// Added @id to li for some control.
// XXX: We might want to move this to htmloutputter.php
- function menuItem($url, $text, $id=null, $title=null, $is_selected=false)
+ function menuItem($url, $text, $title=null, $is_selected=false, $id=null)
{
$lattrs = array();
if ($is_selected) {