class CRM_Widget_Widget {
static $_methodTable;
- function initialize() {
+
+ public function initialize() {
if (!self::$_methodTable) {
self::$_methodTable = array(
- 'getContributionPageData' =>
- array(
+ 'getContributionPageData' => array(
'description' => 'Gets all campaign related data and returns it as a std class.',
'access' => 'remote',
'arguments' => array(
'widgetID',
),
),
- 'getEmbedCode' =>
- array(
+ 'getEmbedCode' => array(
'description' => 'Gets embed code. Perhaps overkill, but we can track dropoffs in this case. by # of people reqeusting emebed code / number of unique instances.',
'access' => 'remote',
'arguments' => array(
}
}
- function &methodTable() {
+ public function &methodTable() {
self::initialize();
return self::$_methodTable;
*
* @return string
*/
- function registerRequest($contributionPageID, $widgetID, $action) {
+ public function registerRequest($contributionPageID, $widgetID, $action) {
return "I registered a request to $action on $contributionPageID from $widgetID";
}
* @param int $contributionPageID
* @param string $widgetID
*
- * @return stdClass
+ * @return object
*/
public function getContributionPageData($contributionPageID, $widgetID) {
$config = CRM_Core_Config::singleton();
$data->is_active = FALSE;
}
- $data->is_active = TRUE;
- $data->title = $widget->title;
- $data->logo = $widget->url_logo;
+ $data->is_active = TRUE;
+ $data->title = $widget->title;
+ $data->logo = $widget->url_logo;
$data->button_title = $widget->button_title;
- $data->button_url = CRM_Utils_System::url('civicrm/contribute/transact',
+ $data->button_url = CRM_Utils_System::url('civicrm/contribute/transact',
"reset=1&id=$contributionPageID",
TRUE, NULL, FALSE, TRUE
);
*
* @param int $contributionPageID
* @param string $widgetID
- * @param string $format - either myspace or normal
+ * @param string $format
+ * Either myspace or normal.
*
* @return string
*/
public function getEmbedCode($contributionPageID, $widgetID, $format = "normal") {
self::registerRequest($contributionPageID, $widgetID, __FUNCTION__);
- return "<embed>.......................</embed>" . print_r(func_get_args(), 1);
+ return "<embed>.......................</embed>" .
+ print_r(func_get_args(), 1);
}
-}
+}