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


PHP WT_Filter::escapeJs方法代码示例

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


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

示例1: Array

			list3.selectedIndex = -1;
		}
		if (list_name=="available_select") {
			list1.selectedIndex = -1;
			list3.selectedIndex = -1;
		}
		if (list_name=="right_select") {
			list1.selectedIndex = -1;
			list2.selectedIndex = -1;
		}
	}
	var block_descr = new Array();
	');
// Load Block Description array for use by javascript
foreach ($all_blocks as $block_name => $block) {
    $controller->addInlineJavascript('block_descr["' . $block_name . '"] = "' . WT_Filter::escapeJs($block->getDescription()) . '";');
}
$controller->addInlineJavascript('block_descr["advice1"] = "' . WT_I18N::translate('Highlight a  block name and then click on one of the arrow icons to move that highlighted block in the indicated direction.') . '";');
?>
<form name="config_setup" method="post" action="index_edit.php?action=update" onsubmit="select_options(); return modalDialogSubmitAjax(this);" >
<input type="hidden" name="user_id"   value="<?php 
echo $user_id;
?>
">
<input type="hidden" name="gedcom_id" value="<?php 
echo $gedcom_id;
?>
">
<table border="1" id="change_blocks">
<?php 
// NOTE: Row 1: Column legends
开发者ID:brambravo,项目名称:webtrees,代码行数:31,代码来源:index_edit.php

示例2: search_sources

        }
        echo '</div>';
    }
    // Output Sources
    if ($type == "source") {
        echo '<div id="find-output">';
        if ($filter) {
            $mysourcelist = search_sources($filter_array, array(WT_GED_ID), 'AND', true);
        } else {
            $mysourcelist = get_source_list(WT_GED_ID);
        }
        if ($mysourcelist) {
            usort($mysourcelist, array('WT_GedcomRecord', 'Compare'));
            echo '<ul>';
            foreach ($mysourcelist as $source) {
                echo '<li><a href="', $source->getHtmlUrl(), '" onclick="pasteid(\'', $source->getXref(), '\', \'', WT_Filter::escapeJs($source->getFullName()), '\');"><span class="list_item">', $source->getFullName(), '</span></a></li>';
            }
            echo '</ul>
			<p>', WT_I18N::translate('Total sources: %s', count($mysourcelist)), '</p>';
        } else {
            echo '<p>', WT_I18N::translate('No results found.'), '</p>';
        }
        echo '</div>';
    }
    // Output Special Characters
    if ($type == "specialchar") {
        echo '<div id="find-output-special"><p>';
        // lower case special characters
        foreach ($lcspecialchars as $key => $value) {
            echo '<a class="largechars" href="#" onclick="return window.opener.paste_char(\'', $value, '\');">', $key, '</a> ';
        }
开发者ID:sadr110,项目名称:webtrees,代码行数:31,代码来源:find.php

示例3: media_object_info

function media_object_info(WT_Media $media)
{
    $xref = $media->getXref();
    $gedcom = WT_Tree::getNameFromId($media->getGedcomId());
    $name = $media->getFullName();
    $html = '<b>' . $name . '</b>' . '<div><i>' . WT_Filter::escapeHtml($media->getNote()) . '</i></div>' . '<br>' . '<a href="' . $media->getHtmlUrl() . '">' . WT_I18N::translate('View') . '</a>';
    $html .= ' - ' . '<a onclick="window.open(\'addmedia.php?action=editmedia&amp;pid=' . $xref . '&ged=' . WT_Filter::escapeJs($gedcom) . '\', \'_blank\', edit_window_specs)" href="#">' . WT_I18N::Translate('Edit') . '</a>' . ' - ' . '<a onclick="return delete_media(\'' . WT_Filter::escapeJs(WT_I18N::translate('Are you sure you want to delete “%s”?', strip_tags($media->getFullName()))) . '\', \'' . $media->getXref() . '\', \'' . WT_Filter::escapeJs($gedcom) . '\');" href="#">' . WT_I18N::Translate('Delete') . '</a>' . ' - ';
    if (array_key_exists('GEDFact_assistant', WT_Module::getActiveModules())) {
        $html .= '<a onclick="return ilinkitem(\'' . $xref . '\', \'manage\', \'' . $gedcom . '\')" href="#">' . WT_I18N::Translate('Manage links') . '</a>';
    } else {
        global $TEXT_DIRECTION;
        $classSuffix = $TEXT_DIRECTION == 'rtl' ? '_rtl' : '';
        $menu = new WT_Menu();
        $menu->addLabel(WT_I18N::translate('Set link'));
        $menu->addClass('', 'submenu');
        $submenu = new WT_Menu(WT_I18N::translate('To individual'));
        $submenu->addClass("submenuitem" . $classSuffix);
        $submenu->addOnClick("return ilinkitem('{$xref}', 'person', '{$gedcom}')");
        $menu->addSubMenu($submenu);
        $submenu = new WT_Menu(WT_I18N::translate('To family'));
        $submenu->addClass("submenuitem" . $classSuffix);
        $submenu->addOnClick("return ilinkitem('{$xref}', 'family', '{$gedcom}')");
        $menu->addSubMenu($submenu);
        $submenu = new WT_Menu(WT_I18N::translate('To source'));
        $submenu->addClass("submenuitem" . $classSuffix);
        $submenu->addOnClick("return ilinkitem('{$xref}', 'source', '{$gedcom}')");
        $menu->addSubMenu($submenu);
        $html .= '<div style="display:inline-block;">' . $menu->getMenu() . '</div>';
    }
    $html .= '<br><br>';
    $linked = array();
    foreach ($media->linkedIndividuals('OBJE') as $link) {
        $linked[] = '<a href="' . $link->getHtmlUrl() . '">' . $link->getFullName() . '</a>';
    }
    foreach ($media->linkedFamilies('OBJE') as $link) {
        $linked[] = '<a href="' . $link->getHtmlUrl() . '">' . $link->getFullName() . '</a>';
    }
    foreach ($media->linkedSources('OBJE') as $link) {
        $linked[] = '<a href="' . $link->getHtmlUrl() . '">' . $link->getFullName() . '</a>';
    }
    foreach ($media->linkedNotes('OBJE') as $link) {
        // Invalid GEDCOM - you cannot link a NOTE to an OBJE
        $linked[] = '<a href="' . $link->getHtmlUrl() . '">' . $link->getFullName() . '</a>';
    }
    foreach ($media->linkedRepositories('OBJE') as $link) {
        // Invalid GEDCOM - you cannot link a REPO to an OBJE
        $linked[] = '<a href="' . $link->getHtmlUrl() . '">' . $link->getFullName() . '</a>';
    }
    if ($linked) {
        $html .= '<ul>';
        foreach ($linked as $link) {
            $html .= '<li>' . $link . '</li>';
        }
        $html .= '</ul>';
    } else {
        $html .= '<div class="error">' . WT_I18N::translate('This media object is not linked to any other record.') . '</div>';
    }
    return $html;
}
开发者ID:brambravo,项目名称:webtrees,代码行数:59,代码来源:admin_media.php

示例4: pageHeader

    public function pageHeader()
    {
        // Import global variables into the local scope, for the theme’s header.php
        global $SEARCH_SPIDER, $TEXT_DIRECTION, $REQUIRE_AUTHENTICATION, $headerfile, $view;
        // The title often includes the names of records, which may have markup
        // that cannot be used in the page title.
        $title = html_entity_decode(strip_tags($this->page_title), ENT_QUOTES, 'UTF-8');
        // Initialise variables for the theme’s header.php
        $LINK_CANONICAL = $this->canonical_url;
        $META_ROBOTS = $this->meta_robots;
        $META_DESCRIPTION = WT_GED_ID ? get_gedcom_setting(WT_GED_ID, 'META_DESCRIPTION') : '';
        if (!$META_DESCRIPTION) {
            $META_DESCRIPTION = strip_tags(WT_TREE_TITLE);
        }
        $META_GENERATOR = WT_WEBTREES . ' ' . WT_VERSION . ' - ' . WT_WEBTREES_URL;
        $META_TITLE = WT_GED_ID ? get_gedcom_setting(WT_GED_ID, 'META_TITLE') : '';
        if ($META_TITLE) {
            $title .= ' - ' . $META_TITLE;
        }
        // This javascript needs to be loaded in the header, *before* the CSS.
        // All other javascript should be defered until the end of the page
        $javascript = '<script src="' . WT_MODERNIZR_URL . '"></script>';
        // Give Javascript access to some PHP constants
        $this->addInlineJavascript('
			var WT_STATIC_URL  = "' . WT_Filter::escapeJs(WT_STATIC_URL) . '";
			var WT_THEME_DIR   = "' . WT_Filter::escapeJs(WT_THEME_DIR) . '";
			var WT_MODULES_DIR = "' . WT_Filter::escapeJs(WT_MODULES_DIR) . '";
			var WT_GEDCOM      = "' . WT_Filter::escapeJs(WT_GEDCOM) . '";
			var WT_GED_ID      = "' . WT_Filter::escapeJs(WT_GED_ID) . '";
			var WT_USER_ID     = "' . WT_Filter::escapeJs(WT_USER_ID) . '";
			var textDirection  = "' . WT_Filter::escapeJs($TEXT_DIRECTION) . '";
			var WT_SCRIPT_NAME = "' . WT_Filter::escapeJs(WT_SCRIPT_NAME) . '";
			var WT_LOCALE      = "' . WT_Filter::escapeJs(WT_LOCALE) . '";
			var WT_CSRF_TOKEN  = "' . WT_Filter::escapeJs(WT_Filter::getCsrfToken()) . '";
		', self::JS_PRIORITY_HIGH);
        // Temporary fix for access to main menu hover elements on android/blackberry touch devices
        $this->addInlineJavascript('
			if(navigator.userAgent.match(/Android|PlayBook/i)) {
				jQuery("#main-menu > li > a").attr("href", "#");
				jQuery("a.icon_arrow").attr("href", "#");
			}
		');
        header('Content-Type: text/html; charset=UTF-8');
        require WT_ROOT . $headerfile;
        // Flush the output, so the browser can render the header and load javascript
        // while we are preparing data for the page
        if (ini_get('output_buffering')) {
            ob_flush();
        }
        flush();
        // Once we've displayed the header, we should no longer write session data.
        Zend_Session::writeClose();
        // We've displayed the header - display the footer automatically
        $this->page_header = true;
        return $this;
    }
开发者ID:brambravo,项目名称:webtrees,代码行数:56,代码来源:Page.php

示例5: format_repo_table

function format_repo_table($repos)
{
    global $SHOW_LAST_CHANGE, $controller;
    $html = '';
    $table_id = 'table-repo-' . Uuid::uuid4();
    // lists requires a unique ID in case there are multiple lists per page
    $controller->addExternalJavascript(WT_JQUERY_DATATABLES_URL)->addInlineJavascript('
			jQuery.fn.dataTableExt.oSort["unicode-asc" ]=function(a,b) {return a.replace(/<[^<]*>/, "").localeCompare(b.replace(/<[^<]*>/, ""))};
			jQuery.fn.dataTableExt.oSort["unicode-desc"]=function(a,b) {return b.replace(/<[^<]*>/, "").localeCompare(a.replace(/<[^<]*>/, ""))};
			jQuery("#' . $table_id . '").dataTable({
				dom: \'<"H"pf<"dt-clear">irl>t<"F"pl>\',
				' . WT_I18N::datatablesI18N() . ',
				jQueryUI: true,
				autoWidth: false,
				processing: true,
				columns: [
					/* 0 name      */ { type: "unicode" },
					/* 1 #sour     */ { dataSort: 2, class: "center" },
					/* 2 #SOUR     */ { type: "num", visible: false },
					/* 3 CHAN      */ { dataSort: 4, visible: ' . ($SHOW_LAST_CHANGE ? 'true' : 'false') . ' },
					/* 4 CHAN_sort */ { visible: false },
					/* 5 DELETE    */ { visible: ' . (WT_USER_GEDCOM_ADMIN ? 'true' : 'false') . ', sortable: false }
				],
				displayLength: 20,
				pagingType: "full_numbers"
			});
			jQuery(".repo-list").css("visibility", "visible");
			jQuery(".loading-image").css("display", "none");
		');
    //--table wrapper
    $html .= '<div class="loading-image">&nbsp;</div>';
    $html .= '<div class="repo-list">';
    //-- table header
    $html .= '<table id="' . $table_id . '"><thead><tr>';
    $html .= '<th>' . WT_I18N::translate('Repository name') . '</th>';
    $html .= '<th>' . WT_I18N::translate('Sources') . '</th>';
    $html .= '<th>#SOUR</th>';
    $html .= '<th' . ($SHOW_LAST_CHANGE ? '' : '') . '>' . WT_Gedcom_Tag::getLabel('CHAN') . '</th>';
    $html .= '<th' . ($SHOW_LAST_CHANGE ? '' : '') . '>CHAN</th>';
    $html .= '<th>&nbsp;</th>';
    //delete
    $html .= '</tr></thead>';
    //-- table body
    $html .= '<tbody>';
    foreach ($repos as $repo) {
        if (!$repo->canShow()) {
            continue;
        }
        if ($repo->isNew()) {
            $class = ' class="new"';
        } elseif ($repo->isOld()) {
            $class = ' class="old"';
        } else {
            $class = '';
        }
        $html .= '<tr' . $class . '>';
        //-- Repository name(s)
        $html .= '<td>';
        foreach ($repo->getAllNames() as $n => $name) {
            if ($n) {
                $html .= '<br>';
            }
            if ($n == $repo->getPrimaryName()) {
                $html .= '<a class="name2" href="' . $repo->getHtmlUrl() . '">' . highlight_search_hits($name['full']) . '</a>';
            } else {
                $html .= '<a href="' . $repo->getHtmlUrl() . '">' . highlight_search_hits($name['full']) . '</a>';
            }
        }
        $html .= '</td>';
        //-- Linked SOURces
        $num = count($repo->linkedSources('REPO'));
        $html .= '<td>' . WT_I18N::number($num) . '</td><td>' . $num . '</td>';
        //-- Last change
        if ($SHOW_LAST_CHANGE) {
            $html .= '<td>' . $repo->LastChangeTimestamp() . '</td>';
        } else {
            $html .= '<td>&nbsp;</td>';
        }
        //-- Last change hidden sort column
        if ($SHOW_LAST_CHANGE) {
            $html .= '<td>' . $repo->LastChangeTimestamp(true) . '</td>';
        } else {
            $html .= '<td>&nbsp;</td>';
        }
        //-- Delete
        if (WT_USER_GEDCOM_ADMIN) {
            $html .= '<td><div title="' . WT_I18N::translate('Delete') . '" class="deleteicon" onclick="return delete_repository(\'' . WT_I18N::translate('Are you sure you want to delete “%s”?', WT_Filter::escapeJs(WT_Filter::unescapeHtml($repo->getFullName()))) . "', '" . $repo->getXref() . '\');"><span class="link_text">' . WT_I18N::translate('Delete') . '</span></div></td>';
        } else {
            $html .= '<td>&nbsp;</td>';
        }
        $html .= '</tr>';
    }
    $html .= '</tbody></table></div>';
    return $html;
}
开发者ID:brambravo,项目名称:webtrees,代码行数:95,代码来源:functions_print_lists.php

示例6: function

		sel.rownum = numfields;
		sel.onchange = function() {
			showDate(this, this.rownum);
		};

		// all of the field options
		<?php 
foreach ($controller->getOtherFields() as $field => $label) {
    ?>
		opt = document.createElement('option');
		opt.value='<?php 
    echo $field;
    ?>
';
		opt.text='<?php 
    echo WT_Filter::escapeJs($label);
    ?>
';
		sel.options.add(opt);
		<?php 
}
?>
		label.appendChild(sel);
		trow.appendChild(label);
		// create the new value cell
		var val = document.createElement('td');
		val.id = 'vcell'+numfields;
		val.className='list_value';

		var inp = document.createElement('input');
		inp.name='values['+numfields+']';
开发者ID:brambravo,项目名称:webtrees,代码行数:31,代码来源:search_advanced.php

示例7: placesEdit


//.........这里部分代码省略.........
                    $place_name = '';
                }
                $place_lati = null;
                $place_long = null;
                $parent_lati = "0.0";
                $parent_long = "0.0";
                $place_icon = '';
                $parent_id = 0;
                $level = 0;
                $zoomfactor = $this->getSetting('GM_MIN_ZOOM');
            }
            $selected_country = 'Countries';
            if (!isset($place_name) || $place_name == "") {
                echo '<b>', WT_I18N::translate('unknown');
            } else {
                echo '<b>', $place_name;
            }
            if (count($where_am_i) > 0) {
                echo ', ', WT_Filter::escapeHtml(str_replace('Unknown', WT_I18N::translate('unknown'), implode(WT_I18N::$list_separator, array_reverse($where_am_i, true)))), '</b><br>';
            }
            echo '</b><br>';
        }
        ?>

			<script src="<?php 
        echo $this->googleMapsScript();
        ?>
"></script>
			<script>
			var map;
			var marker;
			var zoom;
			var pl_name = '<?php 
        echo WT_Filter::escapeJs($place_name);
        ?>
';
			if (pl_name) {
				var pl_lati = '<?php 
        echo $place_lati;
        ?>
';
				var pl_long = '<?php 
        echo $place_long;
        ?>
';
			} else {
				var pl_lati = '<?php 
        echo $parent_lati;
        ?>
';
				var pl_long = '<?php 
        echo $parent_long;
        ?>
';
			}
			var pl_zoom = <?php 
        echo $zoomfactor;
        ?>
;
			var latlng = new google.maps.LatLng(pl_lati, pl_long);
			var polygon1;
			var geocoder;
			var mapType;

			var infowindow = new google.maps.InfoWindow({
				//
开发者ID:jacoline,项目名称:webtrees,代码行数:67,代码来源:module.php

示例8: getTabContent

 public function getTabContent()
 {
     global $controller;
     $html = '<div id="' . $this->getName() . '_content">';
     //Show Lightbox-Album header Links
     if (WT_USER_CAN_EDIT) {
         $html .= '<table class="facts_table"><tr><td class="descriptionbox rela">';
         // Add a new media object
         if (get_gedcom_setting(WT_GED_ID, 'MEDIA_UPLOAD') >= WT_USER_ACCESS_LEVEL) {
             $html .= '<span><a href="#" onclick="window.open(\'addmedia.php?action=showmediaform&linktoid=' . $controller->record->getXref() . '\', \'_blank\', \'resizable=1,scrollbars=1,top=50,height=780,width=600\');return false;">';
             $html .= '<img src="' . WT_CSS_URL . 'images/image_add.png" id="head_icon" class="icon" title="' . WT_I18N::translate('Add a new media object') . '" alt="' . WT_I18N::translate('Add a new media object') . '">';
             $html .= WT_I18N::translate('Add a new media object');
             $html .= '</a></span>';
             // Link to an existing item
             $html .= '<span><a href="#" onclick="window.open(\'inverselink.php?linktoid=' . $controller->record->getXref() . '&linkto=person\', \'_blank\', \'resizable=1,scrollbars=1,top=50,height=300,width=450\');">';
             $html .= '<img src="' . WT_CSS_URL . 'images/image_link.png" id="head_icon" class="icon" title="' . WT_I18N::translate('Link to an existing media object') . '" alt="' . WT_I18N::translate('Link to an existing media object') . '">';
             $html .= WT_I18N::translate('Link to an existing media object');
             $html .= '</a></span>';
         }
         if (WT_USER_GEDCOM_ADMIN && $this->get_media()) {
             // Popup Reorder Media
             $html .= '<span><a href="#" onclick="reorder_media(\'' . $controller->record->getXref() . '\')">';
             $html .= '<img src="' . WT_CSS_URL . 'images/images.png" id="head_icon" class="icon" title="' . WT_I18N::translate('Re-order media') . '" alt="' . WT_I18N::translate('Re-order media') . '">';
             $html .= WT_I18N::translate('Re-order media');
             $html .= '</a></span>';
         }
         $html .= '</td></tr></table>';
     }
     // Used when sorting media on album tab page
     $html .= '<table class="facts_table"><tr><td class="facts_value">';
     // one-cell table - for presentation only
     $html .= '<ul class="album-list">';
     foreach ($this->get_media() as $media) {
         //View Edit Menu ----------------------------------
         //Get media item Notes
         $haystack = $media->getGedcom();
         $needle = '1 NOTE';
         $before = substr($haystack, 0, strpos($haystack, $needle));
         $after = substr(strstr($haystack, $needle), strlen($needle));
         $notes = print_fact_notes($before . $needle . $after, 1, true);
         // Prepare Below Thumbnail  menu ----------------------------------------------------
         $menu = new WT_Menu('<div style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap">' . $media->getFullName() . '</div>');
         $menu->addClass('', 'submenu');
         // View Notes
         if (strpos($media->getGedcom(), "\n1 NOTE")) {
             $submenu = new WT_Menu(WT_I18N::translate('View notes'));
             // Notes Tooltip ----------------------------------------------------
             $submenu->addOnclick("modalNotes('" . WT_Filter::escapeJs($notes) . "','" . WT_I18N::translate('View notes') . "'); return false;");
             $submenu->addClass("submenuitem");
             $menu->addSubMenu($submenu);
         }
         //View Details
         $submenu = new WT_Menu(WT_I18N::translate('View details'), $media->getHtmlUrl());
         $submenu->addClass("submenuitem");
         $menu->addSubMenu($submenu);
         //View Sources
         $source_menu = null;
         foreach ($media->getFacts('SOUR') as $source_fact) {
             $source = $source_fact->getTarget();
             if ($source && $source->canShow()) {
                 if (!$source_menu) {
                     // Group sources under a top level menu
                     $source_menu = new WT_Menu(WT_I18N::translate('Sources'), '#', null, 'right', 'right');
                     $source_menu->addClass('submenuitem', 'submenu');
                 }
                 //now add a link to the actual source as a submenu
                 $submenu = new WT_Menu($source->getFullName(), $source->getHtmlUrl());
                 $submenu->addClass('submenuitem', 'submenu');
                 $source_menu->addSubMenu($submenu);
             }
         }
         if ($source_menu) {
             $menu->addSubMenu($source_menu);
         }
         if (WT_USER_CAN_EDIT) {
             // Edit Media
             $submenu = new WT_Menu(WT_I18N::translate('Edit media'));
             $submenu->addOnclick("return window.open('addmedia.php?action=editmedia&amp;pid=" . $media->getXref() . "', '_blank', edit_window_specs);");
             $submenu->addClass("submenuitem");
             $menu->addSubMenu($submenu);
             if (Auth::isAdmin()) {
                 // Manage Links
                 if (array_key_exists('GEDFact_assistant', WT_Module::getActiveModules())) {
                     $submenu = new WT_Menu(WT_I18N::translate('Manage links'));
                     $submenu->addOnclick("return window.open('inverselink.php?mediaid=" . $media->getXref() . "&amp;linkto=manage', '_blank', find_window_specs);");
                     $submenu->addClass("submenuitem");
                     $menu->addSubMenu($submenu);
                 } else {
                     $submenu = new WT_Menu(WT_I18N::translate('Set link'), '#', null, 'right', 'right');
                     $submenu->addClass('submenuitem', 'submenu');
                     $ssubmenu = new WT_Menu(WT_I18N::translate('To individual'));
                     $ssubmenu->addOnclick("return window.open('inverselink.php?mediaid=" . $media->getXref() . "&amp;linkto=person', '_blank', find_window_specs);");
                     $ssubmenu->addClass('submenuitem', 'submenu');
                     $submenu->addSubMenu($ssubmenu);
                     $ssubmenu = new WT_Menu(WT_I18N::translate('To family'));
                     $ssubmenu->addOnclick("return window.open('inverselink.php?mediaid=" . $media->getXref() . "&amp;linkto=family', '_blank', find_window_specs);");
                     $ssubmenu->addClass('submenuitem', 'submenu');
                     $submenu->addSubMenu($ssubmenu);
                     $ssubmenu = new WT_Menu(WT_I18N::translate('To source'));
                     $ssubmenu->addOnclick("return window.open('inverselink.php?mediaid=" . $media->getXref() . "&amp;linkto=source', '_blank', find_window_specs);");
//.........这里部分代码省略.........
开发者ID:jacoline,项目名称:webtrees,代码行数:101,代码来源:module.php

示例9: getBlock

 public function getBlock($block_id, $template = true, $cfg = null)
 {
     global $ctype;
     require_once WT_ROOT . 'includes/functions/functions_print_facts.php';
     // Block actions
     $action = WT_Filter::get('action');
     $message_id = WT_Filter::getArray('message_id');
     if ($action == 'deletemessage') {
         foreach ($message_id as $msg_id) {
             deleteMessage($msg_id);
         }
     }
     $block = get_block_setting($block_id, 'block', true);
     if ($cfg) {
         foreach (array('block') as $name) {
             if (array_key_exists($name, $cfg)) {
                 ${$name} = $cfg[$name];
             }
         }
     }
     $messages = getUserMessages(WT_USER_ID);
     $id = $this->getName() . $block_id;
     $class = $this->getName() . '_block';
     $title = WT_I18N::plural('%s message', '%s messages', count($messages), WT_I18N::number(count($messages)));
     $content = '<form name="messageform" action="index.php?ctype=' . $ctype . '" method="get" onsubmit="return confirm(\'' . WT_I18N::translate('Are you sure you want to delete this message?  It cannot be retrieved later.') . '\');">';
     if (count(User::all()) > 1) {
         $content .= '<br>' . WT_I18N::translate('Send message') . " <select name=\"touser\">";
         $content .= '<option value="">' . WT_I18N::translate('&lt;select&gt;') . '</option>';
         foreach (User::all() as $user) {
             if ($user->getUserId() != WT_USER_ID && $user->getSetting('verified_by_admin') && $user->getSetting('contactmethod') != 'none') {
                 $content .= '<option value="' . WT_Filter::escapeHtml($user->getUserName()) . '">';
                 $content .= '<span dir="auto">' . WT_Filter::escapeHtml($user->getRealName()) . '</span> - <span dir="auto">' . WT_Filter::escapeHtml($user->getUserName()) . '</span>';
                 $content .= '</option>';
             }
         }
         $content .= '</select> <input type="button" value="' . WT_I18N::translate('Send') . '" onclick="message(document.messageform.touser.options[document.messageform.touser.selectedIndex].value, \'messaging2\', \'\'); return false;"><br><br>';
     }
     if (count($messages) == 0) {
         $content .= WT_I18N::translate('You have no pending messages.') . "<br>";
     } else {
         $content .= '<input type="hidden" name="action" value="deletemessage">';
         $content .= '<table class="list_table"><tr>';
         $content .= '<td class="list_label">' . WT_I18N::translate('Delete') . '<br><a href="#" onclick="jQuery(\'#' . $this->getName() . $block_id . ' :checkbox\').prop(\'checked\', true); return false;">' . WT_I18N::translate('All') . '</a></td>';
         $content .= '<td class="list_label">' . WT_I18N::translate('Subject:') . '</td>';
         $content .= '<td class="list_label">' . WT_I18N::translate('Date sent:') . '</td>';
         $content .= '<td class="list_label">' . WT_I18N::translate('Email address:') . '</td>';
         $content .= '</tr>';
         foreach ($messages as $message) {
             $content .= '<tr>';
             $content .= '<td class="list_value_wrap"><input type="checkbox" id="cb_message' . $message->message_id . '" name="message_id[]" value="' . $message->message_id . '"></td>';
             $content .= '<td class="list_value_wrap"><a href="#" onclick="return expand_layer(\'message' . $message->message_id . '\');"><i id="message' . $message->message_id . '_img" class="icon-plus"></i> <b dir="auto">' . WT_Filter::escapeHtml($message->subject) . '</b></a></td>';
             $content .= '<td class="list_value_wrap">' . format_timestamp($message->created) . '</td>';
             $content .= '<td class="list_value_wrap">';
             $user = User::findByIdentifier($message->sender);
             if ($user) {
                 $content .= '<span dir="auto">' . $user->getRealName() . '</span>';
                 $content .= '  - <span dir="auto">' . $user->getEmail() . '</span>';
             } else {
                 $content .= '<a href="mailto:' . WT_Filter::escapeHtml($message->sender) . '">' . WT_Filter::escapeHtml($message->sender) . '</a>';
             }
             $content .= '</td>';
             $content .= '</tr>';
             $content .= '<tr><td class="list_value_wrap" colspan="5"><div id="message' . $message->message_id . '" style="display:none;">';
             $content .= '<div dir="auto" style="white-space: pre-wrap;">' . WT_Filter::expandUrls($message->body) . '</div><br>';
             if (strpos($message->subject, WT_I18N::translate('RE: ')) !== 0) {
                 $message->subject = WT_I18N::translate('RE: ') . $message->subject;
             }
             if ($user) {
                 $content .= '<a href="#" onclick="reply(\'' . WT_Filter::escapeJs($message->sender) . '\', \'' . WT_Filter::escapeJs($message->subject) . '\'); return false;">' . WT_I18N::translate('Reply') . '</a> | ';
             }
             $content .= '<a href="index.php?action=deletemessage&amp;message_id[]=' . $message->message_id . '" onclick="return confirm(\'' . WT_I18N::translate('Are you sure you want to delete this message?  It cannot be retrieved later.') . '\');">' . WT_I18N::translate('Delete') . '</a></div></td></tr>';
         }
         $content .= '</table>';
         $content .= '<input type="submit" value="' . WT_I18N::translate('Delete selected messages') . '"><br>';
     }
     $content .= '</form>';
     if ($template) {
         if ($block) {
             require WT_THEME_DIR . 'templates/block_small_temp.php';
         } else {
             require WT_THEME_DIR . 'templates/block_main_temp.php';
         }
     } else {
         return $content;
     }
 }
开发者ID:brambravo,项目名称:webtrees,代码行数:86,代码来源:module.php

示例10: modalDialog

        // The third row shows an optional progress bar and a list of maintenance options
        $importing = WT_DB::prepare("SELECT 1 FROM `##gedcom_chunk` WHERE gedcom_id=? AND imported=0 LIMIT 1")->execute(array($tree->tree_id))->fetchOne();
        if ($importing) {
            $in_progress = WT_DB::prepare("SELECT 1 FROM `##gedcom_chunk` WHERE gedcom_id=? AND imported=1 LIMIT 1")->execute(array($tree->tree_id))->fetchOne();
            if (!$in_progress) {
                echo '<div id="import', $tree->tree_id, '"><div id="progressbar', $tree->tree_id, '"><div style="position:absolute;">', WT_I18N::translate('Deleting old genealogy data…'), '</div></div></div>';
                $controller->addInlineJavascript('jQuery("#progressbar' . $tree->tree_id . '").progressbar({value: 0});');
            } else {
                echo '<div id="import', $tree->tree_id, '"></div>';
            }
            $controller->addInlineJavascript('jQuery("#import' . $tree->tree_id . '").load("import.php?gedcom_id=' . $tree->tree_id . '&keep_media' . $tree->tree_id . '=' . WT_Filter::get('keep_media' . $tree->tree_id) . '");');
            echo '<table border="0" width="100%" id="actions', $tree->tree_id, '" style="display:none">';
        } else {
            echo '<table border="0" width="100%" id="actions', $tree->tree_id, '">';
        }
        echo '<tr align="center">', '<td><a href="admin_trees_export.php?ged=', $tree->tree_name_url, '" onclick="return modalDialog(\'admin_trees_export.php?ged=', $tree->tree_name_url, '\', \'', WT_I18N::translate('Export'), '\');">', WT_I18N::translate('Export'), '</a>', help_link('export_gedcom'), '</td>', '<td><a href="', WT_SCRIPT_NAME, '?action=importform&amp;gedcom_id=', $tree->tree_id, '">', WT_I18N::translate('Import'), '</a>', help_link('import_gedcom'), '</td>', '<td><a href="admin_trees_download.php?ged=', $tree->tree_name_url, '">', WT_I18N::translate('Download'), '</a>', help_link('download_gedcom'), '</td>', '<td><a href="', WT_SCRIPT_NAME, '?action=uploadform&amp;gedcom_id=', $tree->tree_id, '">', WT_I18N::translate('Upload'), '</a>', help_link('upload_gedcom'), '</td>', '<td>', '<a href="#" onclick="if (confirm(\'' . WT_Filter::escapeJs(WT_I18N::translate('Are you sure you want to delete “%s”?', $tree->tree_name)), '\')) document.delete_form', $tree->tree_id, '.submit(); return false;">', WT_I18N::translate('Delete'), '</a>', '<form name="delete_form', $tree->tree_id, '" method="post" action="', WT_SCRIPT_NAME, '">', '<input type="hidden" name="action" value="delete">', '<input type="hidden" name="gedcom_id" value="', $tree->tree_id, '">', WT_Filter::getCsrf(), '</form>', '</td></tr></table></td></tr></table><br>';
    }
}
// Options for creating new gedcoms and setting defaults
if (Auth::isAdmin()) {
    echo '<table class="gedcom_table2"><tr>';
    if (count(WT_Tree::GetAll()) > 1) {
        echo '<th>', WT_I18N::translate('Default family tree'), help_link('default_gedcom'), '</th>';
    }
    echo '<th>', WT_I18N::translate('Create a new family tree'), help_link('add_new_gedcom'), '</th></tr><tr>';
    if (count(WT_Tree::GetAll()) > 1) {
        echo '<td><form name="defaultform" method="post" action="', WT_SCRIPT_NAME, '">', '<input type="hidden" name="action" value="setdefault">', WT_Filter::getCsrf(), select_edit_control('default_ged', WT_Tree::getNameList(), '', WT_Site::preference('DEFAULT_GEDCOM'), 'onchange="document.defaultform.submit();"'), '</form></td>';
    }
    echo '<td class="button">', '<form name="createform" method="post" action="', WT_SCRIPT_NAME, '">', WT_Filter::getCsrf(), '<input type="hidden" name="action" value="new_tree">', '<input name="ged_name">', ' <input type="submit" value="', WT_I18N::translate('save'), '">', '</form>', '</td>', '</tr></table><br>';
    // display link to PGV-WT transfer wizard on first visit to this page, before any GEDCOM is loaded
    if (count(WT_Tree::GetAll()) == 0 && count(User::all()) == 1) {
开发者ID:brambravo,项目名称:webtrees,代码行数:31,代码来源:admin_trees_manage.php

示例11: changeCols

						tr.cells[7].childNodes[0].style.background  = '#ffffff';
						tr.cells[12].childNodes[0].style.background = '#ffffff';
					} else {
						// alert(tr.cells[2].childNodes[0].value+" - Not Born Yet");
						tr.cells[2].childNodes[0].style.background  = '#ffaaaa';
						tr.cells[7].childNodes[0].style.background  = '#ffaaaa';
						tr.cells[12].childNodes[0].style.background = '#ffaaaa';
					}

				}
			}
		}
		var cens_ctry_a = document.getElementById('censCtry');
		var cens_ctry = cens_ctry_a.value;
		document.getElementById('Titl').value = '<?php 
echo WT_I18N::translate('Census transcript'), ' - ', WT_Filter::escapeJs($wholename), ' - ', WT_I18N::translate('Household');
?>
';
		var prev = document.getElementById('prevYear');
		prev.value = cenyear;
	}

	// Add or Remove columns ===========================
	function changeCols(cenyear) {
		var cens_ctry = document.getElementById('censCtry').value;

		var cols_0 = document.getElementsByName('col_0');
		var cols_1 = document.getElementsByName('col_1');
		var cols_2 = document.getElementsByName('col_2');
		var cols_3 = document.getElementsByName('col_3');
		var cols_4 = document.getElementsByName('col_4');
开发者ID:brambravo,项目名称:webtrees,代码行数:31,代码来源:census_2_source_input.php

示例12: datatablesI18N

    /**
     * Generate consistent I18N for datatables.js
     *
     * @param array|null $lengths An optional array of page lengths
     *
     * @return string
     */
    public static function datatablesI18N(array $lengths = null)
    {
        if ($lengths === null) {
            $lengths = array(10, 20, 30, 50, 100, -1);
        }
        $length_menu = '';
        foreach ($lengths as $length) {
            $length_menu .= '<option value="' . $length . '">' . ($length == -1 ? self::translate('All') : self::number($length)) . '</option>';
        }
        $length_menu = '<select>' . $length_menu . '</select>';
        $length_menu = self::translate('Display %s', $length_menu);
        // Which symbol is used for separating numbers into groups
        $symbols = Zend_Locale_Data::getList(self::$locale, 'symbols');
        // Which digits are used for numbers
        $digits = Zend_Locale_Data::getContent(self::$locale, 'numberingsystem', self::$numbering_system);
        if ($digits == '0123456789') {
            $callback = '';
        } else {
            $callback = ',
				"infoCallback": function(oSettings, iStart, iEnd, iMax, iTotal, sPre) {
					return sPre
						.replace(/0/g, "' . mb_substr($digits, 0, 1) . '")
						.replace(/1/g, "' . mb_substr($digits, 1, 1) . '")
						.replace(/2/g, "' . mb_substr($digits, 2, 1) . '")
						.replace(/3/g, "' . mb_substr($digits, 3, 1) . '")
						.replace(/4/g, "' . mb_substr($digits, 4, 1) . '")
						.replace(/5/g, "' . mb_substr($digits, 5, 1) . '")
						.replace(/6/g, "' . mb_substr($digits, 6, 1) . '")
						.replace(/7/g, "' . mb_substr($digits, 7, 1) . '")
						.replace(/8/g, "' . mb_substr($digits, 8, 1) . '")
						.replace(/9/g, "' . mb_substr($digits, 9, 1) . '");
				},
				"formatNumber": function(iIn) {
					return String(iIn)
						.replace(/0/g, "' . mb_substr($digits, 0, 1) . '")
						.replace(/1/g, "' . mb_substr($digits, 1, 1) . '")
						.replace(/2/g, "' . mb_substr($digits, 2, 1) . '")
						.replace(/3/g, "' . mb_substr($digits, 3, 1) . '")
						.replace(/4/g, "' . mb_substr($digits, 4, 1) . '")
						.replace(/5/g, "' . mb_substr($digits, 5, 1) . '")
						.replace(/6/g, "' . mb_substr($digits, 6, 1) . '")
						.replace(/7/g, "' . mb_substr($digits, 7, 1) . '")
						.replace(/8/g, "' . mb_substr($digits, 8, 1) . '")
						.replace(/9/g, "' . mb_substr($digits, 9, 1) . '");
				}
			';
        }
        return '"language": {' . ' "paginate": {' . '  "first":    "' . self::translate('first') . '",' . '  "last":     "' . self::translate('last') . '",' . '  "next":     "' . self::translate('next') . '",' . '  "previous": "' . self::translate('previous') . '"' . ' },' . ' "emptyTable":     "' . self::translate('No records to display') . '",' . ' "info":           "' . self::translate('Showing %1$s to %2$s of %3$s', '_START_', '_END_', '_TOTAL_') . '",' . ' "infoEmpty":      "' . self::translate('Showing %1$s to %2$s of %3$s', 0, 0, 0) . '",' . ' "infoFiltered":   "' . self::translate('(filtered from %s total entries)', '_MAX_') . '",' . ' "infoPostfix":    "",' . ' "infoThousands":  "' . $symbols['group'] . '",' . ' "lengthMenu":     "' . WT_Filter::escapeJs($length_menu) . '",' . ' "loadingRecords": "' . self::translate('Loading…') . '",' . ' "processing":     "' . self::translate('Loading…') . '",' . ' "search":         "' . self::translate('Filter') . '",' . ' "url":            "",' . ' "zeroRecords":    "' . self::translate('No records to display') . '"' . '}' . $callback;
    }
开发者ID:sadr110,项目名称:webtrees,代码行数:56,代码来源:I18N.php

示例13: _usersLoggedIn

 static function _usersLoggedIn($type = 'nolist')
 {
     $content = '';
     // List active users
     $NumAnonymous = 0;
     $loggedusers = array();
     foreach (User::allLoggedIn() as $user) {
         if (Auth::isAdmin() || $user->getSetting('visibleonline')) {
             $loggedusers[] = $user;
         } else {
             $NumAnonymous++;
         }
     }
     $LoginUsers = count($loggedusers);
     if ($LoginUsers == 0 && $NumAnonymous == 0) {
         return WT_I18N::translate('No logged-in and no anonymous users');
     }
     if ($NumAnonymous > 0) {
         $content .= '<b>' . WT_I18N::plural('%d anonymous logged-in user', '%d anonymous logged-in users', $NumAnonymous, $NumAnonymous) . '</b>';
     }
     if ($LoginUsers > 0) {
         if ($NumAnonymous) {
             if ($type == 'list') {
                 $content .= "<br><br>";
             } else {
                 $content .= " " . WT_I18N::translate('and') . " ";
             }
         }
         $content .= '<b>' . WT_I18N::plural('%d logged-in user', '%d logged-in users', $LoginUsers, $LoginUsers) . '</b>';
         if ($type == 'list') {
             $content .= '<ul>';
         } else {
             $content .= ': ';
         }
     }
     if (Auth::check()) {
         foreach ($loggedusers as $user) {
             if ($type == 'list') {
                 $content .= "<li>" . WT_Filter::escapeHtml($user->getRealName()) . ' - ' . WT_Filter::escapeHtml($user->getUserName());
             } else {
                 $content .= WT_Filter::escapeHtml($user->getRealName()) . ' - ' . WT_Filter::escapeHtml($user->getUserName());
             }
             if (WT_USER_ID != $user->getUserId() && $user->getSetting('contactmethod') != 'none') {
                 if ($type == 'list') {
                     $content .= '<br><a class="icon-email" href="#" onclick="return message(\'' . $user->getUserId() . '\', \'\', \'' . WT_Filter::escapeJs(get_query_url()) . '\');" title="' . WT_I18N::translate('Send message') . '"></a>';
                 } else {
                     $content .= ' <a class="icon-email" href="#" onclick="return message(\'' . $user->getUserId() . '\', \'\', \'' . WT_Filter::escapeJs(get_query_url()) . '\');" title="' . WT_I18N::translate('Send message') . '"></a>';
                 }
             }
             if ($type == 'list') {
                 $content .= '</li>';
             }
         }
     }
     if ($type == 'list') {
         $content .= '</ul>';
     }
     return $content;
 }
开发者ID:sadr110,项目名称:webtrees,代码行数:59,代码来源:Stats.php

示例14: getEditMenu

 /**
  * get edit menu
  */
 function getEditMenu()
 {
     $SHOW_GEDCOM_RECORD = get_gedcom_setting(WT_GED_ID, 'SHOW_GEDCOM_RECORD');
     if (!$this->record || $this->record->isOld()) {
         return null;
     }
     // edit menu
     $menu = new WT_Menu(WT_I18N::translate('Edit'), '#', 'menu-indi');
     $menu->addLabel($menu->label, 'down');
     // What behaviour shall we give the main menu?  If we leave it blank, the framework
     // will copy the first submenu - which may be edit-raw or delete.
     // As a temporary solution, make it edit the name
     $menu->addOnclick("return false;");
     if (WT_USER_CAN_EDIT) {
         foreach ($this->record->getFacts() as $fact) {
             if ($fact->getTag() == 'NAME' && $fact->canEdit()) {
                 $menu->addOnclick("return edit_name('" . $this->record->getXref() . "', '" . $fact->getFactId() . "');");
             }
             break;
         }
         $submenu = new WT_Menu(WT_I18N::translate('Add a new name'), '#', 'menu-indi-addname');
         $submenu->addOnclick("return add_name('" . $this->record->getXref() . "');");
         $menu->addSubmenu($submenu);
         $has_sex_record = false;
         $submenu = new WT_Menu(WT_I18N::translate('Edit gender'), '#', 'menu-indi-editsex');
         foreach ($this->record->getFacts() as $fact) {
             if ($fact->getTag() == 'SEX' && $fact->canEdit()) {
                 $submenu->addOnclick("return edit_record('" . $this->record->getXref() . "', '" . $fact->getFactId() . "');");
                 $has_sex_record = true;
                 break;
             }
         }
         if (!$has_sex_record) {
             $submenu->addOnclick("return add_new_record('" . $this->record->getXref() . "', 'SEX');");
         }
         $menu->addSubmenu($submenu);
         if (count($this->record->getSpouseFamilies()) > 1) {
             $submenu = new WT_Menu(WT_I18N::translate('Re-order families'), '#', 'menu-indi-orderfam');
             $submenu->addOnclick("return reorder_families('" . $this->record->getXref() . "');");
             $menu->addSubmenu($submenu);
         }
     }
     // delete
     if (WT_USER_CAN_EDIT) {
         $submenu = new WT_Menu(WT_I18N::translate('Delete'), '#', 'menu-indi-del');
         $submenu->addOnclick("return delete_individual('" . WT_I18N::translate('Are you sure you want to delete “%s”?', WT_Filter::escapeJs(strip_tags($this->record->getFullName()))) . "', '" . $this->record->getXref() . "');");
         $menu->addSubmenu($submenu);
     }
     // edit raw
     if (Auth::isAdmin() || WT_USER_CAN_EDIT && $SHOW_GEDCOM_RECORD) {
         $submenu = new WT_Menu(WT_I18N::translate('Edit raw GEDCOM'), '#', 'menu-indi-editraw');
         $submenu->addOnclick("return edit_raw('" . $this->record->getXref() . "');");
         $menu->addSubmenu($submenu);
     }
     // add to favorites
     if (array_key_exists('user_favorites', WT_Module::getActiveModules())) {
         $submenu = new WT_Menu(WT_I18N::translate('Add to favorites'), '#', 'menu-indi-addfav');
         $submenu->addOnclick("jQuery.post('module.php?mod=user_favorites&amp;mod_action=menu-add-favorite',{xref:'" . $this->record->getXref() . "'},function(){location.reload();})");
         $menu->addSubmenu($submenu);
     }
     return $menu;
 }
开发者ID:jacoline,项目名称:webtrees,代码行数:65,代码来源:Individual.php

示例15: user_contact_link

function user_contact_link($user_id)
{
    $user = User::find($user_id);
    if ($user) {
        $method = $user->getSetting('contactmethod');
        switch ($method) {
            case 'none':
                return '';
            case 'mailto':
                return '<a href="mailto:' . WT_Filter::escapeHtml($user->getEmail()) . '">' . WT_Filter::escapeHtml($user->getRealName($user_id)) . '</a>';
            default:
                return "<a href='#' onclick='message(\"" . WT_Filter::escapeJs($user->getUserName()) . "\", \"" . $method . "\", \"" . WT_SERVER_NAME . WT_SCRIPT_PATH . WT_Filter::escapeJs(get_query_url()) . "\", \"\");return false;'>" . WT_Filter::escapeHtml($user->getRealName($user_id)) . '</a>';
        }
    } else {
        return '';
    }
}
开发者ID:brambravo,项目名称:webtrees,代码行数:17,代码来源:functions_print.php


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