<?php /* $Id$ $URL$ */ if (!defined('W2P_BASE_DIR')) { die('You should not access this file directly.'); } // check permissions $perms =& $AppUI->acl(); if (!canEdit('system')) { $AppUI->redirect('m=public&a=access_denied'); } $del = (int) w2PgetParam($_POST, 'del', 0); $obj = new CSystem_SysVal(); $post = array('sysval_title' => w2PgetParam($_POST, 'sysval_title'), 'sysval_key_id' => w2PgetParam($_POST, 'sysval_key_id'), 'sysval_value' => w2PgetParam($_POST, 'sysval_value')); $svid = array('sysval_title' => w2PgetParam($_POST, 'sysval_id')); if ($del) { if (!$obj->bind($svid)) { $AppUI->setMsg($obj->getError(), UI_MSG_ERROR); $AppUI->redirect(); } } else { $del = 0; if (!$obj->bind($post)) { $AppUI->setMsg($obj->getError(), UI_MSG_ERROR); $AppUI->redirect(); } } $AppUI->setMsg('System Lookup Values', UI_MSG_ALERT); if ($del) { if ($msg = $obj->delete()) { $AppUI->setMsg($msg, UI_MSG_ERROR);
public function __construct($key = null, $title = null, $value = null) { parent::__construct($key, $title, $value); trigger_error("CSysVal has been deprecated in v3.0 and will be removed by v4.0. Please use CSystem_SysVal instead.", E_USER_NOTICE); }
<?php if (!defined('W2P_BASE_DIR')) { die('You should not access this file directly.'); } // check permissions $perms =& $AppUI->acl(); if (!canEdit('system')) { $AppUI->redirect(ACCESS_DENIED); } $del = (int) w2PgetParam($_POST, 'del', 0); $obj = new CSystem_SysVal(); $post = array('sysval_title' => w2PgetParam($_POST, 'sysval_title'), 'sysval_key_id' => w2PgetParam($_POST, 'sysval_key_id'), 'sysval_value' => w2PgetParam($_POST, 'sysval_value')); $svid = array('sysval_title' => w2PgetParam($_POST, 'sysval_id')); if ($del) { $bind = $obj->bind($svid); } else { $bind = $obj->bind($post); } if (!$bind) { $AppUI->setMsg($obj->getError(), UI_MSG_ERROR); $AppUI->redirect('m=system&u=syskeys'); } $AppUI->setMsg('System Lookup Values', UI_MSG_ALERT); $prefix = 'System Lookup Values'; $action = $del ? 'deleted' : 'stored'; $success = $del ? $obj->delete() : $obj->store(); if ($success) { $AppUI->setMsg($prefix . ' ' . $action); } else { $AppUI->setMsg($obj->getError(), UI_MSG_ERROR);