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


PHP Theme::themeNames方法代码示例

本文整理汇总了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'));
        ?>
开发者ID:tronsmit,项目名称:webtrees,代码行数:31,代码来源:admin_users.php

示例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 
    }
    ?>
开发者ID:pal-saugstad,项目名称:webtrees,代码行数:31,代码来源:edituser.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 -->
开发者ID:AlexSnet,项目名称:webtrees,代码行数:31,代码来源:admin_site_config.php

示例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;
}
开发者ID:josefpavlik,项目名称:webtrees,代码行数:31,代码来源:action.php

示例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 -->
开发者ID:tronsmit,项目名称:webtrees,代码行数:31,代码来源:admin_trees_config.php

示例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'))) {
开发者ID:tunandras,项目名称:webtrees,代码行数:31,代码来源:session.php


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