/** * Erstellt den Karteireiter zum Verwalten der Kindelemente eines Contents */ function print_childs() { global $content_id, $sprache, $version, $action, $filterstr; $content = new content(); $content->getChilds($content_id); echo 'Folgende Einträge sind diesem Untergeordnet:<br><br>'; echo ' <script type="text/javascript"> $(document).ready(function() { $("#childs_table").tablesorter( { sortList: [[0,0]], widgets: ["zebra"] }); }); </script>'; echo '<table id="childs_table" class="tablesorter" style="width: auto;"> <thead> <tr> <th>Sortierung</th> <th>ID</th> <th>Titel</th> <th></th> </tr> </thead> <tbody>'; foreach ($content->result as $row) { $child = new content(); $child->getContent($row->child_content_id); echo '<tr>'; echo '<td>', $row->sort; echo ' <a href="' . $_SERVER['PHP_SELF'] . '?action=childs&content_id=' . $content_id . '&sprache=' . $sprache . '&version=' . $version . '&contentchild_id=' . $row->contentchild_id . '&method=childs_sort_up&filter=' . implode(' ', $filterstr) . '" title="Nach oben sortieren"><img src="../skin/images/up.png" alt="up"></a>'; echo ' <a href="' . $_SERVER['PHP_SELF'] . '?action=childs&content_id=' . $content_id . '&sprache=' . $sprache . '&version=' . $version . '&contentchild_id=' . $row->contentchild_id . '&method=childs_sort_down&filter=' . implode(' ', $filterstr) . '" title="Nach unten sortieren"><img src="../skin/images/down.png" alt="down"></a>'; echo '</td>'; echo '<td>', $row->child_content_id, '</td>'; echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?action=' . $action . '&sprache=' . $sprache . '&content_id=' . $row->child_content_id . '">', $child->titel, '</a></td>'; echo '<td> <a href="' . $_SERVER['PHP_SELF'] . '?action=childs&content_id=' . $content_id . '&sprache=' . $sprache . '&version=' . $version . '&contentchild_id=' . $row->contentchild_id . '&method=childs_delete&filter=' . implode(' ', $filterstr) . '" title="entfernen"> <img src="../skin/images/delete_x.png"> </a> </td>'; echo '</tr>'; } echo '</tbody></table>'; $content = new content(); $content->getpossibleChilds($content_id); echo '<form action="' . $_SERVER['PHP_SELF'] . '?content_id=' . $content_id . '&sprache=' . $sprache . '&version=' . $version . '&action=childs&method=childs_add&filter=' . implode(' ', $filterstr) . '" method="POST">'; echo '<select name="child_content_id">'; foreach ($content->result as $row) { echo '<option value="' . $row->content_id . '">' . $row->titel . ' (' . $row->content_id . ')</option>'; } echo '</select>'; echo '<input type="submit" value="Hinzufügen" name="add">'; echo '</form>'; }