eggification.
[Epoz.git] / Products / Epoz / epoz / epoz_plone / epoz_toolbox.pt
diff --git a/Products/Epoz/epoz/epoz_plone/epoz_toolbox.pt b/Products/Epoz/epoz/epoz_plone/epoz_toolbox.pt
new file mode 100755 (executable)
index 0000000..618087b
--- /dev/null
@@ -0,0 +1,130 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns:tal="http://xml.zope.org/namespaces/tal"
+      xmlns:metal="http://xml.zope.org/namespaces/metal"
+      i18n:domain="plone">
+
+<head tal:define="ztu modules/ZTUtils;">
+<title tal:content="here/title_or_id">Title or Id</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8"
+          tal:define="charset here/portal_properties/site_properties/default_charset;
+                      dummy python:request.RESPONSE.setHeader('Content-Type', 'text/html;;charset=%s' % charset)"
+          tal:attributes="content string:text/html;;charset=${charset}" />
+<style type="text/css" media="all"
+       tal:define="current_skin python:ztu.make_query(skin=request.get(here.portal_skins.getRequestVarname(), ''))"
+       tal:content="string: @import url(${here/portal_url}/plone.css?${current_skin});">
+</style>
+</head>
+
+<body onload="focus();" 
+      style="margin: 4px;padding:0.5em;"
+      tal:define="checkPermission python: here.portal_membership.checkPermission;">
+
+  <form
+        action="search"
+        method="post"
+        name="search"
+        style="padding-bottom:1em;"
+        tal:define="DateTime python:modules['DateTime'].DateTime"
+        tal:attributes="action string: ${here/absolute_url}/${template/getId}">
+
+   <div i18n:translate="legend_search_terms">Search Terms</div>
+    <input type="text"
+           id="searchGadget"
+           name="SearchableText"
+           size="25"
+           tabindex=""
+           />
+    <input tabindex=""
+           class="searchButton"
+           type="submit"
+           name="submit"
+           value="Search"
+           i18n:attributes="value"
+           />
+  </form>
+
+  <tal:block tal:define="query_results python:[brain.getObject() for brain in here.queryCatalog()];">
+   <div tal:condition="query_results">
+     <span i18n:translate="heading_search_results">Search results</span>
+   </div>
+   <div style="border-top:1px solid black;border-bottom:1px solid black;"
+        tal:attributes="style string:border-top:1px solid ${here/base_properties/globalBorderColor};;
+                                                 border-bottom:1px solid ${here/base_properties/globalBorderColor};;
+                                                 margin-bottom:1em;;padding:0.2em 0 0.1em 0"
+        tal:condition="not: query_results"
+        tal:define="parents request/PARENTS;
+                    nil python: parents.reverse();
+                    portal here/portal_url/getPortalObject;">
+      <tal:block tal:repeat="parent parents">
+        <tal:block tal:condition="python:checkPermission('View', parent) and checkPermission('List folder contents', parent)">
+           <img tal:condition="repeat/parent/start" tal:attributes="src string:${here/portal_url}/logoIcon.gif"/>
+           <tal:block tal:condition="not: repeat/parent/start">
+               <a tal:attributes="href string: ${parent/absolute_url}/${template/getId};">
+                  <span tal:content="string: ${parent/title_or_id}"
+                        tal:condition="python: parent.absolute_url()!=portal.absolute_url()"/>
+                  <span tal:content="string:Home" tal:condition="python: parent.absolute_url()==portal.absolute_url()"/>
+                  <span tal:condition="not: repeat/parent/end" class="breadcrumbSeparator">&raquo;</span>
+                </a>
+           </tal:block>
+        </tal:block>
+      </tal:block>
+   </div>
+
+   <tal:block tal:define="results python: test(query_results, query_results,
+                                          [item for item in here.listFolderContents()
+                                          if checkPermission('View',item)]);">
+
+   <table tal:condition="results"
+          class="group" width="100%" cellspacing="0" cellpadding="2">
+
+    <tbody>
+
+    <tal:block tal:repeat="item results">
+     <tr tal:define="oddrow repeat/item/odd"
+         tal:attributes="class python:test(oddrow, 'even', 'odd')" >
+
+      <td width="50%">
+        <img src="#" tal:attributes="src string:${here/portal_url}/${item/getIcon};alt item/Title" />
+        <a tal:condition="python: item.isPrincipiaFolderish and item<>here"
+           tal:attributes="href string: ${item/absolute_url}/${template/getId}"
+           tal:content="item/title_or_id">Title</a>
+
+        <b tal:condition="python: not item.isPrincipiaFolderish or item==here"
+           tal:content="item/title_or_id">Title</b>
+
+        <a tal:condition="python: item.getTypeInfo().getId() in ['Image','Photo']"
+           tal:attributes="href string:#;
+                           onclick string: window.open('${item/absolute_url}','${repeat/item/index}','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=${item/width},height=${item/height}');; ;">
+           <img tal:define="max python: 32;"
+                tal:attributes="src item/absolute_url;
+                                height python: test(item.height < max, item.height, max);" />
+        </a>
+      </td>
+
+      <td width="25%"
+          i18n:translate=""
+          tal:content="python:item.getTypeInfo().Title()">Metatype</td>
+
+      <td width="25%" tal:define="url python: item.absolute_url() + test(item.isPrincipiaFolderish,'/','');">
+        <a tal:attributes="href string: #;
+                           onclick string: window.opener.CreateLink('${url}');; window.close();; ;"
+           i18n:translate="epoz_insert_link">Insert Link</a>
+         <div tal:condition="python: item.getTypeInfo().getId() in ['Image','Photo']">
+          <a tal:attributes="href string: #;
+                             onclick string: window.opener.CreateImage('${url}');; window.close();; ;"
+             i18n:translate="epoz_insert_image">Insert Image</a>
+         </div>
+      </td>
+     </tr>
+     </tal:block>
+
+    </tbody>
+   </table>
+
+  </tal:block>
+
+ </tal:block>
+</body>
+</html>