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. |
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. |
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. |
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 +--------------------------------------------------------------------+
28 * @copyright CiviCRM LLC (c) 2004-2013
32 class CRM_Wci_BAO_Widget
extends CRM_Wci_DAO_Widget
{
34 public static function getWidgetData($widgetId) {
36 $query = "SELECT * FROM civicrm_wci_widget where id=".$widgetId;
39 $dao = CRM_Core_DAO
::executeQuery($query, $params, TRUE, 'CRM_Wci_DAO_Widget');
42 while ($dao->fetch()) {
43 $data["title"] = $dao->title
;
44 $data["logo_image"] = $dao->logo_image
;
45 $data["image"] = $dao->image
;
47 (empty($dao->button_title
)) ?
$contrin_title = "Donate" :
48 $contrin_title = $dao->button_title
;
50 $data["button_title"] = $contrin_title;
52 $data["button_link_to"] = $dao->button_link_to
;
53 $data["progress_bar_id"] = $dao->progress_bar_id
;
54 $data["description"] = $dao->description
;
55 $data["email_signup_group_id"] = $dao->email_signup_group_id
;
56 $data["size_variant"] = $dao->size_variant
;
57 $data["color_title"] = $dao->color_title
;
58 $data["color_title_bg"] = $dao->color_title_bg
;
59 $data["color_progress_bar"] = $dao->color_progress_bar
;
60 $data["color_progress_bar_bg"] = $dao->color_progress_bar_bg
;
61 $data["color_widget_bg"] = $dao->color_widget_bg
;
62 $data["color_description"] = $dao->color_description
;
63 $data["color_border"] = $dao->color_border
;
64 $data["color_button"] = $dao->color_button
;
65 $data["color_button_bg"] = $dao->color_button_bg
;
66 $data['style_rules'] = $dao->style_rules
;
67 $data["show_pb_perc"] = $dao->show_pb_perc
;
68 CRM_Wci_BAO_ProgressBar
::getProgressbarData($dao->progress_bar_id
, $data);
69 $data["custom_template"] = $dao->custom_template
;
70 $data["widgetId"] = $widgetId;
71 $data["override"] = $dao->override
;
72 $data["hide_title"] = $dao->hide_title
;
73 $data["hide_border"] = $dao->hide_border
;
74 $data["hide_pbcap"] = $dao->hide_pbcap
;
75 $data["color_bar"] = $dao->color_progress_bar
;
76 $defProf = civicrm_api3('setting', 'getValue', array('group' => 'Wci Preference', 'name' => 'default_wci_profile'));
77 $data["emailSignupGroupFormURL"] = CRM_Utils_System
::baseCMSURL() . '/civicrm/profile/create?reset=1&gid=' . $defProf;
78 $data["color_btn_newsletter"] = $dao->color_btn_newsletter
;
79 $data["color_btn_newsletter_bg"] = $dao->color_btn_newsletter_bg
;
80 $data["newsletter_text"] = $dao->newsletter_text
;
81 $data["color_newsletter_text"] = $dao->color_newsletter_text
;
86 * Returns array of widgets
88 * @return widget array
91 public static function getWidgetList() {
92 $query = "SELECT * FROM civicrm_wci_widget";
96 $dao = CRM_Core_DAO
::executeQuery($query, $params, TRUE, 'CRM_Wci_DAO_Widget');
98 while ($dao->fetch()) {
99 $widgList[$dao->id
] = array();
100 CRM_Core_DAO
::storeValues($dao, $widgList[$dao->id
]);