Changeset 130
- Timestamp:
- 19/09/06 23:38:29 (7 years ago)
- Files:
-
- 3 modified
-
components/static.php (modified) (2 diffs)
-
htdocs/index.php (modified) (1 diff)
-
templates/index.tpl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
components/static.php
r128 r130 49 49 case "Save": 50 50 // ...save the file 51 file_put_contents($myfile, $_REQUEST['body'], LOCK_EX); 51 $savesuccess = @file_put_contents($myfile, $_REQUEST['body'], LOCK_EX); 52 if (!$savesuccess) $smarty->assign("fileerror", "Write failed"); 53 $id = $DB->GetOne("select id from static where path=?", array($path)); 54 $record = array(); 55 $record['summary'] = $_REQUEST['summary']; 56 $record['editor'] = $session->username; 57 $record['path'] = $path; 58 if ($id>0) { 59 $DB->AutoExecute("static", $record, 'UPDATE', 'id = $id'); 60 } else { 61 $DB->AutoExecute("static", $record, 'INSERT'); 62 } 52 63 // probably need some error-handling here... 53 64 break; … … 83 94 case "edit": 84 95 $smarty->assign("editcontent", htmlentities($body)); 85 $body = $smarty->fetch('static_edit.tpl'); 96 $record['summary'] = $DB->GetOne("select summary from static where path=?", array($path)); 97 $smarty->assign("record", $record); 86 98 $smarty->assign("action", "edit"); 87 99 $modified = NULL; 100 $body = $smarty->fetch('static_edit.tpl'); 88 101 break; 89 102 case "delete-query": -
htdocs/index.php
r126 r130 1 1 <?php 2 2 // Display execution time? 3 //$displaytime = TRUE;3 $displaytime = TRUE; 4 4 5 5 // start the clock (this is just temporary cause I'm interested in how long all this takes) -
templates/index.tpl
r127 r130 3 3 <div><div><div> 4 4 Session: {$session->errormsg} 5 </div></div></div> 6 </div> 7 {/if} 8 {if $fileerror} 9 <div class="errorbar"> 10 <div><div><div> 11 File error: {$fileerror} 5 12 </div></div></div> 6 13 </div>
