コード例 #1
0
ファイル: print.php プロジェクト: rair/yacs
     }
 }
 // provide details
 if (count($details)) {
     $context['text'] .= '<p class="details">' . implode(BR . "\n", $details) . '</p>';
 }
 // the full name
 if ($item['full_name']) {
     $context['text'] .= '<p>' . sprintf(i18n::s('%s: %s'), i18n::s('Full name'), $item['full_name']) . "</p>\n";
 }
 // web address, if any
 if (isset($item['web_address']) && $item['web_address']) {
     $context['text'] .= '<p>' . sprintf(i18n::s('%s: %s'), i18n::s('Web address'), Skin::build_link($item['web_address'], $item['web_address'], 'external')) . "</p>\n";
 }
 // email address - not showed to anonymous surfers for spam protection
 if (isset($item['email']) && $item['email'] && Surfer::may_mail()) {
     $label = i18n::s('E-mail address: %s %s');
     if (isset($context['with_email']) && $context['with_email'] == 'Y') {
         $url = Users::get_url($id, 'mail');
     } else {
         $url = 'mailto:' . $item['email'];
     }
     if (isset($item['with_newsletters']) && $item['with_newsletters'] == 'Y') {
         $suffix = '';
     } else {
         $suffix = i18n::s('(do not wish to receive newsletters)');
     }
     $context['text'] .= '<p>' . sprintf($label, Skin::build_link($url, $item['email'], 'email'), $suffix) . "</p>\n";
 }
 // the introduction text
 $context['text'] .= Skin::build_block($item['introduction'], 'introduction');
コード例 #2
0
ファイル: select.php プロジェクト: rair/yacs
    $url = $anchor->get_url();
    if (!strncmp($anchor->get_reference(), 'user:'******'#_followers';
    }
    $links[] = Skin::build_link($url, i18n::s('Done'), 'button');
    $context['text'] .= Skin::finalize_list($links, 'assistant_bar');
    // adding editors
    if (strncmp($_REQUEST['member'], 'user:'******'%s if you have to assign new persons and to notify them in a single operation.'), Skin::build_link($anchor->get_url('invite'), i18n::s('Invite participants')));
            // in a side box
            $context['components']['boxes'] = Skin::build_box(i18n::s('Help'), $help, 'boxes', 'help');
        }
        // adding followers
    } else {
        if (Surfer::may_mail()) {
            $help = i18n::s('Each new person will be notified that you are following him.');
            // in a side box
            $context['components']['boxes'] = Skin::build_box(i18n::s('Help'), $help, 'boxes', 'help');
        }
    }
    // list editors
} elseif ($permitted == 'editors') {
    // the title of the page
    if (is_object($anchor)) {
        if (!strncmp($anchor->get_reference(), 'user:'******'page_title'] = i18n::s('Persons that I am following');
            } else {
                $context['page_title'] = sprintf(i18n::s('Persons followed by %s'), $anchor->get_title());
            }
コード例 #3
0
ファイル: users.php プロジェクト: rair/yacs
 /**
  * build a pretty link to a user page
  *
  * Most of the time this function will build a nice link to the user profile at this server.
  * At other time it may feature either a link to another server, or an e-mail address.
  *
  * Pseudo code:
  * [snippet]
  * If there is a user profile for this id
  *	 return a link to the related page
  * else if the user is not logged and if email addresses have to be protected
  *	 return the name string without any link (protected from spam)
  * else if a web address has been provided
  *	 return a http: link to it
  * else if an email address has been provided
  *	 return a mailto: link to it
  * else
  *	 return the name string without any link
  * [/snippet]
  *
  * @param string the user name
  * @param string the email address, or a web address
  * @param string the user id
  * @param boolean TRUE to open the link in a new window, FALSE otherwise
  * @param string an optional hovering label
  * @return a pretty link to insert in the HTML page
  *
  * @see feeds/feeds.php
  */
 public static function get_link($name, $email, $id, $new_window = FALSE, $hover = NULL)
 {
     global $context;
     if (!$name) {
         $name = i18n::s('(unknown)');
     }
     if ($id > 0 && ($url = Users::get_url($id, 'view', $name))) {
         return Skin::build_link($context['url_to_home'] . $context['url_to_root'] . $url, $name, 'user', $hover, $new_window);
     } elseif (!Surfer::may_mail()) {
         return $name;
     } elseif (preg_match('/@/', $email)) {
         return Skin::build_link($email, $name, 'email', $hover);
     } elseif (preg_match('/[:\\/]/', $email)) {
         return Skin::build_link($email, $name, NULL, $hover);
     } else {
         return $name;
     }
 }