6598530183e78d9cd16e61490f6a186030a1c8d8
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.4 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2013 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
31 * @copyright CiviCRM LLC (c) 2004-2013
35 class CRM_Wci_BAO_Widget
extends CRM_Wci_DAO_Widget
{
37 public static function getWidgetData($widgetId) {
39 $query = "SELECT * FROM civicrm_wci_widget where id=".$widgetId;
42 $dao = CRM_Core_DAO
::executeQuery($query, $params, TRUE, 'CRM_Wci_DAO_Widget');
45 while ($dao->fetch()) {
46 $data["title"] = $dao->title
;
47 $data["logo_image"] = $dao->logo_image
;
48 $data["image"] = $dao->image
;
50 (empty($dao->button_title
)) ?
$contrin_title = "Donate" :
51 $contrin_title = $dao->button_title
;
53 $data["button_title"] = $contrin_title;
55 $data["button_link_to"] = $dao->button_link_to
;
56 $data["progress_bar_id"] = $dao->progress_bar_id
;
57 $data["description"] = $dao->description
;
58 $data["email_signup_group_id"] = $dao->email_signup_group_id
;
59 $data["size_variant"] = $dao->size_variant
;
60 $data["color_title"] = $dao->color_title
;
61 $data["color_title_bg"] = $dao->color_title_bg
;
62 $data["color_progress_bar"] = $dao->color_progress_bar
;
63 $data["color_progress_bar_bg"] = $dao->color_progress_bar_bg
;
64 $data["color_widget_bg"] = $dao->color_widget_bg
;
65 $data["color_description"] = $dao->color_description
;
66 $data["color_border"] = $dao->color_border
;
67 $data["color_button"] = $dao->color_button
;
68 $data["color_button_bg"] = $dao->color_button_bg
;
69 $data['style_rules'] = $dao->style_rules
;
70 $data["show_pb_perc"] = $dao->show_pb_perc
;
71 CRM_Wci_BAO_ProgressBar
::getProgressbarData($dao->progress_bar_id
, $data);
72 $data["custom_template"] = $dao->custom_template
;
73 $data["widgetId"] = $widgetId;
74 $data["override"] = $dao->override
;
75 $data["hide_title"] = $dao->hide_title
;
76 $data["hide_border"] = $dao->hide_border
;
77 $data["hide_pbcap"] = $dao->hide_pbcap
;
78 $data["color_bar"] = $dao->color_progress_bar
;
79 $defProf = civicrm_api3('setting', 'getValue', array('group' => 'Wci Preference', 'name' => 'default_wci_profile'));
80 $data["emailSignupGroupFormURL"] = CRM_Utils_System
::baseCMSURL() . '/civicrm/profile/create?reset=1&gid=' . $defProf;
81 $data["color_btn_newsletter"] = $dao->color_btn_newsletter
;
82 $data["color_btn_newsletter_bg"] = $dao->color_btn_newsletter_bg
;
83 $data["newsletter_text"] = $dao->newsletter_text
;
84 $data["color_newsletter_text"] = $dao->color_newsletter_text
;
89 * Returns array of widgets
91 * @return widget array
94 public static function getWidgetList() {
95 $query = "SELECT * FROM civicrm_wci_widget";
99 $dao = CRM_Core_DAO
::executeQuery($query, $params, TRUE, 'CRM_Wci_DAO_Widget');
101 while ($dao->fetch()) {
102 $widgList[$dao->id
] = array();
103 CRM_Core_DAO
::storeValues($dao, $widgList[$dao->id
]);