Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad icon path in albmgr.php #76

Open
electrohike opened this issue Jul 19, 2024 · 1 comment
Open

Bad icon path in albmgr.php #76

electrohike opened this issue Jul 19, 2024 · 1 comment

Comments

@electrohike
Copy link

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant