示例#1
0
function color_theme_dropdown()
{
    global $COLOR_THEME_LIST, $WT_SESSION, $subColor;
    $menu = new WT_Menu(WT_I18N::translate('Palette'), '#', 'menu-color');
    uasort($COLOR_THEME_LIST, array('WT_I18N', 'strcasecmp'));
    foreach ($COLOR_THEME_LIST as $colorChoice => $colorName) {
        $submenu = new WT_Menu($colorName, get_query_url(array('themecolor' => $colorChoice), '&'), 'menu-color-' . $colorChoice);
        if (isset($WT_SESSION->subColor)) {
            if ($WT_SESSION->subColor == $colorChoice) {
                $submenu->addClass('', '', 'theme-active');
            }
        } elseif (WT_Site::preference('DEFAULT_COLOR_PALETTE') == $colorChoice) {
            /* here when visitor changes palette from default */
            $submenu->addClass('', '', 'theme-active');
        } elseif ($subColor == 'ash') {
            /* here when site has different theme as default and user switches to colors */
            if ($subColor == $colorChoice) {
                $submenu->addClass('', '', 'theme-active');
            }
        }
        $menu->addSubMenu($submenu);
    }
    return $menu->getMenuAsList();
}
示例#2
0
 /**
  * edit menu items used in media list
  */
 static function getMediaListMenu($mediaobject)
 {
     $html = '<div class="lightbox-menu"><ul class="makeMenu lb-menu">';
     $menu = new WT_Menu(WT_I18N::translate('Edit details'));
     $menu->addClass('', '', 'lb-image_edit');
     $menu->addOnclick("return window.open('addmedia.php?action=editmedia&amp;pid=" . $mediaobject->getXref() . "', '_blank', edit_window_specs);");
     $html .= $menu->getMenuAsList();
     $menu = new WT_Menu(WT_I18N::translate('Set link'));
     $menu->addClass('', '', 'lb-image_link');
     $menu->addOnclick("return ilinkitem('" . $mediaobject->getXref() . "','person')");
     $submenu = new WT_Menu(WT_I18N::translate('To individual'), '#');
     $submenu->addOnclick("return ilinkitem('" . $mediaobject->getXref() . "','person')");
     $menu->addSubMenu($submenu);
     $submenu = new WT_Menu(WT_I18N::translate('To family'), '#');
     $submenu->addOnclick("return ilinkitem('" . $mediaobject->getXref() . "','family')");
     $menu->addSubMenu($submenu);
     $submenu = new WT_Menu(WT_I18N::translate('To source'), '#');
     $submenu->addOnclick("return ilinkitem('" . $mediaobject->getXref() . "','source')");
     $menu->addSubMenu($submenu);
     $html .= $menu->getMenuAsList();
     $menu = new WT_Menu(WT_I18N::translate('View details'), $mediaobject->getHtmlUrl());
     $menu->addClass('', '', 'lb-image_view');
     $html .= $menu->getMenuAsList();
     $html .= '</ul></div>';
     return $html;
 }