coppermine-gallery / cpg1.6.x

GNU General Public License v3.0
66 stars 31 forks source link

Bad icon path in albmgr.php #76

Open electrohike opened 1 month ago

electrohike commented 1 month ago

While developing a theme with custom icons using 'THEME_HAS_MENU_ICONS', I've found out a small mistake in albmgr.php

The path of the icon shown after each album title for uploading images is hardcoded instead of using the cpg_fetch_icon function. Thus, any custom icon is not shown correctly.

The fix is quite easy :

  1. In $icon_array, add a key : $icon_array['upload'] = cpg_fetch_icon('upload', 0, $lang_albmgr_php['upload_files'])
  2. On line 220 change <a href="upload.php?album={$album['aid']}"><img src="images/icons/upload.png" title="{$lang_albmgr_php['upload_files']}" /></a> to <a href="upload.php?album={$album['aid']}">{$icon_array['upload']}</a>
electrohike commented 1 month ago

And my solution does not cover at least one use-case : When user clics on "new album", it is managed from javascript. And it is still the standard icon that is shown.

Looking into to page code, if found a line stating var js_vars = {(...)"icon_dir":"images\/icons\/","(...),"icon_close_path":"images\/icons\/close.png"(...) I guess those two values should be changed to give the actual theme path. But I've not found where to do that in albmgr.php. There are some lines starting with "set_js_var", true, but I did not found anything about icons.