コード例 #1
0
ファイル: admin_users.php プロジェクト: tronsmit/webtrees
        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
0
ファイル: edituser.php プロジェクト: pal-saugstad/webtrees
			<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
0
    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
0
ファイル: action.php プロジェクト: josefpavlik/webtrees
                        }
                    }
                }
            }
        } 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
0
    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
0
ファイル: session.php プロジェクト: tunandras/webtrees
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'))) {