Changeset 569
- Timestamp:
- 07/29/08 16:01:29 (4 months ago)
- Location:
- trunk
- Files:
-
- 9 modified
-
plog-admin/index.php (modified) (1 diff)
-
plog-admin/plog-admin-functions.php (modified) (24 diffs)
-
plog-admin/plog-admin.php (modified) (2 diffs)
-
plog-admin/plog-feedback.php (modified) (1 diff)
-
plog-admin/plog-manage.php (modified) (12 diffs)
-
plog-admin/plog-upload.php (modified) (1 diff)
-
plog-download.php (modified) (5 diffs)
-
plog-includes/plog-functions.php (modified) (11 diffs)
-
plog-remote.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plog-admin/index.php
r555 r569 2 2 // load configuration variables from database, plog-globals, & plog-includes/plog-functions 3 3 require_once(dirname(dirname(__FILE__))."/plog-load-config.php"); 4 5 // if we're already logged in, redirect to the upload page 6 if (isset($_SESSION['plogger_logged_in']) && $_SESSION['plogger_logged_in'] === true) { 7 header("Location: plog-upload.php"); 8 exit; 9 } 4 10 5 11 $output = ''; -
trunk/plog-admin/plog-admin-functions.php
r568 r569 33 33 } 34 34 35 function generate_pagination_view_menu() { 36 $url_query = "?"; 37 $url_parts = parse_url($_SERVER['REQUEST_URI']); 38 if (isset($url_parts['query'])) { 39 // if entries_per_page is already present in URL, remove it 40 if (strpos($url_parts['query'], "entries_per_page") !== false || strpos($url_parts['query'], "plog_page") !== false) { 41 parse_str($url_parts['query'], $query_parts); 42 foreach ($query_parts as $qkey => $qval) { 43 if ($qkey != "entries_per_page" && $qkey != "plog_page") { 44 $url_query .= $qkey."=".$qval."&"; 45 } 46 } 47 } else { 48 $url_query .= $url_parts['query']."&"; 49 } 50 } 51 52 $java = 'document.location.href = \''.$url_parts['path'].$url_query.'entries_per_page=\'+this.options[this.selectedIndex].value'; 53 54 $possible_values = array("1"=>1, "5"=>5, "10"=>10, "20"=>20, "50"=>50, "100"=>100, "250"=>250, "500"=>500); 55 $output= "\n\t\t\t" . '<label accesskey="e" for="entries_on_page">' .plog_tr('<em>E</em>ntries per page') . '</label> 56 <select class="entries-page" onchange="'.$java.'" name="entries_per_page" style="width: 60px;">'; 57 foreach ($possible_values as $key => $value) { 58 if ($_SESSION['entries_per_page'] == $key) { 59 $output .= "\n\t\t\t\t".'<option value="'.$value.'" selected="selected">'.$key.'</option>'; 60 } else { 61 $output .= "\n\t\t\t\t".'<option value="'.$value.'">'.$key.'</option>'; 62 } 63 } 64 $output.= "\n\t\t\t".'</select>'; 65 return $output; 66 } 67 35 68 function add_picture($album_id,$tmpname,$filename,$caption,$desc) { 36 69 global $config; … … 72 105 73 106 while (is_file($config['basedir'].'plog-content/images/'.$create_path."/".$unique_filename_base.".".$filename_ext)){ 74 $unique_filename_base = SmartStripSlashes($filename_base)." (" . ++$i .")";75 } 76 77 $final_filename = $unique_filename_base. "." . $filename_ext;107 $unique_filename_base = SmartStripSlashes($filename_base)."(" . ++$i .")"; 108 } 109 110 $final_filename = sanitize_filename($unique_filename_base) . "." . $filename_ext; 78 111 79 112 // final fully qualified file name 80 $final_fqfn = $config[ "basedir"].'plog-content/images/'.$create_path.'/'.$final_filename;113 $final_fqfn = $config['basedir'].'plog-content/images/'.$create_path.'/'.$final_filename; 81 114 82 115 if (!makeDirs($config['basedir'].'plog-content/images/'.$create_path, 0777)) { … … 164 197 }; 165 198 166 function update_picture($id, $caption,$allow_comments,$description) {199 function update_picture($id, $caption, $allow_comments, $description) { 167 200 $id = intval($id); 168 201 $caption = mysql_real_escape_string($caption); … … 175 208 WHERE id='$id'"; 176 209 $result = mysql_query($query); 177 if ($result) 210 if ($result) { 178 211 return array('output' => plog_tr('You have successfully modified the selected picture.')); 179 else212 } else { 180 213 return array('errors' => mysql_error()); 214 } 181 215 } 182 216 … … 235 269 $i = 0; 236 270 while ($to_album != $picture['parent_album'] && is_file($config['basedir'].'plog-content/images/'.$target_path."/".$unique_filename_base.".".$filename_ext)){ 237 $unique_filename_base = $filename_base." (" . ++$i . ")";271 $unique_filename_base = $filename_base."(" . ++$i . ")"; 238 272 } 239 273 240 274 // final fully qualified file name 241 $picture_path = $target_path.'/'. $unique_filename_base.".".$filename_ext;275 $picture_path = $target_path.'/'.sanitize_filename($unique_filename_base).".".$filename_ext; 242 276 $final_fqfn = $config['basedir'].'plog-content/images/'.$picture_path; 243 277 … … 392 426 $target_path = $config["basedir"] . "plog-content/images/".$target_name; 393 427 394 // do not allow collections with duplicate names, otherwise mod_rewritten links will start 395 // to behave weird. 396 if ($row["name"] != $name && is_dir($target_path)) { 397 // if there is already a directory, check to see if it's in the database 398 $collection_data = get_collection_by_name($name); 399 if ($collection_data){ 400 // it's in the database, so throw duplicate collection error 401 return array("errors" => sprintf(plog_tr('Collection `%s` could not be renamed to `%s`, because there is another collection with that name'),$row['name'],$name)); 402 } else{ 403 // it's not in the database so attempt to delete the directory 404 if (!@rmdir($target_path)){ 405 // could not delete the directory, so prompt the user to delete it manually 406 return array("errors" => sprintf(plog_tr('Collection directory `%s` exists, but no collection exists in the database. Attempt to delete automatically failed. Please delete folder via FTP manually and try again.'), $target_path)); 428 // check for self-re-naming collection instance 429 if ($source_path != $target_path) { 430 // do not allow collections with duplicate names, otherwise mod_rewritten links will start 431 // to behave weird. 432 if (is_dir($target_path)) { 433 // if there is already a directory, check to see if it's in the database 434 $collection_data = get_collection_by_name($name); 435 if ($collection_data){ 436 // it's in the database, so throw duplicate collection error 437 return array("errors" => sprintf(plog_tr('Collection `%s` could not be renamed to `%s`, because there is another collection with that name'),$row['name'],$name)); 438 } else{ 439 // it's not in the database so attempt to delete the directory 440 if (!@rmdir($target_path)){ 441 // could not delete the directory, so prompt the user to delete it manually 442 return array("errors" => sprintf(plog_tr('Collection directory `%s` exists, but no collection exists in the database. Attempt to delete automatically failed. Please delete folder via FTP manually and try again.'), $target_path)); 443 } 407 444 } 408 445 } 409 } 410 411 // perform the rename on the directory412 if (!rename($source_path, $target_path)) {413 return array("errors" => sprintf(plog_tr("Error renaming directory! (%s to %s)"),$source_path,$target_path));446 447 // perform the rename on the directory 448 if (!rename($source_path, $target_path)) { 449 return array("errors" => sprintf(plog_tr("Error renaming directory! (%s to %s)"),$source_path,$target_path)); 450 } 414 451 } 415 452 … … 470 507 } else { 471 508 return array('errors' => plog_tr('Could not modify selected collection')); 472 } ;509 } 473 510 474 511 } … … 541 578 // first try to create the directory to hold the images, if that fails, then the album 542 579 // will be unusable anyway 543 $create_path = $config[ "basedir"] . "plog-content/images/".SmartStripSlashes($row["collection_path"])."/".$album_folder;580 $create_path = $config['basedir'] . "plog-content/images/".SmartStripSlashes($row['collection_path'])."/".$album_folder; 544 581 545 582 // check path so we are not creating duplicate albums within the same collection … … 582 619 } 583 620 584 function update_album($album_id,$name,$description,$thumbnail_id = 0) { 585 global $config; 586 621 function update_album($album_id, $name, $description, $thumbnail_id = 0) { 622 global $config; 587 623 $errors = $output = ""; 588 589 $target_name = strtolower(sanitize_filename(SmartStripSlashes($name))); 590 624 591 625 $album_id = intval($album_id); 592 626 $thumbnail_id = intval($thumbnail_id); 593 $name = mysql_real_escape_string(SmartStripSlashes( $name));627 $name = mysql_real_escape_string(SmartStripSlashes(trim($name))); 594 628 $description = mysql_real_escape_string(SmartStripSlashes($description)); 629 if (empty($name)) { 630 return array("errors" => plog_tr("Please enter a valid name for the album")); 631 } 632 633 $target_name = strtolower(sanitize_filename(SmartStripSlashes($name))); 595 634 596 635 // first, get the album name and collection name of our source album 597 $sql = "SELECT c.path AS collection_path, a.path AS album_path 636 $sql = "SELECT c.path AS collection_path, a.path AS album_path, a.parent_id AS collection_id 598 637 FROM ".TABLE_PREFIX."albums a, ".TABLE_PREFIX."collections c 599 WHERE c.id = a.parent_id AND a.id = '$album_id'";638 WHERE c.id = a.parent_id AND a.id = ".$album_id; 600 639 601 640 $result = run_query($sql); 602 641 $row = mysql_fetch_assoc($result); 603 642 604 $source_album_name = SmartStripSlashes($row[ "album_path"]);605 $source_collection_name = SmartStripSlashes($row[ "collection_path"]);643 $source_album_name = SmartStripSlashes($row['album_path']); 644 $source_collection_name = SmartStripSlashes($row['collection_path']); 606 645 607 646 $source_path = $config['basedir'] . "plog-content/images/".$source_collection_name."/".$source_album_name; 608 647 $target_path = $config['basedir'] . "plog-content/images/".$source_collection_name."/".$target_name; 609 648 610 // check path so we are not creating duplicate albums within the same collection 611 if (is_dir($target_path)){ 612 // if there is already a directory, check to see if it's in the database 613 $album_data = get_album_by_name($album_name, $to_collection); 614 if ($album_data) { 615 // it's in the database, so throw duplicate album error 616 return array("errors" => sprintf(plog_tr('New album could not be created, because there already is one named `%s` in the collection `%s`!'), $target_name, $source_collection_name)); 617 } else { 618 // it's not in the database so attempt to delete the directory 619 if (!@rmdir($target_path)){ 620 // could not delete the directory, so prompt the user to delete it manually 621 return array("errors" => sprintf(plog_tr('Album directory `%s` exists, but no album exists in the database. Attempt to delete automatically failed. Please delete folder via FTP manually and try again.'), $target_path)); 649 // check for self-re-naming album instance 650 if ($source_path != $target_path) { 651 // check path so we are not creating duplicate albums within the same collection 652 if (is_dir($target_path)) { 653 // if there is already a directory, check to see if it's in the database 654 $album_data = get_album_by_name($name, $row['collection_id']); 655 if ($album_data) { 656 // it's in the database, so throw duplicate album error 657 return array("errors" => sprintf(plog_tr('New album could not be created, because there already is one named `%s` in the collection `%s`!'), $target_name, $source_collection_name)); 658 } else { 659 // it's not in the database so attempt to delete the directory 660 if (!@rmdir($target_path)){ 661 // could not delete the directory, so prompt the user to delete it manually 662 return array("errors" => sprintf(plog_tr('Album directory `%s` exists, but no album exists in the database. Attempt to delete automatically failed. Please delete folder via FTP manually and try again.'), $target_path)); 663 } 622 664 } 623 665 } 624 } 625 626 // perform the rename on the directory627 if (!rename($source_path, $target_path))628 {629 return array(630 "errors" => sprintf(plog_tr("Error renaming directory! (%s to %s)"),$source_path,$target_path));666 667 // perform the rename on the directory 668 if (!rename($source_path, $target_path)) 669 { 670 return array( 671 "errors" => sprintf(plog_tr("Error renaming directory! (%s to %s)"),$source_path,$target_path)); 672 } 631 673 } 632 674 … … 925 967 return false; 926 968 } 927 $output .= "\n\t" . '<form class="edit" action="'.$_SERVER["PHP_SELF"].'" method="post"> 928 <table>'; 969 $query = ""; 970 if (strpos($_SERVER['PHP_SELF'], "plog-manage") !== false) { 971 $query = "?level=comments&id=".$comment['parent_id']; 972 } 973 974 $output .= "\n\t" . '<form class="edit" action="'.$_SERVER['PHP_SELF'].$query.'" method="post">'; 975 976 // get the thumbnail 977 $photo = get_picture_by_id($comment['parent_id']); 978 $thumbpath = generate_thumb(SmartStripSlashes($photo['path']), $photo['id'],THUMB_SMALL); 979 $output .= "\n\t\t" . '<div style="float: right;"><img src="'.$thumbpath.'" alt="" /></div>'; 980 981 $output .= "\n\t\t<table>"; 929 982 $output .= "\n\t\t\t" . '<tr> 930 983 <td>' . plog_tr('Author:') . '<br /><input size="30" name="author" id="author" value="'.SmartStripSlashes($comment['author']).'"/ ></td> … … 940 993 <input type="hidden" name="pid" value="'.$comment['id'].'" > 941 994 <input type="hidden" name="action" value="update-comment" > 942 <button class="submit" type="submit">' . plog_tr('Update') . '</button>'; 943 944 if (isset($_REQUEST["level"])) 945 { 946 $output .= "\n\t\t\t" . '<input type="hidden" name="level" value="'.$_REQUEST['level'].'" />'; 947 } 948 949 if (isset($_REQUEST["id"])) 950 { 951 $output .= "\n\t\t\t" . '<input type="hidden" name="id" value="'.$_REQUEST['id'].'" />'; 952 } 995 <input class="submit" name="update" value="' . plog_tr('Update') . '" type="submit" /> 996 <input class="submit" name="cancel" value="' . plog_tr('Cancel') . '" type="submit" />'; 953 997 954 998 $output .= "\n\n\t\t" . '</form>'; … … 1135 1179 1136 1180 /// XXX: something for the future: perhaps hooks for plugins should be implemented, 1137 // so plugi s could add new fields to all those forms.1181 // so plugins could add new fields to all those forms. 1138 1182 function plog_add_collection_form() { 1139 1183 $output = "\n\t\t" . '<input type="button" class="submit" id="show-collection" onclick="toggle(\'create-collection\'); toggle(\'show-collection\')" value="' . plog_tr('Create a Collection') . '" />'; … … 1178 1222 $output = ''; 1179 1223 $collection_id = intval($collection_id); 1180 $output .= "\n\t\t" . '<form class="edit" action="'.$_SERVER[ "REQUEST_URI"].'" method="post">';1224 $output .= "\n\t\t" . '<form class="edit" action="'.$_SERVER['PHP_SELF'].'" method="post">'; 1181 1225 $collection = get_collection_by_id($collection_id); 1182 1226 … … 1205 1249 $output .= "\n\t\t\t" . '<div> 1206 1250 <label accesskey="n" for="name">' . plog_tr('<em>N</em>ame') . ':</label><br /> 1207 <input size="30" name="name" id="name" value="'. SmartStripSlashes($collection['name']).'" /><br />1251 <input size="30" name="name" id="name" value="'.htmlspecialchars(SmartStripSlashes($collection['name'])).'" /><br /> 1208 1252 <label accesskey="d" for="description">' . plog_tr('<em>D</em>escription') . ':</label><br /> 1209 <input size="80" name="description" id="description" value="'. SmartStripSlashes($collection['description']).'" /><br />1253 <input size="80" name="description" id="description" value="'.htmlspecialchars(SmartStripSlashes($collection['description'])).'" /><br /> 1210 1254 Thumbnail:<br /> 1211 1255 <select name="thumbnail_id" onchange="updateThumbPreview(this)" class="thumbselect" id="thumbselect"> … … 1216 1260 <input type="hidden" name="action" value="update-collection" /> 1217 1261 <br /> 1218 <button class="submit" type="submit">' . plog_tr('Update') . '</button> 1262 <input class="submit" name="update" value="' . plog_tr('Update') . '" type="submit" /> 1263 <input class="submit" name="cancel" value="' . plog_tr('Cancel') . '" type="submit" /> 1219 1264 </div>'; 1220 1265 … … 1231 1276 $auto_graphic = $config['gallery_url']."plog-admin/images/auto.gif"; 1232 1277 1233 $output = "\n\t\t" . '<form class="edit" action="'.$_SERVER[ "PHP_SELF"].'?level=albums&id='.$album["parent_id"].'" method="post">';1278 $output = "\n\t\t" . '<form class="edit" action="'.$_SERVER['PHP_SELF'].'?level=albums&id='.$album['parent_id'].'" method="post">'; 1234 1279 1235 1280 $images = '<option class="thumboption" value="0" style="padding-left: 100px; background-image: url('.$auto_graphic.'); background-repeat: no-repeat;">' . plog_tr('automatic') . '</option>'; … … 1242 1287 $style = 'class="thumboption" style="padding-left: '.($thumbnail_config[THUMB_SMALL]["size"] + 5).'px; background-image: url('.generate_thumb(SmartStripSlashes($row["path"]), $row["id"]).'); background-repeat: no-repeat;"'; 1243 1288 1244 $images .= "\n\t\t\t\t<option $stylevalue='" . $row["id"] . "'" . $selected . ">";1289 $images .= "\n\t\t\t\t<option ".$style." value='" . $row["id"] . "'" . $selected . ">"; 1245 1290 $images .= !empty($row["caption"]) ? SmartStripSlashes($row["caption"]) : SmartStripSlashes(basename($row["path"])); 1246 1291 $images .= "</option>"; … … 1249 1294 $output .= "\n\t\t\t" . '<div> 1250 1295 <label for="name" accesskey="n">' . plog_tr('<em>N</em>ame') . ':</label><br /> 1251 <input size="30" name="name" id="name" value="'. SmartStripSlashes($album['name']).'" /><br />1296 <input size="30" name="name" id="name" value="'.htmlspecialchars(SmartStripSlashes($album['name'])).'" /><br /> 1252 1297 <label for="description" accesskey="d">' . plog_tr('<em>D</em>escription') . ':</label><br /> 1253 <input size="80" name="description" id="description" value="'. SmartStripSlashes($album['description']).'" /><br />1298 <input size="80" name="description" id="description" value="'.htmlspecialchars(SmartStripSlashes($album['description'])).'" /><br /> 1254 1299 Thumbnail:<br /> 1255 1300 <select name="thumbnail_id" class="thumbselect" id="thumbselect" onchange="updateThumbPreview(this)"> … … 1260 1305 <input type="hidden" name="action" value="update-album" /> 1261 1306 <br /> 1262 <button class="submit" type="submit">' . plog_tr('Update') . '</button> 1307 <input class="submit" name="update" value="' . plog_tr('Update') . '" type="submit" /> 1308 <input class="submit" name="cancel" value="' . plog_tr('Cancel') . '" type="submit" /> 1263 1309 </div>'; 1264 1310 $output .= "\n\t\t" . '</form>' . "\n"; … … 1331 1377 //$java = "javascript:this.ThumbPreviewPopup('$target')"; 1332 1378 $output .= "\n\t\t\t\t" . '<td><div class="img-shadow"><a href="'.plogger_get_picture_thumb(THUMB_LARGE).'" rel="lightbox" title="'.plogger_get_picture_caption().'">'.$imgtag.'</a></div></td>'; 1333 $output .= "\n\t\t\t\t <td><strong><a class='folder' href='?level=comments&id=" . $id . "'>" . basename(plogger_get_source_picture_path()) . "</a></strong></td>";1379 $output .= "\n\t\t\t\t".'<td><strong><a class="folder" href="'.$_SERVER['PHP_SELF'].'?level=comments&id=' . $id . '">' . basename(plogger_get_source_picture_path()) . '</a></strong> — ' . sprintf(plog_tr('contains %d comment(s)'), plogger_picture_comment_count()) . '</td>'; 1334 1380 $output .= "\n\t\t\t\t<td><p id=\"picture-caption-" . plogger_get_picture_id() ."\">" . plogger_get_picture_caption() . " </p></td>"; 1335 1381 $output .= "\n\t\t\t\t<td><p id=\"picture-description-" . plogger_get_picture_id() ."\">" . plogger_get_picture_description() . " </p></td>"; … … 1342 1388 1343 1389 $parent_id = $_REQUEST["id"]; 1344 $output .= '<a href="?action=1&selected%5B%5D=' . $id . '&level=pictures&delete_checked=1&id='.$parent_id; 1345 if (isset($_GET["entries_per_page"])) $output .= '&entries_per_page=' . intval($_GET["entries_per_page"]); 1346 if (isset($_GET["plog_page"])) $output .= '&plog_page=' . intval($_GET["plog_page"]); 1390 $output .= '<a href="?action=move-delete&selected%5B%5D=' . $id . '&level=pictures&delete_checked=1&id='.$parent_id; 1391 if (isset($_GET['plog_page'])) $output .= '&plog_page=' . intval($_GET['plog_page']); 1347 1392 $output .= '" onclick="return confirm(\'' . plog_tr('Are you sure you want to delete this item?') . '\');"><img style="display: inline;" src="'.$config['gallery_url'].'plog-admin/images/x.gif" alt="' . plog_tr('Delete') . '" title="' . plog_tr('Delete') . '" /></a></td>'; 1348 1393 $output .= "\n\t\t\t</tr>"; … … 1415 1460 $counter++; 1416 1461 1417 $output .= "\n\t\t\t<tr class='$table_row_color'>"; 1418 $output .= "\n\t\t\t\t<td><input type='checkbox' name='selected[]' value='" . $id . "' /></td>"; 1419 $output .= "\n\t\t\t\t<td><a class='folder' href='?level=pictures&id=" .$id . "'><span id='album-name-" . plogger_get_album_id(). "'><strong>" . plogger_get_album_name() . "</strong></span></a> — " . sprintf(plog_tr('contains %d picture(s)'),plogger_album_picture_count()) . "</td>"; 1420 $output .= "\n\t\t\t\t<td><p id='album-description-" . plogger_get_album_id() . "'>" . plogger_get_album_description() . " </p></td>"; 1421 $output .= "\n\t\t\t\t" . '<td><a href="?action=edit-album&id=' . $id . '"><img style="display: inline;" src="'.$config['gallery_url'].'plog-admin/images/edit.gif" alt="' . plog_tr('Edit') . '" title="' . plog_tr('Edit') . '" /></a>'; 1422 $output .= '<a href="?action=1&selected%5B%5D=' . $id . '&level=albums&delete_checked=1&id='.$_REQUEST["id"].'" onclick="return confirm(\'' . plog_tr('Are you sure you want to delete this item?') . '\');"><img style="display: inline;" src="'.$config['gallery_url'].'plog-admin/images/x.gif" alt="' . plog_tr('Delete') . '" title="' . plog_tr('Delete') . '" /></a></td>'; 1462 $output .= "\n\t\t\t".'<tr class="'.$table_row_color.'">'; 1463 $output .= "\n\t\t\t\t".'<td><input type="checkbox" name="selected[]" value="'.$id.'" /></td>'; 1464 $output .= "\n\t\t\t\t".'<td><a class="folder" href="'.$_SERVER['PHP_SELF'].'?level=pictures&id='.$id.'"><span id="album-name-'.plogger_get_album_id().'"><strong>'.plogger_get_album_name().'</strong></span></a> — ' . sprintf(plog_tr('contains %d picture(s)'), plogger_album_picture_count()) . '</td>'; 1465 $output .= "\n\t\t\t\t".'<td><p id="album-description-'.plogger_get_album_id().'">'.plogger_get_album_description().' </p></td>'; 1466 $output .= "\n\t\t\t\t".'<td><a href="'.$_SERVER['PHP_SELF'].'?action=edit-album&id='.$id.'"><img style="display: inline;" src="'.$config['gallery_url'].'plog-admin/images/edit.gif" alt="' . plog_tr('Edit') . '" title="' . plog_tr('Edit') . '" /></a>'; 1467 $output .= '<a href="'.$_SERVER['PHP_SELF'].'?action=move-delete&selected%5B%5D='.$id.'&level=albums&delete_checked=1&id='.$_REQUEST['id']; 1468 if (isset($_GET['plog_page'])) { $output .= '&plog_page='.intval($_GET['plog_page']); } 1469 $output .= '" onclick="return confirm(\'' . plog_tr('Are you sure you want to delete this item?') . '\');"><img style="display: inline;" src="'.$config['gallery_url'].'plog-admin/images/x.gif" alt="' . plog_tr('Delete') . '" title="' . plog_tr('Delete') . '" /></a></td>'; 1423 1470 $output .= "\n\t\t\t</tr>"; 1424 1471 1425 } ;1426 $output .= "\n\t\t\t" .'<tr class="footer">1472 } 1473 $output .= "\n\t\t\t".'<tr class="footer"> 1427 1474 <td colspan="7"></td> 1428 1475 </tr> 1429 </table>' ."\n";1476 </table>'."\n"; 1430 1477 } else { 1431 1478 $output .= "\n\n\t\t<p class=\"actions\">" . plog_tr("There are no albums in this collection yet, why don't you create one?") . "</p>\n"; 1432 } ;1479 } 1433 1480 return $output; 1434 1481 … … 1488 1535 $output .= "\n\t\t\t<tr class=\"$table_row_color\">"; 1489 1536 $output .= "\n\t\t\t\t<td><input type='checkbox' name='selected[]' value='" . $id . "' /></td>"; 1490 $output .= "\n\t\t\t\t<td><a class='folder' href='?level=albums&id=" .$id . "'><span id='collection-name-" . plogger_get_collection_id() . "'><strong>" . plogger_get_collection_name() . "</strong></span></a> — " . sprintf(plog_tr('contains %d albums'),plogger_collection_album_count()) . "</td>";1491 $output .= "\n\t\t\t\t<td><p id='collection-description-" . plogger_get_collection_id() . "'>" . plogger_get_collection_description() ." </p></td>";1537 $output .= "\n\t\t\t\t<td><a class='folder' href='?level=albums&id=" .$id . "'><span id='collection-name-" . plogger_get_collection_id()."'><strong>".plogger_get_collection_name()."</strong></span></a> — " . sprintf(plog_tr('contains %d albums'), plogger_collection_album_count()) . "</td>"; 1538 $output .= "\n\t\t\t\t<td><p id='collection-description-" . plogger_get_collection_id() . "'>" . plogger_get_collection_description()." </p></td>"; 1492 1539 $output .= "\n\t\t\t\t" . '<td><a href="?action=edit-collection&id=' . $id . '"><img style="display: inline;" src="'.$config['gallery_url'].'plog-admin/images/edit.gif" alt="' . plog_tr('Edit') . '" title="' . plog_tr('Edit') . '" /></a>'; 1493 $output .= '<a href="?action=1&selected%5B%5D=' . $id . '&level=collections&delete_checked=1&id='.@$_REQUEST["id"].'" onclick="return confirm(\'' . plog_tr('Are you sure you want to delete this item?') . '\');"><img style="display: inline;" src="'.$config['gallery_url'].'plog-admin/images/x.gif" alt="' . plog_tr('Delete') . '" title="' . plog_tr('Delete') . '" /></a></td>'; 1540 $output .= '<a href="?action=move-delete&selected%5B%5D=' . $id . '&level=collections&delete_checked=1&'; 1541 if (isset($_REQUEST['id'])) { $output .= 'id='.intval($_REQUEST['id']); } 1542 if (isset($_GET['plog_page'])) { $output .= '&plog_page=' . intval($_GET['plog_page']); } 1543 $output .= '" onclick="return confirm(\'' . plog_tr('Are you sure you want to delete this item?') . '\');"><img style="display: inline;" src="'.$config['gallery_url'].'plog-admin/images/x.gif" alt="' . plog_tr('Delete') . '" title="' . plog_tr('Delete') . '" /></a></td>'; 1494 1544 $output .= "\n\t\t\t</tr>"; 1495 } ;1545 } 1496 1546 $output .= "\n\t\t\t" . '<tr class="footer"> 1497 1547 <td colspan="7"></td> … … 1500 1550 } else { 1501 1551 $output .= "\n\n\t\t<p class=\"actions\">" . plog_tr('There are no collections yet') . "</p>\n"; 1502 } ;1552 } 1503 1553 return $output; 1504 1554 } -
trunk/plog-admin/plog-admin.php
r567 r569 22 22 } 23 23 24 if (!isset($_SESSION[ "plogger_logged_in"])){24 if (!isset($_SESSION['plogger_logged_in']) || $_SESSION['plogger_logged_in'] !== true){ 25 25 header("Location: index.php"); 26 26 exit; … … 63 63 <script type="text/javascript" src="'.$config['gallery_url'].'plog-admin/js/plogger.js"></script> 64 64 <script type="text/javascript" src="'.$config['gallery_url'].'plog-admin/js/lightbox.js"></script> 65 <script type="text/javascript" src="'.$config['gallery_url'].'plog-admin/js/AmiJS.js"></script>66 <script type="text/javascript" src="'.$config['gallery_url'].'plog-admin/js/greybox.js"></script>67 65 '.$inHead.' 68 <script type="text/javascript">69 //GreyBox configuration70 //Use animation?71 var GB_ANIMATION = true;72 var GB_IMG_DIR = "'.$config['gallery_url'].'plog-admin/images/";73 //Clicking on the transparent overlay closes the GreyBox window?74 var GB_overlay_click_close = false;75 </script>76 66 </head> 77 67 -
trunk/plog-admin/plog-feedback.php
r568 r569 9 9 $inHead = '<script src="js/ajax_editing.js" type="text/javascript"></script>'; 10 10 11 function generate_pagination_view_menu() { 12 13 $java = 'document.location.href = \''.$_SERVER["PHP_SELF"].'?'.'&entries_per_page=\'+this.options[this.selectedIndex].value'; 14 15 $possible_values = array("5"=>5, "10"=>10, "20"=>20, "50"=>50); 16 $output = "\n\t\t\t\t\t" . '<label accesskey="e" for="entries_on_page">' .plog_tr('<em>E</em>ntries per page') . '</label> 17 <select class="entries-page" onchange="'.$java.'" name="entries_per_page" style="width: 60px;">'; 18 foreach ($possible_values as $key => $value) 19 if ($_SESSION['entries_per_page'] == $key) 20 $output .= "\n\t\t\t\t\t\t<option value=\"$value\" selected=\"selected\">$key</option>"; 21 else 22 $output .= "\n\t\t\t\t\t\t<option value=\"$value\">$key</option>"; 23 $output.= "\n\t\t\t\t\t</select>"; 24 25 return $output; 26
