本文整理汇总了PHP中Fisharebest\Webtrees\Theme::themeNames方法的典型用法代码示例。如果您正苦于以下问题:PHP Theme::themeNames方法的具体用法?PHP Theme::themeNames怎么用?PHP Theme::themeNames使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fisharebest\Webtrees\Theme
的用法示例。
在下文中一共展示了Theme::themeNames方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
echo I18N::translate('Site members can send each other messages. You can choose to how these messages are sent to you, or choose not receive them at all.');
?>
</p>
</div>
</div>
<!-- THEME -->
<div class="form-group">
<label class="control-label col-sm-3" for="theme">
<?php
echo I18N::translate('Theme');
?>
</label>
<div class="col-sm-9">
<?php
echo FunctionsEdit::selectEditControl('theme', Theme::themeNames(), I18N::translate('<default theme>'), $user->getPreference('theme'), 'class="form-control"');
?>
</div>
</div>
<!-- COMMENTS -->
<div class="form-group">
<label class="control-label col-sm-3" for="comment">
<?php
echo I18N::translate('Administrator comments on user');
?>
</label>
<div class="col-sm-9">
<textarea class="form-control" id="comment" name="comment" rows="5" maxlength="255"><?php
echo Filter::escapeHtml($user->getPreference('comment'));
?>
示例2: foreach
<div class="label">
<label for="form_theme">
<?php
echo I18N::translate('Theme');
?>
</label>
</div>
<div class="value">
<select id="form_theme" name="form_theme">
<option value="">
<?php
echo Filter::escapeHtml(I18N::translate('<default theme>'));
?>
</option>
<?php
foreach (Theme::themeNames() as $theme_id => $theme_name) {
?>
<option value="<?php
echo $theme_id;
?>
" <?php
echo $theme_id === Auth::user()->getPreference('theme') ? 'selected' : '';
?>
>
<?php
echo $theme_name;
?>
</option>
<?php
}
?>
示例3:
echo I18N::translate('The time zone is required for date calculations, such as knowing today’s date.');
?>
</p>
</div>
</div>
<!-- THEME_DIR -->
<div class="form-group">
<label for="THEME_DIR" class="col-sm-3 control-label">
<?php
echo I18N::translate('Default theme');
?>
</label>
<div class="col-sm-9">
<?php
echo FunctionsEdit::selectEditControl('THEME_DIR', Theme::themeNames(), null, Site::getPreference('THEME_DIR'), 'class="form-control"');
?>
<p class="small text-muted">
<?php
echo I18N::translate('You can change the appearance of webtrees using “themes”. Each theme has a different style, layout, color scheme, etc.');
?>
</p>
<p class="small text-muted">
<?php
echo I18N::translate('Themes can be selected at three levels: user, family tree, and website. User settings take priority over family tree settings, which in turn take priority over the website setting. Selecting “default theme” at one level will use the theme at the next level.');
?>
</p>
</div>
</div>
<!-- ALLOW_USER_THEMES -->
示例4:
}
}
}
}
} else {
http_response_code(406);
}
break;
case 'reject-changes':
// Reject all the pending changes for a record
$record = GedcomRecord::getInstance(Filter::post('xref', WT_REGEX_XREF), $WT_TREE);
if ($record && $record->canEdit() && Auth::isModerator($record->getTree())) {
FlashMessages::addMessage(I18N::translate('The changes to “%s” have been rejected.', $record->getFullName()));
FunctionsImport::rejectAllChanges($record);
} else {
http_response_code(406);
}
break;
case 'theme':
// Change the current theme
$theme = Filter::post('theme');
if (Site::getPreference('ALLOW_USER_THEMES') && array_key_exists($theme, Theme::themeNames())) {
Session::put('theme_id', $theme);
// Remember our selection
Auth::user()->setPreference('theme', $theme);
} else {
// Request for a non-existant theme.
http_response_code(406);
}
break;
}
示例5:
echo I18N::translate('The theme menu will only be shown if the website preferences allow users to select their own theme.');
?>
</p>
</div>
</fieldset>
<!-- THEME_DIR -->
<div class="form-group">
<label class="control-label col-sm-3" for="THEME_DIR">
<?php
echo I18N::translate('Default theme');
?>
</label>
<div class="col-sm-9">
<?php
echo FunctionsEdit::selectEditControl('THEME_DIR', Theme::themeNames(), I18N::translate('<default theme>'), $WT_TREE->getPreference('THEME_DIR'), 'class="form-control"');
?>
<p class="small text-muted">
<?php
echo I18N::translate('You can change the appearance of webtrees using “themes”. Each theme has a different style, layout, color scheme, etc.');
?>
</p>
</div>
</div>
<h3><?php
echo I18N::translate('Media folders');
?>
</h3>
<!-- MEDIA_DIRECTORY -->
示例6: AdministrationTheme
if (substr(WT_SCRIPT_NAME, 0, 5) === 'admin' || WT_SCRIPT_NAME === 'module.php' && substr(Filter::get('mod_action'), 0, 5) === 'admin') {
// Administration scripts begin with “admin” and use a special administration theme
Theme::theme(new AdministrationTheme())->init($WT_TREE);
} else {
// Last theme used?
$theme_id = Session::get('theme_id');
// Default for tree
if (!array_key_exists($theme_id, Theme::themeNames()) && $WT_TREE) {
$theme_id = $WT_TREE->getPreference('THEME_DIR');
}
// Default for site
if (!array_key_exists($theme_id, Theme::themeNames())) {
$theme_id = Site::getPreference('THEME_DIR');
}
// Default
if (!array_key_exists($theme_id, Theme::themeNames())) {
$theme_id = 'webtrees';
}
foreach (Theme::installedThemes() as $theme) {
if ($theme->themeId() === $theme_id) {
Theme::theme($theme)->init($WT_TREE);
// Remember this setting
if (Site::getPreference('ALLOW_USER_THEMES')) {
Session::put('theme_id', $theme_id);
}
break;
}
}
}
// Search engines are only allowed to see certain pages.
if (Auth::isSearchEngine() && !in_array(WT_SCRIPT_NAME, array('index.php', 'indilist.php', 'module.php', 'mediafirewall.php', 'individual.php', 'family.php', 'mediaviewer.php', 'note.php', 'repo.php', 'source.php'))) {