Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18198
Modified Files:
Tag: branch-smarty
serendipity_admin_templates.inc.php
serendipity_functions.inc.php
Log Message:
- Move printing/listing of templates out of _functions, we don't need it as a function
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.419.2.58
retrieving revision 1.419.2.59
diff -u -d -r1.419.2.58 -r1.419.2.59
--- serendipity_functions.inc.php 28 Oct 2004 12:01:24 -0000 1.419.2.58
+++ serendipity_functions.inc.php 28 Oct 2004 20:22:53 -0000 1.419.2.59
@@ -154,58 +154,6 @@
serendipity_set_config_var('template', $theme);
}
-function serendipity_printTemplates($themelist) {
- global $serendipity;
-?>
-<div>
- <form method="post" action="<?php echo $serendipity['serendipityHTTPPath']; ?>serendipity_admin.php?serendipity[adminModule]=templates&serendipity[adminAction]=save">
-<?php
- foreach ($themelist as $theme) {
- $info = serendipity_fetchTemplateInfo($theme);
- if (file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . $theme . '/preview.png')) {
- $preview = '<img src="templates/' . $theme . '/preview.png" width="100" style="border: 1px #000000 solid" />';
- } else {
- $preview = ' ';
- }
-
- if (serendipity_get_config_var('template', $serendipity['defaultTemplate']) == $theme) {
- $is_active = 'checked="checked"';
- } else {
- $is_active = '';
- }
-
- $jsLine = " onmousedown=\"document.getElementById('serendipity_theme_radio_". $theme ."').checked = true;\"";
- $jsLine .= " onmouseout=\"document.getElementById('serendipity_theme_". $theme ."').className='';\"";
- $jsLine .= " onmouseover=\"document.getElementById('serendipity_theme_". $theme ."').className='serendipity_admin_list_item_uneven'; style.cursor = 'pointer';\"";
-?>
- <table width="100%" id="serendipity_theme_<?php echo $theme; ?>">
- <tr>
- <td colspan="3" <?php echo $jsLine ?>><strong><?php echo $info['name']; ?></strong></td>
- </tr>
-
- <tr>
- <td width="100" <?php echo $jsLine ?> style="padding-left: 10px"><?php echo $preview; ?></td>
-
- <td valign="top" <?php echo $jsLine ?>>
- <?php echo AUTHOR; ?> : <?php echo $info['author'];?><br />
- <?php echo LAST_UPDATED; ?>: <?php echo $info['date']; ?>
- </td>
-
- <td valign="middle" align="center" width="70" <?php echo $jsLine ?>>
- <div><input type="radio" name="serendipity[theme]" value="<?php echo $theme; ?>" id="serendipity_theme_radio_<?php echo $theme; ?>" <?php echo $is_active; ?> /></div>
- </td>
- </tr>
- </table>
- <br />
-<?php
- }
-?>
- <div align="right"><input type="submit" name="submit" value="<?php echo SET_AS_TEMPLATE; ?>" /></div>
- </form>
-</div>
-<?php
-}
-
function serendipity_displayCommentForm($id, $url = '', $comments = NULL, $data = NULL, $showToolbar = true, $moderate_comments = true, $entry = null) {
global $serendipity;
Index: serendipity_admin_templates.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_templates.inc.php,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -d -r1.5 -r1.5.2.1
--- serendipity_admin_templates.inc.php 4 Apr 2004 16:24:46 -0000 1.5
+++ serendipity_admin_templates.inc.php 28 Oct 2004 20:22:53 -0000 1.5.2.1
@@ -11,9 +11,55 @@
if ($serendipity['GET']['adminAction'] == 'save' ) {
serendipity_saveTemplateSelection($serendipity['POST']['theme']);
}
+?>
-echo SELECT_TEMPLATE;
-serendipity_printTemplates(serendipity_fetchTemplates());
+<?php echo SELECT_TEMPLATE; ?>
+<div>
+ <form method="post" action="<?php echo $serendipity['serendipityHTTPPath']; ?>serendipity_admin.php?serendipity[adminModule]=templates&serendipity[adminAction]=save">
+<?php
+ foreach (serendipity_fetchTemplates() as $theme) {
+ $info = serendipity_fetchTemplateInfo($theme);
+ if (file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . $theme . '/preview.png')) {
+ $preview = '<img src="templates/' . $theme . '/preview.png" width="100" style="border: 1px #000000 solid" />';
+ } else {
+ $preview = ' ';
+ }
+
+ if (serendipity_get_config_var('template', $serendipity['defaultTemplate']) == $theme) {
+ $is_active = 'checked="checked"';
+ } else {
+ $is_active = '';
+ }
+
+ $jsLine = " onmousedown=\"document.getElementById('serendipity_theme_radio_". $theme ."').checked = true;\"";
+ $jsLine .= " onmouseout=\"document.getElementById('serendipity_theme_". $theme ."').className='';\"";
+ $jsLine .= " onmouseover=\"document.getElementById('serendipity_theme_". $theme ."').className='serendipity_admin_list_item_uneven'; style.cursor = 'pointer';\"";
+?>
+ <table width="100%" id="serendipity_theme_<?php echo $theme; ?>">
+ <tr>
+ <td colspan="3" <?php echo $jsLine ?>><strong><?php echo $info['name']; ?></strong></td>
+ </tr>
+
+ <tr>
+ <td width="100" <?php echo $jsLine ?> style="padding-left: 10px"><?php echo $preview; ?></td>
+ <td valign="top" <?php echo $jsLine ?>>
+ <?php echo AUTHOR; ?> : <?php echo $info['author'];?><br />
+ <?php echo LAST_UPDATED; ?>: <?php echo $info['date']; ?>
+ </td>
+
+ <td valign="middle" align="center" width="70" <?php echo $jsLine ?>>
+ <div><input type="radio" name="serendipity[theme]" value="<?php echo $theme; ?>" id="serendipity_theme_radio_<?php echo $theme; ?>" <?php echo $is_active; ?> /></div>
+ </td>
+ </tr>
+ </table>
+ <br />
+<?php
+ }
+?>
+ <div align="right"><input type="submit" name="submit" value="<?php echo SET_AS_TEMPLATE; ?>" /></div>
+ </form>
+</div>
+<?php
/* vim: set sts=4 ts=4 expandtab : */
?>
|