Add StickyEntry support to core1.

        Patch by afuna. 

diffs (90 lines):

diff -r 608c256164b7 -r 9b50b71c72fe bin/upgrading/s2layers/core1.s2
--- a/bin/upgrading/s2layers/core1.s2   Sun Oct 18 01:48:22 2009 +0000
+++ b/bin/upgrading/s2layers/core1.s2   Sun Oct 18 03:11:59 2009 +0000
@@ -358,6 +358,14 @@ class Entry extends EntryLite
     "Does nothing.";
     function builtin print_ebox() [fixed]
     "Does nothing.";
+}
+
+class StickyEntry extends Entry
+"An entry that is shown on top of the journal's recent entries page"
+{
+    var Image sticky_entry_icon "A little icon displayed next to the subject 
of a sticky entry post";
+
+    function print_sticky_icon () "prints the icon into the subject line";
 }
 
 class Comment extends EntryLite
@@ -593,6 +601,13 @@ class RecentPage extends Page
     "Array of entries available to be seen by the viewer of the page.";
 
     var RecentNav nav;
+
+    var StickyEntry stickyentry
+    "Entry shown on top of the Recent Entries page";
+
+    function print_sticky_entry(StickyEntry s)
+    "function to print the sticky entry";
+
 }
 
 class FriendsPage extends RecentPage
@@ -1315,6 +1330,11 @@ property string text_permalink {
     size = 20;
 }
 set text_permalink = "Link";
+
+property string text_stickyentry_subject {
+    des = "Text that appears before the subject of the sticky entry";
+}
+set text_stickyentry_subject = "Sticky: ";
 
 property string text_edit_entry {
     des = "Text to edit an entry";
@@ -1597,11 +1617,17 @@ property string text_icon_alt_18 {
     des = "Alternative text for icons of 18+ entries";
     noui = 1;
 }
+property string text_icon_alt_sticky_entry {
+    des = "Alternative text for icons of sticky entries";
+    noui = 1;
+}
+
 set text_icon_alt_protected = "[protected post]";
 set text_icon_alt_private = "[private post]";
 set text_icon_alt_groups = "[custom friends groups post]";
 set text_icon_alt_nsfw = "[NSFW]";
 set text_icon_alt_18 = "[18+]";
+set text_icon_alt_sticky_entry = "[sticky entry]";
 
 property bool use_shared_pic {
     des = "Use community userpics instead of poster's userpic.";
@@ -2219,6 +2245,12 @@ function FriendsPage::print_entry(Entry 
     "</div>\n\n";
 }
 
+function RecentPage::print_sticky_entry(StickyEntry s)
+"function to print the sticky entry. can be overrised by styles to print it 
differently than other entries."
+{
+    $this->print_entry( $s );
+}
+
 function Comment::print_edit_text() {
     if ($this.edited) {
         print "<br /><br /><span 
class='ljedittime'><em>$*text_comment_edittime " + $this->edittime_display() + 
"</em></span>";
@@ -2281,6 +2313,14 @@ function Entry::print_linkbar() {
     if ($show_interentry) {
         $this->print_link_next();
     }
+}
+
+function StickyEntry::print_sticky_icon()
+"Can be used by layouts to print out sticky icons. Not used in core1"
+{
+    """<span class="sticky-entry-icon">""";
+    $this.sticky_entry_icon->print($*text_icon_alt_sticky_entry);
+    """</span>\n""";
 }
 
 ### RecentPage and related functions
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to