public static function editsidebars(array &$sidebars)
 {
     // collect all id from checkboxes
     $items = array();
     foreach ($_POST as $key => $value) {
         if (strbegin($key, 'widgetcheck-')) {
             $items[] = (int) $value;
         }
     }
     foreach ($items as $id) {
         if ($pos = tsidebars::getpos($sidebars, $id)) {
             list($i, $j) = $pos;
             if (isset($_POST['deletewidgets'])) {
                 array_delete($sidebars[$i], $j);
             } else {
                 $i2 = (int) $_POST["sidebar-{$id}"];
                 $j2 = (int) $_POST["order-{$id}"];
                 if ($j2 > count($sidebars[$i2])) {
                     $j2 = count($sidebars[$i2]);
                 }
                 if ($i != $i2 || $j != $j2) {
                     $item = $sidebars[$i][$j];
                     array_delete($sidebars[$i], $j);
                     array_insert($sidebars[$i2], $item, $j2);
                 }
                 $sidebars[$i2][$j2]['ajax'] = isset($_POST["inlinecheck-{$id}"]) ? 'inline' : isset($_POST["ajaxcheck-{$id}"]);
             }
         }
     }
     //    return $this->html->h2->success;
 }
 public function getpos($id)
 {
     return tsidebars::getpos($this->sidebars, $id);
 }