本文整理匯總了PHP中Fisharebest\Webtrees\Filter::escapeJs方法的典型用法代碼示例。如果您正苦於以下問題:PHP Filter::escapeJs方法的具體用法?PHP Filter::escapeJs怎麽用?PHP Filter::escapeJs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Fisharebest\Webtrees\Filter
的用法示例。
在下文中一共展示了Filter::escapeJs方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getEditMenu
/**
* get edit menu
*/
public function getEditMenu()
{
if (!$this->record || $this->record->isPendingDeletion()) {
return null;
}
// edit menu
$menu = new Menu(I18N::translate('Edit'), '#', 'menu-sour');
if (Auth::isEditor($this->record->getTree())) {
$fact = $this->record->getFirstFact('TITL');
if ($fact) {
// Edit existing name
$menu->addSubmenu(new Menu(I18N::translate('Edit the source'), '#', 'menu-sour-edit', array('onclick' => 'return edit_record("' . $this->record->getXref() . '", "' . $fact->getFactId() . '");')));
} else {
// Add new name
$menu->addSubmenu(new Menu(I18N::translate('Edit the source'), '#', 'menu-sour-edit', array('onclick' => 'return add_fact("' . $this->record->getXref() . '", "TITL");')));
}
// delete
$menu->addSubmenu(new Menu(I18N::translate('Delete'), '#', 'menu-sour-del', array('onclick' => "return delete_record('" . I18N::translate('Are you sure you want to delete “%s”?', Filter::escapeJs(Filter::unescapeHtml($this->record->getFullName()))) . "', '" . $this->record->getXref() . "');")));
}
// edit raw
if (Auth::isAdmin() || Auth::isEditor($this->record->getTree()) && $this->record->getTree()->getPreference('SHOW_GEDCOM_RECORD')) {
$menu->addSubmenu(new Menu(I18N::translate('Edit the raw GEDCOM'), '#', 'menu-sour-editraw', array('onclick' => 'return edit_raw("' . $this->record->getXref() . '");')));
}
return $menu;
}
示例2: getEditMenu
/**
* get edit menu
*/
public function getEditMenu()
{
if (!$this->record || $this->record->isPendingDeletion()) {
return null;
}
// edit menu
$menu = new Menu(I18N::translate('Edit'), '#', 'menu-obje');
if (Auth::isEditor($this->record->getTree())) {
$menu->addSubmenu(new Menu(I18N::translate('Edit the media object'), '#', 'menu-obje-edit', array('onclick' => 'window.open("addmedia.php?action=editmedia&pid=' . $this->record->getXref() . '", "_blank", edit_window_specs)')));
// main link displayed on page
if (Module::getModuleByName('GEDFact_assistant')) {
$menu->addSubmenu(new Menu(I18N::translate('Manage the links'), '#', 'menu-obje-link', array('onclick' => 'return ilinkitem("' . $this->record->getXref() . '","manage");')));
} else {
$menu->addSubmenu(new Menu(I18N::translate('Link this media object to an individual'), '#', 'menu-obje-link-indi', array('onclick' => 'return ilinkitem("' . $this->record->getXref() . '","person");')));
$menu->addSubmenu(new Menu(I18N::translate('Link this media object to a family'), '#', 'menu-obje-link-fam', array('onclick' => 'return ilinkitem("' . $this->record->getXref() . '","family");')));
$menu->addSubmenu(new Menu(I18N::translate('Link this media object to a source'), '#', 'menu-obje-link-sour', array('onclick' => 'return ilinkitem("' . $this->record->getXref() . '","source");')));
}
// delete
$menu->addSubmenu(new Menu(I18N::translate('Delete'), '#', 'menu-obje-del', array('onclick' => 'return delete_record("' . I18N::translate('Are you sure you want to delete “%s”?', Filter::escapeJs(Filter::unescapeHtml($this->record->getFullName()))) . '", "' . $this->record->getXref() . '");')));
}
// edit raw
if (Auth::isAdmin() || Auth::isEditor($this->record->getTree()) && $this->record->getTree()->getPreference('SHOW_GEDCOM_RECORD')) {
$menu->addSubmenu(new Menu(I18N::translate('Edit the raw GEDCOM'), '#', 'menu-obje-editraw', array('onclick' => 'return edit_raw("' . $this->record->getXref() . '");')));
}
return $menu;
}
示例3: getEditMenu
/**
* get edit menu
*/
public function getEditMenu()
{
if (!$this->record || $this->record->isPendingDeletion()) {
return null;
}
// edit menu
$menu = new Menu(I18N::translate('Edit'), '#', 'menu-note');
if (Auth::isEditor($this->record->getTree())) {
$menu->addSubmenu(new Menu(I18N::translate('Edit note'), '#', 'menu-note-edit', array('onclick' => 'return edit_note("' . $this->record->getXref() . '");')));
}
// delete
if (Auth::isEditor($this->record->getTree())) {
$menu->addSubmenu(new Menu(I18N::translate('Delete'), '#', 'menu-note-del', array('onclick' => 'return delete_record("' . I18N::translate('Are you sure you want to delete “%s”?', Filter::escapeJs(Filter::unescapeHtml($this->record->getFullName()))) . '", "' . $this->record->getXref() . '");')));
}
// add to favorites
if (Module::getModuleByName('user_favorites')) {
$menu->addSubmenu(new Menu(I18N::translate('Add to favorites'), '#', 'menu-note-addfav', array('onclick' => 'jQuery.post("module.php?mod=user_favorites&mod_action=menu-add-favorite",{xref:"' . $this->record->getXref() . '"},function(){location.reload();})')));
}
// Get the link for the first submenu and set it as the link for the main menu
if ($menu->getSubmenus()) {
$submenus = $menu->getSubmenus();
$menu->setLink($submenus[0]->getLink());
$menu->setAttrs($submenus[0]->getAttrs());
}
return $menu;
}
示例4: getEditMenu
/**
* get edit menu
*/
public function getEditMenu()
{
if (!$this->record || $this->record->isPendingDeletion()) {
return null;
}
// edit menu
$menu = new Menu(I18N::translate('Edit'), '#', 'menu-repo');
if (Auth::isEditor($this->record->getTree())) {
$fact = $this->record->getFirstFact('NAME');
if ($fact) {
// Edit existing name
$menu->addSubmenu(new Menu(I18N::translate('Edit the repository'), '#', 'menu-repo-edit', array('onclick' => 'return edit_record("' . $this->record->getXref() . '", "' . $fact->getFactId() . '");')));
} else {
// Add new name
$menu->addSubmenu(new Menu(I18N::translate('Edit the repository'), '#', 'menu-repo-edit', array('onclick' => 'return add_fact("' . $this->record->getXref() . '", "NAME");')));
}
}
// delete
if (Auth::isEditor($this->record->getTree())) {
$menu->addSubmenu(new Menu(I18N::translate('Delete'), '#', 'menu-repo-del', array('onclick' => 'return delete_record("' . I18N::translate('Are you sure you want to delete “%s”?', Filter::escapeJs(Filter::unescapeHtml($this->record->getFullName()))) . '", "' . $this->record->getXref() . '");')));
}
// edit raw
if (Auth::isAdmin() || Auth::isEditor($this->record->getTree()) && $this->record->getTree()->getPreference('SHOW_GEDCOM_RECORD')) {
$menu->addSubmenu(new Menu(I18N::translate('Edit the raw GEDCOM'), '#', 'menu-repo-editraw', array('onclick' => 'return edit_raw("' . $this->record->getXref() . '");')));
}
// add to favorites
if (Module::getModuleByName('user_favorites')) {
$menu->addSubmenu(new Menu(I18N::translate('Add to favorites'), '#', 'menu-repo-addfav', array('onclick' => 'jQuery.post("module.php?mod=user_favorites&mod_action=menu-add-favorite" ,{xref:"' . $this->record->getXref() . '"},function(){location.reload();})')));
}
return $menu;
}
示例5: getEditMenu
/**
* get edit menu
*/
public function getEditMenu()
{
if (!$this->record || $this->record->isPendingDeletion()) {
return null;
}
// edit menu
$menu = new Menu(I18N::translate('Edit'), '#', 'menu-note');
if (Auth::isEditor($this->record->getTree())) {
$menu->addSubmenu(new Menu(I18N::translate('Edit the note'), '#', 'menu-note-edit', array('onclick' => 'return edit_note("' . $this->record->getXref() . '");')));
// delete
$menu->addSubmenu(new Menu(I18N::translate('Delete'), '#', 'menu-note-del', array('onclick' => 'return delete_record("' . I18N::translate('Are you sure you want to delete “%s”?', Filter::escapeJs(Filter::unescapeHtml($this->record->getFullName()))) . '", "' . $this->record->getXref() . '");')));
}
return $menu;
}
示例6: getEditMenu
/**
* get edit menu
*/
public function getEditMenu()
{
if (!$this->record || $this->record->isPendingDeletion()) {
return null;
}
// edit menu
$menu = new Menu(I18N::translate('Edit'), '#', 'menu-obje');
if (Auth::isEditor($this->record->getTree())) {
$menu->addSubmenu(new Menu(I18N::translate('Edit media object'), '#', 'menu-obje-edit', array('onclick' => 'window.open("addmedia.php?action=editmedia&pid=' . $this->record->getXref() . '", "_blank", edit_window_specs)')));
// main link displayed on page
if (Module::getModuleByName('GEDFact_assistant')) {
$menu->addSubmenu(new Menu(I18N::translate('Manage links'), '#', 'menu-obje-link', array('onclick' => 'return ilinkitem("' . $this->record->getXref() . '","manage");')));
} else {
$menu->addSubmenu(new Menu(I18N::translate('Link this media object to an individual'), '#', 'menu-obje-link-indi', array('onclick' => 'return ilinkitem("' . $this->record->getXref() . '","person");')));
$menu->addSubmenu(new Menu(I18N::translate('Link this media object to a family'), '#', 'menu-obje-link-fam', array('onclick' => 'return ilinkitem("' . $this->record->getXref() . '","family");')));
$menu->addSubmenu(new Menu(I18N::translate('Link this media object to a source'), '#', 'menu-obje-link-sour', array('onclick' => 'return ilinkitem("' . $this->record->getXref() . '","source");')));
}
}
// delete
if (Auth::isEditor($this->record->getTree())) {
$menu->addSubmenu(new Menu(I18N::translate('Delete'), '#', 'menu-obje-del', array('onclick' => 'return delete_record("' . I18N::translate('Are you sure you want to delete “%s”?', Filter::escapeJs(Filter::unescapeHtml($this->record->getFullName()))) . '", "' . $this->record->getXref() . '");')));
}
// edit raw
if (Auth::isAdmin() || Auth::isEditor($this->record->getTree()) && $this->record->getTree()->getPreference('SHOW_GEDCOM_RECORD')) {
$menu->addSubmenu(new Menu(I18N::translate('Edit raw GEDCOM'), '#', 'menu-obje-editraw', array('onclick' => 'return edit_raw("' . $this->record->getXref() . '");')));
}
// add to favorites
if (Module::getModuleByName('user_favorites')) {
$menu->addSubmenu(new Menu(I18N::translate('Add to favorites'), '#', 'menu-obje-addfav', array('onclick' => 'jQuery.post("module.php?mod=user_favorites&mod_action=menu-add-favorite",{xref:"' . $this->record->getXref() . '"},function(){location.reload();})')));
}
// Get the link for the first submenu and set it as the link for the main menu
if ($menu->getSubmenus()) {
$submenus = $menu->getSubmenus();
$menu->setLink($submenus[0]->getLink());
$menu->setAttrs($submenus[0]->getAttrs());
}
return $menu;
}
示例7: getEditMenu
/**
* get edit menu
*/
public function getEditMenu()
{
if (!$this->record || $this->record->isPendingDeletion()) {
return null;
}
// edit menu
$menu = new Menu(I18N::translate('Edit'), '#', 'menu-sour');
if (Auth::isEditor($this->record->getTree())) {
$fact = $this->record->getFirstFact('TITL');
if ($fact) {
// Edit existing name
$menu->addSubmenu(new Menu(I18N::translate('Edit source'), '#', 'menu-sour-edit', array('onclick' => 'return edit_record("' . $this->record->getXref() . '", "' . $fact->getFactId() . '");')));
} else {
// Add new name
$menu->addSubmenu(new Menu(I18N::translate('Edit source'), '#', 'menu-sour-edit', array('onclick' => 'return add_fact("' . $this->record->getXref() . '", "TITL");')));
}
}
// delete
if (Auth::isEditor($this->record->getTree())) {
$menu->addSubmenu(new Menu(I18N::translate('Delete'), '#', 'menu-sour-del', array('onclick' => "return delete_record('" . I18N::translate('Are you sure you want to delete “%s”?', Filter::escapeJs(Filter::unescapeHtml($this->record->getFullName()))) . "', '" . $this->record->getXref() . "');")));
}
// edit raw
if (Auth::isAdmin() || Auth::isEditor($this->record->getTree()) && $this->record->getTree()->getPreference('SHOW_GEDCOM_RECORD')) {
$menu->addSubmenu(new Menu(I18N::translate('Edit raw GEDCOM'), '#', 'menu-sour-editraw', array('onclick' => 'return edit_raw("' . $this->record->getXref() . '");')));
}
// add to favorites
if (Module::getModuleByName('user_favorites')) {
$menu->addSubmenu(new Menu(I18N::translate('Add to favorites'), '#', 'menu-sour-addfav', array('onlick' => 'jQuery.post("module.php?mod=user_favorites&mod_action=menu-add-favorite",{xref:"' . $this->record->getXref() . '"},function(){location.reload();})')));
}
// Get the link for the first submenu and set it as the link for the main menu
if ($menu->getSubmenus()) {
$submenus = $menu->getSubmenus();
$menu->setLink($submenus[0]->getLink());
$menu->setAttrs($submenus[0]->getAttrs());
}
return $menu;
}
示例8: print_navigator_family
/**
* Display family members with clickable links
*
* @param Family $family
* @param Individual $individual
*/
function print_navigator_family(Family $family, Individual $individual)
{
foreach ($family->getSpouses() as $spouse) {
?>
<tr class="fact_value">
<td class="facts_value">
<a href="edit_interface.php?action=addmedia_links&noteid=newnote&pid=<?php
echo $spouse->getXref();
?>
&gedcom=<?php
echo $spouse->getTree()->getNameUrl();
?>
">
<i class="headimg vmiddle icon-button_head"></i>
</a>
</td>
<td class="facts_value" >
<a href="#" onclick="opener.insertRowToTable('<?php
echo $spouse->getXref();
?>
', '<?php
echo Filter::escapeJs($spouse->getFullName());
?>
', '', '', '', '', '', '', '', '');">
<?php
echo $spouse === $individual ? '<b>' : '';
?>
<?php
echo $spouse->getFullName();
?>
<?php
echo $spouse->getLifeSpan();
?>
<?php
echo $spouse === $individual ? '</b>' : '';
?>
</a>
</td>
<tr>
<?php
}
foreach ($family->getChildren() as $child) {
?>
<tr>
<td class="facts_value" >
<a href="edit_interface.php?action=addmedia_links&noteid=newnote&pid=<?php
echo $child->getXref();
?>
&gedcom=<?php
echo $child->getTree()->getNameUrl();
?>
">
<i class="headimg vmiddle icon-button_head"></i>
</a>
</td>
<td class="facts_value">
<a href="#" onclick="opener.insertRowToTable('<?php
echo $child->getXref();
?>
', '<?php
echo Filter::escapeJs($child->getFullName());
?>
', '', '', '', '', '', '', '', '');">
<?php
echo $child === $individual ? '<b>' : '';
?>
<?php
echo $child->getFullName();
?>
<?php
echo $child->getLifeSpan();
?>
<?php
echo $child === $individual ? '</b>' : '';
?>
</a>
</td>
</tr>
<?php
}
}
示例9: index
/**
* SosaList@index
*/
public function index()
{
global $WT_TREE;
$controller = new PageController();
$controller->setPageTitle(I18N::translate('Sosa Ancestors'));
$this->view_bag->set('title', $controller->getPageTitle());
if ($this->view_bag->get('is_setup', false)) {
$this->view_bag->set('has_sosa', $this->generation > 0 && $this->sosa_provider->getSosaCountAtGeneration($this->generation) > 0);
$this->view_bag->set('url_module', $this->module->getName());
$this->view_bag->set('url_action', 'SosaList');
$this->view_bag->set('url_ged', $WT_TREE->getNameUrl());
$this->view_bag->set('min_gen', 1);
if ($this->view_bag->get('has_sosa', false)) {
$controller->addInlineJavascript('
jQuery("#sosalist-tabs").tabs();
jQuery("#sosalist-tabs").css("visibility", "visible");
jQuery.get(
"module.php",
{
"mod" : "' . $this->module->getName() . '",
"mod_action": "SosaList@sosalist",
"ged" : "' . $WT_TREE->getNameUrl() . '",
"type" : "indi",
"gen" : "' . $this->generation . '"
},
"html"
).success(
function(data){
if(data){
jQuery("#sosalist-indi-data").html(data);
/* datatablesosaindi(); */
}
jQuery("#loading-indi").hide();
}
).error(
function(){
jQuery("#sosalist-indi-data").html("' . Filter::escapeJs('<p class="warning">' . I18N::translate('An error occurred while retrieving data...') . '</p>') . '");
jQuery("#loading-indi").hide();
}
);
jQuery.get(
"module.php",
{
"mod" : "' . $this->module->getName() . '",
"mod_action": "SosaList@sosalist",
"ged" : "' . $WT_TREE->getNameUrl() . '",
"type" : "fam",
"gen" : "' . $this->generation . '"
},
"html"
).success(
function(data){
if(data){
jQuery("#sosalist-fam-data").html(data);
}
jQuery("#loading-fam").hide();
}
).error(
function(){
jQuery("#sosalist-fam-data").html("' . Filter::escapeJs('<p class="warning">' . I18N::translate('An error occurred while retrieving data...') . '</p>') . '");
jQuery("#loading-fam").hide();
}
);
');
}
}
ViewFactory::make('SosaList', $this, $controller, $this->view_bag)->render();
}
示例10: confirm
</a>
<form name="delete_form<?php
echo $tree->getTreeId();
?>
" method="post">
<input type="hidden" name="action" value="delete">
<input type="hidden" name="gedcom_id" value="<?php
echo $tree->getTreeId();
?>
">
<?php
echo Filter::getCsrf();
?>
<!-- A11Y - forms need submit buttons, but they look ugly here -->
<button class="sr-only" onclick="return confirm('<?php
echo I18N::translate('Are you sure you want to delete “%s”?', Filter::escapeJs($tree->getTitle()));
?>
')" type="submit">
<?php
echo I18N::translate('Delete');
?>
</button>
</form>
</li>
<!-- SET AS DEFAULT -->
<?php
if (count(Tree::getAll()) > 1) {
?>
<li>
<i class="fa fa-li fa-star"></i>
<?php
示例11: censusNavigatorFamily
/**
* Create a family on the census navigator.
*
* @param CensusInterface $census
* @param Family $family
* @param Individual $head
*
* @return string
*/
public static function censusNavigatorFamily(CensusInterface $census, Family $family, Individual $head)
{
$headImg2 = '<i class="icon-button_head" title="' . I18N::translate('Head of household') . '"></i>';
foreach ($family->getSpouses() as $spouse) {
$menu = new Menu(Functions::getCloseRelationshipName($head, $spouse));
foreach ($spouse->getChildFamilies() as $grandparents) {
foreach ($grandparents->getSpouses() as $grandparent) {
$submenu = new Menu(Functions::getCloseRelationshipName($head, $grandparent) . ' - ' . $grandparent->getFullName(), '#', '', array('onclick' => 'return appendCensusRow("' . Filter::escapeJs(self::censusTableRow($census, $grandparent, $head)) . '");'));
$submenu->addClass('submenuitem', '');
$menu->addSubmenu($submenu);
$menu->addClass('', 'submenu');
}
}
?>
<tr>
<td class="optionbox">
<?php
echo $menu->getMenu();
?>
</td>
<td class="facts_value nowrap">
<a href="#" onclick="return appendCensusRow('<?php
echo Filter::escapeJs(self::censusTableRow($census, $spouse, $head));
?>
');">
<?php
echo $spouse->getFullName();
?>
</a>
</td>
<td class="facts_value">
<?php
if ($head !== $spouse) {
?>
<a href="edit_interface.php?action=addnewnote_assisted&noteid=newnote&xref=<?php
echo $spouse->getXref();
?>
&gedcom=<?php
echo $spouse->getTree()->getNameUrl();
?>
&census=<?php
echo get_class($census);
?>
">
<?php
echo $headImg2;
?>
</a>
<?php
}
?>
</td>
</tr>
<?php
}
foreach ($family->getChildren() as $child) {
$menu = new Menu(Functions::getCloseRelationshipName($head, $child));
foreach ($child->getSpouseFamilies() as $spouse_family) {
foreach ($spouse_family->getSpouses() as $spouse_family_spouse) {
if ($spouse_family_spouse != $child) {
$submenu = new Menu(Functions::getCloseRelationshipName($head, $spouse_family_spouse) . ' - ' . $spouse_family_spouse->getFullName(), '#', '', array('onclick' => 'return appendCensusRow("' . Filter::escapeJs(self::censusTableRow($census, $spouse_family_spouse, $head)) . '");'));
$submenu->addClass('submenuitem', '');
$menu->addSubmenu($submenu);
$menu->addClass('', 'submenu');
}
}
foreach ($spouse_family->getChildren() as $spouse_family_child) {
$submenu = new Menu(Functions::getCloseRelationshipName($head, $spouse_family_child) . ' - ' . $spouse_family_child->getFullName(), '#', '', array('onclick' => 'return appendCensusRow("' . Filter::escapeJs(self::censusTableRow($census, $spouse_family_child, $head)) . '");'));
$submenu->addClass('submenuitem', '');
$menu->addSubmenu($submenu);
$menu->addClass('', 'submenu');
}
}
?>
<tr>
<td class="optionbox">
<?php
echo $menu->getMenu();
?>
</td>
<td class="facts_value">
<a href="#" onclick="return appendCensusRow('<?php
echo Filter::escapeJs(self::censusTableRow($census, $child, $head));
?>
');">
<?php
echo $child->getFullName();
?>
</a>
</td>
<td class="facts_value">
//.........這裏部分代碼省略.........
示例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);
$digits = self::$locale->digits('0123456789');
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": "",' . ' "lengthMenu": "' . 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;
}
示例13: header
header('Location: ' . WT_BASE_URL . WT_SCRIPT_NAME);
break;
default:
$controller->setPageTitle(I18N::translate('User administration'))->addExternalJavascript(WT_JQUERY_DATATABLES_JS_URL)->addExternalJavascript(WT_DATATABLES_BOOTSTRAP_JS_URL)->addInlineJavascript('
jQuery(".table-user-list").dataTable({
' . I18N::datatablesI18N() . ',
stateSave: true,
stateDuration: 300,
processing: true,
serverSide: true,
ajax: {
"url": "' . WT_SCRIPT_NAME . '?action=load_json",
"type": "POST"
},
search: {
search: "' . Filter::escapeJs(Filter::get('filter')) . '"
},
autoWidth: false,
pageLength: ' . Auth::user()->getPreference('admin_users_page_size', 10) . ',
sorting: [[2, "asc"]],
columns: [
/* details */ { sortable: false },
/* user-id */ { visible: false },
/* user_name */ null,
/* real_name */ null,
/* email */ null,
/* language */ null,
/* registered (sort) */ { visible: false },
/* registered */ { dataSort: 7 },
/* last_login (sort) */ { visible: false },
/* last_login */ { dataSort: 9 },
示例14:
?>
<p class="small text-muted">
<?php
echo I18N::translate('This checkbox controls your visibility to other users while you’re online. It also controls your ability to see other online users who are configured to be visible.<br><br>When this box is unchecked, you will be completely invisible to others, and you will also not be able to see other online users. When this box is checked, exactly the opposite is true. You will be visible to others, and you will also be able to see others who are configured to be visible.');
?>
</p>
</div>
</div>
<div id="edituser_submit">
<input type="submit" value="<?php
echo I18N::translate('save');
?>
">
</div>
<?php
if (!Auth::user()->getPreference('canadmin')) {
?>
<a href="#" onclick="if (confirm('<?php
echo I18N::translate('Are you sure you want to delete “%s”?', Filter::escapeJs(Auth::user()->getUserName()));
?>
')) {jQuery('#form_action').val('delete'); document.editform.submit(); }">
<?php
echo I18N::translate('Delete your account');
?>
</a>
<?php
}
?>
</form>
</div>
<?php
示例15: array
}
echo '</div>';
}
// Output Sources
if ($type == "source") {
echo '<div id="find-output">';
if ($filter) {
$mysourcelist = FunctionsDb::searchSources($filter_array, array($WT_TREE));
} else {
$mysourcelist = FunctionsDb::getSourceList($WT_TREE);
}
if ($mysourcelist) {
usort($mysourcelist, '\\Fisharebest\\Webtrees\\GedcomRecord::compare');
echo '<ul>';
foreach ($mysourcelist as $source) {
echo '<li><a href="', $source->getHtmlUrl(), '" onclick="pasteid(\'', $source->getXref(), '\', \'', Filter::escapeJs($source->getFullName()), '\');"><span class="list_item">', $source->getFullName(), '</span></a></li>';
}
echo '</ul>
<p>', I18N::translate('Total sources: %s', count($mysourcelist)), '</p>';
} else {
echo '<p>', 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 (SpecialChars::create($language_filter)->upper() as $special_character) {
echo '<a class="largechars" href="#" onclick="return window.opener.paste_char(\'', $special_character, '\');">', $special_character, '</a> ';
}