Update of /cvsroot/php-blog/serendipity/include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13006/include
Modified Files:
functions.inc.php functions_images.inc.php
Log Message:
- Redesign and partly rewrite category management
TODO: needs the even/uneven css class, somehow
Index: functions_images.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/functions_images.inc.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- functions_images.inc.php 10 Dec 2004 18:53:55 -0000 1.17
+++ functions_images.inc.php 15 Dec 2004 19:46:35 -0000 1.18
@@ -915,7 +915,7 @@
<?php if ($is_image) { ?><img class="serendipityImageButton" title="<?php echo IMAGE_RESIZE; ?>" alt="<?php echo IMAGE_RESIZE; ?>" src="<?php echo serendipity_getTemplateFile('admin/img/resize.png') ?>" border="0" onclick="location.href='?serendipity[adminModule]=images&serendipity[adminAction]=scaleSelect&serendipity[fid]=<?php echo $file['id']; ?>';" /><br /><?php } ?>
<?php if ($is_image) { ?><a href="?serendipity[adminModule]=images&serendipity[adminAction]=rotateLeft&serendipity[fid]=<?php echo $file['id']; ?>"><img class="serendipityImageButton" title="<?php echo IMAGE_ROTATE_LEFT; ?>" alt="<?php echo IMAGE_ROTATE_LEFT; ?>" src="<?php echo serendipity_getTemplateFile('admin/img/rotate_ccw.png') ?>" border="0" /><br /><?php } ?>
<?php if ($is_image) { ?><a href="?serendipity[adminModule]=images&serendipity[adminAction]=rotateRight&serendipity[fid]=<?php echo $file['id']; ?>"><img class="serendipityImageButton" title="<?php echo IMAGE_ROTATE_RIGHT; ?>" alt="<?php echo IMAGE_ROTATE_RIGHT; ?>" src="<?php echo serendipity_getTemplateFile('admin/img/rotate_cw.png') ?>" border="0" /><br /><?php } ?>
- <a href="?serendipity[adminModule]=images&serendipity[adminAction]=delete&serendipity[fid]=<?php echo $file['id']; ?>"><img class="serendipityImageButton" title="<?php echo MEDIA_DELETE; ?>" alt="<?php echo MEDIA_DELETE; ?>" src="<?php echo serendipity_getTemplateFile('admin/img/delete.png') ?>" border="0" /><br />
+ <a href="?serendipity[adminModule]=images&serendipity[adminAction]=delete&serendipity[fid]=<?php echo $file['id']; ?>"><img class="serendipityImageButton" title="<?php echo MEDIA_DELETE; ?>" alt="<?php echo MEDIA_DELETE; ?>" src="<?php echo serendipity_getTemplateFile('admin/img/delete_image.png') ?>" border="0" /><br />
<?php
}
?>
Index: functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/functions.inc.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- functions.inc.php 8 Dec 2004 20:27:52 -0000 1.11
+++ functions.inc.php 15 Dec 2004 19:46:34 -0000 1.12
@@ -102,6 +102,40 @@
return $data;
}
+function serendipity_walkRecursive($ary, $child_name = 'id', $parent_name = 'parent_id', $parentid = 0, $depth = 0) {
+ global $serendipity;
+ static $_resArray;
+
+ if ( sizeof($ary) == 0 ) {
+ return array();
+ }
+
+ if ($parentid === VIEWMODE_THREADED) {
+ $parentid = 0;
+ }
+
+ if ( $depth == 0 ) {
+ $_resArray = array();
+ }
+
+ foreach ($ary as $data) {
+ if ($parentid === VIEWMODE_LINEAR || !isset($data[$parent_name]) || $data[$parent_name] == $parentid) {
+ $data['depth'] = $depth;
+ $_resArray[] = $data;
+ if ($data[$child_name] && $parentid !== VIEWMODE_LINEAR ) {
+ serendipity_walkRecursive($ary, $child_name, $parent_name, $data[$child_name], ($depth+1));
+ }
+ }
+ }
+
+ /* We are inside a recusive child, and we need to break out */
+ if ($depth !== 0) {
+ return true;
+ }
+
+ return $_resArray;
+}
+
function serendipity_fetchUsers($user = '') {
global $serendipity;
|