Файл: adultscript-2.0.3-pro/files/admin/modules/channel/components/config.php
Строк: 77
<?php
defined('_VALID') or die('Restricted Access!');
class VComponent_Admin_channel_config extends VModule_Admin_channel
{
public function __construct()
{
parent::__construct();
}
public function render()
{
$ccfg = VF::cfg('module.channel');
$errors = array();
$messages = array();
$warnings = array();
if (isset($_POST['submit_config'])) {
$filter = VF::factory('filter');
$channels_per_page = (int) trim($_POST['channels_per_page']);
$videos_per_page = (int) trim($_POST['videos_per_page']);
$rating_count = (int) trim($_POST['rating_count']);
$rating_type = $filter->get('rating_type');
if (!$errors) {
$ccfg = array(
'channels_per_page' => $channels_per_page,
'videos_per_page' => $videos_per_page,
'rating_count' => $rating_count,
'rating_type' => $rating_type
);
$this->db->query("UPDATE #__module
SET config_cache = '".$this->db->escape(serialize($ccfg))."',
config = '".$this->db->escape(serialize($ccfg))."'
WHERE name = 'channel'
LIMIT 1");
VF::cache_set('channel', $ccfg, 'module');
$messages[] = 'Channel Module Configuration Updated';
}
}
$ccfg = VF::cfg('module.channel', true, true);
$tpl = VF::factory('template');
$tpl->menu = 'channel';
$tpl->submenu = 'config';
$tpl->meta_title = 'Admin::Channel::Config';
$tpl->errors = $errors;
$tpl->messages = $messages;
$tpl->warnings = $warnings;
$tpl->ccfg = $ccfg;
$tpl->load(array('header', 'channel_config', 'footer'));
$tpl->display();
}
}
?>