is_admin()) { return; } global $template, $page; $url_root = get_root_url(); $tpl_vars = array( 'U_SITE_ADMIN' => $url_root . 'admin.php?page=', 'MULTIVIEW' => $MultiView->get_data(), 'U_SELF' => $MultiView->get_clean_url(true), ); // TODO : param to allow owner modification if (script_basename() == 'picture') { global $picture; $url_self = duplicate_picture_url(); $tpl_vars['IS_PICTURE'] = true; $template->clear_assign(array( 'U_SET_AS_REPRESENTATIVE', 'U_PHOTO_ADMIN', 'U_CADDIE', )); if (isset($page['category'])) { $tpl_vars['U_SET_REPRESENTATIVE'] = add_url_params( $url_self, array('action'=>'set_as_representative') ); $tpl_vars['CATEGORY_ID'] = $page['category']['id']; } $tpl_vars['U_EDIT'] = $url_root . 'admin.php?page=photo-' . $page['image_id'] .(isset($page['category']) ? '&cat_id=' . $page['category']['id'] : ''); $tpl_vars['U_CADDIE'] = add_url_params( $url_self, array('action'=>'add_to_caddie') ); } else if (@$page['section'] = 'categories' and isset($page['category'])) { $url_self = duplicate_index_url(); $tpl_vars['IS_CATEGORY'] = true; $tpl_vars['CATEGORY_ID'] = $page['category']['id']; $template->clear_assign(array( 'U_EDIT', 'U_CADDIE', )); $tpl_vars['U_EDIT'] = $url_root . 'admin.php?page=album-' . $page['category']['id']; if (!empty($page['items'])) { $tpl_vars['U_CADDIE'] = add_url_params( $url_self, array('caddie'=>1) ); } } // get users $query = ' SELECT '.$conf['user_fields']['id'].' AS id, '.$conf['user_fields']['username'].' AS username FROM '.USERS_TABLE.' ORDER BY CONVERT('.$conf['user_fields']['username'].', CHAR) ;'; $tpl_vars['USERS'] = simple_hash_from_query($query, 'id', 'username'); // get themes include_once(PHPWG_ROOT_PATH.'admin/include/themes.class.php'); $themes = new themes(); foreach (array_keys($themes->fs_themes) as $theme) { $tpl_vars['THEMES'][$theme] = $theme; } // get languages foreach (get_languages() as $code => $name) { $tpl_vars['LANGS'][$code] = $name; } $template->assign(array( 'ADMINTOOLS_PATH' => ADMINTOOLS_PATH, 'ato' => $tpl_vars, )); $template->set_filename('ato', realpath(ADMINTOOLS_PATH . 'template/public_controller.tpl')); $template->parse('ato'); }