예제 #1
0
function printDbList(&$db)
{
    $dblist = getDbList($db);
    // if there is one database for the given userid, let's select it to cut out one extra step
    if (!Session::get('db', 'name')) {
        $stDb = 0;
        $selDb = "";
        $stDbList = $db->getStandardDbList();
        foreach ($dblist as $dbname) {
            if (in_array($dbname, $stDbList)) {
                $stDb++;
            } else {
                $selDb = $dbname;
            }
        }
        if (count($dblist) == $stDb + 1) {
            Session::set('db', 'name', $selDb);
            $db->selectDb(Session::get('db', 'name'));
        }
    }
    // --- end of automatic selection logic
    if (getDbName()) {
        $folder = $db->name();
        echo view(array($folder . '/dblist', 'dblist'), array(), $dblist);
    } else {
        print '<span>' . __('Select a database to begin') . '.</span>';
    }
    return $dblist;
}
예제 #2
0
,
                type : 'experiments',
                // we need this to get the updated content
                title : document.getElementById('title_input').value,
                date : document.getElementById('datepicker').value,
                body : tinymce.activeEditor.getContent()
                }
            }).done(showSaved());
        },
        // keyboard shortcut to insert today's date at cursor in editor
        setup : function(editor) {
            editor.addShortcut("ctrl+shift+d", "add date at cursor", function() { addDateOnCursor(); });
        },
        mentions: {
            source: [<?php 
echo getDbList('mention');
?>
],
            delimiter: '#'
        },
        language : '<?php 
echo $_SESSION['prefs']['lang'];
?>
',
        style_formats_merge: true,
        style_formats: [
            {
                title: 'Image Left',
                selector: 'img',
                styles: {
                    'float': 'left',