I'm a programmer, but new to Drupal module's programming. I only need to write a module that changes theme based upon content access of each page in the website. I'll try to explain, although my English level is not as good as I wanted.
I have 4 user types (roles), i.e.: anonymous, registered, type1 and type2, where anoymous is the same as registered, except for the fact that anonymous can't write comments, but both can access the same nodes. Type1 users can access nodes that anonymous/registered user can't. And Type2 users can access nodes that even Type1 users can't. Only admin can view more pages than Type2 users.
I wan't to use three different themes, depending on the access level of the page being shown: if only Type2 users (the least restricted ones) can view it, Theme1; if Type1 or Type2 users can view it, Theme2; and Theme3 else. Note that I don't need to know if ACTUAL logged user can acces the ACTUAL page, but which roles can access the actual page.
Note that I say page instead of node, because I suppose (but don't actually know) that not every URL in Drupal is showing a node. If I'm in a mistake, you can read node where I've written page. ;-)
I pretend to write a hook_init() procedure that calls init_theme() depending on these calculations I have told you about.
What functions do I have to use? Would you be so kind as to help me, please?
Comments
Comment #1
good_man commentedThis is way beyond Content Access scope, you need to this on theme level, using subtheme to provide various themes to users, and controlling the theme from theme settings.