CRM-15789 - Move htmlAttributes helper to utils class
[civicrm-core.git] / CRM / Utils / ICalendar.php
index 3125a94cb58c279ee473e697284c1610de8dc821..b15171998b3503ec3d9bcedf65b424825c1ff8a0 100644 (file)
@@ -23,7 +23,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
@@ -45,12 +45,13 @@ class CRM_Utils_ICalendar {
   /**
    * Escape text elements for safe ICalendar use
    *
-   * @param $text Text to escape
-   *
-   * @return  Escaped text
+   * @param $text
+   *   Text to escape.
    *
+   * @return string
+   *   Escaped text
    */
-  static function formatText($text) {
+  public static function formatText($text) {
     $text = strip_tags($text);
     $text = str_replace("\"", "DQUOTE", $text);
     $text = str_replace("\\", "\\\\", $text);
@@ -64,13 +65,15 @@ class CRM_Utils_ICalendar {
   /**
    * Escape date elements for safe ICalendar use
    *
-   * @param $date Date to escape
+   * @param $date
+   *   Date to escape.
    *
    * @param bool $gdata
    *
-   * @return  Escaped date
+   * @return string
+   *   Escaped date
    */
-  static function formatDate($date, $gdata = FALSE) {
+  public static function formatDate($date, $gdata = FALSE) {
 
     if ($gdata) {
       return date("Y-m-d\TH:i:s.000",
@@ -90,17 +93,20 @@ class CRM_Utils_ICalendar {
    * - 'text/plain'    : used for iCal formatted feed
    * - 'text/xml'      : used for gData or rss formatted feeds
    *
-   * @access public
    *
-   * @param string $calendar The calendar data to be published.
+   * @param string $calendar
+   *   The calendar data to be published.
    * @param string $content_type
-   * @param string $charset The character set to use, defaults to 'us-ascii'.
-   * @param string $fileName The file name (for downloads)
-   * @param string $disposition How the file should be sent ('attachment' for downloads)
+   * @param string $charset
+   *   The character set to use, defaults to 'us-ascii'.
+   * @param string $fileName
+   *   The file name (for downloads).
+   * @param string $disposition
+   *   How the file should be sent ('attachment' for downloads).
    *
    * @return void
    */
-  static function send($calendar, $content_type = 'text/calendar', $charset = 'us-ascii', $fileName = NULL, $disposition = NULL) {
+  public static function send($calendar, $content_type = 'text/calendar', $charset = 'us-ascii', $fileName = NULL, $disposition = NULL) {
     $config = CRM_Core_Config::singleton();
     $lang = $config->lcMessages;
     header("Content-Language: $lang");
@@ -117,5 +123,5 @@ class CRM_Utils_ICalendar {
 
     echo $calendar;
   }
-}
 
+}