31455 readme
[com.zyxware.civiwci.git] / wci-helper-functions.php
CommitLineData
88583b52 1<?php
bccdda02
J
2/*
3 +--------------------------------------------------------------------+
4 | CiviCRM Widget Creation Interface (WCI) Version 1.0 |
5 +--------------------------------------------------------------------+
6 | Copyright Zyxware Technologies (c) 2014 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM WCI. |
9 | |
10 | CiviCRM WCI is free software; you can copy, modify, and distribute |
11 | it under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007. |
13 | |
14 | CiviCRM WCI is distributed in the hope that it will be useful, |
15 | but 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 along with this program; if not, contact Zyxware |
21 | Technologies at info[AT]zyxware[DOT]com. |
22 +--------------------------------------------------------------------+
23*/
88583b52
J
24
25 function getContributionPageOptions() {
26 $options = array(
f33bc7b0 27 0 => ts('- select -'),
88583b52 28 );
bccdda02 29
88583b52
J
30 $result = civicrm_api3('contribution_page', 'get');
31 foreach ($result['values'] as $contribution_page) {
32 $options[$contribution_page['id']] = $contribution_page['title'];
33 }
bccdda02 34
88583b52
J
35 return $options;
36 }
bccdda02 37
c68d158b 38 function getExtensionRootPath() {
e242dd86 39 return 'http://' . $_SERVER['SERVER_NAME'] . str_replace($_SERVER['DOCUMENT_ROOT'], '', __DIR__);
c68d158b 40 }
bccdda02 41
c68d158b 42 function getWciWidgetControllerPath() {
13e70378 43 $widget_controller_path = getExtensionRootPath() . '/extern/embed.php';
bccdda02 44
c68d158b
M
45 return $widget_controller_path;
46 }
bccdda02 47
c68d158b 48 function getWciWidgetTemplatePath() {
c311490a 49 $widget_tpl_path = __DIR__ . '/templates/CRM/Wci/Page';
bccdda02 50
c68d158b 51 return $widget_tpl_path;
799ffc5a 52 }