Exemplo n.º 1
0
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2075 $
 */
define('CURSCRIPT', 'templet');
require "../libraries/common.inc.php";
uses("templet", "typeoption", "setting");
require "session_cp.inc.php";
require LIB_PATH . "cache.class.php";
include CACHE_PATH . "cache_membergroup.php";
include CACHE_PATH . "cache_type.php";
$cache = new Caches();
$setting = new Settings();
$templet = new Templets();
$typeoption = new Typeoption();
$templet_controller = new Templet();
$conditions = null;
$tpl_file = "templet";
setvar("AskAction", $typeoption->get_cache_type("common_option"));
if (isset($_POST['save']) && !empty($_POST['data']['templet']['title'])) {
    $vals = array();
    $vals = $_POST['data']['templet'];
    if (!in_array(0, $_POST['data']['require_membertype']) && !empty($_POST['data']['require_membertype'])) {
        $res = "[" . implode("][", $_POST['data']['require_membertype']) . "]";
        $vals['require_membertype'] = $res;
    } elseif (!empty($_POST['data']['require_membertype'])) {
        $vals['require_membertype'] = 0;
    }
    if (!in_array(0, $_POST['data']['require_membergroups']) && !empty($_POST['data']['require_membergroups'])) {
        $res = "[" . implode("][", $_POST['data']['require_membergroups']) . "]";
        $vals['require_membergroups'] = $res;
Exemplo n.º 2
0
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2075 $
 */
define('CURSCRIPT', 'templet');
require "../libraries/common.inc.php";
uses("templet", "typeoption", "setting");
require "session_cp.inc.php";
require LIB_PATH . "cache.class.php";
$G['membergroup'] = cache_read("membergroup");
require CACHE_COMMON_PATH . "cache_type.php";
$cache = new Caches();
$setting = new Settings();
$templet = new Templets();
$typeoption = new Typeoption();
$templet_controller = new Templet();
$conditions = null;
$tpl_file = "templet";
setvar("AskAction", $typeoption->get_cache_type("common_option"));
if (isset($_POST['save']) && !empty($_POST['data']['templet']['title'])) {
    $vals = array();
    $vals = $_POST['data']['templet'];
    if (isset($_POST['data']['require_membertype']) && !in_array(0, $_POST['data']['require_membertype']) && !empty($_POST['data']['require_membertype'])) {
        $res = "[" . implode("][", $_POST['data']['require_membertype']) . "]";
        $vals['require_membertype'] = $res;
    } elseif (!empty($_POST['data']['require_membertype'])) {
        $vals['require_membertype'] = 0;
    }
    if (isset($_POST['data']['require_membergroups']) && !in_array(0, $_POST['data']['require_membergroups']) && !empty($_POST['data']['require_membergroups'])) {
        $res = "[" . implode("][", $_POST['data']['require_membergroups']) . "]";
        $vals['require_membergroups'] = $res;