23
23
* @package GalleryCore
24
24
* @subpackage UserInterface
25
25
* @author Bharat Mediratta <bharat@menalto.com>
26
* @version $Revision: 15513 $
26
* @version $Revision: 16471 $
28
28
class ItemEditTheme extends ItemEditPlugin {
126
126
* @see ItemEditPlugin::loadTemplate
128
128
function loadTemplate(&$template, &$form, $item, $thumbnail) {
129
$themeId = $item->getTheme();
129
$themeId = $themeSettingsThemeId = $item->getTheme();
130
if (empty($themeSettingsThemeId)) {
131
list ($ret, $themeSettingsThemeId) =
132
GalleryCoreApi::getPluginParameter('module', 'core', 'default.theme');
134
return array($ret, null, null);
131
$ret = GalleryCoreApi::loadThemeSettingsForm($themeId, $item->getId(), $template, $form);
133
if ($ret->getErrorCode() & ERROR_BAD_PARAMETER) {
135
* This theme could be invalid, which can happen after an upgrade. Swallow the
136
* error for now so that the user can get to the administration form and pick a
139
* @todo Log this error when we have a logging system.
138
list ($ret, $theme) =
139
GalleryCoreApi::loadPlugin('theme', $themeSettingsThemeId, false, true);
141
$ret = GalleryCoreApi::loadThemeSettingsForm(
142
$themeSettingsThemeId, $item->getId(), $template, $form);
142
144
return array($ret, null, null);
146
} else if ($ret->getErrorCode() & (ERROR_BAD_PARAMETER | ERROR_PLUGIN_VERSION_MISMATCH)) {
147
/* Ignore incompatible / missing themes. Just show a warning. */
149
return array($ret, null, null);
146
152
if ($form['formName'] != 'ItemEditTheme') {
167
list ($ret, $tmp) = GalleryCoreApi::loadPlugin('theme', $id);
173
list ($ret, $tmp) = GalleryCoreApi::loadPlugin('theme', $id, false, true);
169
return array($ret, null, null);
176
if ($ret->getErrorCode() & (ERROR_BAD_PARAMETER | ERROR_PLUGIN_VERSION_MISMATCH)) {
177
/* Ignore incompatible themes (but don't list them either) */
180
return array($ret, null, null);
171
182
$themeList[$id] = $tmp->translate($tmp->getName());