zoukankan      html  css  js  c++  java
  • [Drupal] Using the admin theme when you deleting a node.

    As we know that, in Drupal, it does not separate the front-end and back-end. Though we can set the back-end theme, but some time, it still displays the front-end theme, for example, when deleting a node, it will display the front-end theme but not the back-end theme you wish to, here is a way to build a very simple module to do it.

    About the .info, please search the details in drupal.org, here i only provide the code of .module.

    Let say the module "my_admin_node" is what we will build. Here is the codes of my_admin_node.module

    代码
    /**
     * Implementation of hook_init().
     
    */
    function my_admin_node_init() {
      
    // Use the administrative theme
      $arg_2 = arg(2);
      
    if (
        
    $arg_2 == 'delete'
        
    || $arg_2 == 'revisions'
        
    || (arg(0== 'user' && !empty($arg_2))
      ) {
        
    global $custom_theme;
        
    $custom_theme = variable_get('admin_theme', '0');
        drupal_add_css(drupal_get_path(
    'module', 'system'.'/admin.css', 'module');
      }
    }

    yeah, you can see that is just a very simple module with a very simple way to do that,  and with this info, i hope you can build your own complex module. :)

    Have fun with Drupal! 

  • 相关阅读:
    spring获取webapplicationcontext,applicationcontext几种方法详解(转)
    spring注入是否会被回收
    think in java 手记(一)
    spring 注解实例
    navicat远程连接oracle
    tomcat监听activemq jms配置
    HDU 1160:FatMouse's Speed
    YTU 2457: 很简单的一道题
    YTU 2456: 评委打分
    YTU 2455: Pefect 数字
  • 原文地址:https://www.cnblogs.com/davidhhuan/p/1938522.html
Copyright © 2011-2022 走看看