*/ class OptionsController extends GalleryController { /** * @see GalleryControler::handleRequest */ function handleRequest($form) { $results = array(); if (isset($form['action']['setOptions'])) { /* No form processing/validation required so just continue the next page */ $results['redirect']['view'] = 'publishxp.UploadItems'; $results['redirect']['stripExtensions'] = isset($form['stripExtensions']); $results['redirect']['setCaptions'] = isset($form['setCaptions']); $results['redirect']['albumId'] = $form['albumId']; } else { $results['delegate']['view'] = 'publishxp.Options'; } $results['status'] = array(); $results['error'] = array(); return array(GalleryStatus::success(), $results); } } /** * View to set options on how photos are uploaded. * * Allows the user to specify options that control how the photos are created * within Gallery. The two options supported are for whether the file extension * should be used in the title and if the captions should be set automatically. * * @version $Id: Options.inc,v 1.4 2005/08/23 03:49:49 mindless Exp $ * @package PublishXp * @author Timothy Webb */ class OptionsView extends GalleryView { /** * @see GalleryView::loadTemplate */ function loadTemplate(&$template, &$form) { global $gallery; if ($form['formName'] != 'Options') { $form['formName'] = 'Options'; list ($form['albumId'], $form['stripExtensions'], $form['setCaptions']) = GalleryUtilities::getRequestVariables('albumId', 'stripExtensions', 'setCaptions'); /* Strip extensions defaults to true, if there was no query parameter for it */ if ($form['stripExtensions'] == null) { $form['stripExtensions'] = true; } if (empty($form['albumId'])) { return array(GalleryStatus::error(ERROR_BAD_PARAMETER, __FILE__, __LINE__), null); } } $template->head('modules/publishxp/templates/Head.tpl'); return array(GalleryStatus::success(), array('body' => 'modules/publishxp/templates/Options.tpl')); } } ?>