mirror of
https://github.com/processwire/processwire.git
synced 2025-08-23 14:56:51 +02:00
Prevent stars input from showing in InputfieldCommentsAdmin.module when stars feature is not enabled
This commit is contained in:
@@ -123,6 +123,16 @@ class InputfieldCommentsAdmin extends Inputfield implements InputfieldItemList {
|
|||||||
wireRelativeTimeStr($comment->created),
|
wireRelativeTimeStr($comment->created),
|
||||||
$cite
|
$cite
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if($this->hasField && $this->hasField->useStars) {
|
||||||
|
$starsInput =
|
||||||
|
"<p class='CommentsAdminItemStars'>" .
|
||||||
|
"<label for='$names[stars]'><span class='detail'>" . $this->_('Stars') . "</span></label>" .
|
||||||
|
"<input type='number' min='0' max='5' id='$names[stars]' name='$names[stars]' value='$stars' />" .
|
||||||
|
"</p>";
|
||||||
|
} else {
|
||||||
|
$starsInput = '';
|
||||||
|
}
|
||||||
|
|
||||||
$f->value =
|
$f->value =
|
||||||
"<div class='ui-helper-clearfix'>" .
|
"<div class='ui-helper-clearfix'>" .
|
||||||
@@ -147,10 +157,7 @@ class InputfieldCommentsAdmin extends Inputfield implements InputfieldItemList {
|
|||||||
"<label for='$names[website]'><span class='detail'>" . $this->_('Website') . "</span></label>" .
|
"<label for='$names[website]'><span class='detail'>" . $this->_('Website') . "</span></label>" .
|
||||||
"<input type='text' id='$names[website]' name='$names[website]' value='$website' />" .
|
"<input type='text' id='$names[website]' name='$names[website]' value='$website' />" .
|
||||||
"</p>" .
|
"</p>" .
|
||||||
"<p class='CommentsAdminItemStars'>" .
|
$starsInput .
|
||||||
"<label for='$names[stars]'><span class='detail'>" . $this->_('Stars') . "</span></label>" .
|
|
||||||
"<input type='number' min='0' max='5' id='$names[stars]' name='$names[stars]' value='$stars' />" .
|
|
||||||
"</p>" .
|
|
||||||
"</div>" .
|
"</div>" .
|
||||||
"<p class='CommentsAdminItemText'>" .
|
"<p class='CommentsAdminItemText'>" .
|
||||||
"<label for='$names[text]'><span class='detail'>" . $this->_('Text') . "</span></label>" .
|
"<label for='$names[text]'><span class='detail'>" . $this->_('Text') . "</span></label>" .
|
||||||
@@ -195,13 +202,14 @@ class InputfieldCommentsAdmin extends Inputfield implements InputfieldItemList {
|
|||||||
'cite',
|
'cite',
|
||||||
'email',
|
'email',
|
||||||
'website',
|
'website',
|
||||||
'stars',
|
|
||||||
'status',
|
'status',
|
||||||
'delete',
|
'delete',
|
||||||
'parent_id',
|
'parent_id',
|
||||||
'text',
|
'text',
|
||||||
'sort',
|
'sort',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if($this->hasField && $this->hasField->useStars) $names[] = 'stars';
|
||||||
|
|
||||||
foreach($this->value as $comment) {
|
foreach($this->value as $comment) {
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user