Skip to content

Commit

Permalink
bug:2848
Browse files Browse the repository at this point in the history
added two options for the slideshow

ToDo lang var

git-svn-id: http://piwigo.org/svn/trunk@23718 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
flop25 committed Jun 30, 2013
1 parent 19ae5b7 commit 18cfd1b
Show file tree
Hide file tree
Showing 9 changed files with 740 additions and 9 deletions.
29 changes: 29 additions & 0 deletions themes/smartpocket/admin/admin.inc.php
@@ -0,0 +1,29 @@
<?php

// Need upgrade?
global $conf;
include(PHPWG_THEMES_PATH.'smartpocket/admin/upgrade.inc.php');

load_language('theme.lang', PHPWG_THEMES_PATH.'smartpocket/');

$config_send= array();

if(isset($_POST['submit_smartpocket']))
{
$config_send['loop']=(isset($_POST['loop']) and $_POST['loop']=="false") ? false : true;
$config_send['autohide']=(isset($_POST['autohide']) and $_POST['autohide']=="0") ? 0 : 5000;

$conf['smartpocket'] = serialize($config_send);
conf_update_param('smartpocket', pwg_db_real_escape_string($conf['smartpocket']));

array_push($page['infos'], l10n('Information data registered in database'));
}

$template->set_filenames(array(
'theme_admin_content' => dirname(__FILE__) . '/admin.tpl'));

$template->assign('options', unserialize($conf['smartpocket']));

$template->assign_var_from_handle('ADMIN_CONTENT', 'theme_admin_content');

?>
35 changes: 35 additions & 0 deletions themes/smartpocket/admin/admin.tpl
@@ -0,0 +1,35 @@
{combine_css path="themes/default/js/ui/theme/jquery.ui.button.css"}
{combine_css path="themes/smartpocket/admin/jquery.ui.button.css"}
{footer_script require='jquery.ui.button'}
{literal}
jQuery(document).ready(function(){
jQuery( ".radio" ).buttonset();
});
{/literal}
{/footer_script}

<div class="titrePage">
<h2>{'Smartpocket, Configuration Page'|@translate}</h2>
</div>
<form method="post" class="properties" action="" ENCTYPE="multipart/form-data" name="form" class="properties">
<div id="configContent">
<fieldset>
<legend>{'Slideshow Options'|@translate}</legend>
<ul>
<li class="radio" >
<label for="loop"><span class="property">{'Loop the slideshow'|@translate}</span>&nbsp;</label>
<input type="radio" id="loop_true" name="loop" value="true" {if $options.loop}checked="checked"{/if}><label for="loop_true">{'Yes'|@translate}</label>
<input type="radio" id="loop_false" name="loop" value="false" {if !$options.loop}checked="checked"{/if}><label for="loop_false">{'No'|@translate}</label>
</li>
<li class="radio" >
<label for="autohide"><span class="property">{'Autohide the bar of the slideshow'|@translate}</span>&nbsp;</label>
<input type="radio" id="autohide_on" name="autohide" value="5000" {if $options.autohide==5000}checked="checked"{/if}><label for="autohide_on">{'Yes'|@translate}</label>
<input type="radio" id="autohide_off" name="autohide" value="0" {if $options.autohide==0}checked="checked"{/if}><label for="autohide_off">{'No'|@translate}</label>
</li>
</ul>
</fieldset>
</div>
<p>
<input class="submit" type="submit" value="{'Submit'|@translate}" name="submit_smartpocket" />
</p>
</form>
30 changes: 30 additions & 0 deletions themes/smartpocket/admin/index.php
@@ -0,0 +1,30 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based picture gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+

// Recursive call
$url = '../';
header( 'Request-URI: '.$url );
header( 'Content-Location: '.$url );
header( 'Location: '.$url );
exit();
?>

0 comments on commit 18cfd1b

Please sign in to comment.