Пример #1
0
     $new_layout->set_r($_POST['r']);
     $new_layout->set_d($_POST['d']);
     $currentListLayout = $dbHandler->read('layout');
     if ($currentListLayout != null) {
         if (is_array($currentListLayout)) {
             $tmparr = $currentListLayout;
         } else {
             $tmparr = get_object_vars($currentListLayout);
         }
         array_push($tmparr, (object) $new_layout->getAllData());
     } else {
         $tmparr = array((object) $new_layout->getAllData());
     }
     // $tmparr[]= (object) $new_layout->getAllData();
     $currentListLayout = $tmparr;
     $rs = $dbHandler->set("layout", $currentListLayout)->save();
     if ($rs) {
         $tmpdata = $new_layout->getAllData();
         $dbHandler->set("current_layout", $tmpdata)->save();
         echo json_encode(array('err' => 0));
     } else {
         echo json_encode(array('err' => 1));
     }
     break;
 case 'delete tmp file':
     $tmpFile = $_POST['listfile'];
     $exceptFile = $_POST['exceptfile'];
     $tmpFileArr = explode('@@@@', $tmpFile);
     foreach ($tmpFileArr as $key => $value) {
         if ($value != $exceptFile) {
             unlink($config['image_path'] . $value);