diff options
Diffstat (limited to 'themes/smartpocket/admin')
-rw-r--r-- | themes/smartpocket/admin/admin.inc.php | 29 | ||||
-rw-r--r-- | themes/smartpocket/admin/admin.tpl | 47 | ||||
-rw-r--r-- | themes/smartpocket/admin/index.php | 30 | ||||
-rw-r--r-- | themes/smartpocket/admin/maintain.inc.php | 45 | ||||
-rw-r--r-- | themes/smartpocket/admin/upgrade.inc.php | 29 |
5 files changed, 180 insertions, 0 deletions
diff --git a/themes/smartpocket/admin/admin.inc.php b/themes/smartpocket/admin/admin.inc.php new file mode 100644 index 000000000..a5a9300c4 --- /dev/null +++ b/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']); + $config_send['autohide'] = (isset($_POST['autohide']) ? 5000 : 0); + + $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'); + +?>
\ No newline at end of file diff --git a/themes/smartpocket/admin/admin.tpl b/themes/smartpocket/admin/admin.tpl new file mode 100644 index 000000000..baf6d47fe --- /dev/null +++ b/themes/smartpocket/admin/admin.tpl @@ -0,0 +1,47 @@ +{html_style} +.graphicalCheckbox { + font-size:16px; + line-height:16px; +} + +input[type=checkbox] { + display:none; +} +{/html_style} + +{footer_script}{literal} +jQuery(document).ready(function() { + jQuery('form li label input[type=checkbox]').change(function() { + jQuery(this).prev().toggleClass('icon-check icon-check-empty'); + }); +}); +{/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><label> + <span class="property">{'Loop the slideshow'|@translate}</span> + <span class="graphicalCheckbox icon-check{if not $options.loop}-empty{/if}"> </span> + <input type="checkbox" name="loop"{if $options.loop} checked="checked"{/if}> + </label></li> + + <li><label> + <span class="property">{'Autohide the bar of the slideshow'|@translate}</span> + <span class="graphicalCheckbox icon-check{if $options.autohide != 5000}-empty{/if}"> </span> + <input type="checkbox" name="autohide"{if $options.autohide == 5000} checked="checked"{/if}> + </label></li> + + </ul> + </fieldset> +</div> +<p> + <input class="submit" type="submit" value="{'Submit'|@translate}" name="submit_smartpocket" /> +</p> +</form> diff --git a/themes/smartpocket/admin/index.php b/themes/smartpocket/admin/index.php new file mode 100644 index 000000000..e3365959c --- /dev/null +++ b/themes/smartpocket/admin/index.php @@ -0,0 +1,30 @@ +<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2014 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();
+?>
diff --git a/themes/smartpocket/admin/maintain.inc.php b/themes/smartpocket/admin/maintain.inc.php new file mode 100644 index 000000000..d3beb4873 --- /dev/null +++ b/themes/smartpocket/admin/maintain.inc.php @@ -0,0 +1,45 @@ +<?php +class smartpocket_maintain extends ThemeMaintain +{ + private $installed = false; + + private $default_conf = array( + 'loop' => true,//true - false + 'autohide' => 5000,//5000 - 0 + ); + + function activate($theme_version, &$errors=array()) + { + global $conf, $prefixeTable; + + if (empty($conf['smartpocket'])) + { + $conf['smartpocket'] = serialize($this->default_conf); + $query = " + INSERT INTO " . CONFIG_TABLE . " (param,value,comment) + VALUES ('smartpocket' , '".pwg_db_real_escape_string($conf['smartpocket'])."' , 'loop#autohide');"; + pwg_query($query); + } + elseif (count(unserialize( $conf['smartpocket'] ))!=2) + { + $conff=unserialize($conf['smartpocket']); + $config = array( + 'loop' => (!empty($conff['loop'])) ? $conff['loop'] :true, + 'autohide' => (!empty($conff['autohide'])) ? $conff['autohide'] :5000, + ); + conf_update_param('smartpocket', pwg_db_real_escape_string(serialize($config))); + load_conf_from_db(); + } + $this->installed = true; + } + + function deactivate() + { } + + function delete() + { + // delete configuration + conf_delete_param('smartpocket'); + } +} +?>
\ No newline at end of file diff --git a/themes/smartpocket/admin/upgrade.inc.php b/themes/smartpocket/admin/upgrade.inc.php new file mode 100644 index 000000000..1e1925d77 --- /dev/null +++ b/themes/smartpocket/admin/upgrade.inc.php @@ -0,0 +1,29 @@ +<?php + +if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); + +global $prefixeTable, $conf; + +if (!isset($conf['smartpocket'])) +{ + $config = array( + 'loop' => true,//true - false + 'autohide' => 5000,//5000 - 0 + ); + $query = " +INSERT INTO " . CONFIG_TABLE . " (param,value,comment) +VALUES ('smartpocket' , '".pwg_db_real_escape_string(serialize($config))."' , 'loop#autohide');"; + pwg_query($query); + load_conf_from_db(); +} +elseif (count(unserialize( $conf['smartpocket'] ))!=2) +{ + $conff=unserialize($conf['smartpocket']); + $config = array( + 'loop' => (!empty($conff['loop'])) ? $conff['loop'] :true, + 'autohide' => (!empty($conff['autohide'])) ? $conff['autohide'] :5000, + ); + conf_update_param('smartpocket', pwg_db_real_escape_string(serialize($config))); + load_conf_from_db(); +} +?>
\ No newline at end of file |