Commit 0f8d67c8 authored by Tino Goratsch's avatar Tino Goratsch

- fixed a possible error when installing the feeds module

- minor user interface refinements
parent 92fcbd95
......@@ -3,7 +3,6 @@
namespace ACP3\Modules\ACP3\Feeds\Helper;
use ACP3\Core\Config;
use ACP3\Core\Router;
use ACP3\Core\RouterInterface;
use FeedWriter\ATOM;
......@@ -51,8 +50,6 @@ class FeedGenerator
{
$this->config = $config;
$this->router = $router;
$this->configure();
}
/**
......@@ -79,6 +76,10 @@ class FeedGenerator
protected function configure()
{
if ($this->renderer) {
return;
}
$this->settings = $this->config->getSettings('feeds');
switch ($this->settings['feed_type']) {
......@@ -121,6 +122,8 @@ class FeedGenerator
*/
public function assign(array $items)
{
$this->configure();
// Check for a multidimensional array
if (isset($items[0]) === true) {
foreach ($items as $row) {
......@@ -145,6 +148,8 @@ class FeedGenerator
*/
public function generateFeed()
{
$this->configure();
$this->generateChannel();
return $this->renderer->generateFeed();
}
......
......@@ -7,7 +7,7 @@
{redirect_message}
<form action="{uri args="acp/feeds"}" method="post" accept-charset="UTF-8" class="form-horizontal" data-ajax-form="true" data-ajax-form-loading-text="{lang t="system|loading_please_wait"}">
<div class="form-group">
<label for="feed-image" class="col-sm-2 control-label required">{lang t="feeds|feed_image"}</label>
<label for="feed-image" class="col-sm-2 control-label">{lang t="feeds|feed_image"}</label>
<div class="col-sm-10">
<input class="form-control" type="text" name="feed_image" id="feed-image" value="{$form.feed_image}" maxlength="120">
......@@ -17,7 +17,7 @@
<label for="feed-type" class="col-sm-2 control-label required">{lang t="feeds|feed_type"}</label>
<div class="col-sm-10">
<select class="form-control" name="feed_type" id="feed-type">
<select class="form-control" name="feed_type" id="feed-type" required>
{foreach $feed_types as $row}
<option value="{$row.value}"{$row.selected}>{$row.lang}</option>
{/foreach}
......
......@@ -20,7 +20,7 @@
<label for="nickname" class="col-sm-2 control-label required">{lang t="users|nickname"}</label>
<div class="col-sm-10">
<input class="form-control" type="text" name="nickname" id="nickname" value="{$form.nickname}" maxlength="30">
<input class="form-control" type="text" name="nickname" id="nickname" value="{$form.nickname}" maxlength="30" required>
</div>
</div>
<div class="form-group">
......@@ -31,10 +31,10 @@
</div>
</div>
<div class="form-group">
<label for="gender" class="col-sm-2 control-label">{lang t="users|gender"}</label>
<label for="gender" class="col-sm-2 control-label required">{lang t="users|gender"}</label>
<div class="col-sm-10">
<select class="form-control" name="gender" id="gender">
<select class="form-control" name="gender" id="gender" required>
{foreach $gender as $row}
<option value="{$row.value}"{$row.selected}>{$row.lang}</option>
{/foreach}
......@@ -52,7 +52,7 @@
<label for="roles" class="col-sm-2 control-label required">{lang t="permissions|roles"}</label>
<div class="col-sm-10">
<select class="form-control" name="roles[]" id="roles" multiple="multiple" style="height:100px">
<select class="form-control" name="roles[]" id="roles" multiple="multiple" required style="height:100px">
{foreach $roles as $row}
<option value="{$row.id}"{$row.selected}>{$row.name}</option>
{/foreach}
......@@ -243,11 +243,11 @@
{block PASSWORD_FIELDS}
<div class="form-group">
<label for="pwd" class="col-sm-2 control-label required">{lang t="users|pwd"}</label>
<div class="col-sm-10"><input class="form-control" type="password" name="pwd" id="pwd"></div>
<div class="col-sm-10"><input class="form-control" type="password" name="pwd" id="pwd" required></div>
</div>
<div class="form-group">
<label for="pwd-repeat" class="col-sm-2 control-label required">{lang t="users|pwd_repeat"}</label>
<div class="col-sm-10"><input class="form-control" type="password" name="pwd_repeat" id="pwd-repeat"></div>
<div class="col-sm-10"><input class="form-control" type="password" name="pwd_repeat" id="pwd-repeat" required></div>
</div>
{/block}
</div>
......
......@@ -18,7 +18,7 @@
<label for="nickname" class="col-sm-2 control-label required">{lang t="users|nickname"}</label>
<div class="col-sm-10">
<input class="form-control" type="text" name="nickname" id="nickname" value="{$form.nickname}" maxlength="30">
<input class="form-control" type="text" name="nickname" id="nickname" value="{$form.nickname}" maxlength="30" required>
</div>
</div>
<div class="form-group">
......@@ -29,10 +29,10 @@
</div>
</div>
<div class="form-group">
<label for="gender" class="col-sm-2 control-label">{lang t="users|gender"}</label>
<label for="gender" class="col-sm-2 control-label required">{lang t="users|gender"}</label>
<div class="col-sm-10">
<select class="form-control" name="gender" id="gender">
<select class="form-control" name="gender" id="gender" required>
{foreach $gender as $row}
<option value="{$row.value}"{$row.selected}>{$row.lang}</option>
{/foreach}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment