本文整理汇总了PHP中Site::Flash方法的典型用法代码示例。如果您正苦于以下问题:PHP Site::Flash方法的具体用法?PHP Site::Flash怎么用?PHP Site::Flash使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Site
的用法示例。
在下文中一共展示了Site::Flash方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: copy
public function copy($id = null)
{
$group = $this->load_group($id);
$newGroup = new ACLGroup();
$newGroup->name = $group->name;
$newGroup->code = $group->code;
$newGroup->description = $group->description;
if ($this->post) {
$newGroup->name = $this->PostData('name');
$newGroup->code = $this->PostData('code');
$newGroup->description = $this->PostData('description');
if ($newGroup->save()) {
foreach ($group->rules() as $rule) {
$newRule = new ACLRule();
$newRule->aclgroup_id = $newGroup->id;
$newRule->acl_id = $rule->acl_id;
$newRule->action = $rule->action;
$newRule->url = $rule->url;
$newRule->notice = $rule->notice;
$newRule->error = $rule->error;
$newRule->save();
}
Site::Flash('notice', 'The group has been copied');
Redirect("admin/acl/groups/{$newGroup->id}");
}
}
$this->assign('group', $newGroup);
$this->assign('originalGroup', $group);
$this->title = "ACL :: Groups :: {$group->name} :: Copy";
$this->render('aclgroup/copy.tpl');
}
示例2: update_discounts
public function update_discounts($id = null)
{
$cart = $this->load_cart($id);
$cart->check_discounts();
Site::Flash('notice', 'The discounts have been updated');
Redirect("admin/carts/{$cart->id}");
}
示例3: edit
public function edit($permalink = null)
{
$this->tinymce = true;
$event = self::load_event($permalink);
if ($this->post) {
$event->name = $this->PostData('name');
$event->shortname = $this->PostData('shortname');
$event->permalink = $this->PostData('permalink');
$event->location = $this->PostData('location');
$event->postcode = $this->PostData('postcode');
$event->capacity = $this->PostData('capacity');
$event->forum_id = $this->PostData('forum_id');
$event->visible = $this->PostData('visible');
$event->active = $this->PostData('active');
$event->tournament_url = $this->PostData('tournament_url');
$event->display_achievements = $this->PostData('display_achievements');
$event->set_startdate($this->PostData('startdate'));
$event->set_enddate($this->PostData('enddate'));
$event->lock_seating = $this->PostData('lock_seating');
$event->next = $this->PostData('next');
$event->advertised = $this->PostData('advertised');
if ($event->save()) {
Site::Flash("notice", "The event has been edited");
Redirect("admin/events/{$event->permalink}");
}
}
$this->assign("event", $event);
$this->title = "Edit Event";
$this->render("event/edit.tpl");
}
示例4: user_index
public function user_index($nickname = null)
{
if (!$nickname) {
$nickname = $this->GetData('nickname');
}
$user = User::find_by_nickname($nickname);
$newaward = new LoyaltyAward();
if ($this->post) {
$newaward->user_id = $user->id;
$newaward->points = $this->PostData("points");
$newaward->justification = $this->PostData("justification");
$newaward->awarded_by_id = Site::CurrentUser()->id;
if (!$this->csrf) {
Site::InstantFlash('error', 'Invalid form submission');
} elseif ($newaward->save()) {
Site::Flash("notice", "The loyalty points have been awarded");
Redirect("admin/users/" . $user->permalink() . "/loyalty");
} else {
Site::InstantFlash('error', 'Unable to award loyalty points');
}
}
$page = 1;
if ($this->GetData('page')) {
$page = $this->GetData('page');
}
$id = mysql_real_escape_string($user->id);
$awards = LoyaltyAward::paginate("users.id = '{$id}'", "loyalty_awards.id DESC", $page, 50);
$this->assign("user", $user);
$this->assign("awards", $awards);
$this->assign('newaward', $newaward);
$this->title = "{$user->nickname} :: Loyalty";
$this->render("loyalty_award/user_index.tpl");
}
示例5: edit
public function edit()
{
$gateway = $this->getByID('PaymentGateway');
$settings = $gateway->getSettings();
$code = $this->getData('code');
if (!isset($settings[$code])) {
throw new Error404('Unable to find setting with the code supplied');
}
$setting = $settings[$code];
if ($this->post) {
$value = $this->postData('value');
if (!$setting->obj) {
$setting->obj = new PaymentGatewaySetting();
$setting->obj->paymentgateway = $gateway;
$setting->obj->paymentgateway_id = $gateway->id;
$setting->obj->code = $setting->code;
}
$setting->obj->value = $this->postData('value');
$setting->value = $setting->obj->value;
if ($this->csrf && $setting->obj->save()) {
Site::Flash('notice', 'The payment gateway setting has been updated');
Redirect("admin/payments/gateways/{$gateway->id}");
} elseif (!$this->csrf) {
Site::Flash('error', 'Invalid form submission');
}
}
$this->assign('gateway', $gateway);
$this->assign('setting', $setting);
$this->title = "Payment Gateways :: {$gateway->name} :: Settings :: {$setting->name}";
$this->render('paymentgatewaysetting/edit.tpl');
}
示例6: delete
public function delete($group_id = null, $id = null)
{
$group = self::load_group($group_id);
$user_group = self::load_user_group($group->id, $id);
$user_group->destroy();
Site::Flash("notice", "{$user_group->user->nickname} has been removed from this group");
if (isset($_GET['user'])) {
Redirect("admin/users/{$user_group->user->permalink()}");
}
Redirect("admin/groups/{$group->id}");
}
示例7: delete
public function delete($group_id = null, $id = null)
{
$group = self::load_group($group_id);
$event_group = self::load_event_group($group->id, $id);
$event_group->destroy();
Site::Flash("notice", "{$event_group->event->name} has been removed from this group");
if (isset($_GET['event'])) {
Redirect("admin/users/{$user_group->event->name}");
}
Redirect("admin/groups/{$group->id}");
}
示例8: delete
public function delete($id = null)
{
if (!$id) {
$id = $this->GetData('id');
}
$redemption = DiscountRedemption::find_by_id($id);
if (!$redemption || $redemption->user->id != Site::CurrentUser()->id) {
throw new Error404();
}
$redemption->destroy();
Site::Flash("notice", "Discount code removed successfully.");
RedirectBack("bookings/pay/{$cart_id}/");
}
示例9: delete
public function delete($permalink = null, $id = null)
{
$event = self::load_event();
$ticket = self::load_ticket($event);
if ($ticket->event_signups()) {
Site::Flash("error", "Ticket cannot be deleted as it has bookings");
Redirect("admin/events/{$event->permalink}");
} else {
$ticket->destroy();
Site::Flash("notice", "The ticket has been deleted");
Redirect("admin/events/{$event->permalink}");
}
}
示例10: delete
public function delete($permalink = null, $id = null)
{
$event = self::load_event();
$service = self::load_service($event);
if ($service->event_services()) {
Site::Flash("error", "Service cannot be deleted as it has bookings");
Redirect("admin/events/{$event->permalink}");
} else {
$service->destroy();
Site::Flash("notice", "The service has been deleted");
Redirect("admin/events/{$event->permalink}");
}
}
示例11: edit
public function edit($id = null)
{
$nickname = self::load_nickname($id);
if ($this->method == "POST") {
$nickname->nickname = $_POST['nickname'];
if ($nickname->Save()) {
Site::Flash("notice", "The nickname has been edited");
Redirect("admin/nicknames");
}
}
$this->assign("nickname", $nickname);
$this->title = "Edit Bad Nickname";
$this->render("badnickname/edit.tpl");
}
示例12: edit
public function edit($id = null)
{
$group = self::load_group($id);
if ($this->post) {
$group->name = $_POST['name'];
$group->description = $_POST['description'];
if ($group->save()) {
Site::Flash("notice", "The group has been updated");
Redirect("admin/groups/{$group->id}");
}
}
$this->assign("group", $group);
$this->title = "Edit Group";
$this->render("group/edit.tpl");
}
示例13: create
public function create()
{
$game = self::load_game();
if ($this->post) {
$gametype = new Gametype();
$gametype->game_id = $game->id;
$gametype->gametype = $_POST['gametype'];
if ($gametype->Save()) {
Site::Flash("notice", "The gametype has been created");
} else {
Site::Flash("error", "Unable to create gametype");
}
}
Redirect("admin/games/{$game->id}");
}
示例14: edit
public function edit($id = null)
{
$tag = self::load_tag($id);
if ($this->post) {
$tag->tag = $this->PostData('tag');
$tag->system = $this->PostData('system');
$tag->hidden = $this->PostData('hidden');
if ($tag->save()) {
Site::Flash("notice", "The tag has been edited");
Redirect("admin/tags/{$tag->id}");
}
}
$this->assign("tag", $tag);
$this->title = "Edit Tags";
$this->render("tag/edit.tpl");
}
示例15: edit
public function edit($id = null)
{
$account = $this->load_account($id);
if ($this->post) {
$account->name = $this->PostData('name');
$account->code = $this->PostData('code');
$account->description = $this->PostData('description');
if ($account->save()) {
Site::Flash('notice', 'The account has been updated');
Redirect("admin/twitter/accounts/{$account->id}");
}
}
$this->assign('account', $account);
$this->title = "Twitter Account :: Edit {$account->name}";
$this->render('twitter_account/edit.tpl');
}