Merge branch '2.1.x'

This commit is contained in:
Marc Alexander
2015-06-21 23:01:45 +02:00
3 changed files with 31 additions and 3 deletions

View File

@@ -244,7 +244,7 @@ class main
return false; return false;
} }
if (in_array($column, array('left', 'right')) && $this->config['board3_' . $column . '_column']) if ($this->is_enabled_side_column($column))
{ {
++$this->module_count[$column]; ++$this->module_count[$column];
$template_module = $module->get_template_side($row['module_id']); $template_module = $module->get_template_side($row['module_id']);
@@ -258,6 +258,18 @@ class main
return $template_module; return $template_module;
} }
/**
* Check if column is enabled side column
*
* @param string $column Column string
*
* @return bool True if column is side column and enabled, false if not
*/
protected function is_enabled_side_column($column)
{
return in_array($column, array('left', 'right')) && ($this->config['board3_' . $column . '_column'] || $this->allowed_columns);
}
/** /**
* Check if portal needs to redirect to index page * Check if portal needs to redirect to index page
*/ */
@@ -302,7 +314,7 @@ class main
*/ */
protected function check_module_count($column, $config = true) protected function check_module_count($column, $config = true)
{ {
return $this->module_count[$column] > 0 && $config; return $this->module_count[$column] > 0 && ($config || $this->allowed_columns);
} }
/** /**

View File

@@ -2,7 +2,14 @@
.portal-body-center dd.posts, .portal-body-center dd.views { .portal-body-center dd.posts, .portal-body-center dd.views {
display: none !important; display: none !important;
} }
.portal-body-center dt { width: 130% !important; }
.portal-body-center ul.topiclist dt .list-inner {
margin-right: 60%;
}
.portal-body-center ul.topiclist dt {
margin-right: -60%;
}
.portal-body-center dd.lastpost { width: auto; } .portal-body-center dd.lastpost { width: auto; }
} }

View File

@@ -103,4 +103,13 @@ class main_test extends \board3\portal\tests\testframework\database_test_case
$this->assertNull($this->controller_main->handle(array('left' => 1))); $this->assertNull($this->controller_main->handle(array('left' => 1)));
$this->template->assert_same(null, 'S_PORTAL_ALL'); $this->template->assert_same(null, 'S_PORTAL_ALL');
} }
public function test_is_enabled_side_column()
{
$this->assertFalse($this->controller_main->get_module_template(array(), new \board3\portal\modules\clock($this->config, $this->template)));
$this->assertNull($this->controller_main->handle(array('left' => 1)));
$this->template->assert_same(true, 'S_PORTAL_ALL');
$this->config['board3_left_column'] = false;
$this->assertSame('clock_side.html', $this->controller_main->get_module_template(array('module_column' => 1), new \board3\portal\modules\clock($this->config, $this->template)));
}
} }