Beispiel #1
0
 /**
  * Perform checks. Returns verbal messages.
  * 
  * @param array|string names of checks you want to perform
  * 
  * @return array Verbal warnings
  * 
  * @since 1.0.3
  */
 public static function getWarnings($checkList = array())
 {
     $methods = self::getAvailableChecks();
     // Get only requested and available
     if (!empty($checkList)) {
         $checkList = (array) $checkList;
         $methods = array_intersect($checkList, $methods);
     }
     // Do checks
     $res = array();
     foreach ($methods as $m) {
         self::$data = array();
         if (!self::$m()) {
             array_push($res, JText::sprintf('COM_NEWSLETTER_ENVIRONMENT_' . strtoupper($m), isset(self::$data[0]) ? self::$data[0] : '', isset(self::$data[1]) ? self::$data[1] : ''));
         }
     }
     self::$data = array();
     return $res;
 }