PHP Drupal:强制管理主题在其他非管理路径上

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP Drupal:强制管理主题在其他非管理路径上相关的知识,希望对你有一定的参考价值。

<?php

/**
 * In this example, it uses the administration theme on "node creation", "node edition",
 * "user registration", "user profile" and "forgot password" pages.
 */

function MODULENAME_init(){

	// The list of paths on which to use the administration theme
	$patterns = array(
		'user',
		'user/*',
		'user/password',
		'user/*/edit',
		'user/*/geodata',
		'node/add/*',
		'node/*/edit',
		'node/*/delete'
	);

	$path = drupal_get_path_alias($_GET['q']);

	$use_admin_theme = false;
	foreach ($patterns as $pattern){
		if (drupal_match_path($path, $pattern)){
			$use_admin_theme = true;
			break;
		}
	}

	if ($use_admin_theme){
		global $custom_theme;
		$custom_theme = variable_get('admin_theme', '0');
		drupal_add_css(drupal_get_path('module', 'system') .'/admin.css', 'module');	
	}
}

?>

以上是关于PHP Drupal:强制管理主题在其他非管理路径上的主要内容,如果未能解决你的问题,请参考以下文章

如何将自己做好的网站用drupal来进行内容管理

Drupal:如何实现权限少于正常和自己的主题的 SECOND 管理员?

XF 2.0 管理面板路径更改

任何节点的 Drupal 主题模板文件

允许非站点管理员通过管理员菜单访问清除缓存,Drupal 6

如何在不同的 Drupal 主题上显示不同的视图