/
donationController.php
executable file
·98 lines (82 loc) · 2.89 KB
/
donationController.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
##################################################
#
# Copyright (c) 2004-2016 OIC Group, Inc.
#
# This file is part of Exponent
#
# Exponent is free software; you can redistribute
# it and/or modify it under the terms of the GNU
# General Public License as published by the Free
# Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# GPL: http://www.gnu.org/licenses/gpl.txt
#
##################################################
/**
* @subpackage Controllers
* @package Modules
*/
class donationController extends expController {
public $basemodel_name = 'donation';
public $useractions = array(
'showall'=>'Show all Donation Causes',
);
// hide the configs we don't need
public $remove_configs = array(
'aggregation',
'categories',
'comments',
'ealerts',
'facebook',
'files',
'rss',
'tags',
'twitter',
); // all options: ('aggregation','categories','comments','ealerts','facebook','files','module_title','pagination','rss','tags','twitter',)
static function displayname() { return gt("e-Commerce Online Donations"); }
static function description() { return gt("Allows you to accept donations on your website"); }
function showall() {
expHistory::set('viewable', $this->params);
$causes = $this->donation->find('all');
//eDebug($causes);
assign_to_template(array(
'causes'=>$causes
));
}
function metainfo() {
global $router;
if (empty($router->params['action'])) return false;
// figure out what metadata to pass back based on the action we are in.
$action = $router->params['action'];
$metainfo = array('title'=>'', 'keywords'=>'', 'description'=>'', 'canonical'=> '', 'noindex' => false, 'nofollow' => false);
$storename = ecomconfig::getConfig('storename');
switch($action) {
case 'showall':
case 'show':
$metainfo['title'] = gt('Online Donations') . ' - ' . $storename;
$metainfo['keywords'] = gt('donate online');
$metainfo['description'] = gt("Make a donation");
break;
default:
$metainfo['title'] = static::displayname()." - ".$storename;
$metainfo['keywords'] = SITE_KEYWORDS;
$metainfo['description'] = SITE_DESCRIPTION;
}
return $metainfo;
}
// function index() {
// redirect_to(array('controller'=>'donation', 'action'=>'showall'));
//// $this->showall();
// }
function show() {
redirect_to(array('controller'=>'donation', 'action'=>'showall'));
// $this->showall();
}
function delete() {
redirect_to(array('controller'=>'donation', 'action'=>'showall'));
// $this->showall();
}
}
?>