added file extension php5
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / wizards / PHPFileWizardPage.java
index 7785377..c931b92 100644 (file)
@@ -148,7 +148,6 @@ public class PHPFileWizardPage extends WizardPage {
        /**
         * Ensures that both text fields are set.
         */
-
        private void dialogChanged() {
                String container = getContainerName();
                String fileName = getFileName();
@@ -161,11 +160,16 @@ public class PHPFileWizardPage extends WizardPage {
                        updateStatus("WizardPage.nameMustBeSpecified");
                        return;
                }
-               int dotLoc = fileName.indexOf('.');
+               int dotLoc = fileName.lastIndexOf('.');
                if (dotLoc != -1) {
                        String ext = fileName.substring(dotLoc + 1);
-                       if (ext.equalsIgnoreCase("php") == false) {
-                               updateStatus(PHPWizardMessages.getString("WizardPage.mustBePHP"));
+                       if (!ext.equalsIgnoreCase("php") && 
+                           !ext.equalsIgnoreCase("php3") && 
+                           !ext.equalsIgnoreCase("php4") && 
+                           !ext.equalsIgnoreCase("php5") &&
+                           !ext.equalsIgnoreCase("phtml") &&
+                           !ext.equalsIgnoreCase("inc")) {
+                               updateStatus(PHPWizardMessages.getString("WizardPage.mustBePHP"));
                                return;
                        }
                }