PHP Drupal删除特定内容类型的特定选项卡
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP Drupal删除特定内容类型的特定选项卡相关的知识,希望对你有一定的参考价值。
/*
*Removes Tabs From Specific Content types.
*/
<?php
function phptemplate_preprocess_page(&$variables, $hook) {
$nid = str_replace('page-node-','',$variables['template_files'][1]);
$node = node_load($nid);
if($node->type == 'project') {
theme_removetab(t('Edit'), $variables);
theme_removetab(t('View'), $variables);
theme_removetab(t('Outline'), $variables);
}
}
function theme_removetab($label, &$vars) {
$tabs = explode("\n", $vars['tabs']);
$vars['tabs'] = '';
foreach($tabs as $tab) {
if(strpos($tab, '>' . $label . '<') === FALSE) {
$vars['tabs'] .= $tab . "\n";
}
}
}
?>
以上是关于PHP Drupal删除特定内容类型的特定选项卡的主要内容,如果未能解决你的问题,请参考以下文章