public function getResults(Request $request)
 {
     $list = Type::getList();
     $items = array();
     foreach ($list as $t) {
         $item = new \PortlandLabs\Concrete5\MigrationTool\Entity\Export\ConversationRatingType();
         $item->setItemId($t->getConversationRatingTypeID());
         $items[] = $item;
     }
     return $items;
 }
Beispiel #2
0
 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');
 }
Beispiel #3
0
 public function save()
 {
     if ($this->token->validate('conversation_points')) {
         $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');
     } else {
         $this->error->add(t('Invalid CSRF token. Please refresh and try again.'));
         $this->view();
     }
 }