<?php plogger_get_header(); print '<div id="thumbnail_container">'; if (plogger_has_collections()) { print '<ul class="slides">'; while (plogger_has_collections()) { $row = plogger_load_collection(); $desc = plogger_get_collection_description(); print '<li class="thumbnail"><div class="tag"><a href="' . plogger_get_collection_url() . '">'; // generate XHTML with thumbnail and link to picture view. print '<img class="photos" src="' . plogger_get_collection_thumb() . '" title="' . $desc . '" alt="' . $desc . '" />'; print '</a><br/>'; print plogger_download_checkbox(plogger_get_collection_id()); print plogger_get_collection_name() . ' <br />'; print '<div class="meta-header">('; $num_albums = plogger_collection_album_count(); print $num_albums . ' '; print $num_albums == 1 ? "album" : "albums"; print ')</div></div></li>'; } print '</ul>'; } else { print "No collections yet"; } print '</div>'; plogger_get_footer();
function plog_collection_manager($from, $limit) { plogger_init_collections(array('from' => $from, 'limit' => $limit, 'all_collections' => 1, 'sortby' => 'id', 'sortdir' => 'asc')); // create javascript initiation function for editable elements if (plogger_has_collections()) { $output .= '<script type="text/javascript">'; $output .= "Event.observe(window, 'load', init, false);"; $output .= "function init() {"; while (plogger_has_collections()) { plogger_load_collection(); // makeEditable('collection-name-".plogger_get_collection_id()."'); $output .= "makeEditable('collection-description-" . plogger_get_collection_id() . "');"; } $output .= "}"; $output .= '</script>'; } plogger_init_collections(array('from' => $from, 'limit' => $limit, 'all_collections' => 1, 'sortby' => 'id', 'sortdir' => 'asc')); if (plogger_has_collections()) { $output .= '<table style="width: 100%" cellpadding="4"> <col style="width: 15px;"/><tr class="header"><td class="table-header-left"></td>'; $output .= '<td class="table-header-middle">' . plog_tr('Name') . '</td>'; $output .= '<td class="table-header-middle">' . plog_tr('Description') . '</td>'; $output .= '<td class="table-header-right">' . plog_tr('Actions') . '</td></tr>'; $counter = 0; while (plogger_has_collections()) { plogger_load_collection(); if ($counter % 2 == 0) { $table_row_color = "color-1"; } else { $table_row_color = "color-2"; } $counter++; $id = plogger_get_collection_id(); $output .= "<tr class='{$table_row_color}'>"; $output .= "<td><input type='checkbox' name='selected[]' value='" . $id . "'/></td>"; $output .= "<td><a class='folder' href='?level=albums&id=" . $id . "'><strong><span id='collection-name-" . plogger_get_collection_id() . "'>" . plogger_get_collection_name() . "</span></a></strong> — " . sprintf(plog_tr('contains %d albums'), plogger_collection_album_count()) . "</td>"; $output .= "<td><p id='collection-description-" . plogger_get_collection_id() . "'>" . plogger_get_collection_description() . " </p></td>"; $output .= '<td><a href="?action=edit-collection&id=' . $id . '"><img style="display:inline" src="../graphics/edit.gif" alt="' . plog_tr('Edit') . '" title="' . plog_tr('Edit') . '"></a>'; $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="../graphics/x.gif" alt="' . plog_tr('Delete') . '" title="' . plog_tr('Delete') . '"></a></td>'; $output .= "</tr>"; } $output .= '<tr class="header"><td colspan="7"></td></tr></table>'; $output .= "</table>"; } else { $output .= "<p class='actions'>" . plog_tr('There are no collections yet') . "</p>"; } return $output; }
function plog_collection_manager($from, $limit) { global $config, $empty; $output = ''; plogger_init_collections(array('from' => $from, 'limit' => $limit, 'all_collections' => 1, 'sortby' => !empty($config['collection_sortby']) ? $config['collection_sortby'] : 'id', 'sortdir' => !empty($config['collection_sortdir']) ? $config['collection_sortdir'] : 'ASC')); // Create javascript initiation function for editable elements if (plogger_has_collections()) { $output .= "\n\t\t" . '<script type="text/javascript">'; $output .= "\n\t\t\t" . 'Event.observe(window, \'load\', init, false);'; $output .= "\n\t\t\t" . 'function init() {' . "\n"; while (plogger_has_collections()) { plogger_load_collection(); // makeEditable('collection-name-".plogger_get_collection_id()."'); $output .= "\t\t\t\tmakeEditable('collection-description-" . plogger_get_collection_id() . "');\n"; } $output .= "\t\t\t" . '}'; $output .= "\n\t\t" . '</script>'; } plogger_init_collections(array('from' => $from, 'limit' => $limit, 'all_collections' => 1, 'sortby' => !empty($config['collection_sortby']) ? $config['collection_sortby'] : 'id', 'sortdir' => !empty($config['collection_sortdir']) ? $config['collection_sortdir'] : 'ASC')); if (plogger_has_collections()) { $output .= "\n\t\t" . '<table style="width: 100%;" cellpadding="3" cellspacing="0"> <col style="width: 15px;" /> <tr class="header"> <th class="table-header-left align-center width-15"><input name="allbox" type="checkbox" onclick="checkAll(document.getElementById(\'contentList\'));" /></th> <th class="table-header-middle align-left width-275">' . plog_tr('Name') . '</th> <th class="table-header-middle align-left">' . plog_tr('Description') . '</th> <th class="table-header-right align-center width-100">' . plog_tr('Actions') . '</th> </tr>'; $counter = 0; while (plogger_has_collections()) { plogger_load_collection(); if ($counter % 2 == 0) { $table_row_color = 'color-1'; } else { $table_row_color = 'color-2'; } $counter++; $id = plogger_get_collection_id(); $text = plogger_collection_album_count() == 1 ? plog_tr('album') : plog_tr('albums'); $output .= "\n\t\t\t" . '<tr class="' . $table_row_color . '">'; $output .= "\n\t\t\t\t" . '<td class="align-center width-15"><p class="margin-5"><input type="checkbox" name="selected[]" value="' . $id . '" /></p></td>'; $output .= "\n\t\t\t\t" . '<td class="align-left width-275"><p class="margin-5"><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('%d'), plogger_collection_album_count()) . ' ' . $text . '</p></td>'; $output .= "\n\t\t\t\t" . '<td class="align-left vertical-top"><p class="margin-5" id="collection-description-' . plogger_get_collection_id() . '">' . plogger_get_collection_description() . '</p></td>'; $output .= "\n\t\t\t\t" . '<td class="align-center width-100"><p class="margin-5"><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>'; $output .= ' <a href="?action=move-delete&selected%5B%5D=' . $id . '&level=collections&delete_checked=1&'; if (isset($_REQUEST['id'])) { $output .= 'id=' . intval($_REQUEST['id']); } if (isset($_GET['plog_page'])) { $output .= '&plog_page=' . intval($_GET['plog_page']); } $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></p></td>'; $output .= "\n\t\t\t" . '</tr>'; } $output .= "\n\t\t\t" . '<tr class="footer"> <td class="align-left invert-selection" colspan="7"><a href="#" onclick="checkToggle(document.getElementById(\'contentList\')); return false;">' . plog_tr('Toggle Checkbox Selection') . '</a></td> </tr> </table>' . "\n"; } else { $output .= "\n\n\t\t" . '<p class="actions">' . plog_tr('There are no collections yet') . '.</p>' . "\n"; $empty = true; } return $output; }