Classic with drop down menus Classic with drop down menus
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Classic with drop down menus

Started by Gene-2008, October 08, 2009, 03:06:31 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Gene-2008

Here I release a theme developed from the classic theme with the only changes those required to make the drop down menus for admin_menu, sys_menu, and sub_menu.

This is done with all the released SVN code.  Only theme files are changed.

The one thing I didn't get working are the words for the headings in other languages.  Those would require an addition to the language files.
If the development team is interested could we get the words added to the language files?

Example can be seen here:
http://gfyoung.homeip.net/cpg15x/index.php?theme=classic_w_drop
Official cpg1.5.x Demo

Attached is the theme files zip.
You can also download it here: https://sourceforge.net/projects/coppermine/files/Themes/1.5.x/cpg1.5.x_theme_classic-w-drop_2.1.zip/download

There  are several other drop down changes I have made in another theme with drop down menus in more places but they at present require some changes to the SVN code.  This is still WIP while I try to get it to work with SVN code.
http://gfyoung.homeip.net/cpg15x/index.php?theme=New15b

Hope you find this helpful and interesting,
Gene


Αndré

#1
Quote from: Gene-2008 on October 08, 2009, 03:06:31 AM
The one thing I didn't get working are the words for the headings in other languages.  Those would require an addition to the language files.
The only non translated string is 'Media/File settings' (see attachment).

Why did you copy all those icons to the theme? As far I can see (almost) all of them will never be used? You can remove all standard icons if you remove
define('THEME_HAS_MENU_ICONS', 16);
in your theme.


There are some issues when plugins add some buttons to the admin menu (see attachment). But that's maybe my fault (I'm not sure how I added these buttons to the menu. E.g. it works for the forum manager).

Gene-2008

Quote from: Αndré on October 08, 2009, 12:13:34 PM
The only non translated string is 'Media/File settings' (see attachment).
Actually the non translated are:
The title for the sys_menu which I labeled as User.  There is a $lang_gallery_admin_menu['users_lnk'] = 'Users';
But I haven't figured out of to get it recognized in the $template_sys_menu template.

The title for the sub_menu which I labeled as Albums.  Like the sub_menu label there are some translations but I don't know how to get them to work.

I addition "Gallery" and the one you pointed out "Media/File setting".  I am open to other suggestions for that as well.

Quote
Why did you copy all those icons to the theme? As far I can see (almost) all of them will never be used? You can remove all standard icons if you remove
define('THEME_HAS_MENU_ICONS', 16);
in your theme.
I meant to do that and had already removed the define('THEME_HAS_MENU_ICONS', 16); so the standard Icons are being used except those that were in the Albums menu.  I fixed the CSS to use the standard ones for those as well and will post latter.

Quote
There are some issues when plugins add some buttons to the admin menu (see attachment). But that's maybe my fault (I'm not sure how I added these buttons to the menu. E.g. it works for the forum manager).
I will look into that today and get back today.

Thanks for the comments,
Gene

jeepguy_1980

The drop down on my site is difficult to read, b/c the background isn't rendered.

Gene-2008

You appear to be missing the button images that should be in the themes/class_w_drop/images directory.
Like:
   Sq_button_drop_up.png
   Sq_button_drop_down.png
   menu_dropa_0_wide.png
   menu_drop_0.gif
  etc

Make sure you unzipped the theme correctly.

Gene

Gene-2008

Quote from: Αndré on October 08, 2009, 12:13:34 PM
There are some issues when plugins add some buttons to the admin menu (see attachment). But that's maybe my fault (I'm not sure how I added these buttons to the menu. E.g. it works for the forum manager).

I can't find the 1.5.x version of the forum manager. Are you using the 1.4 version or an unrelease 1.5 version.
If you can give me a pointer to it I can check to see why it worked and others didn't?

Thanks in advance,
Gene

Joachim Müller

The forum plugin is not being mentioned in a thread of it's own nor the plugins page yet. The only way you can get it is by checking out the subversion repository for the forum plugin

Gene-2008

Quote from: Gene-2008 on October 08, 2009, 04:25:55 PM
I can't find the 1.5.x version of the forum manager. Are you using the 1.4 version or an unrelease 1.5 version.
If you can give me a pointer to it I can check to see why it worked and others didn't?

Thanks in advance,
Gene

@Joachim thanks for the pointer.  I down loaded it and tried to get installed.  It has problems but that is not the purpose of this thread so I will leave that for another thread.

@Αndré What I did find is that forum install is using   "$button = template_extract_block($new_emplate, $before);" to extract the formatting used for the "documentation button" and then replacing the values with those for the forum.
It then adds the button to the admin_menu below the "document button".
It does the same thing using the "Home" button on the sys_menu.

While this appears to work it brings up the issue that the Icon used is the one for the button it copied.
Note this part is not just a drop down menu issue but also a standard config issue.  Note the reuse of the documentation Icon in the classic version.


It looks like some plugins (like bbcControl) are using this style to hook in to admin menu.
http://gfyoung.homeip.net/cpg15x/docs/en/dev_plugin_api.htm#plugin_api_tutorial_button_admin_menu

$thisplugin->add_filter('admin_menu','coffee_maker_config_button');

function coffee_maker_bar_config_button($admin_menu){
    global $lang_plugin_coffee_maker, $CONFIG, $coffee_maker_icon_array;
    if ($CONFIG['plugin_coffee_maker_config_link'] == 1) {
    $new_button = '<div class="admin_menu admin_float"><a href="index.php?file=coffee_maker/index&action=configure"';
    $new_button .= ' title="' . $lang_plugin_coffee_maker['config'] . '">';
    $new_button .= $coffee_maker_icon_array['config_menu'] . $lang_plugin_coffee_maker['config'] . '</a></div>';
    $look_for = '<!-- END export -->'; // This is where you determine the place in the admin menu
    $admin_menu = str_replace($look_for, $look_for . $new_button, $admin_menu);
    }
    return $admin_menu;
}


Some are doing their own thing like the forum plugin

I'm not sure if any are using this suggested coding or if it applies?
http://gfyoung.homeip.net/cpg15x/docs/en/dev_plugin_api.htm#plugin_api_tutorial_button_overall_menu

Suggestions on how to proceed are certainly welcomed,
Gene


Joachim Müller

Hm. Plugin writing and theming are two different animals. The actions and filters that are available inside the plugin API can of course be accessed by non-plugin code, but I'm not convinced that that's a good idea.

Joachim

Gene-2008

Quote from: Joachim Müller on October 09, 2009, 07:24:37 AM
Hm. Plugin writing and theming are two different animals. The actions and filters that are available inside the plugin API can of course be accessed by non-plugin code, but I'm not convinced that that's a good idea.

Joachim

I know they are different.   My points were:$thisplugin->add_filter('sys_menu','coffee_maker_sys_button');

function coffee_maker_bar_sys_button($menu) {
    global $lang_plugin_coffee_maker, $template_sys_menu_spacer, $CONFIG;
    if ($CONFIG['plugin_coffee_maker_how'] == 4) {
coffee_maker_bar_language(); // Call the function that populates the language variable
        $new_button = array();
        $new_button[0][0] = $lang_plugin_coffee_maker['picinfo_heading'];
        $new_button[0][1] = $lang_plugin_coffee_maker['menu'];
        $new_button[0][2] = 'index.php?file=coffee_maker/index';
        $new_button[0][3] = 'coffee_maker';
        $new_button[0][4] = $template_sys_menu_spacer;
        $new_button[0][5] = 'rel="nofollow"';
        array_splice($menu, count($menu)-1, 0, $new_button);
    }
    return $menu;
}



  • Would give a standard way.

One suggestion I would make on the above is to also allow the passing of Icon information.
Gene

Gene-2008

Quote from: jeepguy_1980 on October 08, 2009, 03:31:21 PM
The drop down on my site is difficult to read, b/c the background isn't rendered.

I finally found that this is an issue with the length of filenames, don't know were the restriction is.
You can fix by looking for and changing the names of the .png .jpg and .gif used in the theme to something shorter.
I.e. strip the menu_ and menu_image_ from the names of the images AND the style.css.

I will try to update the themes files asap.

Thanks for reporting...hope you get it working.

Gene


Timos-Welt

Hello Gene-2008,

great work, please go on!

Two things you could improve:

1. You link to the wrong coppermine logo.
In template.html, change
<img id="logo" src="themes/classic/images/coppermine-logo.png" alt="Logo" />
to
<img id="logo" src="themes/classic_w_drop/images/coppermine-logo.png" alt="Logo" />

2. Preload your menu background images to improve user experience.
I recommend to not use Javascript, because if you did, preloading would start after the last thumb has been loaded (which is too late). Instead, you could insert in template.html directly after the body-tag this code:
<img src="themes/classic_w_drop/images/menu_drop_0.gif" width="0" height="0" style="padding:0px;margin:0px;border-width:0px;outline-width:0px;" alt="place holder" />
<img src="themes/classic_w_drop/images/menu_drop_1_grey.png" width="0" height="0" style="padding:0px;margin:0px;border-width:0px;outline-width:0px;" alt="place holder" />
<img src="themes/classic_w_drop/images/menu_dropa_0_wide.png" width="0" height="0" style="padding:0px;margin:0px;border-width:0px;outline-width:0px;" alt="place holder" />
<img src="themes/classic_w_drop/images/menu_dropba_1_grey_wide.png" width="0" height="0" style="padding:0px;margin:0px;border-width:0px;outline-width:0px;" alt="place holder" />


This way, the background images of the menu will be the first images of the website to be cached and will be available immediately, most likely before the user is able to point at the menu bar.

regards
Timo

Timos-Welt

Another note:
Your menu doesn't work in IE<=6 at all, and it does not provide any other way to navigate there either. This could probably easily improved by using some CSS. It's not neccessary to have the dropdown functionality in IE6, but I think the menu should be completely visible from the start, moving the categories down a bit to not overlap them. This way, old fashioned users could at least use the site.

Gene-2008

Quote from: Timos-Welt on November 09, 2009, 08:28:22 AM
Another note:
Your menu doesn't work in IE<=6 at all, and it does not provide any other way to navigate there either.

Ok well I have finally gotten this to work with IE6.

I now works (or should  :D ) with IE 6,7,8.  And FF.

I also made the changes suggested above.

Please let me know if you see any issues...thanks in advance,
Gene

Joachim Müller


internetking

there seem a bug with one of the memu....  it is on http://photos.hulds.com

see attached pic for the results....



Αndré

The export feature has been dropped, so the theme needs to be adjusted accordingly.

Αndré

Attached version 2.1 to initial post. Will upload to the demo and sourceforge soon.

Αndré