예제 #1
0
 /**
  * Reorder entries
  *
  * @return  void
  */
 public function orderTask()
 {
     // Check for request forgeries
     Request::checkToken();
     $id = Request::getVar('id', array(0), 'post', 'array');
     \Hubzero\Utility\Arr::toInteger($id, array(0));
     $uid = $id[0];
     $inc = $this->_task == 'orderup' ? -1 : 1;
     $row = new Tables\Unit($this->database);
     $row->load($uid);
     $row->move($inc, 'offering_id=' . $this->database->Quote($row->offering_id));
     $offering = \Components\Courses\Models\Offering::getInstance(Request::getInt('offering', 0));
     foreach ($offering->units() as $unit) {
         $unit->store();
     }
     App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller . '&offering=' . Request::getInt('offering', 0), false));
 }