/** * Generates HTML foreach element found in the page definition * * @param array $page_def Array of all elements for which we need to generate HTML */ function config_generate_html(array $page_def) { global $lang; foreach ($page_def as $def) { switch ($def[0]) { case 'html': config_html($def[1]); break; case 'text_input': config_text_input($def[1], $def[2], $GLOBALS[$def[1]], $def[3], $def[4], $def[5], $def[6], $def[7]); break; case 'boolean_select': config_boolean_select($def[1], $def[2], $GLOBALS[$def[1]], $def[3], $def[4], $def[5], $def[6]); break; case 'single_select': config_single_select($def[1], $def[2], $GLOBALS[$def[1]], $def[3], $def[4], $def[5], $def[6], $def[7]); break; } } }
/** * Generate the second half of the "guts" of a plugin setup page from a page definition array. The * page definition array is typically constructed by a series of calls to config_add_xxxx functions * (see below). See the setup page for the sample plugin for information on how to use this and the * associated functions. * * @param $page_def mixed an array whose elements are generated by calls to config_add_xxxx functions * each of which describes how one of the plugin's configuratoin variables. * @param $plugin_name string the name of the plugin for which the function is being invoked. * @param $upload_status string the status string returned by config_get_setup_post(). * @param $plugin_page_heading string the heading to be displayed for the setup page for this plugin, * typically a $lang[] variable. * @param $plugin_page_frontm string front matter for the setup page in html format. This material is * placed after the page heading and before the form. Default: '' (i.e., no front matter). */ function config_gen_setup_html($page_def, $plugin_name, $upload_status, $plugin_page_heading, $plugin_page_frontm = '') { global $lang, $baseurl_short; ?> <div class="BasicsBox"> <h2> </h2> <h1><?php echo $plugin_page_heading; ?> </h1> <?php if ($plugin_page_frontm != '') { echo $plugin_page_frontm; } ?> <form id="form1" name="form1" method="post" action="<?php echo $baseurl_short; ?> plugins/<?php echo $plugin_name; ?> /pages/setup.php"> <?php foreach ($page_def as $def) { switch ($def[0]) { case 'section_header': config_section_header($def[1], $def[2]); break; case 'html': config_html($def[1]); break; case 'text_input': config_text_input($def[1], $def[2], $GLOBALS[$def[1]], $def[3], $def[4]); break; case 'text_list': config_text_input($def[1], $def[2], implode(',', $GLOBALS[$def[1]]), $def[3], $def[4]); break; case 'boolean_select': config_boolean_select($def[1], $def[2], $GLOBALS[$def[1]], $def[3], $def[4]); break; case 'single_select': config_single_select($def[1], $def[2], $GLOBALS[$def[1]], $def[3], $def[4], $def[5]); break; case 'multi_select': config_multi_select($def[1], $def[2], $GLOBALS[$def[1]], $def[3], $def[4], $def[5]); break; case 'single_user_select': config_single_user_select($def[1], $def[2], $GLOBALS[$def[1]], $def[3]); break; case 'multi_user_select': config_multi_user_select($def[1], $def[2], $GLOBALS[$def[1]], $def[3]); break; case 'single_ftype_select': config_single_ftype_select($def[1], $def[2], $GLOBALS[$def[1]], $def[3], $def[4]); break; case 'multi_ftype_select': config_multi_ftype_select($def[1], $def[2], $GLOBALS[$def[1]], $def[3], $def[4], $def[5]); break; case 'single_rtype_select': config_single_rtype_select($def[1], $def[2], $GLOBALS[$def[1]], $def[3]); break; case 'multi_rtype_select': config_multi_rtype_select($def[1], $def[2], $GLOBALS[$def[1]], $def[3]); break; case 'db_single_select': config_db_single_select($def[1], $def[2], $GLOBALS[$def[1]], $def[3], $def[4], $def[5], $def[6], $def[7], $def[8]); break; case 'db_multi_select': config_db_multi_select($def[1], $def[2], $GLOBALS[$def[1]], $def[3], $def[4], $def[5], $def[6], $def[7], $def[8]); break; case 'single_group_select': config_single_group_select($def[1], $def[2], $GLOBALS[$def[1]], $def[3]); break; case 'multi_group_select': config_multi_group_select($def[1], $def[2], $GLOBALS[$def[1]], $def[3]); break; } } ?> <div class="Question"> <label for="submit"> </label> <input type="submit" name="save" id="save" value="<?php echo $lang['plugins-saveconfig']; ?> "> <input type="submit" name="submit" id="submit" value="<?php echo $lang['plugins-saveandexit']; ?> "> </div> <div class="clearerleft"></div> </form> <?php display_rsc_upload($upload_status); ?> </div> <?php }