Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Should fix broken month navigation for instances installed in a subdir.

Adds thead/tbody to data tables
  • Loading branch information...
commit f23134f22a000108618ad72967dddc7100eb82bc 1 parent e94e979
@chimo authored
Showing with 8 additions and 3 deletions.
  1. +8 −3 social.php
View
11 social.php
@@ -106,10 +106,11 @@ function title()
function printNavigation($current_month) {
$month = clone($current_month);
+ $url = common_local_url('social');
$this->elementStart('ul', array('class' => 'social_nav'));
$this->elementStart('li', array('class' => 'prev'));
- $this->element('a', array('href' => '/social?month=' . $month->modify('-1 month')->format('Y-m')), _m('Previous Month'));
+ $this->element('a', array('href' => $url . '?month=' . $month->modify('-1 month')->format('Y-m')), _m('Previous Month'));
$this->elementEnd('li');
// Don't generate a 'next' link if the next month is in the future
@@ -117,7 +118,7 @@ function printNavigation($current_month) {
// if($today->format('Y-m') >= $month->modify('+2 month')->format('Y-m')) {
if($today >= $month->modify('+2 month')) {
$this->elementStart('li', array('class' => 'next'));
- $this->element('a', array('href' => '/social?month=' . $month->format('Y-m')), _m('Next Month'));
+ $this->element('a', array('href' => $url . '?month=' . $month->format('Y-m')), _m('Next Month'));
$this->elementEnd('li');
}
$this->elementEnd('ul');
@@ -135,14 +136,17 @@ function printGraph($name, $headers, $rows) {
// Data table
$this->elementStart('table', array('class' => 'social_table ' . $name . '_table'));
+ $this->elementStart('thead');
$this->elementStart('tr');
$this->element('td');
// First row (headers)
foreach($headers as $header) {
$this->element('th', null, $header);
}
- // Data rows
$this->elementEnd('tr');
+ $this->elementEnd('thead');
+ // Data rows
+ $this->elementStart('tbody');
foreach($rows as $row) {
$this->elementStart('tr');
$this->element('th', null, array_shift($row)); // First cell is a header
@@ -151,6 +155,7 @@ function printGraph($name, $headers, $rows) {
}
$this->elementEnd('tr');
}
+ $this->elementEnd('tbody');
$this->elementEnd('table');
}
Please sign in to comment.
Something went wrong with that request. Please try again.