Exemple #1
0
 public static function html_link($text, $url = array(), $options = array(), $msg = NULL)
 {
     if (is_array($url)) {
         if (isset($url[1])) {
             $url = Self::url_format($url[0], $url[1]);
         } else {
             $url = Self::url_format($url[0]);
         }
     }
     if (is_array($options)) {
         $opt_string = "";
         foreach ($options as $attr => $val) {
             $opt_string .= " {$attr} = '{$val}' ";
         }
     }
     if ($msg != NULL) {
         return "<a onclick='return confirm(\"{$msg}\")' href='{$url}' {$opt_string}>{$text}</a>";
     } else {
         return "<a href='{$url}' {$opt_string}>{$text}</a>";
     }
 }