Files
plegall b12f6314c4 fixes #288 on branch 2.7 (cherry-pick of commit 40256be64a from master)
bug 3174 fixed: avoid using load_conf_from_db, use 3rd parameter updateGlobal instead

git-svn-id: http://piwigo.org/svn/trunk@30460 68402e56-0260-453c-a942-63ccdbb3a9ee
2015-09-29 12:28:31 +02:00

43 lines
972 B
PHP

<?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_update_param('smartpocket', $this->default_conf, true);
}
elseif (count(safe_unserialize($conf['smartpocket'])) != 2)
{
$conff = safe_unserialize($conf['smartpocket']);
$config = array(
'loop' => (!empty($conff['loop'])) ? $conff['loop'] :true,
'autohide' => (!empty($conff['autohide'])) ? $conff['autohide'] :5000,
);
conf_update_param('smartpocket', $config, true);
}
$this->installed = true;
}
function deactivate()
{
}
function delete()
{
// delete configuration
conf_delete_param('smartpocket');
}
}
?>