function showPageNotice() { $notice = sprintf(_('%%%%site.name%%%% groups let you find and talk with ' . 'people of similar interests. After you join a group ' . 'you can send messages to all other members using the ' . 'syntax "!groupname". Don\'t see a group you like? Try ' . '[searching for one](%%%%action.groupsearch%%%%) or ' . '[start your own](%%%%action.newgroup%%%%)!')); $this->elementStart('div', 'instructions'); $this->raw(common_markup_to_html($notice)); $this->elementEnd('div'); }
/** * Instead of showing notices, link to the original offsite profile. */ function showNotices() { $url = $this->profile->profileurl; $host = parse_url($url, PHP_URL_HOST); $markdown = sprintf(_m('This remote profile is registered on another site; see [%1$s\'s original profile page on %2$s](%3$s).'), $this->profile->nickname, $host, $url); $html = common_markup_to_html($markdown); $this->raw($html); if ($this->profile->hasRole(Profile_role::SILENCED)) { // TRANS: Message on blocked remote profile page. $markdown = _m('Site moderators have silenced this profile, which prevents delivery of new messages to any users on this site.'); $this->raw(common_markup_to_html($markdown)); } else { $pnl = null; if (Event::handle('ShowStreamNoticeList', array($this->notice, $this, &$pnl))) { $pnl = new ProfileNoticeList($this->notice, $this); } $cnt = $pnl->show(); if (0 == $cnt) { $this->showEmptyListMessage(); } $args = array('id' => $this->profile->id); if (!empty($this->tag)) { $args['tag'] = $this->tag; } $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'remoteprofile', $args); } }
function showResults($q, $page) { $user_group = new User_group(); $user_group->limit(($page - 1) * GROUPS_PER_PAGE, GROUPS_PER_PAGE + 1); $wheres = array('nickname', 'fullname', 'homepage', 'description', 'location'); foreach ($wheres as $where) { $where_q = "{$where} like '%" . trim($user_group->escape($q), '\'') . '%\''; $user_group->whereAdd($where_q, 'OR'); } $cnt = $user_group->find(); if ($cnt > 0) { $terms = preg_split('/[\\s,]+/', $q); $results = new GroupSearchResults($user_group, $terms, $this); $results->show(); $user_group->free(); $this->pagination($page > 1, $cnt > GROUPS_PER_PAGE, $page, 'groupsearch', array('q' => $q)); } else { $this->element('p', 'error', _('No results.')); $this->searchSuggestions($q); if (common_logged_in()) { $message = _('If you can\'t find the group you\'re looking for, you can [create it](%%action.newgroup%%) yourself.'); } else { $message = _('Why not [register an account](%%action.register%%) and [create the group](%%action.newgroup%%) yourself!'); } $this->elementStart('div', 'guide'); $this->raw(common_markup_to_html($message)); $this->elementEnd('div'); $user_group->free(); } }
function showEmptyList() { $message = sprintf(_('This is %1$s\'s event stream, but %1$s hasn\'t received any events yet.'), $this->target->getNickname()) . ' '; $this->elementStart('div', 'guide'); $this->raw(common_markup_to_html($message)); $this->elementEnd('div'); }
function showPageNotice() { $instr = $this->getInstructions(); $output = common_markup_to_html($instr); $this->elementStart('div', 'instructions'); $this->raw($output); $this->elementEnd('div'); }
function showPageNotice() { if ($this->err) { $this->element('div', 'error', $this->err); } else { $inst = _('To subscribe, you can [login](%%action.login%%),' . ' or [register](%%action.register%%) a new ' . ' account. If you already have an account ' . ' on a [compatible microblogging site](%%doc.openmublog%%), ' . ' enter your profile URL below.'); $output = common_markup_to_html($inst); $this->elementStart('div', 'instructions'); $this->raw($output); $this->elementEnd('div'); } }
function showPageNotice() { if ($this->error) { $this->element('div', array('class' => 'error'), $this->error); } else { $instr = $this->getInstructions(); $output = common_markup_to_html($instr); $this->elementStart('div', 'instructions'); $this->raw($output); $this->elementEnd('div'); } }
function showEmptyList() { $message = _('No one has posted a notice with a [hashtag](%%doc.tags%%) yet.') . ' '; if (common_logged_in()) { $message .= _('Be the first to post one!'); } else { $message .= _('Why not [register an account](%%action.register%%) and be the first to post one!'); } $this->elementStart('div', 'guide'); $this->raw(common_markup_to_html($message)); $this->elementEnd('div'); }
/** * Instead of showing notices, link to the original offsite profile. */ function showNotices() { $url = $this->profile->profileurl; $host = parse_url($url, PHP_URL_HOST); $markdown = sprintf(_m('This remote profile is registered on another site; see [%s\'s original profile page on %s](%s).'), $this->profile->nickname, $host, $url); $html = common_markup_to_html($markdown); $this->raw($html); if ($this->profile->hasRole(Profile_role::SILENCED)) { $markdown = _m('Site moderators have silenced this profile, which prevents delivery of new messages to any users on this site.'); $this->raw(common_markup_to_html($markdown)); } }
function onEndShowPageNotice($action) { $name = $action->trimmed('action'); switch ($name) { case 'login': $instr = '(Have an account with CAS? ' . 'Try our [CAS login]' . '(%%action.caslogin%%)!)'; break; default: return true; } $output = common_markup_to_html($instr); $action->raw($output); return true; }
function onStartRegistrationFormData($action) { $instr = 'Note you will initially be "sandboxed" so your posts will not appear in the public timeline.'; if (isset($this->contact)) { $contactuser = User::staticGet('nickname', $this->contact); if (!empty($contactuser)) { $contactlink = "@<a href=\"{$contactuser->uri}\">{$contactuser->nickname}</a>"; $instr = $instr . " Send a message to {$contactlink} to speed up the unsandboxing process."; } } $output = common_markup_to_html($instr); $action->elementStart('div', 'instructions'); $action->raw($output); $action->elementEnd('div'); }
function showTop($arr = null) { $error = null; if ($arr) { $error = $arr[1]; } if (!empty($error)) { $this->element('p', 'error', $error); } else { $instr = $this->getInstructions(); $output = common_markup_to_html($instr); $this->elementStart('div', 'instructions'); $this->raw($output); $this->elementEnd('div'); } }
function onEndShowPageNotice($action) { $name = $action->trimmed('action'); switch ($name) { case 'login': // TRANS: Invitation to users with a CAS account to log in using the service. // TRANS: "[CAS login]" is a link description. (%%action.caslogin%%) is the URL. // TRANS: These two elements may not be separated. $instr = _m('(Have an account with CAS? ' . 'Try our [CAS login](%%action.caslogin%%)!)'); break; default: return true; } $output = common_markup_to_html($instr); $action->raw($output); return true; }
function showEmptyList() { // TRANS: Empty list message on page with public list cloud. // TRANS: This message contains Markdown links in the form [description](link). $message = _('No one has [listed](%%doc.tags%%) anyone yet.') . ' '; if (common_logged_in()) { // TRANS: Additional empty list message on page with public list cloud for logged in users. $message .= _('Be the first to list someone!'); } else { // TRANS: Additional empty list message on page with public list cloud for anonymous users. // TRANS: This message contains Markdown links in the form [description](link). $message .= _('Why not [register an account](%%action.register%%) and be the first to list someone!'); } $this->elementStart('div', 'guide'); $this->raw(common_markup_to_html($message)); $this->elementEnd('div'); }
function onStartRegistrationFormData($action) { // TRANS: User instructions after registration. $instr = _m('Note you will initially be "sandboxed" so your posts will not appear in the public timeline.'); if (isset($this->contact)) { $contactuser = User::staticGet('nickname', $this->contact); if (!empty($contactuser)) { $contactlink = "@<a href=\"{$contactuser->uri}\">{$contactuser->nickname}</a>"; // TRANS: User instructions after registration. // TRANS: %s is a clickable e-mailaddress. $instr = sprintf(_m('Note you will initially be "sandboxed" so your posts will not appear in the public timeline. ' . 'Send a message to %s to speed up the unsandboxing process.'), $contactlink); } } $output = common_markup_to_html($instr); $action->elementStart('div', 'instructions'); $action->raw($output); $action->elementEnd('div'); }
function onStartRegistrationFormData($action) { // TRANS: User instructions after registration. $instr = _m('Note you will initially be "sandboxed" so your posts will not appear in the public timeline.'); if (isset($this->contact)) { $contactuser = User::getKV('nickname', $this->contact); if ($contactuser instanceof User) { $contactlink = sprintf('@<a href="%s">%s</a>', htmlspecialchars($contactuser->getProfile()->getUrl()), htmlspecialchars($contactuser->getProfile()->getNickname())); // TRANS: User instructions after registration. // TRANS: %s is a clickable OStatus profile URL. $instr = sprintf(_m('Note you will initially be "sandboxed" so your posts will not appear in the public timeline. ' . 'Send a message to %s to speed up the unsandboxing process.'), $contactlink); } } $output = common_markup_to_html($instr); $action->elementStart('div', 'instructions'); $action->raw($output); $action->elementEnd('div'); }
function onEndShowPageNotice($action) { $name = $action->trimmed('action'); $instr = false; switch ($name) { case 'register': if ($this->autoregistration) { $instr = 'Have an LDAP account? Use your standard username and password.'; } break; case 'login': $instr = 'Have an LDAP account? Use your standard username and password.'; break; default: return true; } if ($instr) { $output = common_markup_to_html($instr); $action->raw($output); } return true; }
function showEmptyListMessage() { if (common_logged_in()) { $current_user = common_current_user(); if ($this->user->id === $current_user->id) { // TRANS: Text displayed instead of favourite notices for the current logged in user that has no favourites. $message = _('You haven\'t chosen any favorite notices yet. Click the fave button on notices you like to bookmark them for later or shed a spotlight on them.'); } else { // TRANS: Text displayed instead of favourite notices for a user that has no favourites while logged in. // TRANS: %s is a username. $message = sprintf(_('%s hasn\'t added any favorite notices yet. Post something interesting they would add to their favorites :)'), $this->user->nickname); } } else { // TRANS: Text displayed instead of favourite notices for a user that has no favourites while not logged in. // TRANS: %s is a username, %%%%action.register%%%% is a link to the user registration page. // TRANS: (link text)[link] is a Mark Down link. $message = sprintf(_('%s hasn\'t added any favorite notices yet. Why not [register an account](%%%%action.register%%%%) and then post something interesting they would add to their favorites :)'), $this->user->nickname); } $this->elementStart('div', 'guide'); $this->raw(common_markup_to_html($message)); $this->elementEnd('div'); }
function showEmptyList() { // TRANS: This message contains a Markdown URL. The link description is between // TRANS: square brackets, and the link between parentheses. Do not separate "](" // TRANS: and do not change the URL part. $message = _('No one has posted a notice with a [hashtag](%%doc.tags%%) yet.') . ' '; if (common_logged_in()) { // TRANS: Message shown to a logged in user for the public tag cloud // TRANS: while no tags exist yet. "One" refers to the non-existing hashtag. $message .= _('Be the first to post one!'); } else { // TRANS: Message shown to a anonymous user for the public tag cloud // TRANS: while no tags exist yet. "One" refers to the non-existing hashtag. // TRANS: This message contains a Markdown URL. The link description is between // TRANS: square brackets, and the link between parentheses. Do not separate "](" // TRANS: and do not change the URL part. $message .= _('Why not [register an account](%%action.register%%) and be the first to post one!'); } $this->elementStart('div', 'guide'); $this->raw(common_markup_to_html($message)); $this->elementEnd('div'); }
function showEmptyListMessage() { // TRANS: %s is user nickname $message = sprintf(_('This is the timeline for %s and friends but no one has posted anything yet.'), $this->user->nickname) . ' '; if (common_logged_in()) { $current_user = common_current_user(); if ($this->user->id === $current_user->id) { // TRANS: Encouragement displayed on logged in user's empty timeline. // TRANS: This message contains Markdown links. Keep "](" together. $message .= _('Try subscribing to more people, [join a group](%%action.groups%%) or post something yourself.'); } else { // TRANS: %1$s is user nickname, %2$s is user nickname, %2$s is user nickname prefixed with "@" // TRANS: This message contains Markdown links. Keep "](" together. $message .= sprintf(_('You can try to [nudge %1$s](../%2$s) from their profile or [post something to them](%%%%action.newnotice%%%%?status_textarea=%3$s).'), $this->user->nickname, $this->user->nickname, '@' . $this->user->nickname); } } else { // TRANS: Encoutagement displayed on empty timeline user pages for anonymous users. // TRANS: %s is a user nickname. This message contains Markdown links. Keep "](" together. $message .= sprintf(_('Why not [register an account](%%%%action.register%%%%) and then nudge %s or post a notice to them.'), $this->user->nickname); } $this->elementStart('div', 'guide'); $this->raw(common_markup_to_html($message)); $this->elementEnd('div'); }
function showEmptyListMessage() { if (common_logged_in()) { if ($this->scoped->sameAs($this->getTarget())) { // TRANS: Tag subscription list text when the logged in user has no tag subscriptions. $message = _m('You are not listening to any hash tags right now. You can push the "Subscribe" button ' . 'on any hashtag page to automatically receive any public messages on this site that use that ' . 'tag, even if you are not subscribed to the poster.'); } else { // TRANS: Tag subscription list text when looking at the subscriptions for a of a user other // TRANS: than the logged in user that has no tag subscriptions. %s is the user nickname. $message = sprintf(_m('%s is not following any tags.'), $this->getTarget()->getNickname()); } } else { // TRANS: Subscription list text when looking at the subscriptions for a of a user that has none // TRANS: as an anonymous user. %s is the user nickname. $message = sprintf(_m('%s is not following any tags.'), $this->getTarget()->getNickname()); } $this->elementStart('div', 'guide'); $this->raw(common_markup_to_html($message)); $this->elementEnd('div'); }
function loadDoc() { if (Event::handle('StartLoadDoc', array(&$this->title, &$this->output))) { $this->filename = $this->getFilename(); if (empty($this->filename)) { throw new ClientException(sprintf(_('No such document "%s"'), $this->title), 404); } $c = file_get_contents($this->filename); $this->output = common_markup_to_html($c); Event::handle('EndLoadDoc', array($this->title, &$this->output)); } }
/** * Show page notice * * Display a notice for how to use the page, or the * error if it exists. * * @return void */ function showPageNotice() { if ($this->error) { $this->element('p', 'error', $this->error); } else { $instr = $this->getInstructions(); $output = common_markup_to_html($instr); $this->raw($output); } }
function showPageNotice() { if ($this->msg) { $this->element('div', $this->success ? 'success' : 'error', $this->msg); } else { $inst = $this->getInstructions(); $output = common_markup_to_html($inst); $this->elementStart('div', 'instructions'); $this->raw($output); $this->elementEnd('div'); } }
function showEmptyListMessage() { // TRANS: %1$s is user nickname $message = sprintf(_('This is the timeline for %s and friends but no one has posted anything yet.'), $this->user->nickname) . ' '; if (common_logged_in()) { $current_user = common_current_user(); if ($this->user->id === $current_user->id) { $message .= _('Try subscribing to more people, [join a group](%%action.groups%%) or post something yourself.'); } else { // TRANS: %1$s is user nickname, %2$s is user nickname, %2$s is user nickname prefixed with "@" $message .= sprintf(_('You can try to [nudge %1$s](../%2$s) from his profile or [post something to his or her attention](%%%%action.newnotice%%%%?status_textarea=%3$s).'), $this->user->nickname, $this->user->nickname, '@' . $this->user->nickname); } } else { $message .= sprintf(_('Why not [register an account](%%%%action.register%%%%) and then nudge %s or post a notice to his or her attention.'), $this->user->nickname); } $this->elementStart('div', 'guide'); $this->raw(common_markup_to_html($message)); $this->elementEnd('div'); }
function showAnonymousMessage() { $m = sprintf(_('**%s** has an account on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' . 'based on the Free Software [Laconica](http://laconi.ca/) tool. ' . '[Join now](%%%%action.register%%%%) to follow **%s**\'s notices and many more! ([Read more](%%%%doc.help%%%%))'), $this->user->nickname, $this->user->nickname); $this->elementStart('div', array('id' => 'anon_notice')); $this->raw(common_markup_to_html($m)); $this->elementEnd('div'); }
/** * Show StatusNet license. * * @return nothing */ function showStatusNetLicense() { // TRANS: DT element for StatusNet software license. $this->element('dt', array('id' => 'site_statusnet_license'), _('StatusNet software license')); $this->elementStart('dd', null); if (common_config('site', 'broughtby')) { // TRANS: First sentence of the StatusNet site license. Used if 'broughtby' is set. $instr = _('**%%site.name%%** is a microblogging service brought to you by [%%site.broughtby%%](%%site.broughtbyurl%%).'); } else { // TRANS: First sentence of the StatusNet site license. Used if 'broughtby' is not set. $instr = _('**%%site.name%%** is a microblogging service.'); } $instr .= ' '; // TRANS: Second sentence of the StatusNet site license. Mentions the StatusNet source code license. $instr .= sprintf(_('It runs the [StatusNet](http://status.net/) microblogging software, version %s, available under the [GNU Affero General Public License](http://www.fsf.org/licensing/licenses/agpl-3.0.html).'), STATUSNET_VERSION); $output = common_markup_to_html($instr); $this->raw($output); $this->elementEnd('dd'); // do it }
function showEmptyResults($q, $page) { // TRANS: Text for notice search results is the query had no results. $this->element('p', 'error', _('No results.')); $this->searchSuggestions($q); if (common_logged_in()) { // TRANS: Text for logged in users making a query for notices without results. // TRANS: This message contains a Markdown link. $message = sprintf(_('Be the first to [post on this topic](%%%%action.newnotice%%%%?status_textarea=%s)!'), urlencode($q)); } else { // TRANS: Text for not logged in users making a query for notices without results. // TRANS: This message contains Markdown links. $message = sprintf(_('Why not [register an account](%%%%action.register%%%%) and be the first to [post on this topic](%%%%action.newnotice%%%%?status_textarea=%s)!'), urlencode($q)); } $this->elementStart('div', 'guide'); $this->raw(common_markup_to_html($message)); $this->elementEnd('div'); return; }
function showAnonymousMessage() { if (!(common_config('site', 'closed') || common_config('site', 'inviteonly'))) { $m = _('This is %%site.name%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' . 'based on the Free Software [StatusNet](http://status.net/) tool. ' . '[Join now](%%action.register%%) to share notices about yourself with friends, family, and colleagues! ' . '([Read more](%%doc.help%%))'); } else { $m = _('This is %%site.name%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' . 'based on the Free Software [StatusNet](http://status.net/) tool.'); } $this->elementStart('div', array('id' => 'anon_notice')); $this->raw(common_markup_to_html($m)); $this->elementEnd('div'); }
/** * Show results * * @param string $q search query * @param integer $page page number * * @return void */ function showResults($q, $page) { $notice = new Notice(); $search_engine = $notice->getSearchEngine('notice'); $search_engine->set_sort_mode('chron'); // Ask for an extra to see if there's more. $search_engine->limit(($page - 1) * NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1); if (false === $search_engine->query($q)) { $cnt = 0; } else { $cnt = $notice->find(); } if ($cnt === 0) { $this->element('p', 'error', _('No results.')); $this->searchSuggestions($q); if (common_logged_in()) { $message = sprintf(_('Be the first to [post on this topic](%%%%action.newnotice%%%%?status_textarea=%s)!'), urlencode($q)); } else { $message = sprintf(_('Why not [register an account](%%%%action.register%%%%) and be the first to [post on this topic](%%%%action.newnotice%%%%?status_textarea=%s)!'), urlencode($q)); } $this->elementStart('div', 'guide'); $this->raw(common_markup_to_html($message)); $this->elementEnd('div'); return; } $terms = preg_split('/[\\s,]+/', $q); $nl = new SearchNoticeList($notice, $this, $terms); $cnt = $nl->show(); $this->pagination($page > 1, $cnt > NOTICES_PER_PAGE, $page, 'noticesearch', array('q' => $q)); }