コード例 #1
0
 /**
  * Presun na vyssi uroven zanoreni (hloubeji)
  * @param int $id
  */
 public function right($id)
 {
     $finder = new NodeFinder($this->getTree());
     $previous = $finder->findPrevious($id);
     if ($previous) {
         $this->setParent($id, $previous['id']);
     }
 }
コード例 #2
0
 /**
  * Presun na vyssi pozici
  * @param int $id
  */
 public function up($id)
 {
     $finder = new NodeFinder($this->getTree());
     $current = $finder->findCurrent($id);
     $previous = $finder->findPrevious($id);
     if ($previous) {
         $this->swapDirection($previous, $current);
     } else {
         $last = $finder->findLast($id);
         $this->verticalTreeModelAdapter->setPriority($current['id'], $last['priority'] + 1);
     }
 }