File: /www/wwwroot/bs.kntsleep.com/system/admin/template/params.class.php
<?php
/*
* Copyright (c) Huyin Information Technology Co., Ltd. All Rights Reserved.
* BOSSCMS Content Management System (https://www.bosscms.net/)
*/
defined('IS_OK') or exit('Access Forbidden');
into::basic_class('admin');
into::basic_json('attrflag');
class params extends admin
{
public function init()
{
global $G;
$G['cover'] = $this->cover();
$array = array();
if($G['config']['attrflag']){
$attrflag = json::decode($G['config']['attrflag']);
foreach($attrflag as $k=>$v){
$data['attrflag'][$k] = array('name'=>$v,'display'=>1);
}
foreach($G['attrflag'] as $k=>$v){
if(!$data['attrflag'][$k]){
$data['attrflag'][$k] = array('name'=>$v,'display'=>0);
}
}
}else{
foreach($G['attrflag'] as $k=>$v){
$data['attrflag'][$k] = array('name'=>$v,'display'=>1);
}
}
$G['models'] = page::models_list(true);
$G['grade'] = array();
$G['grade'][0] = '不限会员';
if($res = page::grade_list()){
foreach($res as $v){
$G['grade'][$v['weight']] = $v['name'];
}
}
echo $this->theme('template/params',$data);
}
public function add()
{
global $G;
$this->cover('template¶ms','M');
if(isset($G['post'])){
$data = array(
'product_content_number' => $G['post']['product_content_number'],
'product_content_title' => $G['post']['product_content_title'],
'product_content_title1' => $G['post']['product_content_title1'],
'product_content_title2' => $G['post']['product_content_title2'],
'product_content_title3' => $G['post']['product_content_title3'],
'product_content_title4' => $G['post']['product_content_title4'],
'news_thumbnail_width' => $G['post']['news_thumbnail_width'],
'news_thumbnail_height' => $G['post']['news_thumbnail_height'],
'product_thumbnail_width' => $G['post']['product_thumbnail_width'],
'product_thumbnail_height' => $G['post']['product_thumbnail_height'],
'image_thumbnail_width' => $G['post']['image_thumbnail_width'],
'image_thumbnail_height' => $G['post']['image_thumbnail_height'],
'download_thumbnail_width' => $G['post']['download_thumbnail_width'],
'download_thumbnail_height' => $G['post']['download_thumbnail_height'],
'both_type' => $G['post']['both_type'],
'thumbnail_size' => $G['post']['thumbnail_size'],
'thumbnail_horizontal' => $G['post']['thumbnail_horizontal'],
'thumbnail_vertical' => $G['post']['thumbnail_vertical'],
'news_number' => $G['post']['news_number'],
'product_number' => $G['post']['product_number'],
'image_number' => $G['post']['image_number'],
'download_number' => $G['post']['download_number'],
'feedback_number' => $G['post']['feedback_number'],
'search_number' => $G['post']['search_number'],
'tag_number' => $G['post']['tag_number'],
'download_linktype' => $G['post']['download_linktype'],
'download_file' => $G['post']['download_file'],
'download_weight' => $G['post']['download_weight'],
'download_golds' => $G['post']['download_golds'],
'download_golds_type' => $G['post']['download_golds_type'],
'download_mirror_open' => $G['post']['download_mirror_open'],
'download_mirror_local' => $G['post']['download_mirror_local'],
'download_mirror_dfiles' => json::enfilter($G['post']['download_mirror_dfiles']),
'home' => $G['post']['home'],
'page_first' => $G['post']['page_first'],
'page_prev' => $G['post']['page_prev'],
'page_next' => $G['post']['page_next'],
'page_number' => $G['post']['page_number'],
'page_last' => $G['post']['page_last'],
'page_before' => $G['post']['page_before'],
'page_after' => $G['post']['page_after'],
'page_none' => $G['post']['page_none'],
'link_title' => $G['post']['link_title'],
'group_time' => $G['post']['group_time'],
'group_notice' => $G['post']['group_notice'],
'group_collect' => $G['post']['group_collect'],
'group_author' => $G['post']['group_author'],
'download_size' => $G['post']['download_size'],
'all' => $G['post']['all'],
'attrflag' => array()
);
$models = page::models_list(true);
foreach($models as $v){
$data["model_{$v['sign']}_number"] = $G['post']["model_{$v['sign']}_number"];
$data["model_{$v['sign']}_thumbnail_width"] = $G['post']["model_{$v['sign']}_thumbnail_width"];
$data["model_{$v['sign']}_thumbnail_height"] = $G['post']["model_{$v['sign']}_thumbnail_height"];
}
foreach($G['post']['attrflag'] as $k=>$v){
if($v['display'] && $G['attrflag'][$k]){
$data['attrflag'][$k] = $v['name'];
}
}
$data['attrflag'] = json::encode($data['attrflag']);
foreach($data as $k=>$v){
mysql::select_set(array('name'=>$k,'value'=>$v,'parent'=>'0','type'=>'0'),'config',array('value'));
}
alert('操作成功', url::mpf('template','params','init'));
}
}
}
?>