Commit afef82a7 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

do not use relative path for image urls in admin toolbox.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28320 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6af5f50a
...@@ -76,7 +76,7 @@ current_web_section_translated_portal_type = current_web_section.getTranslatedPo ...@@ -76,7 +76,7 @@ current_web_section_translated_portal_type = current_web_section.getTranslatedPo
action_dict = request.get(\'actions\', {}) # XXX actions needs to be renamed to action_dict\n action_dict = request.get(\'actions\', {}) # XXX actions needs to be renamed to action_dict\n
exchange_action_list = action_dict.get(\'object_exchange\', [])\n exchange_action_list = action_dict.get(\'object_exchange\', [])\n
button_action_list = action_dict.get(\'object_button\', [])\n button_action_list = action_dict.get(\'object_button\', [])\n
portal_url = context.portal_url()\n portal_url = getattr(context, \'getWebSiteValue\', context.getPortalObject)().absolute_url()\n
http_parameters = request.get(\'http_parameters\', \'\')\n http_parameters = request.get(\'http_parameters\', \'\')\n
http_parameters = http_parameters.replace(\'editable_mode\', \'dummy_editable_mode\')\n http_parameters = http_parameters.replace(\'editable_mode\', \'dummy_editable_mode\')\n
\n \n
...@@ -102,13 +102,13 @@ if not editable_mode:\n ...@@ -102,13 +102,13 @@ if not editable_mode:\n
result.append(dict(\n result.append(dict(\n
url = "%s/view?editable_mode:int=1&%s" \n url = "%s/view?editable_mode:int=1&%s" \n
%(editable_absolute_url, http_parameters),\n %(editable_absolute_url, http_parameters),\n
icon = context.getIcon() or \'file_icon.gif\',\n icon = "%s/%s" % (portal_url, context.getIcon(relative_to_portal=True) or \'file_icon.gif\'),\n
title = edit_title,\n title = edit_title,\n
label = "%s Icon" % translated_portal_type,))\n label = "%s Icon" % translated_portal_type,))\n
else: \n else: \n
result.append(dict(\n result.append(dict(\n
url = "%s/view?editable_mode:int=0&%s" % (absolute_url, http_parameters),\n url = "%s/view?editable_mode:int=0&%s" % (absolute_url, http_parameters),\n
icon = context.getIcon() or \'file_icon.gif\',\n icon = "%s/%s" % (portal_url, context.getIcon(relative_to_portal=True) or \'file_icon.gif\'),\n
title = translateString("View ${portal_type}", \n title = translateString("View ${portal_type}", \n
mapping=dict(portal_type=translated_portal_type)),\n mapping=dict(portal_type=translated_portal_type)),\n
label = "%s Icon" % translated_portal_type,))\n label = "%s Icon" % translated_portal_type,))\n
...@@ -117,7 +117,7 @@ else: \n ...@@ -117,7 +117,7 @@ else: \n
if portal_type not in (\'Web Section\', \'Web Site\'): \n if portal_type not in (\'Web Section\', \'Web Site\'): \n
result.append(dict(\n result.append(dict(\n
url = "%s/view?editable_mode=1" % current_web_section.absolute_url(),\n url = "%s/view?editable_mode=1" % current_web_section.absolute_url(),\n
icon = current_web_section.getIcon(),\n icon = "%s/%s" % (portal_url, current_web_section.getIcon(relative_to_portal=True)),\n
title = translateString("Edit Parent ${portal_type}",\n title = translateString("Edit Parent ${portal_type}",\n
mapping=dict(portal_type=current_web_section_translated_portal_type)),\n mapping=dict(portal_type=current_web_section_translated_portal_type)),\n
label = "%s Icon" % current_web_section_translated_portal_type,))\n label = "%s Icon" % current_web_section_translated_portal_type,))\n
...@@ -193,16 +193,17 @@ return result\n ...@@ -193,16 +193,17 @@ return result\n
<string>action_dict</string> <string>action_dict</string>
<string>exchange_action_list</string> <string>exchange_action_list</string>
<string>button_action_list</string> <string>button_action_list</string>
<string>getattr</string>
<string>portal_url</string> <string>portal_url</string>
<string>http_parameters</string> <string>http_parameters</string>
<string>absolute_url</string> <string>absolute_url</string>
<string>getattr</string>
<string>editable_absolute_url</string> <string>editable_absolute_url</string>
<string>getActionTitleForContext</string> <string>getActionTitleForContext</string>
<string>int</string> <string>int</string>
<string>editable_mode</string> <string>editable_mode</string>
<string>edit_title</string> <string>edit_title</string>
<string>dict</string> <string>dict</string>
<string>True</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>action</string> <string>action</string>
<string>_getitem_</string> <string>_getitem_</string>
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
here.Base_filterDuplicateActions(\n here.Base_filterDuplicateActions(\n
here.portal_actions.listFilteredActionsFor(here));\n here.portal_actions.listFilteredActionsFor(here));\n
dummy python:request.set(\'actions\', actions);\n dummy python:request.set(\'actions\', actions);\n
portal_url python: getattr(here, \'getWebSiteValue\', here.getPortalObject)().absolute_url();\n
portal_type here/getPortalType">\n portal_type here/getPortalType">\n
\n \n
<!-- XXX is this really useful - called how many times ?? - tried to removed but failed -->\n <!-- XXX is this really useful - called how many times ?? - tried to removed but failed -->\n
...@@ -166,7 +167,8 @@ ...@@ -166,7 +167,8 @@
<button alt=\'Clone &amp; Edit\' id="clone_action_button" \n <button alt=\'Clone &amp; Edit\' id="clone_action_button" \n
title=\'Clone &amp; Edit\'\n title=\'Clone &amp; Edit\'\n
name="Base_cloneContent:method">\n name="Base_cloneContent:method">\n
<img src="admin_toolbox_clone_document.png" id="clone_action_icon"/>\n <img src="admin_toolbox_clone_document.png" id="clone_action_icon"\n
tal:attributes="src string:$portal_url/admin_toolbox_clone_document.png" />\n
<span id="duplicate_document_action">Clone &amp; Edit</span>\n <span id="duplicate_document_action">Clone &amp; Edit</span>\n
</button>\n </button>\n
</div>\n </div>\n
...@@ -174,14 +176,13 @@ ...@@ -174,14 +176,13 @@
\n \n
</fieldset>\n </fieldset>\n
\n \n
<script type="text/javascript" language="JavaScript">\n <script type="text/javascript" language="JavaScript" tal:content="string:\n
<!--\n
// preload action icons\n // preload action icons\n
if (document.images) {\n if (document.images) {\n
clone_icon = new Image();\n clone_icon = new Image();\n
new_icon = new Image();\n new_icon = new Image();\n
clone_icon.src = "admin_toolbox_clone_document.png";\n clone_icon.src = \'$portal_url/admin_toolbox_clone_document.png\';\n
new_icon.src = "admin_toolbox_new_document.png";\n new_icon.src = \'$portal_url/admin_toolbox_new_document.png\';\n
}\n }\n
\n \n
function setCreationMode (sel) {\n function setCreationMode (sel) {\n
...@@ -210,7 +211,7 @@ ...@@ -210,7 +211,7 @@
document.getElementById(\'duplicate_document_action\').innerHTML = action_name;\n document.getElementById(\'duplicate_document_action\').innerHTML = action_name;\n
\n \n
// replace the action icon\n // replace the action icon\n
document.getElementById(\'clone_action_icon\').src = eval(action + "_icon.src");\n document.getElementById(\'clone_action_icon\').src = eval(action + \'_icon.src\');\n
\n \n
// update action button alt & title\n // update action button alt & title\n
var button = document.getElementById(\'clone_action_button\');\n var button = document.getElementById(\'clone_action_button\');\n
...@@ -218,8 +219,7 @@ ...@@ -218,8 +219,7 @@
button.title = action_name;\n button.title = action_name;\n
button.name = name;\n button.name = name;\n
}\n }\n
-->\n " />\n
</script>\n
</div>\n </div>\n
</tal:block> </tal:block>
......
834 835
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment