aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/LocalFilesEditor/editarea/reg_syntax/php.js
diff options
context:
space:
mode:
authorpatdenice <patdenice@piwigo.org>2008-09-25 17:46:27 +0000
committerpatdenice <patdenice@piwigo.org>2008-09-25 17:46:27 +0000
commit1eb3d18ae24a221037a44d662439d50c74e6fe9f (patch)
treebad9aae88920126457aeadf09a7a9ec55242977b /plugins/LocalFilesEditor/editarea/reg_syntax/php.js
parentfd0b26af453fedf4528eaf4114914a6e5b7bc685 (diff)
- Move get_extents function to include/functions.inc.php.
- Change all plugins version to 2.0. - LocalFiles Editor can now edit and create template extension. - Editarea (for LocalFiles Editor) go to version 0.7.2.2 (chrome compatible) - Editarea activation is now saved in database with AJAX. git-svn-id: http://piwigo.org/svn/trunk@2588 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'plugins/LocalFilesEditor/editarea/reg_syntax/php.js')
-rw-r--r--plugins/LocalFilesEditor/editarea/reg_syntax/php.js83
1 files changed, 82 insertions, 1 deletions
diff --git a/plugins/LocalFilesEditor/editarea/reg_syntax/php.js b/plugins/LocalFilesEditor/editarea/reg_syntax/php.js
index 535a22bd3..a1c5883af 100644
--- a/plugins/LocalFilesEditor/editarea/reg_syntax/php.js
+++ b/plugins/LocalFilesEditor/editarea/reg_syntax/php.js
@@ -11,7 +11,7 @@ editAreaLoader.load_syntax["php"] = {
'return', 'break', 'continue'
]
,'reserved' : [
- '_GET', '_POST', '_SERVER', '_FILES', '_ENV', '_COOKIE', '_REQUEST',
+ '_GET', '_POST', '_SESSION', '_SERVER', '_FILES', '_ENV', '_COOKIE', '_REQUEST',
'null', '__LINE__', '__FILE__',
'false', '&lt;?php', '?&gt;', '&lt;?',
'&lt;script language', '&lt;/script&gt;',
@@ -72,4 +72,85 @@ editAreaLoader.load_syntax["php"] = {
'variables' : 'color: #E0BD54;'
}
}
+ ,'AUTO_COMPLETION' : {
+ "default": { // the name of this definition group. It's posisble to have different rules inside the same definition file
+ "REGEXP": { "before_word": "[^a-zA-Z0-9_]|^" // \\s|\\.|
+ ,"possible_words_letters": "[a-zA-Z0-9_\$]+"
+ ,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$"
+ ,"prefix_separator": "\\-\\>|\\:\\:"
+ }
+ ,"CASE_SENSITIVE": true
+ ,"MAX_TEXT_LENGTH": 100 // the maximum length of the text being analyzed before the cursor position
+ ,"KEYWORDS": {
+ '': [ // the prefix of thoses items
+ /**
+ * 0 : the keyword the user is typing
+ * 1 : (optionnal) the string inserted in code ("{@}" being the new position of the cursor, "§" beeing the equivalent to the value the typed string indicated if the previous )
+ * If empty the keyword will be displayed
+ * 2 : (optionnal) the text that appear in the suggestion box (if empty, the string to insert will be displayed)
+ */
+ ['$_POST']
+ ,['$_GET']
+ ,['$_SESSION']
+ ,['$_SERVER']
+ ,['$_FILES']
+ ,['$_ENV']
+ ,['$_COOKIE']
+ ,['$_REQUEST']
+ // magic methods
+ ,['__construct', '§( {@} )']
+ ,['__destruct', '§( {@} )']
+ ,['__sleep', '§( {@} )']
+ ,['__wakeup', '§( {@} )']
+ ,['__toString', '§( {@} )']
+ // include
+ ,['include', '§ "{@}";']
+ ,['include_once', '§ "{@}";']
+ ,['require', '§ "{@}";']
+ ,['require_once', '§ "{@}";']
+ // statements
+ ,['for', '§( {@} )']
+ ,['foreach', '§( {@} )']
+ ,['if', '§( {@} )']
+ ,['elseif', '§( {@} )']
+ ,['while', '§( {@} )']
+ ,['switch', '§( {@} )']
+ ,['break']
+ ,['case']
+ ,['continue']
+ ,['do']
+ ,['else']
+ ,['endif']
+ ,['endswitch']
+ ,['endwhile']
+ ,['return']
+ // function
+ ,['unset', '§( {@} )']
+ ]
+ }
+ }
+ ,"live": {
+
+ // class NAME: /class\W+([a-z]+)\W+/gi
+ // method: /^(public|private|protected)?\s*function\s+([a-z][a-z0-9\_]*)\s*(\([^\{]*\))/gmi
+ // static: /^(public|private|protected)?\s+static\s+(public|private|protected)?\s*function\s+([a-z][a-z0-9\_]*)\s*(\([^\{]*\))/gmi
+ // attributes: /(\$this\-\>|(?:var|public|protected|private)\W+\$)([a-z0-9\_]+)(?!\()\b/gi
+ // v1 : /(\$this\-\>|var\W+|public\W+|protected\W+|private\W+)([a-z0-9\_]+)\W*(=|;)/gi
+ // var type: /(\$(this\-\>)?[a-z0-9\_]+)\s*\=\s*new\s+([a-z0-9\_])+/gi
+
+
+ "REGEXP": { "before_word": "[^a-zA-Z0-9_]|^" // \\s|\\.|
+ ,"possible_words_letters": "[a-zA-Z0-9_\$]+"
+ ,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$"
+ ,"prefix_separator": "\\-\\>"
+ }
+ ,"CASE_SENSITIVE": true
+ ,"MAX_TEXT_LENGTH": 100 // the maximum length of the text being analyzed before the cursor position
+ ,"KEYWORDS": {
+ '$this': [ // the prefix of thoses items
+ ['test']
+ ]
+ }
+ }
+ }
};