Index: /extensions/AdminTools/include/events.inc.php =================================================================== --- /extensions/AdminTools/include/events.inc.php (revision 25628) +++ /extensions/AdminTools/include/events.inc.php (revision 25629) @@ -11,5 +11,5 @@ } - global $template, $page; + global $template, $page, $user; $url_root = get_root_url(); @@ -20,4 +20,5 @@ 'U_SELF' => $MultiView->get_clean_url(true), 'USER' => $MultiView->get_user(), + 'CURRENT_USERNAME' => $user['id']==$conf['guest_id'] ? l10n('guest') : $user['username'], ); @@ -37,11 +38,21 @@ )); + $query = 'SELECT element_id FROM ' . CADDIE_TABLE . ' + WHERE element_id = ' . $page['image_id'] .';'; + $tpl_vars['IS_IN_CADDIE'] = pwg_db_num_rows(pwg_query($query)) > 0; + if (isset($page['category'])) { + $tpl_vars['CATEGORY_ID'] = $page['category']['id']; + $tpl_vars['U_SET_REPRESENTATIVE'] = add_url_params( $url_self, array('action'=>'set_as_representative') ); - $tpl_vars['CATEGORY_ID'] = $page['category']['id']; + + $query = 'SELECT id FROM ' . CATEGORIES_TABLE.' + WHERE id = ' . $page['category']['id'] .' + AND representative_picture_id = ' . $page['image_id'] .';'; + $tpl_vars['IS_REPRESENTATIVE'] = pwg_db_num_rows(pwg_query($query)) > 0; } Index: /extensions/AdminTools/template/public_controller.tpl =================================================================== --- /extensions/AdminTools/template/public_controller.tpl (revision 25628) +++ /extensions/AdminTools/template/public_controller.tpl (revision 25629) @@ -2,8 +2,4 @@ {combine_css path='admin/themes/default/fontello/css/fontello.css'} {combine_css path=$ADMINTOOLS_PATH|cat:'template/fontello/css/fontello-ato.css'} - -{capture assign=users_options} {html_options options=$ato.USERS selected=$ato.MULTIVIEW.view_as}{/capture} -{capture assign=themes_options}{html_options options=$ato.THEMES selected=$ato.MULTIVIEW.theme}{/capture} -{capture assign=langs_options} {html_options options=$ato.LANGS selected=$ato.MULTIVIEW.lang}{/capture}
@@ -14,5 +10,5 @@