/** * Display the edit settings form */ function oik_plugins_edit_settings() { global $bw_plugin; bw_form(); stag("table", "wide-fat"); bw_tablerow(array("plugin", $bw_plugin['plugin'] . ihidden('plugin', $bw_plugin['plugin']))); bw_textfield("server", 100, "server", stripslashes($bw_plugin['server'])); bw_textfield("apikey", 26, "apikey?", $bw_plugin["apikey"]); etag("table"); p(isubmit("_oik_plugins_edit_settings", "Change plugin", null, "button-primary")); etag("form"); }
/** * Create a checkbox field given a field name and value * * @param string $name field name * @param string $text field label * @param integer $value 1 for checked * @param array $args future use */ function bw_checkbox($name, $text, $value = 1, $args = NULL) { $lab = label($name, $text); $icheckbox = icheckbox($name, $value); bw_tablerow(array($lab, $icheckbox)); return; }
/** * Display the registered libraries * * Nothing fancy here as we cannot alter the settings * So we just convert each OIK_lib in the OIK_libs class to an array of fields * * We can display $oik_libs->libraries, $oik_libs->loaded_libraries and $oik_libs->checked_libraries * * If deps is an assoc array then we only get the '*' - so we copy the value of args['deps'] * which we know is set * [library] => oik_boot [src] => C:\apache\htdocs\wordpress\wp-content\plugins\oik-bwtrace\libs\oik_boot.php [deps] => [version] => 2.6 [init_function] => [args] => Array * */ function oik_lib_display_libraries() { p("Registered libraries, showing the versions and dependencies."); $oik_libs = oik_libs(); //bw_trace2( $oik_libs, "oik_libs" ); //$oik_libs->display_libs(); $libraries = $oik_libs->libraries; stag("table", "wide-fat"); $labels = bw_as_array(__("Library,Source,Dependencies,Version,Args", 'oik-lib')); bw_tablerow($labels, "tr", "th"); foreach ($libraries as $lib => $data) { //print_r( $lib ); //bw_trace2( $data, "data" ); //$data->deps(); $data->deps = $data->args['deps']; unset($data->error); bw_tablerow($data); } etag("table"); }