CRM-17763 trigger postEmailSend hook in civimail
[civicrm-core.git] / CRM / Widget / Widget.php
index 364c6a0956e1fc4e1a3c14eb3e5ae09bee4925ba..cf22c5933391a883f757236b76c566824a2c7a69 100644 (file)
 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(
@@ -24,8 +24,7 @@ class CRM_Widget_Widget {
             '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(
@@ -38,7 +37,7 @@ class CRM_Widget_Widget {
     }
   }
 
-  function &methodTable() {
+  public function &methodTable() {
     self::initialize();
 
     return self::$_methodTable;
@@ -53,7 +52,7 @@ class CRM_Widget_Widget {
    *
    * @return string
    */
-  function registerRequest($contributionPageID, $widgetID, $action) {
+  public function registerRequest($contributionPageID, $widgetID, $action) {
     return "I registered a request to $action on $contributionPageID from $widgetID";
   }
 
@@ -63,7 +62,7 @@ class CRM_Widget_Widget {
    * @param int $contributionPageID
    * @param string $widgetID
    *
-   * @return stdClass
+   * @return object
    */
   public function getContributionPageData($contributionPageID, $widgetID) {
     $config = CRM_Core_Config::singleton();
@@ -93,11 +92,11 @@ class CRM_Widget_Widget {
       $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
     );
@@ -184,13 +183,15 @@ WHERE  id = %1";
    *
    * @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);
   }
-}
 
+}