Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22573
Modified Files:
NEWS serendipity_admin_plugins.inc.php
serendipity_functions.inc.php serendipity_sidebar_items.php
Log Message:
Redesigned the plugin manager - now it looks more like the installer
Added RFE #827945 - Allow for custom selection of calendar beginning on week
Please test the latter, it's somewhat of a hack :)
Index: NEWS
===================================================================
RCS file: /cvsroot/php-blog/serendipity/NEWS,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -d -r1.79 -r1.80
--- NEWS 26 Feb 2004 11:37:42 -0000 1.79
+++ NEWS 27 Feb 2004 19:25:54 -0000 1.80
@@ -2,6 +2,8 @@
Version 0.5.1 ()
------------------------------------
+ * Redesigned the plugin manager (tomsommer)
+ * Added RFE #827945 - Allow for custom selection of calendar beginning on week (tomsommer)
* Markup can be applied individually from a list of available transformations: BBCode, Wiki, Textile, s9y markup, Emoticons, nl2br. Multiple transformations are possible. (Colin Viebrock, garvinhicking)
* Allow for each language to have its own charset (tomsommer)
* Now able to preview comments. (garvinhicking)
Index: serendipity_admin_plugins.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_plugins.inc.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- serendipity_admin_plugins.inc.php 10 Feb 2004 13:36:54 -0000 1.16
+++ serendipity_admin_plugins.inc.php 27 Feb 2004 19:25:55 -0000 1.17
@@ -227,9 +227,9 @@
}
?>
<form method="post" name="serendipityPluginConfigure">
- <table cellpadding="5">
+ <table cellpadding="5" style="border: 1px dashed" width="90%" align="center">
<tr>
- <th><?php echo NAME; ?></th>
+ <th width="100"><?php echo NAME; ?></th>
<td><?php echo $name; ?></td>
</tr>
@@ -238,8 +238,8 @@
<td><?php echo $desc; ?></td>
</tr>
</table>
-
- <table border="0" cellspacing="5" cellpadding="5">
+<br />
+ <table border="0" cellspacing="0" cellpadding="3" width="100%">
<?php
foreach ($config_names as $config_item) {
$cbag = new serendipity_property_bag;
@@ -265,8 +265,14 @@
$select = $cbag->get('select_values');
?>
<tr>
- <td style="vertical-align: top"><?php echo $cname; ?></td>
- <td style="vertical-align: top">
+ <td style="border-bottom: 1px solid #000000; vertical-align: top"><strong><?php echo $cname; ?></strong>
+<?php
+ if ($cdesc != '') {
+?>
+ <br><span style="color: #5E7A94; font-size: 8pt;"> <?php echo $cdesc; ?></span>
+<?php } ?>
+ </td>
+ <td style="border-bottom: 1px solid #000000; vertical-align: middle" width="250">
<div>
<select name="serendipity[plugin][<?php echo $config_item; ?>]">
<?php
@@ -281,13 +287,6 @@
?>
</select>
</div>
-<?php
- if ($cdesc != '') {
-?>
- <br /><span style="color: #bbbbbb">// <?php echo $cdesc; ?></span>
-<?php
- }
-?>
</td>
</tr>
<?php
@@ -311,8 +310,16 @@
}
?>
<tr>
- <td style="vertical-align: top"><?php echo $cname; ?></td>
- <td style="vertical-align: top">
+ <td style="border-bottom: 1px solid #000000; vertical-align: top"><strong><?php echo $cname; ?></strong>
+<?php
+ if ($cdesc != '') {
+?>
+ <br /><span style="color: #5E7A94; font-size: 8pt;"> <?php echo $cdesc; ?></span>
+<?php
+ }
+?>
+ </td>
+ <td style="border-bottom: 1px solid #000000; vertical-align: middle;" width="250">
<?php
$counter = 0;
foreach($radio['value'] AS $radio_index => $radio_value) {
@@ -334,12 +341,6 @@
<?php
}
}
-
- if ($cdesc != '') {
-?>
- <br /><span style="color: #bbbbbb">// <?php echo $cdesc; ?></span>
-<?php
- }
?>
</td>
</tr>
@@ -349,10 +350,13 @@
case 'string':
?>
<tr>
- <td><?php echo $cname; ?></td>
- <td>
+ <td style="border-bottom: 1px solid #000000">
+ <strong><?php echo $cname; ?></strong>
+ <br><span style="color: #5E7A94; font-size: 8pt;"> <?php echo $cdesc; ?></span>
+ </td>
+ <td style="border-bottom: 1px solid #000000" width="250">
<div>
- <input type="text" name="serendipity[plugin][<?php echo $config_item; ?>]" value="<?php echo $hvalue; ?>" /> <span style="color: #bbbbbb">// <?php echo $cdesc; ?></span>
+ <input type="text" name="serendipity[plugin][<?php echo $config_item; ?>]" value="<?php echo $hvalue; ?>" size="30" />
</div>
</td>
</tr>
@@ -362,8 +366,8 @@
case 'html':
?>
<tr>
- <td colspan="2">
- <?php echo $cname; ?> <span style="color: #bbbbbb">// <?php echo $cdesc; ?></span>
+ <td colspan="2"><strong><?php echo $cname; ?></strong>
+ <span style="color: #5E7A94; font-size: 8pt;"> <?php echo $cdesc; ?></span>
</td>
</tr>
@@ -381,8 +385,8 @@
}
?>
</table>
-
- <div>
+<br />
+ <div style="padding-left: 20px">
<input type="submit" name="SAVECONF" value="<?php echo SAVE; ?>" />
</div>
</form>
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.218
retrieving revision 1.219
diff -u -d -r1.218 -r1.219
--- serendipity_functions.inc.php 26 Feb 2004 11:37:42 -0000 1.218
+++ serendipity_functions.inc.php 27 Feb 2004 19:25:55 -0000 1.219
@@ -298,9 +298,14 @@
}
// Draws a little calendar in HTML
-function serendipity_drawCalendar($month, $year) {
+function serendipity_drawCalendar($month, $year, $bow=1) {
global $serendipity;
+ if (empty($bow)) {
+ $bow = 1;
+ }
+
+
// Catch faulty month
if ($month<1) {
$month = 1;
@@ -312,13 +317,17 @@
$nrOfDays = date('t', $ts);
$firstDayWeekDay = date('w', $ts);
- // Shift the weekday a little, we want monday to be day number 0
- if ($firstDayWeekDay >0) {
- $firstDayWeekDay -=1;
- } else {
+ // Hack out if firstday is sunday, then we move it to the last day of the week
+ if ( $firstDayWeekDay == 0 ) {
$firstDayWeekDay = 6;
}
+ if ( $bow >= $firstDayWeekDay+1 ) {
+ $firstDayWeekDay += ($bow*2)+1;
+ } else {
+ $firstDayWeekDay -= ($bow);
+ }
+
// Calculate the number of next/previous month
if ($month > 1) {
$previousMonth = $month-1;
@@ -408,7 +417,7 @@
<tr>
<?php
for ( $i = 1; $i <= 7; $i++ ) {
- $date = mktime(0,0,0,3,$i,2004);
+ $date = mktime(0,0,0,3,$i+$bow-1,2004);
?>
<td class="serendipity_weekDayName" align="center"><?php echo substr(strftime("%a", $date),0,2); ?></td>
<?php
Index: serendipity_sidebar_items.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_sidebar_items.php,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- serendipity_sidebar_items.php 26 Feb 2004 11:37:42 -0000 1.46
+++ serendipity_sidebar_items.php 27 Feb 2004 19:25:55 -0000 1.47
@@ -5,6 +5,22 @@
{
$propbag->add('name', CALENDAR);
$propbag->add('description', QUICKJUMP_CALENDAR);
+ $propbag->add('configuration', array('beginningOfWeek'));
+ }
+
+ function introspect_config_item($name, &$propbag)
+ {
+ switch($name) {
+ case 'beginningOfWeek':
+ $propbag->add('type', 'string');
+ $propbag->add('name', CALENDAR_BEGINNING_OF_WEEK);
+ $propbag->add('description', CALENDAR_BOW_DESC);
+ break;
+
+ default:
+ return false;
+ }
+ return true;
}
function generate_content(&$title)
@@ -31,7 +47,9 @@
(isset($serendipity['GET']['calendarZoom']) ? $serendipity['GET']['calendarZoom'] : ''),
0,
4
- )
+ ),
+ $this->get_config('beginningOfWeek')
+
);
}
}
|