Skip to content

Commit

Permalink
Various small fixes
Browse files Browse the repository at this point in the history
- Fix some warnings
- Remove dead function getShoutboxById()
- Remove empty action attributes
- Update version numbers
  • Loading branch information
blackcoder87 committed Apr 22, 2018
1 parent e1c3ef7 commit e780aea
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 30 deletions.
2 changes: 1 addition & 1 deletion application/modules/forum/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Config extends \Ilch\Config\Install

public $config = [
'key' => 'forum',
'version' => '1.6',
'version' => '1.7',
'icon_small' => 'fa-list',
'author' => 'Stantin Thomas',
'link' => 'http://ilch.de',
Expand Down
3 changes: 2 additions & 1 deletion application/modules/forum/mappers/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,11 @@ public function getPostByTopicId($topicId, $pagination = null)
public function deleteById($id)
{
$this->trigger(ForumConfig::EVENT_DELETEPOST_BEFORE, ['id' => $id]);
return $this->db()->delete('forum_posts')
$returnValue = $this->db()->delete('forum_posts')
->where(['id' => $id])
->execute();
$this->trigger(ForumConfig::EVENT_DELETEPOST_AFTER, ['id' => $id]);
return $returnValue;
}

public function saveVisits(PostModel $model)
Expand Down
4 changes: 2 additions & 2 deletions application/modules/forum/mappers/Rank.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function getRanks()
* Get rank by id.
*
* @param integer $id
* @return ArticleModel
* @return RankModel
*/
public function getRankById($id)
{
Expand All @@ -63,7 +63,7 @@ public function getRankById($id)
* Get rank by posts.
*
* @param integer $posts
* @return ArticleModel
* @return RankModel
*/
public function getRankByPosts($posts)
{
Expand Down
6 changes: 3 additions & 3 deletions application/modules/forum/models/ForumStatistics.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ForumStatistics extends \Ilch\Model
/**
* Sets the id.
*
* @param integer $id
* @param integer $countPosts
*/
public function setCountPosts($countPosts)
{
Expand All @@ -57,7 +57,7 @@ public function getCountPosts()
/**
* Sets the id.
*
* @param integer $id
* @param integer $countTopics
*/
public function setCountTopics($countTopics)
{
Expand All @@ -76,7 +76,7 @@ public function getCountTopics()
/**
* Sets the id.
*
* @param integer $id
* @param integer $countUsers
*/
public function setCountUsers($countUsers)
{
Expand Down
1 change: 0 additions & 1 deletion application/modules/forum/translations/de.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
'noThreads' => 'Keine Themen vorhanden',
'noNewThreads' => 'Keine neuen Themen vorhanden',
'ranks' => 'Ränge',
'posts' => 'Beiträge',
'menuRanks' => 'Ränge',
'noRanks' => 'Keine Ränge vorhanden',
];
1 change: 0 additions & 1 deletion application/modules/forum/translations/en.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
'noThreads' => 'No Threads available',
'noNewThreads' => 'No new Threads available',
'ranks' => 'Ranks',
'posts' => 'Posts',
'menuRanks' => 'Ranks',
'noRanks' => 'No ranks available',
];
2 changes: 1 addition & 1 deletion application/modules/shoutbox/boxes/views/shoutbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@

<?php if (is_in_array($this->get('writeAccess'), explode(',', $config->get('shoutbox_writeaccess')))): ?>
<div id="shoutbox-form-container" style="display: none;">
<form class="form-horizontal" action="" method="post">
<form class="form-horizontal" method="post">
<?=$this->getTokenField() ?>
<div class="form-group hidden">
<label class="col-lg-2 control-label">
Expand Down
2 changes: 1 addition & 1 deletion application/modules/shoutbox/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Config extends \Ilch\Config\Install
{
public $config = [
'key' => 'shoutbox',
'version' => '1.0',
'version' => '1.1',
'icon_small' => 'fa-bullhorn',
'author' => 'Veldscholten, Kevin',
'link' => 'http://ilch.de',
Expand Down
14 changes: 1 addition & 13 deletions application/modules/shoutbox/mappers/Shoutbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function getShoutbox()
/**
* Gets the Shoutbox.
*
* @param null|int $limit
* @return ShoutboxModel[]|array
*/
public function getShoutboxLimit($limit = null)
Expand Down Expand Up @@ -73,19 +74,6 @@ public function getShoutboxLimit($limit = null)
return $shoutbox;
}

/**
* Gets shoutbox.
*
* @param integer $id
* @return ShoutboxModel|null
*/
public function getShoutboxById($id)
{
$shoutbox = $this->getShoutbox(['id' => $id]);

return reset($shoutbox);
}

/**
* Insert shoutbox model.
*
Expand Down
10 changes: 5 additions & 5 deletions application/modules/shoutbox/models/Shoutbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function getId()
* Sets the id of the shoutbox.
*
* @param int $id
* @return this
* @return $this
*/
public function setId($id)
{
Expand All @@ -80,7 +80,7 @@ public function getUid()
* Sets the uid of the shoutbox.
*
* @param string $uid
* @return this
* @return $this
*/
public function setUid($uid)
{
Expand All @@ -103,7 +103,7 @@ public function getName()
* Sets the name of the shoutbox.
*
* @param string $name
* @return this
* @return $this
*/
public function setName($name)
{
Expand All @@ -126,7 +126,7 @@ public function getTextarea()
* Sets the textarea of the shoutbox.
*
* @param string $textarea
* @return this
* @return $this
*/
public function setTextarea($textarea)
{
Expand All @@ -149,7 +149,7 @@ public function getTime()
* Sets the time of the shoutbox.
*
* @param string $time
* @return this
* @return $this
*/
public function setTime($time)
{
Expand Down
2 changes: 1 addition & 1 deletion application/modules/shoutbox/views/admin/index/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<h1><?=$this->getTrans('manage') ?></h1>
<?php if ($this->get('shoutbox') != ''): ?>
<form class="form-horizontal" method="POST" action="">
<form class="form-horizontal" method="POST">
<?=$this->getTokenField() ?>
<div class="table-responsive">
<table class="table table-hover table-striped">
Expand Down

0 comments on commit e780aea

Please sign in to comment.