예제 #1
0
        }
    } else {
        // switching desc mode while creating new list
        $tpl->assign('newlist_mode', true);
        $tpl->assign('show_editor', true);
    }
}
// save data entered in the 'edit list' form
if (isset($_REQUEST['save']) && isset($_REQUEST['listid'])) {
    $list = new cachelist($_REQUEST['listid'] + 0);
    if ($list->exist() && $list->getUserId() == $login->userid) {
        $name_error = $list->setNameAndVisibility($list_name, $list_visibility);
        if ($name_error) {
            $edit_list = true;
        }
        $list->setPassword($list_password);
        $purifier = new OcHTMLPurifier($opt);
        $list->setDescription($purifier->purify($desctext), $descMode == 3);
        $list->save();
        $list->watch($watch);
        if ($list_caches != '') {
            $result = $list->addCachesByWPs($list_caches);
            $tpl->assign('invalid_waypoints', $result === true ? false : implode(", ", $result));
            $list_caches = '';
        }
        foreach ($_REQUEST as $key => $value) {
            if (substr($key, 0, 7) == 'remove_') {
                $list->removeCacheById(substr($key, 7));
            }
        }
    }