on('GET', '/inline/callback', inline('inline-locals', function () { return array('name' => 'dispatch'); })); on('GET', '/session/setup', function () { session('name', 'i am dispatch'); session('type', 'php framework'); }); on('GET', '/session/check', function () { session('type', null); if (session('type')) { echo "type is still set"; } echo session('name'); }); on('POST', '/upload', function () { $info = upload_info('attachment'); if (is_array($info) && is_uploaded_file($info['tmp_name'])) { echo "received {$info['name']}"; } else { echo "failed upload"; } }); on('GET', '/download', function () { send_file('./README.md', 'readme.txt', 60 * 60 * 24 * 365); }); prefix('books', function () { on('GET', '/list', function () { echo "book list"; }); prefix('chapters', function () { on('GET', '/list', function () {
public function preparePropUpload($src = "", $multi = 0) { global $thisSite; $dimMaxArray = explode("x", $this->dimMax); if (is_array($this->extensionsAuthorized)) { $ext = implode(",", $this->extensionsAuthorized); } else { $ext = $this->extensionsAuthorized; } if (is_array($this->dimThumbs)) { $dimThumbs = implode(",", $this->dimThumbs); } else { $dimThumbs = $this->dimThumbs; } upload_info($src, "../../../" . $thisSite->DOS_CLIENT_FILES . $this->startFolder . "/", $dimMaxArray, $dimThumbs, $ext, $multi); }
$datas["real_path"] = $real_path; $datas["real_path_urlencode"] = urlencode($real_path); $datas["KEY_TYPE"] = $item[File_List::KEY_TYPE]; $datas["KEY_NAME"] = $item[File_List::KEY_NAME]; $datas["KEY_NAME_htmlsc"] = htmlspecialchars($item[File_List::KEY_NAME]); $datas["KEY_NAME_urlencode"] = urlencode($item[File_List::KEY_NAME]); $datas["KEY_DATE"] = date('d/m/y H:i:s', $item[File_List::KEY_DATE]); $listing_filtred[$xx] = $datas; } $smarty->assign("listing_filtred", $listing_filtred); } $smarty->assign("getLastItemCount", $file_list->getLastItemCount()); $smarty->assign("getPagination", getPagination($file_list->getLastItemCount(), $start, $limit)); $smarty->assign("totPagination", $start + $limit > $file_list->getLastItemCount() ? $file_list->getLastItemCount() : $start + $limit); ////////////////////////// PREPARATION UPLOAD /////////////////////////////// upload_info("browse", $path, $dimMaxArray, $dimThumbs, $extensionsAuthorized); // //$upload_info = $datas_lang["upload_infoPoids"] . "<br>"; // //if ($dimMaxArray[0]==0 && $dimMaxArray[1]==0 ) { // $upload_info.= $datas_lang["upload_info0"]; //} else { // if ($dimMaxArray[0]>0 && $dimMaxArray[1]==0 ) { $upload_info.= $datas_lang["upload_info1"]; } // if ($dimMaxArray[0]==0 && $dimMaxArray[1]>0 ) { $upload_info.= $datas_lang["upload_info2"]; } // if ($dimMaxArray[0]>0 && $dimMaxArray[1]>0 ) { $upload_info.= $datas_lang["upload_info3"]; } //} // //if ($dimThumbs!="") { $upload_info.= "<br>" . $datas_lang["upload_infoThumbs"]; } // //$upload_info= str_replace("!!poidsmax!!", niceSize(POIDSMAX), $upload_info); //$upload_info= str_replace("!!wMax!!", $dimMaxArray[0], $upload_info);