Merge pull request #4917 from eileenmcnaughton/minor-tidies
[civicrm-core.git] / CRM / Grant / Info.php
CommitLineData
6a488035
TO
1<?php
2/*
3 +--------------------------------------------------------------------+
39de6fd5 4 | CiviCRM version 4.6 |
6a488035 5 +--------------------------------------------------------------------+
06b69b18 6 | Copyright CiviCRM LLC (c) 2004-2014 |
6a488035
TO
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
18 | |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
26*/
27
28/**
29 * This class introduces component to the system and provides all the
30 * information about it. It needs to extend CRM_Core_Component_Info
31 * abstract class.
32 *
33 * @package CRM
06b69b18 34 * @copyright CiviCRM LLC (c) 2004-2014
6a488035
TO
35 * $Id$
36 *
37 */
38class CRM_Grant_Info extends CRM_Core_Component_Info {
39
e7c15cb6
CW
40 /**
41 * @inheritDoc
42 */
6a488035
TO
43 protected $keyword = 'grant';
44
e0ef6999 45 /**
e7c15cb6 46 * @inheritDoc
e0ef6999
EM
47 * @return array
48 */
6a488035
TO
49 public function getInfo() {
50 return array(
51 'name' => 'CiviGrant',
52 'translatedName' => ts('CiviGrant'),
53 'title' => 'CiviCRM Grant Management Engine',
54 'path' => 'CRM_Grant_',
55 'search' => 1,
56 'showActivitiesInCore' => 1,
57 );
58 }
59
60
e0ef6999 61 /**
e7c15cb6 62 * @inheritDoc
e0ef6999
EM
63 * @param bool $getAllUnconditionally
64 *
65 * @return array
66 */
33777e4a 67 public function getPermissions($getAllUnconditionally = FALSE) {
6a488035
TO
68 return array(
69 'access CiviGrant',
70 'edit grants',
71 'delete in CiviGrant',
72 );
73 }
74
e0ef6999 75 /**
e7c15cb6 76 * @inheritDoc
e0ef6999
EM
77 * @return null
78 */
6a488035
TO
79 public function getUserDashboardElement() {
80 // no dashboard element for this component
81 return NULL;
82 }
83
e0ef6999 84 /**
e7c15cb6 85 * @inheritDoc
e0ef6999
EM
86 * @return null
87 */
6a488035
TO
88 public function getUserDashboardObject() {
89 // no dashboard element for this component
90 return NULL;
91 }
92
e0ef6999 93 /**
e7c15cb6 94 * @inheritDoc
e0ef6999
EM
95 * @return array
96 */
6a488035 97 public function registerTab() {
1afc557a 98 return array(
353ffa53 99 'title' => ts('Grants'),
6a488035
TO
100 'url' => 'grant',
101 'weight' => 50,
102 );
103 }
104
e0ef6999 105 /**
e7c15cb6 106 * @inheritDoc
e0ef6999
EM
107 * @return array
108 */
6a488035 109 public function registerAdvancedSearchPane() {
1afc557a 110 return array(
353ffa53 111 'title' => ts('Grants'),
6a488035
TO
112 'weight' => 50,
113 );
114 }
115
e0ef6999 116 /**
e7c15cb6 117 * @inheritDoc
e0ef6999
EM
118 * @return null
119 */
6a488035
TO
120 public function getActivityTypes() {
121 return NULL;
122 }
123
e0ef6999 124 /**
4f1f1f2a 125 * add shortcut to Create New
e0ef6999
EM
126 * @param $shortCuts
127 */
6a488035
TO
128 public function creatNewShortcut(&$shortCuts) {
129 if (CRM_Core_Permission::check('access CiviGrant') &&
130 CRM_Core_Permission::check('edit grants')
131 ) {
132 $shortCuts = array_merge($shortCuts, array(
1afc557a 133 array(
353ffa53
TO
134 'path' => 'civicrm/grant/add',
135 'query' => "reset=1&action=add&context=standalone",
136 'ref' => 'new-grant',
137 'title' => ts('Grant'),
138 )
139 ));
6a488035
TO
140 }
141 }
142}