<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) PHP-Fusion Inc
| https://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: figurelib_settings.php based on weblinks_settings.php
| Author: PHP-Fusion Development Team
|
| Modification: Catzenjaeger
| URL: www.aliencollectors.com
| E-Mail: admin@aliencollectors.com
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }
pageAccess("FI");
add_breadcrumb(array(
'link' => INFUSIONS.'figurelib/admin.php'.$aidlink.'&section=figurelib_settings',
'title' => 'FigureLib Settings'
));
if (isset($_POST['savesettings'])) {
$inputArray = array(
"figure_per_page" => form_sanitizer($_POST['figure_per_page'], 0, "figure_per_page"),
"figure_per_line" => form_sanitizer($_POST['figure_per_line'], 0, "figure_per_line"),
"figure_display" => form_sanitizer($_POST['figure_display'], 0, "figure_display"),
"figure_submit" => isset($_POST['figure_submit']) ? 1 : 0,
"figure_related" => isset($_POST['figure_related']) ? 1 : 0,
"figure_social_sharing" => isset($_POST['figure_social_sharing']) ? 1 : 0,
);
if (defender::safe()) {
foreach ($inputArray as $figure_settings_name => $figure_settings_value) {
$inputSettings = array(
"figure_settings_name" => $figure_settings_name,
"figure_settings_value" => $figure_settings_value,
);
dbquery_insert(DB_FIGURE_SETTINGS, $inputSettings, "update", array("primary_key" => "figure_settings_name"));
}
addNotice("success", $locale['900']);
redirect(FUSION_REQUEST);
} else {
addNotice('danger', $locale['901']);
}
}
echo openform('settingsform', 'post', FUSION_REQUEST, array('class' => "m-t-20"));
echo "<div class='well'>".$locale['filt_0006']."</div>"; // ['filt_0006'] = "Configuration page for Figures";
echo "<div class='row'><div class='col-xs-12 col-sm-12 col-md-6'>\n";
openside("");
// ['figure_334'] = "Figures per page:";
echo form_text('figure_per_page', $locale['figure_334'], $fil_settings['figure_per_page'], array(
'inline' => 1,
'required' => 1,
'error_text' => $locale['error_value'],
'number' => 1,
'width' => '250px'
));
// ['figure_357'] = "Figures per line:";
echo form_text('figure_per_line', $locale['figure_357'], $fil_settings['figure_per_line'], array(
'inline' => 1,
'required' => 1,
'error_text' => $locale['error_value'],
'number' => 1,
'width' => '250px'
));
echo "<b>".$data['figure_per_line']."</b>";
// $locale['figure_339'] = "Display mode:";
echo form_text('figure_display', $locale['figure_339'], $fil_settings['figure_display'], array(
'inline' => 1,
'required' => 1,
'error_text' => $locale['error_value'],
'number' => 1,
'width' => '250px'
));
closeside();
echo "</div>\n<div class='col-xs-12 col-sm-12 col-md-6'>\n";
openside("");
// ['figure_335'] = "Allow users to submit figures:";
echo form_checkbox('figure_submit', $locale['figure_335'], $fil_settings['figure_submit']);
/*
echo form_select("figure_submit", $locale['figure_335'], $fil_settings['figure_submit'], array(
"inline" => TRUE,
"options" => array($locale['disable'],
$locale['enable'])
));
*/
// ['figure_344'] = "Allow Social Sharing:";
echo form_checkbox('figure_social_sharing', $locale['figure_344'], $fil_settings['figure_social_sharing']);
/*
echo form_select("figure_social_sharing", $locale['figure_344'], $fil_settings['figure_social_sharing'], array(
"inline" => TRUE,
"options" => array($locale['disable'],
$locale['enable'])
));
*/
// ['figure_348'] = "Show related figures:";
echo form_checkbox('figure_related', $locale['figure_348'], $fil_settings['figure_related']);
/*
echo form_select("figure_related", $locale['figure_348'], $fil_settings['figure_related'], array(
"inline" => TRUE,
"options" => array($locale['disable'],
$locale['enable'])
));
*/
closeside();
echo "</div>\n</div>\n";
// ['figure_345'] = "Save Settings";
echo form_button('savesettings', $locale['figure_345'], $locale['figure_345'], array('class' => 'btn-success'));
echo closeform();