X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Faction.php;h=2a8f5677c571158e9cfc7e752900fed142ef2bbb;hb=f294eab92a4e44c0ad8790b7875173a1340f4b5c;hp=4d2aa02e2c33d1500739cd37e9aec0d689d541ac;hpb=c4462b152af09e6af254f8bb00d06554b2994689;p=quix0rs-gnu-social.git diff --git a/lib/action.php b/lib/action.php index 4d2aa02e2c..2a8f5677c5 100644 --- a/lib/action.php +++ b/lib/action.php @@ -194,11 +194,11 @@ class Action extends HTMLOutputter // lawsuit 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'); } @@ -208,7 +208,11 @@ class Action extends HTMLOutputter // lawsuit $this->showLogo(); $this->showPrimaryNav(); $this->showSiteNotice(); - $this->showNoticeForm(); + if (common_logged_in()) { + $this->showNoticeForm(); + } else { + $this->showAnonymousMessage(); + } $this->elementEnd('div'); } @@ -235,8 +239,9 @@ 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')); + $this->elementStart('ul', array('class' => 'nav')); if ($user) { $this->menuItem(common_local_url('all', array('nickname' => $user->nickname)), _('Home')); @@ -259,21 +264,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() @@ -282,9 +289,14 @@ class Action extends HTMLOutputter // lawsuit $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(); @@ -302,41 +314,49 @@ class Action extends HTMLOutputter // lawsuit { $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 @@ -364,7 +384,10 @@ class Action extends HTMLOutputter // lawsuit 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')), @@ -378,6 +401,8 @@ class Action extends HTMLOutputter // lawsuit $this->menuItem(common_local_url('doc', array('title' => 'contact')), _('Contact')); $this->elementEnd('ul'); + $this->elementEnd('dd'); + $this->elementEnd('dl'); } function showLicenses() @@ -399,7 +424,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 } @@ -409,16 +434,16 @@ 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.')); + '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'); } @@ -435,7 +460,7 @@ class Action extends HTMLOutputter // lawsuit return null; } - function is_readonly() + function isReadOnly() { return false; } @@ -504,14 +529,14 @@ class Action extends HTMLOutputter // lawsuit } } - 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__); @@ -568,7 +593,7 @@ class Action extends HTMLOutputter // lawsuit // 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) {