Update of /cvsroot/php-blog/serendipity/include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10304/include
Modified Files:
functions.inc.php functions_entries.inc.php
functions_images.inc.php functions_installer.inc.php
plugin_api.inc.php plugin_internal.inc.php
Log Message:
- Merged author and admin suites
- New separated layout for Administration Suite
- Fixed lots of layout quirks, make the admin look more unified
- Fixed some invalid HTML (unclosed/excess tags)
- Remove some unneeded session_start() functions in included admin files
- Allow $plugin->get_config() to return the default value as defined in introspect_config_item, when only given one argument
- Fixed bug in upgrader, not allowing multiple upgrade functions for a single version
- Killed serendipity_printLogin() and moved it to serendipity_admin.php
- Pretty up the iframe stuff
- Added aliases to some adminModules
Index: functions_installer.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/functions_installer.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- functions_installer.inc.php 20 Nov 2004 14:09:10 -0000 1.4
+++ functions_installer.inc.php 27 Nov 2004 22:14:14 -0000 1.5
@@ -87,7 +87,7 @@
case 'serendipityPath':
$test_path1 = $_SERVER['DOCUMENT_ROOT'] . rtrim(dirname($_SERVER['PHP_SELF']), '/') . '/';
$test_path2 = serendipity_getRealDir(__FILE__);
- if (file_exists($test_path1 . 'serendipity_entries.php')) {
+ if (file_exists($test_path1 . 'serendipity_admin.php')) {
return $test_path1;
} else {
return $test_path2;
Index: functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/functions.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- functions.inc.php 19 Nov 2004 11:05:29 -0000 1.2
+++ functions.inc.php 27 Nov 2004 22:14:13 -0000 1.3
@@ -671,42 +671,6 @@
return (strpos($d, "\r") === false && strpos($d, "\n") === false);
}
-function serendipity_printLogin() {
- global $serendipity;
-?>
- <td id="content">
- <div class="serendipity_admin_title serendipity_center"><?php echo HAVE_TO_BE_LOGGED_ON ?></div>
- <div class="serendipity_admin">
-<?php
- if ( isset($serendipity['POST']['action']) && !serendipity_userLoggedIn() ) {
-?>
- <div class="serendipity_center serendipity_msg_important"><?php echo WRONG_USERNAME_OR_PASSWORD; ?></div>
-<?php
- }
-?>
- <form action="?" method="post">
- <input type="hidden" name="serendipity[action]" value="admin" />
- <table cellspacing="3" cellpadding="0" border="0" align="center" width="300">
- <tr>
- <td><?php echo USERNAME ?></td>
- <td><input type="text" name="serendipity[user]" /></td>
- </tr>
- <tr>
- <td><?php echo PASSWORD ?></td><td><input type="password" name="serendipity[pass]" /></td>
- </tr>
- <tr>
- <td colspan="2"><input id="autologin" type="checkbox" name="serendipity[auto]" /><label for="autologin"> <?php echo AUTOMATIC_LOGIN ?></label></td>
- </tr>
- <tr>
- <td colspan="2" align="right"><input type="submit" name="submit" value="<?php echo LOGIN ?> >" /></td>
- </tr>
- </table>
- </form>
- </div>
- <a href="<?php echo $serendipity['serendipityHTTPPath']; ?>"><?php echo BACK_TO_BLOG;?></a>
-<?php
-}
-
define("serendipity_FUNCTIONS_LOADED", true);
/* vim: set sts=4 ts=4 expandtab : */
?>
Index: functions_entries.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/functions_entries.inc.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- functions_entries.inc.php 26 Nov 2004 14:40:13 -0000 1.10
+++ functions_entries.inc.php 27 Nov 2004 22:14:14 -0000 1.11
@@ -1152,7 +1152,7 @@
if (!empty($errMsg)) {
?>
- <span class="serendipity_msg_important"><?php echo $errMsg; ?></span>
+ <div class="serendipityAdminMsgError"><?php echo $errMsg; ?></div>
<?php } ?>
<form action="<?php echo $targetURL; ?>" method="post" <?php echo ($serendipity['XHTML11'] ? 'id' : 'name'); ?>="serendipityEntry" style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px">
<?php echo $hidden; ?>
@@ -1165,7 +1165,7 @@
<td colspan="2">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
- <td><input type="text" name="serendipity[title]" value="<?php echo isset($entry['title']) ? htmlspecialchars($entry['title']) : ''; ?>" size="72" /></td>
+ <td><input type="text" name="serendipity[title]" value="<?php echo isset($entry['title']) ? htmlspecialchars($entry['title']) : ''; ?>" size="60" /></td>
<td align="right">
<select name="serendipity[isdraft]">
<?php if ($_SESSION['serendipityRightPublish']) { ?><option value="false" <?php echo $draftP; ?>><?php echo PUBLISH; ?></option><?php } ?>
@@ -1603,8 +1603,8 @@
</head>
<body style="padding: 0px; margin: 0px;">
- <div id="mainpane" style="padding: 0px; margin: 0px;">
- <div id="content" style="height: 100%; padding: 0px; margin: 0px">
+ <div id="mainpane" style="padding: 0px; margin: auto; width: 99%;">
+ <div id="content" style="padding: 0px; margin: 0px;">
<?php
// We need to restore GET/POST variables to that depending plugins inside the iframe
// can still fetch all that variables; and we also tighten security by not allowing
@@ -1642,7 +1642,7 @@
// it needs to be stored with the new ID.
echo '<script type="text/javascript">parent.document.forms[\'serendipityEntry\'][\'serendipity[id]\'].value = "' . $serendipity['lastSavedEntry'] . '";</script>';
}
- echo '<div class="serendipity_msg_notice">' . ENTRY_SAVED . '</div>';
+ echo '<div class="serendipityAdminMsgSuccess">' . ENTRY_SAVED . '</div>';
}
return true;
@@ -1653,10 +1653,7 @@
serendipity_smarty_init();
$serendipity['smarty']->assign('is_preview', true);
- echo '<strong>' . PREVIEW . '</strong>';
- echo '<div style="border:1px solid #000000; padding: 15px;">';
serendipity_printEntries(array($entry), ($entry['extended'] != '' ? 1 : 0), true);
- echo '</div>';
return true;
break;
@@ -1677,16 +1674,16 @@
switch($mode) {
case 'save':
$attr = ' height="100" ';
- echo '<div class="serendipity_msg_notice">' . IFRAME_PREVIEW . '</div><br />';
+ echo '<div class="serendipityAdminMsgSuccess">' . IFRAME_PREVIEW . '</div><br />';
break;
case 'preview':
$attr = ' height="300" ';
- echo '<div class="serendipity_msg_notice">' . IFRAME_SAVE . '</div><br />';
+ echo '<div class="serendipityAdminMsgSuccess">' . IFRAME_SAVE . '</div><br />';
break;
}
- echo '<iframe src="serendipity_admin.php?serendipity[is_iframe]=true&serendipity[iframe_mode]=' . $mode . '" name="serendipity_iframe" ' . $attr . ' width="95%" frameborder="1" marginwidth="0" marginheight="0" scrolling="auto" title="Serendipity">'
+ echo '<iframe src="serendipity_admin.php?serendipity[is_iframe]=true&serendipity[iframe_mode]=' . $mode . '" id="serendipity_iframe" name="serendipity_iframe" ' . $attr . ' width="100%" frameborder="0" marginwidth="0" marginheight="0" scrolling="auto" title="Serendipity">'
. IFRAME_WARNING
. '</iframe><br /><br />';
}
Index: plugin_internal.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/plugin_internal.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- plugin_internal.inc.php 24 Nov 2004 18:52:21 -0000 1.8
+++ plugin_internal.inc.php 27 Nov 2004 22:14:14 -0000 1.9
@@ -751,7 +751,7 @@
$base = $serendipity['serendipityHTTPPath'];
}
- $link = $base . ($serendipity['rewrite'] == 'none' ? 'serendipity_entries.php?/' : '') . PATH_ENTRIES;
+ $link = $base . ($serendipity['rewrite'] == 'none' ? $serendipity['indexFile'] .'?/' : '') . 'admin';
$text = (($_SESSION['serendipityAuthedUser'] === true) ? SUPERUSER_OPEN_ADMIN : SUPERUSER_OPEN_LOGIN);
echo '<a href="' . $link . '" title="'. $text .'">'. $text .'</a>';
}
Index: plugin_api.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/plugin_api.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- plugin_api.inc.php 23 Nov 2004 12:47:02 -0000 1.5
+++ plugin_api.inc.php 27 Nov 2004 22:14:14 -0000 1.6
@@ -615,8 +615,16 @@
/* Fetches a configuration value for this plugin */
function get_config($name, $defaultvalue = null, $empty = true)
{
- $name = $this->instance . '/' . $name;
- return serendipity_get_config_var($name, $defaultvalue, $empty);
+ $_res = serendipity_get_config_var($this->instance . '/' . $name, $defaultvalue, $empty);
+
+ if (is_null($_res)) {
+ $cbag = new serendipity_property_bag;
+ $this->introspect_config_item($name, $cbag);
+ $_res = $cbag->get('default');
+ unset($cbag);
+ }
+
+ return $_res;
}
function set_config($name, $value)
Index: functions_images.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/functions_images.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- functions_images.inc.php 19 Nov 2004 11:05:30 -0000 1.2
+++ functions_images.inc.php 27 Nov 2004 22:14:14 -0000 1.3
@@ -288,7 +288,7 @@
$returnsize = serendipity_makeThumbnail($filename, false, $file['authorid'], '', false);
printf(RESIZE_BLAHBLAH, $filename . ': ' . $returnsize[0] . 'x' . $returnsize[1]);
if (!file_exists($newThumb)) {
- printf('<span class="serendipity_msg_important">' . THUMBNAIL_FAILED_COPY . '</span><br />', $filename);
+ printf('<span class="serendipityAdminMsgError">' . THUMBNAIL_FAILED_COPY . '</span><br />', $filename);
} else {
$update = true;
}
@@ -298,7 +298,7 @@
printf(THUMBNAIL_USING_OWN . '<br />', $filename);
$update = true;
} else {
- printf('<span class="serendipity_msg_important">' . THUMBNAIL_FAILED_COPY . '</span><br />', $filename);
+ printf('<span class="serendipityAdminMsgError">' . THUMBNAIL_FAILED_COPY . '</span><br />', $filename);
}
}
|