Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1:/tmp/cvs-serv16657
Modified Files:
serendipity_sidebar_items.php
Log Message:
Code cleanup: Indentation, single/double quotes.
Index: serendipity_sidebar_items.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_sidebar_items.php,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- serendipity_sidebar_items.php 8 Jul 2003 09:13:27 -0000 1.21
+++ serendipity_sidebar_items.php 16 Jul 2003 12:08:22 -0000 1.22
@@ -1,204 +1,229 @@
<?php # $Id$
class serendipity_calendar_plugin extends serendipity_plugin {
+ function introspect(&$propbag)
+ {
+ $propbag->add('name', CALENDAR);
+ $propbag->add('description', QUICKJUMP_CALENDAR);
+ }
+
+ function generate_content(&$title)
+ {
+ global $serendipity;
+
+ $title = QUICKJUMP;
- function introspect(&$propbag)
- {
- $propbag->add('name', CALENDAR);
- $propbag->add('description', QUICKJUMP_CALENDAR);
- }
-
- function generate_content(&$title)
- {
- global $serendipity;
-
- $title = QUICKJUMP;
- if (!$serendipity["GET"]["calendarZoom"]) {
- if (!$serendipity["GET"]["range"]) {
- $serendipity["GET"]["calendarZoom"] = date("Y").date("m");
- }
- else {
- $serendipity["GET"]["calendarZoom"] = $serendipity["GET"]["range"];
- }
- }
- serendipity_drawCalendar(substr($serendipity["GET"]["calendarZoom"], 4, 2),
- substr($serendipity["GET"]["calendarZoom"], 0,4));
+ if (!$serendipity['GET']['calendarZoom']) {
+ if (!$serendipity['GET']['range']) {
+ $serendipity['GET']['calendarZoom'] = date('Y') . date('m');
+ } else {
+ $serendipity['GET']['calendarZoom'] = $serendipity['GET']['range'];
+ }
+ }
- }
+ serendipity_drawCalendar(
+ substr(
+ $serendipity['GET']['calendarZoom'],
+ 4,
+ 2
+ ),
+ substr(
+ $serendipity['GET']['calendarZoom'],
+ 0,
+ 4
+ )
+ );
+ }
}
class serendipity_quicksearch_plugin extends serendipity_plugin {
- function introspect(&$propbag)
- {
- $propbag->add('name', QUICKSEARCH);
- $propbag->add('description', SEARCH_FOR_ENTRY);
- }
-
- function generate_content(&$title)
- {
- global $serendipity;
-
- $title = QUICKSEARCH;
-
- echo "<form action=\"$serendipity[serendipityHTTPPath]search.php\" METHOD=\"GET\">\n"
- . "<input type=\"hidden\" name=\"serendipity[action]\" value=\"search\">\n"
- . "<INPUT TYPE=\"TEXT\" name=\"serendipity[searchTerm]\" ONFOCUS=\"value='';\" size=\"13\">\n"
- . "</form>";
- }
+ function introspect(&$propbag)
+ {
+ $propbag->add('name', QUICKSEARCH);
+ $propbag->add('description', SEARCH_FOR_ENTRY);
+ }
+
+ function generate_content(&$title)
+ {
+ global $serendipity;
+
+ $title = QUICKSEARCH;
+?>
+<form action="<?= $serendipity['serendipityHTTPPath']; ?>search.php" method="get">
+ <div>
+ <input type="hidden" name="serendipity[action]" value="search" />
+ <input type="text" name="serendipity[searchTerm]" onfocus="value='';" size="13" />
+ </div>
+</form>
+<?php
+ }
}
class serendipity_archives_plugin extends serendipity_plugin {
- function introspect(&$propbag)
- {
- $propbag->add('name', ARCHIVES);
- $propbag->add('description', BROWSE_ARCHIVES);
- }
+ function introspect(&$propbag)
+ {
+ $propbag->add('name', ARCHIVES);
+ $propbag->add('description', BROWSE_ARCHIVES);
+ }
+
+ function generate_content(&$title)
+ {
+ global $serendipity;
+
+ $title = ARCHIVES;
- function generate_content(&$title)
- {
- global $serendipity;
+ $ts = mktime(0, 0, 0, (date('m')+1), 1, date('Y'));
- $title = ARCHIVES;
- $ts = mktime(0,0,0,(date("m")+1), 1, date("Y"));
- for($x=0; $x<3; $x++) {
- $ts-=1;
- if ($serendipity["rewrite"] === true)
- $link = $serendipity["serendipityHTTPPath"]."archives/".date("Ym", $ts).".html";
- else
- $link = "fixme";
- echo "<a href='$link'>".$serendipity["months"][date("n", $ts)]." ".date("Y", $ts)."</a><br />";
- $ts = mktime(0,0,0,date("m", $ts), 1, date("Y", $ts));
+ for($x = 0; $x < 3; $x++) {
+ $ts -= 1;
- }
- echo "<a href='{$serendipity['serendipityHTTPPath']}'>".RECENT."</a><br />";
- echo "<a href='{$serendipity['serendipityHTTPPath']}archive'>".OLDER."</a>";
- }
-}
+ if ($serendipity['rewrite'] === true) {
+ $link = $serendipity['serendipityHTTPPath'] . 'archives/' . date('Ym', $ts) . '.html';
+ } else {
+ $link = 'fixme';
+ }
+
+ $ts_title = $serendipity['months'][date('n', $ts)] . ' ' . date('Y', $ts);
+
+ echo '<a href="' . $link . '" title="' . $ts_title . '">' . $ts_title . '</a><br />' . "\n";
-class serendipity_topreferrers_plugin extends serendipity_plugin {
- function introspect(&$propbag)
- {
- $propbag->add('name', TOP_REFERRER);
- $propbag->add('description', SHOWS_TOP_SITES);
- }
+ $ts = mktime(0, 0, 0, date('m', $ts), 1, date('Y', $ts));
+ }
- function generate_content(&$title)
- {
- global $serendipity;
+ echo "<a href='{$serendipity['serendipityHTTPPath']}'>" . RECENT . "</a><br />\n";
+ echo "<a href='{$serendipity['serendipityHTTPPath']}archive'>" . OLDER . "</a>\n";
+ }
+}
- $title = TOP_REFERRER;
- echo serendipity_displayTopReferrers();
- }
+class serendipity_topreferrers_plugin extends serendipity_plugin {
+ function introspect(&$propbag)
+ {
+ $propbag->add('name', TOP_REFERRER);
+ $propbag->add('description', SHOWS_TOP_SITES);
+ }
+
+ function generate_content(&$title)
+ {
+ global $serendipity;
+
+ $title = TOP_REFERRER;
+ echo serendipity_displayTopReferrers();
+ }
}
class serendipity_topexits_plugin extends serendipity_plugin {
- function introspect(&$propbag)
- {
- $propbag->add('name', TOP_EXITS);
- $propbag->add('description', SHOWS_TOP_EXIT);
- }
-
- function generate_content(&$title)
- {
- global $serendipity;
-
- $title = TOP_EXITS;
- echo serendipity_displayTopExits();
- }
+ function introspect(&$propbag)
+ {
+ $propbag->add('name', TOP_EXITS);
+ $propbag->add('description', SHOWS_TOP_EXIT);
+ }
+
+ function generate_content(&$title)
+ {
+ global $serendipity;
+
+ $title = TOP_EXITS;
+ echo serendipity_displayTopExits();
+ }
}
class serendipity_syndication_plugin extends serendipity_plugin {
- function introspect(&$propbag)
- {
- $propbag->add('name', SYNDICATION);
- $propbag->add('description', SHOWS_RSS_BLAHBLAH);
- }
-
- function generate_content(&$title)
- {
- global $serendipity;
-
- $title = SYNDICATE_THIS_BLOG;
+ function introspect(&$propbag)
+ {
+ $propbag->add('name', SYNDICATION);
+ $propbag->add('description', SHOWS_RSS_BLAHBLAH);
+ }
+
+ function generate_content(&$title)
+ {
+ global $serendipity;
+
+ $title = SYNDICATE_THIS_BLOG;
?>
- <a href='<?php echo $serendipity['serendipityHTTPPath'] ; ?>rss.php?version=0.91'><img src="<?php echo $serendipity['serendipityHTTPPath'] ; ?>xml.gif" border=0></a>
- <a href='<?php echo $serendipity['serendipityHTTPPath'] ; ?>rss.php?version=0.91'>RSS 0.91 feed</a>
- <br/>
- <a href='<?php echo $serendipity['serendipityHTTPPath'] ; ?>rss.php?version=2.0'><img src="<?php echo $serendipity['serendipityHTTPPath'] ; ?>xml.gif" border=0></a>
- <a href='<?php echo $serendipity['serendipityHTTPPath'] ; ?>rss.php?version=2.0'>RSS 2.0 feed</a>
+ <a href="<?php echo $serendipity['serendipityHTTPPath']; ?>rss.php?version=0.91"><img src="<?php echo $serendipity['serendipityHTTPPath']; ?>xml.gif" border="0" alt="XML" /></a>
+ <a href="<?php echo $serendipity['serendipityHTTPPath']; ?>rss.php?version=0.91">RSS 0.91 feed</a>
+ <br />
+ <a href="<?php echo $serendipity['serendipityHTTPPath']; ?>rss.php?version=2.0"><img src="<?php echo $serendipity['serendipityHTTPPath']; ?>xml.gif" border="0" alt="XML" /></a>
+ <a href="<?php echo $serendipity['serendipityHTTPPath']; ?>rss.php?version=2.0">RSS 2.0 feed</a>
<?php
- }
+ }
}
class serendipity_superuser_plugin extends serendipity_plugin {
- function introspect(&$propbag)
- {
- $propbag->add('name', SUPERUSER);
- $propbag->add('description', ALLOWS_YOU_BLAHBLAH);
- }
-
- function generate_content(&$title)
- {
- global $serendipity;
-
- $title = SUPERUSER.":";
- echo "<a href=\"$serendipity[serendipityHTTPPath]entries\">\$ su -</a>";
- }
+ function introspect(&$propbag)
+ {
+ $propbag->add('name', SUPERUSER);
+ $propbag->add('description', ALLOWS_YOU_BLAHBLAH);
+ }
+
+ function generate_content(&$title)
+ {
+ global $serendipity;
+
+ $title = SUPERUSER . ':';
+ echo "<a href=\"{$serendipity['serendipityHTTPPath']}entries\" title=\"$title\">\$ su -</a>";
+ }
}
class serendipity_plug_plugin extends serendipity_plugin {
- function introspect(&$propbag)
- {
- $propbag->add('name', POWERED_BY);
- $propbag->add('description', ADVERTISES_BLAHBLAH);
- }
-
- function generate_content(&$title)
- {
- global $serendipity;
-
- $title = POWERED_BY.":";
- echo "<div class=\"serendipityPlug\"><a href=\"http://www.s9y.org\"><img src=\"{$serendipity['serendipityHTTPPath']}pixel/s9y_banner_tiny.png\" alt=\":serendipity\" border=\"0\"/></a></div>";
- }
+ function introspect(&$propbag)
+ {
+ $propbag->add('name', POWERED_BY);
+ $propbag->add('description', ADVERTISES_BLAHBLAH);
+ }
+
+ function generate_content(&$title)
+ {
+ global $serendipity;
+
+ $title = POWERED_BY . ":";
+?>
+<div class="serendipityPlug">
+ <a title=":serendipity" href="http://www.s9y.org/"><img src="<?= $serendipity['serendipityHTTPPath']; ?>pixel/s9y_banner_tiny.png" alt=":serendipity" border="0" /></a>
+</div>
+<?php
+ }
}
class serendipity_html_nugget_plugin extends serendipity_plugin {
- function introspect(&$propbag)
- {
- $propbag->add('name', HTML_NUGGET);
- $propbag->add('description', HOLDS_A_BLAHBLAH);
- $propbag->add('configuration', array(
- 'title',
- 'content',
- ));
- }
-
- function introspect_config_item($name, &$propbag)
- {
- switch($name) {
- case 'title':
- $propbag->add('type', 'string');
- $propbag->add('name', 'Title');
- $propbag->add('description', TITLE_FOR_NUGGET);
- break;
-
- case 'content':
- $propbag->add('type', 'html');
- $propbag->add('name', 'Content');
- $propbag->add('description', THE_NUGGET);
- break;
- default:
- return false;
- }
- return true;
- }
-
- function generate_content(&$title)
- {
- $title = $this->get_config('title', $title);
- echo serendipity_markup_text($this->get_config('content'));
- }
+ function introspect(&$propbag)
+ {
+ $propbag->add('name', HTML_NUGGET);
+ $propbag->add('description', HOLDS_A_BLAHBLAH);
+ $propbag->add('configuration', array(
+ 'title',
+ 'content',
+ )
+ );
+ }
+
+ function introspect_config_item($name, &$propbag)
+ {
+ switch($name) {
+ case 'title':
+ $propbag->add('type', 'string');
+ $propbag->add('name', 'Title');
+ $propbag->add('description', TITLE_FOR_NUGGET);
+ break;
+
+ case 'content':
+ $propbag->add('type', 'html');
+ $propbag->add('name', 'Content');
+ $propbag->add('description', THE_NUGGET);
+ break;
+ default:
+ return false;
+ }
+ return true;
+ }
+
+ function generate_content(&$title)
+ {
+ $title = $this->get_config('title', $title);
+ echo serendipity_markup_text($this->get_config('content'));
+ }
}
-/* vim: set sts=4 ts=4 expandtab : */
+/* vim: set sts=4 ts=4 expandtab : */
?>
|