src/UI/SettingsForm.php
public static function text($name, $title=false)
    {
        global $USER;
        if ( ! $USER ) return false;

        $oldsettings = Settings::linkGetAll();
        $configured = isset($oldsettings[$name]) ? $oldsettings[$name] : false;
        if ( $title === false ) $title = $name;
        if ( ! $USER->instructor ) {
            if ( $configured === false || strlen($configured) < 1 ) {
                echo('<p>'._m('Setting').' '.htmlent_utf8($name).' '._m('is not set').'</p>');
            } else {
                echo('<p>'.htmlent_utf8(ucwords($name)).' '._m('is set to').' '.htmlent_utf8($configured).'</p>');
            }
            return;
        }

        // Instructor view
        echo('<label style="width:100%;" for="'.$name.'">'.htmlent_utf8($title)."\n");
        echo('<input type="text" class="form-control" style="width:100%;" name="'.$name.'"');
        echo('value="'.htmlent_utf8($configured).'"></label>'."\n");
    }
public static function text($name, $title=false)
    {
        global $USER;
        if ( ! $USER ) return false;

        $oldsettings = Settings::linkGetAll();
        $configured = isset($oldsettings[$name]) ? $oldsettings[$name] : false;
        if ( $title === false ) $title = $name;
        if ( ! $USER->instructor ) {
            if ( $configured === false || strlen($configured) < 1 ) {
                echo('<p>'._m('Setting').' '.htmlent_utf8($name).' '._m('is not set').'</p>');
            } else {
                echo('<p>'.htmlent_utf8(ucwords($name)).' '._m('is set to').' '.htmlent_utf8($configured).'</p>');
            }
            return;
        }

        // Instructor view
        echo('<label style="width:100%;" for="'.$name.'">'.htmlent_utf8($title)."\n");
        echo('<input type="text" class="form-control" style="width:100%;" name="'.$name.'"');
        echo('value="'.htmlent_utf8($configured).'"></label>'."\n");
    }
public static function text ( $ name , $ title = false ) { global $ USER ; if ( ! $ USER ) return false ; $ oldsettings = Settings :: linkGetAll ( ) ; $ configured = isset ( $ oldsettings [ $ name ] ) ? $ oldsettings [ $ name ] : false ; if ( $ title === false ) $ title = $ name ; if ( ! $ USER -> instructor ) { if ( $ configured === false || strlen ( $ configured ) < 1 ) { echo ( '<p>' . _m ( 'Setting' ) . ' ' . htmlent_utf8 ( $ name ) . ' ' . _m ( 'is not set' ) . '</p>' ) ; } else { echo ( '<p>' . htmlent_utf8 ( ucwords ( $ name ) ) . ' ' . _m ( 'is set to' ) . ' ' . htmlent_utf8 ( $ configured ) . '</p>' ) ; } return ; } // Instructor view echo ( '<label style="width:100%;" for="' . $ name . '">' . htmlent_utf8 ( $ title ) . "\n" ) ; echo ( '<input type="text" class="form-control" style="width:100%;" name="' . $ name . '"' ) ; echo ( 'value="' . htmlent_utf8 ( $ configured ) . '"></label>' . "\n" ) ; }
Handle a settings text box
Handle a settings text box