pw_all_categories = 1; $me->pw_categories = array(); $save_config = true; } else { if (isset($_POST['pw_categories'])) { if (count($_POST['pw_categories'])==1 && ($_POST['pw_categories'][0]=='__none__')) { $page['errors'][] = l10n('You must choose at least one category'); $me->pw_categories = array(); $save_config = true; } else { $page['infos'][] = l10n('You choose that mode for').' '. l10n_dec('one category', 'severals categories', count($_POST['pw_categories']) ); $me->pw_all_categories = 0; $me->pw_categories = $_POST['pw_categories']; $save_config = true; } } else { $page['errors'][] = l10n('You must choose at least one category'); } } } if (!empty($_POST['pw_width']) && intval($_POST['pw_width'])!=$me->pw_width) { $me->pw_width = intval($_POST['pw_width']); $page['infos'][] = l10n('Width has been updated'); $save_config = true; } if (!empty($_POST['pw_height']) && intval($_POST['pw_height'])!=$me->pw_height) { $me->pw_height = intval($_POST['pw_height']); $page['infos'][] = l10n('Height has been updated'); $save_config = true; } if (!empty($_POST['pw_bgcolor']) && trim($_POST['pw_bgcolor'])!=$me->pw_bgcolor) { $me->pw_bgcolor = $_POST['pw_bgcolor']; $page['infos'][] = l10n('Background color of animation has been updated'); $save_config = true; } if ($save_config) { $me->save_config(); } } $query = ' SELECT id,name,global_rank,uppercats FROM '.CATEGORIES_TABLE; display_select_cat_wrapper($query, $me->pw_categories, 'all_categories'); $template->set_filenames(array('plugin_admin_content' => PW_TEMPLATE . '/admin.tpl')); $template->assign('PW_CAT_CHOICES', array(1 => l10n('Yes'), 0 => l10n('No'))); $template->assign('PW_ALL_CATEGORIES', $me->pw_all_categories); $template->assign('PWG_PHOTO_WIDGET_PLUGIN_CSS', PW_CSS); $template->assign('PWG_PHOTO_WIDGET_PLUGIN_JS', PW_JS); $template->assign('PW_BGCOLOR', $me->pw_bgcolor); $template->assign('PW_WIDTH', $me->pw_width); $template->assign('PW_HEIGHT', $me->pw_height); $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');