Skip to content

Commit

Permalink
Merge pull request #7 from blackcoder87/master
Browse files Browse the repository at this point in the history
Use ilch_html and purify() and update icons for FA6
  • Loading branch information
hhunderter authored Aug 10, 2023
2 parents fb78c94 + 68371f3 commit 597bcea
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 33 deletions.
13 changes: 8 additions & 5 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class Config extends \Ilch\Config\Install
{
public $config = [
'key' => 'radiohoerercharts',
'version' => '1.7.0',
'icon_small' => 'fa-list-ol',
'version' => '1.8.0',
'icon_small' => 'fa-solid fa-list-ol',
'author' => 'Reilard, Dennis alias hhunderter',
'link' => 'https://github.com/hhunderter/radiohoerercharts',
'official' => false,
Expand All @@ -28,8 +28,8 @@ class Config extends \Ilch\Config\Install
'description' => 'Here you can manage your Listener Charts.',
],
],
'ilchCore' => '2.1.41',
'phpVersion' => '7.0',
'ilchCore' => '2.1.52',
'phpVersion' => '7.3',
];

public function install()
Expand Down Expand Up @@ -164,7 +164,7 @@ public function getUpdate($installedVersion)
$databaseConfig->set('radio_hoerercharts_Program_Name', 'Hörercharts');
$fields = [
'author' => 'Reilard, Dennis alias hhunderter',
'icon_small' => 'fa-list-ol'
'icon_small' => 'fa-solid fa-list-ol'
];
$this->db()->update('modules')
->values($fields)
Expand Down Expand Up @@ -320,6 +320,9 @@ public function getUpdate($installedVersion)
->values($fields)
->where(['key' => 'radiohoerercharts'])
->execute();
case "1.7.0":
// Update icons for fontawesome 6
$this->db()->query("UPDATE `[prefix]_modules` SET `icon_small` = '" . $this->config['icon_small'] . "' WHERE `key` = '" . $this->config['key'] . "';");

}
return 'Update function executed.';
Expand Down
8 changes: 4 additions & 4 deletions controllers/admin/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ public function init()
[
'name' => 'manage',
'active' => false,
'icon' => 'fas fa-th-list',
'icon' => 'fa-solid fa-table-list',
'url' => $this->getLayout()->getUrl(['controller' => 'index', 'action' => 'index'])
],
[
'name' => 'reset',
'active' => false,
'icon' => 'fas fa-trash-alt',
'icon' => 'fa-solid fa-trash-can',
'url' => $this->getLayout()->getUrl(['controller' => 'index', 'action' => 'reset'])
],
[
'name' => 'settings',
'active' => false,
'icon' => 'fas fa-cogs',
'icon' => 'fa-solid fa-gears',
'url' => $this->getLayout()->getUrl(['controller' => 'settings', 'action' => 'index'])
]
];
Expand All @@ -46,7 +46,7 @@ public function init()
$items[0][0] = [
'name' => 'add',
'active' => false,
'icon' => 'fas fa-plus-circle',
'icon' => 'fa-solid fa-circle-plus',
'url' => $this->getLayout()->getUrl(['controller' => 'index', 'action' => 'treat'])
];
if ($this->getRequest()->getActionName() == 'treat') {
Expand Down
6 changes: 3 additions & 3 deletions controllers/admin/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ public function init()
[
'name' => 'manage',
'active' => false,
'icon' => 'fas fa-th-list',
'icon' => 'fa-solid fa-table-list',
'url' => $this->getLayout()->getUrl(['controller' => 'index', 'action' => 'index'])
],
[
'name' => 'reset',
'active' => false,
'icon' => 'fas fa-trash-alt',
'icon' => 'fa-solid fa-trash-can',
'url' => $this->getLayout()->getUrl(['controller' => 'index', 'action' => 'reset'])
],
[
'name' => 'settings',
'active' => true,
'icon' => 'fas fa-cogs',
'icon' => 'fa-solid fa-gears',
'url' => $this->getLayout()->getUrl(['controller' => 'settings', 'action' => 'index'])
]
];
Expand Down
4 changes: 2 additions & 2 deletions mappers/HoererCharts.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ public function getStars(int $votes = 0, bool $showstars = false)
}

$stars = '';
for ($i = 1; $i <= $starcount; $i++) $stars .= '<i class="fas fa-star text-warning"></i>';
for ($i = 1; $i <= 5-$starcount; $i++) $stars .= '<i class="far fa-star text-secondary"></i>';
for ($i = 1; $i <= $starcount; $i++) $stars .= '<i class="fa-solid fa-star text-warning"></i>';
for ($i = 1; $i <= 5-$starcount; $i++) $stars .= '<i class="fa-regular fa-star text-secondary"></i>';
} else {
$stars = $votes;
}
Expand Down
2 changes: 1 addition & 1 deletion translations/de.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
'active' => 'Aktiv',
'active_list' => 'Aktive Liste',
'list' => 'Liste',
'show_registered_by' => '"Eingetragen von" Info aneigen?',
'show_registered_by' => '"Eingetragen von" Info anzeigen?',
'show_artwork' => 'Cover anzeigen',
'show_artworkText' => '',
'selectactive_list' => '',
Expand Down
20 changes: 10 additions & 10 deletions views/admin/index/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<?php if (!$this->get('suggestion') && !$this->get('list')) {
?>
<div class="col-lg-6">
<?=$this->getTrans('votedatetime') ?><?=$this->get('votedatetime') ?> <a href="javascript:votedatetime()" title="<?=$this->getTrans('edit') ?>"><span class="fas fa-edit text-success"></span></a>
<?=$this->getTrans('votedatetime') ?><?=$this->get('votedatetime') ?> <a href="javascript:votedatetime()" title="<?=$this->getTrans('edit') ?>"><span class="fa-solid fa-pen-to-square text-success"></span></a>
</div>
<div class="form-group">
<label for="filterlist" class="col-lg-2 control-label">
Expand Down Expand Up @@ -104,7 +104,7 @@
<?php foreach ($this->get('listentries') as $entry) {
$listentries[] = $entry->getHId();
?>
<li class="handle_li" value="<?=$entry->getHId() ?>"><div><span class="fa fa-sort"></span> <?=$entry->getEntry()->getInterpret() ?> - <?=$entry->getEntry()->getSongTitel() ?></div></li>
<li class="handle_li" value="<?=$entry->getHId() ?>"><div><span class="fa-solid fa-sort"></span> <?=$entry->getEntry()->getInterpret() ?> - <?=$entry->getEntry()->getSongTitel() ?></div></li>
<?php } ?>
</ol>
</div>
Expand All @@ -114,7 +114,7 @@
<ol id="entries" class="sortable connectedSortable">
<?php foreach ($this->get('entries') as $entry) { ?>
<?php if (!in_array($entry->getId(), $listentries)) { ?>
<li class="handle_li" value="<?=$entry->getId() ?>"><div><span class="fa fa-sort"></span> <?=$entry->getInterpret() ?> - <?=$entry->getSongTitel() ?></div></li>
<li class="handle_li" value="<?=$entry->getId() ?>"><div><span class="fa-solid fa-sort"></span> <?=$entry->getInterpret() ?> - <?=$entry->getSongTitel() ?></div></li>
<?php } ?>
<?php } ?>
</ol>
Expand Down Expand Up @@ -168,35 +168,35 @@
<th>
<a href="<?=$this->getUrl(array_merge(['column' => 'interpret'], $urladd)) ?>" title="<?=$this->getTrans('interpret') ?>">
<?=$this->getTrans('interpret') ?>
<i class="fas fa-sort<?php echo $this->get('sort_column') == 'interpret' ? '-' . str_replace(['ASC', 'DESC'], ['up', 'down'], $this->get('sort_order')) : ''; ?>"></i>
<i class="fa-solid fa-sort<?php echo $this->get('sort_column') == 'interpret' ? '-' . str_replace(['ASC', 'DESC'], ['up', 'down'], $this->get('sort_order')) : ''; ?>"></i>
</a>
</th>
<th>
<a href="<?=$this->getUrl(array_merge(['column' => 'songtitel'], $urladd)) ?>" title="<?=$this->getTrans('songtitel') ?>">
<?=$this->getTrans('songtitel') ?>
<i class="fas fa-sort<?php echo $this->get('sort_column') == 'songtitel' ? '-' . str_replace(['ASC', 'DESC'], ['up', 'down'], $this->get('sort_order')) : ''; ?>"></i>
<i class="fa-solid fa-sort<?php echo $this->get('sort_column') == 'songtitel' ? '-' . str_replace(['ASC', 'DESC'], ['up', 'down'], $this->get('sort_order')) : ''; ?>"></i>
</a>
</th>
<?php if (!$this->get('suggestion')) {
?>
<th>
<a href="<?=$this->getUrl(array_merge(['column' => 'votes'], $urladd)) ?>" title="<?=$this->getTrans('vote') ?>">
<?=$this->getTrans('vote') ?>
<i class="fas fa-sort<?php echo $this->get('sort_column') == 'votes' ? '-' . str_replace(['ASC', 'DESC'], ['up', 'down'], $this->get('sort_order')) : ''; ?>"></i>
<i class="fa-solid fa-sort<?php echo $this->get('sort_column') == 'votes' ? '-' . str_replace(['ASC', 'DESC'], ['up', 'down'], $this->get('sort_order')) : ''; ?>"></i>
</a>
</th>
<?php
} ?>
<th>
<a href="<?=$this->getUrl(array_merge(['column' => 'datecreate'], $urladd)) ?>" title="<?=$this->getTrans('datecreate') ?>">
<?=$this->getTrans('datecreate') ?>
<i class="fas fa-sort<?php echo $this->get('sort_column') == 'datecreate' ? '-' . str_replace(['ASC', 'DESC'], ['up', 'down'], $this->get('sort_order')) : ''; ?>"></i>
<i class="fa-solid fa-sort<?php echo $this->get('sort_column') == 'datecreate' ? '-' . str_replace(['ASC', 'DESC'], ['up', 'down'], $this->get('sort_order')) : ''; ?>"></i>
</a>
</th>
<th>
<a href="<?=$this->getUrl(array_merge(['column' => 'user'], $urladd)) ?>" title="<?=$this->getTrans('user') ?>">
<?=$this->getTrans('user') ?>
<i class="fas fa-sort<?php echo $this->get('sort_column') == 'user' ? '-' . str_replace(['ASC', 'DESC'], ['up', 'down'], $this->get('sort_order')) : ''; ?>"></i>
<i class="fa-solid fa-sort<?php echo $this->get('sort_column') == 'user' ? '-' . str_replace(['ASC', 'DESC'], ['up', 'down'], $this->get('sort_order')) : ''; ?>"></i>
</a>
</th>
</tr>
Expand All @@ -212,13 +212,13 @@
<?php if (!$this->get('suggestion')) {
?>
<a href="<?=$this->getUrl(['action' => 'update', 'id' => $entry->getId(), 'status_man' => -1], null, true) ?>">
<span class="far fa-<?=($entry->getSetFree()?'check-':'') ?>square text-info"></span>
<span class="fa-regular fa-<?=($entry->getSetFree()?'check-':'') ?>square text-info"></span>
</a>
<?php
} else {
?>
<a href="<?=$this->getUrl(['action' => 'suggestionenable', 'id' => $entry->getId()], null, true) ?>">
<span class="fas fa-reply text-info"></span>
<span class="fa-solid fa-reply text-info"></span>
</a>
<?php
} ?>
Expand Down
4 changes: 2 additions & 2 deletions views/admin/settings/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,15 @@ class="form-control"
<textarea class="form-control ckeditor"
id="votetext_de"
name="votetext_de"
toolbar="ilch_bbcode"
toolbar="ilch_html"
required><?=$this->escape($this->originalInput('votetext_de', $this->get('votetext_de'))) ?></textarea>
</div>
<div class="form-group col-lg-6">
<label for="votetext_en"><?=$this->getTrans('english') ?></label>
<textarea class="form-control ckeditor"
id="votetext_en"
name="votetext_en"
toolbar="ilch_bbcode"
toolbar="ilch_html"
required><?=$this->escape($this->originalInput('votetext_en', $this->get('votetext_en'))) ?></textarea>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions views/admin/settings/votedatetime.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class="form-control"
name="start_datetime"
value="<?=$start_datetime ?>" />
<span class="input-group-addon">
<span class="fas fa-calendar"></span>
<span class="fa-solid fa-calendar"></span>
</span>
</div>
</div>
Expand All @@ -34,7 +34,7 @@ class="form-control"
name="end_datetime"
value="<?=$end_datetime ?>" />
<span class="input-group-addon">
<span class="fas fa-calendar"></span>
<span class="fa-solid fa-calendar"></span>
</span>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions views/index/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</h1>
<div class="teams" id="hoerercharts-container">
<div class="col-lg-12" id="hoerercharts-form-container">
<?=nl2br($this->getHtmlFromBBCode($this->escape($this->get('hoererchartsMapper')->getvotetext()))) ?>
<?=$this->purify($this->get('hoererchartsMapper')->getvotetext()) ?>
<?=((!$this->getUser() and !$hoererchartsconfig['guestallow'])?'':$this->getTrans('votetextvote')) ?><br><br>
<?php if ($this->get('voted')) {
?>
Expand Down Expand Up @@ -103,7 +103,7 @@
<?php if ($hoererchartsconfig['show_registered_by']) {
?>
<?php $User = $userMapper->getUserById($entry->getUser_Id()); ?>
<td><span class="fas fa-info-circle text-info" data-toggle="tooltip" data-placement="left" title="<?=$this->getTrans('registered_by') ?>: <?=(!$User?$this->getTrans('guest'):$this->escape($User->getName())) ?>"></span></td>
<td><span class="fa-solid fa-circle-info text-info" data-toggle="tooltip" data-placement="left" title="<?=$this->getTrans('registered_by') ?>: <?=(!$User?$this->getTrans('guest'):$this->escape($User->getName())) ?>"></span></td>
<?php
} ?>
</tr>
Expand Down Expand Up @@ -190,7 +190,7 @@
<?php if ($hoererchartsconfig['show_registered_by']) {
?>
<?php $User = $userMapper->getUserById($entry->getUser_Id()); ?>
<td><span class="fas fa-info-circle text-info" data-toggle="tooltip" data-placement="left" title="<?=$this->getTrans('registered_by') ?>: <?=(!$User?$this->getTrans('guest'):$this->escape($User->getName())) ?>"></span></td>
<td><span class="fa-solid fa-circle-info text-info" data-toggle="tooltip" data-placement="left" title="<?=$this->getTrans('registered_by') ?>: <?=(!$User?$this->getTrans('guest'):$this->escape($User->getName())) ?>"></span></td>
<?php
} ?>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion views/index/treat.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class="form-control"
document.getElementById('captcha').src='<?=$this->getUrl() ?>/application/libraries/Captcha/Captcha.php?'+Math.random();
document.getElementById('captcha-form').focus();"
id="change-image">
<i class="fas fa-sync"></i>
<i class="fa-solid fa-rotate"></i>
</a>
</span>
</div>
Expand Down

0 comments on commit 597bcea

Please sign in to comment.