- Timestamp:
- 05/02/05 15:33:26 (8 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog-auth/wifidog/classes/Content/PatternLanguage.php
r601 r610 38 38 class PatternLanguage extends ContentGroup 39 39 { 40 /** 41 * Get all pattern language objects 42 */ 43 public static function getAllContent() 44 { 45 return parent::getAllContent("PatternLanguage"); 46 } 47 40 48 function __construct($content_id) 41 49 { … … 49 57 * @param $subclass_admin_interface Html content of the interface element of a children 50 58 * @return The HTML fragment for this interface */ 51 52 //TODO: complete this53 /*54 59 public function getUserUI($subclass_user_interface = null) 55 60 { … … 63 68 { 64 69 // hyperlink to all users narrative 70 $html .= "<ul class='pattern_language_menu'>"; 71 $html .= "<li><a class='pattern_language_big_links' href='/content/PatternLanguage/subscription.php'>"._("Subscribe to Pattern Language")."</a></li>"; 72 $html .= "<li><a class='pattern_language_big_links' href='/content/PatternLanguage/archives.php'>"._("Read narratives archives")."</a></li>"; 73 $html .= "</ul>"; 65 74 66 75 // Until subscription is done DO NOT log this ! … … 73 82 // The user is subscribed to the pattern language show an element ! 74 83 // hyperlink to user's narrative 84 $html .= "<ul class='pattern_language_menu'>"; 85 $html .= "<li><a href='/content/PatternLanguage/narrative.php'>"._("Read my narrative")."</a></li>"; 86 $html .= "<li><a href='/content/PatternLanguage/archives.php'>"._("Read narratives archives")."</a></li>"; 87 $html .= "<li><a href='/content/PatternLanguage/subscription.php'>"._("Unsubscribe")."</a></li>"; 88 $html .= "</ul>"; 75 89 76 90 // Display the random pattern … … 82 96 83 97 return $parent_output; 84 }*/ 98 } 99 100 /** Is this pattern displayable at a certain Node 101 * @param $node Node, optionnal 102 * @return true or false */ 103 public function isDisplayableAt($node) 104 { 105 // Pattern language will always be displayable 106 return true; 107 } 85 108 86 109 /** Display the narrative … … 89 112 public function displayNarrative(User $user) 90 113 { 91 return "<h1>displayNarrative(): WRITEME</h1>"; 92 } 114 global $db; 115 $sql = "SELECT content_group_element_id FROM content_display_log AS cdl JOIN content_group_element AS cge ON (cdl.content_id = cge.content_group_element_id) WHERE cge.content_group_id = '{$this->getId()}'"; 116 $db->ExecSql($sql, $rows, false); 117 $html = ""; 118 if($rows) 119 foreach($rows as $row) 120 { 121 $cge = Content::getObject($row['content_group_element_id']); 122 $html .= $cge->getUserUI()."<p>"; 123 } 124 return $html; 125 } 93 126 94 127 /** Get the list of all narratives 95 * @param $user The user who's narrative you want to grab96 128 * @return the archive page HTML */ 97 129 public function getNarrativeList() 98 130 { 99 return "<h1>displayNarrative(): WRITEME</h1>"; 131 global $db; 132 $sql = "SELECT DISTINCT user_id FROM content_display_log AS cdl JOIN content_group_element AS cge ON (cdl.content_id = cge.content_group_element_id) JOIN content ON (content.content_id = cge.content_group_id) WHERE content_type = 'PatternLanguage'"; 133 $db->ExecSql($sql , $rows, false); 134 $narratives = array(); 135 if($rows) 136 foreach($rows as $row) 137 $narratives[] = User::getObject($row['user_id']); 138 return $narratives; 100 139 } 101 140
