Esempio n. 1
0
 /**
  *
  */
 private function handleAjaxAction()
 {
     switch ($_GET['action']) {
         case 'getpins':
             $pins = new Db\Table\ProfilePins();
             $result = $pins->getAllByUser($_POST['userid']);
             $view = new View(true);
             if (!is_array($result)) {
                 $result = $result->toArray();
                 foreach ($result as $i => $res) {
                     $result[$i]['content'] = htmlspecialchars_decode($res['content']);
                 }
             } else {
                 $result = [];
             }
             $view->addData(["result" => $result]);
             $view->sendResponse();
             break;
     }
 }
Esempio n. 2
0
 /** @noinspection PhpUnusedPrivateMethodInspection */
 private function pinPositions()
 {
     $pins = new Db\Table\ProfilePins();
     if (isset($_POST['pins'])) {
         foreach ($_POST['pins'] as $i => $pin) {
             $pins->updatePosition($_POST['column'], $i, $pin);
         }
     }
 }