当前位置: 首页>>代码示例>>PHP>>正文


PHP Filter::escapeUrl方法代码示例

本文整理汇总了PHP中Fisharebest\Webtrees\Filter::escapeUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Filter::escapeUrl方法的具体用法?PHP Filter::escapeUrl怎么用?PHP Filter::escapeUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Fisharebest\Webtrees\Filter的用法示例。


在下文中一共展示了Filter::escapeUrl方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: modAction

 /**
  * This is a general purpose hook, allowing modules to respond to routes
  * of the form module.php?mod=FOO&mod_action=BAR
  *
  * @param string $mod_action
  */
 public function modAction($mod_action)
 {
     switch ($mod_action) {
         case 'delete':
             $stmt = Database::prepare("DELETE FROM `##message` WHERE user_id = :user_id AND message_id = :message_id");
             foreach (Filter::postArray('message_id') as $id) {
                 $stmt->execute(array('message_id' => $id, 'user_id' => Auth::id()));
             }
     }
     $ged = Filter::post('ged');
     $ctype = Filter::post('ctype', 'user|gedcom', 'user');
     header('Location: ' . WT_BASE_URL . 'index.php?ged=' . Filter::escapeUrl($ged) . '&ctype=' . $ctype);
 }
开发者ID:tunandras,项目名称:webtrees,代码行数:19,代码来源:UserMessagesModule.php

示例2: __construct

 /**
  * Startup activity
  */
 public function __construct()
 {
     global $WT_TREE;
     parent::__construct();
     // $action comes from GET (search) or POST (replace)
     if (Filter::post('action')) {
         $this->action = Filter::post('action', 'replace', 'general');
         $this->query = Filter::post('query');
         $this->replace = Filter::post('replace');
         $this->replaceNames = Filter::post('replaceNames', 'checked', '');
         $this->replacePlaces = Filter::post('replacePlaces', 'checked', '');
         $this->replacePlacesWord = Filter::post('replacePlacesWord', 'checked', '');
         $this->replaceAll = Filter::post('replaceAll', 'checked', '');
     } else {
         $this->action = Filter::get('action', 'advanced|general|soundex|replace|header', 'general');
         $this->query = Filter::get('query');
         $this->replace = Filter::get('replace');
         $this->replaceNames = Filter::get('replaceNames', 'checked', '');
         $this->replacePlaces = Filter::get('replacePlaces', 'checked', '');
         $this->replacePlacesWord = Filter::get('replacePlacesWord', 'checked', '');
         $this->replaceAll = Filter::get('replaceAll', 'checked', '');
     }
     // Only editors can use search/replace
     if ($this->action === 'replace' && !Auth::isEditor($WT_TREE)) {
         $this->action = 'general';
     }
     $this->srindi = Filter::get('srindi', 'checked', '');
     $this->srfams = Filter::get('srfams', 'checked', '');
     $this->srsour = Filter::get('srsour', 'checked', '');
     $this->srnote = Filter::get('srnote', 'checked', '');
     $this->soundex = Filter::get('soundex', 'DaitchM|Russell', 'DaitchM');
     $this->showasso = Filter::get('showasso');
     $this->firstname = Filter::get('firstname');
     $this->lastname = Filter::get('lastname');
     $this->place = Filter::get('place');
     $this->year = Filter::get('year');
     // If no record types specified, search individuals
     if (!$this->srfams && !$this->srsour && !$this->srnote) {
         $this->srindi = 'checked';
     }
     // If no replace types specifiied, replace full records
     if (!$this->replaceNames && !$this->replacePlaces && !$this->replacePlacesWord) {
         $this->replaceAll = 'checked';
     }
     // Trees to search
     if (Site::getPreference('ALLOW_CHANGE_GEDCOM')) {
         foreach (Tree::getAll() as $search_tree) {
             if (Filter::get('tree_' . $search_tree->getTreeId())) {
                 $this->search_trees[] = $search_tree;
             }
         }
         if (!$this->search_trees) {
             $this->search_trees[] = $WT_TREE;
         }
     } else {
         $this->search_trees[] = $WT_TREE;
     }
     // If we want to show associated persons, build the list
     switch ($this->action) {
         case 'header':
             // We can type in an XREF into the header search, and jump straight to it.
             // Otherwise, the header search is the same as the general search
             if (preg_match('/' . WT_REGEX_XREF . '/', $this->query)) {
                 $record = GedcomRecord::getInstance($this->query, $WT_TREE);
                 if ($record && $record->canShowName()) {
                     header('Location: ' . WT_BASE_URL . $record->getRawUrl());
                     exit;
                 }
             }
             $this->action = 'general';
             $this->srindi = 'checked';
             $this->srfams = 'checked';
             $this->srsour = 'checked';
             $this->srnote = 'checked';
             $this->setPageTitle(I18N::translate('General search'));
             $this->generalSearch();
             break;
         case 'general':
             $this->setPageTitle(I18N::translate('General search'));
             $this->generalSearch();
             break;
         case 'soundex':
             // Create a dummy search query to use as a title to the results list
             $this->query = trim($this->firstname . ' ' . $this->lastname . ' ' . $this->place);
             $this->setPageTitle(I18N::translate('Phonetic search'));
             $this->soundexSearch();
             break;
         case 'replace':
             $this->setPageTitle(I18N::translate('Search and replace'));
             $this->search_trees = array($WT_TREE);
             $this->srindi = 'checked';
             $this->srfams = 'checked';
             $this->srsour = 'checked';
             $this->srnote = 'checked';
             if (Filter::post('query')) {
                 $this->searchAndReplace($WT_TREE);
                 header('Location: ' . WT_BASE_URL . WT_SCRIPT_NAME . '?action=replace&query=' . Filter::escapeUrl($this->query) . '&replace=' . Filter::escapeUrl($this->replace) . '&replaceAll=' . $this->replaceAll . '&replaceNames=' . $this->replaceNames . '&replacePlaces=' . $this->replacePlaces . '&replacePlacesWord=' . $this->replacePlacesWord);
//.........这里部分代码省略.........
开发者ID:bmhm,项目名称:webtrees,代码行数:101,代码来源:SearchController.php

示例3: header

         FlashMessages::addMessage(I18N::translate('The family tree “%s” will be shown to visitors when they first arrive at this website.', $WT_TREE->getTitleHtml()), 'success');
     }
     header('Location: ' . WT_BASE_URL . WT_SCRIPT_NAME);
     return;
 case 'new_tree':
     $basename = basename(Filter::post('tree_name'));
     $tree_title = Filter::post('tree_title');
     if (Filter::checkCsrf() && $basename && $tree_title) {
         if (Tree::findByName($basename)) {
             FlashMessages::addMessage(I18N::translate('The family tree “%s” already exists.', Filter::escapeHtml($basename)), 'danger');
         } else {
             Tree::create($basename, $tree_title);
             FlashMessages::addMessage(I18N::translate('The family tree “%s” has been created.', Filter::escapeHtml($basename)), 'success');
         }
     }
     header('Location: ' . WT_BASE_URL . WT_SCRIPT_NAME . '?ged=' . Filter::escapeUrl($basename));
     return;
 case 'replace_upload':
     $gedcom_id = Filter::postInteger('gedcom_id');
     $keep_media = Filter::post('keep_media', '1', '0');
     $GEDCOM_MEDIA_PATH = Filter::post('GEDCOM_MEDIA_PATH');
     $WORD_WRAPPED_NOTES = Filter::post('WORD_WRAPPED_NOTES', '1', '0');
     $tree = Tree::findById($gedcom_id);
     if (Filter::checkCsrf() && $tree) {
         $tree->setPreference('keep_media', $keep_media);
         $tree->setPreference('GEDCOM_MEDIA_PATH', $GEDCOM_MEDIA_PATH);
         $tree->setPreference('WORD_WRAPPED_NOTES', $WORD_WRAPPED_NOTES);
         if (isset($_FILES['tree_name'])) {
             if ($_FILES['tree_name']['error'] == 0 && is_readable($_FILES['tree_name']['tmp_name'])) {
                 $tree->importGedcomFile($_FILES['tree_name']['tmp_name'], $_FILES['tree_name']['name']);
             }
开发者ID:AlexSnet,项目名称:webtrees,代码行数:31,代码来源:admin_trees_manage.php

示例4: printReadMoreLink

 /**
  * Print read-more link
  * 
  * @param type $root
  * @return string
  */
 private function printReadMoreLink($root)
 {
     return '<div id="read-more-link">' . '<a href="module.php?mod=' . $this->getName() . '&amp;mod_action=page&rootid=' . $root . '&amp;ged=' . Filter::escapeUrl(Tree::findById($this->tree_id)->getName()) . '">' . I18N::translate('Read more') . '</a>' . '</div>';
 }
开发者ID:bxbroze,项目名称:webtrees,代码行数:10,代码来源:FancyTreeviewClass.php

示例5: getNameUrl

 /**
  * The name of this tree
  *
  * @return string
  */
 public function getNameUrl()
 {
     return Filter::escapeUrl($this->name);
 }
开发者ID:AlexSnet,项目名称:webtrees,代码行数:9,代码来源:Tree.php

示例6: count

?>
					</button>
					<button type="submit" name="action" value="reset">
						<?php 
echo I18N::translate('reset');
?>
					</button>
				</td>
			</tr>
		</tbody>
	</table>
</form>

<?php 
if ($action === 'submit') {
    $url = 'medialist.php?action=submit' . '&amp;ged=' . $WT_TREE->getNameHtml() . '&amp;folder=' . Filter::escapeUrl($folder) . '&amp;sortby=' . Filter::escapeUrl($sortby) . '&amp;subdirs=' . Filter::escapeUrl($subdirs) . '&amp;filter=' . Filter::escapeUrl($filter) . '&amp;form_type=' . Filter::escapeUrl($form_type) . '&amp;columns=' . Filter::escapeUrl($columns) . '&amp;max=' . Filter::escapeUrl($max);
    $count = count($medialist);
    $pages = (int) (($count + $max - 1) / $max);
    $page = max(min($page, $pages), 1);
    if ($page === $pages && $count % $max !== 0) {
        // Last page may have    fewer than $max pages
        $number_on_page = $count % $max;
    } else {
        $number_on_page = $max;
    }
    if (I18N::direction() === 'ltr') {
        $icons = array('first' => 'ldarrow', 'previous' => 'larrow', 'next' => 'rarrow', 'last' => 'rdarrow');
    } else {
        $icons = array('first' => 'rdarrow', 'previous' => 'rarrow', 'next' => 'larrow', 'last' => 'ldarrow');
    }
    echo '<div><p>', I18N::translate('Media objects found'), ' ', $count, '</p>';
开发者ID:josefpavlik,项目名称:webtrees,代码行数:31,代码来源:medialist.php

示例7: header

			<div>
				<input type="submit" value="', I18N::translate('Send'), '">
			</div>
		</form>
	</div>';
        break;
    case 'verify_hash':
        if (!Site::getPreference('USE_REGISTRATION_MODULE')) {
            header('Location: ' . WT_BASE_URL);
            return;
        }
        // switch language to webmaster settings
        $webmaster = User::find($WT_TREE->getPreference('WEBMASTER_USER_ID'));
        I18N::init($webmaster->getPreference('language'));
        $user = User::findByIdentifier($user_name);
        $mail1_body = I18N::translate('Hello administrator…') . Mail::EOL . Mail::EOL . I18N::translate('A new user (%1$s) has requested an account (%2$s) and verified an email address (%3$s).', $user->getRealNameHtml(), Filter::escapeHtml($user->getUserName()), Filter::escapeHtml($user->getEmail())) . Mail::EOL . Mail::EOL . I18N::translate('You now need to review the account details, and set the “approved” status to “yes”.') . Mail::EOL . '<a href="' . WT_BASE_URL . "admin_users.php?filter=" . Filter::escapeUrl($user->getUserName()) . '">' . WT_BASE_URL . "admin_users.php?filter=" . Filter::escapeUrl($user->getUserName()) . '</a>' . Mail::auditFooter();
        $mail1_subject = I18N::translate('New user at %s', WT_BASE_URL . ' ' . $WT_TREE->getTitle());
        // Change to the new user’s language
        I18N::init($user->getPreference('language'));
        $controller->setPageTitle(I18N::translate('User verification'));
        $controller->pageHeader();
        echo '<div id="login-register-page">';
        echo '<h2>' . I18N::translate('User verification') . '</h2>';
        echo '<div id="user-verify">';
        if ($user && $user->checkPassword($user_password) && $user->getPreference('reg_hashcode') === $user_hashcode) {
            Mail::send($WT_TREE, $webmaster->getEmail(), $webmaster->getRealName(), $WT_TREE->getPreference('WEBTREES_EMAIL'), $WT_TREE->getPreference('WEBTREES_EMAIL'), $mail1_subject, $mail1_body);
            $mail1_method = $webmaster->getPreference('CONTACT_METHOD');
            if ($mail1_method != 'messaging3' && $mail1_method != 'mailto' && $mail1_method != 'none') {
                Database::prepare("INSERT INTO `##message` (sender, ip_address, user_id, subject, body) VALUES (? ,? ,? ,? ,?)")->execute(array($user_name, WT_CLIENT_IP, $webmaster->getUserId(), $mail1_subject, Filter::unescapeHtml($mail1_body)));
            }
            $user->setPreference('verified', '1')->setPreference('reg_timestamp', date('U'))->deletePreference('reg_hashcode');
开发者ID:ambled,项目名称:webtrees,代码行数:31,代码来源:login.php

示例8: date

     Log::addAuthenticationLog('Possible spam registration from "' . $user_name . '"/"' . $user_email . '" comments="' . $user_comments . '"');
 } else {
     // Everything looks good - create the user
     $controller->pageHeader();
     Log::addAuthenticationLog('User registration requested for: ' . $user_name);
     $user = User::create($user_name, $user_realname, $user_email, $user_password01);
     $user->setPreference('language', WT_LOCALE)->setPreference('verified', '0')->setPreference('verified_by_admin', 0)->setPreference('reg_timestamp', date('U'))->setPreference('reg_hashcode', md5(Uuid::uuid4()))->setPreference('contactmethod', 'messaging2')->setPreference('comment', $user_comments)->setPreference('visibleonline', '1')->setPreference('auto_accept', '0')->setPreference('canadmin', '0')->setPreference('sessiontime', '0');
     // Generate an email in the admin’s language
     $webmaster = User::find($WT_TREE->getPreference('WEBMASTER_USER_ID'));
     I18N::init($webmaster->getPreference('language'));
     $mail1_body = I18N::translate('Hello administrator…') . Mail::EOL . Mail::EOL . I18N::translate('A prospective user has registered with webtrees at %s.', WT_BASE_URL . ' ' . $WT_TREE->getTitleHtml()) . Mail::EOL . Mail::EOL . I18N::translate('Username') . ' ' . Filter::escapeHtml($user->getUserName()) . Mail::EOL . I18N::translate('Real name') . ' ' . $user->getRealNameHtml() . Mail::EOL . I18N::translate('Email address') . ' ' . Filter::escapeHtml($user->getEmail()) . Mail::EOL . I18N::translate('Comments') . ' ' . Filter::escapeHtml($user_comments) . Mail::EOL . Mail::EOL . I18N::translate('The user has been sent an e-mail with the information necessary to confirm the access request.') . Mail::EOL . Mail::EOL . I18N::translate('You will be informed by e-mail when this prospective user has confirmed the request. You can then complete the process by activating the user name. The new user will not be able to login until you activate the account.');
     $mail1_subject = I18N::translate('New registration at %s', WT_BASE_URL . ' ' . $WT_TREE->getTitle());
     I18N::init(WT_LOCALE);
     echo '<div id="login-register-page">';
     // Generate an email in the user’s language
     $mail2_body = I18N::translate('Hello %s…', $user->getRealNameHtml()) . Mail::EOL . Mail::EOL . I18N::translate('You (or someone claiming to be you) has requested an account at %1$s using the email address %2$s.', WT_BASE_URL . ' ' . $WT_TREE->getTitleHtml(), $user->getEmail()) . ' ' . I18N::translate('Information about the request is shown under the link below.') . Mail::EOL . I18N::translate('Please click on the following link and fill in the requested data to confirm your request and email address.') . Mail::EOL . Mail::EOL . '<a href="' . WT_LOGIN_URL . '?user_name=' . Filter::escapeUrl($user->getUserName()) . '&amp;user_hashcode=' . $user->getPreference('reg_hashcode') . '&amp;action=userverify&amp;ged=' . $WT_TREE->getNameUrl() . '">' . WT_LOGIN_URL . "?user_name=" . Filter::escapeHtml($user->getUserName()) . "&amp;user_hashcode=" . urlencode($user->getPreference('reg_hashcode')) . '&amp;action=userverify&amp;ged=' . $WT_TREE->getNameHtml() . '</a>' . Mail::EOL . Mail::EOL . I18N::translate('Username') . " - " . Filter::escapeHtml($user->getUserName()) . Mail::EOL . I18N::translate('Verification code') . " - " . $user->getPreference('reg_hashcode') . Mail::EOL . I18N::translate('Comments') . " - " . $user->getPreference('comment') . Mail::EOL . I18N::translate('If you didn’t request an account, you can just delete this message.') . Mail::EOL;
     $mail2_subject = I18N::translate('Your registration at %s', WT_BASE_URL);
     $mail2_to = $user->getEmail();
     $mail2_from = $WT_TREE->getPreference('WEBTREES_EMAIL');
     // Send user message by email only
     Mail::send($WT_TREE, $mail2_to, $mail2_to, $mail2_from, $mail2_from, $mail2_subject, $mail2_body);
     // Send admin message by email and/or internal messaging
     Mail::send($WT_TREE, $webmaster->getEmail(), $webmaster->getRealName(), $user->getEmail(), $user->getRealName(), $mail1_subject, $mail1_body);
     $mail1_method = $webmaster->getPreference('contact_method');
     if ($mail1_method != 'messaging3' && $mail1_method != 'mailto' && $mail1_method != 'none') {
         Database::prepare("INSERT INTO `##message` (sender, ip_address, user_id, subject, body) VALUES (? ,? ,? ,? ,?)")->execute(array($user->getEmail(), WT_CLIENT_IP, $webmaster->getUserId(), $mail1_subject, Filter::unescapeHtml($mail1_body)));
     }
     echo '<div class="confirm"><p>', I18N::translate('Hello %s…<br>Thank you for your registration.', $user->getRealNameHtml()), '</p>';
     echo '<p>', I18N::translate('We will now send a confirmation email to the address <b>%s</b>. You must verify your account request by following instructions in the confirmation email. If you do not confirm your account request within seven days, your application will be rejected automatically. You will have to apply again.<br><br>After you have followed the instructions in the confirmation email, the administrator still has to approve your request before your account can be used.<br><br>To login to this website, you will need to know your user name and password.', $user->getEmail()), '</p>';
     echo '</div>';
     echo '</div>';
开发者ID:pal-saugstad,项目名称:webtrees,代码行数:31,代码来源:login.php

示例9: getMenu

 /** {@inheritdoc} */
 public function getMenu()
 {
     global $controller;
     if (!Auth::isSearchEngine()) {
         Database::updateSchema(self::SCHEMA_MIGRATION_PREFIX, self::SCHEMA_SETTING_NAME, self::SCHEMA_TARGET_VERSION);
         static $menu;
         // Function has already run
         if ($menu !== null && count($menu->getSubmenus()) > 0) {
             return $menu;
         }
         $FTV_SETTINGS = unserialize($this->getSetting('FTV_SETTINGS'));
         if (!empty($FTV_SETTINGS)) {
             foreach ($FTV_SETTINGS as $FTV_ITEM) {
                 if ($FTV_ITEM['TREE'] == $this->tree_id && !empty($FTV_ITEM['PID']) && $FTV_ITEM['ACCESS_LEVEL'] >= Auth::accessLevel($this->tree)) {
                     $FTV_GED_SETTINGS[] = $FTV_ITEM;
                 }
             }
             if (!empty($FTV_GED_SETTINGS)) {
                 if (Theme::theme()->themeId() !== '_administration') {
                     // load the module stylesheets
                     echo $this->module()->getStylesheet();
                     // add javascript files and scripts
                     $this->module()->includeJs($controller, 'menu');
                     if (WT_SCRIPT_NAME === 'individual.php') {
                         $this->module()->includeJs($controller, 'tab');
                     }
                 }
                 $tree_name = Filter::escapeUrl($this->tree->getName());
                 $menu = new Menu(I18N::translate('Family tree overview'), 'module.php?mod=' . $this->getName() . '&amp;mod_action=page&amp;rootid=' . $FTV_GED_SETTINGS[0]['PID'] . '&amp;ged=' . $tree_name, 'menu-fancy_treeview');
                 foreach ($FTV_GED_SETTINGS as $FTV_ITEM) {
                     $record = Individual::getInstance($FTV_ITEM['PID'], $this->tree);
                     if ($record && $record->canShowName()) {
                         if ($this->module()->options('use_fullname') == true) {
                             $submenu = new Menu(I18N::translate('Descendants of %s', $record->getFullName()), 'module.php?mod=' . $this->getName() . '&amp;mod_action=page&amp;rootid=' . $FTV_ITEM['PID'] . '&amp;ged=' . $tree_name, 'menu-fancy_treeview-' . $FTV_ITEM['PID']);
                         } else {
                             $submenu = new Menu(I18N::translate('Descendants of the %s family', $FTV_ITEM['SURNAME']), 'module.php?mod=' . $this->getName() . '&amp;mod_action=page&amp;rootid=' . $FTV_ITEM['PID'] . '&amp;ged=' . $tree_name, 'menu-fancy_treeview-' . $FTV_ITEM['PID']);
                         }
                         $menu->addSubmenu($submenu);
                     }
                 }
                 if (count($menu->getSubmenus()) > 0) {
                     return $menu;
                 }
             }
         }
     }
 }
开发者ID:bxbroze,项目名称:webtrees,代码行数:48,代码来源:module.php

示例10: surnameTagCloud

 /**
  * Print a tagcloud of surnames.
  *
  * @param string[][] $surnames array (of SURN, of array of SPFX_SURN, of array of PID)
  * @param string $script indilist or famlist
  * @param bool $totals show totals after each name
  * @param Tree $tree generate links to this tree
  *
  * @return string
  */
 public static function surnameTagCloud($surnames, $script, $totals, Tree $tree)
 {
     $minimum = PHP_INT_MAX;
     $maximum = 1;
     foreach ($surnames as $surn => $surns) {
         foreach ($surns as $spfxsurn => $indis) {
             $maximum = max($maximum, count($indis));
             $minimum = min($minimum, count($indis));
         }
     }
     $html = '';
     foreach ($surnames as $surn => $surns) {
         foreach ($surns as $spfxsurn => $indis) {
             if ($maximum === $minimum) {
                 // All surnames occur the same number of times
                 $size = 150.0;
             } else {
                 $size = 75.0 + 125.0 * (count($indis) - $minimum) / ($maximum - $minimum);
             }
             $html .= '<a style="font-size:' . $size . '%" href="' . $script . '?surname=' . Filter::escapeUrl($surn) . '&amp;ged=' . $tree->getNameUrl() . '">';
             if ($totals) {
                 $html .= I18N::translate('%1$s (%2$s)', '<span dir="auto">' . $spfxsurn . '</span>', I18N::number(count($indis)));
             } else {
                 $html .= $spfxsurn;
             }
             $html .= '</a> ';
         }
     }
     return '<div class="tag_cloud">' . $html . '</div>';
 }
开发者ID:tunandras,项目名称:webtrees,代码行数:40,代码来源:FunctionsPrintLists.php

示例11: date

     Log::addAuthenticationLog('Possible spam registration from "' . $user_name . '"/"' . $user_email . '" comments="' . $user_comments . '"');
 } else {
     // Everything looks good - create the user
     $controller->pageHeader();
     Log::addAuthenticationLog('User registration requested for: ' . $user_name);
     $user = User::create($user_name, $user_realname, $user_email, $user_password01);
     $user->setPreference('language', WT_LOCALE)->setPreference('verified', '0')->setPreference('verified_by_admin', 0)->setPreference('reg_timestamp', date('U'))->setPreference('reg_hashcode', md5(Uuid::uuid4()))->setPreference('contactmethod', 'messaging2')->setPreference('comment', $user_comments)->setPreference('visibleonline', '1')->setPreference('auto_accept', '0')->setPreference('canadmin', '0')->setPreference('sessiontime', '0');
     // Generate an email in the admin’s language
     $webmaster = User::find($WT_TREE->getPreference('WEBMASTER_USER_ID'));
     I18N::init($webmaster->getPreference('language'));
     $mail1_body = I18N::translate('Hello administrator…') . Mail::EOL . Mail::EOL . I18N::translate('A prospective user has registered with webtrees at %s.', WT_BASE_URL . ' ' . $WT_TREE->getTitleHtml()) . Mail::EOL . Mail::EOL . I18N::translate('Username') . ' ' . Filter::escapeHtml($user->getUserName()) . Mail::EOL . I18N::translate('Real name') . ' ' . $user->getRealNameHtml() . Mail::EOL . I18N::translate('Email address') . ' ' . Filter::escapeHtml($user->getEmail()) . Mail::EOL . I18N::translate('Comments') . ' ' . Filter::escapeHtml($user_comments) . Mail::EOL . Mail::EOL . I18N::translate('The user has been sent an email with the information necessary to confirm the access request.') . Mail::EOL . Mail::EOL . I18N::translate('You will be informed by email when this prospective user has confirmed the request. You can then complete the process by activating the username. The new user will not be able to sign in until you activate the account.');
     $mail1_subject = I18N::translate('New registration at %s', WT_BASE_URL . ' ' . $WT_TREE->getTitle());
     I18N::init(WT_LOCALE);
     echo '<div id="login-register-page">';
     // Generate an email in the user’s language
     $mail2_body = I18N::translate('Hello %s…', $user->getRealNameHtml()) . Mail::EOL . Mail::EOL . I18N::translate('You (or someone claiming to be you) has requested an account at %1$s using the email address %2$s.', WT_BASE_URL . ' ' . $WT_TREE->getTitleHtml(), $user->getEmail()) . Mail::EOL . Mail::EOL . I18N::translate('Follow this link to verify your email address.') . Mail::EOL . Mail::EOL . '<a href="' . WT_LOGIN_URL . '?user_name=' . Filter::escapeUrl($user->getUserName()) . '&amp;user_hashcode=' . $user->getPreference('reg_hashcode') . '&amp;action=userverify&amp;ged=' . $WT_TREE->getNameUrl() . '">' . WT_LOGIN_URL . "?user_name=" . Filter::escapeHtml($user->getUserName()) . "&amp;user_hashcode=" . urlencode($user->getPreference('reg_hashcode')) . '&amp;action=userverify&amp;ged=' . $WT_TREE->getNameHtml() . '</a>' . Mail::EOL . Mail::EOL . I18N::translate('Username') . " - " . Filter::escapeHtml($user->getUserName()) . Mail::EOL . I18N::translate('Comments') . " - " . $user->getPreference('comment') . Mail::EOL . I18N::translate('If you didn’t request an account, you can just delete this message.') . Mail::EOL;
     $mail2_subject = I18N::translate('Your registration at %s', WT_BASE_URL);
     $mail2_to = $user->getEmail();
     $mail2_from = $WT_TREE->getPreference('WEBTREES_EMAIL');
     // Send user message by email only
     Mail::send($WT_TREE, $mail2_to, $mail2_to, $mail2_from, $mail2_from, $mail2_subject, $mail2_body);
     // Send admin message by email and/or internal messaging
     Mail::send($WT_TREE, $webmaster->getEmail(), $webmaster->getRealName(), $user->getEmail(), $user->getRealName(), $mail1_subject, $mail1_body);
     $mail1_method = $webmaster->getPreference('contact_method');
     if ($mail1_method != 'messaging3' && $mail1_method != 'mailto' && $mail1_method != 'none') {
         Database::prepare("INSERT INTO `##message` (sender, ip_address, user_id, subject, body) VALUES (? ,? ,? ,? ,?)")->execute(array($user->getEmail(), WT_CLIENT_IP, $webmaster->getUserId(), $mail1_subject, Filter::unescapeHtml($mail1_body)));
     }
     echo '<div class="confirm"><p>', I18N::translate('Hello %s…<br>Thank you for your registration.', $user->getRealNameHtml()), '</p>';
     echo '<p>', I18N::translate('We will now send a confirmation email to the address <b>%s</b>. You must verify your account request by following instructions in the confirmation email. If you do not confirm your account request within seven days, your application will be rejected automatically. You will have to apply again.<br><br>After you have followed the instructions in the confirmation email, the administrator still has to approve your request before your account can be used.<br><br>To sign in to this website, you will need to know your username and password.', $user->getEmail()), '</p>';
     echo '</div>';
     echo '</div>';
开发者ID:tronsmit,项目名称:webtrees,代码行数:31,代码来源:login.php

示例12: printFact


//.........这里部分代码省略.........
        } else {
            echo $label;
        }
        switch ($fact->getTag()) {
            case '_BIRT_CHIL':
                echo '<br>', I18N::translate('#%s', ++$n_chil);
                break;
            case '_BIRT_GCHI':
            case '_BIRT_GCH1':
            case '_BIRT_GCH2':
                echo '<br>', I18N::translate('#%s', ++$n_gchi);
                break;
        }
        echo '</td><td class="optionbox ', $styleadd, ' wrap">';
        // Event from another record?
        if ($parent !== $record) {
            if ($parent instanceof Family) {
                foreach ($parent->getSpouses() as $spouse) {
                    if ($record !== $spouse) {
                        echo '<a href="', $spouse->getHtmlUrl(), '">', $spouse->getFullName(), '</a> — ';
                    }
                }
                echo '<a href="', $parent->getHtmlUrl(), '">', I18N::translate('View family'), '</a><br>';
            } elseif ($parent instanceof Individual) {
                echo '<a href="', $parent->getHtmlUrl(), '">', $parent->getFullName(), '</a><br>';
            }
        }
        // Print the value of this fact/event
        switch ($fact->getTag()) {
            case 'ADDR':
                echo $fact->getValue();
                break;
            case 'AFN':
                echo '<div class="field"><a href="https://familysearch.org/search/tree/results#count=20&query=afn:', Filter::escapeUrl($fact->getValue()), '">', Filter::escapeHtml($fact->getValue()), '</a></div>';
                break;
            case 'ASSO':
                // we handle this later, in format_asso_rela_record()
                break;
            case 'EMAIL':
            case 'EMAI':
            case '_EMAIL':
                echo '<div class="field"><a href="mailto:', Filter::escapeHtml($fact->getValue()), '">', Filter::escapeHtml($fact->getValue()), '</a></div>';
                break;
            case 'FILE':
                if (Auth::isEditor($fact->getParent()->getTree())) {
                    echo '<div class="field">', Filter::escapeHtml($fact->getValue()), '</div>';
                }
                break;
            case 'RESN':
                echo '<div class="field">';
                switch ($fact->getValue()) {
                    case 'none':
                        // Note: "1 RESN none" is not valid gedcom.
                        // However, webtrees privacy rules will interpret it as "show an otherwise private record to public".
                        echo '<i class="icon-resn-none"></i> ', I18N::translate('Show to visitors');
                        break;
                    case 'privacy':
                        echo '<i class="icon-class-none"></i> ', I18N::translate('Show to members');
                        break;
                    case 'confidential':
                        echo '<i class="icon-confidential-none"></i> ', I18N::translate('Show to managers');
                        break;
                    case 'locked':
                        echo '<i class="icon-locked-none"></i> ', I18N::translate('Only managers can edit');
                        break;
                    default:
开发者ID:pal-saugstad,项目名称:webtrees,代码行数:67,代码来源:FunctionsPrintFacts.php

示例13: menuMedia

 protected function menuMedia()
 {
     $resns = $this->tree->getFactPrivacy();
     if (isset($resns['OBJE'])) {
         $resn = $resns['OBJE'];
     } else {
         $resn = Auth::PRIV_PRIVATE;
     }
     if ($resn >= Auth::accessLevel($this->tree)) {
         $MEDIA_DIRECTORY = $this->tree->getPreference('MEDIA_DIRECTORY');
         $folders = $this->themeOption('mediafolders');
         $show_subfolders = $this->themeOption('show_subfolders') ? '&amp;subdirs=on' : '';
         if (count($folders) > 1) {
             $menu = new Menu(I18N::translate('Media'), '', 'menu-media');
             $submenu = new Menu(I18N::translate('Media'), 'medialist.php?' . $this->tree_url . '&amp;action=filter&amp;search=no&amp;folder=&amp;sortby=title' . $show_subfolders . '&amp;max=20&amp;columns=2&amp;action=submit', 'menu-media-all');
             $menu->addSubmenu($submenu);
             // divider
             $divider = new Menu('', '#', 'menu-media-divider divider');
             $menu->addSubmenu($divider);
             foreach ($folders as $key => $folder) {
                 if ($key !== $MEDIA_DIRECTORY) {
                     $submenu = new Menu(ucfirst($folder), 'medialist.php?' . $this->tree_url . '&amp;action=filter&amp;search=no&amp;folder=' . Filter::escapeUrl($key) . '&amp;sortby=title' . $show_subfolders . '&amp;max=20&amp;columns=2&amp;action=submit', 'menu-media-' . preg_replace('/[^A-Za-z0-9\\. -]/', '', str_replace(" ", "-", $folder)));
                     $menu->addSubmenu($submenu);
                 }
             }
         } else {
             // fallback if we don't have any subfolders added to the list
             $menu = new Menu(I18N::translate('Media'), 'medialist.php?' . $this->tree_url . '&amp;sortby=title&amp;max=20&amp;columns=2&amp;action=submit', 'menu-media');
         }
         return $menu;
     }
 }
开发者ID:bxbroze,项目名称:justlight,代码行数:32,代码来源:theme.php


注:本文中的Fisharebest\Webtrees\Filter::escapeUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。