Jump to content

Admin themes - default/ custom/ uninstall


kixe
 Share

Recommended Posts

Remove of field admin_theme didn't work after uninstall of last custom AdminTheme.

I tried to call the uninstall() function of AdminTheme.php by adding a function in MyCustomAdminTheme.module. This function should remove the field from the templates and delete the field. But this didn't work. Whats wrong?

public function ___uninstall() {
		parent::___uninstall();
}

notice
Most of the existing third party AdminThemes don't call the uninstall routine.

While Playing around with the themes I uninstalled default theme in Modules to get the basic default admin theme (wire/templates-admin)
Couldn't see the content under Modules Tab. Worked after updating wire/templates-admin/scripts/main.js.

Link to comment
Share on other sites

@kongondo
you are right. I found only 2 Admin themes based on module. :P

Something is buggy in the uninstall method. Made some changes. Works now ...
 

//in: site/modules/AdminThemeCustom.module and: wire/modules/AdminTheme/AdminThemeDefault

    public static function getModuleInfo() {
        return array(
           //something else
          'autoload' => 'template=admin',
          'singular' => true
          );
    }

//in wire/core/AdminTheme.php

      public function ___uninstall() {

      //must be 2 not 1 because there are 2 themes before uninstallation
      if(self::$numAdminThemes > 2) return;

      //add this line which allows also to uninstall default Admin Theme, fallback to wire/template-admin/
      if(!$this->wire('fields')->get('admin_theme')) return;
      ......

No need to call uninstall() from custom module.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...