本文整理汇总了PHP中Fisharebest\Webtrees\Tree::getNameList方法的典型用法代码示例。如果您正苦于以下问题:PHP Tree::getNameList方法的具体用法?PHP Tree::getNameList怎么用?PHP Tree::getNameList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fisharebest\Webtrees\Tree
的用法示例。
在下文中一共展示了Tree::getNameList方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: config
//.........这里部分代码省略.........
}
</style>
<ol class="breadcrumb small">
<li><a href="admin.php"><?php
echo webtrees\I18N::translate('Control panel');
?>
</a></li>
<li><a href="admin_modules.php"><?php
echo webtrees\I18N::translate('Module administration');
?>
</a></li>
<li class="active"><?php
echo $controller->getPageTitle();
?>
</li>
</ol>
<div class="row">
<div class="col-sm-4 col-xs-12">
<form class="form">
<label for="ged" class="sr-only">
<?php
echo webtrees\I18N::translate('Family tree');
?>
</label>
<input type="hidden" name="mod" value="<?php
echo $this->getName();
?>
">
<input type="hidden" name="mod_action" value="admin_config">
<div class="col-sm-9 col-xs-9" style="padding:0;">
<?php
echo webtrees\Functions\FunctionsEdit::selectEditControl('ged', webtrees\Tree::getNameList(), null, $WT_TREE->getName(), 'class="form-control"');
?>
</div>
<div class="col-sm-3" style="padding:0;">
<input type="submit" class="btn btn-primary" value="<?php
echo webtrees\I18N::translate('show');
?>
">
</div>
</form>
</div>
<span class="visible-xs hidden-sm hidden-md hidden-lg" style="display:block;"></br></br></span>
<div class="col-sm-4 text-center text-left-xs col-xs-12">
<p>
<a href="module.php?mod=<?php
echo $this->getName();
?>
&mod_action=admin_edit" class="btn btn-primary">
<i class="fa fa-plus"></i>
<?php
echo webtrees\I18N::translate('Add Menu');
?>
</a>
</p>
</div>
<div class="col-sm-4 text-right text-left-xs col-xs-12">
<?php
// TODO: Move to internal item/page
if (file_exists(WT_MODULES_DIR . $this->getName() . '/readme.html')) {
?>
<a href="<?php
echo WT_MODULES_DIR . $this->getName();
?>
示例2:
echo I18N::translate('User');
?>
</label>
<?php
echo FunctionsEdit::selectEditControl('user', $users_array, '', $user, 'class="form-control"');
?>
</div>
<div class="form-group col-xs-6 col-md-3">
<label for="gedc">
<?php
echo I18N::translate('Family tree');
?>
</label>
<?php
echo FunctionsEdit::selectEditControl('gedc', Tree::getNameList(), '', $gedc, Auth::isAdmin() ? 'class="form-control"' : 'disabled class="form-control"');
?>
</div>
</div>
<div class="row text-center">
<button type="submit" class="btn btn-primary">
<?php
echo I18N::translate('Filter');
?>
</button>
<button type="submit" class="btn btn-primary" onclick="document.logs.action.value='export';return true;" <?php
echo $action === 'show' ? '' : 'disabled';
?>
>
示例3: adminPlaces
//.........这里部分代码省略.........
<hr>
<form class="form-horizontal" action="?" onsubmit="add_place_location(this.parent_id.options[this.parent_id.selectedIndex].value); return false;">
<div class="form-group">
<label class="form-control-static col-sm-4" for="parent_id">
<?php
echo I18N::translate('Add a new geographic location');
?>
</label>
<div class="col-sm-8">
<div class="col-sm-6">
<?php
echo FunctionsEdit::selectEditControl('parent_id', $where_am_i, I18N::translate('Top level'), $parent, 'class="form-control"');
?>
</div>
<button type="submit" class="btn btn-default">
<i class="fa fa-plus"></i>
<?php
echo I18N::translate('Add');
?>
</button>
</div>
</div>
</form>
<form class="form-horizontal" action="module.php" method="get">
<input type="hidden" name="mod" value="googlemap">
<input type="hidden" name="mod_action" value="admin_places">
<input type="hidden" name="action" value="ImportGedcom">
<div class="form-group">
<label class="form-control-static col-sm-4" for="ged">
<?php
echo I18N::translate('Import all places from a family tree');
?>
</label>
<div class="col-sm-8">
<div class="col-sm-6">
<?php
echo FunctionsEdit::selectEditControl('ged', Tree::getNameList(), null, $WT_TREE->getName(), 'class="form-control"');
?>
</div>
<button type="submit" class="btn btn-default">
<i class="fa fa-upload"></i>
<?php
echo I18N::translate('Import');
?>
</button>
</div>
</div>
</form>
<form class="form-horizontal" action="module.php" method="get">
<input type="hidden" name="mod" value="googlemap">
<input type="hidden" name="mod_action" value="admin_places">
<input type="hidden" name="action" value="ImportFile">
<div class="form-group">
<label class="form-control-static col-sm-4">
<?php
echo I18N::translate('Upload geographic data');
?>
</label>
<div class="col-sm-8">
<div class="col-sm-6">
<button type="submit" class="btn btn-default">
<i class="fa fa-upload"></i>
<?php
echo I18N::translate('Upload');
?>
</button>
</div>
</div>
</div>
</form>
<form class="form-horizontal" action="module.php" method="get">
<input type="hidden" name="mod" value="googlemap">
<input type="hidden" name="mod_action" value="admin_places">
<input type="hidden" name="action" value="ExportFile">
<div class="form-group">
<label class="form-control-static col-sm-4">
<?php
echo I18N::translate('Download geographic data');
?>
</label>
<div class="col-sm-8">
<div class="col-sm-6">
<?php
echo FunctionsEdit::selectEditControl('parent', $where_am_i, I18N::translate('All'), $WT_TREE->getTreeId(), 'class="form-control"');
?>
</div>
<button type="submit" class="btn btn-default">
<i class="fa fa-download"></i>
<?php
echo I18N::translate('Download');
?>
</button>
</div>
</div>
</form>
<?php
}
示例4: foreach
}
}
foreach (Tree::getAll() as $tree) {
if (!in_array($tree->getName(), $basenames)) {
FlashMessages::addMessage(I18N::translate('The family tree “%s” has been deleted.', $tree->getTitleHtml()), 'success');
$tree->delete();
}
}
}
header('Location: ' . WT_BASE_URL . WT_SCRIPT_NAME);
return;
}
$default_tree_title = I18N::translate('My family tree');
$default_tree_name = 'tree';
$default_tree_number = 1;
$existing_trees = Tree::getNameList();
while (array_key_exists($default_tree_name . $default_tree_number, $existing_trees)) {
$default_tree_number++;
}
$default_tree_name .= $default_tree_number;
// Process GET actions
switch (Filter::get('action')) {
case 'importform':
$controller->setPageTitle($WT_TREE->getTitleHtml() . ' — ' . I18N::translate('Import a GEDCOM file'))->pageHeader();
?>
<ol class="breadcrumb small">
<li><a href="admin.php"><?php
echo I18N::translate('Control panel');
?>
</a></li>
<li><a href="admin_trees_manage.php"><?php
示例5: config
/**
* Provide a form to manage the FAQs.
*/
private function config()
{
global $WT_TREE;
$controller = new PageController();
$controller->restrictAccess(Auth::isAdmin())->setPageTitle(I18N::translate('Frequently asked questions'))->pageHeader();
$faqs = Database::prepare("SELECT block_id, block_order, gedcom_id, bs1.setting_value AS header, bs2.setting_value AS faqbody" . " FROM `##block` b" . " JOIN `##block_setting` bs1 USING (block_id)" . " JOIN `##block_setting` bs2 USING (block_id)" . " WHERE module_name = :module_name" . " AND bs1.setting_name = 'header'" . " AND bs2.setting_name = 'faqbody'" . " AND IFNULL(gedcom_id, :tree_id_1) = :tree_id_2" . " ORDER BY block_order")->execute(array('module_name' => $this->getName(), 'tree_id_1' => $WT_TREE->getTreeId(), 'tree_id_2' => $WT_TREE->getTreeId()))->fetchAll();
$min_block_order = Database::prepare("SELECT MIN(block_order) FROM `##block` WHERE module_name = 'faq' AND (gedcom_id = :tree_id OR gedcom_id IS NULL)")->execute(array('tree_id' => $WT_TREE->getTreeId()))->fetchOne();
$max_block_order = Database::prepare("SELECT MAX(block_order) FROM `##block` WHERE module_name = 'faq' AND (gedcom_id = :tree_id OR gedcom_id IS NULL)")->execute(array('tree_id' => $WT_TREE->getTreeId()))->fetchOne();
?>
<ol class="breadcrumb small">
<li><a href="admin.php"><?php
echo I18N::translate('Control panel');
?>
</a></li>
<li><a href="admin_modules.php"><?php
echo I18N::translate('Module administration');
?>
</a></li>
<li class="active"><?php
echo $controller->getPageTitle();
?>
</li>
</ol>
<h2><?php
echo $controller->getPageTitle();
?>
</h2>
<p>
<?php
echo I18N::translate('FAQs are lists of questions and answers, which allow you to explain the site’s rules, policies, and procedures to your visitors. Questions are typically concerned with privacy, copyright, user-accounts, unsuitable content, requirement for source-citations, etc.');
?>
<?php
echo I18N::translate('You may use HTML to format the answer and to add links to other websites.');
?>
</p>
<form class="form form-inline">
<label for="ged" class="sr-only">
<?php
echo I18N::translate('Family tree');
?>
</label>
<input type="hidden" name="mod" value="<?php
echo $this->getName();
?>
">
<input type="hidden" name="mod_action" value="admin_config">
<?php
echo FunctionsEdit::selectEditControl('ged', Tree::getNameList(), null, $WT_TREE->getName(), 'class="form-control"');
?>
<input type="submit" class="btn btn-primary" value="<?php
echo I18N::translate('show');
?>
">
</form>
<p>
<a href="module.php?mod=<?php
echo $this->getName();
?>
&mod_action=admin_edit" class="btn btn-default">
<i class="fa fa-plus"></i>
<?php
echo I18N::translate('Add an FAQ item');
?>
</a>
</p>
<?php
echo '<table class="table table-bordered">';
if (empty($faqs)) {
echo '<tr><td class="error center" colspan="5">', I18N::translate('The FAQ list is empty.'), '</td></tr></table>';
} else {
foreach ($faqs as $faq) {
// NOTE: Print the position of the current item
echo '<tr class="faq_edit_pos"><td>';
echo I18N::translate('#%s', $faq->block_order + 1), ' ';
if ($faq->gedcom_id === null) {
echo I18N::translate('All');
} else {
echo $WT_TREE->getTitleHtml();
}
echo '</td>';
// NOTE: Print the edit options of the current item
echo '<td>';
if ($faq->block_order == $min_block_order) {
echo ' ';
} else {
echo '<a href="module.php?mod=', $this->getName(), '&mod_action=admin_moveup&block_id=', $faq->block_id, '"><i class="fa fa-arrow-up"></i></i> ', I18N::translate('Move up'), '</a>';
}
echo '</td><td>';
if ($faq->block_order == $max_block_order) {
echo ' ';
} else {
echo '<a href="module.php?mod=', $this->getName(), '&mod_action=admin_movedown&block_id=', $faq->block_id, '"><i class="fa fa-arrow-down"></i></i> ', I18N::translate('Move down'), '</a>';
}
echo '</td><td>';
echo '<a href="module.php?mod=', $this->getName(), '&mod_action=admin_edit&block_id=', $faq->block_id, '"><i class="fa fa-pencil"></i> ', I18N::translate('Edit'), '</a>';
//.........这里部分代码省略.........
示例6: main
//.........这里部分代码省略.........
?>
</a></li>
<li><a href="admin_modules.php"><?php
echo I18N::translate('Module administration');
?>
</a></li>
<li class="active"><?php
echo $controller->getPageTitle();
?>
</li>
</ol>
<h2><?php
echo $controller->getPageTitle();
?>
</h2>
<form id="batch_update_form" class="form-horizontal" action="module.php" method="get">
<input type="hidden" name="mod" value="batch_update">
<input type="hidden" name="mod_action" value="admin_batch_update">
<input type="hidden" name="xref" value="' . $this->xref . '">
<input type="hidden" name="action" value=""><?php
// will be set by javascript for next update
?>
<input type="hidden" name="data" value=""><?php
// will be set by javascript for next update
?>
<div class="form-group">
<label class="control-label col-sm-3"><?php
echo I18N::translate('Family tree');
?>
</label>
<div class="col-sm-9">
<?php
echo FunctionsEdit::selectEditControl('ged', Tree::getNameList(), '', $WT_TREE->getName(), 'class="form-control" onchange="reset_reload();"');
?>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3"><?php
echo I18N::translate('Batch update');
?>
</label>
<div class="col-sm-9">
<select class="form-control" name="plugin" onchange="reset_reload();">
<?php
if (!$this->plugin) {
?>
<option value="" selected></option>
<?php
}
?>
<?php
foreach ($this->plugins as $class => $plugin) {
?>
<option value="<?php
echo $class;
?>
" <?php
echo $this->plugin == $class ? 'selected' : '';
?>
><?php
echo $plugin->getName();
?>
</option>
<?php
}
示例7: config
/**
* The admin view - list, create, edit, delete stories.
*/
private function config()
{
global $WT_TREE;
$controller = new PageController();
$controller->restrictAccess(Auth::isAdmin())->setPageTitle($this->getTitle())->pageHeader()->addExternalJavascript(WT_JQUERY_DATATABLES_JS_URL)->addExternalJavascript(WT_DATATABLES_BOOTSTRAP_JS_URL)->addInlineJavascript('
jQuery("#story_table").dataTable({
' . I18N::datatablesI18N() . ',
autoWidth: false,
paging: true,
pagingType: "full_numbers",
lengthChange: true,
filter: true,
info: true,
sorting: [[0,"asc"]],
columns: [
/* 0-name */ null,
/* 1-NAME */ null,
/* 2-NAME */ { sortable:false },
/* 3-NAME */ { sortable:false }
]
});
');
$stories = Database::prepare("SELECT block_id, xref" . " FROM `##block` b" . " WHERE module_name=?" . " AND gedcom_id=?" . " ORDER BY xref")->execute(array($this->getName(), $WT_TREE->getTreeId()))->fetchAll();
?>
<ol class="breadcrumb small">
<li><a href="admin.php"><?php
echo I18N::translate('Control panel');
?>
</a></li>
<li><a href="admin_modules.php"><?php
echo I18N::translate('Module administration');
?>
</a></li>
<li class="active"><?php
echo $controller->getPageTitle();
?>
</li>
</ol>
<h1><?php
echo $controller->getPageTitle();
?>
</h1>
<form class="form form-inline">
<label for="ged" class="sr-only">
<?php
echo I18N::translate('Family tree');
?>
</label>
<input type="hidden" name="mod" value="<?php
echo $this->getName();
?>
">
<input type="hidden" name="mod_action" value="admin_config">
<?php
echo FunctionsEdit::selectEditControl('ged', Tree::getNameList(), null, $WT_TREE->getName(), 'class="form-control"');
?>
<input type="submit" class="btn btn-primary" value="<?php
echo I18N::translate('show');
?>
">
</form>
<p>
<a href="module.php?mod=<?php
echo $this->getName();
?>
&mod_action=admin_edit" class="btn btn-default">
<i class="fa fa-plus"></i>
<?php
echo I18N::translate('Add a story');
?>
</a>
</p>
<table class="table table-bordered table-condensed">
<thead>
<tr>
<th><?php
echo I18N::translate('Story title');
?>
</th>
<th><?php
echo I18N::translate('Individual');
?>
</th>
<th><?php
echo I18N::translate('Edit');
?>
</th>
<th><?php
echo I18N::translate('Delete');
?>
</th>
</tr>
</thead>
//.........这里部分代码省略.........
示例8: main
/**
* Main entry point
*
* @return string
*/
private function main()
{
global $WT_TREE;
$this->plugins = $this->getPluginList();
// List of available plugins
$this->plugin = Filter::get('plugin');
// User parameters
$this->xref = Filter::get('xref', WT_REGEX_XREF);
$this->action = Filter::get('action');
$this->data = Filter::get('data');
// Don't do any processing until a plugin is chosen.
if ($this->plugin && array_key_exists($this->plugin, $this->plugins)) {
$this->PLUGIN = new $this->plugin();
$this->PLUGIN->getOptions();
$this->getAllXrefs();
switch ($this->action) {
case 'update':
$record = self::getLatestRecord($this->xref, $this->all_xrefs[$this->xref]);
if ($this->PLUGIN->doesRecordNeedUpdate($this->xref, $record)) {
$newrecord = $this->PLUGIN->updateRecord($this->xref, $record);
if ($newrecord != $record) {
if ($newrecord) {
GedcomRecord::getInstance($this->xref, $WT_TREE)->updateRecord($newrecord, $this->PLUGIN->chan);
} else {
GedcomRecord::getInstance($this->xref, $WT_TREE)->deleteRecord();
}
}
}
$this->xref = $this->findNextXref($this->xref);
break;
case 'update_all':
foreach ($this->all_xrefs as $xref => $type) {
$record = self::getLatestRecord($xref, $type);
if ($this->PLUGIN->doesRecordNeedUpdate($xref, $record)) {
$newrecord = $this->PLUGIN->updateRecord($xref, $record);
if ($newrecord != $record) {
if ($newrecord) {
GedcomRecord::getInstance($this->xref, $WT_TREE)->updateRecord($newrecord, $this->PLUGIN->chan);
} else {
GedcomRecord::getInstance($this->xref, $WT_TREE)->deleteRecord();
}
}
}
}
$this->xref = '';
break;
}
// Make sure that our requested record really does need updating.
// It may have been updated in another session, or may not have
// been specified at all.
if (array_key_exists($this->xref, $this->all_xrefs) && $this->PLUGIN->doesRecordNeedUpdate($this->xref, self::getLatestRecord($this->xref, $this->all_xrefs[$this->xref]))) {
$this->curr_xref = $this->xref;
}
// The requested record doesn't need updating - find one that does
if (!$this->curr_xref) {
$this->curr_xref = $this->findNextXref($this->xref);
}
if (!$this->curr_xref) {
$this->curr_xref = $this->findPrevXref($this->xref);
}
// If we've found a record to update, get details and look for the next/prev
if ($this->curr_xref) {
$this->prev_xref = $this->findPrevXref($this->curr_xref);
$this->next_xref = $this->findNextXref($this->curr_xref);
}
}
// HTML common to all pages
$html = $this->getJavascript() . '<form id="batch_update_form" action="module.php" method="get">' . '<input type="hidden" name="mod" value="batch_update">' . '<input type="hidden" name="mod_action" value="admin_batch_update">' . '<input type="hidden" name="xref" value="' . $this->xref . '">' . '<input type="hidden" name="action" value="">' . '<input type="hidden" name="data" value="">' . '<table id="batch_update"><tr>' . '<th>' . I18N::translate('Family tree') . '</th>' . '<td>' . FunctionsEdit::selectEditControl('ged', Tree::getNameList(), '', $WT_TREE->getName(), 'onchange="reset_reload();"') . '</td></tr><tr><th>' . I18N::translate('Batch update') . '</th><td><select name="plugin" onchange="reset_reload();">';
if (!$this->plugin) {
$html .= '<option value="" selected></option>';
}
foreach ($this->plugins as $class => $plugin) {
$html .= '<option value="' . $class . '" ' . ($this->plugin == $class ? 'selected' : '') . '>' . $plugin->getName() . '</option>';
}
$html .= '</select>';
if ($this->PLUGIN) {
$html .= '<br><em>' . $this->PLUGIN->getDescription() . '</em>';
}
$html .= '</td></tr>';
if (!Auth::user()->getPreference('auto_accept')) {
$html .= '<tr><td colspan="2" class="warning">' . I18N::translate('Your user account does not have “automatically approve changes” enabled. You will only be able to change one record at a time.') . '</td></tr>';
}
// If a plugin is selected, display the details
if ($this->PLUGIN) {
$html .= $this->PLUGIN->getOptionsForm();
if (substr($this->action, -4) == '_all') {
// Reset - otherwise we might "undo all changes", which refreshes the
// page, which makes them all again!
$html .= '<script>reset_reload();</script>';
} else {
if ($this->curr_xref) {
// Create an object, so we can get the latest version of the name.
$this->record = GedcomRecord::getInstance($this->curr_xref, $WT_TREE);
$html .= '</table><table id="batch_update2"><tr><td>' . self::createSubmitButton(I18N::translate('previous'), $this->prev_xref) . self::createSubmitButton(I18N::translate('next'), $this->next_xref) . '</td><th><a href="' . $this->record->getHtmlUrl() . '">' . $this->record->getFullName() . '</a>' . '</th>' . '</tr><tr><td valign="top">' . '<br>' . implode('<br>', $this->PLUGIN->getActionButtons($this->curr_xref, $this->record)) . '<br>' . '</td><td dir="ltr" align="left">' . $this->PLUGIN->getActionPreview($this->record) . '</td></tr>';
} else {
//.........这里部分代码省略.........