use different themes for viewers and admin?

adriand

Joined: 2005-07-16
Posts: 14
Posted: Fri, 2006-01-20 02:42

I am specifically trying to embed my gallery (2) into Joomla. I like the siriux theme for the front end (viewers), but its back-end display is really ugly (I like the standard matrix look the best). Is there a way to have one side use one theme, while the back-end uses another? Thanks.

edit: i would also like a way to have nice, clean urls, but ULR rewrite messes up my joomla (images don't appear). is there a way to turn it on for direct access to the gallery and have it off for access through the cms?

 
rgoth

Joined: 2006-02-20
Posts: 7
Posted: Tue, 2007-02-13 17:39

I have been looking forever for this answer...

open

gallery2\modules\core\classes\helpers\ GalleryItemHelper_simple.class

Look for this line in “function fetchThemeId($item)”
**********************************************************************
return array(GalleryStatus::success(), $themeId);
**********************************************************************
it is at the very end of the function right before the closing “}”

CHANGE TO
**********************************************************************
/* If user is admin use Matrix theme else use default Theme */
$ret = GalleryCoreApi::assertUserIsSiteAdministrator();
if ($ret->isError()) {
return array(GalleryStatus::success(), $themeId);
}

return array(GalleryStatus::success(), 'matrix');
**********************************************************************

your end code looks like this

**********************************************************************

function fetchThemeId($item) {
global $gallery;

/* Find the right theme for this item */
if (GalleryUtilities::isA($item, 'GalleryAlbumItem')) {
$themeId = $item->getTheme();
} else {
list ($ret, $parent) = GalleryCoreApi::loadEntitiesById($item->getParentId());
if ($ret->isError()) {
return array($ret->wrap(__FILE__, __LINE__), null);
}

$themeId = $parent->getTheme();
}

if (empty($themeId)) {
list ($ret, $themeId) =
GalleryCoreApi::getPluginParameter('module', 'core', 'default.theme');
if ($ret->isError()) {
return array($ret->wrap(__FILE__, __LINE__), null);
}
}

/* No default? We're screwed */
if (empty($themeId)) {
return array(GalleryStatus::error(ERROR_BAD_PARAMETER, __FILE__, __LINE__), null);
}

/* Make sure we have adequate permissions */
$ret = GalleryCoreApi::assertUserIsSiteAdministrator();
if ($ret->isError()) {
return array(GalleryStatus::success(), $themeId);
}

return array(GalleryStatus::success(), 'matrix');
}
*********************************************************************************

You can change “matrix” for the any theme you would like. Just use all lower case. Oh yeah this works with Gallerry 2.02 I assume it works with all other versions as well.

As to your second question I have no idea... good luck

 
marshull

Joined: 2006-07-13
Posts: 32
Posted: Thu, 2008-02-28 02:41

Can anyone tell me how to make this work in 2.2.4? I have been messing around with this and cant seem to get it to work. Would really like to get this to work since i have messed with the template so much to get it to look right in Joomla, that it looks like ass when accessed directly.

 
finofontana

Joined: 2008-01-12
Posts: 5
Posted: Sat, 2008-11-15 13:13

I am aware this is an old thread, but I cannot find an answer to a question which is related to this post.
The solution described by rgoth has the following impications:
The user pages render in 'theme'. When logged in as admin, the admin pages render in 'matrix'. But when logged in a admin an browsing the user pages, these pages are also rendered in 'matrix'. That is because you then browse user pages as admin. The solution does not check what pages you browse; it checks whether you admin or not (assertUserIsSiteAdministrator). So to view the user pages with 'theme', you have to log out.
I would like to see a solution which discriminates on the type of pages you're browsing: user pages or (site) admin pages. Then I will not be forced to log out everytime I want to check the layout of the user pages.
Can anyone please help?