Commit 3a3d77bd authored by Kevin Deldycke's avatar Kevin Deldycke

New version of generic admin tool box (work still in progress)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9956 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 48431c1e
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>global edit_links\n
edit_links = []\n
\n
# Generic function to make edit links consistent\n
def addLink(doc, portal_type, level):\n
global edit_links\n
# Remove trailing slashes\n
doc_url = doc.WebSite_getDocumentUrl()\n
while doc_url.endswith(\'/\'):\n
doc_url = doc_url[:-1]\n
new_link = { \'doc\' : doc\n
, \'portal_type\': portal_type\n
, \'url\' : \'%s/view?editable_mode=1\' % doc_url\n
, \'label\' : \'Edit %s %s\' % (level, portal_type)\n
, \'icon\' : \'admin-toolbox-%s.png\' % portal_type.lower().replace(\' \', \'-\')\n
}\n
edit_links.append(new_link)\n
\n
# Display current doc\n
current_doc = context\n
current_pt = current_doc.getPortalType()\n
addLink(current_doc, current_pt, \'Displayed\')\n
\n
# Display current doc\n
if current_pt == \'Web Page\':\n
parent_doc = current_doc.aq_parent\n
addLink(parent_doc, parent_doc.getPortalType(), \'Parent\')\n
\n
\n
\n
\n
\n
return edit_links\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>truc</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>truc</string>
<string>edit_links</string>
<string>addLink</string>
<string>context</string>
<string>current_doc</string>
<string>_getattr_</string>
<string>current_pt</string>
<string>parent_doc</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>AdminToolbox_getEditShortcutList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>OFS.Image</string>
<string>Image</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>admin-tool-box.png</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>image/png</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="base64">iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAANkE3LLaAgAAAs1JREFU
eJx9U11Ik2EYPTp1ueXU5dLpMvMnsEjnJq7yB5WyMEgIlTQVRU1YA/MiVpgEilPvugjUK2mKdhFN
Niy0lQOxtilp7sJkKeq+YWvCN/Sz+bP2dpNh/p3L85xznsMDDwBAIpHkRkdHX8DRCKipqbmv1+vH
NBrNRwDB/01LSko6JiYmfmVlZV05zN3Z2dlLCCEURf3OzMxU/KX9AZzY1bBbW1t14+PjVgC8vea0
tLQcmqaJ2+0m1dXV7bt8V1fXy6Kiogd7tb6FhYUvVCrVWwABu2R+fn4lTdPE4XAQk8m0KJVKZUql
stnj8ZC8vLzaA3UrKip6GhsbNQBYABATEyObn58nNpuNrKysEIqitmmaJmaz2R0SEpLkuz9ArVbX
0jRN6uvrewAENDQ0yLlcLgDA6/WCzWb72+12tLS0dLtcrhmfw44GwK+urq6/oKAgQya7LGTWXFCp
2nTLFLUYFhYmNBqNI1arVQ1gy++IAHZKcgo3NjZOSK/+wLuxyYXuvj453G5qv5C1n+DxePzBwUHt
paSk69ubGzDZdvCZnRoqPHuO/31Mpz02QCDgRKjVAzpxcko6L+gkDIZR+6Nei3PdL5wfJ04Vh0dG
nl4wDg8d2lkoFEaPDI9MLy0tE6fTSSwWy6ZIFHETQCInt8kmaZ4k5W9+kozapva9PhYAiESieK1W
+z4+ISERIPB6vSgtLX04Ozs3AGB1x/bFvOYbcdsbKOAkXL2WEciGxz7zaQwAWDwej6/RaPT9/a+m
GGZtXSwWn6mqquoYHR1t+7fGu23bsU9/XWOJChB4in0+PS/XZ8tFO+amTFAoFI83NjaIQqF4ZjAY
vsnl8teHHRcAECi4w7313C1tNpPyQZok5BbfRVlZ2ROGYQjDMESpVA5h3y8cACeqIrhYTVKfflgP
jbl4AwCCsrOz5RKJpBIA91jzLkLi77G4UTkA8AemGSncz8QQ2gAAAABJRU5ErkJggg==</string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <int>16</int> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>790</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>16</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
<pickle> <pickle>
<tuple> <tuple>
<tuple> <tuple>
<string>OFS.Folder</string> <string>Products.PageTemplates.ZopePageTemplate</string>
<string>Folder</string> <string>ZopePageTemplate</string>
</tuple> </tuple>
<none/> <none/>
</tuple> </tuple>
...@@ -19,18 +19,184 @@ ...@@ -19,18 +19,184 @@
</value> </value>
</item> </item>
<item> <item>
<key> <string>_objects</string> </key> <key> <string>_bind_names</string> </key>
<value> <value>
<tuple/> <object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value> </value>
</item> </item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!-- Floating Panel -->\n
\n
<!-- header_definitions must be re-called and is_web_mode rededined because calling\n
the current page template through editor_field in the form layout seems to reset\n
the context needed by action drop-down list.\n
\n
TODO: Is this case should be handle by automaticcaly by erp5_xhtml_style ?\n
-->\n
\n
\n
<tal:block\n
tal:define="is_web_mode python: True;\n
portal_type python: here.getPortalType();\n
">\n
<!-- widget_list python: [ \'admin_tool_menus\']"\n
, \'admin_tool_edit\'\n
, \'admin_tool_duplicate_document\'\n
, \'admin_tool_duplicate_section\'\n
, \'admin_tool_debug\'\n
]">\n
-->\n
\n
<tal:block metal:use-macro="here/global_definitions/macros/header_definitions"/>\n
\n
<div id="adminToolBox">\n
\n
<script type="text/javascript" language="JavaScript" src="js/cookie_utils.js"></script>\n
<script type="text/javascript" language="JavaScript">\n
<!--\n
// global variables\n
var cookie_name = "erp5_admin_tool_box_hidden_state"\n
var hidden_class = "doNotDisplay";\n
var elements_to_hide_name = "adminSection";\n
\n
function hideElements (hide) {\n
if (hide == true) {\n
new_hidden_class = hidden_class;\n
} else if (hide == false) {\n
new_hidden_class = "";\n
} else {\n
return;\n
}\n
// set the visibility of each element\n
element_list = document.getElementsByName(elements_to_hide_name);\n
for (var i = 0; i < element_list.length; i++) {\n
element_list[i].className = new_hidden_class;\n
}\n
// update cookie to remember the visibility status\n
days = 1; // cookie lifetime\n
stop_date = new Date();\n
stop_date.setTime(stop_date.getTime() + (days*24*60*60*1000));\n
SetCookie(cookie_name, hidden_status, stop_date);\n
}\n
\n
function autoHide () {\n
element_list = document.getElementsByName(elements_to_hide_name);\n
hidden_status = false;\n
// compute the global visibility only once to avoid inconsistencies\n
if (element_list[0].className != hidden_class) {\n
hidden_status = true;\n
}\n
hideElements(hidden_status);\n
}\n
\n
function initHiddenState () {\n
hidden_status = GetCookie(cookie_name);\n
// be carefull: cookies contain string values\n
if (hidden_status == "false") {\n
hidden_status = false;\n
} else if (hidden_status == "true") {\n
hidden_status = true;\n
}\n
// restore the previous state\n
hideElements(hidden_status);\n
}\n
-->\n
</script>\n
\n
<h3 title="Click to Collapse / Expand administrator toolbar." onclick="autoHide()" class="warning"><img src="admin-tool-box.png"/><span name="adminSection"> Admin Tool Box</span></h3>\n
\n
<!-- Edit button menu -->\n
<div name="adminSection">\n
<h3>Edit</h3>\n
<ul tal:define="edit_links python: context.AdminToolbox_getEditShortcutList(truc=context)">\n
<li tal:repeat="link edit_links">\n
<a tal:attributes="href python: link[\'url\']">\n
<img tal:attributes="src python: link[\'icon\'];\n
title python: link[\'portal_type\'];\n
alt python: \'%s Icon\' % link[\'portal_type\'];"/>\n
<tal:block tal:replace="python: link[\'label\']"/>\n
</a>\n
</li>\n
\n
<!--li tal:condition="python: not is_portal_root">\n
<a tal:attributes="href python: \'%s/view?editable_mode=1\' % context.WebSite_getSection();"\n
><img src="pictures/section.png"/> Edit <tal:block tal:content="python: (is_webdoc and \'Parent \') or \'Current \'"/>Section</a>\n
</li-->\n
\n
<!--li tal:condition="python: (not is_portal_root) and ((is_section and valid_default_doc and not is_edit_mode) or is_webdoc)">\n
<a tal:attributes="href python: \'%s/view?editable_mode=1\' % context.WebSite_getDocumentPhysicalPath();"\n
><img src="pictures/webpage.png"/> Edit <tal:block tal:content="python: (is_section and \'Default \') or \'Current \'"/>Page</a>\n
</li-->\n
\n
<!--li tal:define="context_url python: context.absolute_url();\n
url_list python: context_url[context_url.find(\'://\')+3:].split(\'/\');\n
is_secure python: context_url[4].lower() == \'s\';\n
base_url python: url_list[0];\n
doc_url python: \'/\'.join(url_list[1:]);\n
webdav_prefix python: \'webdav\' + (is_secure and \'s\' or \'\');\n
WEBDAV_PORT python: \'443\'">\n
<a tal:attributes="href python: \'%s://webdav.%s:%s/%s\' % (webdav_prefix, base_url, WEBDAV_PORT, doc_url)"\n
><img src="pictures/webdav.png" tal:attributes="src string:${portal_url}/pictures/webdav.png"/> Open <tal:block tal:content="python: (is_secure and \'Secured \') or \'Unsecured \'"/>webdav</a>\n
</li-->\n
</ul>\n
</div>\n
\n
<!-- Action drop-down contextual menu -->\n
<div name="adminSection">\n
<h3><tal:block tal:content="portal_type"/> Actions</h3>\n
<tal:block metal:use-macro="here/context_box_render/macros/action"/>\n
</div>\n
\n
<!-- Generic attempt -->\n
<!--div name="adminSection" tal:repeat="widget python: widget_list">\n
<tal:block tal:define="widget_object python: here[widget]">\n
<tal:block metal:use-macro="widget_object/macros/master"/>\n
</tal:block>\n
</div-->\n
\n
</div>\n
</tal:block>
]]></string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>admin_toolbox</string> </value> <value> <string>admin_toolbox</string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Outdated code: need upgrade</string> </value> <value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>OFS.Folder</string>
<string>Folder</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>admin_toolboxXXX</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Outdated code: need upgrade</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -185,6 +185,10 @@ return new_ref\n ...@@ -185,6 +185,10 @@ return new_ref\n
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>WebSite_getCopyOfReference</string> </value> <value> <string>WebSite_getCopyOfReference</string> </value>
</item> </item>
<item>
<key> <string>title</string> </key>
<value> <string>Used ?</string> </value>
</item>
<item> <item>
<key> <string>warnings</string> </key> <key> <string>warnings</string> </key>
<value> <value>
......
...@@ -87,7 +87,7 @@ IGNORED_FORM_ID_LIST = [ \\\n ...@@ -87,7 +87,7 @@ IGNORED_FORM_ID_LIST = [ \\\n
, \'x\', \'y\'\n , \'x\', \'y\'\n
# custom forms field ids\n # custom forms field ids\n
, \'new_portal_type\', \'destination_section\'\n , \'new_portal_type\', \'destination_section\'\n
]\n ]\n
\n \n
directory = context.restrictedTraverse(context.getRelativeUrl()).getParent()\n directory = context.restrictedTraverse(context.getRelativeUrl()).getParent()\n
creation_mode = form_data[\'document_action_mode\']\n creation_mode = form_data[\'document_action_mode\']\n
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PageTemplates.ZopePageTemplate</string>
<string>ZopePageTemplate</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<tal:block metal:define-macro="master">\n
\n
<h3>Debug Menu</h3>\n
\n
<ul>\n
\n
<li>\n
<pre>\n
<tal:block tal:content="python: \'is_edit_mode = \' + repr(is_edit_mode)" />\n
<tal:block tal:content="python: \'is_section = \' + repr(is_section)" />\n
<tal:block tal:content="python: \'is_webdoc = \' + repr(is_webdoc)" />\n
<tal:block tal:content="python: \'is_portal_root = \' + repr(is_portal_root)" />\n
<tal:block tal:content="python: \'valid_default_doc = \' + repr(valid_default_doc)"/>\n
</pre>\n
</li>\n
\n
<li>\n
<a tal:attributes="href python: \'%s/view?ignore_layout=1\' % context.WebSite_getSection();"\n
><img src="pictures/section.png"/> Edit <tal:block tal:content="python: (is_webdoc and \'Parent \') or \'Current \'"/>Section in ERP5</a>\n
</li>\n
\n
<li tal:condition="python: (is_section and valid_default_doc and not is_edit_mode) or is_webdoc">\n
<a tal:attributes="href python: \'%s/view?ignore_layout=1\' % context.WebSite_getDocumentPhysicalPath();"\n
><img src="pictures/webpage.png" tal:attributes="src string:${portal_url}/pictures/webpage.png"/> Edit <tal:block tal:content="python: (is_section and \'Default \') or \'Current \'"/>Page in ERP5</a>\n
</li>\n
\n
</ul>\n
\n
</tal:block>\n
]]></string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>admin_tool_debug</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PageTemplates.ZopePageTemplate</string>
<string>ZopePageTemplate</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<tal:block metal:define-macro="master"\n
tal:define="document context/WebSite_getDocumentValue;"\n
tal:condition="python: (is_section and valid_default_doc and not is_edit_mode) or is_webdoc">\n
\n
<form name="tool_create" method="post" action="WebSite_newContent">\n
\n
<input id="document_action_mode" name="document_action_mode" value="clone" type="hidden"/>\n
\n
<h3>\n
<span id="create_new_document_title"></span>\n
<span id="clone_document_title">Clone <tal:block tal:content="python: (is_section and \'Default \') or \'Current \'"/>Page</span>\n
</h3>\n
\n
<table cellspacing="1" cellpadding="0" border="0">\n
<tr>\n
<td>Title</td>\n
<td><input class="input" size="20" type="text" name="title" tal:attributes="value document/getTitle | nothing"/></td>\n
</tr>\n
<tr>\n
<td>Page URI</td>\n
<td><input class="input" size="20" type="text" name="reference" tal:attributes="value document/getReference | nothing"/></td>\n
</tr>\n
<tr>\n
<td>Version</td>\n
<td><input class="input" size="5" type="text" name="version" tal:attributes="value document/getVersion | nothing"/></td>\n
</tr>\n
<tr>\n
<td>Language</td>\n
<td><input class="input" size="5" type="text" name="language" tal:attributes="value document/getLanguage | nothing"/></td>\n
<!--select name="language" size="1"\n
tal:define="language_map python: here.Localizer.get_languages_map()">\n
<tal:block tal:repeat="language language_map">\n
<tal:block tal:condition="python: document.getLanguage() == language[\'id\'] or language[\'selected\']">\n
<option tal:attributes="value language/id"\n
tal:content="language/id"\n
selected/>\n
</tal:block>\n
<tal:block tal:condition="python: not(document.getLanguage() == language[\'id\'] or language[\'selected\'])">\n
<option tal:attributes="value language/id"\n
tal:content="language/id"/>\n
</tal:block>\n
</tal:block>\n
</select-->\n
</tr>\n
\n
<script type="text/javascript" language="JavaScript">\n
<!--\n
// preload action icons\n
if (document.images) {\n
clone_icon = new Image();\n
new_icon = new Image();\n
clone_icon.src = "pictures/clone-document.png";\n
new_icon.src = "pictures/new-document.png";\n
}\n
\n
function setCreationMode (sel) {\n
// default is cloning\n
var action = \'clone\';\n
var action_name = \'Clone &amp; Edit\';\n
var icon = \'clone-document.png\';\n
var clone_class = \'\';\n
var new_title = \'\';\n
\n
// a portal type is given, so create a new document\n
var portal_type = sel.options[sel.selectedIndex].value;\n
if (portal_type != \'None\') {\n
action = \'new\'\n
action_name = \'Create New &amp; Edit\';\n
icon = \'new-document.png\';\n
clone_class = \'doNotDisplay\';\n
new_title = \'Create New Document\';\n
}\n
\n
// update action dependent values\n
document.getElementById(\'document_action_mode\' ).value = action;\n
document.getElementById(\'create_new_document_title\').innerHTML = new_title;\n
document.getElementById(\'clone_document_title\' ).className = clone_class;\n
document.getElementById(\'duplicate_document_action\').innerHTML = action_name;\n
\n
// replace the action icon\n
document.getElementById(\'clone_action_icon\').src = eval(action + "_icon.src");\n
\n
// update action button alt & title\n
var button = document.getElementById(\'clone_action_button\');\n
button.alt = action_name;\n
button.title = action_name;\n
}\n
-->\n
</script>\n
\n
<tr>\n
<td>Type</td>\n
<td>\n
<select class="input" name="new_portal_type" size="1" onchange="setCreationMode(this)">\n
<option value="None" selected>&mdash; Same as Current &mdash;</option>\n
<tal:block tal:repeat="portal_type python: here.portal_types.objectValues()">\n
<option tal:condition="python: \'web_document\' in getattr(portal_type, \'group_list\', [])"\n
tal:content="portal_type/id"\n
tal:attributes="value portal_type/id"/>\n
</tal:block>\n
</select>\n
</td>\n
</tr>\n
<tr>\n
<td colspan="2" class="centeredInner">\n
<button alt=\'Clone &amp; Edit\' id="clone_action_button" title=\'Clone &amp; Edit\'><img src="pictures/clone-document.png" id="clone_action_icon"/> <span id="duplicate_document_action">Clone &amp; Edit</span></button>\n
<!--input type="image" alt="Clone &amp; Edit" title="Clone &amp; Edit" src="pictures/clone-document.png" id="clone_action_icon"/> <span id="duplicate_document_action">Clone &amp; Edit</span-->\n
</td>\n
</tr>\n
</table>\n
\n
</form>\n
\n
</tal:block>
]]></string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>admin_tool_duplicate_document</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PageTemplates.ZopePageTemplate</string>
<string>ZopePageTemplate</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<tal:block metal:define-macro="master"\n
tal:define="url context/WebSite_getDocumentUrl;\n
section context/WebSite_getSectionValue;">\n
<h3>Clone section</h3>\n
<form name="tool_create" method="post" action="WebSite_newContent">\n
<table border="0" cellspacing="1" cellpadding="0">\n
<tr>\n
<td class="article">Id</td>\n
<td class="article"><input class="input" type="text" name="id" tal:attributes="value section/getId | nothing"/></td>\n
</tr>\n
<tr>\n
<td class="article">Title</td>\n
<td class="article"><input class="input" type="text" name="title" tal:attributes="value section/getTitle | nothing"/></td>\n
</tr>\n
<tr>\n
<td colspan="2" class="article" align="center">\n
<input type="image" alt="Clone" title="Clone" src="pictures/clone.png" name="WebSite_createContent:method"/> Clone\n
</td>\n
</tr>\n
</table>\n
</form>\n
</tal:block>
]]></string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>admin_tool_duplicate_section</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PageTemplates.ZopePageTemplate</string>
<string>ZopePageTemplate</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<tal:block metal:define-macro="master">\n
\n
<h3>Edit</h3>\n
\n
<ul>\n
\n
<!--li tal:condition="python: is_portal_root">\n
<a tal:attributes="href python: \'%s/view?editable_mode=1\' % context.WebSite_getSite();"\n
><img src="pictures/section.png"/> Edit Web Site</a>\n
</li-->\n
\n
<!--li tal:condition="python: not is_portal_root">\n
<a tal:attributes="href python: \'%s/view?editable_mode=1\' % context.WebSite_getSection();"\n
><img src="pictures/section.png"/> Edit <tal:block tal:content="python: (is_webdoc and \'Parent \') or \'Current \'"/>Section</a>\n
</li-->\n
\n
<!--li tal:condition="python: (not is_portal_root) and ((is_section and valid_default_doc and not is_edit_mode) or is_webdoc)">\n
<a tal:attributes="href python: \'%s/view?editable_mode=1\' % context.WebSite_getDocumentPhysicalPath();"\n
><img src="pictures/webpage.png"/> Edit <tal:block tal:content="python: (is_section and \'Default \') or \'Current \'"/>Page</a>\n
</li-->\n
\n
<!--li tal:define="context_url python: context.absolute_url();\n
url_list python: context_url[context_url.find(\'://\')+3:].split(\'/\');\n
is_secure python: context_url[4].lower() == \'s\';\n
base_url python: url_list[0];\n
doc_url python: \'/\'.join(url_list[1:]);\n
webdav_prefix python: \'webdav\' + (is_secure and \'s\' or \'\');\n
WEBDAV_PORT python: \'443\'">\n
<a tal:attributes="href python: \'%s://webdav.%s:%s/%s\' % (webdav_prefix, base_url, WEBDAV_PORT, doc_url)"\n
><img src="pictures/webdav.png" tal:attributes="src string:${portal_url}/pictures/webdav.png"/> Open <tal:block tal:content="python: (is_secure and \'Secured \') or \'Unsecured \'"/>webdav</a>\n
</li-->\n
</ul>\n
</tal:block>
]]></string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>admin_tool_edit</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PageTemplates.ZopePageTemplate</string>
<string>ZopePageTemplate</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<tal:block\n
metal:define-macro="master"\n
tal:define="here python: getattr(here.REQUEST, \'here\', here);\n
url python: \'\';\n
actions python: [];\n
">\n
<!-- this title mimic the behaviour of menu content depending on context -->\n
<h3><tal:block tal:content="here/getPortalType"/> Actions</h3>\n
\n
<p tal:content="python: repr(here.REQUEST.items())"/>\n
\n
<!--tal:block metal:use-macro="here/context_box_render/macros/action"/-->\n
\n
</tal:block>
]]></string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>admin_tool_menus</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PageTemplates.ZopePageTemplate</string>
<string>ZopePageTemplate</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!-- Floating Panel -->\n
<tal:block tal:define="widget_list python: [ \'admin_tool_menus\']">\n
<!-- , \'admin_tool_edit\'\n
, \'admin_tool_duplicate_document\'\n
, \'admin_tool_duplicate_section\'\n
, \'admin_tool_debug\'\n
]">\n
-->\n
<div id="adminToolBox" tal:condition="python: len(widget_list) > 0">\n
\n
<script type="text/javascript" language="JavaScript" src="js/cookie_utils.js"></script>\n
<script type="text/javascript" language="JavaScript">\n
<!--\n
// global variables\n
var cookie_name = "erp5_admin_tool_box_hidden_state"\n
var hidden_class = "doNotDisplay";\n
var elements_to_hide_name = "adminSection";\n
\n
function hideElements (hide) {\n
if (hide == true) {\n
new_hidden_class = hidden_class;\n
} else if (hide == false) {\n
new_hidden_class = "";\n
} else {\n
return;\n
}\n
// set the visibility of each element\n
element_list = document.getElementsByName(elements_to_hide_name);\n
for (var i = 0; i < element_list.length; i++) {\n
element_list[i].className = new_hidden_class;\n
}\n
// update cookie to remember the visibility status\n
days = 1; // cookie lifetime\n
stop_date = new Date();\n
stop_date.setTime(stop_date.getTime() + (days*24*60*60*1000));\n
SetCookie(cookie_name, hidden_status, stop_date);\n
}\n
\n
function autoHide () {\n
element_list = document.getElementsByName(elements_to_hide_name);\n
hidden_status = false;\n
// compute the global visibility only once to avoid inconsistencies\n
if (element_list[0].className != hidden_class) {\n
hidden_status = true;\n
}\n
hideElements(hidden_status);\n
}\n
\n
function initHiddenState () {\n
hidden_status = GetCookie(cookie_name);\n
// be carefull: cookies contain string values\n
if (hidden_status == "false") {\n
hidden_status = false;\n
} else if (hidden_status == "true") {\n
hidden_status = true;\n
}\n
// restore the previous state\n
hideElements(hidden_status);\n
}\n
-->\n
</script>\n
\n
<h3 title="Collapse / Expand administrator toolbar." onclick="autoHide()" class="warning"><img src="admin_toolbox/admin-tool-box.png"/><span name="adminSection"> Admin Tool Box</span></h3>\n
\n
<!-- this title mimic the behaviour of menu content depending on context -->\n
<h3><tal:block tal:content="here/getPortalType"/> Actions</h3>\n
\n
<!--tal:block metal:use-macro="here/context_box_render/macros/master"/-->\n
\n
\n
\n
\n
<!--div name="adminSection" tal:repeat="widget python: widget_list">\n
<tal:block tal:define="widget_object python: here[widget]">\n
<tal:block metal:use-macro="widget_object/macros/master"/>\n
</tal:block>\n
</div-->\n
\n
</div>\n
</tal:block>
]]></string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>admin_toolbox-ORIGINAL</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PageTemplates.ZopePageTemplate</string>
<string>ZopePageTemplate</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<tal:block metal:define-macro="master"\n
tal:define="layout_form python: context.medicentre_admin_toolbox_layout;\n
widget_list python: context.WebSite_getGroupWidgetList(layout_form, group=\'toolbox\')">\n
\n
<div id="adminToolBox" tal:condition="python: len(widget_list) > 0">\n
\n
<h3 class="warning"><img src="pictures/admin-tool-box.png"/> Admin Tool Box</h3>\n
\n
<script type=\'text/javascript\' src=\'js/nav_bar.js\'></script>\n
\n
<!-- Menu bar -->\n
<div class="dynToolbar">\n
<tal:block tal:repeat="widget python: widget_list">\n
<tal:block\n
tal:define="widget_object python: widget[\'widget\'];\n
order python: widget[\'order\'];\n
click_attr python: \'return buttonClick(event, \\\'menu%s\\\');;\' % (order);\n
mouseover_attr python: \'buttonMouseover(event, \\\'menu%s\\\');;\' % (order);">\n
<a class="dynToolbarButton" href="#"\n
tal:attributes="onclick click_attr;\n
onmouseover mouseover_attr"><tal:block metal:use-macro="widget_object/macros/title"/></a>\n
</tal:block>\n
</tal:block>\n
\n
<!-- Menu items -->\n
<tal:block tal:repeat="widget python: widget_list">\n
<tal:block tal:define="widget_object python: widget[\'widget\'];\n
menuX python: \'menu%s\' % (widget[\'order\'])">\n
<div tal:attributes="id menuX" class="dynToolbarItem">\n
<tal:block metal:use-macro="widget_object/macros/master"/>\n
</div>\n
</tal:block>\n
</tal:block>\n
\n
</div>\n
</div>\n
\n
</tal:block>
]]></string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>medicentre_admin_toolbox_widget</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Used ?</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PageTemplates.ZopePageTemplate</string>
<string>ZopePageTemplate</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<tal:block metal:define-macro="master"\n
tal:condition="python: (is_section and valid_default_doc and not is_edit_mode) or is_webdoc">\n
\n
<form name="tool_create" method="post" action="WebSite_newContent">\n
\n
<input id="document_action_mode" name="document_action_mode" value="clone_to" type="hidden"/>\n
\n
<h3>Clone Current Page</h3>\n
\n
<table cellspacing="1" cellpadding="0" border="0">\n
<tr>\n
<td>Destination Section</td>\n
<td>\n
<select class="input" name="destination_section" size="1">\n
<tal:block tal:repeat="top_section python: context.WebSite_getSiteValue().WebSite_getMainSectionList()">\n
<option tal:content="python: top_section.getTitle()"\n
tal:attributes="value python: top_section.getId()"/>\n
</tal:block>\n
</select>\n
</td>\n
</tr>\n
<tr>\n
<td colspan="2" align="center">\n
<input type="image" alt="Clone &amp; Edit" title="Clone &amp; Edit" src="pictures/clone-document.png" id="clone_action_icon"/> Clone &amp; Edit\n
</td>\n
</tr>\n
</table>\n
\n
</form>\n
\n
</tal:block>
]]></string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>medicentre_tool_clone_document</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Used ?</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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