Файл: concrete5.7.5.6/concrete/controllers/single_page/dashboard/system/conversations/points.php
Строк: 58
<?php
namespace ConcreteControllerSinglePageDashboardSystemConversations;
use ConcreteCorePageControllerDashboardPageController;
use Loader;
use ConcreteCoreConversationRatingType as ConversationRatingType;
class Points extends DashboardPageController
{
public function view()
{
$ratingTypes = array_reverse(ConversationRatingType::getList());
$this->set('ratingTypes', $ratingTypes);
}
public function success() {
$this->view();
$this->set('message', t('Rating types updated.'));
}
public function save() {
$db = Loader::db();
foreach (ConversationRatingType::getList() as $crt) {
$rtID = $crt->getConversationRatingTypeID();
$rtPoints = $this->post('rtPoints_' . $rtID);
if (is_string($rtPoints) && is_numeric($rtPoints)) {
$db->Execute('UPDATE ConversationRatingTypes SET cnvRatingTypeCommunityPoints = ? WHERE cnvRatingTypeID = ? LIMIT 1', array($rtPoints, $rtID));
}
}
$this->redirect('/dashboard/system/conversations/points', 'success');
}
}