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?

Login or register to post comments
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

Login or register to post comments
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.

Login or register to post comments