/** * Retreives the user interface of this object. * @return The HTML fragment for this interface */ public function getUserUI() { // Init values $html = ''; // Check if the user has already subscribed to Pattern language $current_user = User::getCurrentUser(); if ($current_user == null || $this->isUserSubscribed($current_user) == false) { // hyperlink to all users narrative $html .= "<ul class='pattern_language_menu'>"; $html .= "<li><a class='pattern_language_big_links' href='/content/PatternLanguage/subscription.php'>" . _("Subscribe to Pattern Language") . "</a></li>"; $html .= "<li><a class='pattern_language_big_links' href='/content/PatternLanguage/archives.php'>" . _("Read narratives archives") . "</a></li>"; $html .= "</ul>"; // Until subscription is done DO NOT log this ! $this->setLoggingStatus(false); $this->setUserUIMainDisplayContent($html); // Tell the content group not to display elements until subscription is done $parent_output = parent::getUserUI(true); } else { /* * The user is subscribed to the pattern language show an element! * hyperlink to user's narrative */ $html .= "<ul class='pattern_language_menu'>"; $html .= "<li><a href='/content/PatternLanguage/narrative.php'>" . _("Read my narrative") . "</a></li>"; $html .= "<li><a href='/content/PatternLanguage/archives.php'>" . _("Read narratives archives") . "</a></li>"; $html .= "<li><a href='/content/PatternLanguage/subscription.php'>" . _("Unsubscribe") . "</a></li>"; $html .= "</ul>"; $this->setUserUIMainDisplayContent($html); // Display the random pattern $parent_output = parent::getUserUI(); } return $parent_output; }