[pLog-svn] r1292 - in plugins/trunk/templateeditor: class/action templates

mark at devel.plogworld.net mark at devel.plogworld.net
Wed Mar 2 19:55:40 GMT 2005


Author: mark
Date: 2005-03-02 19:55:39 +0000 (Wed, 02 Mar 2005)
New Revision: 1292

Modified:
   plugins/trunk/templateeditor/class/action/pluginblogcopytemplatefileaction.class.php
   plugins/trunk/templateeditor/class/action/pluginsitecopytemplatefileaction.class.php
   plugins/trunk/templateeditor/templates/blogtemplateslist.template
   plugins/trunk/templateeditor/templates/sitetemplateslist.template
Log:
Fix some errors of extension check.

Modified: plugins/trunk/templateeditor/class/action/pluginblogcopytemplatefileaction.class.php
===================================================================
--- plugins/trunk/templateeditor/class/action/pluginblogcopytemplatefileaction.class.php	2005-03-02 19:42:15 UTC (rev 1291)
+++ plugins/trunk/templateeditor/class/action/pluginblogcopytemplatefileaction.class.php	2005-03-02 19:55:39 UTC (rev 1292)
@@ -113,7 +113,8 @@
 		    $extensionList = explode(",", $allowedExtension);
             $templateFiles = Array();
 		    for ($i = 0; $i < count($extensionList); $i++) {
-                $files = Glob::myGlob( $folder, trim($extensionList[$i]) );
+		        $extension = "*." . trim($extensionList[$i]);
+                $files = Glob::myGlob( $folder, $extension );
                 foreach ($files as $file) {
                     $tmp['name'] = basename($file);
                     $tmp['size'] = filesize($file);

Modified: plugins/trunk/templateeditor/class/action/pluginsitecopytemplatefileaction.class.php
===================================================================
--- plugins/trunk/templateeditor/class/action/pluginsitecopytemplatefileaction.class.php	2005-03-02 19:42:15 UTC (rev 1291)
+++ plugins/trunk/templateeditor/class/action/pluginsitecopytemplatefileaction.class.php	2005-03-02 19:55:39 UTC (rev 1292)
@@ -113,7 +113,8 @@
 		    $extensionList = explode(",", $allowedExtension);
             $templateFiles = Array();
 		    for ($i = 0; $i < count($extensionList); $i++) {
-                $files = Glob::myGlob( $folder, trim($extensionList[$i]) );
+		        $extension = "*." . trim($extensionList[$i]);
+                $files = Glob::myGlob( $folder, $extension );
                 foreach ($files as $file) {
                     $tmp['name'] = basename($file);
                     $tmp['size'] = filesize($file);

Modified: plugins/trunk/templateeditor/templates/blogtemplateslist.template
===================================================================
--- plugins/trunk/templateeditor/templates/blogtemplateslist.template	2005-03-02 19:42:15 UTC (rev 1291)
+++ plugins/trunk/templateeditor/templates/blogtemplateslist.template	2005-03-02 19:55:39 UTC (rev 1292)
@@ -3,7 +3,7 @@
 <SCRIPT type="text/javascript"> var copyToMessage = '{$locale->tr("templateeditor_enter_new_templatefile_name")}'; </SCRIPT>
 {literal}
 <SCRIPT type="text/javascript">
-function copyTemplateFileTo( objId ) {
+function copyTemplateFileTo( objId , templateId) {
     copyToName = prompt(copyToMessage, 'new_' + objId);
     url = document.getElementById(objId);
     if (copyToName != '' && copyToName != null) {
@@ -11,7 +11,7 @@
         newUrl = encodeURI(originUrl + '&newFileId=' + copyToName);
         url.setAttribute('href', newUrl);
     } else {
-        url.setAttribute('href', '?op=blogTemplatesList&templateId=' + objId);
+        url.setAttribute('href', '?op=blogTemplatesList&templateId=' + templateId);
     }
 }
 </SCRIPT>
@@ -74,7 +74,7 @@
       <a href="?op=blogDeleteTemplateFile&amp;templateId={$currentTemplate}&amp;fileId={$file.name}">
         <img src="imgs/admin/icon_delete-16.png" alt="{$locale->tr("delete")}" />
       </a>
-      <a href="?op=blogCopyTemplateFile&amp;templateId={$currentTemplate}&amp;fileId={$file.name}" id="{$file.name}" onClick="copyTemplateFileTo(this.id)" >
+      <a href="?op=blogCopyTemplateFile&amp;templateId={$currentTemplate}&amp;fileId={$file.name}" id="{$file.name}" onClick="copyTemplateFileTo(this.id, '{$currentTemplate}')" >
         <img src="imgs/admin/icon_copy-16.png" alt="{$locale->tr("copy")}" />
       </a>        
      </div>

Modified: plugins/trunk/templateeditor/templates/sitetemplateslist.template
===================================================================
--- plugins/trunk/templateeditor/templates/sitetemplateslist.template	2005-03-02 19:42:15 UTC (rev 1291)
+++ plugins/trunk/templateeditor/templates/sitetemplateslist.template	2005-03-02 19:55:39 UTC (rev 1292)
@@ -3,7 +3,7 @@
 <SCRIPT type="text/javascript"> var copyToMessage = '{$locale->tr("templateeditor_enter_new_templatefile_name")}'; </SCRIPT>
 {literal}
 <SCRIPT type="text/javascript">
-function copyTemplateFileTo( objId ) {
+function copyTemplateFileTo( objId , templateId) {
     copyToName = prompt(copyToMessage, 'new_' + objId);
     url = document.getElementById(objId);
     if (copyToName != '' && copyToName != null) {
@@ -11,7 +11,7 @@
         newUrl = encodeURI(originUrl + '&newFileId=' + copyToName);
         url.setAttribute('href', newUrl);
     } else {
-        url.setAttribute('href', '?op=siteTemplatesList&templateId=' + objId);
+        url.setAttribute('href', '?op=siteTemplatesList&templateId=' + templateId);
     }
 }
 </SCRIPT>
@@ -74,7 +74,7 @@
       <a href="?op=siteDeleteTemplateFile&amp;templateId={$currentTemplate}&amp;fileId={$file.name}">
         <img src="imgs/admin/icon_delete-16.png" alt="{$locale->tr("delete")}" />
       </a>
-      <a href="?op=siteCopyTemplateFile&amp;templateId={$currentTemplate}&amp;fileId={$file.name}" id="{$file.name}" onClick="copyTemplateFileTo(this.id)" >
+      <a href="?op=siteCopyTemplateFile&amp;templateId={$currentTemplate}&amp;fileId={$file.name}" id="{$file.name}" onClick="copyTemplateFileTo(this.id, '{$currentTemplate}')" >
         <img src="imgs/admin/icon_copy-16.png" alt="{$locale->tr("copy")}" />
       </a>      
      </div>




More information about the pLog-svn mailing list