BabelKit PHP API Quick Reference

BabelKit Handle Creation

require_once('BabelKit.php');

$babelkit = new BabelKit($dbh, array(
                         'table' => 'bk_code'
                         )):

Display Methods

$code_desc = $babelkit->desc(   $code_set, $code_lang, $code_code);
$Code_desc = $babelkit->ucfirst($code_set, $code_lang, $code_code);
$Code_Desc = $babelkit->ucwords($code_set, $code_lang, $code_code);

Data Methods

$code_desc = $babelkit->render($code_set, $code_lang, $code_code);
$code_desc = $babelkit->data(  $code_set, $code_lang, $code_code);
$parameter = $babelkit->param( $code_set, $code_code);

HTML Select Common Options

print $babelkit->select('day', $lang, array(
                        'var_name' => 'start_day',
                        'value'    => $start_day,
                        'default'  => 1,
                        'subset'   => array( 1, 2, 3, 4, 5 ),
                        'options'  => 'onchange="submit()"'
                        ));

HTML Select Single Value Methods

$html = $babelkit->select($code_set, $code_lang, array(
                          'select_prompt' => 'Code set description?',
                          'blank_prompt'  => 'None'
                          ));

$html = $babelkit->radio($code_set, $code_lang, array(
                         'blank_prompt' => 'None'
                         'sep'          => "<br>\n",
                         ));

HTML Select Multiple Value Methods

$html = $babelkit->multiple($code_set, $code_lang, array(
                            'size' => 10
                            ));

$html = $babelkit->checkbox($code_set, $code_lang, array(
                            'sep' => "<br>\n"
                            ));

Code Set Methods

$rows = $babelkit->lang_set($code_set, $code_lang);
$rows = $babelkit->full_set($code_set, $code_lang);

Code Table Update Methods

$babelkit->slave($code_set, $code_code, $code_desc);

$babelkit->remove($code_set, $code_code);

list( $code_desc, $code_order, $code_flag ) =
    $babelkit->get($code_set, $code_lang, $code_code);

$babelkit->put($code_set,  $code_lang,  $code_code,
               $code_desc, $code_order, $code_flag);