OSDN Git Service

Just a cleanup, shrink
authorhenoheno <henoheno>
Mon, 9 Aug 2004 14:03:42 +0000 (23:03 +0900)
committerhenoheno <henoheno>
Mon, 9 Aug 2004 14:03:42 +0000 (23:03 +0900)
plugin/aname.inc.php

index b60e053..fb4aad7 100644 (file)
@@ -2,36 +2,32 @@
 /////////////////////////////////////////////////
 // PukiWiki - Yet another WikiWikiWeb clone.
 //
-// $Id: aname.inc.php,v 1.15 2004/07/31 03:09:20 henoheno Exp $
+// $Id: aname.inc.php,v 1.16 2004/08/09 14:03:42 henoheno Exp $
 //
 
 function plugin_aname_inline()
 {
        $args = func_get_args();
-       return call_user_func_array('plugin_aname_convert',$args);
+       return call_user_func_array('plugin_aname_convert', $args);
 }
+
 function plugin_aname_convert()
 {
-       global $script,$vars;
+       global $script, $vars;
 
-       if (func_num_args() < 1)
-       {
-               return FALSE;
-       }
+       if (func_num_args() < 1) return FALSE;
 
        $args = func_get_args();
        $id = array_shift($args);
 
-       if (!preg_match('/^[A-Za-z][\w\-]*$/',$id))
-       {
+       if (! preg_match('/^[A-Za-z][\w\-]*$/', $id))
                return FALSE;
-       }
 
-       $body = count($args) ? preg_replace('/<\/?a[^>]*>/','',array_pop($args)) : '';
+       $body = count($args) ? preg_replace('/<\/?a[^>]*>/', '', array_pop($args)) : '';
 
-       $class   = in_array('super',$args) ? 'anchor_super' : 'anchor';
-       $url     = in_array('full',$args)  ? "$script?".rawurlencode($vars['page']) : '';
-       $attr_id = in_array('noid',$args)  ? '' : " id=\"$id\"";
+       $class   = in_array('super', $args) ? 'anchor_super' : 'anchor';
+       $url     = in_array('full',  $args) ? "$script?" . rawurlencode($vars['page']) : '';
+       $attr_id = in_array('noid',  $args) ? '' : " id=\"$id\"";
 
        return "<a class=\"$class\"$attr_id href=\"$url#$id\" title=\"$id\">$body</a>";
 }