本文整理汇总了PHP中Setting::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Setting::delete方法的具体用法?PHP Setting::delete怎么用?PHP Setting::delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Setting
的用法示例。
在下文中一共展示了Setting::delete方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
}
if (filter_input(INPUT_POST, "deleteThisSetting") != NULL) {
$postVars = array('name');
// Form fields names
foreach ($postVars as $postVar) {
switch ($postVar) {
default:
$settingObj->{$postVar} = filter_input(INPUT_POST, $postVar) ? mysqli_real_escape_string($dbObj->connection, filter_input(INPUT_POST, $postVar)) : '';
if ($settingObj->{$postVar} === "") {
array_push($errorArr, "Please enter {$postVar} ");
}
break;
}
}
if (count($errorArr) < 1) {
echo $settingObj->delete();
} else {
$json = array("status" => 0, "msg" => $errorArr);
$dbObj->close();
//Close Database Connection
header('Content-type: application/json');
echo json_encode($json);
}
}
if (filter_input(INPUT_POST, "addNewSetting") != NULL && filter_input(INPUT_POST, "addNewSetting") == "editSetting") {
$postVars = array('value', 'name');
// Form fields names
foreach ($postVars as $postVar) {
switch ($postVar) {
default:
$settingObj->{$postVar} = filter_input(INPUT_POST, $postVar) ? mysqli_real_escape_string($dbObj->connection, filter_input(INPUT_POST, $postVar)) : '';
示例2: delete
public static function delete($owner, $name)
{
return Setting::delete(TOKEN, $owner, $name);
}
示例3: Setting
if ($user_id > 0) {
$owner_id = $user_id;
} else {
$owner_id = fSession::get('user_id');
}
} else {
$owner_id = 0;
}
if ('delete' == $action) {
$class_name = 'Setting';
try {
$obj = new Setting(array('name' => $setting_name, 'owner_id' => $owner_id));
$delete_text = 'Are you sure you want to delete this setting : <strong>' . $obj->getFriendlyName() . '</strong>?';
if (fRequest::isPost()) {
fRequest::validateCSRFToken(fRequest::get('token'));
$obj->delete();
fMessaging::create('success', fURL::get(), 'The setting ' . $obj->getFriendlyName() . ' was successfully deleted');
fURL::redirect(Setting::makeUrl('list', $setting_type, NULL, $owner_id));
}
} catch (fNotFoundException $e) {
fMessaging::create('error', fURL::get(), 'The setting requested could not be found');
fURL::redirect(Setting::makeUrl('list'));
} catch (fExpectedException $e) {
fMessaging::create('error', fURL::get(), $e->getMessage());
}
include VIEW_PATH . '/delete.php';
// --------------------------------- //
} elseif ('edit' == $action) {
try {
$setting = new Setting(array('name' => $setting_name, 'owner_id' => $owner_id));
if (fRequest::isPost()) {
示例4: _updateSettings
/**
* Update settings method
*
*/
protected function _updateSettings()
{
App::import('Model', 'Setting');
$Setting = new Setting();
// find all of the dynamic js files
$jsFiles = $this->find('all', array('conditions' => array('WebpageJs.is_requested' => 0)));
if (!empty($jsFiles)) {
// write the settings using all js files in existence
$data['Setting']['type'] = 'Webpages';
$data['Setting']['name'] = 'DEFAULT_JS_FILENAMES';
$data['Setting']['value'] = '';
foreach ($jsFiles as $js) {
if (!empty($js['WebpageJs']['webpage_id'])) {
$data['Setting']['value'] .= @$js['WebpageJs']['type'] . 'text/javascript[] = ' . $js['WebpageJs']['webpage_id'] . ',' . $js['WebpageJs']['name'] . PHP_EOL;
} else {
$data['Setting']['value'] .= 'text/javascript[] = ' . $js['WebpageJs']['name'] . PHP_EOL;
}
}
if ($Setting->add($data)) {
return true;
} else {
return false;
}
} else {
// if its empty then just delete the setting
$setting = $Setting->find('first', array('conditions' => array('Setting.name' => 'DEFAULT_JS_FILENAMES')));
if ($Setting->delete($setting['Setting']['id'])) {
if ($Setting->writeSettingsIniData()) {
return true;
} else {
return false;
}
} else {
return false;
}
}
}
示例5: delete
static function delete($owner, $name)
{
return Setting::delete(USER, $owner, $name);
}