From: Erin S. <ebu...@us...> - 2003-10-23 10:22:14
|
Update of /cvsroot/squirrelmail/smdoc/templates In directory sc8-pr-cvs1:/tmp/cvs-serv13026/templates Modified Files: default.tpl style.css Added Files: foowd_object.object_history.tpl index.tpl smdoc_external.changes.tpl smdoc_external.siteindex.tpl Removed Files: foowd_object.object_history.php index.php smdoc_external.changes.php smdoc_external.object_view.php smdoc_external.siteindex.php Log Message: More templating changes.. Revisions, file renaming. More to follow --- NEW FILE --- <?php $t['body_function'] = 'object_history_body'; include(TEMPLATE_PATH.'/index.tpl'); function object_history_body(&$foowd, $className, $method, $user, $object, &$t) {?> <h1>History of <?php echo $t['title']; ?></h1> <p> <table border="0" cellspacing="0" cellpadding="0" align="center"> <tr><td></td><td rowspan="6" width="10"><img src="empty.png" border="0" alt="" /></td><td></td></tr> <tr><td><b>Title:</b> </td><td><?php echo $t['detailsTitle']; ?></td></tr> <tr><td><b>Created:</b> </td><td><?php echo $t['detailsCreated']; ?></td></tr> <tr><td><b>Author:</b> </td><td><?php echo $t['detailsAuthor']; ?></td></tr> <tr><td><b>Object Type:</b></td><td><?php echo $t['detailsType']; ?></td></tr> <?php if (isset($t['detailsWorkspace'])) { ?> <tr><td><b>Workspace:</b> </td><td><?php echo $t['detailsWorkspace']; ?></td></tr> <?php } ?> </table> </p> <p> <table border="0" cellspacing="5" align="center"> <tr > <th class="separator">Last Updated</th> <th class="separator">Author</th> <th class="separator" align="center">Version</th> <th> </th> <?php foreach ($t['versions'] as $version) { $link = getURI() . '?objectid=' . $version['objectid'] . '&classid=' . $version['classid'] . '&version=' . $version['version']; ?> </tr> <tr> <td class="smalldate"><?php echo $version['updated']; ?></td> <td class="small" align="center"><?php echo $version['author']; ?></td> <td class="small" align="center"><a href="<?php echo $link; ?>"><?php echo $version['version']; ?></a></td> <?php if (isset($version['revert']) && $foowd->user->hasPermission($className,'revert','object',$object) ) { ?> <td class="small"><a href="<?php echo $link.'&method=revert'; ?>">Revert</a></td> <?php } if ( isset($version['diff']) && $foowd->user->hasPermission($className,'diff','object',$object)) { ?> <td class="small"><a href="<?php echo $link.'&method=diff'; ?>">Diff</a></td> <?php } } ?> </tr> </table> </p> <?php } ?> --- NEW FILE --- <table width="100%" cellspacing="2"> <tr> <th><?php echo _("Title") ?></th> <th></th> <th><?php echo _("Updated") ?></th> <th><?php echo _("Author") ?></th> <th align="left"><?php echo _("Object Type") ?></th> </tr> <?php $row = 0; foreach ( $t['changeList'] as $arr ) { ?> <tr class="<?php echo ($row ? 'row_odd' : 'row_even'); ?>"> <td><a href="<?php echo $arr['url']; ?>"><?php echo $arr['title']; ?></a></td> <td class="small" align="center"> <?php echo $arr['langid']; ?></td> <td class="smalldate" align="center"> <?php echo $arr['updated']; ?></td> <td class="small" align="center"> <?php echo $arr['updated_by']; ?></td> <td class="small" align="left"> <?php echo $arr['desc']; ?></td> </tr> <?php $row = !$row; } ?> </table> --- NEW FILE --- <?php $temp_index = array('A','B','C','D','E','F','G','H','I','J','K','L','M', 'N','O','P','Q','R','S','T','U','V','W','X','Y','Z'); $i = 0; $index = array(); $object_arr =& $t['objectList']; $max = count($object_arr); $prev = 0; foreach ( $temp_index as $char ) { $ord_char = ord($char); if ( $i < $max ) $ord_title = ord(ucfirst($object_arr[$i]['title'])); if ( $i >= $max || $ord_title > $ord_char ) { // character in title is higher in alphabet than character in index $index[] = $char; continue; } elseif ( $ord_title == $ord_char ) { // character in index is equal to first character of current object title $index[] = '<a href="#index_' . $char . '">'. $char . '</a>'; $object_arr[$i]['index'] = '<a name="#index_' . $char . '"></a>'; $prev = $ord_title; // skip over duplicates $i++; while ( $i < $max ) { $ord_title = ord(ucfirst($object_arr[$i]['title'])); if ( $ord_title != $ord_char ) break; $i++; } } } ?> <div class="index"><?php echo implode(' ', $index); ?></div> <table width="100%" cellspacing="2"> <tr> <th><?php echo _("Title") ?></th> <th></th> <th></th> <th><?php echo _("Updated") ?></th> <th align="left"><?php echo _("Object Type") ?></th> </tr> <?php $row = 0; foreach ( $object_arr as $arr ) { if ( isset($arr['index']) ) { ?> <tr> <td colspan="5"><?php echo $arr['index']; ?></td> </tr> <?php } ?> <tr class="<?php echo ($row ? 'row_odd' : 'row_even'); ?>"> <td><a href="<?php echo $arr['url']; ?>"><?php echo $arr['title']; ?></a></td> <td class="small" align="center"> <?php echo $arr['permission']; ?></td> <td class="small" align="center"> <?php echo $arr['langid']; ?></td> <td class="smalldate" align="center"> <?php echo $arr['updated']; ?></td> <td class="small" align="left"> <?php echo $arr['desc']; ?></td> </tr> <?php $row = !$row; } ?> </table> Index: default.tpl =================================================================== RCS file: /cvsroot/squirrelmail/smdoc/templates/default.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- default.tpl 30 Sep 2003 05:10:06 -0000 1.1 +++ default.tpl 23 Oct 2003 05:14:42 -0000 1.2 @@ -1,8 +1,12 @@ <?php -function default_body($foowd, $className, $method, $user, $object, $t) +$t['body_function'] = 'default_body'; +include(TEMPLATE_PATH.'/index.tpl'); + +function default_body(&$foowd, $className, $method, $user, &$object, &$t) { echo '<h3>Default Object Display</h3>'; + if ( isset($object) ) { echo '<pre>Class: ', $className, "\n", 'Method: ', $method, '</pre>'; @@ -11,6 +15,4 @@ } } -$t['body_function'] = 'default_body'; -include(TEMPLATE_PATH.'/index.php'); ?> Index: style.css =================================================================== RCS file: /cvsroot/squirrelmail/smdoc/templates/style.css,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- style.css 30 Sep 2003 05:14:22 -0000 1.2 +++ style.css 23 Oct 2003 05:14:42 -0000 1.3 @@ -17,7 +17,7 @@ padding-right: 5px; } #pagetitle .logo { - background: #fff url(templates/images/sm_logo.png) no-repeat top left; + background: #fff url(images/sm_logo.png) no-repeat top left; } #pagetitle .usermenu { font-size: small; --- foowd_object.object_history.php DELETED --- --- index.php DELETED --- --- smdoc_external.changes.php DELETED --- --- smdoc_external.object_view.php DELETED --- --- smdoc_external.siteindex.php DELETED --- |