From 78bbe96269b6b0600e52156151d2fd5ad7f72fea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Fri, 25 Feb 2022 00:09:17 +0900
Subject: [PATCH] Revert "zope patches: remove in ZMI actions taller/shorter
 and wider/narrower for page templates"

This reverts commit 8f5497d4501649367cd06e60e753324293215a1b.

This is not longer needed - with Zope 4 the ZMI is better and we now
have possibility to edit most of these through ERP5 user interface.
The main motivation is that these kind of patches are really hard to
keep up to date.
---
 product/ERP5Type/ZopePatch.py                |   1 -
 product/ERP5Type/dtml/ptEdit.zpt             | 115 -------------------
 product/ERP5Type/patches/ZopePageTemplate.py |  26 -----
 3 files changed, 142 deletions(-)
 delete mode 100644 product/ERP5Type/dtml/ptEdit.zpt
 delete mode 100644 product/ERP5Type/patches/ZopePageTemplate.py

diff --git a/product/ERP5Type/ZopePatch.py b/product/ERP5Type/ZopePatch.py
index 84957a13bc..def9c05977 100644
--- a/product/ERP5Type/ZopePatch.py
+++ b/product/ERP5Type/ZopePatch.py
@@ -90,7 +90,6 @@ if six.PY2:
   # No ZServer, so no webdav
   from Products.ERP5Type.patches import WebDAV
 from Products.ERP5Type.patches import CMFCoreUtils
-from Products.ERP5Type.patches import ZopePageTemplate
 from Products.ERP5Type.patches import ZSQLMethod
 from Products.ERP5Type.patches import MimetypesRegistry
 from Products.ERP5Type.patches import users
diff --git a/product/ERP5Type/dtml/ptEdit.zpt b/product/ERP5Type/dtml/ptEdit.zpt
deleted file mode 100644
index 88041b1ec9..0000000000
--- a/product/ERP5Type/dtml/ptEdit.zpt
+++ /dev/null
@@ -1,115 +0,0 @@
-<h1 tal:replace="structure python:context.manage_page_header(management_page_charset='utf-8')">Header</h1>
-<h2 tal:define="manage_tabs_message options/manage_tabs_message | nothing"
-    tal:replace="structure context/manage_tabs">Tabs</h2>
-
-<tal:block define="global body request/other/text | request/form/text
-                                                  | context/read" /> 
-<form action="" method="post" tal:attributes="action request/URL1">
-<input type="hidden" name=":default_method" value="pt_changePrefs" />
-<input type="hidden" name="encoding" value="utf-8" />
-<table width="100%" cellspacing="0" cellpadding="2" border="0" style="height: 80%;">
-  <tr>
-    <td align="left" valign="middle">
-      <div class="form-optional">Title</div>
-    </td>
-    <td align="left" valign="middle">
-      <input type="text" name="title" size="40" 
-             tal:attributes="value request/title | context/title" />
-    </td>
-    <td align="left" valign="middle">
-      <div class="form-label">Content-Type</div>
-    </td>
-    <td align="left" valign="middle">
-      <input type="text" name="content_type" size="14" 
-             tal:attributes="value request/content_type | context/content_type" />
-    </td>
-  </tr>
-  <tr>
-    <td align="left" valign="middle">
-      <div class="form-label">Last Modified</div>
-    </td>
-    <td align="left" valign="middle">
-      <div class="form-text" 
-       tal:content="python:context.bobobase_modification_time().strftime('%Y-%m-%d %I:%M %p')">1/1/2000
-      </div>
-    </td>
-    <td align="left" valign="top" colspan="2">
-      <a href="source.html" tal:condition="context/html">Browse HTML source</a>
-      <a href="source.xml" tal:condition="not:context/html">Browse XML source</a>
-      <br />
-      <input type="hidden" name="expand:int:default" value="0" />
-      <input type="checkbox" value="1" name="expand:int"
-             tal:attributes="checked request/expand | context/expand" />
-      Expand macros when editing
-    </td>
-  </tr>
-
-  <tr tal:define="errors context/pt_errors" tal:condition="errors">
-    <td align="left" valign="middle" class="form-label">Errors</td>
-    <td align="left" valign="middle" style="background-color: #FFDDDD"
-        colspan="3">
-<pre tal:content="python:'\n'.join(errors)">errors</pre>
-    </td>
-  </tr>
-  <tr>
-    <td align="left" valign="top" colspan="4" style="height: 100%">
-      <textarea name="text:text" wrap="off" style="width: 100%;height: 100%"
-                tal:content="body">Template Body</textarea>
-    </td>
-  </tr>
-
-<tr>
-  <td align="left" valign="top" colspan="4">
-  <div class="form-element">
-    <em tal:condition="context/wl_isLocked">Locked by WebDAV</em>
-    <input tal:condition="not:context/wl_isLocked"
-           class="form-element" type="submit" 
-           name="pt_editAction:method" value="Save Changes"/>
-    &nbsp;&nbsp;
-  </div>
-  </td>
-</tr>
-</table>
-</form>
-
-<p class="form-help">You can upload the text for
-<span tal:replace="context/title_and_id" /> using the following form.
-Choose an existing HTML or XML file from your local computer by
-clicking <em>browse</em>.  You can also <a href="document_src">click
-context</a> to view or download the current text.</p>
-
-<form action="pt_upload" method="post" enctype="multipart/form-data">
-<table cellpadding="2" cellspacing="0" border="0">
-<tr>
-  <td align="left" valign="top">
-    <div class="form-label">File &nbsp;</div>
-  </td>
-  <td align="left" valign="top">
-    <input type="file" name="file" size="40" value="" />
-  </td>
-</tr>
-<tr>
-  <td align="left" valign="top">
-    <div class="form-label">Encoding &nbsp;</div>
-  </td>
-  <td align="left" valign="top" colspan="2">
-    <input name="encoding" value="utf-8" />
-  </td>
-  <td align="left" valign="top" colspan="1">
-    <em>(only used for non-XML and non-XHTML content)</em>
-  </td>
-</tr>
-<tr>
-  <td></td>
-  <td align="left" valign="top">
-  <div class="form-element">
-    <em tal:condition="context/wl_isLocked">Locked by WebDAV</em>
-    <input tal:condition="not:context/wl_isLocked"
-           class="form-element" type="submit" value="Upload File" />
-  </div>
-  </td>
-</tr>
-</table>
-</form>
-
-<h1 tal:replace="structure context/manage_page_footer">Footer</h1>
diff --git a/product/ERP5Type/patches/ZopePageTemplate.py b/product/ERP5Type/patches/ZopePageTemplate.py
deleted file mode 100644
index 19b2c2d442..0000000000
--- a/product/ERP5Type/patches/ZopePageTemplate.py
+++ /dev/null
@@ -1,26 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE
-#
-##############################################################################
-from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate
-from Products.PageTemplates.PageTemplateFile import PageTemplateFile
-from Products.ERP5Type import _dtmldir
-import os
-
-# Patch for displaying textearea in full window instead of
-# remembering a quantity of lines to display in a cookie
-pt_editForm = PageTemplateFile(os.path.join(_dtmldir, "ptEdit"), globals(),
-                               __name__='pt_editForm' )
-pt_editForm._owner = None
-ZopePageTemplate.pt_editForm = pt_editForm
-ZopePageTemplate.manage = pt_editForm
-ZopePageTemplate.manage_main = pt_editForm
-
-- 
2.30.9