$name) { $img = PHPWG_THEMES_PATH.$id.'/screenshot.png'; if (file_exists($img)) { $theme = array( 'id' => $id, 'name' => $name, 'url' => add_url_params( duplicate_index_url(), array('theme'=>$id) ), 'img' => $img, ); if ($id==$user['theme']) { $template->assign('theme_switch_active', $theme); } $template->append('theme_switch', $theme); } } $template->assign('THEME_SWITCH_PATH', THEME_SWITCH_PATH); $template->set_filename('theme_thumb', dirname(__FILE__) . '/thumb.tpl'); $template->concat('PLUGIN_INDEX_ACTIONS', $template->parse('theme_thumb', true)); $template->clear_assign('theme_thumb'); } function theme_controler_select() { global $user, $template; foreach (get_pwg_themes() as $id => $name) { $template->append('theme_switch', array( 'id' => $id, 'name' => $name, 'url' => add_url_params( duplicate_index_url(), array('theme'=>$id) ), 'select' => ($id==$user['theme']) ? 'selected="selected"' : null, )); } $template->set_filename('theme_select', dirname(__FILE__) . '/select.tpl'); $template->concat('PLUGIN_INDEX_ACTIONS', $template->parse('theme_select', true)); $template->clear_assign('theme_select'); } ?>