本文整理汇总了PHP中Messages::addNotice方法的典型用法代码示例。如果您正苦于以下问题:PHP Messages::addNotice方法的具体用法?PHP Messages::addNotice怎么用?PHP Messages::addNotice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Messages
的用法示例。
在下文中一共展示了Messages::addNotice方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isset
<?php
$todo = isset($_GET['todo']) ? $_GET['todo'] : null;
switch ($todo) {
case 'delete':
$exampleCat = new ExampleCategories($_GET['id']);
if ($exampleCat->id) {
$players = ExamplePlayers::getAllFromCat($_GET['id']);
foreach ($players as $player) {
$player->delete();
}
$exampleCat->delete();
Messages::addNotice('Category successfully deleted');
} else {
Messages::addError('Delete Failed');
}
break;
case 'up':
$c = new ExampleCategories($_GET['id']);
$c->moveUp();
break;
case 'down':
$c = new ExampleCategories($_GET['id']);
$c->moveDown();
break;
}
$ec = new ExampleCategories();
$smarty->assign('c_list', $ec->getAll(' ORDER BY `display_order` ASC'));
示例2: jump
$error_nr++;
}
if (!isset($_POST['c_probability']) || $_POST['c_probability'] == '') {
Messages::addError('Code required!');
$error_nr++;
}
if ($error_nr > 0) {
$_SESSION['post'] = $_POST;
jump("index.php?page=noscripts&action=add_edit" . $append);
}
if (isset($_GET['id']) && $_GET['id'] != '') {
//edit
$c = new Noscripts($_GET['id']);
Messages::addNotice('Code edited!');
} else {
//add
$c = new Noscripts();
Messages::addNotice('Code added!');
}
$c->name = $_POST['c_name'];
$c->code = $_POST['c_code'];
$c->probability = $_POST['c_probability'];
$c->status = $_POST['c_status'];
$c->save();
jump('?page=noscripts');
}
if (isset($_GET['todo']) && $_GET['todo'] == 'edit') {
$c = new Noscripts(@$_GET['id']);
$smarty->assign('c', $c);
$smarty->assign('edit', 1);
}
示例3: isset
<?php
$c_id = isset($_GET['c_id']) ? $_GET['c_id'] : null;
if (isset($_GET['todo'])) {
if ($_GET['todo'] == 'delete') {
$b = new ExamplePlayers($_GET['id']);
$b->delete();
} elseif ($_GET['todo'] == 'up') {
$b = new ExamplePlayers($_GET['b_id']);
$b->moveUp(' `cat_id`= \'' . $b->cat_id . '\'');
} elseif ($_GET['todo'] == 'down') {
$b = new ExamplePlayers($_GET['b_id']);
$b->moveDown(' `cat_id`= \'' . $b->cat_id . '\'');
} else {
Messages::addNotice('Error');
}
}
$eb = new ExamplePlayers();
$smarty->assign('b_list', $eb->getAll("WHERE `cat_id`= '{$c_id}' ORDER BY `display_order` ASC"));
$smarty->assign('c_id', $c_id);
示例4: jump
if ($action == 'move_up') {
$language->moveUp();
} else {
$language->moveDown();
}
Messages::addNotice('Order changed');
jump('?page=language');
break;
case 'set_default':
$language->setDefault();
Messages::addNotice('Changed');
jump('?page=language');
break;
case 'change_status':
if ($language->isActive()) {
$language->status = Language::STATUS_INACTIVE;
} else {
$language->status = Language::STATUS_ACTIVE;
}
$language->save();
Messages::addNotice('Status changed');
jump('?page=language');
break;
default:
$languages = $language->getAll("ORDER BY display_order ASC");
$smarty->assign('languages', $languages);
$action = 'list';
$smarty->assign('CONTENT', 'language/list.tpl');
break;
}
$smarty->assign('language', $language);
示例5: md5
if ($config->isPOST()) {
$adm->email = $_POST['email'];
if (!empty($_POST['password']) && $_POST['password'] == $_POST['password2']) {
$adm->password = md5($_POST['password']);
} else {
Messages::addError('Password not changed');
}
$adm->access = isset($_POST['access']) ? array_sum($_POST['access']) : 0;
if (empty($adm->id) && empty($adm->password)) {
Messages::addError('Password can\'t be empty');
jump('?page=administrators&action=add');
} else {
$adm->save();
if ($adm->id == Admin::getLogged()->id) {
Admin::setLoggedUser($adm);
}
Messages::addNotice('Saved');
jump('?page=administrators&action=edit&id=' . $adm->id);
}
}
$smarty->assign('accessData', Admin::getAccessData());
$smarty->assign('adm', $adm);
$smarty->assign('CONTENT', 'administrators/add_edit.tpl');
break;
case 'remove':
$adm->delete();
Messages::addNotice('Deleted');
jump('?page=administrators');
break;
}
$smarty->assign('action', $action);
示例6: jump
if (!empty($_FILES['background']['name'])) {
if (!$template->uploadBgImageOnAmazon($_FILES['background']['tmp_name'], $err)) {
Messages::addError($err);
}
}
if (!empty($_FILES['xml']['name'])) {
if (!$template->uploadXmlOnAmazon($_FILES['xml']['tmp_name'], $err)) {
Messages::addError($err);
}
}
if (!empty($_FILES['swf']['name'])) {
if (!$template->uploadSwfOnAmazon($_FILES['swf']['tmp_name'], $err)) {
Messages::addError($err);
}
}
Messages::addNotice('Saved');
jump('?page=templates');
}
$smarty->assign('template', $template);
break;
case 'up':
if (!isset($_GET['id'])) {
jump('index.php?page=templates');
}
$template = new Templates((int) $_GET['id']);
$template->moveUp();
jump('index.php?page=templates');
break;
case 'down':
if (!isset($_GET['id'])) {
jump('index.php?page=templates');
示例7: Noscripts
<?php
if (isset($_GET['todo'])) {
if ($_GET['todo'] == 'delete') {
$b = new Noscripts($_GET['id']);
$b->delete();
Messages::addNotice('Code deleted');
} elseif ($_GET['todo'] == '1') {
Noscripts::setStatus(1, $_GET['ids']);
Messages::addNotice('Code(s) updated');
} elseif ($_GET['todo'] == '0') {
Noscripts::setStatus(0, $_GET['ids']);
Messages::addNotice('Code(s) updated');
} elseif ($_GET['todo'] == 'del') {
Noscripts::deleteAll($_GET['ids']);
Messages::addNotice('Code(s) deleted');
}
jump('?page=noscripts');
}
$ec = new Noscripts();
$smarty->assign('c_list', $ec->getAll(' ORDER BY `name` ASC'));
示例8: Noscripts
<?php
$c = new Noscripts($_GET['id']);
$c->status = $c->status == 1 ? 0 : 1;
$c->save();
Messages::addNotice('Code status updated!');
jump('?page=noscripts');
示例9: foreach
<?php
if ($config->isPOST()) {
foreach ($_POST as $post => $value) {
$set = explode('_', $post);
if (is_array($set)) {
$conf = new Settings($set[1]);
$conf->value = $value;
$conf->save();
}
}
Messages::addNotice('Settings successfully saved.');
jump('index.php?page=settings');
}
$conf = new Settings();
$smarty->assign('settings', $conf->getAll());
示例10: jump
}
Messages::addNotice('The changes were saved!');
jump('index.php?page=examples&action=manage_players&c_id=' . $_GET['c_id']);
} else {
Messages::addError('No changes!');
jump('index.php?page=examples&action=manage_players&c_id=' . $_GET['c_id']);
}
} else {
//add
if ($_FILES['b_thumbnail']['name'] == '') {
Messages::addError('You have to fill all fields!');
$smarty->assign('post', $_POST);
} else {
$eb = new ExamplePlayers();
$eb->cat_id = $_GET['c_id'];
//deg($_GET,$_POST);
$eb->hash = $_POST['b_hash'];
$eb->save();
$finfo = getimagesize($_FILES['b_thumbnail']['tmp_name']);
$result = S3::putObjectFile($_FILES['b_thumbnail']['tmp_name'], $config->amazon->S3Bucket, $config->amazon->folders['site']['examples']['thumbs'] . '/' . $eb->id, S3::ACL_PUBLIC_READ, array(), $finfo['mime']);
Messages::addNotice('The notification was added succesfully!');
jump('index.php?page=examples&action=manage_players&c_id=' . $_GET['c_id']);
}
}
}
if (isset($_GET['todo']) && $_GET['todo'] == 'edit') {
$b = new ExamplePlayers($_GET['b_id']);
$smarty->assign('b', $b);
$smarty->assign('edit', 1);
}
$smarty->assign('c_id', $_GET['c_id']);