Example #1
0
 /**
  * Returns the output string for the form of topics assigned to user
  * 
  * @param string $param
  * @param string $defaultValue
  * @param bool $editAllowed
  * @return string
  */
 public static function userHasTopicsFormFieldsOutput($param, $defaultValue = "", $editAllowed = true)
 {
     if (substr($param, 0, strlen('repetition_frequency_days')) == 'repetition_frequency_days' && $defaultValue == '') {
         $defaultValue = DEFAULT_REPETITION_FREQUENCY;
     } else {
         if (substr($param, 0, strlen('topic_expiry_date')) == 'topic_expiry_date' && $defaultValue == '') {
             $defaultValue = date('Y-m-d', strtotime(date("Y-m-d", time()) . " + " . DEFAULT_EXPIRY_PERIOD . " day"));
         }
     }
     if (substr_count($defaultValue, "-") == 2 && substr_count($defaultValue, ":") == 2) {
         // Wenn Datum im Format 2015-06-03 00:00:00, dann Zeit abschneiden und Datum rumdrehen
         $defaultValue = substr($defaultValue, 0, 10);
         $tmp = explode("-", $defaultValue);
         $defaultValue = $tmp[2] . "." . $tmp[1] . "." . $tmp[0];
     }
     if (substr_count($defaultValue, "-") == 2 && substr_count($defaultValue, ":") != 2) {
         // Wenn Datum im Format 2015-06-03, dann Datum rumdrehen
         $defaultValue = substr($defaultValue, 0, 10);
         $tmp = explode("-", $defaultValue);
         $defaultValue = $tmp[2] . "." . $tmp[1] . "." . $tmp[0];
     }
     return View::textFormOutput($param, $defaultValue, "", $editAllowed);
 }