Redeclare function error
<p>I am having a re-declare issue and I just want to understand why can someone enlighten me.</p>

<p>Here's my code.</p>

<pre><code> function createAdminPage($dialarg,$topsnamearg,$shortnamearg) {
    global $dial;
    $dial = $dialarg;
    global $topsname;
    $topsname = $topsnamearg;
    global $topname;
    $topname = "Top ".$dial;
    global $shortname;
    $shortname = $shortnamearg;

    function createArrays($i){
    global $shortname;
        $arr =    array (
                 "name" =&gt; "Canci&amp;oacute;n ".$i,
                "desc" =&gt; "Escriba el nombre de la canci&amp;oacute;n ".$i,
                "autor" =&gt; "Autor ".$i,
                "desc_autor" =&gt; "Escriba el Nombre del Autor ".$i,
                "id" =&gt; $shortname."cancicon_".$i,
                "va_autor" =&gt; $shortname."autor_".$i,
                "type" =&gt; "text",
                "std" =&gt; "");
        return $arr;
    }

    global $options;
    $options = array (
        array( "name" =&gt; "Top ".$dial,
               "type" =&gt; "title"),
        array( "type" =&gt; "open"),
        createArrays(1),
        createArrays(2),
        createArrays(3),
        createArrays(4),
        createArrays(5),
        createArrays(6),
        createArrays(7),
        createArrays(8),
        createArrays(9),
        createArrays(10),
        array( "type" =&gt; "close")
    );
    function cl_add_admin() {

        global $topname, $shortname, $options, $dial;

        if ( $_GET['page'] == basename(__FILE__) ) {

            if ( 'save' == $_REQUEST['action'] ) {

                foreach ($options as $value) {
                    update_option( $value['id'], $_REQUEST[ $value['id'] ] );
                    update_option( $value['va_autor'], $_REQUEST[ $value['va_autor'] ] );

                    foreach ($options as $value) {
                        if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ]  ); } else { delete_option( $value['id'] ); }
                        if( isset( $_REQUEST[ $value['va_autor'] ] ) ) { update_option( $value['va_autor'], $_REQUEST[ $value['va_autor'] ]  ); } else { delete_option( $value['va_autor'] ); }

                    }

                    header("Location: themes.php?page=functions.php&amp;saved=true");
                    die;

                }
                } else if( 'reset' == $_REQUEST['action'] ) {

                    foreach ($options as $value) {
                        delete_option( $value['id'] ); 
                        delete_option( $value['va_autor'] ); 

                    }

                    header("Location: themes.php?page=functions.php&amp;reset=true");
                    die;

                }
        }

        add_menu_page($topname, 'Tops Circuito Lider', 'edit_themes', $dial.'-handle', 'cl_admin');
        add_submenu_page($dial.'-handle', $topname, $topname, 'edit_themes', $dial.'sub-handle', 'cl_admin');

    }
    function cl_add_init() {  
        $file_dir=get_bloginfo('template_directory');  
        wp_enqueue_style("functions", $file_dir."/functions/options_panel.css", false, "1.0", "all");  
    } 

    function cl_admin() {

    global $topname, $shortname, $options;

         //echo $topname;
         //print_r($options);

        if ( $_REQUEST['saved'] ) echo '&lt;div id="message" class="updated fade"&gt;&lt;p&gt;&lt;strong&gt;'.$topname.' settings saved.&lt;/strong&gt;&lt;/p&gt;&lt;/div&gt;';
        if ( $_REQUEST['reset'] ) echo '&lt;div id="message" class="updated fade"&gt;&lt;p&gt;&lt;strong&gt;'.$topname.' settings reset.&lt;/strong&gt;&lt;/p&gt;&lt;/div&gt;';

        ?&gt;
            &lt;div class="wrap"&gt;
            &lt;h2&gt;Configurar &lt;?php echo $topname; ?&gt;&lt;/h2&gt;

            &lt;form method="post"&gt;

            &lt;?php     

        foreach ($options as $value) {
            switch ( $value['type'] ) {

            case "open":
            ?&gt;
                &lt;table width="100%" border="0" style="background-color:#cdcdcd; padding:10px;"&gt;

            &lt;?php break;

            case "close":
            ?&gt;

                &lt;/table&gt;&lt;br /&gt;

            &lt;?php break;

            case "title":
            ?&gt;
                &lt;table width="100%" border="0" style="background-color:#868686; padding:5px 10px;"&gt;&lt;tr&gt;
                &lt;td colspan="2"&gt;&lt;h3 style="font-family:Georgia,'Times New Roman',Times,serif;"&gt;&lt;?php echo $value['name']; ?&gt;&lt;/h3&gt;&lt;/td&gt;
                &lt;/tr&gt;

            &lt;?php break;

            case 'text':
            //echo "begins";
            ?&gt;
                &lt;tr&gt;
                &lt;td width="20%" rowspan="2" valign="middle"&gt;
                    &lt;strong&gt;&lt;?php echo $value['name']; ?&gt;&lt;/strong&gt;
                    &lt;br /&gt;
                    &lt;strong&gt;&lt;?php echo $value['autor']; ?&gt;&lt;/strong&gt;
                &lt;/td&gt;
                &lt;td width="80%"&gt;
                    &lt;input style="width:400px;" name="&lt;?php echo $value['id']; ?&gt;" id="&lt;?php echo $value['id']; ?&gt;" type="&lt;?php echo $value['type']; ?&gt;" value="&lt;?php     if ( get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?&gt;" /&gt;&lt;br /&gt;
                    &lt;small&gt;&lt;?php echo $value['desc']; ?&gt;&lt;/small&gt;
                    &lt;br /&gt;
                    &lt;input style="width:400px;" name="&lt;?php echo $value['va_autor']?&gt;" id="&lt;?php echo $value['va_autor']?&gt;" type="&lt;?php echo $value['type']; ?&gt;" value="&lt;?php     if ( get_settings( $value['va_autor'] ) != "") { echo get_settings( $value['va_autor'] ); } else { echo $value['std']; } ?&gt;" /&gt;&lt;br /&gt;
                    &lt;small&gt;&lt;?php echo $value['desc_autor']; ?&gt;&lt;/small&gt;
                &lt;/td&gt;
                &lt;/tr&gt;

                &lt;tr&gt;&lt;td colspan="2" style="margin-bottom:5px;border-bottom:1px dotted #000000;"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan="2"&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;

                &lt;?php

                break;
            }
        //echo "after break";
        }
    ?&gt;
         &lt;style type="text/css" /&gt;
         .submit {
        display:inline;
        width:200px;
        }
        &lt;/style&gt;
        &lt;p class="submit"&gt;
        &lt;input name="save" type="submit" value="Guardar" /&gt;
        &lt;input type="hidden" name="action" value="save" /&gt;
        &lt;/p&gt;
        &lt;p class="submit"&gt;
        &lt;input name="reset" type="submit" value="Borrar todos" /&gt;
        &lt;input type="hidden" name="action" value="reset" /&gt;
        &lt;/p&gt;
        &lt;/form&gt;
        &lt;/div&gt;
    &lt;?php
    }
    add_action('admin_menu', 'cl_add_admin');
    add_action('admin_init', 'cl_add_init');
}
</code></pre>

<p>And this is how I am calling it from another file</p>

<pre><code>include("includes/_createTop.php");
createAdminPage("923","Lider 92.3 FM","cl_923");
createAdminPage("931","Romance 93.1 FM","cl_931");
</code></pre>
