function footsy()
{
    global $popupBoxen;
    echo $popupBoxen;
    if (class_exists('PLL_Base')) {
        echo '<span id="pylangswitcher">';
        //  echo '<li><a id="notice-trans" href="#">notice! (08-30)</a></li>';
        // these are the publicly-available languages
        foreach (unserialize(PRODUCTION_LANGUAGES) as $lang) {
            if ($lang != pll_current_language()) {
                echo '<li><a href="' . get_permalink(pll_get_post(get_the_ID(), $lang)) . '">' . $lang . '</a></li>';
            }
        }
        // these are the ones in development
        if (userIsAdmin() || userIsTranslator() || userIsAssistant()) {
            foreach (unserialize(DEVELOPMENT_LANGUAGES) as $lang) {
                if ($lang != pll_current_language()) {
                    echo '<li><a href="' . get_permalink(pll_get_post(get_the_ID(), $lang)) . '">' . $lang . '</a></li>';
                }
            }
        }
        // old method:  echo pll_the_languages(array('echo'=>0,'display_names_as' => 'slug','hide_current' => 1));
        if (userIsAdmin() || userIsTranslator() || userIsAssistant()) {
            echo '<li><a href="' . admin_url('edit.php?post_type=page') . '">' . __t('Editor') . '</a></li>';
        }
        echo '</span>';
    }
}
function tweak_polylang_menu()
{
    global $wp_admin_bar;
    if (class_exists('PLL_Base') && is_admin()) {
        if (pybox_on() && !(userIsTranslator() || userIsAdmin() || userIsAssistant())) {
            $wp_admin_bar->remove_node('languages');
        } else {
            $node = $wp_admin_bar->get_node('languages');
            $node->title = ___t('Filter Listed Pages');
            // 'Languages' is confusing
            $wp_admin_bar->add_node($node);
            // update
            /*      $node = $wp_admin_bar->get_node('all'); doesn't exist any more?
                  $node->title = str_replace(__('Show all languages', 'polylang'), ___t('Show all visible'), $node->title); // similar
                  $wp_admin_bar->add_node($node); // update   */
        }
    }
}