本文整理汇总了PHP中Themes::validate_theme方法的典型用法代码示例。如果您正苦于以下问题:PHP Themes::validate_theme方法的具体用法?PHP Themes::validate_theme怎么用?PHP Themes::validate_theme使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Themes
的用法示例。
在下文中一共展示了Themes::validate_theme方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preview_theme
/**
* Sets a theme to be the current user's preview theme
*
* @param string $theme_name The name of the theme to preview
* @param string $theme_dir The directory of the theme to preview
*/
public static function preview_theme($theme_name, $theme_dir)
{
$ok = Themes::validate_theme($theme_dir);
if ($ok) {
$_SESSION['user_theme_name'] = $theme_name;
$_SESSION['user_theme_dir'] = $theme_dir;
// Execute the theme's activated action
$preview_theme = Themes::create();
Plugins::act_id('theme_activated', $preview_theme->plugin_id(), $theme_name, $preview_theme);
EventLog::log(_t('Previewed Theme: %s', array($theme_name)), 'notice', 'theme', 'habari');
}
return $ok;
}