Esempio n. 1
0
/**
 * Loads styles and js
 *
 */
function _maximenu_modal_render($menu_content = array())
{
    // Skin
    $skin = isset($menu_content['skin']) ? $menu_content['skin'] : FALSE;
    drupal_add_css(MAXIMENU_PLUGINS . '/styles/modal/modal.css');
    if ($skin) {
        drupal_add_css(MAXIMENU_PLUGINS . '/skins/' . $skin . '/' . $skin . '.css');
    }
    // Style - Modal
    $menu = _maximenu_string($menu_content['title']);
    $action = isset($menu_content['action']) ? $menu_content['action'] : 'click';
    $delay = isset($menu_content['delay']) ? $menu_content['delay'] : 1000;
    $scripts = _maximenu_modal_js($menu, $action, $delay);
    // Effects
    $dock = isset($menu_content['float_options']['dock']) ? 1 : 0;
    $jiggly = isset($menu_content['jiggly']) ? 1 : 0;
    $lavalamp = isset($menu_content['lavalamp']) ? 1 : 0;
    $lavalamp_defaults = isset($menu_content['lavalamp_defaults']) ? $menu_content['lavalamp_defaults'] : '';
    $slideup = isset($menu_content['slideup']) ? 1 : 0;
    // adding the scripts
    if ($dock && function_exists('_maximenu_dock')) {
        $scripts .= _maximenu_dock($menu);
    }
    if ($lavalamp && function_exists('_maximenu_lavalamp')) {
        $scripts .= _maximenu_lavalamp($menu, $lavalamp_defaults);
    }
    if ($slideup && function_exists('_maximenu_slideup')) {
        $scripts .= _maximenu_slideup($menu);
    }
    if ($jiggly && function_exists('_maximenu_jiggly')) {
        $scripts .= _maximenu_jiggly($menu);
    }
    // Others
    $active = isset($menu_content['active']) ? $menu_content['active'] : 0;
    $longmenu = isset($menu_content['longmenu']) ? $menu_content['longmenu'] : FALSE;
    $autoscroll = isset($menu_content['autoscroll']) ? 1 : 0;
    // adding the scripts
    if ($active && function_exists('_maximenu_active_js')) {
        $scripts .= _maximenu_active_js($menu, $lavalamp, 'modal');
    }
    if ($longmenu && function_exists('_maximenu_longmenu_js')) {
        $scripts .= _maximenu_longmenu_js($menu, $longmenu);
    }
    if ($autoscroll && function_exists('_maximenu_autoscroll')) {
        $scripts .= _maximenu_autoscroll($menu);
    }
    return $scripts;
}
Esempio n. 2
0
/**
 * Loads styles and js
 *
 */
function _maximenu_drop_render($menu_content = array())
{
    // Skin
    $skin = isset($menu_content['skin']) ? $menu_content['skin'] : FALSE;
    // add css per  Maximenu
    drupal_add_css(MAXIMENU_PLUGINS . '/styles/drop/drop.css');
    if ($skin) {
        drupal_add_css(MAXIMENU_PLUGINS . '/skins/' . $skin . '/' . $skin . '.css');
    }
    // Style - Drop
    $menu = _maximenu_string($menu_content['title']);
    $action = isset($menu_content['action']) ? $menu_content['action'] : 'hover_fast';
    $displace = isset($menu_content['displace']) ? $menu_content['displace'] : 0;
    $delay = isset($menu_content['delay']) ? $menu_content['delay'] : 1000;
    $fadeout = isset($menu_content['fadeout']) ? $menu_content['fadeout'] : 1;
    $scripts = _maximenu_drop_js($menu, $action, $displace, $delay, $fadeout);
    // Effects
    $lavalamp_defaults = isset($menu_content['lavalamp_defaults']) ? $menu_content['lavalamp_defaults'] : '';
    // adding the scripts
    if ($menu_content['dock'] == 1 && function_exists('_maximenu_dock')) {
        $scripts .= _maximenu_dock($menu);
    }
    if ($menu_content['lavalamp'] == 1 && function_exists('_maximenu_lavalamp')) {
        $scripts .= _maximenu_lavalamp($menu, $lavalamp_defaults);
    }
    if ($menu_content['slideup'] == 1 && function_exists('_maximenu_slideup')) {
        $scripts .= _maximenu_slideup($menu);
    }
    if ($menu_content['jiggly'] == 1 && function_exists('_maximenu_jiggly')) {
        $scripts .= _maximenu_jiggly($menu);
    }
    // Others
    $active = isset($menu_content['active']) ? $menu_content['active'] : 0;
    $longmenu = isset($menu_content['longmenu']) ? $menu_content['longmenu'] : FALSE;
    $autoscroll = isset($menu_content['autoscroll']) ? 1 : 0;
    // adding the scripts
    if ($active && function_exists('_maximenu_active_js')) {
        $scripts .= _maximenu_active_js($menu, $menu_content['lavalamp'] == 1, 'drop');
    }
    if ($longmenu && function_exists('_maximenu_longmenu_js')) {
        $scripts .= _maximenu_longmenu_js($menu, $longmenu);
    }
    if ($autoscroll && function_exists('_maximenu_autoscroll')) {
        $scripts .= _maximenu_autoscroll($menu);
    }
    return $scripts;
}