Replace icons with text - HOW TO

JP

Member
I thought I had read in one of these posts on how to replace the Delete / Update / Details icons with text links and the only thing I found was this post and it may be the original post I used to change my install but is lacking in detail so I'll explain how I changed my icons to text.

The line numbers referenced in bold are from an untouched business_logic.php in DaDaBIK version 4.2

Go to line:

2980 $results_table .= "<a class=\"onlyscreen\" target=\"_".$edit_target_window."\" href=\"".$dadabik_main_file."?table_name=".urlencode($table_name)."&function=edit&where_field=".urlencode($where_field)."&where_value=".urlencode($where_value)."\"><img border=\"0\" src=\"".$edit_icon."\" alt=\"".$submit_buttons_ar["edit"]."\" title=\"".$submit_buttons_ar["edit"]."\"></a>";

And replace with:

$results_table .= "<a class=\"onlyscreen\" target=\"_".$edit_target_window."\" href=\"".$dadabik_main_file."?table_name=".urlencode($table_name)."&function=edit&where_field=".urlencode($where_field)."&where_value=".urlencode($where_value)."\">Update</a>&nbsp;&nbsp;";

Go to line:

2994 $results_table .= "&where_field=".urlencode($where_field)."&where_value=".urlencode($where_value)."\"><img border=\"0\" src=\"".$delete_icon."\" alt=\"".$submit_buttons_ar["delete"]."\" title=\"".$submit_buttons_ar["delete"]."\"></a>";

And replace with:

$results_table .= "&where_field=".urlencode($where_field)."&where_value=".urlencode($where_value)."\">Delete</a>&nbsp;&nbsp;";

Go to line:

2998 $results_table .= "<a class=\"onlyscreen\" target=\"_".$edit_target_window."\" href=\"".$dadabik_main_file."?table_name=".urlencode($table_name)."&function=details&where_field=".urlencode($where_field)."&where_value=".urlencode($where_value)."\"><img border=\"0\" src=\"".$details_icon."\" alt=\"".$submit_buttons_ar["details"]."\" title=\"".$submit_buttons_ar["details"]."\"></a>";

And replace with:

$results_table .= "<a class=\"onlyscreen\" target=\"_".$edit_target_window."\" href=\"".$dadabik_main_file."?table_name=".urlencode($table_name)."&function=details&where_field=".urlencode($where_field)."&where_value=".urlencode($where_value)."\">Details</a>";


Working demo of this mod can be seen here.

Hope this helps anyone who may want to replace the default icons for Delete / Update / Details with simple text links.



Post Edited (11-22-09 02:18)
 

meanster99

Well-known member
Excellent post! For me, using untouched version 4.3, the lines were on 3021, 3042 and 3049 respectively, and using the "& & " at the end of the first two edits didn't work for me - I actually removed them and pressed the spacebar twice instead - all worked OK.

i.e. instead of (won't use code tags for this part of this post as easier to see the difference as plain text):

$results_table .= "<a class=\"onlyscreen\" target=\"_".$edit_target_window."\" href=\"".$dadabik_main_file."?table_name=".urlencode($table_name)."&function=edit&where_field=".urlencode($where_field)."&where_value=".urlencode($where_value)."\">Update</a>&nbsp;&nbsp;";

For browsers that may not display the whole code above (I know Chrome v15 doesn't):
[pre]
$results_table .= "<a class=\"onlyscreen\" target=\"_".$edit_target_window."\" href=\"".$dadabik_main_file."?table_name=".urlencode($table_name)."&function=edit&where_field=".urlencode($where_field)."&where_value=".urlencode($where_value)."\">Update</a>&nbsp;&nbsp;";
[/pre]

I put:

$results_table .= "<a class=\"onlyscreen\" target=\"_".$edit_target_window."\" href=\"".$dadabik_main_file."?table_name=".urlencode($table_name)."&function=edit&where_field=".urlencode($where_field)."&where_value=".urlencode($where_value)."\">Update</a> ";

and did the same for the delete button line.

Also, I had to delete (I actually commented out rather than delete, just in case!) lines 3027:

[pre]
$results_table .= "\"><img border=\"0\" src=\"".$edit_icon."\" alt=\"".$submit_buttons_ar["edit"]."\" title=\"".$submit_buttons_ar["edit"]."\"></a>";
[/pre]

and line 3055:

[pre]
$results_table .= "\"><img border=\"0\" src=\"".$details_icon."\" alt=\"".$submit_buttons_ar["details"]."\" title=\"".$submit_buttons_ar["details"]."\"></a>";
[/pre]

Hope this adds something to this very useful post...
 

meanster99

Well-known member
Need to add that the "& & " does work when done correctly, which should be just "  " without the extra ampersands (&).
 

JP

Member
I just checked the code in my active demo (version 4.2) and it is "  " just like you posted, not sure how or why the ampersands (&amp) were in there, nice catch meanster99 thanks :)
 

meanster99

Well-known member
No worries JP - have been using your active demo as my benchmark/goal - absolutely love what you've done with it - you really have taken the dadabik default system and turned it into what looks like a bespoke system that you would pay thousands for. I have to admire you work sir!

Don't know if you saw my post re changing the submit buttons, but as it was your demo system I saw the windows standard submit buttons on, I was actually hoping you would respond to my question! Can you remember?
 

JP

Member
Thank you very much for the compliment. I could not have made the demo the way it is without great help from people on the forum. Extra thanks goes to DebbieS for that. Speaking of DebbieS it looks like she was able to answer your question about the standard Windows submit button :)
 

proenza

New member
The easy way just go to the images folder find the icons rename them with something else ! for ex: details2.png no code same result !
 
Top