return $array;
}
+ /**
+ * Prepare a given one dimension array for deleting
+ *
+ * @access public
+ * @author Falk Doering
+ * @param array the array
+ * @param string the key of the main id
+ * @param string the key of the parent id
+ * @return array the final array with one new keys: 'delete' with true or false
+ */
+ function prepareDelete($array, $this_id = 'id', $parent_id = 'parent_id')
+ {
+ global $serendipity;
+
+ if (is_array($array)) {
+ for ($i = 0, $ii = count($array); $i < $ii; $i++) {
+ if (isset($array[$i+1]) && ($array[$i+1][$parent_id] == $array[$i][$this_id])) {
+ $array[$i]['delete'] = false;
+ } else {
+ $array[$i]['delete'] = true;
+ }
+ }
+ }
+ return $array;
+ }
+
+
/**
* Update table for re-ordering
*