- Timestamp:
- 02/24/06 16:34:11 (3 years ago)
- Location:
- branches/ajax_editing/trunk
- Files:
-
- 1 added
- 4 modified
-
admin/js/plogger.js (modified) (1 diff)
-
admin/plog-admin-functions.php (modified) (3 diffs)
-
admin/plog-manage.php (modified) (3 diffs)
-
admin/plog-rpc.php (added)
-
css/admin.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/ajax_editing/trunk/admin/js/plogger.js
r318 r324 56 56 new Ajax.Request('plog-thumb.php', {method: 'get', onComplete: onImportThumbComplete, parameters: 'img=' + importThumbs[importThumbCounter]}); 57 57 }; 58 59 function addItemForm() { 60 Element.hide('add_item_link'); 61 Element.show('add_item_form'); 62 Form.focusFirstElement('add_form'); 63 } 64 65 function addItemLink() { 66 Element.show('add_item_link'); 67 Element.hide('add_item_form'); 68 Element.hide('rpc_message'); 69 70 } 71 72 function submitAddForm() { 73 // I need to clear the form. 74 new Ajax.Request('plog-rpc.php', { 75 method: 'post', 76 onComplete: onAddComplete, 77 postBody: Form.serialize('add_form')}); 78 } 79 80 function onAddComplete(request) { 81 Element.update('rsv',request.responseText); 82 reloadManager(); 83 // I need to know whether I got an error or not. 84 // if there was an error, then I need to keep the form. 85 // otherwise I have to hide it. 86 // here I should trigger the reload of collection list. 87 } 88 89 function reloadManager() { 90 new Ajax.Updater('mgrtable','plog-rpc.php', { 91 method: 'post', 92 postBody: 'action=list-collections&page=' + $F('plog_page')}); 93 //alert('reloading page ' + $F('plog_page')); 94 95 } -
branches/ajax_editing/trunk/admin/plog-admin-functions.php
r316 r324 4 4 require_once($config['basedir'] . "/plog-functions.php"); 5 5 require_once($config['basedir'] . "/lib/exifer1_5/exif.php"); 6 7 6 function get_files($directory) { 8 7 // Try to open the directory … … 895 894 // so plugis could add new fields to all those forms. 896 895 function plog_add_collection_form() { 897 $output = '<form action="'.$_SERVER["PHP_SELF"].'" method="post">'; 898 $output .= '<div class="box-3"><h2 class="add">Create a Collection: </h2><label for="name">Name </label><br/><input name="name" id="name"> 899 <br/><label for="description">Description </label><br/><input name="description" id="description" size="50"> 900 <input name="action" type="hidden" value="add-collection"> 901 <input class="submit" type="submit" value="Add Collection"> 902 </div></form>'; 896 global $plog_page; 897 $output = ""; 898 $output .= '<div id="rsv"></div><div id="add_container"><div id="add_item_link" class="add_item"><h2 class="add"><a href="javascript:addItemForm();">Create a Collection »</a></h2></div>'; 899 $output .= '<div id="add_item_form" class="box-3" style="display: none;"><form action="'.$_SERVER["PHP_SELF"].'" id="add_form" method="post" onsubmit="submitAddForm();return false;">'; 900 $output .= '<h2 class="add">Create a Collection: </h2><label for="name">Name </label><br/><input name="name" id="name"> 901 <br/><label for="description">Description </label><br/><input name="description" id="description" size="50"/><br/> 902 <input name="action" type="hidden" value="add-collection"/> 903 <!--<input class="submit" type="submit" value="Add Collection"/>--> 904 <input type="hidden" id="plog_page" value="' . $plog_page .'"/> 905 <input type="button" class="submit" value="Add Collection" onclick="submitAddForm();"/> 906 <input class="submit" type="button" value="Cancel" onClick="addItemLink();"/> 907 </form></div></div>'; 903 908 return $output; 904 909 } … … 1114 1119 } 1115 1120 1116 function plog_collection_manager($from,$limit) { 1121 function plog_collection_manager($page,$limit) { 1122 $from = ($page - 1) * $_SESSION['entries_per_page']; 1123 if ($from < 0) { 1124 $from = 0; 1125 }; 1126 1117 1127 $output = '<table style="width: 100%" cellpadding="4"> 1118 1128 <col style="width: 15px;"/><tr class="header"><td></td>'; -
branches/ajax_editing/trunk/admin/plog-manage.php
r317 r324 275 275 } 276 276 277 278 $plog_page = isset($_REQUEST['plog_page']) ? $_REQUEST['plog_page'] : 1; 279 $first_item = ($plog_page - 1) * $_SESSION['entries_per_page']; 280 if ($first_item < 0) { 281 $first_item = 0; 282 }; 283 277 284 // here we will generate a "add collection/album" header 278 285 if ($level == "collections") { … … 307 314 $url = "?entries_per_page=$_SESSION[entries_per_page]&level=$_REQUEST[level]&id=$id"; 308 315 309 $plog_page = isset($_REQUEST['plog_page']) ? $_REQUEST['plog_page'] : 0; 310 $first_item = ($plog_page - 1) * $_SESSION['entries_per_page']; 311 if ($first_item < 0) { 312 $first_item = 0; 313 }; 316 314 317 $limit = "LIMIT $first_item, $_SESSION[entries_per_page]"; 315 318 … … 328 331 if (empty($level)) { 329 332 $output .= generate_breadcrumb_admin(""); 330 $output .= plog_collection_manager($first_item,$_SESSION['entries_per_page']); 331 }; 333 $output .= "<div id='mgrtable'>"; 334 $output .= plog_collection_manager($plog_page,$_SESSION['entries_per_page']); 335 $output .= "</div>"; 336 }; 337 338 332 339 333 340 if ($level == "albums") { -
branches/ajax_editing/trunk/css/admin.css
r312 r324 318 318 } 319 319 320 .add_item { 321 margin: 15px; 322 border: 1px solid #488F62; 323 padding: 10px; 324 padding-left: 20px; 325 padding-bottom: 2px; 326 margin-bottom: 0px; 327 background-color: #BEDEBE; 328 padding-top: 0; 329 width: 300px; 330 margin-left: 0; 331 } 332 320 333 .box-3 321 334 {
