diff --git a/sites/all/modules/geshifilter/LICENSE.txt b/sites/all/modules/geshifilter/LICENSE.txt new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/sites/all/modules/geshifilter/LICENSE.txt @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/sites/all/modules/geshifilter/README.txt b/sites/all/modules/geshifilter/README.txt new file mode 100644 index 0000000..aba3684 --- /dev/null +++ b/sites/all/modules/geshifilter/README.txt @@ -0,0 +1,82 @@ + +============================ +GeSHi Filter (Drupal Module) +============================ + + +DESCRIPTION +----------- +The GeShi Filter is a Drupal module for syntax highlighting of pieces of +source code. It implements a filter that formats and highlights the syntax of +source code between for example .... + + +DEPENDENCY +---------- +This module requires the third-party library GeShi 1.0.x (Generic Syntax +Highlighter, written by Nigel McNie) which can be found at + http://qbnz.com/highlighter +See installation procedure below for more information. + + +INSTALLATION +------------ +1. Extract the GeSHi Filter module tarball and place the entire geshifilter + directory into your Drupal setup (e.g. in sites/all/modules). + +2. Download the GeSHi library from + http://sourceforge.net/projects/geshi/files/geshi + Make sure you download a version of the branch 1.0.x and not a version + from the branch 1.1.x (also described as geshi-dev), which is not yet + supported by the GeSHi filter module. + Place the entire extracted 'geshi' folder (which contains geshi.php) + in the geshifilter directory (e.g. as sites/all/modules/geshifilter/geshi), + or better, in a libraries directory (e.g. as sites/all/libraries/geshi). + +3. Enable this module as any other Drupal module by navigating to + administer > site building > modules + + +CONFIGURATION +------------- +1. The general GeSHi Filter settings can be found by navigating to: + administer > site configuration > geshifilter. + Set the path to the GeSHi library on that page, if it is not detected + automatically already. +2. Further configuration instructions can be found by following the + "more help..." link at the top of that general settings page, which leads + to www.example.com/?q=admin/help/geshifilter . This requires you have the + 'help' module enabled. + + +USAGE +----- +The basic usage (with the default settings) is: + + for (int i; i<10; ++i) { + dothisdothat(i); + } + +When language tags are enabled (like "" for Java) you can also do + + for (int i; i<10; ++i) { + dothisdothat(i); + } + +More options and tricks can be found in the filter tips of the input format at +www.example.com/?q=filter/tips . + + +AUTHORS +------- +Original module by: + Vincent Filby + +Drupal.org hosted version for Drupal 4.7: + Vincent Filby + Michael Hutchinson (http://compsoc.dur.ac.uk/~mjh/contact) + Damien Pitard + +Port to Drupal 5: + rötzi (http://drupal.org/user/73064) + Stefaan Lippens (http://drupal.org/user/41478) diff --git a/sites/all/modules/geshifilter/geshi-extra/README b/sites/all/modules/geshifilter/geshi-extra/README new file mode 100644 index 0000000..aaefb9f --- /dev/null +++ b/sites/all/modules/geshifilter/geshi-extra/README @@ -0,0 +1,12 @@ + +README file for geshi-extra directory +------------------------------------- + +This directory is meant to store custom GeSHi language definition files that +are not part of the default GeSHi library. Separating custom files from a +pristine GeSHi library eases upgrading and maintenance of the GeSHi library. + +If you add/remove language definition files, you need to flush the cache +of available languages before the GeSHi filter module will pick these up. +You'll find a link for this on the "Languages" tab of the GeSHi filter +module settings. diff --git a/sites/all/modules/geshifilter/geshi-extra/drupal5.php b/sites/all/modules/geshifilter/geshi-extra/drupal5.php new file mode 100644 index 0000000..06d081f --- /dev/null +++ b/sites/all/modules/geshifilter/geshi-extra/drupal5.php @@ -0,0 +1,673 @@ + 'Drupal 5', + 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'), + 'COMMENT_MULTI' => array('/*' => '*/'), + 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE, + 'QUOTEMARKS' => array("'", '"'), + 'ESCAPE_CHAR' => '\\', + 'KEYWORDS' => array( + 1 => array( + 'include', 'require', 'include_once', 'require_once', + 'for', 'foreach', 'as', 'if', 'elseif', 'else', 'while', 'do', 'endwhile', + 'endif', 'switch', 'case', 'endswitch', 'endfor', 'endforeach', + 'return', 'break', 'continue' + ), + 2 => array( + 'null', '__LINE__', '__FILE__', + 'false', '<?php', '?>', '<?', + '<script language', '</script>', + 'true', 'var', 'default', + 'function', 'class', 'new', '&new', 'public', 'private', 'interface', 'extends', + '__FUNCTION__', '__CLASS__', '__METHOD__', 'PHP_VERSION', + 'PHP_OS', 'DEFAULT_INCLUDE_PATH', 'PEAR_INSTALL_DIR', 'PEAR_EXTENSION_DIR', + 'PHP_EXTENSION_DIR', 'PHP_BINDIR', 'PHP_LIBDIR', 'PHP_DATADIR', 'PHP_SYSCONFDIR', + 'PHP_LOCALSTATEDIR', 'PHP_CONFIG_FILE_PATH', 'PHP_OUTPUT_HANDLER_START', 'PHP_OUTPUT_HANDLER_CONT', + 'PHP_OUTPUT_HANDLER_END', 'E_ERROR', 'E_WARNING', 'E_PARSE', 'E_NOTICE', + 'E_CORE_ERROR', 'E_CORE_WARNING', 'E_COMPILE_ERROR', 'E_COMPILE_WARNING', 'E_USER_ERROR', + 'E_USER_WARNING', 'E_USER_NOTICE', 'E_ALL' + ), + 3 => array( + 'zlib_get_coding_type','zend_version','zend_logo_guid','yp_order','yp_next', + 'yp_match','yp_master','yp_get_default_domain','yp_first','yp_errno','yp_err_string', + 'yp_cat','yp_all','xml_set_unparsed_entity_decl_handler','xml_set_start_namespace_decl_handler','xml_set_processing_instruction_handler','xml_set_object', + 'xml_set_notation_decl_handler','xml_set_external_entity_ref_handler','xml_set_end_namespace_decl_handler','xml_set_element_handler','xml_set_default_handler','xml_set_character_data_handler', + 'xml_parser_set_option','xml_parser_get_option','xml_parser_free','xml_parser_create_ns','xml_parser_create','xml_parse_into_struct', + 'xml_parse','xml_get_error_code','xml_get_current_line_number','xml_get_current_column_number','xml_get_current_byte_index','xml_error_string', + 'wordwrap','wddx_serialize_vars','wddx_serialize_value','wddx_packet_start','wddx_packet_end','wddx_deserialize', + 'wddx_add_vars','vsprintf','vprintf','virtual','version_compare','var_export', + 'var_dump','utf8_encode','utf8_decode','usort','usleep','user_error', + 'urlencode','urldecode','unserialize','unregister_tick_function','unpack','unlink', + 'unixtojd','uniqid','umask','uksort','ucwords','ucfirst', + 'uasort','trim','trigger_error','touch','token_name','token_get_all', + 'tmpfile','time','textdomain','tempnam','tanh','tan', + 'system','syslog','symlink','substr_replace','substr_count','substr', + 'strval','strtr','strtoupper','strtotime','strtolower','strtok', + 'strstr','strspn','strrpos','strrev','strrchr','strpos', + 'strncmp','strncasecmp','strnatcmp','strnatcasecmp','strlen','stristr', + 'stripslashes','stripcslashes','strip_tags','strftime','stream_wrapper_register','stream_set_write_buffer', + 'stream_set_timeout','stream_set_blocking','stream_select','stream_register_wrapper','stream_get_meta_data','stream_filter_prepend', + 'stream_filter_append','stream_context_set_params','stream_context_set_option','stream_context_get_options','stream_context_create','strcspn', + 'strcoll','strcmp','strchr','strcasecmp','str_word_count','str_shuffle', + 'str_rot13','str_replace','str_repeat','str_pad','stat','sscanf', + 'srand','sqrt','sql_regcase','sprintf','spliti','split', + 'soundex','sort','socket_writev','socket_write','socket_strerror','socket_shutdown', + 'socket_setopt','socket_set_timeout','socket_set_option','socket_set_nonblock','socket_set_blocking','socket_set_block', + 'socket_sendto','socket_sendmsg','socket_send','socket_select','socket_recvmsg','socket_recvfrom', + 'socket_recv','socket_readv','socket_read','socket_listen','socket_last_error','socket_iovec_set', + 'socket_iovec_free','socket_iovec_fetch','socket_iovec_delete','socket_iovec_alloc','socket_iovec_add','socket_getsockname', + 'socket_getpeername','socket_getopt','socket_get_status','socket_get_option','socket_create_pair','socket_create_listen', + 'socket_create','socket_connect','socket_close','socket_clear_error','socket_bind','socket_accept', + 'sleep','sizeof','sinh','sin','similar_text','shuffle', + 'show_source','shmop_write','shmop_size','shmop_read','shmop_open','shmop_delete', + 'shmop_close','shm_remove_var','shm_remove','shm_put_var','shm_get_var','shm_detach', + 'shm_attach','shell_exec','sha1_file','sha1','settype','setlocale', + 'setcookie','set_time_limit','set_socket_blocking','set_magic_quotes_runtime','set_include_path','set_file_buffer', + 'set_error_handler','session_write_close','session_unset','session_unregister','session_start','session_set_save_handler', + 'session_set_cookie_params','session_save_path','session_register','session_regenerate_id','session_name','session_module_name', + 'session_is_registered','session_id','session_get_cookie_params','session_encode','session_destroy','session_decode', + 'session_cache_limiter','session_cache_expire','serialize','sem_remove','sem_release','sem_get', + 'sem_acquire','rtrim','rsort','round','rmdir','rewinddir', + 'rewind','restore_include_path','restore_error_handler','reset','rename','register_tick_function', + 'register_shutdown_function','realpath','readlink','readgzfile','readfile','readdir', + 'read_exif_data','rawurlencode','rawurldecode','range','rand','rad2deg', + 'quotemeta','quoted_printable_decode','putenv','proc_open','proc_close','printf', + 'print_r','prev','preg_split','preg_replace_callback','preg_replace','preg_quote', + 'preg_match_all','preg_match','preg_grep','pow','posix_uname','posix_ttyname', + 'posix_times','posix_strerror','posix_setuid','posix_setsid','posix_setpgid','posix_setgid', + 'posix_seteuid','posix_setegid','posix_mkfifo','posix_kill','posix_isatty','posix_getuid', + 'posix_getsid','posix_getrlimit','posix_getpwuid','posix_getpwnam','posix_getppid','posix_getpid', + 'posix_getpgrp','posix_getpgid','posix_getlogin','posix_getgroups','posix_getgrnam','posix_getgrgid', + 'posix_getgid','posix_geteuid','posix_getegid','posix_getcwd','posix_get_last_error','posix_errno', + 'posix_ctermid','pos','popen','pi','phpversion','phpinfo', + 'phpcredits','php_uname','php_sapi_name','php_logo_guid','php_ini_scanned_files','pg_update', + 'pg_untrace','pg_unescape_bytea','pg_tty','pg_trace','pg_setclientencoding','pg_set_client_encoding', + 'pg_send_query','pg_select','pg_result_status','pg_result_seek','pg_result_error','pg_result', + 'pg_query','pg_put_line','pg_port','pg_ping','pg_pconnect','pg_options', + 'pg_numrows','pg_numfields','pg_num_rows','pg_num_fields','pg_meta_data','pg_lowrite', + 'pg_lounlink','pg_loreadall','pg_loread','pg_loopen','pg_loimport','pg_loexport', + 'pg_locreate','pg_loclose','pg_lo_write','pg_lo_unlink','pg_lo_tell','pg_lo_seek', + 'pg_lo_read_all','pg_lo_read','pg_lo_open','pg_lo_import','pg_lo_export','pg_lo_create', + 'pg_lo_close','pg_last_oid','pg_last_notice','pg_last_error','pg_insert','pg_host', + 'pg_getlastoid','pg_get_result','pg_get_pid','pg_get_notify','pg_freeresult','pg_free_result', + 'pg_fieldtype','pg_fieldsize','pg_fieldprtlen','pg_fieldnum','pg_fieldname','pg_fieldisnull', + 'pg_field_type','pg_field_size','pg_field_prtlen','pg_field_num','pg_field_name','pg_field_is_null', + 'pg_fetch_row','pg_fetch_result','pg_fetch_object','pg_fetch_assoc','pg_fetch_array','pg_fetch_all', + 'pg_exec','pg_escape_string','pg_escape_bytea','pg_errormessage','pg_end_copy','pg_delete', + 'pg_dbname','pg_copy_to','pg_copy_from','pg_convert','pg_connection_status','pg_connection_reset', + 'pg_connection_busy','pg_connect','pg_cmdtuples','pg_close','pg_clientencoding','pg_client_encoding', + 'pg_cancel_query','pg_affected_rows','pfsockopen','pclose','pathinfo','passthru', + 'parse_url','parse_str','parse_ini_file','pack','overload','output_reset_rewrite_vars', + 'output_add_rewrite_var','ord','openssl_x509_read','openssl_x509_parse','openssl_x509_free','openssl_x509_export_to_file', + 'openssl_x509_export','openssl_x509_checkpurpose','openssl_x509_check_private_key','openssl_verify','openssl_sign','openssl_seal', + 'openssl_public_encrypt','openssl_public_decrypt','openssl_private_encrypt','openssl_private_decrypt','openssl_pkey_new','openssl_pkey_get_public', + 'openssl_pkey_get_private','openssl_pkey_free','openssl_pkey_export_to_file','openssl_pkey_export','openssl_pkcs7_verify','openssl_pkcs7_sign', + 'openssl_pkcs7_encrypt','openssl_pkcs7_decrypt','openssl_open','openssl_get_publickey','openssl_get_privatekey','openssl_free_key', + 'openssl_error_string','openssl_csr_sign','openssl_csr_new','openssl_csr_export_to_file','openssl_csr_export','openlog', + 'opendir','octdec','ob_start','ob_list_handlers','ob_implicit_flush','ob_iconv_handler', + 'ob_gzhandler','ob_get_status','ob_get_level','ob_get_length','ob_get_flush','ob_get_contents', + 'ob_get_clean','ob_flush','ob_end_flush','ob_end_clean','ob_clean','number_format', + 'nl_langinfo','nl2br','ngettext','next','natsort','natcasesort', + 'mysql_unbuffered_query','mysql_thread_id','mysql_tablename','mysql_table_name','mysql_stat','mysql_selectdb', + 'mysql_select_db','mysql_result','mysql_real_escape_string','mysql_query','mysql_ping','mysql_pconnect', + 'mysql_numrows','mysql_numfields','mysql_num_rows','mysql_num_fields','mysql_listtables','mysql_listfields', + 'mysql_listdbs','mysql_list_tables','mysql_list_processes','mysql_list_fields','mysql_list_dbs','mysql_insert_id', + 'mysql_info','mysql_get_server_info','mysql_get_proto_info','mysql_get_host_info','mysql_get_client_info','mysql_freeresult', + 'mysql_free_result','mysql_fieldtype','mysql_fieldtable','mysql_fieldname','mysql_fieldlen','mysql_fieldflags', + 'mysql_field_type','mysql_field_table','mysql_field_seek','mysql_field_name','mysql_field_len','mysql_field_flags', + 'mysql_fetch_row','mysql_fetch_object','mysql_fetch_lengths','mysql_fetch_field','mysql_fetch_assoc','mysql_fetch_array', + 'mysql_escape_string','mysql_error','mysql_errno','mysql_dropdb','mysql_drop_db','mysql_dbname', + 'mysql_db_query','mysql_db_name','mysql_data_seek','mysql_createdb','mysql_create_db','mysql_connect', + 'mysql_close','mysql_client_encoding','mysql_affected_rows','mysql','mt_srand','mt_rand', + 'mt_getrandmax','move_uploaded_file','money_format','mktime','mkdir','min', + 'microtime','method_exists','metaphone','memory_get_usage','md5_file','md5', + 'mbsubstr','mbstrrpos','mbstrpos','mbstrlen','mbstrcut','mbsplit', + 'mbregex_encoding','mberegi_replace','mberegi','mbereg_search_setpos','mbereg_search_regs','mbereg_search_pos', + 'mbereg_search_init','mbereg_search_getregs','mbereg_search_getpos','mbereg_search','mbereg_replace','mbereg_match', + 'mbereg','mb_substr_count','mb_substr','mb_substitute_character','mb_strwidth','mb_strtoupper', + 'mb_strtolower','mb_strrpos','mb_strpos','mb_strlen','mb_strimwidth','mb_strcut', + 'mb_split','mb_send_mail','mb_regex_set_options','mb_regex_encoding','mb_preferred_mime_name','mb_parse_str', + 'mb_output_handler','mb_language','mb_internal_encoding','mb_http_output','mb_http_input','mb_get_info', + 'mb_eregi_replace','mb_eregi','mb_ereg_search_setpos','mb_ereg_search_regs','mb_ereg_search_pos','mb_ereg_search_init', + 'mb_ereg_search_getregs','mb_ereg_search_getpos','mb_ereg_search','mb_ereg_replace','mb_ereg_match','mb_ereg', + 'mb_encode_numericentity','mb_encode_mimeheader','mb_detect_order','mb_detect_encoding','mb_decode_numericentity','mb_decode_mimeheader', + 'mb_convert_variables','mb_convert_kana','mb_convert_encoding','mb_convert_case','max','mail', + 'magic_quotes_runtime','ltrim','lstat','long2ip','log1p','log10', + 'log','localtime','localeconv','linkinfo','link','levenshtein', + 'lcg_value','ksort','krsort','key_exists','key','juliantojd', + 'join','jewishtojd','jdtounix','jdtojulian','jdtojewish','jdtogregorian', + 'jdtofrench','jdmonthname','jddayofweek','is_writeable','is_writable','is_uploaded_file', + 'is_subclass_of','is_string','is_scalar','is_resource','is_real','is_readable', + 'is_object','is_numeric','is_null','is_nan','is_long','is_link', + 'is_integer','is_int','is_infinite','is_float','is_finite','is_file', + 'is_executable','is_double','is_dir','is_callable','is_bool','is_array', + 'is_a','iptcparse','iptcembed','ip2long','intval','ini_set', + 'ini_restore','ini_get_all','ini_get','ini_alter','in_array','import_request_variables', + 'implode','image_type_to_mime_type','ignore_user_abort','iconv_set_encoding','iconv_get_encoding','iconv', + 'i18n_mime_header_encode','i18n_mime_header_decode','i18n_ja_jp_hantozen','i18n_internal_encoding','i18n_http_output','i18n_http_input', + 'i18n_discover_encoding','i18n_convert','hypot','htmlspecialchars','htmlentities','html_entity_decode', + 'highlight_string','highlight_file','hexdec','hebrevc','hebrev','headers_sent', + 'header','gzwrite','gzuncompress','gztell','gzseek','gzrewind', + 'gzread','gzputs','gzpassthru','gzopen','gzinflate','gzgetss', + 'gzgets','gzgetc','gzfile','gzeof','gzencode','gzdeflate', + 'gzcompress','gzclose','gregoriantojd','gmstrftime','gmmktime','gmdate', + 'glob','gettype','gettimeofday','gettext','getservbyport','getservbyname', + 'getrusage','getrandmax','getprotobynumber','getprotobyname','getopt','getmyuid', + 'getmypid','getmyinode','getmygid','getmxrr','getlastmod','getimagesize', + 'gethostbynamel','gethostbyname','gethostbyaddr','getenv','getdate','getcwd', + 'getallheaders','get_resource_type','get_required_files','get_parent_class','get_object_vars','get_meta_tags', + 'get_magic_quotes_runtime','get_magic_quotes_gpc','get_loaded_extensions','get_included_files','get_include_path','get_html_translation_table', + 'get_extension_funcs','get_defined_vars','get_defined_functions','get_defined_constants','get_declared_classes','get_current_user', + 'get_class_vars','get_class_methods','get_class','get_cfg_var','get_browser','fwrite', + 'function_exists','func_num_args','func_get_args','func_get_arg','ftruncate','ftp_systype', + 'ftp_ssl_connect','ftp_size','ftp_site','ftp_set_option','ftp_rmdir','ftp_rename', + 'ftp_rawlist','ftp_quit','ftp_pwd','ftp_put','ftp_pasv','ftp_nlist', + 'ftp_nb_put','ftp_nb_get','ftp_nb_fput','ftp_nb_fget','ftp_nb_continue','ftp_mkdir', + 'ftp_mdtm','ftp_login','ftp_get_option','ftp_get','ftp_fput','ftp_fget', + 'ftp_exec','ftp_delete','ftp_connect','ftp_close','ftp_chdir','ftp_cdup', + 'ftok','ftell','fstat','fsockopen','fseek','fscanf', + 'frenchtojd','fread','fputs','fpassthru','fopen','fnmatch', + 'fmod','flush','floor','flock','floatval','filetype', + 'filesize','filepro_rowcount','filepro_retrieve','filepro_fieldwidth','filepro_fieldtype','filepro_fieldname', + 'filepro_fieldcount','filepro','fileperms','fileowner','filemtime','fileinode', + 'filegroup','filectime','fileatime','file_get_contents','file_exists','file', + 'fgetss','fgets','fgetcsv','fgetc','fflush','feof', + 'fclose','ezmlm_hash','extract','extension_loaded','expm1','explode', + 'exp','exif_thumbnail','exif_tagname','exif_read_data','exif_imagetype','exec', + 'escapeshellcmd','escapeshellarg','error_reporting','error_log','eregi_replace','eregi', + 'ereg_replace','ereg','end','easter_days','easter_date','each', + 'doubleval','dngettext','dl','diskfreespace','disk_total_space','disk_free_space', + 'dirname','dir','dgettext','deg2rad','defined','define_syslog_variables', + 'define','decoct','dechex','decbin','debug_zval_dump','debug_backtrace', + 'deaggregate','dcngettext','dcgettext','dba_sync','dba_replace','dba_popen', + 'dba_optimize','dba_open','dba_nextkey','dba_list','dba_insert','dba_handlers', + 'dba_firstkey','dba_fetch','dba_exists','dba_delete','dba_close','date', + 'current','ctype_xdigit','ctype_upper','ctype_space','ctype_punct','ctype_print', + 'ctype_lower','ctype_graph','ctype_digit','ctype_cntrl','ctype_alpha','ctype_alnum', + 'crypt','create_function','crc32','count_chars','count','cosh', + 'cos','copy','convert_cyr_string','constant','connection_status','connection_aborted', + 'compact','closelog','closedir','clearstatcache','class_exists','chunk_split', + 'chr','chown','chop','chmod','chgrp','checkdnsrr', + 'checkdate','chdir','ceil','call_user_method_array','call_user_method','call_user_func_array', + 'call_user_func','cal_to_jd','cal_info','cal_from_jd','cal_days_in_month','bzwrite', + 'bzread','bzopen','bzflush','bzerrstr','bzerror','bzerrno', + 'bzdecompress','bzcompress','bzclose','bindtextdomain','bindec','bind_textdomain_codeset', + 'bin2hex','bcsub','bcsqrt','bcscale','bcpow','bcmul', + 'bcmod','bcdiv','bccomp','bcadd','basename','base_convert', + 'base64_encode','base64_decode','atanh','atan2','atan','assert_options', + 'assert','asort','asinh','asin','arsort','array_walk', + 'array_values','array_unshift','array_unique','array_sum','array_splice','array_slice', + 'array_shift','array_search','array_reverse','array_reduce','array_rand','array_push', + 'array_pop','array_pad','array_multisort','array_merge_recursive','array_merge','array_map', + 'array_keys','array_key_exists','array_intersect_assoc','array_intersect','array_flip','array_filter', + 'array_fill','array_diff_assoc','array_diff','array_count_values','array_chunk','array_change_key_case', + 'apache_setenv','apache_response_headers','apache_request_headers','apache_note','apache_lookup_uri','apache_get_version', + 'apache_child_terminate','aggregation_info','aggregate_properties_by_regexp','aggregate_properties_by_list','aggregate_properties','aggregate_methods_by_regexp', + 'aggregate_methods_by_list','aggregate_methods','aggregate','addslashes','addcslashes','acosh', + 'acos','abs','_','echo', 'print', 'global', 'static', 'exit', 'array', 'empty', + 'eval', 'isset', 'unset', 'die', 'list' + ), + 5 => array( + 'timer_start', 'timer_read', 'timer_stop', 'conf_path', 'drupal_unset_globals', 'conf_init', + 'drupal_get_filename', 'variable_init', 'variable_get', 'variable_set', 'variable_del', + 'page_get_cache', 'bootstrap_invoke_all', 'drupal_load', 'drupal_page_header', 'drupal_page_cache_header', + 'bootstrap_hooks', 'drupal_unpack', 'referer_uri', 'check_plain', 'request_uri', 'watchdog', + 'drupal_set_message', 'drupal_get_messages', 'drupal_is_denied', 'drupal_anonymous_user', + 'drupal_bootstrap', '_drupal_bootstrap', '_drupal_cache_init', 'drupal_maintenance_theme', + 'get_t', 'cache_get', 'cache_set', 'cache_clear_all', 'drupal_set_content', 'drupal_get_content', + 'drupal_set_breadcrumb', 'drupal_get_breadcrumb', 'drupal_set_html_head', 'drupal_get_html_head', + 'drupal_clear_path_cache', 'drupal_set_header', 'drupal_get_headers', 'drupal_add_feed', + 'drupal_get_feeds', 'drupal_query_string_encode', 'drupal_get_destination', 'drupal_goto', + 'drupal_site_offline', 'drupal_not_found', 'drupal_access_denied', 'drupal_http_request', + 'error_handler', '_fix_gpc_magic', '_fix_gpc_magic_files', 'fix_gpc_magic', 'locale_initialize', + 't', 'valid_email_address', 'valid_url', 'flood_register_event', 'flood_is_allowed', + 'check_file', 'check_url', 'format_rss_channel', 'format_rss_item', 'format_xml_elements', + 'format_plural', 'parse_size', 'format_size', 'format_interval', 'format_date', 'url', + 'drupal_attributes', 'l', 'drupal_page_footer', 'drupal_map_assoc', 'drupal_eval', + 'drupal_get_path', 'base_path', 'drupal_clone', 'drupal_add_link', 'drupal_add_css', + 'drupal_get_css', 'drupal_build_css_cache', 'drupal_clear_css_cache', 'drupal_add_js', + '_drupal_add_js', 'drupal_get_js', 'drupal_to_js', 'drupal_urlencode', 'drupal_get_private_key', + 'drupal_get_token', 'drupal_valid_token', 'xmlrpc', '_drupal_bootstrap_full', 'page_set_cache', + 'drupal_mail', 'drupal_cron_run', 'drupal_cron_cleanup', 'drupal_system_listing', + 'drupal_render', '_element_sort', 'element_property', 'element_properties', 'element_child', + 'element_children', 'db_prefix_tables', 'db_set_active', '_db_query_callback', 'db_query', + '_db_rewrite_sql', 'db_rewrite_sql', 'db_escape_table', 'db_status_report', 'db_version', + 'db_connect', '_db_query', 'db_fetch_object', 'db_fetch_array', 'db_num_rows', 'db_result', + 'db_error', 'db_next_id', 'db_affected_rows', 'db_query_range', 'db_query_temporary', + 'db_encode_blob', 'db_decode_blob', 'db_escape_string', 'db_lock_table', 'db_unlock_tables', + 'db_table_exists', 'db_distinct_field', 'db_check_setup', 'file_create_url', 'file_create_path', + 'file_check_directory', 'file_check_path', 'file_check_upload', 'file_check_location', + 'file_copy', 'file_move', 'file_create_filename', 'file_delete', 'file_save_upload', + 'file_save_data', 'file_transfer', 'file_download', 'file_scan_directory', 'file_directory_temp', + 'file_directory_path', 'file_upload_max_size', 'drupal_get_form', '_drupal_clean_form_sessions', + 'drupal_execute', 'drupal_retrieve_form', 'drupal_process_form', 'drupal_prepare_form', + 'drupal_validate_form', 'drupal_submit_form', 'drupal_render_form', 'drupal_redirect_form', + '_form_validate', 'form_set_error', 'form_get_errors', 'form_get_error', 'form_error', + 'form_builder', 'form_set_value', '_form_set_value', '_element_info', 'form_options_flatten', + 'theme_select', 'form_select_options', 'form_get_options', 'theme_fieldset', 'theme_radio', + 'theme_radios', 'theme_password_confirm', 'expand_password_confirm', 'password_confirm_validate', + 'theme_date', 'expand_date', 'date_validate', 'map_month', 'checkboxes_value', 'weight_value', + 'expand_radios', 'theme_item', 'theme_checkbox', 'theme_checkboxes', 'expand_checkboxes', + 'theme_submit', 'theme_button', 'theme_hidden', 'theme_token', 'theme_textfield', + 'theme_form', 'theme_textarea', 'theme_markup', 'theme_password', 'process_weight', + 'theme_file', 'theme_form_element', '_form_set_class', 'form_clean_id', 'image_get_available_toolkits', + 'image_get_toolkit', 'image_toolkit_invoke', 'image_get_info', 'image_scale', 'image_resize', + 'image_rotate', 'image_crop', 'image_gd_settings', 'image_gd_check_settings', 'image_gd_resize', + 'image_gd_rotate', 'image_gd_crop', 'image_gd_open', 'image_gd_close', 'drupal_load_updates', + 'drupal_get_schema_versions', 'drupal_get_installed_schema_version', 'drupal_set_installed_schema_version', + 'drupal_install_profile_name', 'drupal_detect_baseurl', 'drupal_detect_database_types', + 'drupal_rewrite_settings', 'drupal_get_install_files', 'drupal_verify_profile', 'drupal_install_profile', + 'drupal_install_modules', 'drupal_uninstall_module', 'drupal_verify_install_file', + 'drupal_install_mkdir', 'drupal_install_fix_file', 'install_goto', 'st', '_system_update_utf8', + 'drupal_check_profile', 'drupal_requirements_severity', 'drupal_check_module', 'mysql_is_available', + 'drupal_test_mysql', 'mysqli_is_available', 'drupal_test_mysqli', 'pgsql_is_available', + 'drupal_test_pgsql', '_locale_add_language', '_locale_admin_manage_screen', 'theme_locale_admin_manage_screen', + '_locale_admin_manage_screen_submit', 'locale_add_language_form', 'locale_custom_language_form', + '_locale_admin_manage_add_screen', 'locale_add_language_form_validate', 'locale_add_language_form_submit', + '_locale_admin_import', '_locale_admin_import_submit', '_locale_export_po_form', '_locale_export_pot_form', + '_locale_admin_export_screen', '_locale_export_po_form_submit', '_locale_string_seek_form', + '_locale_string_edit', '_locale_string_edit_submit', '_locale_string_delete', '_locale_import_po', + '_locale_import_read_po', '_locale_import_message', '_locale_import_one_string', '_locale_import_parse_header', + '_locale_import_parse_plural_forms', '_locale_import_parse_arithmetic', '_locale_import_tokenize_formula', + '_locale_import_append_plural', '_locale_import_shorten_comments', '_locale_import_parse_quoted', + '_locale_export_po', '_locale_export_print', '_locale_export_wrap', '_locale_export_remove_plural', + '_locale_string_language_list', '_locale_string_seek_query', '_locale_string_seek', + '_locale_prepare_iso_list', '_locale_get_iso639_list', 'menu_get_menu', 'menu_get_local_tasks', + 'menu_get_item', 'menu_get_root_menus', 'menu_set_location', 'menu_execute_active_handler', + 'menu_get_active_item', 'menu_set_active_item', 'menu_get_active_nontask_item', 'menu_get_active_title', + 'menu_get_active_help', 'menu_get_active_breadcrumb', 'menu_in_active_trail', 'menu_in_active_trail_in_submenu', + 'menu_rebuild', 'theme_menu_tree', 'menu_tree', 'theme_menu_item', 'theme_menu_item_link', + 'menu_item_link', 'theme_menu_local_tasks', 'menu_primary_local_tasks', 'menu_secondary_local_tasks', + 'theme_menu_local_task', 'menu_primary_links', 'menu_secondary_links', 'theme_menu_links', + '_menu_get_active_trail', '_menu_get_active_trail_in_submenu', '_menu_sort', '_menu_build', + '_menu_item_is_accessible', '_menu_build_visible_tree', '_menu_append_contextual_items', + '_menu_find_parents', '_menu_build_local_tasks', '_menu_site_is_offline', 'module_load_all', + 'module_iterate', 'module_list', 'module_rebuild_cache', '_module_build_dependents', + '_module_parse_info_file', 'module_exists', 'module_load_install', 'module_enable', + 'module_disable', 'module_hook', 'module_implements', 'module_invoke', 'module_invoke_all', + 'pager_query', 'pager_get_querystring', 'theme_pager', 'theme_pager_first', 'theme_pager_previous', + 'theme_pager_next', 'theme_pager_last', 'theme_pager_list', 'theme_pager_link', 'pager_load_array', + 'drupal_init_path', 'drupal_lookup_path', 'drupal_get_path_alias', 'drupal_get_normal_path', + 'arg', 'drupal_get_title', 'drupal_set_title', 'drupal_is_front_page', 'sess_open', + 'sess_close', 'sess_read', 'sess_write', 'sess_regenerate', 'sess_count', 'sess_destroy_sid', + 'sess_destroy_uid', 'sess_gc', 'session_save_session', 'tablesort_init', 'tablesort_sql', + 'tablesort_header', 'tablesort_cell', 'tablesort_get_querystring', 'tablesort_get_order', + 'tablesort_get_sort', 'init_theme', 'list_themes', 'list_theme_engines', 'theme', + 'theme_get_function', 'path_to_theme', 'path_to_engine', 'theme_get_settings', 'theme_get_setting', + 'theme_placeholder', 'theme_page', 'theme_maintenance_page', 'theme_install_page', + 'theme_status_messages', 'theme_links', 'theme_image', 'theme_breadcrumb', 'theme_help', + 'theme_node', 'theme_submenu', 'theme_table', 'theme_table_select_header_cell', 'theme_tablesort_indicator', + 'theme_box', 'theme_block', 'theme_mark', 'theme_item_list', 'theme_more_help_link', + 'theme_xml_icon', 'theme_feed_icon', 'theme_closure', 'theme_blocks', 'theme_username', + 'theme_progress_bar', '_theme_table_cell', 'unicode_check', '_unicode_check', 'unicode_requirements', + 'drupal_xml_parser_create', 'drupal_convert_to_utf8', 'truncate_utf8', 'mime_header_encode', + 'mime_header_decode', '_mime_header_decode', 'decode_entities', '_decode_entities', + 'drupal_strlen', 'drupal_strtoupper', 'drupal_strtolower', '_unicode_caseflip', 'drupal_ucfirst', + 'drupal_substr', 'xmlrpc_value', 'xmlrpc_value_calculate_type', 'xmlrpc_value_get_xml', + 'xmlrpc_message', 'xmlrpc_message_parse', 'xmlrpc_message_set', 'xmlrpc_message_get', + 'xmlrpc_message_tag_open', 'xmlrpc_message_cdata', 'xmlrpc_message_tag_close', 'xmlrpc_request', + 'xmlrpc_error', 'xmlrpc_error_get_xml', 'xmlrpc_date', 'xmlrpc_date_get_xml', 'xmlrpc_base64', + 'xmlrpc_base64_get_xml', '_xmlrpc', 'xmlrpc_errno', 'xmlrpc_error_msg', 'xmlrpc_server', + 'xmlrpc_server_error', 'xmlrpc_server_output', 'xmlrpc_server_set', 'xmlrpc_server_get', + 'xmlrpc_server_call', 'xmlrpc_server_multicall', 'xmlrpc_server_list_methods', 'xmlrpc_server_get_capabilities', + 'xmlrpc_server_method_signature', 'xmlrpc_server_method_help', 'aggregator_help', + 'aggregator_menu', 'aggregator_admin_settings', 'aggregator_perm', 'aggregator_cron', + 'aggregator_block', 'aggregator_form_category_validate', 'aggregator_form_category_submit', + 'aggregator_save_category', 'aggregator_form_feed', 'aggregator_form_feed_validate', + 'aggregator_form_feed_submit', 'aggregator_save_feed', 'aggregator_remove', 'aggregator_element_start', + 'aggregator_element_end', 'aggregator_element_data', 'aggregator_refresh', 'aggregator_parse_w3cdtf', + 'aggregator_parse_feed', 'aggregator_save_item', 'aggregator_get_feed', 'aggregator_get_category', + 'aggregator_view', 'aggregator_admin_remove_feed', 'aggregator_admin_refresh_feed', + 'aggregator_admin_overview', 'aggregator_page_last', 'aggregator_page_source', 'aggregator_page_category', + 'aggregator_page_list', '_aggregator_page_list', 'theme_aggregator_page_list', 'aggregator_page_list_validate', + 'aggregator_page_list_submit', 'aggregator_page_sources', 'aggregator_page_rss', 'aggregator_page_opml', + 'aggregator_page_categories', 'theme_aggregator_feed', 'theme_aggregator_block_item', + 'theme_aggregator_summary_item', 'theme_aggregator_page_item', 'aggregator_filter_xss', + '_aggregator_items', 'block_help', 'block_perm', 'block_menu', 'block_block', '_block_rehash', + 'block_admin_display', '_block_compare', 'block_admin_display_submit', 'theme_block_admin_display', + 'block_box_get', 'block_admin_configure', 'block_admin_configure_validate', 'block_admin_configure_submit', + 'block_box_form_validate', 'block_box_form_submit', 'block_box_delete', 'block_box_delete_submit', + 'block_box_form', 'block_box_save', 'block_user', 'block_list', 'blog_node_info', + 'blog_perm', 'blog_access', 'blog_user', 'blog_help', 'blog_feed_user', 'blog_feed_last', + 'blog_page', 'blog_page_user', 'blog_page_last', 'blog_form', 'blog_view', 'blog_link', + 'blog_menu', 'blog_block', 'blogapi_help', 'blogapi_xmlrpc', 'blogapi_blogger_get_users_blogs', + 'blogapi_blogger_get_user_info', 'blogapi_blogger_new_post', 'blogapi_blogger_edit_post', + 'blogapi_blogger_get_post', 'blogapi_blogger_delete_post', 'blogapi_blogger_get_recent_posts', + 'blogapi_metaweblog_new_post', 'blogapi_metaweblog_edit_post', 'blogapi_metaweblog_get_post', + 'blogapi_metaweblog_new_media_object', 'blogapi_metaweblog_get_category_list', 'blogapi_metaweblog_get_recent_posts', + 'blogapi_mt_get_recent_post_titles', 'blogapi_mt_get_category_list', 'blogapi_mt_get_post_categories', + 'blogapi_mt_set_post_categories', 'blogapi_mt_supported_text_filters', 'blogap_mti_publish_post', + 'blogapi_error', 'blogapi_validate_user', 'blogapi_blogger_title', 'blogapi_admin_settings', + 'blogapi_menu', 'blogapi_blogapi', 'blogapi_rsd', '_blogapi_mt_extra', '_blogapi_get_post', + '_blogapi_blogid', '_blogapi_get_node_types', 'book_node_info', 'book_perm', 'book_access', + 'book_link', 'book_menu', 'book_block', 'book_insert', 'book_submit', 'book_form', + 'book_outline', 'book_outline_submit', 'book_location', 'book_location_down', 'book_prev', + 'book_next', 'book_content', 'book_nodeapi', 'theme_book_navigation', 'book_toc_recurse', + 'book_toc', 'book_tree_recurse', 'book_tree', 'book_render', 'book_export', 'book_export_html', + 'theme_book_export_html', 'book_recurse', 'book_node_visitor_html_pre', 'book_node_visitor_html_post', + '_book_admin_table', '_book_admin_table_tree', 'theme_book_admin_table', 'book_admin_edit', + 'book_admin_orphan', 'book_admin_edit_submit', 'book_admin', 'book_admin_overview', + 'book_help', 'color_help', 'color_form_alter', '_color_page_alter', 'color_get_info', + 'color_get_palette', 'color_scheme_form', 'theme_color_scheme_form', 'color_scheme_form_submit', + '_color_rewrite_stylesheet', '_color_import_stylesheet', '_color_render_images', '_color_shift', + '_color_gd', '_color_blend', '_color_unpack', '_color_pack', '_color_hsl2rgb', '_color_hue2rgb', + '_color_rgb2hsl', 'comment_help', 'comment_menu', 'comment_perm', 'comment_block', + 'comment_get_recent', 'theme_comment_block', 'comment_link', 'comment_form_alter', + 'comment_nodeapi', 'comment_user', 'comment_admin_settings', 'comment_access', 'comment_node_url', + 'comment_edit', 'comment_reply', 'comment_save', 'comment_links', 'comment_render', + 'comment_delete', 'comment_confirm_delete', 'comment_confirm_delete_submit', 'comment_operations', + 'comment_admin', 'comment_admin_overview', 'comment_admin_overview_validate', 'comment_admin_overview_submit', + 'theme_comment_admin_overview', 'comment_multiple_delete_confirm', 'comment_multiple_delete_confirm_submit', + '_comment_load', 'comment_num_all', 'comment_num_replies', 'comment_num_new', 'comment_validate', + 'comment_form', 'comment_form_box', 'comment_form_add_preview', 'comment_form_validate', + '_comment_form_submit', 'comment_form_submit', 'theme_comment_preview', 'theme_comment_view', + 'comment_controls', 'theme_comment_controls', 'comment_controls_submit', 'theme_comment', + 'theme_comment_folded', 'theme_comment_flat_collapsed', 'theme_comment_flat_expanded', + 'theme_comment_thread_collapsed', 'theme_comment_thread_expanded', 'theme_comment_post_forbidden', + 'theme_comment_wrapper', '_comment_delete_thread', '_comment_get_modes', '_comment_get_orders', + '_comment_per_page', '_comment_get_display_setting', '_comment_update_node_statistics', + 'comment_invoke_comment', 'int2vancode', 'vancode2int', 'contact_help', 'contact_perm', + 'contact_menu', 'contact_user', 'contact_admin_categories', 'contact_admin_edit', + 'contact_admin_edit_validate', 'contact_admin_edit_submit', 'contact_admin_delete', + 'contact_admin_delete_submit', 'contact_admin_settings', 'contact_user_page', 'contact_mail_user', + 'contact_mail_user_submit', 'contact_site_page', 'contact_mail_page', 'contact_mail_page_validate', + 'contact_mail_page_submit', 'drupal_help', 'drupal_sites_registry_settings', 'drupal_distributed_authentication_settings', + 'drupal_cron', 'drupal_client_ping', 'drupal_client_page', 'theme_client_list', 'drupal_xmlrpc', + 'drupal_notify', 'drupal_info', 'drupal_auth', 'drupal_menu', 'drupal_page_help', + 'drupal_login', 'filter_help', 'filter_menu', 'filter_perm', 'filter_cron', 'filter_filter_tips', + 'filter_admin_overview', 'filter_admin_overview_submit', 'theme_filter_admin_overview', + 'filter_admin_delete', 'filter_admin_delete_submit', 'filter_admin_format_form', 'filter_admin_format_form_validate', + 'filter_admin_format_form_submit', 'filter_admin_order', 'theme_filter_admin_order', + 'filter_admin_order_submit', 'filter_admin_configure', 'filter_formats', 'filter_list_all', + '_filter_list_cmp', 'filter_resolve_format', 'filter_format_allowcache', 'filter_list_format', + 'check_markup', 'filter_form', 'filter_form_validate', 'filter_access', 'filter_tips_long', + '_filter_tips', 'theme_filter_tips', 'theme_filter_tips_more_info', 'filter_filter', + '_filter_html_settings', '_filter_html', '_filter_url_settings', '_filter_url', '_filter_url_parse_full_links', + '_filter_url_parse_partial_links', '_filter_url_trim', '_filter_autop', 'filter_xss_admin', + 'filter_xss', '_filter_xss_split', '_filter_xss_attributes', 'filter_xss_bad_protocol', + 'forum_help', 'forum_menu', 'forum_node_info', 'forum_access', 'forum_perm', 'forum_nodeapi', + 'forum_taxonomy', 'forum_admin_settings', 'forum_form_alter', 'forum_load', 'forum_block', + 'forum_view', 'forum_submit', 'forum_validate', 'forum_update', 'forum_form', 'forum_prepare', + 'forum_insert', 'forum_delete', 'forum_form_container', 'forum_form_main', 'forum_form_forum', + 'forum_form_submit', 'forum_confirm_delete', 'forum_confirm_delete_submit', 'forum_overview', + '_forum_parent_select', 'forum_link_alter', '_forum_get_vid', '_forum_format', 'forum_get_forums', + '_forum_topics_unread', 'forum_get_topics', '_forum_new', 'forum_page', 'theme_forum_display', + 'theme_forum_list', 'theme_forum_topic_list', 'theme_forum_icon', 'theme_forum_topic_navigation', + '_forum_user_last_visit', '_forum_get_topic_order', '_forum_get_topic_order_sql', + 'help_menu', 'help_main', 'help_links_as_list', 'help_help', 'help_page', 'legacy_help', + 'legacy_menu', 'legacy_taxonomy_page', 'legacy_taxonomy_feed', 'legacy_blog_feed', + 'legacy_filter', '_legacy_filter_old_urls', 'locale_help', 'locale_menu', 'locale_perm', + 'locale_user', 'locale', 'locale_refresh_cache', 'locale_supported_languages', 'locale_get_plural', + 'locale_admin_manage', 'locale_admin_manage_delete_form', 'locale_admin_manage_delete_form_submit', + 'locale_admin_manage_add', 'locale_admin_import', 'locale_admin_export', 'locale_string_search', + 'locale_admin_string_edit', 'locale_admin_string_edit_submit', 'locale_admin_string_delete', + 'menu_help', 'menu_menu', 'menu_block', 'menu_nodeapi', 'menu_perm', 'menu_form_alter', + 'menu_configure', 'menu_edit_menu_form', 'menu_edit_item_form', 'menu_edit_item_form_submit', + 'menu_item_delete_form', 'menu_item_delete_form_submit', 'menu_reset_item', 'menu_reset_item_submit', + 'menu_confirm_disable_item', 'menu_confirm_disable_item_submit', 'menu_overview', + 'menu_edit_item_save', 'menu_save_item', 'menu_delete_item', 'menu_overview_tree', + 'menu_overview_tree_rows', 'menu_parent_options', 'menu_node_form_delete', 'node_overview_types', + 'node_type_form', 'node_type_form_validate', 'node_type_form_submit', 'node_node_type', + 'node_type_reset', 'node_type_delete_confirm', 'node_type_delete_confirm_submit', + 'node_help', 'node_cron', 'node_title_list', 'theme_node_list', 'node_tag_new', 'node_last_viewed', + 'node_mark', 'node_teaser', 'node_get_types', 'node_types_rebuild', 'node_type_save', + 'node_type_delete', 'node_type_update_nodes', '_node_types_build', '_node_type_set_defaults', + 'node_hook', 'node_invoke', 'node_invoke_nodeapi', 'node_load', 'node_save', 'node_view', + 'node_prepare', 'node_build_content', 'node_show', 'node_perm', 'node_search', 'node_user', + 'theme_node_search_admin', 'node_configure', 'node_configure_validate', 'node_configure_rebuild_confirm', + 'node_configure_rebuild_confirm_submit', 'node_comment_mode', 'node_link', 'node_menu', + 'node_last_changed', 'node_node_operations', 'node_operations_publish', 'node_operations_unpublish', + 'node_operations_promote', 'node_operations_demote', 'node_operations_sticky', 'node_operations_unsticky', + 'node_filters', 'node_build_filter_query', 'node_filter_form', 'theme_node_filter_form', + 'theme_node_filters', 'node_filter_form_submit', 'node_admin_nodes_submit', 'node_admin_nodes_validate', + 'node_admin_content', 'node_admin_nodes', 'theme_node_admin_nodes', 'node_multiple_delete_confirm', + 'node_multiple_delete_confirm_submit', 'node_revision_overview', 'node_revision_revert', + 'node_revision_revert_confirm', 'node_revision_revert_confirm_submit', 'node_revision_delete', + 'node_revision_delete_confirm', 'node_revision_delete_confirm_submit', 'node_revision_list', + 'node_admin_search', 'node_block', 'node_feed', 'node_submit', 'node_validate', 'node_form_validate', + 'node_object_prepare', 'node_form', 'node_form_add_preview', 'theme_node_form', 'node_add', + 'node_preview', 'theme_node_preview', 'theme_node_log_message', 'node_form_submit', + 'node_delete_confirm', 'node_delete_confirm_submit', 'node_delete', 'node_revisions', + 'node_page_default', 'node_page_view', 'node_page_edit', 'node_update_shutdown', 'node_update_index', + 'node_form_alter', 'node_search_validate', 'node_access', '_node_access_join_sql', + '_node_access_where_sql', 'node_access_grants', 'node_access_view_all_nodes', 'node_db_rewrite_sql', + 'node_access_acquire_grants', 'node_access_write_grants', 'node_access_rebuild', 'node_content_access', + 'node_content_form', 'node_forms', 'path_help', 'path_menu', 'path_admin', 'path_admin_edit', + 'path_admin_delete_confirm', 'path_admin_delete_confirm_submit', 'path_admin_delete', + 'path_set_alias', 'path_form', 'path_nodeapi', 'path_form_alter', 'path_perm', 'path_overview', + 'path_load', 'path_form_validate', 'path_form_submit', 'ping_help', 'ping_cron', '_ping_notify', + 'ping_ping', 'poll_help', 'poll_access', 'poll_block', 'poll_cron', 'poll_delete', + 'poll_submit', 'poll_validate', 'poll_form', 'poll_insert', 'poll_menu', 'poll_load', + 'poll_node_info', 'poll_page', 'poll_perm', 'poll_teaser', 'poll_view_voting', 'theme_poll_view_voting', + 'poll_view_results', 'theme_poll_results', 'poll_cancel_form', 'theme_poll_bar', 'poll_results', + 'poll_votes', 'poll_vote', 'poll_cancel', 'poll_view', 'poll_update', 'poll_user', + 'profile_help', 'profile_menu', 'profile_block', 'profile_user', 'profile_field_form', + 'profile_field_form_validate', 'profile_field_form_submit', 'profile_field_delete', + 'profile_field_delete_submit', 'profile_admin_overview', 'profile_browse', 'profile_load_profile', + 'profile_save_profile', 'profile_view_field', 'profile_view_profile', '_profile_form_explanation', + 'profile_form_profile', 'profile_autocomplete', '_profile_update_user_fields', 'profile_validate_profile', + 'profile_categories', 'theme_profile_block', 'theme_profile_listing', '_profile_field_types', + '_profile_field_serialize', '_profile_get_fields', 'profile_admin_settings_autocomplete', + 'search_help', 'search_perm', 'search_block', 'search_menu', 'search_admin_settings_validate', + 'search_admin_settings', 'search_wipe_confirm', 'search_wipe_confirm_submit', 'search_wipe', + 'search_dirty', 'search_cron', 'search_update_totals', 'search_simplify', 'search_expand_cjk', + 'search_index_split', '_search_index_truncate', 'search_preprocess', 'search_index', + 'search_query_extract', 'search_query_insert', 'search_parse_query', '_search_parse_query', + 'do_search', 'search_get_keys', 'search_view', 'search_form', 'search_form_validate', + 'search_form_submit', 'search_box', 'search_box_form_submit', 'theme_search_theme_form', + 'theme_search_block_form', 'search_data', 'search_excerpt', '_search_excerpt_replace', + 'theme_search_item', 'theme_search_page', 'search_forms', 'statistics_help', 'statistics_exit', + 'statistics_perm', 'statistics_link', 'statistics_menu', 'statistics_user', 'statistics_access_log', + 'statistics_node_tracker', 'statistics_user_tracker', 'statistics_recent_hits', 'statistics_top_pages', + 'statistics_top_visitors', 'statistics_top_referrers', 'statistics_access_logging_settings', + 'statistics_cron', 'statistics_title_list', 'statistics_get', 'statistics_block', + '_statistics_link', '_statistics_format_item', 'statistics_nodeapi', 'system_help', + 'system_perm', 'system_elements', 'system_menu', 'system_user', 'system_main_admin_page', + 'system_admin_menu_block', 'system_admin_menu_block_page', 'system_admin_compact_page', + 'system_admin_theme_settings', 'system_admin_theme_submit', 'system_theme_select_form', + 'theme_system_theme_select_form', '_system_zonelist', 'system_site_information_settings', + 'system_clean_url_settings', 'system_error_reporting_settings', 'system_performance_settings', + 'system_file_system_settings', 'system_image_toolkit_settings', 'system_rss_feeds_settings', + 'system_date_time_settings', 'system_site_maintenance_settings', 'system_check_directory', + 'system_get_files_database', 'system_theme_data', 'system_region_list', 'system_default_region', + 'system_initialize_theme_blocks', 'system_settings_form', 'system_theme_settings_submit', + 'system_settings_form_submit', 'system_themes', 'theme_system_themes', 'system_themes_submit', + 'system_modules', 'system_modules_disable', 'system_modules_confirm_form', 'system_module_build_dependencies', + 'system_modules_submit', 'theme_system_modules', 'system_modules_uninstall', 'system_modules_uninstall_confirm_form', + 'theme_system_modules_uninstall', 'system_modules_uninstall_validate', 'system_modules_uninstall_submit', + 'system_run_cron', 'system_php', '_system_sql', 'system_sql', 'system_status', '_system_sort_requirements', + 'theme_status_report', 'system_settings_overview', 'system_theme_settings', 'system_node_type', + 'confirm_form', 'system_admin_compact_mode', 'theme_admin_page', 'theme_admin_block', + 'theme_admin_block_content', 'system_admin_by_module', 'system_get_module_admin_tasks', + 'theme_system_admin_by_module', 'taxonomy_perm', 'taxonomy_link', 'taxonomy_term_path', + 'taxonomy_menu', 'taxonomy_overview_vocabularies', 'taxonomy_overview_terms', 'taxonomy_form_vocabulary', + 'taxonomy_form_vocabulary_submit', 'taxonomy_save_vocabulary', 'taxonomy_del_vocabulary', + 'taxonomy_vocabulary_confirm_delete', 'taxonomy_vocabulary_confirm_delete_submit', + 'taxonomy_form_term', 'taxonomy_form_term_submit', 'taxonomy_save_term', 'taxonomy_del_term', + 'taxonomy_term_confirm_delete', 'taxonomy_term_confirm_delete_submit', 'taxonomy_form', + 'taxonomy_form_all', 'taxonomy_get_vocabularies', 'taxonomy_form_alter', 'taxonomy_node_get_terms_by_vocabulary', + 'taxonomy_node_get_terms', 'taxonomy_node_validate', 'taxonomy_node_save', 'taxonomy_node_delete', + 'taxonomy_node_type', 'taxonomy_get_related', 'taxonomy_get_parents', 'taxonomy_get_parents_all', + 'taxonomy_get_children', 'taxonomy_get_tree', 'taxonomy_get_synonyms', 'taxonomy_get_synonym_root', + 'taxonomy_term_count_nodes', '_taxonomy_term_children', 'taxonomy_get_term_by_name', + 'taxonomy_get_vocabulary', 'taxonomy_get_term', '_taxonomy_term_select', 'theme_taxonomy_term_select', + 'taxonomy_select_nodes', 'taxonomy_render_nodes', 'taxonomy_nodeapi', 'taxonomy_node_update_index', + 'taxonomy_terms_parse_string', 'taxonomy_term_page', 'taxonomy_admin_vocabulary_edit', + 'taxonomy_admin_term_edit', 'taxonomy_rss_item', 'taxonomy_help', '_taxonomy_get_tid_from_term', + 'taxonomy_autocomplete', 'throttle_menu', 'throttle_status', 'throttle_exit', 'throttle_help', + 'throttle_admin_settings', 'throttle_admin_settings_validate', 'tracker_help', 'tracker_menu', + 'tracker_track_user', 'tracker_page', 'upload_help', 'upload_perm', 'upload_link', + 'upload_menu', 'upload_admin_settings_validate', 'upload_admin_settings', 'upload_download', + 'upload_file_download', '_upload_prepare', 'upload_form_alter', '_upload_validate', + 'upload_nodeapi', 'theme_upload_attachments', 'upload_space_used', 'upload_total_space_used', + 'upload_munge_filename', 'upload_unmunge_filename', 'upload_save', 'upload_delete', + 'upload_delete_revision', '_upload_form', 'theme_upload_form_current', 'theme_upload_form_new', + 'upload_load', '_upload_image', 'upload_js', 'user_module_invoke', 'user_external_load', + 'user_load', 'user_save', 'user_validate_name', 'user_validate_mail', 'user_validate_picture', + 'user_password', 'user_access', 'user_is_blocked', 'user_fields', 'user_perm', 'user_file_download', + 'user_search', 'user_user', 'user_login_block', 'user_block', 'theme_user_picture', + 'theme_user_profile', 'theme_user_list', 'user_menu', 'user_get_authmaps', 'user_set_authmaps', + 'user_auth_help_links', 'user_login', 'user_login_validate', 'user_login_submit', + 'user_authenticate', 'user_logout', 'user_pass', 'user_pass_validate', 'user_pass_submit', + 'user_pass_reset', 'user_pass_reset_url', 'user_pass_rehash', 'user_register', 'user_register_validate', + 'user_register_submit', 'user_edit_form', '_user_edit_validate', '_user_edit_submit', + 'user_edit', 'user_confirm_delete', 'user_confirm_delete_submit', 'user_delete', 'user_edit_validate', + 'user_edit_submit', 'user_view', '_user_mail_text', 'user_admin_check_user', 'user_admin_check_mail', + 'user_admin_check_host', 'user_admin_access_check', 'user_admin_access_check_validate', + 'user_admin_access_check_submit', 'user_admin_access_add', 'user_admin_access_delete_confirm', + 'user_admin_access_delete_confirm_submit', 'user_admin_access_edit', 'user_admin_access_form', + 'user_admin_access', 'user_roles', 'user_admin_perm', 'theme_user_admin_perm', 'user_admin_perm_submit', + 'user_admin_role', 'user_admin_role_validate', 'user_admin_role_submit', 'theme_user_admin_new_role', + 'user_admin_account', 'theme_user_admin_account', 'user_admin_account_submit', 'user_admin_account_validate', + 'user_user_operations', 'user_user_operations_unblock', 'user_user_operations_block', + 'user_multiple_role_edit', 'user_multiple_delete_confirm', 'user_multiple_delete_confirm_submit', + 'user_admin_settings', 'user_admin', 'user_help', 'user_help_page', '_user_categories', + '_user_sort', '_user_forms', 'user_autocomplete', 'user_filters', 'user_build_filter_query', + 'user_filter_form', 'theme_user_filter_form', 'theme_user_filters', 'user_filter_form_submit', + 'user_forms', 'watchdog_help', 'watchdog_menu', 'watchdog_cron', 'watchdog_user', + 'watchdog_form_overview', 'watchdog_overview', 'watchdog_top', 'theme_watchdog_form_overview', + 'watchdog_form_overview_submit', 'watchdog_event', '_watchdog_get_message_types', + ), + 6 => array( + 'CACHE_PERMANENT', 'CACHE_TEMPORARY', 'CACHE_DISABLED', 'CACHE_NORMAL', 'CACHE_AGGRESSIVE', + 'WATCHDOG_NOTICE', 'WATCHDOG_WARNING', 'WATCHDOG_ERROR', 'DRUPAL_BOOTSTRAP_CONFIGURATION', + 'DRUPAL_BOOTSTRAP_EARLY_PAGE_CACHE', 'DRUPAL_BOOTSTRAP_DATABASE', 'DRUPAL_BOOTSTRAP_ACCESS', + 'DRUPAL_BOOTSTRAP_SESSION', 'DRUPAL_BOOTSTRAP_LATE_PAGE_CACHE', 'DRUPAL_BOOTSTRAP_PATH', + 'DRUPAL_BOOTSTRAP_FULL', 'DRUPAL_ANONYMOUS_RID', 'DRUPAL_AUTHENTICATED_RID', 'SAVED_NEW', + 'SAVED_UPDATED', 'SAVED_DELETED', 'DB_QUERY_REGEXP', 'FILE_DOWNLOADS_PUBLIC', 'FILE_DOWNLOADS_PRIVATE', + 'FILE_CREATE_DIRECTORY', 'FILE_MODIFY_PERMISSIONS', 'FILE_EXISTS_RENAME', 'FILE_EXISTS_REPLACE', + 'FILE_EXISTS_ERROR', 'SCHEMA_UNINSTALLED', 'SCHEMA_INSTALLED', 'REQUIREMENT_INFO', + 'REQUIREMENT_OK', 'REQUIREMENT_WARNING', 'REQUIREMENT_ERROR', 'FILE_EXIST', 'FILE_READABLE', + 'FILE_WRITABLE', 'FILE_EXECUTABLE', 'FILE_NOT_EXIST', 'FILE_NOT_READABLE', 'FILE_NOT_WRITABLE', + 'FILE_NOT_EXECUTABLE', 'MENU_IS_ROOT', 'MENU_VISIBLE_IN_TREE', 'MENU_VISIBLE_IN_BREADCRUMB', + 'MENU_VISIBLE_IF_HAS_CHILDREN', 'MENU_MODIFIABLE_BY_ADMIN', 'MENU_MODIFIED_BY_ADMIN', + 'MENU_CREATED_BY_ADMIN', 'MENU_IS_LOCAL_TASK', 'MENU_EXPANDED', 'MENU_LINKS_TO_PARENT', + 'MENU_NORMAL_ITEM', 'MENU_ITEM_GROUPING', 'MENU_CALLBACK', 'MENU_DYNAMIC_ITEM', 'MENU_SUGGESTED_ITEM', + 'MENU_LOCAL_TASK', 'MENU_DEFAULT_LOCAL_TASK', 'MENU_CUSTOM_ITEM', 'MENU_CUSTOM_MENU', + 'MENU_FOUND', 'MENU_NOT_FOUND', 'MENU_ACCESS_DENIED', 'MENU_SITE_OFFLINE', 'MARK_READ', + 'MARK_NEW', 'MARK_UPDATED', 'UNICODE_ERROR', 'UNICODE_SINGLEBYTE', 'UNICODE_MULTIBYTE', + 'BLOCK_REGION_NONE', 'COMMENT_PUBLISHED', 'COMMENT_NOT_PUBLISHED', 'COMMENT_MODE_FLAT_COLLAPSED', + 'COMMENT_MODE_FLAT_EXPANDED', 'COMMENT_MODE_THREADED_COLLAPSED', 'COMMENT_MODE_THREADED_EXPANDED', + 'COMMENT_ORDER_NEWEST_FIRST', 'COMMENT_ORDER_OLDEST_FIRST', 'COMMENT_CONTROLS_ABOVE', + 'COMMENT_CONTROLS_BELOW', 'COMMENT_CONTROLS_ABOVE_BELOW', 'COMMENT_CONTROLS_HIDDEN', + 'COMMENT_ANONYMOUS_MAYNOT_CONTACT', 'COMMENT_ANONYMOUS_MAY_CONTACT', 'COMMENT_ANONYMOUS_MUST_CONTACT', + 'COMMENT_FORM_SEPARATE_PAGE', 'COMMENT_FORM_BELOW', 'COMMENT_NODE_DISABLED', 'COMMENT_NODE_READ_ONLY', + 'COMMENT_NODE_READ_WRITE', 'COMMENT_PREVIEW_OPTIONAL', 'COMMENT_PREVIEW_REQUIRED', + 'FILTER_FORMAT_DEFAULT', 'FILTER_HTML_STRIP', 'FILTER_HTML_ESCAPE', 'NODE_NEW_LIMIT', + 'PROFILE_PRIVATE', 'PROFILE_PUBLIC', 'PROFILE_PUBLIC_LISTINGS', 'PROFILE_HIDDEN', + 'PREG_CLASS_SEARCH_EXCLUDE', 'PREG_CLASS_NUMBERS', 'PREG_CLASS_PUNCTUATION', 'PREG_CLASS_CJK', + 'VERSION', 'USERNAME_MAX_LENGTH', 'EMAIL_MAX_LENGTH', + ), + ), + 'SYMBOLS' => array( + '(', ')', '[', ']', '{', '}', '!', '@', '%', '&', '*', '|', '/', '<', '>' + ), + 'CASE_SENSITIVE' => array( + GESHI_COMMENTS => false, + 1 => false, + 2 => false, + 3 => false, + 4 => false, + 5 => false, + 6 => false, + ), + 'STYLES' => array( + 'KEYWORDS' => array( + 1 => 'color: #b1b100;', + 2 => 'color: #000000; font-weight: bold;', + 3 => 'color: #000066;', + 5 => 'color: #000066;', + 6 => 'color: #000000; font-weight: bold;', + ), + 'COMMENTS' => array( + 1 => 'color: #808080; font-style: italic;', + 2 => 'color: #808080; font-style: italic;', + 'MULTI' => 'color: #808080; font-style: italic;' + ), + 'ESCAPE_CHAR' => array( + 0 => 'color: #000099; font-weight: bold;' + ), + 'BRACKETS' => array( + 0 => 'color: #66cc66;' + ), + 'STRINGS' => array( + 0 => 'color: #ff0000;' + ), + 'NUMBERS' => array( + 0 => 'color: #cc66cc;' + ), + 'METHODS' => array( + 1 => 'color: #006600;', + 2 => 'color: #006600;' + ), + 'SYMBOLS' => array( + 0 => 'color: #66cc66;' + ), + 'REGEXPS' => array( + 0 => 'color: #0000ff;', + 1 => 'color: #ff0000' + ), + 'SCRIPT' => array( + 0 => '', + 1 => '', + 2 => '', + 3 => '' + ) + ), + 'URLS' => array( + 1 => '', + 2 => '', + 3 => 'http://www.php.net/{FNAME}', + 4 => '', + 5 => 'http://api.drupal.org/api/function/{FNAME}/5', + 6 => 'http://api.drupal.org/api/constant/{FNAME}/5', + ), + 'OOLANG' => true, + 'OBJECT_SPLITTERS' => array( + 1 => '->', + 2 => '::', + ), + 'REGEXPS' => array( + 0 => "[\\$]{1,2}[a-zA-Z_][a-zA-Z0-9_]*", + 1 => array( + GESHI_SEARCH => "([a-zA-Z]+)(\n)(.*)(\n)(\\1;?)", + GESHI_REPLACE => '\3', + GESHI_BEFORE => '\1\2', + GESHI_AFTER => '\4\5', + GESHI_MODIFIERS => 'siU' + ), + ), + 'STRICT_MODE_APPLIES' => GESHI_MAYBE, + 'SCRIPT_DELIMITERS' => array( + 0 => array( + ' '?>' + ), + 1 => array( + ' '?>' + ), + 2 => array( + '<%' => '%>' + ), + ), + 'HIGHLIGHT_STRICT_BLOCK' => array( + 0 => true, + 1 => true, + 2 => true, + 3 => true + ), + 'TAB_WIDTH' => 2 +); diff --git a/sites/all/modules/geshifilter/geshi-extra/drupal6.php b/sites/all/modules/geshifilter/geshi-extra/drupal6.php new file mode 100644 index 0000000..68cee9a --- /dev/null +++ b/sites/all/modules/geshifilter/geshi-extra/drupal6.php @@ -0,0 +1,816 @@ + 'Drupal 6', + 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'), + 'COMMENT_MULTI' => array('/*' => '*/'), + 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE, + 'QUOTEMARKS' => array("'", '"'), + 'ESCAPE_CHAR' => '\\', + 'KEYWORDS' => array( + 1 => array( + 'include', 'require', 'include_once', 'require_once', + 'for', 'foreach', 'as', 'if', 'elseif', 'else', 'while', 'do', 'endwhile', + 'endif', 'switch', 'case', 'endswitch', 'endfor', 'endforeach', + 'return', 'break', 'continue' + ), + 2 => array( + 'null', '__LINE__', '__FILE__', + 'false', '<?php', '?>', '<?', + '<script language', '</script>', + 'true', 'var', 'default', + 'function', 'class', 'new', '&new', 'public', 'private', 'interface', 'extends', + '__FUNCTION__', '__CLASS__', '__METHOD__', 'PHP_VERSION', + 'PHP_OS', 'DEFAULT_INCLUDE_PATH', 'PEAR_INSTALL_DIR', 'PEAR_EXTENSION_DIR', + 'PHP_EXTENSION_DIR', 'PHP_BINDIR', 'PHP_LIBDIR', 'PHP_DATADIR', 'PHP_SYSCONFDIR', + 'PHP_LOCALSTATEDIR', 'PHP_CONFIG_FILE_PATH', 'PHP_OUTPUT_HANDLER_START', 'PHP_OUTPUT_HANDLER_CONT', + 'PHP_OUTPUT_HANDLER_END', 'E_ERROR', 'E_WARNING', 'E_PARSE', 'E_NOTICE', + 'E_CORE_ERROR', 'E_CORE_WARNING', 'E_COMPILE_ERROR', 'E_COMPILE_WARNING', 'E_USER_ERROR', + 'E_USER_WARNING', 'E_USER_NOTICE', 'E_ALL' + ), + 3 => array( + 'zlib_get_coding_type','zend_version','zend_logo_guid','yp_order','yp_next', + 'yp_match','yp_master','yp_get_default_domain','yp_first','yp_errno','yp_err_string', + 'yp_cat','yp_all','xml_set_unparsed_entity_decl_handler','xml_set_start_namespace_decl_handler','xml_set_processing_instruction_handler','xml_set_object', + 'xml_set_notation_decl_handler','xml_set_external_entity_ref_handler','xml_set_end_namespace_decl_handler','xml_set_element_handler','xml_set_default_handler','xml_set_character_data_handler', + 'xml_parser_set_option','xml_parser_get_option','xml_parser_free','xml_parser_create_ns','xml_parser_create','xml_parse_into_struct', + 'xml_parse','xml_get_error_code','xml_get_current_line_number','xml_get_current_column_number','xml_get_current_byte_index','xml_error_string', + 'wordwrap','wddx_serialize_vars','wddx_serialize_value','wddx_packet_start','wddx_packet_end','wddx_deserialize', + 'wddx_add_vars','vsprintf','vprintf','virtual','version_compare','var_export', + 'var_dump','utf8_encode','utf8_decode','usort','usleep','user_error', + 'urlencode','urldecode','unserialize','unregister_tick_function','unpack','unlink', + 'unixtojd','uniqid','umask','uksort','ucwords','ucfirst', + 'uasort','trim','trigger_error','touch','token_name','token_get_all', + 'tmpfile','time','textdomain','tempnam','tanh','tan', + 'system','syslog','symlink','substr_replace','substr_count','substr', + 'strval','strtr','strtoupper','strtotime','strtolower','strtok', + 'strstr','strspn','strrpos','strrev','strrchr','strpos', + 'strncmp','strncasecmp','strnatcmp','strnatcasecmp','strlen','stristr', + 'stripslashes','stripcslashes','strip_tags','strftime','stream_wrapper_register','stream_set_write_buffer', + 'stream_set_timeout','stream_set_blocking','stream_select','stream_register_wrapper','stream_get_meta_data','stream_filter_prepend', + 'stream_filter_append','stream_context_set_params','stream_context_set_option','stream_context_get_options','stream_context_create','strcspn', + 'strcoll','strcmp','strchr','strcasecmp','str_word_count','str_shuffle', + 'str_rot13','str_replace','str_repeat','str_pad','stat','sscanf', + 'srand','sqrt','sql_regcase','sprintf','spliti','split', + 'soundex','sort','socket_writev','socket_write','socket_strerror','socket_shutdown', + 'socket_setopt','socket_set_timeout','socket_set_option','socket_set_nonblock','socket_set_blocking','socket_set_block', + 'socket_sendto','socket_sendmsg','socket_send','socket_select','socket_recvmsg','socket_recvfrom', + 'socket_recv','socket_readv','socket_read','socket_listen','socket_last_error','socket_iovec_set', + 'socket_iovec_free','socket_iovec_fetch','socket_iovec_delete','socket_iovec_alloc','socket_iovec_add','socket_getsockname', + 'socket_getpeername','socket_getopt','socket_get_status','socket_get_option','socket_create_pair','socket_create_listen', + 'socket_create','socket_connect','socket_close','socket_clear_error','socket_bind','socket_accept', + 'sleep','sizeof','sinh','sin','similar_text','shuffle', + 'show_source','shmop_write','shmop_size','shmop_read','shmop_open','shmop_delete', + 'shmop_close','shm_remove_var','shm_remove','shm_put_var','shm_get_var','shm_detach', + 'shm_attach','shell_exec','sha1_file','sha1','settype','setlocale', + 'setcookie','set_time_limit','set_socket_blocking','set_magic_quotes_runtime','set_include_path','set_file_buffer', + 'set_error_handler','session_write_close','session_unset','session_unregister','session_start','session_set_save_handler', + 'session_set_cookie_params','session_save_path','session_register','session_regenerate_id','session_name','session_module_name', + 'session_is_registered','session_id','session_get_cookie_params','session_encode','session_destroy','session_decode', + 'session_cache_limiter','session_cache_expire','serialize','sem_remove','sem_release','sem_get', + 'sem_acquire','rtrim','rsort','round','rmdir','rewinddir', + 'rewind','restore_include_path','restore_error_handler','reset','rename','register_tick_function', + 'register_shutdown_function','realpath','readlink','readgzfile','readfile','readdir', + 'read_exif_data','rawurlencode','rawurldecode','range','rand','rad2deg', + 'quotemeta','quoted_printable_decode','putenv','proc_open','proc_close','printf', + 'print_r','prev','preg_split','preg_replace_callback','preg_replace','preg_quote', + 'preg_match_all','preg_match','preg_grep','pow','posix_uname','posix_ttyname', + 'posix_times','posix_strerror','posix_setuid','posix_setsid','posix_setpgid','posix_setgid', + 'posix_seteuid','posix_setegid','posix_mkfifo','posix_kill','posix_isatty','posix_getuid', + 'posix_getsid','posix_getrlimit','posix_getpwuid','posix_getpwnam','posix_getppid','posix_getpid', + 'posix_getpgrp','posix_getpgid','posix_getlogin','posix_getgroups','posix_getgrnam','posix_getgrgid', + 'posix_getgid','posix_geteuid','posix_getegid','posix_getcwd','posix_get_last_error','posix_errno', + 'posix_ctermid','pos','popen','pi','phpversion','phpinfo', + 'phpcredits','php_uname','php_sapi_name','php_logo_guid','php_ini_scanned_files','pg_update', + 'pg_untrace','pg_unescape_bytea','pg_tty','pg_trace','pg_setclientencoding','pg_set_client_encoding', + 'pg_send_query','pg_select','pg_result_status','pg_result_seek','pg_result_error','pg_result', + 'pg_query','pg_put_line','pg_port','pg_ping','pg_pconnect','pg_options', + 'pg_numrows','pg_numfields','pg_num_rows','pg_num_fields','pg_meta_data','pg_lowrite', + 'pg_lounlink','pg_loreadall','pg_loread','pg_loopen','pg_loimport','pg_loexport', + 'pg_locreate','pg_loclose','pg_lo_write','pg_lo_unlink','pg_lo_tell','pg_lo_seek', + 'pg_lo_read_all','pg_lo_read','pg_lo_open','pg_lo_import','pg_lo_export','pg_lo_create', + 'pg_lo_close','pg_last_oid','pg_last_notice','pg_last_error','pg_insert','pg_host', + 'pg_getlastoid','pg_get_result','pg_get_pid','pg_get_notify','pg_freeresult','pg_free_result', + 'pg_fieldtype','pg_fieldsize','pg_fieldprtlen','pg_fieldnum','pg_fieldname','pg_fieldisnull', + 'pg_field_type','pg_field_size','pg_field_prtlen','pg_field_num','pg_field_name','pg_field_is_null', + 'pg_fetch_row','pg_fetch_result','pg_fetch_object','pg_fetch_assoc','pg_fetch_array','pg_fetch_all', + 'pg_exec','pg_escape_string','pg_escape_bytea','pg_errormessage','pg_end_copy','pg_delete', + 'pg_dbname','pg_copy_to','pg_copy_from','pg_convert','pg_connection_status','pg_connection_reset', + 'pg_connection_busy','pg_connect','pg_cmdtuples','pg_close','pg_clientencoding','pg_client_encoding', + 'pg_cancel_query','pg_affected_rows','pfsockopen','pclose','pathinfo','passthru', + 'parse_url','parse_str','parse_ini_file','pack','overload','output_reset_rewrite_vars', + 'output_add_rewrite_var','ord','openssl_x509_read','openssl_x509_parse','openssl_x509_free','openssl_x509_export_to_file', + 'openssl_x509_export','openssl_x509_checkpurpose','openssl_x509_check_private_key','openssl_verify','openssl_sign','openssl_seal', + 'openssl_public_encrypt','openssl_public_decrypt','openssl_private_encrypt','openssl_private_decrypt','openssl_pkey_new','openssl_pkey_get_public', + 'openssl_pkey_get_private','openssl_pkey_free','openssl_pkey_export_to_file','openssl_pkey_export','openssl_pkcs7_verify','openssl_pkcs7_sign', + 'openssl_pkcs7_encrypt','openssl_pkcs7_decrypt','openssl_open','openssl_get_publickey','openssl_get_privatekey','openssl_free_key', + 'openssl_error_string','openssl_csr_sign','openssl_csr_new','openssl_csr_export_to_file','openssl_csr_export','openlog', + 'opendir','octdec','ob_start','ob_list_handlers','ob_implicit_flush','ob_iconv_handler', + 'ob_gzhandler','ob_get_status','ob_get_level','ob_get_length','ob_get_flush','ob_get_contents', + 'ob_get_clean','ob_flush','ob_end_flush','ob_end_clean','ob_clean','number_format', + 'nl_langinfo','nl2br','ngettext','next','natsort','natcasesort', + 'mysql_unbuffered_query','mysql_thread_id','mysql_tablename','mysql_table_name','mysql_stat','mysql_selectdb', + 'mysql_select_db','mysql_result','mysql_real_escape_string','mysql_query','mysql_ping','mysql_pconnect', + 'mysql_numrows','mysql_numfields','mysql_num_rows','mysql_num_fields','mysql_listtables','mysql_listfields', + 'mysql_listdbs','mysql_list_tables','mysql_list_processes','mysql_list_fields','mysql_list_dbs','mysql_insert_id', + 'mysql_info','mysql_get_server_info','mysql_get_proto_info','mysql_get_host_info','mysql_get_client_info','mysql_freeresult', + 'mysql_free_result','mysql_fieldtype','mysql_fieldtable','mysql_fieldname','mysql_fieldlen','mysql_fieldflags', + 'mysql_field_type','mysql_field_table','mysql_field_seek','mysql_field_name','mysql_field_len','mysql_field_flags', + 'mysql_fetch_row','mysql_fetch_object','mysql_fetch_lengths','mysql_fetch_field','mysql_fetch_assoc','mysql_fetch_array', + 'mysql_escape_string','mysql_error','mysql_errno','mysql_dropdb','mysql_drop_db','mysql_dbname', + 'mysql_db_query','mysql_db_name','mysql_data_seek','mysql_createdb','mysql_create_db','mysql_connect', + 'mysql_close','mysql_client_encoding','mysql_affected_rows','mysql','mt_srand','mt_rand', + 'mt_getrandmax','move_uploaded_file','money_format','mktime','mkdir','min', + 'microtime','method_exists','metaphone','memory_get_usage','md5_file','md5', + 'mbsubstr','mbstrrpos','mbstrpos','mbstrlen','mbstrcut','mbsplit', + 'mbregex_encoding','mberegi_replace','mberegi','mbereg_search_setpos','mbereg_search_regs','mbereg_search_pos', + 'mbereg_search_init','mbereg_search_getregs','mbereg_search_getpos','mbereg_search','mbereg_replace','mbereg_match', + 'mbereg','mb_substr_count','mb_substr','mb_substitute_character','mb_strwidth','mb_strtoupper', + 'mb_strtolower','mb_strrpos','mb_strpos','mb_strlen','mb_strimwidth','mb_strcut', + 'mb_split','mb_send_mail','mb_regex_set_options','mb_regex_encoding','mb_preferred_mime_name','mb_parse_str', + 'mb_output_handler','mb_language','mb_internal_encoding','mb_http_output','mb_http_input','mb_get_info', + 'mb_eregi_replace','mb_eregi','mb_ereg_search_setpos','mb_ereg_search_regs','mb_ereg_search_pos','mb_ereg_search_init', + 'mb_ereg_search_getregs','mb_ereg_search_getpos','mb_ereg_search','mb_ereg_replace','mb_ereg_match','mb_ereg', + 'mb_encode_numericentity','mb_encode_mimeheader','mb_detect_order','mb_detect_encoding','mb_decode_numericentity','mb_decode_mimeheader', + 'mb_convert_variables','mb_convert_kana','mb_convert_encoding','mb_convert_case','max','mail', + 'magic_quotes_runtime','ltrim','lstat','long2ip','log1p','log10', + 'log','localtime','localeconv','linkinfo','link','levenshtein', + 'lcg_value','ksort','krsort','key_exists','key','juliantojd', + 'join','jewishtojd','jdtounix','jdtojulian','jdtojewish','jdtogregorian', + 'jdtofrench','jdmonthname','jddayofweek','is_writeable','is_writable','is_uploaded_file', + 'is_subclass_of','is_string','is_scalar','is_resource','is_real','is_readable', + 'is_object','is_numeric','is_null','is_nan','is_long','is_link', + 'is_integer','is_int','is_infinite','is_float','is_finite','is_file', + 'is_executable','is_double','is_dir','is_callable','is_bool','is_array', + 'is_a','iptcparse','iptcembed','ip2long','intval','ini_set', + 'ini_restore','ini_get_all','ini_get','ini_alter','in_array','import_request_variables', + 'implode','image_type_to_mime_type','ignore_user_abort','iconv_set_encoding','iconv_get_encoding','iconv', + 'i18n_mime_header_encode','i18n_mime_header_decode','i18n_ja_jp_hantozen','i18n_internal_encoding','i18n_http_output','i18n_http_input', + 'i18n_discover_encoding','i18n_convert','hypot','htmlspecialchars','htmlentities','html_entity_decode', + 'highlight_string','highlight_file','hexdec','hebrevc','hebrev','headers_sent', + 'header','gzwrite','gzuncompress','gztell','gzseek','gzrewind', + 'gzread','gzputs','gzpassthru','gzopen','gzinflate','gzgetss', + 'gzgets','gzgetc','gzfile','gzeof','gzencode','gzdeflate', + 'gzcompress','gzclose','gregoriantojd','gmstrftime','gmmktime','gmdate', + 'glob','gettype','gettimeofday','gettext','getservbyport','getservbyname', + 'getrusage','getrandmax','getprotobynumber','getprotobyname','getopt','getmyuid', + 'getmypid','getmyinode','getmygid','getmxrr','getlastmod','getimagesize', + 'gethostbynamel','gethostbyname','gethostbyaddr','getenv','getdate','getcwd', + 'getallheaders','get_resource_type','get_required_files','get_parent_class','get_object_vars','get_meta_tags', + 'get_magic_quotes_runtime','get_magic_quotes_gpc','get_loaded_extensions','get_included_files','get_include_path','get_html_translation_table', + 'get_extension_funcs','get_defined_vars','get_defined_functions','get_defined_constants','get_declared_classes','get_current_user', + 'get_class_vars','get_class_methods','get_class','get_cfg_var','get_browser','fwrite', + 'function_exists','func_num_args','func_get_args','func_get_arg','ftruncate','ftp_systype', + 'ftp_ssl_connect','ftp_size','ftp_site','ftp_set_option','ftp_rmdir','ftp_rename', + 'ftp_rawlist','ftp_quit','ftp_pwd','ftp_put','ftp_pasv','ftp_nlist', + 'ftp_nb_put','ftp_nb_get','ftp_nb_fput','ftp_nb_fget','ftp_nb_continue','ftp_mkdir', + 'ftp_mdtm','ftp_login','ftp_get_option','ftp_get','ftp_fput','ftp_fget', + 'ftp_exec','ftp_delete','ftp_connect','ftp_close','ftp_chdir','ftp_cdup', + 'ftok','ftell','fstat','fsockopen','fseek','fscanf', + 'frenchtojd','fread','fputs','fpassthru','fopen','fnmatch', + 'fmod','flush','floor','flock','floatval','filetype', + 'filesize','filepro_rowcount','filepro_retrieve','filepro_fieldwidth','filepro_fieldtype','filepro_fieldname', + 'filepro_fieldcount','filepro','fileperms','fileowner','filemtime','fileinode', + 'filegroup','filectime','fileatime','file_get_contents','file_exists','file', + 'fgetss','fgets','fgetcsv','fgetc','fflush','feof', + 'fclose','ezmlm_hash','extract','extension_loaded','expm1','explode', + 'exp','exif_thumbnail','exif_tagname','exif_read_data','exif_imagetype','exec', + 'escapeshellcmd','escapeshellarg','error_reporting','error_log','eregi_replace','eregi', + 'ereg_replace','ereg','end','easter_days','easter_date','each', + 'doubleval','dngettext','dl','diskfreespace','disk_total_space','disk_free_space', + 'dirname','dir','dgettext','deg2rad','defined','define_syslog_variables', + 'define','decoct','dechex','decbin','debug_zval_dump','debug_backtrace', + 'deaggregate','dcngettext','dcgettext','dba_sync','dba_replace','dba_popen', + 'dba_optimize','dba_open','dba_nextkey','dba_list','dba_insert','dba_handlers', + 'dba_firstkey','dba_fetch','dba_exists','dba_delete','dba_close','date', + 'current','ctype_xdigit','ctype_upper','ctype_space','ctype_punct','ctype_print', + 'ctype_lower','ctype_graph','ctype_digit','ctype_cntrl','ctype_alpha','ctype_alnum', + 'crypt','create_function','crc32','count_chars','count','cosh', + 'cos','copy','convert_cyr_string','constant','connection_status','connection_aborted', + 'compact','closelog','closedir','clearstatcache','class_exists','chunk_split', + 'chr','chown','chop','chmod','chgrp','checkdnsrr', + 'checkdate','chdir','ceil','call_user_method_array','call_user_method','call_user_func_array', + 'call_user_func','cal_to_jd','cal_info','cal_from_jd','cal_days_in_month','bzwrite', + 'bzread','bzopen','bzflush','bzerrstr','bzerror','bzerrno', + 'bzdecompress','bzcompress','bzclose','bindtextdomain','bindec','bind_textdomain_codeset', + 'bin2hex','bcsub','bcsqrt','bcscale','bcpow','bcmul', + 'bcmod','bcdiv','bccomp','bcadd','basename','base_convert', + 'base64_encode','base64_decode','atanh','atan2','atan','assert_options', + 'assert','asort','asinh','asin','arsort','array_walk', + 'array_values','array_unshift','array_unique','array_sum','array_splice','array_slice', + 'array_shift','array_search','array_reverse','array_reduce','array_rand','array_push', + 'array_pop','array_pad','array_multisort','array_merge_recursive','array_merge','array_map', + 'array_keys','array_key_exists','array_intersect_assoc','array_intersect','array_flip','array_filter', + 'array_fill','array_diff_assoc','array_diff','array_count_values','array_chunk','array_change_key_case', + 'apache_setenv','apache_response_headers','apache_request_headers','apache_note','apache_lookup_uri','apache_get_version', + 'apache_child_terminate','aggregation_info','aggregate_properties_by_regexp','aggregate_properties_by_list','aggregate_properties','aggregate_methods_by_regexp', + 'aggregate_methods_by_list','aggregate_methods','aggregate','addslashes','addcslashes','acosh', + 'acos','abs','_','echo', 'print', 'global', 'static', 'exit', 'array', 'empty', + 'eval', 'isset', 'unset', 'die', 'list' + ), + 5 => array( + 'actions_do', 'actions_list', 'actions_get_all_actions', 'actions_actions_map', 'actions_function_lookup', + 'actions_synchronize', 'actions_save', 'actions_load', 'actions_delete', '_batch_page', + '_batch_start', '_batch_progress_page_js', '_batch_do', '_batch_progress_page_nojs', + '_batch_process', '_batch_next_set', '_batch_finished', '_batch_shutdown', 'timer_start', + 'timer_read', 'timer_stop', 'conf_path', 'drupal_unset_globals', 'conf_init', 'drupal_get_filename', + 'variable_init', 'variable_get', 'variable_set', 'variable_del', 'page_get_cache', + 'bootstrap_invoke_all', 'drupal_load', 'drupal_page_header', 'drupal_page_cache_header', + 'bootstrap_hooks', 'drupal_unpack', 'referer_uri', 'check_plain', 'request_uri', 'watchdog', + 'drupal_set_message', 'drupal_get_messages', 'drupal_is_denied', 'drupal_anonymous_user', + 'drupal_bootstrap', '_drupal_bootstrap', 'drupal_maintenance_theme', 'get_t', 'drupal_init_language', + 'language_list', 'language_default', 'ip_address', 'cache_get', 'cache_set', 'cache_clear_all', + 'drupal_set_content', 'drupal_get_content', 'drupal_set_breadcrumb', 'drupal_get_breadcrumb', + 'drupal_set_html_head', 'drupal_get_html_head', 'drupal_clear_path_cache', 'drupal_set_header', + 'drupal_get_headers', 'drupal_add_feed', 'drupal_get_feeds', 'drupal_query_string_encode', + 'drupal_get_destination', 'drupal_goto', 'drupal_site_offline', 'drupal_not_found', + 'drupal_access_denied', 'drupal_http_request', 'drupal_error_handler', '_fix_gpc_magic', + '_fix_gpc_magic_files', 'fix_gpc_magic', 't', 'valid_email_address', 'valid_url', + 'flood_register_event', 'flood_is_allowed', 'check_file', 'check_url', 'format_rss_channel', + 'format_rss_item', 'format_xml_elements', 'format_plural', 'parse_size', 'format_size', + 'format_interval', 'format_date', 'url', 'drupal_attributes', 'l', 'drupal_page_footer', + 'drupal_map_assoc', 'drupal_eval', 'drupal_get_path', 'base_path', 'drupal_clone', + 'drupal_add_link', 'drupal_add_css', 'drupal_get_css', 'drupal_build_css_cache', '_drupal_build_css_path', + 'drupal_load_stylesheet', '_drupal_load_stylesheet', 'drupal_clear_css_cache', 'drupal_add_js', + 'drupal_get_js', 'drupal_add_tabledrag', 'drupal_build_js_cache', '_drupal_compress_js', + '_packer_apply', '_packer_escape_char', '_packer_replacement', '_packer_unescape_char', + '_packer_backreferences', 'drupal_clear_js_cache', 'drupal_to_js', 'drupal_json', + 'drupal_urlencode', 'drupal_get_private_key', 'drupal_get_token', 'drupal_valid_token', + 'xmlrpc', '_drupal_bootstrap_full', 'page_set_cache', 'drupal_cron_run', 'drupal_cron_cleanup', + 'drupal_system_listing', 'drupal_alter', 'drupal_render', 'element_sort', 'element_property', + 'element_properties', 'element_child', 'element_children', 'drupal_common_theme', + 'drupal_get_schema', 'drupal_install_schema', 'drupal_uninstall_schema', 'drupal_get_schema_unprocessed', + '_drupal_initialize_schema', 'drupal_schema_fields_sql', 'drupal_write_record', 'drupal_parse_info_file', + 'watchdog_severity_levels', 'drupal_explode_tags', 'drupal_implode_tags', 'drupal_flush_all_caches', + 'update_sql', 'db_prefix_tables', 'db_set_active', 'db_is_active', '_db_query_callback', + 'db_placeholders', '_db_rewrite_sql', 'db_rewrite_sql', 'db_escape_table', 'db_create_table', + 'db_field_names', 'db_type_placeholder', 'db_query', 'db_create_table_sql', '_db_create_keys_sql', + '_db_create_key_sql', '_db_process_field', '_db_create_field_sql', 'db_type_map', + 'db_rename_table', 'db_drop_table', 'db_add_field', 'db_drop_field', 'db_field_set_default', + 'db_field_set_no_default', 'db_add_primary_key', 'db_drop_primary_key', 'db_add_unique_key', + 'db_drop_unique_key', 'db_add_index', 'db_drop_index', 'db_change_field', 'db_last_insert_id', + 'db_status_report', 'db_version', 'db_connect', '_db_query', 'db_fetch_object', 'db_fetch_array', + 'db_result', 'db_error', 'db_affected_rows', 'db_query_range', 'db_query_temporary', + 'db_encode_blob', 'db_decode_blob', 'db_escape_string', 'db_lock_table', 'db_unlock_tables', + 'db_table_exists', 'db_column_exists', 'db_distinct_field', 'db_check_setup', '_db_create_index_sql', + '_db_create_keys', 'file_create_url', 'file_create_path', 'file_check_directory', + 'file_check_path', 'file_check_location', 'file_copy', 'file_destination', 'file_move', + 'file_munge_filename', 'file_unmunge_filename', 'file_create_filename', 'file_delete', + 'file_space_used', 'file_save_upload', 'file_validate_name_length', 'file_validate_extensions', + 'file_validate_size', 'file_validate_is_image', 'file_validate_image_resolution', + 'file_save_data', 'file_set_status', 'file_transfer', 'file_download', 'file_scan_directory', + 'file_directory_temp', 'file_directory_path', 'file_upload_max_size', 'drupal_get_form', + 'drupal_rebuild_form', 'form_get_cache', 'form_set_cache', 'drupal_execute', 'drupal_retrieve_form', + 'drupal_process_form', 'drupal_prepare_form', 'drupal_validate_form', 'drupal_render_form', + 'drupal_redirect_form', '_form_validate', 'form_execute_handlers', 'form_set_error', + 'form_get_errors', 'form_get_error', 'form_error', 'form_builder', '_form_builder_handle_input_element', + '_form_button_was_clicked', '_form_builder_ie_cleanup', 'form_type_image_button_value', + 'form_type_checkbox_value', 'form_type_checkboxes_value', 'form_type_password_confirm_value', + 'form_type_select_value', 'form_type_textfield_value', 'form_type_token_value', 'form_set_value', + '_form_set_value', '_element_info', 'form_options_flatten', 'theme_select', 'form_select_options', + 'form_get_options', 'theme_fieldset', 'theme_radio', 'theme_radios', 'theme_password_confirm', + 'expand_password_confirm', 'password_confirm_validate', 'theme_date', 'expand_date', + 'date_validate', 'map_month', 'weight_value', 'expand_radios', 'form_expand_ahah', + 'theme_item', 'theme_checkbox', 'theme_checkboxes', 'expand_checkboxes', 'theme_submit', + 'theme_button', 'theme_image_button', 'theme_hidden', 'theme_token', 'theme_textfield', + 'theme_form', 'theme_textarea', 'theme_markup', 'theme_password', 'process_weight', + 'theme_file', 'theme_form_element', '_form_set_class', 'form_clean_id', 'batch_set', + 'batch_process', 'image_gd_info', 'image_gd_settings', 'image_gd_check_settings', + 'image_gd_resize', 'image_gd_rotate', 'image_gd_crop', 'image_gd_open', 'image_gd_close', + 'image_get_available_toolkits', 'image_get_toolkit', 'image_toolkit_invoke', 'image_get_info', + 'image_scale_and_crop', 'image_scale', 'image_resize', 'image_rotate', 'image_crop', + 'drupal_load_updates', 'drupal_get_schema_versions', 'drupal_get_installed_schema_version', + 'drupal_set_installed_schema_version', 'drupal_install_profile_name', 'drupal_detect_baseurl', + 'drupal_detect_database_types', 'drupal_rewrite_settings', 'drupal_get_install_files', + 'drupal_verify_profile', 'drupal_install_modules', '_drupal_install_module', 'drupal_install_system', + 'drupal_uninstall_module', 'drupal_verify_install_file', 'drupal_install_mkdir', 'drupal_install_fix_file', + 'install_goto', 'st', '_system_update_utf8', 'drupal_check_profile', 'drupal_requirements_severity', + 'drupal_check_module', 'mysql_is_available', 'drupal_test_mysql', 'mysqli_is_available', + 'drupal_test_mysqli', 'pgsql_is_available', 'drupal_test_pgsql', 'language_initialize', + 'language_from_browser', 'language_url_rewrite', 'locale_languages_overview_form', + 'theme_locale_languages_overview_form', 'locale_languages_overview_form_submit', 'locale_languages_add_screen', + 'locale_languages_predefined_form', 'locale_languages_custom_form', 'locale_languages_edit_form', + '_locale_languages_common_controls', 'locale_languages_predefined_form_validate', + 'locale_languages_predefined_form_submit', 'locale_languages_edit_form_validate', + 'locale_languages_edit_form_submit', 'locale_languages_delete_form', 'locale_languages_delete_form_submit', + 'locale_languages_configure_form', 'locale_languages_configure_form_submit', 'locale_translate_overview_screen', + 'locale_translate_seek_screen', 'locale_translate_seek_form', 'locale_translate_import_form', + 'locale_translate_import_form_submit', 'locale_translate_export_screen', 'locale_translate_export_po_form', + 'locale_translate_export_pot_form', 'locale_translate_export_po_form_submit', 'locale_translate_edit_form', + 'locale_translate_edit_form_submit', 'locale_translate_delete', 'locale_add_language', + '_locale_import_po', '_locale_import_read_po', '_locale_import_message', '_locale_import_one_string', + '_locale_import_one_string_db', '_locale_import_parse_header', '_locale_import_parse_plural_forms', + '_locale_import_parse_arithmetic', '_locale_import_tokenize_formula', '_locale_import_append_plural', + '_locale_import_shorten_comments', '_locale_import_parse_quoted', '_locale_parse_js_file', + '_locale_export_get_strings', '_locale_export_po_generate', '_locale_export_po', '_locale_export_string', + '_locale_export_wrap', '_locale_export_remove_plural', '_locale_translate_seek', '_locale_translate_seek_query', + '_locale_invalidate_js', '_locale_rebuild_js', '_locale_translate_language_list', + '_locale_prepare_predefined_list', '_locale_get_predefined_list', 'locale_batch_by_language', + 'locale_batch_by_component', '_locale_batch_build', '_locale_batch_import', '_locale_batch_system_finished', + '_locale_batch_language_finished', 'drupal_mail', 'drupal_mail_send', 'drupal_wrap_mail', + 'drupal_html_to_text', '_drupal_wrap_mail_line', '_drupal_html_to_mail_urls', '_drupal_html_to_text_clean', + '_drupal_html_to_text_pad', 'menu_get_ancestors', 'menu_unserialize', 'menu_set_item', + 'menu_get_item', 'menu_execute_active_handler', '_menu_load_objects', '_menu_check_access', + '_menu_item_localize', '_menu_translate', '_menu_link_map_translate', 'menu_tail_to_arg', + '_menu_link_translate', 'menu_tree', 'menu_tree_output', 'menu_tree_all_data', 'menu_tree_page_data', + 'menu_tree_collect_node_links', 'menu_tree_check_access', '_menu_tree_check_access', + 'menu_tree_data', '_menu_tree_data', 'theme_menu_item_link', 'theme_menu_tree', 'theme_menu_item', + 'theme_menu_local_task', 'drupal_help_arg', 'menu_get_active_help', 'menu_get_names', + 'menu_list_system_menus', 'menu_primary_links', 'menu_secondary_links', 'menu_navigation_links', + 'menu_local_tasks', 'menu_primary_local_tasks', 'menu_secondary_local_tasks', 'menu_tab_root_path', + 'theme_menu_local_tasks', 'menu_set_active_menu_name', 'menu_get_active_menu_name', + 'menu_set_active_item', 'menu_set_active_trail', 'menu_get_active_trail', 'menu_get_active_breadcrumb', + 'menu_get_active_title', 'menu_link_load', 'menu_cache_clear', 'menu_cache_clear_all', + 'menu_rebuild', 'menu_router_build', '_menu_link_build', '_menu_navigation_links_rebuild', + 'menu_link_delete', '_menu_delete_item', 'menu_link_save', '_menu_clear_page_cache', + '_menu_set_expanded_menus', '_menu_find_router_path', 'menu_link_maintain', 'menu_link_children_relative_depth', + '_menu_link_move_children', '_menu_update_parental_status', '_menu_link_parents_set', + '_menu_router_build', 'menu_path_is_external', '_menu_site_is_offline', 'module_load_all', + 'module_iterate', 'module_list', 'module_rebuild_cache', '_module_build_dependents', + 'module_exists', 'module_load_install', 'module_load_include', 'module_load_all_includes', + 'module_enable', 'module_disable', 'module_hook', 'module_implements', 'module_invoke', + 'module_invoke_all', 'drupal_required_modules', 'pager_query', 'pager_get_querystring', + 'theme_pager', 'theme_pager_first', 'theme_pager_previous', 'theme_pager_next', 'theme_pager_last', + 'theme_pager_link', 'pager_load_array', 'drupal_init_path', 'drupal_lookup_path', + 'drupal_get_path_alias', 'drupal_get_normal_path', 'arg', 'drupal_get_title', 'drupal_set_title', + 'drupal_is_front_page', 'drupal_match_path', 'sess_open', 'sess_close', 'sess_read', + 'sess_write', 'sess_regenerate', 'sess_count', 'sess_destroy_sid', 'sess_destroy_uid', + 'sess_gc', 'session_save_session', 'tablesort_init', 'tablesort_sql', 'tablesort_header', + 'tablesort_cell', 'tablesort_get_querystring', 'tablesort_get_order', 'tablesort_get_sort', + 'init_theme', '_init_theme', 'theme_get_registry', '_theme_set_registry', '_theme_load_registry', + '_theme_save_registry', 'drupal_rebuild_theme_registry', '_theme_process_registry', + '_theme_build_registry', 'list_themes', 'theme', 'drupal_discover_template', 'path_to_theme', + 'drupal_find_theme_functions', 'drupal_find_theme_templates', 'theme_get_settings', + 'theme_get_setting', 'theme_render_template', 'theme_placeholder', 'theme_status_messages', + 'theme_links', 'theme_image', 'theme_breadcrumb', 'theme_help', 'theme_submenu', 'theme_table', + 'theme_table_select_header_cell', 'theme_tablesort_indicator', 'theme_box', 'theme_mark', + 'theme_item_list', 'theme_more_help_link', 'theme_xml_icon', 'theme_feed_icon', 'theme_more_link', + 'theme_closure', 'theme_blocks', 'theme_username', 'theme_progress_bar', 'theme_indentation', + '_theme_table_cell', 'template_preprocess', 'template_preprocess_page', 'template_preprocess_node', + 'template_preprocess_block', 'unicode_check', '_unicode_check', 'unicode_requirements', + 'drupal_xml_parser_create', 'drupal_convert_to_utf8', 'truncate_utf8', 'mime_header_encode', + 'mime_header_decode', '_mime_header_decode', 'decode_entities', '_decode_entities', + 'drupal_strlen', 'drupal_strtoupper', 'drupal_strtolower', '_unicode_caseflip', 'drupal_ucfirst', + 'drupal_substr', 'xmlrpc_value', 'xmlrpc_value_calculate_type', 'xmlrpc_value_get_xml', + 'xmlrpc_message', 'xmlrpc_message_parse', 'xmlrpc_message_set', 'xmlrpc_message_get', + 'xmlrpc_message_tag_open', 'xmlrpc_message_cdata', 'xmlrpc_message_tag_close', 'xmlrpc_request', + 'xmlrpc_error', 'xmlrpc_error_get_xml', 'xmlrpc_date', 'xmlrpc_date_get_xml', 'xmlrpc_base64', + 'xmlrpc_base64_get_xml', '_xmlrpc', 'xmlrpc_errno', 'xmlrpc_error_msg', 'xmlrpc_server', + 'xmlrpc_server_error', 'xmlrpc_server_output', 'xmlrpc_server_set', 'xmlrpc_server_get', + 'xmlrpc_server_call', 'xmlrpc_server_multicall', 'xmlrpc_server_list_methods', 'xmlrpc_server_get_capabilities', + 'xmlrpc_server_method_signature', 'xmlrpc_server_method_help', '_drupal_maintenance_theme', + '_theme_load_offline_registry', 'theme_task_list', 'theme_install_page', 'theme_update_page', + 'template_preprocess_maintenance_page', 'aggregator_admin_overview', 'aggregator_view', + 'aggregator_form_feed', 'aggregator_form_feed_validate', 'aggregator_form_feed_submit', + 'aggregator_admin_remove_feed', 'aggregator_admin_refresh_feed', 'aggregator_admin_settings', + 'aggregator_form_category', 'aggregator_form_category_validate', 'aggregator_form_category_submit', + 'aggregator_help', 'aggregator_theme', 'aggregator_menu', '_aggregator_category_title', + 'aggregator_init', '_aggregator_has_categories', 'aggregator_perm', 'aggregator_cron', + 'aggregator_block', 'aggregator_save_category', 'aggregator_save_feed', 'aggregator_remove', + 'aggregator_element_start', 'aggregator_element_end', 'aggregator_element_data', 'aggregator_refresh', + 'aggregator_parse_w3cdtf', 'aggregator_parse_feed', 'aggregator_save_item', 'aggregator_feed_load', + 'aggregator_category_load', 'theme_aggregator_block_item', 'aggregator_filter_xss', + '_aggregator_items', 'aggregator_page_last', 'aggregator_page_source', 'aggregator_page_category', + 'aggregator_feed_items_load', '_aggregator_page_list', 'aggregator_categorize_items', + 'aggregator_categorize_items_validate', 'aggregator_categorize_items_submit', 'theme_aggregator_categorize_items', + 'template_preprocess_aggregator_wrapper', 'template_preprocess_aggregator_item', 'aggregator_page_sources', + 'aggregator_page_categories', 'aggregator_page_rss', 'theme_aggregator_page_rss', + 'aggregator_page_opml', 'theme_aggregator_page_opml', 'template_preprocess_aggregator_summary_items', + 'template_preprocess_aggregator_summary_item', 'template_preprocess_aggregator_feed_source', + 'block_admin_display', 'block_admin_display_form', 'block_admin_display_form_submit', + '_block_compare', 'block_admin_configure', 'block_admin_configure_validate', 'block_admin_configure_submit', + 'block_add_block_form', 'block_add_block_form_validate', 'block_add_block_form_submit', + 'block_box_delete', 'block_box_delete_submit', 'template_preprocess_block_admin_display_form', + 'block_help', 'block_theme', 'block_perm', 'block_menu', 'block_block', '_block_rehash', + 'block_box_get', 'block_box_form', 'block_box_save', 'block_user', 'block_list', '_block_get_cache_id', + 'blog_node_info', 'blog_perm', 'blog_access', 'blog_user', 'blog_help', 'blog_form', + 'blog_view', 'blog_link', 'blog_menu', 'blog_block', 'blog_page_user', 'blog_page_last', + 'blog_feed_user', 'blog_feed_last', 'blogapi_help', 'blogapi_xmlrpc', 'blogapi_blogger_get_users_blogs', + 'blogapi_blogger_get_user_info', 'blogapi_blogger_new_post', 'blogapi_blogger_edit_post', + 'blogapi_blogger_get_post', 'blogapi_blogger_delete_post', 'blogapi_blogger_get_recent_posts', + 'blogapi_metaweblog_new_post', 'blogapi_metaweblog_edit_post', 'blogapi_metaweblog_get_post', + 'blogapi_metaweblog_new_media_object', 'blogapi_metaweblog_get_category_list', 'blogapi_metaweblog_get_recent_posts', + 'blogapi_mt_get_recent_post_titles', 'blogapi_mt_get_category_list', 'blogapi_mt_get_post_categories', + 'blogapi_mt_set_post_categories', 'blogapi_mt_supported_text_filters', 'blogap_mti_publish_post', + 'blogapi_error', 'blogapi_validate_user', 'blogapi_blogger_title', 'blogapi_admin_settings', + 'blogapi_menu', 'blogapi_init', 'blogapi_rsd', '_blogapi_mt_extra', '_blogapi_get_post', + '_blogapi_blogid', '_blogapi_get_node_types', 'book_admin_overview', 'book_admin_settings', + 'book_admin_settings_validate', 'book_admin_edit', 'book_admin_edit_submit', '_book_admin_table', + '_book_admin_table_tree', 'theme_book_admin_table', '_book_admin_sort_tree', '_book_admin_compare', + 'book_theme', 'book_perm', 'book_link', 'book_menu', '_book_outline_access', '_book_outline_remove_access', + 'book_init', 'book_block', 'theme_book_title_link', 'book_get_books', 'book_form_alter', + '_book_parent_select', '_book_add_form_elements', '_book_update_outline', 'book_update_bid', + 'book_get_flat_menu', '_book_flatten_menu', 'book_prev', 'book_next', 'book_children', + 'book_menu_name', 'book_build_active_trail', 'book_nodeapi', '_book_parent_depth_limit', + 'book_form_node_delete_confirm_alter', '_book_link_defaults', 'template_preprocess_book_navigation', + '_book_toc_recurse', 'book_toc', 'template_preprocess_book_export_html', 'book_export_traverse', + 'book_node_export', 'template_preprocess_book_node_export_html', 'book_type_is_allowed', + 'book_node_type', 'book_help', 'book_link_load', 'book_menu_subtree_data', 'book_render', + 'book_export', 'book_export_html', 'book_outline', 'book_outline_form', 'book_remove_button_submit', + 'book_outline_form_submit', 'book_remove_form', 'book_remove_form_submit', 'book_form_update', + 'color_help', 'color_theme', 'color_form_alter', '_color_page_alter', 'color_get_info', + 'color_get_palette', 'color_scheme_form', 'theme_color_scheme_form', 'color_scheme_form_submit', + '_color_rewrite_stylesheet', '_color_import_stylesheet', '_color_render_images', '_color_shift', + '_color_gd', '_color_blend', '_color_unpack', '_color_pack', '_color_hsl2rgb', '_color_hue2rgb', + '_color_rgb2hsl', 'comment_admin', 'comment_admin_overview', 'comment_admin_overview_validate', + 'comment_admin_overview_submit', 'theme_comment_admin_overview', 'comment_multiple_delete_confirm', + 'comment_multiple_delete_confirm_submit', 'comment_delete', 'comment_confirm_delete', + 'comment_confirm_delete_submit', '_comment_delete_thread', 'comment_help', 'comment_theme', + 'comment_menu', 'comment_node_type', 'comment_perm', 'comment_block', 'comment_get_recent', + 'comment_new_page_count', 'theme_comment_block', 'comment_link', 'comment_form_alter', + 'comment_nodeapi', 'comment_user', 'comment_access', 'comment_node_url', 'comment_save', + 'comment_links', 'comment_render', 'comment_operations', '_comment_load', 'comment_num_all', + 'comment_num_replies', 'comment_num_new', 'comment_validate', 'comment_form', 'comment_form_box', + 'comment_form_add_preview', 'comment_form_validate', '_comment_form_submit', 'comment_form_submit', + 'theme_comment_view', 'comment_controls', 'theme_comment_controls', 'comment_controls_submit', + 'template_preprocess_comment', 'template_preprocess_comment_folded', 'theme_comment_flat_collapsed', + 'theme_comment_flat_expanded', 'theme_comment_thread_collapsed', 'theme_comment_thread_expanded', + 'theme_comment_post_forbidden', 'template_preprocess_comment_wrapper', 'theme_comment_submitted', + '_comment_get_modes', '_comment_get_orders', '_comment_per_page', '_comment_get_display_setting', + '_comment_update_node_statistics', 'comment_invoke_comment', 'int2vancode', 'vancode2int', + 'comment_hook_info', 'comment_action_info', 'comment_unpublish_action', 'comment_unpublish_by_keyword_action_form', + 'comment_unpublish_by_keyword_action_submit', 'comment_unpublish_by_keyword_action', + 'comment_edit', 'comment_reply', 'contact_admin_categories', 'contact_admin_edit', + 'contact_admin_edit_validate', 'contact_admin_edit_submit', 'contact_admin_delete', + 'contact_admin_delete_submit', 'contact_admin_settings', 'contact_help', 'contact_perm', + 'contact_menu', '_contact_user_tab_access', 'contact_load', 'contact_user', 'contact_mail', + 'contact_site_page', 'contact_mail_page', 'contact_mail_page_validate', 'contact_mail_page_submit', + 'contact_user_page', 'contact_mail_user', 'contact_mail_user_submit', 'dblog_admin_settings', + 'dblog_overview', 'dblog_top', 'dblog_event', 'dblog_build_filter_query', 'dblog_filters', + '_dblog_format_message', 'dblog_filter_form', 'dblog_filter_form_validate', 'dblog_filter_form_submit', + 'dblog_help', 'dblog_theme', 'dblog_menu', 'dblog_init', 'dblog_cron', 'dblog_user', + '_dblog_get_message_types', 'dblog_watchdog', 'theme_dblog_filters', 'filter_admin_overview', + 'filter_admin_overview_submit', 'theme_filter_admin_overview', 'filter_admin_format_page', + 'filter_admin_format_form', 'filter_admin_format_form_validate', 'filter_admin_format_form_submit', + 'filter_admin_delete', 'filter_admin_delete_submit', 'filter_admin_configure_page', + 'filter_admin_configure', 'filter_admin_order_page', 'filter_admin_order', 'theme_filter_admin_order', + 'filter_admin_order_submit', 'filter_help', 'filter_theme', 'filter_menu', 'filter_format_load', + 'filter_perm', 'filter_cron', 'filter_filter_tips', 'filter_formats', 'filter_list_all', + '_filter_list_cmp', 'filter_resolve_format', 'filter_format_allowcache', 'filter_list_format', + 'check_markup', 'filter_form', 'filter_form_validate', 'filter_access', '_filter_tips', + 'theme_filter_tips_more_info', 'filter_filter', '_filter_html_settings', '_filter_html', + '_filter_url_settings', '_filter_url', '_filter_htmlcorrector', '_filter_url_parse_full_links', + '_filter_url_parse_partial_links', '_filter_url_trim', '_filter_autop', 'filter_xss_admin', + 'filter_xss', '_filter_xss_split', '_filter_xss_attributes', 'filter_xss_bad_protocol', + 'filter_tips_long', 'theme_filter_tips', 'forum_form_main', 'forum_form_forum', 'forum_form_submit', + 'forum_form_container', 'forum_confirm_delete', 'forum_confirm_delete_submit', 'forum_admin_settings', + 'forum_overview', '_forum_parent_select', 'forum_help', 'forum_theme', 'forum_term_load', + 'forum_menu', 'forum_init', 'forum_nodeapi', 'forum_node_info', 'forum_access', 'forum_perm', + 'forum_taxonomy', 'forum_form_alter', 'forum_load', 'forum_block', 'forum_form', 'forum_link_alter', + 'forum_get_forums', '_forum_topics_unread', 'forum_get_topics', '_forum_new', 'template_preprocess_forums', + 'template_preprocess_forum_list', 'template_preprocess_forum_topic_list', 'template_preprocess_forum_icon', + 'template_preprocess_forum_topic_navigation', 'template_preprocess_forum_submitted', + '_forum_user_last_visit', '_forum_get_topic_order', '_forum_get_topic_order_sql', + 'forum_page', 'help_main', 'help_page', 'help_links_as_list', 'help_menu', 'help_help', + 'locale_help', 'locale_menu', 'locale_inc_callback', 'locale_perm', 'locale_locale', + 'locale_user', 'locale_form_alter', 'locale_theme', 'locale', 'locale_get_plural', + 'locale_language_name', 'locale_language_list', 'locale_system_update', 'locale_update_js_files', + 'locale_block', 'menu_overview_page', 'menu_overview_form', '_menu_overview_tree_form', + 'menu_overview_form_submit', 'theme_menu_overview_form', 'menu_edit_item', 'menu_edit_item_validate', + 'menu_item_delete_submit', 'menu_edit_item_submit', 'menu_edit_menu', 'menu_custom_delete_submit', + 'menu_delete_menu_page', 'menu_delete_menu_confirm', 'menu_delete_menu_confirm_submit', + 'menu_edit_menu_validate', 'menu_edit_menu_submit', 'menu_item_delete_page', 'menu_item_delete_form', + 'menu_item_delete_form_submit', 'menu_reset_item_confirm', 'menu_reset_item_confirm_submit', + 'menu_configure', 'menu_help', 'menu_perm', 'menu_menu', 'menu_theme', 'menu_enable', + 'menu_overview_title', 'menu_load', 'menu_parent_options', '_menu_parents_recurse', + 'menu_reset_item', 'menu_block', 'menu_nodeapi', '_menu_parent_depth_limit', 'menu_form_alter', + 'menu_node_form_submit', 'menu_get_menus', 'menu_valid_path', 'node_overview_types', + 'node_type_form', 'node_type_form_validate', 'node_type_form_submit', 'node_node_type', + 'node_type_reset', 'node_type_delete_confirm', 'node_type_delete_confirm_submit', + 'node_configure', 'node_configure_validate', 'node_configure_rebuild_confirm', 'node_configure_rebuild_confirm_submit', + 'node_node_operations', 'node_filters', 'node_build_filter_query', 'node_filter_form', + 'theme_node_filter_form', 'theme_node_filters', 'node_filter_form_submit', 'node_admin_nodes_submit', + 'node_admin_nodes_validate', 'node_admin_content', 'node_admin_nodes', 'theme_node_admin_nodes', + 'node_multiple_delete_confirm', 'node_multiple_delete_confirm_submit', 'node_help', + 'node_theme', 'node_cron', 'node_title_list', 'theme_node_list', 'node_tag_new', 'node_last_viewed', + 'node_mark', 'node_teaser_js', 'node_teaser', 'node_get_types', 'node_types_rebuild', + 'node_type_save', 'node_type_delete', 'node_type_update_nodes', '_node_types_build', + '_node_type_set_defaults', 'node_hook', 'node_invoke', 'node_invoke_nodeapi', 'node_load', + 'node_validate', 'node_submit', 'node_save', '_node_save_revision', 'node_delete', + 'node_view', 'node_prepare', 'node_build_content', 'node_show', 'theme_node_log_message', + 'node_perm', 'node_search', 'node_user', 'theme_node_search_admin', 'node_comment_mode', + 'node_link', '_node_revision_access', '_node_add_access', 'node_menu', 'node_init', + 'node_last_changed', 'node_revision_list', 'node_block', 'node_feed', 'node_page_default', + 'node_page_view', 'node_update_index', '_node_index_node', 'node_form_alter', 'node_search_validate', + 'node_access', '_node_access_join_sql', '_node_access_where_sql', 'node_access_grants', + 'node_access_view_all_nodes', 'node_db_rewrite_sql', 'node_access_acquire_grants', + 'node_access_write_grants', 'node_access_needs_rebuild', 'node_access_rebuild', '_node_access_rebuild_batch_operation', + '_node_access_rebuild_batch_finished', 'node_content_access', 'node_content_form', + 'node_forms', 'theme_node_submitted', 'node_hook_info', 'node_action_info', 'node_publish_action', + 'node_unpublish_action', 'node_make_sticky_action', 'node_make_unsticky_action', 'node_promote_action', + 'node_unpromote_action', 'node_save_action', 'node_assign_owner_action', 'node_assign_owner_action_form', + 'node_assign_owner_action_validate', 'node_assign_owner_action_submit', 'node_unpublish_by_keyword_action_form', + 'node_unpublish_by_keyword_action_submit', 'node_unpublish_by_keyword_action', 'node_mass_update', + '_node_mass_update_helper', '_node_mass_update_batch_process', '_node_mass_update_batch_finished', + 'node_page_edit', 'node_add_page', 'theme_node_add_list', 'node_add', 'node_form_validate', + 'node_object_prepare', 'node_form', 'node_body_field', 'node_form_delete_submit', + 'node_form_build_preview', 'theme_node_form', 'node_preview', 'theme_node_preview', + 'node_form_submit', 'node_form_submit_build_node', 'node_delete_confirm', 'node_delete_confirm_submit', + 'node_revisions', 'node_revision_overview', 'node_revision_revert', 'node_revision_revert_confirm', + 'node_revision_revert_confirm_submit', 'node_revision_delete', 'node_revision_delete_confirm', + 'node_revision_delete_confirm_submit', 'openid_redirect_http', 'openid_redirect', + 'openid_redirect_form', '_openid_is_xri', '_openid_normalize', '_openid_normalize_xri', + '_openid_normalize_url', '_openid_create_message', '_openid_encode_message', '_openid_parse_message', + '_openid_nonce', '_openid_link_href', '_openid_meta_httpequiv', '_openid_signature', + '_openid_hmac', '_openid_sha1', '_openid_dh_base64_to_long', '_openid_dh_long_to_base64', + '_openid_dh_binary_to_long', '_openid_dh_long_to_binary', '_openid_dh_xorsecret', + '_openid_dh_rand', '_openid_get_bytes', '_openid_fix_post', 'openid_menu', 'openid_help', + 'openid_user', 'openid_form_alter', 'openid_login_validate', 'openid_begin', 'openid_complete', + 'openid_discovery', 'openid_association', 'openid_authentication', 'openid_association_request', + 'openid_authentication_request', 'openid_verify_assertion', 'openid_authentication_page', + 'openid_user_identities', 'openid_user_add', 'openid_user_add_validate', 'openid_user_delete', + 'xrds_parse', '_xrds_element_start', '_xrds_element_end', '_xrds_cdata', '_xrds_strip_namespace', + 'path_admin_overview', 'path_admin_edit', 'path_admin_form', 'path_admin_form_validate', + 'path_admin_form_submit', 'path_admin_delete_confirm', 'path_admin_delete_confirm_submit', + 'path_admin_filter_form', 'path_admin_filter_form_submit_filter', 'path_admin_filter_form_submit_reset', + 'path_admin_filter_get_keys', 'path_help', 'path_menu', 'path_admin_delete', 'path_set_alias', + 'path_nodeapi', 'path_form_alter', 'path_perm', 'path_load', 'php_help', 'php_filter_tips', + 'php_filter', 'ping_help', 'ping_cron', '_ping_notify', 'ping_ping', 'poll_help', + 'poll_init', 'poll_theme', 'poll_perm', 'poll_access', 'poll_menu', '_poll_menu_access', + 'poll_block', 'poll_cron', 'poll_node_info', 'poll_form', 'poll_more_choices_submit', + '_poll_choice_form', 'poll_choice_js', 'poll_node_form_submit', 'poll_validate', 'poll_load', + 'poll_insert', 'poll_update', 'poll_delete', 'poll_view', 'poll_teaser', 'poll_view_voting', + 'poll_vote', 'template_preprocess_poll_vote', 'poll_view_results', 'theme_poll_choices', + 'template_preprocess_poll_results', 'template_preprocess_poll_bar', 'poll_cancel_form', + 'poll_cancel', 'poll_user', 'poll_page', 'poll_votes', 'poll_results', 'profile_admin_overview', + 'profile_admin_overview_submit', 'theme_profile_admin_overview', 'profile_field_form', + 'profile_field_form_validate', 'profile_field_form_submit', 'profile_field_delete', + 'profile_field_delete_submit', 'profile_admin_settings_autocomplete', 'profile_help', + 'profile_theme', 'profile_menu', 'profile_block', 'profile_user', 'profile_load_profile', + 'profile_save_profile', 'profile_view_field', 'profile_view_profile', '_profile_form_explanation', + 'profile_form_profile', '_profile_update_user_fields', 'profile_validate_profile', + 'profile_categories', 'profile_category_access', 'template_preprocess_profile_block', + 'template_preprocess_profile_listing', 'template_preprocess_profile_wrapper', '_profile_field_types', + '_profile_field_serialize', '_profile_get_fields', 'profile_browse', 'profile_autocomplete', + 'search_wipe_confirm', 'search_wipe_confirm_submit', 'search_admin_settings', 'search_admin_settings_validate', + 'search_help', 'search_theme', 'search_perm', 'search_block', 'search_menu', '_search_menu', + 'search_wipe', 'search_dirty', 'search_cron', 'search_update_totals', 'search_simplify', + 'search_expand_cjk', 'search_index_split', '_search_index_truncate', 'search_invoke_preprocess', + 'search_index', 'search_touch_node', 'search_nodeapi', 'search_comment', 'search_query_extract', + 'search_query_insert', 'search_parse_query', '_search_parse_query', 'do_search', 'search_get_keys', + 'search_form', 'search_box', 'search_box_form_submit', 'template_preprocess_search_theme_form', + 'template_preprocess_search_block_form', 'search_data', 'search_excerpt', '_search_excerpt_replace', + 'search_forms', 'search_view', 'template_preprocess_search_results', 'template_preprocess_search_result', + 'search_form_validate', 'search_form_submit', 'statistics_recent_hits', 'statistics_top_pages', + 'statistics_top_visitors', 'statistics_top_referrers', 'statistics_access_log', 'statistics_access_logging_settings', + 'statistics_help', 'statistics_exit', 'statistics_perm', 'statistics_link', 'statistics_menu', + 'statistics_user', 'statistics_cron', 'statistics_title_list', 'statistics_get', 'statistics_block', + '_statistics_link', '_statistics_format_item', 'statistics_nodeapi', 'statistics_node_tracker', + 'statistics_user_tracker', 'syslog_help', 'syslog_menu', 'syslog_admin_settings', + 'syslog_facility_list', 'syslog_watchdog', 'syslog_theme', 'theme_syslog_format', + 'system_main_admin_page', 'system_admin_menu_block_page', 'system_admin_compact_page', + 'system_admin_by_module', 'system_settings_overview', 'system_admin_theme_settings', + 'system_themes_form', 'system_themes_form_submit', 'system_theme_settings', 'system_theme_settings_submit', + '_system_is_incompatible', 'system_modules', 'system_sort_modules_by_info_name', 'system_modules_disable', + 'system_modules_confirm_form', 'system_modules_submit', 'system_module_build_dependencies', + 'system_modules_uninstall', 'system_modules_uninstall_confirm_form', 'system_modules_uninstall_validate', + 'system_modules_uninstall_submit', 'system_site_information_settings', 'system_error_reporting_settings', + 'system_logging_overview', 'system_performance_settings', 'system_clear_cache_submit', + 'system_file_system_settings', 'system_image_toolkit_settings', 'system_rss_feeds_settings', + 'system_date_time_settings', 'system_date_time_settings_submit', 'system_date_time_lookup', + 'system_site_maintenance_settings', 'system_clean_url_settings', 'system_status', + 'system_run_cron', 'system_php', '_system_sql', 'system_sql', 'system_batch_page', + 'theme_admin_block', 'theme_admin_block_content', 'theme_admin_page', 'theme_system_admin_by_module', + 'theme_status_report', 'theme_system_modules', 'theme_system_modules_uninstall', 'theme_system_theme_select_form', + 'theme_system_themes_form', 'system_help', 'system_theme', 'system_perm', 'system_elements', + 'system_menu', 'system_init', 'system_user', 'system_block', 'system_admin_menu_block', + 'system_admin_theme_submit', 'system_theme_select_form', 'system_check_directory', + 'system_get_files_database', 'system_theme_default', 'system_theme_data', '_system_theme_data', + 'system_find_base_theme', 'system_region_list', 'system_default_region', 'system_initialize_theme_blocks', + 'system_settings_form', 'system_settings_form_submit', '_system_sort_requirements', + 'system_node_type', 'confirm_form', 'system_admin_compact_mode', 'system_get_module_admin_tasks', + 'system_cron', 'system_hook_info', 'system_action_info', 'system_actions_manage', + 'system_actions_manage_form', 'system_actions_manage_form_submit', 'system_actions_configure', + 'system_actions_configure_validate', 'system_actions_configure_submit', 'system_actions_delete_form', + 'system_actions_delete_form_submit', 'system_action_delete_orphans_post', 'system_actions_remove_orphans', + 'system_send_email_action_form', 'system_send_email_action_validate', 'system_send_email_action_submit', + 'system_send_email_action', 'system_mail', 'system_message_action_form', 'system_message_action_submit', + 'system_message_action', 'system_goto_action_form', 'system_goto_action_submit', 'system_goto_action', + '_system_zonelist', 'theme_system_powered_by', 'taxonomy_overview_vocabularies', 'taxonomy_overview_vocabularies_submit', + 'theme_taxonomy_overview_vocabularies', 'taxonomy_form_vocabulary', 'taxonomy_form_vocabulary_submit', + 'taxonomy_admin_vocabulary_edit', 'taxonomy_admin_term_edit', 'taxonomy_overview_terms', + 'taxonomy_overview_terms_submit', 'theme_taxonomy_overview_terms', 'taxonomy_add_term_page', + 'taxonomy_form_term', 'taxonomy_form_term_validate', 'taxonomy_form_term_submit', + 'taxonomy_term_confirm_parents', 'taxonomy_term_confirm_delete', 'taxonomy_term_confirm_delete_submit', + 'taxonomy_vocabulary_confirm_delete', 'taxonomy_vocabulary_confirm_delete_submit', + 'taxonomy_vocabulary_confirm_reset_alphabetical', 'taxonomy_vocabulary_confirm_reset_alphabetical_submit', + 'taxonomy_perm', 'taxonomy_theme', 'taxonomy_link', 'taxonomy_term_path', 'taxonomy_menu', + 'taxonomy_save_vocabulary', 'taxonomy_del_vocabulary', 'taxonomy_check_vocabulary_hierarchy', + 'taxonomy_save_term', 'taxonomy_del_term', 'taxonomy_form', 'taxonomy_form_all', 'taxonomy_get_vocabularies', + 'taxonomy_form_alter', 'taxonomy_preview_terms', 'taxonomy_node_get_terms_by_vocabulary', + 'taxonomy_node_get_terms', 'taxonomy_node_validate', 'taxonomy_node_save', 'taxonomy_node_delete', + 'taxonomy_node_delete_revision', 'taxonomy_node_type', 'taxonomy_get_related', 'taxonomy_get_parents', + 'taxonomy_get_parents_all', 'taxonomy_get_children', 'taxonomy_get_tree', 'taxonomy_get_synonyms', + 'taxonomy_get_synonym_root', 'taxonomy_term_count_nodes', '_taxonomy_term_children', + 'taxonomy_get_term_by_name', 'taxonomy_vocabulary_load', 'taxonomy_get_term', '_taxonomy_term_select', + 'theme_taxonomy_term_select', 'taxonomy_select_nodes', 'taxonomy_render_nodes', 'taxonomy_nodeapi', + 'taxonomy_node_update_index', 'taxonomy_terms_parse_string', 'taxonomy_rss_item', + 'taxonomy_help', '_taxonomy_get_tid_from_term', 'taxonomy_implode_tags', 'taxonomy_hook_info', + 'taxonomy_term_page', 'theme_taxonomy_term_page', 'taxonomy_autocomplete', 'throttle_admin_settings', + 'throttle_admin_settings_validate', 'throttle_menu', 'throttle_status', 'throttle_exit', + 'throttle_help', 'tracker_help', 'tracker_menu', 'tracker_page', 'translation_help', + 'translation_menu', '_translation_tab_access', 'translation_perm', 'translation_form_alter', + 'translation_link', 'translation_nodeapi', 'translation_remove_from_set', 'translation_node_get_translations', + 'translation_supported_type', 'translation_path_get_translations', 'translation_translation_link_alter', + 'translation_node_overview', 'trigger_assign', 'trigger_unassign', 'trigger_unassign_submit', + 'trigger_assign_form', 'trigger_assign_form_validate', 'trigger_assign_form_submit', + 'theme_trigger_display', '_trigger_get_hook_actions', 'trigger_help', 'trigger_menu', + 'trigger_access_check', '_trigger_get_hook_aids', 'trigger_theme', 'trigger_forms', + '_trigger_normalize_node_context', 'trigger_nodeapi', '_trigger_normalize_comment_context', + 'trigger_comment', 'trigger_cron', '_trigger_normalize_user_context', 'trigger_user', + 'trigger_taxonomy', 'trigger_options', 'update_get_projects', '_update_process_info_list', + 'update_get_project_name', 'update_process_project_info', 'update_calculate_project_data', + 'update_manual_status', '_update_refresh', '_update_build_fetch_url', '_update_cron_notify', + 'update_help', 'update_menu', 'update_theme', 'update_requirements', 'update_cron', + 'update_form_alter', '_update_no_data', 'update_get_available', 'update_invalidate_cache', + 'update_refresh', 'update_mail', '_update_message_text', 'update_status', 'theme_update_report', + 'theme_update_version', 'update_settings', 'update_settings_validate', 'update_settings_submit', + 'upload_admin_settings_validate', 'upload_admin_settings', 'upload_help', 'upload_theme', + 'upload_perm', 'upload_link', 'upload_menu', 'upload_menu_alter', '_upload_file_limits', + 'upload_file_download', 'upload_node_form_submit', 'upload_form_alter', 'upload_nodeapi', + 'theme_upload_attachments', 'upload_space_used', 'upload_total_space_used', 'upload_save', + 'upload_delete', 'upload_delete_revision', '_upload_form', 'theme_upload_form_current', + 'theme_upload_form_new', 'upload_load', 'upload_js', 'user_admin', 'user_filter_form', + 'user_filter_form_submit', 'user_admin_account', 'user_admin_account_submit', 'user_admin_account_validate', + 'user_admin_settings', 'user_admin_perm', 'user_admin_perm_submit', 'theme_user_admin_perm', + 'user_admin_role', 'user_admin_role_validate', 'user_admin_role_submit', 'user_admin_access_check', + 'user_admin_access_add', 'user_admin_access_edit', 'user_admin_access_form', 'user_admin_access_check_validate', + 'user_admin_check_user', 'user_admin_check_mail', 'user_admin_check_host', 'user_admin_access_check_submit', + 'user_admin_access_delete_confirm', 'user_admin_access_delete_confirm_submit', 'user_admin_access', + 'theme_user_admin_account', 'theme_user_admin_new_role', 'theme_user_filter_form', + 'theme_user_filters', 'user_module_invoke', 'user_theme', 'user_external_load', 'user_external_login', + 'user_load', 'user_save', 'user_validate_name', 'user_validate_mail', 'user_validate_picture', + 'user_password', 'user_access', 'user_is_blocked', 'user_fields', 'user_perm', 'user_file_download', + 'user_search', 'user_elements', 'user_user', 'user_login_block', 'user_block', 'template_preprocess_user_picture', + 'theme_user_list', 'user_is_anonymous', 'user_is_logged_in', 'user_register_access', + 'user_view_access', 'user_edit_access', 'user_load_self', 'user_menu', 'user_init', + 'user_current_load', 'user_category_load', 'user_current_to_arg', 'user_get_authmaps', + 'user_set_authmaps', 'user_login', 'user_login_default_validators', 'user_login_name_validate', + 'user_login_authenticate_validate', 'user_login_final_validate', 'user_authenticate', + 'user_login_submit', 'user_external_login_register', 'user_pass_reset_url', 'user_pass_rehash', + 'user_edit_form', '_user_edit_validate', '_user_edit_submit', 'user_delete', 'user_build_content', + 'user_mail', '_user_mail_text', 'user_roles', 'user_user_operations', 'user_user_operations_unblock', + 'user_user_operations_block', 'user_multiple_role_edit', 'user_multiple_delete_confirm', + 'user_multiple_delete_confirm_submit', 'user_help', '_user_categories', '_user_sort', + 'user_filters', 'user_build_filter_query', 'user_forms', 'user_comment', 'theme_user_signature', + 'user_mail_tokens', 'user_preferred_language', '_user_mail_notify', '_user_password_dynamic_validation', + 'user_hook_info', 'user_action_info', 'user_block_user_action', 'user_block_ip_action', + 'user_register_submit', 'user_register', 'user_register_validate', '_user_forms', + 'user_autocomplete', 'user_pass', 'user_pass_validate', 'user_pass_submit', 'user_pass_reset', + 'user_logout', 'user_view', 'template_preprocess_user_profile', 'template_preprocess_user_profile_item', + 'template_preprocess_user_profile_category', 'user_edit', 'user_profile_form', 'user_profile_form_validate', + 'user_profile_form_submit', 'user_edit_delete_submit', 'user_confirm_delete', 'user_confirm_delete_submit', + 'user_edit_validate', 'user_edit_submit', 'user_page', + ), + 6 => array( + 'CACHE_PERMANENT', 'CACHE_TEMPORARY', 'CACHE_DISABLED', 'CACHE_NORMAL', 'CACHE_AGGRESSIVE', + 'WATCHDOG_EMERG', 'WATCHDOG_ALERT', 'WATCHDOG_CRITICAL', 'WATCHDOG_ERROR', 'WATCHDOG_WARNING', + 'WATCHDOG_NOTICE', 'WATCHDOG_INFO', 'WATCHDOG_DEBUG', 'DRUPAL_BOOTSTRAP_CONFIGURATION', + 'DRUPAL_BOOTSTRAP_EARLY_PAGE_CACHE', 'DRUPAL_BOOTSTRAP_DATABASE', 'DRUPAL_BOOTSTRAP_ACCESS', + 'DRUPAL_BOOTSTRAP_SESSION', 'DRUPAL_BOOTSTRAP_LATE_PAGE_CACHE', 'DRUPAL_BOOTSTRAP_LANGUAGE', + 'DRUPAL_BOOTSTRAP_PATH', 'DRUPAL_BOOTSTRAP_FULL', 'DRUPAL_ANONYMOUS_RID', 'DRUPAL_AUTHENTICATED_RID', + 'LANGUAGE_NEGOTIATION_NONE', 'LANGUAGE_NEGOTIATION_PATH_DEFAULT', 'LANGUAGE_NEGOTIATION_PATH', + 'LANGUAGE_NEGOTIATION_DOMAIN', 'SAVED_NEW', 'SAVED_UPDATED', 'SAVED_DELETED', 'DB_ERROR', + 'DB_QUERY_REGEXP', 'FILE_DOWNLOADS_PUBLIC', 'FILE_DOWNLOADS_PRIVATE', 'FILE_CREATE_DIRECTORY', + 'FILE_MODIFY_PERMISSIONS', 'FILE_EXISTS_RENAME', 'FILE_EXISTS_REPLACE', 'FILE_EXISTS_ERROR', + 'FILE_STATUS_TEMPORARY', 'FILE_STATUS_PERMANENT', 'SCHEMA_UNINSTALLED', 'SCHEMA_INSTALLED', + 'REQUIREMENT_INFO', 'REQUIREMENT_OK', 'REQUIREMENT_WARNING', 'REQUIREMENT_ERROR', + 'FILE_EXIST', 'FILE_READABLE', 'FILE_WRITABLE', 'FILE_EXECUTABLE', 'FILE_NOT_EXIST', + 'FILE_NOT_READABLE', 'FILE_NOT_WRITABLE', 'FILE_NOT_EXECUTABLE', 'LOCALE_JS_STRING', + 'LOCALE_IMPORT_OVERWRITE', 'LOCALE_IMPORT_KEEP', 'MENU_IS_ROOT', 'MENU_VISIBLE_IN_TREE', + 'MENU_VISIBLE_IN_BREADCRUMB', 'MENU_LINKS_TO_PARENT', 'MENU_MODIFIED_BY_ADMIN', 'MENU_CREATED_BY_ADMIN', + 'MENU_IS_LOCAL_TASK', 'MENU_NORMAL_ITEM', 'MENU_CALLBACK', 'MENU_SUGGESTED_ITEM', + 'MENU_LOCAL_TASK', 'MENU_DEFAULT_LOCAL_TASK', 'MENU_FOUND', 'MENU_NOT_FOUND', 'MENU_ACCESS_DENIED', + 'MENU_SITE_OFFLINE', 'MENU_MAX_PARTS', 'MENU_MAX_DEPTH', 'MARK_READ', 'MARK_NEW', + 'MARK_UPDATED', 'UNICODE_ERROR', 'UNICODE_SINGLEBYTE', 'UNICODE_MULTIBYTE', 'BLOCK_REGION_NONE', + 'BLOCK_NO_CACHE', 'BLOCK_CACHE_PER_ROLE', 'BLOCK_CACHE_PER_USER', 'BLOCK_CACHE_PER_PAGE', + 'BLOCK_CACHE_GLOBAL', 'COMMENT_PUBLISHED', 'COMMENT_NOT_PUBLISHED', 'COMMENT_MODE_FLAT_COLLAPSED', + 'COMMENT_MODE_FLAT_EXPANDED', 'COMMENT_MODE_THREADED_COLLAPSED', 'COMMENT_MODE_THREADED_EXPANDED', + 'COMMENT_ORDER_NEWEST_FIRST', 'COMMENT_ORDER_OLDEST_FIRST', 'COMMENT_CONTROLS_ABOVE', + 'COMMENT_CONTROLS_BELOW', 'COMMENT_CONTROLS_ABOVE_BELOW', 'COMMENT_CONTROLS_HIDDEN', + 'COMMENT_ANONYMOUS_MAYNOT_CONTACT', 'COMMENT_ANONYMOUS_MAY_CONTACT', 'COMMENT_ANONYMOUS_MUST_CONTACT', + 'COMMENT_FORM_SEPARATE_PAGE', 'COMMENT_FORM_BELOW', 'COMMENT_NODE_DISABLED', 'COMMENT_NODE_READ_ONLY', + 'COMMENT_NODE_READ_WRITE', 'COMMENT_PREVIEW_OPTIONAL', 'COMMENT_PREVIEW_REQUIRED', + 'FILTER_FORMAT_DEFAULT', 'FILTER_HTML_STRIP', 'FILTER_HTML_ESCAPE', 'LANGUAGE_LTR', + 'LANGUAGE_RTL', 'MENU_MAX_MENU_NAME_LENGTH_UI', 'NODE_NEW_LIMIT', 'NODE_BUILD_NORMAL', + 'NODE_BUILD_PREVIEW', 'NODE_BUILD_SEARCH_INDEX', 'NODE_BUILD_SEARCH_RESULT', 'NODE_BUILD_RSS', + 'NODE_BUILD_PRINT', 'OPENID_DH_DEFAULT_MOD', 'OPENID_DH_DEFAULT_GEN', 'OPENID_SHA1_BLOCKSIZE', + 'OPENID_RAND_SOURCE', 'OPENID_NS_2_0', 'OPENID_NS_1_1', 'OPENID_NS_1_0', 'PROFILE_PRIVATE', + 'PROFILE_PUBLIC', 'PROFILE_PUBLIC_LISTINGS', 'PROFILE_HIDDEN', 'PREG_CLASS_SEARCH_EXCLUDE', + 'PREG_CLASS_NUMBERS', 'PREG_CLASS_PUNCTUATION', 'PREG_CLASS_CJK', 'VERSION', 'DRUPAL_CORE_COMPATIBILITY', + 'DRUPAL_MINIMUM_PHP', 'DRUPAL_MINIMUM_MYSQL', 'DRUPAL_MINIMUM_PGSQL', 'DRUPAL_MINIMUM_APACHE', + 'DRUPAL_MAXIMUM_TEMP_FILE_AGE', 'UPDATE_DEFAULT_URL', 'UPDATE_CURRENT', 'UPDATE_NOT_SECURE', + 'UPDATE_NOT_CURRENT', 'UPDATE_NOT_CHECKED', 'UPDATE_UNKNOWN', 'USERNAME_MAX_LENGTH', + 'EMAIL_MAX_LENGTH', + ), + ), + 'SYMBOLS' => array( + '(', ')', '[', ']', '{', '}', '!', '@', '%', '&', '*', '|', '/', '<', '>' + ), + 'CASE_SENSITIVE' => array( + GESHI_COMMENTS => false, + 1 => false, + 2 => false, + 3 => false, + 4 => false, + 5 => false, + 6 => false, + ), + 'STYLES' => array( + 'KEYWORDS' => array( + 1 => 'color: #b1b100;', + 2 => 'color: #000000; font-weight: bold;', + 3 => 'color: #000066;', + 5 => 'color: #000066;', + 6 => 'color: #000000; font-weight: bold;', + ), + 'COMMENTS' => array( + 1 => 'color: #808080; font-style: italic;', + 2 => 'color: #808080; font-style: italic;', + 'MULTI' => 'color: #808080; font-style: italic;' + ), + 'ESCAPE_CHAR' => array( + 0 => 'color: #000099; font-weight: bold;' + ), + 'BRACKETS' => array( + 0 => 'color: #66cc66;' + ), + 'STRINGS' => array( + 0 => 'color: #ff0000;' + ), + 'NUMBERS' => array( + 0 => 'color: #cc66cc;' + ), + 'METHODS' => array( + 1 => 'color: #006600;', + 2 => 'color: #006600;' + ), + 'SYMBOLS' => array( + 0 => 'color: #66cc66;' + ), + 'REGEXPS' => array( + 0 => 'color: #0000ff;', + 1 => 'color: #ff0000' + ), + 'SCRIPT' => array( + 0 => '', + 1 => '', + 2 => '', + 3 => '' + ) + ), + 'URLS' => array( + 1 => '', + 2 => '', + 3 => 'http://www.php.net/{FNAME}', + 4 => '', + 5 => 'http://api.drupal.org/api/function/{FNAME}/6', + 6 => 'http://api.drupal.org/api/constant/{FNAME}/6', + ), + 'OOLANG' => true, + 'OBJECT_SPLITTERS' => array( + 1 => '->', + 2 => '::', + ), + 'REGEXPS' => array( + 0 => "[\\$]{1,2}[a-zA-Z_][a-zA-Z0-9_]*", + 1 => array( + GESHI_SEARCH => "([a-zA-Z]+)(\n)(.*)(\n)(\\1;?)", + GESHI_REPLACE => '\3', + GESHI_BEFORE => '\1\2', + GESHI_AFTER => '\4\5', + GESHI_MODIFIERS => 'siU' + ), + ), + 'STRICT_MODE_APPLIES' => GESHI_MAYBE, + 'SCRIPT_DELIMITERS' => array( + 0 => array( + ' '?>' + ), + 1 => array( + ' '?>' + ), + 2 => array( + '<%' => '%>' + ), + ), + 'HIGHLIGHT_STRICT_BLOCK' => array( + 0 => true, + 1 => true, + 2 => true, + 3 => true + ), + 'TAB_WIDTH' => 2 +); diff --git a/sites/all/modules/geshifilter/geshifield/geshifield.info b/sites/all/modules/geshifilter/geshifield/geshifield.info new file mode 100644 index 0000000..a9868d4 --- /dev/null +++ b/sites/all/modules/geshifilter/geshifield/geshifield.info @@ -0,0 +1,13 @@ +name = "GeSHi field" +description = "Provides a CCK field for source code with GeSHI syntax highlighting." +package = "Filters" +core = 6.x +dependencies[] = content +dependencies[] = geshifilter + +; Information added by drupal.org packaging script on 2013-03-18 +version = "6.x-1.5" +core = "6.x" +project = "geshifilter" +datestamp = "1363644611" + diff --git a/sites/all/modules/geshifilter/geshifield/geshifield.install b/sites/all/modules/geshifilter/geshifield/geshifield.install new file mode 100644 index 0000000..e479eba --- /dev/null +++ b/sites/all/modules/geshifilter/geshifield/geshifield.install @@ -0,0 +1,41 @@ + array( + 'arguments' => array('element' => NULL), + ), + 'geshifield_formatter_default' => array( + 'arguments' => array('element' => NULL), + ), + 'geshifield_formatter_nohighlighting' => array( + 'arguments' => array('element' => NULL), + ), + 'geshifield_formatter_trimmed' => array( + 'arguments' => array('element' => NULL), + ), + ); +} + + +/** + * Implementation of hook_field_info(). + */ +function geshifield_field_info() { + return array( + 'geshifield' => array( + // @todo: better label? "Source code field"? + 'label' => t('GeSHi field'), + 'description' => t('Source code text field with GeSHi syntax highlighting.'), + ) + ); +} + +/** + * Implementation of hook_field_settings(). + */ +function geshifield_field_settings($op, $field) { + switch ($op) { + case 'database columns': + $columns = array( + 'sourcecode' => array( + 'type' => 'text', + 'size' => 'big', + 'not null' => FALSE, + 'sortable' => TRUE, + 'views' => TRUE, //@todo what does this do? + ), + 'language' => array( + 'type' => 'varchar', + 'length' => 32, + 'not null' => FALSE, + 'sortable' => TRUE, + 'views' => TRUE, //@todo what does this do? + ), + ); + return $columns; + } +} + + +/** + * Implementation of hook_field(). + */ +function geshifield_field($op, &$node, $field, &$items, $teaser, $page) { + // Nothing to do here. + // Typically only the validition operation is needed in this hook + // but for geshifield even this is not needed. +} + +/** + * Implementation of hook_content_is_empty(). + */ +function geshifield_content_is_empty($item, $field) { + return empty($item['sourcecode']); +} + +/** + * Implementation of hook_content_diff_values(). + * + * Provides support for viewing differences between node revisions. + * More info: diff module (diff/node.inc), cck module + * (cck/includes/content.diff.inc) + */ +function geshifield_content_diff_values($node, $field, $items) { + $result = array(); + foreach ($items as $item) { + if (isset($item['sourcecode']) && isset($item['language'])) { + $result[] = t('[Language: !language]', array('!language' => $item['language'])); + foreach (explode("\n", $item['sourcecode']) as $i) { + $result[] = $i; + } + } + } + return $result; +} + +/** + * Implementation of hook_widget_info(). + */ +function geshifield_widget_info() { + return array( + 'geshifield_textarea' => array( + 'label' => t('Source code text area'), + 'field types' => array('geshifield'), + // Let CCK core handle multiple values. + 'multiple values' => CONTENT_HANDLE_CORE, + 'callbacks' => array( + // Do not provide default values through CCK core's + // default value handling. @todo: or should we? + 'default value' => CONTENT_CALLBACK_NONE, + ), + ), + ); + // @todo provide a file upload widget too. +} + +/** + * Implementation of hook_elements(). + */ +function geshifield_elements() { + $elements = array( + 'geshifield_textarea' => array( + '#input' => TRUE, + '#process' => array('geshifield_textarea_process' ), + ), + ); + return $elements; +} + +/** + * Process callback for geshifield_textarea widget. + */ +function geshifield_textarea_process($element, $edit, &$form_state, $form) { + module_load_include('inc', 'geshifilter'); + + $defaults = $element['#value']; + $field = content_fields($element['#field_name'], $element['#type_name']); + + $enabled_languages = _geshifilter_get_enabled_languages(); + // @todo: also add "no highlighting" options. + + $element['sourcecode'] = array( + '#type' => 'textarea', + '#title' => t('Source code'), + '#default_value' => isset($defaults['sourcecode']) ? $defaults['sourcecode'] : '', + '#required' => $element['#required'], + '#rows' => $field['widget']['rows'], + '#description' => filter_xss($field['widget']['description']), + ); + + $element['language'] = array( + '#type' => 'select', + '#title' => t('Syntax highlighting mode'), + '#default_value' => isset($defaults['language']) ? $defaults['language'] : '', + '#options' => $enabled_languages, + '#description' => t('Select the syntax highlighting mode to use for the source code.'), + ); + + return $element; +} + +/** + * Theming function for the geshifield_textarea widget + */ +function theme_geshifield_textarea($element) { + return theme( 'form_element', $element, $element['#children'] ); +} + +/** + * Implementation of hook_widget_settings(). + */ +function geshifield_widget_settings($op, $widget) { + switch ($op) { + case 'form': + $form = array(); + $form['rows'] = array( + '#type' => 'textfield', + '#title' => t('Default number of rows in text area'), + '#description' => t('The default number of rows to provide in the text area for entering the source code.'), + '#default_value' => isset($widget['rows']) ? $widget['rows'] : 20, + '#required' => TRUE, + ); + // @todo add an option for the default language + return $form; + break; + + case 'validate': + if (!is_numeric($widget['rows']) || intval($widget['rows']) != $widget['rows'] || $widget['rows'] <= 0 || $widget['rows'] > 100) { + form_set_error('rows', t('The number of rows must be an integer between 1 and 100.')); + } + break; + + case 'save': + return array('rows'); + break; + } +} + +/** + * Implementation of hook_widget(). + */ +function geshifield_widget(&$form, &$form_state, $field, $items, $delta = 0) { + $element = array( + '#type' => $field['widget']['type'], + '#default_value' => isset($items[$delta]) ? $items[$delta] : '', + ); + return $element; +} + +/** + * Implementation of hook_field_formatter_info(). + */ +function geshifield_field_formatter_info() { + $formatters = array( + 'default' => array( + 'label' => t('Default'), + 'field types' => array('geshifield'), + ), + 'nohighlighting' => array( + 'label' => t('No syntax highlighting'), + 'field types' => array('geshifield'), + ), + 'trimmed' => array( + 'label' => t('Trimmed'), + 'field types' => array('geshifield'), + ), + ); + return $formatters; +} + + +function theme_geshifield_formatter_default($element) { + $output = ''; + module_load_include('inc', 'geshifilter', 'geshifilter.pages'); + if (isset($element['#item']['sourcecode'])) { + $output .= geshifilter_geshi_process($element['#item']['sourcecode'], $element['#item']['language']); + } + return $output; +} + +function theme_geshifield_formatter_nohighlighting($element) { + $output = ''; + module_load_include('inc', 'geshifilter', 'geshifilter.pages'); + if (isset($element['#item']['sourcecode'])) { + $output .= geshifilter_geshi_process($element['#item']['sourcecode'], 'text'); + } + return $output; +} + +function theme_geshifield_formatter_trimmed($element) { + $output = ''; + module_load_include('inc', 'geshifilter', 'geshifilter.pages'); + if (isset($element['#item']['sourcecode'])) { + $output .= geshifilter_geshi_process(node_teaser($element['#item']['sourcecode']), $element['#item']['language']); + } + return $output; +} diff --git a/sites/all/modules/geshifilter/geshifilter.admin.inc b/sites/all/modules/geshifilter/geshifilter.admin.inc new file mode 100644 index 0000000..efbe8a2 --- /dev/null +++ b/sites/all/modules/geshifilter/geshifilter.admin.inc @@ -0,0 +1,595 @@ + 'fieldset', + '#title' => t('GeSHi filter'), + '#collapsible' => TRUE, + ); + if (geshifilter_use_format_specific_options()) { + // tags and attributes + $form['geshifilter']['general_tags'] = _geshifilter_general_highlight_tags_settings($format); + $form['#validate'][] = '_geshifilter_tag_styles_validate'; + // per language tags + $form['geshifilter']['per_language_settings'] = array( + '#type' => 'fieldset', + '#title' => t('Per language tags'), + '#collapsible' => TRUE, + 'table' => geshifilter_per_language_settings($format, 'enabled', FALSE, TRUE), + ); + } + else { + $form['geshifilter']['info'] = array( + '#value' => '

'. t('GeSHi filter is configured to use global tag settings. For separate settings per input format, enable this option in the general GeSHi filter settings.', array('!geshi_admin_url' => url('admin/settings/geshifilter'))) .'

' + ); + } + $form['#validate'][] = 'geshifilter_per_language_settings_validate'; + return $form; +} + +/** + * Validation handler for the tag styles form element. + * Covers usage in the general form of geshifilter_admin_general_settings() + * and the format specific (sub)form of _geshifilter_filter_settings(). + */ +function _geshifilter_tag_styles_validate($form, &$form_state) { + // If we're coming from the _geshifilter_filter_settings (sub)form, we should + // take the input format into account. + $f = isset($form_state['values']['format']) ? '_'. $form_state['values']['format'] : ''; + + // Check that at least one tag style is selected. + if (0 == count(array_filter($form_state['values']["geshifilter_tag_styles{$f}"]))) { + form_set_error("geshifilter_tag_styles{$f}", t('At least one tag style should be selected.')); + } +} + +/** + * General settings form for the GeSHi filter. + */ +function geshifilter_admin_general_settings(&$form_state) { + $form = array(); + + // Try to load GeSHi library and get version if successful. + $geshi_library = _geshifilter_check_geshi_library(); + + // GeSHi library settings (constant GESHI_VERSION is defined in GeSHi library) + $form['geshifilter_library'] = array( + '#type' => 'fieldset', + '#title' => defined('GESHI_VERSION') ? t('GeSHi library version @version detected', array('@version' => GESHI_VERSION)) : t('GeSHi library'), + '#description' => t('The GeSHi filter requires the GeSHi library (which needs to be downloaded and installed seperately).', + array('!geshi' => url('http://qbnz.com/highlighter/'))), + '#collapsible' => TRUE, + '#collapsed' => $geshi_library['success'], + ); + $form['geshifilter_library']['geshifilter_geshi_dir'] = array( + '#type' => 'textfield', + '#title' => t('Path to GeSHi library'), + '#default_value' => _geshifilter_get_geshi_dir(), + '#description' => t('Specify the path to the GeSHi library directory (which contains a file called geshi.php).') + ); + $form['geshifilter_library']['#after_build'] = array('geshifilter_admin_general_settings_after_build'); + + // If the GeSHi library is loaded, show all the options and settings. + if ($geshi_library['loaded']) { + + // Option for flushing the GeSHi language definition cache. + $form['geshifilter_library']['geshi_language_definition_caching'] = array( + '#type' => 'item', + '#title' => t('GeSHi language definition caching'), + '#description' => t('The GeSHi library uses languages definition files to define the properties and highlight rules of the supported languages. In most scenarios these language definition files do not change and a lot of derivative data, such as the list of available languages or the CSS style sheet, can be cached for efficiency reasons. Sometimes however, this cache needs to be flushed and the languages definition files need to be reparsed, for example after an upgrade of the GeSHi library or after adding/editing some language definition files manually.'), + ); + // Non-submitting button for flushing the GeSHi language definition file cache. + $form['geshifilter_library']['geshi_language_definition_caching']['flush_geshi_language_definition_cache'] = array( + '#type' => 'button', + '#value' => t(GESHIFILTER_FLUSH_LANGUAGE_DEFINITION_CACHE_TEXT), + ); + // Handle the button for flushing the GeSHi language definition cache. + // This is done here instead of in a submit handler because the button is + // not a submitting button. + if (isset($form_state['post']['op']) && $form_state['post']['op'] == t(GESHIFILTER_FLUSH_LANGUAGE_DEFINITION_CACHE_TEXT)) { + _geshifilter_flush_language_definition_cache(); + } + + // GeSHi filter tags and delimiters options + $form['geshifilter_tag_options'] = array( + '#type' => 'fieldset', + '#title' => t('GeSHi filter tags and delimiters'), + '#collapsible' => TRUE, + ); + // Usage of format specific options. + $form['geshifilter_tag_options']['geshifilter_format_specific_options'] = array( + '#type' => 'checkbox', + '#title' => t('Use input format specific tag settings.'), + '#default_value' => geshifilter_use_format_specific_options(), + '#description' => t('Enable seperate tag settings of the GeSHi filter for each input format instead of global tag settings.', array('!input_formats' => url('admin/settings/filters'))), + ); + // Generic tags settings. + // @todo: do this conditional form part showing/hiding in jQuery instead of in the form builder. + if (!geshifilter_use_format_specific_options()) { + $form['geshifilter_tag_options']['geshifilter_general_tags'] = _geshifilter_general_highlight_tags_settings(); + $form['#validate'][] = '_geshifilter_tag_styles_validate'; + } + + // GeSHi filter highlighting options + $form['geshifilter_highlighting_options'] = array( + '#type' => 'fieldset', + '#title' => t('Syntax highlighting options'), + '#collapsible' => TRUE, + ); + // default language + $languages = _geshifilter_get_enabled_languages(); + $form['geshifilter_highlighting_options']['geshifilter_default_highlighting'] = array( + '#type' => 'select', + '#title' => t('Default highlighting mode'), + '#default_value' => variable_get('geshifilter_default_highlighting', GESHIFILTER_DEFAULT_PLAINTEXT), + '#options' => array( + t('No highlighting') => array( + GESHIFILTER_DEFAULT_DONOTHING => t('Do nothing'), + GESHIFILTER_DEFAULT_PLAINTEXT => t('As plain text'), + ), + t('Languages') => $languages, + ), + '#description' => t('Select the default highlighting mode to use when no language is defined with a language attribute in the tag.') + ); + // Default line numbering scheme + $form['geshifilter_highlighting_options']['geshifilter_default_line_numbering'] = array( + '#type' => 'select', + '#title' => t('Default line numbering'), + '#default_value' => variable_get('geshifilter_default_line_numbering', GESHIFILTER_LINE_NUMBERS_DEFAULT_NONE), + '#options' => array( + GESHIFILTER_LINE_NUMBERS_DEFAULT_NONE => t('no line numbers'), + GESHIFILTER_LINE_NUMBERS_DEFAULT_NORMAL => t('normal line numbers'), + GESHIFILTER_LINE_NUMBERS_DEFAULT_FANCY5 => t('fancy line numbers (every @n lines)', array('@n' => GESHIFILTER_LINE_NUMBERS_DEFAULT_FANCY5)), + GESHIFILTER_LINE_NUMBERS_DEFAULT_FANCY10 => t('fancy line numbers (every @n lines)', array('@n' => GESHIFILTER_LINE_NUMBERS_DEFAULT_FANCY10)), + GESHIFILTER_LINE_NUMBERS_DEFAULT_FANCY20 => t('fancy line numbers (every @n lines)', array('@n' => GESHIFILTER_LINE_NUMBERS_DEFAULT_FANCY20)), + ), + '#description' => t('Select the default line numbering scheme: no line numbers, normal line numbers or fancy line numbers. With fancy line numbers every nth line number is highlighted. (GeSHi documentation: Line numbers).', + array('!link' => 'http://qbnz.com/highlighter/geshi-doc.html#line-numbers')), + ); + // highlight_string usage option + $form['geshifilter_highlighting_options']['geshifilter_use_highlight_string_for_php'] = array( + '#type' => 'checkbox', + '#title' => t('Use built-in PHP function highlight_string() for PHP source code.'), + '#description' => t('When enabled, PHP source code will be syntax highlighted with the built-in PHP function highlight_string() instead of with the GeSHi library. GeSHi features, like line numbering and usage of an external CSS stylesheet for example, are not available.', + array('!highlight_string' => 'http://php.net/manual/en/function.highlight-string.php')), + '#default_value' => variable_get('geshifilter_use_highlight_string_for_php', FALSE), + ); + // Option to disable Keyword URL's + $form['geshifilter_highlighting_options']['geshifilter_enable_keyword_urls'] = array( + '#type' => 'checkbox', + '#title' => t('Enable GeSHi keyword URLs'), + '#description' => t('For some languages GeSHi can link language keywords (e.g. standard library functions) to their online documentation. (GeSHi documentation: Keyword URLs).', + array('!link' => 'http://qbnz.com/highlighter/geshi-doc.html#keyword-urls')), + '#default_value' => variable_get('geshifilter_enable_keyword_urls', TRUE), + ); + + // Styling, layout and CSS + $form['geshifilter_styling'] = array( + '#type' => 'fieldset', + '#title' => t('Styling, layout and CSS'), + '#collapsible' => TRUE, + ); + + // CSS mode + $form['geshifilter_styling']['geshifilter_css_mode'] = array( + '#type' => 'radios', + '#title' => t('CSS mode for syntax highlighting'), + '#options' => array( + GESHIFILTER_CSS_INLINE => t('Inline CSS style attributes.'), + GESHIFILTER_CSS_CLASSES_AUTOMATIC => t('Use CSS classes and an automatically managed external CSS style sheet.'), + GESHIFILTER_CSS_CLASSES_ONLY => t('Only add CSS classes to the markup.'), + ), + '#default_value' => variable_get('geshifilter_css_mode', GESHIFILTER_CSS_INLINE), + '#description' => t('Inline CSS is easier to set up, does not depend on an external style sheets and is consequently more robust to copy/paste operations like content aggregation. However, usage of CSS classes and an external stylesheet requires much less markup code and bandwidth. The external style sheet can be managed automatically by the GeSHi filter module, but this feature requires the public download method. If the GeSHi filter is configured to only add the CSS classes to the markup, the administrator or themer is responsible for adding the appropriate CSS rules to the pages (e.g. based on these defaults). (GeSHi documentation: Using CSS Classes).', + array( + '!geshidoc' => 'http://qbnz.com/highlighter/geshi-doc.html#using-css-classes', + '!filesystem' => url('admin/settings/file-system'), + '!cssdefaults' => url('admin/settings/geshifilter/generate_css'), + )), + ); + + // Code container + $container_options = array( + GESHI_HEADER_PRE => t('%val: uses a @cnt wrapper, efficient whitespace coding, no automatic line wrapping, generates invalid HTML with line numbering.', + array('%val' => 'GESHI_HEADER_PRE', '@cnt' => '
')),
+      GESHI_HEADER_DIV => t('%val: uses a @cnt wrapper, enables automatic line wrapping.',
+        array('%val' => 'GESHI_HEADER_DIV', '@cnt' => '
')), + ); + if (version_compare(GESHI_VERSION, '1.0.8', '>=')) { + $container_options[GESHI_HEADER_PRE_VALID] = t('%val: uses @pre wrappers, ensures valid HTML with line numbering, but generates more markup.', + array('%val' => 'GESHI_HEADER_PRE_VALID', '@pre' => '
', '@li' => '
  • ')); + $container_options[GESHI_HEADER_PRE_TABLE] = t('%val: uses a @table construction for adding line numbers which avoids selection/copy/paste problems.', + array('%val' => 'GESHI_HEADER_PRE_TABLE', '@table' => '')); + } + if (version_compare(GESHI_VERSION, '1.0.7.2', '>=')) { + $container_options[GESHI_HEADER_NONE] = t('%val: uses no wrapper.', + array('%val' => 'GESHI_HEADER_NONE')); + } + + $form['geshifilter_styling']['geshifilter_code_container'] = array( + '#type' => 'radios', + '#title' => t('Code container, wrapping technique'), + '#description' => t('Define the wrapping technique to use for code blocks. (GeSHi documentation: The Code Container).', + array('!link' => 'http://qbnz.com/highlighter/geshi-doc.html#the-code-container') + ), + '#options' => $container_options, + '#default_value' => variable_get('geshifilter_code_container', GESHI_HEADER_PRE), + ); + } + // Make it a system settings form. + $form = system_settings_form($form); + // Set custom validate/submit handlers (to be run after system_settings_form submit). + $form['#validate'][] = 'geshifilter_admin_general_settings_validate'; + $form['#submit'][] = 'geshifilter_admin_general_settings_submit'; + return $form; +} + +/** + * After build function for admin settings + */ +function geshifilter_admin_general_settings_after_build($form, &$form_state) { + $geshi_library = _geshifilter_check_geshi_library(FALSE, $form_state['values']['geshifilter_geshi_dir'], FALSE); + if (!$geshi_library['success']) { + form_set_error('geshifilter_geshi_dir', $geshi_library['message']); + } + return $form; +} + +/** + * Validate function for admin settings + */ +function geshifilter_admin_general_settings_validate($form, &$form_state) { + // Check if automatically managed style sheet is posible + if (isset($form_state['values']['geshifilter_css_mode']) && $form_state['values']['geshifilter_css_mode'] == GESHIFILTER_CSS_CLASSES_AUTOMATIC && !_geshifilter_managed_external_stylesheet_possible()) { + form_set_error('geshifilter_css_mode', t('GeSHi filter can not automatically manage an external CSS style sheet when the download method is private.')); + } +} + +/** + * Submit function for admin settings + */ +function geshifilter_admin_general_settings_submit($form, &$form_state) { + // Cache of available languages should be cleared when GeSHi library dir changes + // _geshifilter_get_geshi_dir() returns the new value set by + // system_settings_form_submit() which runs before + // geshifilter_admin_general_settings_submit(), + // $form['geshifilter_library']['geshifilter_geshi_dir']['#default_value'] is + // the old value + if (_geshifilter_get_geshi_dir() != $form['geshifilter_library']['geshifilter_geshi_dir']['#default_value']) { + variable_del('geshifilter_available_languages_cache'); + } + // Regenerate language_css + // Note the use of variable_get('geshifilter_css_mode') which is alread set + // to $form_state['values']['geshifilter_css_mode'] by + // system_settings_form_submit, which is run before this submit handler. + if (variable_get('geshifilter_css_mode', GESHIFILTER_CSS_INLINE) == GESHIFILTER_CSS_CLASSES_AUTOMATIC) { + _geshifilter_generate_languages_css_file(); + } + // Always clear the filter cache. + _geshifilter_clear_filter_cache(); +} + +/** + * Menu callback for per language settings + */ +function geshifilter_admin_per_language_settings($form_state, $view = 'enabled') { + $form = array(); + // check if GeSHi library is available + $geshi_library = _geshifilter_check_geshi_library(); + if (!$geshi_library['success']) { + drupal_set_message($geshi_library['message'], 'error'); + return; + } + $add_checkbox = TRUE; + $add_tag_option = (!geshifilter_use_format_specific_options()); + $form['language_settings'] = geshifilter_per_language_settings(NULL, $view, $add_checkbox, $add_tag_option); + + // Make it a system settings form. + $form = system_settings_form($form); + + // set custom validate and submit handlers + $form['#validate'][] = 'geshifilter_per_language_settings_validate'; + $form['#submit'][] = 'geshifilter_admin_per_language_settings_submit'; + + return $form; +} + +/** + * Validate function for per language settings + * + * Check that language tags differ between languages and fro the generic tags. + */ +function geshifilter_per_language_settings_validate($form, &$form_state) { + + // if we're coming from the _geshifilter_filter_settings (sub)form, we should + // take the input format into account + $format = isset($form_state['values']['format']) ? $form_state['values']['format'] : NULL; + $f = ($format === NULL) ? '' : "_$format"; + + // language tags should differ from each other + $languages = _geshifilter_get_available_languages(); + foreach ($languages as $language1 => $language_data1) { + // iterate over the enabled languages: skip disabled ones + $field = "geshifilter_language_enabled_{$language1}"; + if (!(isset($form_state['values'][$field]) ? $form_state['values'][$field] : variable_get($field, FALSE))) { + continue; + } + // get the associated tags as $tags1 + $field = "geshifilter_language_tags_{$language1}{$f}"; + if (isset($form_state['values'][$field])) { + $tags1 = _geshifilter_tag_split($form_state['values'][$field]); + } + else { + $tags1 = _geshifilter_tag_split(geshifilter_language_tags($language1, $format)); + } + // also include the generic tags + $field = "geshifilter_tags{$f}"; + $generic_tags = isset($form_state['values'][$field]) ? $form_state['values'][$field] : geshifilter_tags($format); + $tags1 = array_merge($tags1, _geshifilter_tag_split($generic_tags)); + + // check that other languages do not use these tags + foreach ($languages as $language2 => $language_data2) { + // check these tags against the tags of other enabled languages + $field = "geshifilter_language_enabled_{$language2}"; + if ($language1 == $language2 || !(isset($form_state['values'][$field]) ? $form_state['values'][$field] : variable_get($field, FALSE))) { + continue; + } + // get tags for $language2, or skip when not in $form_state['values'] + $field = "geshifilter_language_tags_{$language2}{$f}"; + if (isset($form_state['values'][$field])) { + $tags2 = _geshifilter_tag_split($form_state['values'][$field]); + } + else { + continue; + } + // and now we can check tags1 against tags2 + foreach ($tags1 as $tag1) { + foreach ($tags2 as $tag2) { + if ($tag1 == $tag2) { + form_set_error("geshifilter_language_tags_{$language2}{$f}", t('The language tags should differ between languages and from the generic tags.')); + } + } + } + } + } +} + +/** + * Submit function for per language settings + */ +function geshifilter_admin_per_language_settings_submit($form, &$form_state) { + // regenerate language_css + if (variable_get('geshifilter_css_mode', GESHIFILTER_CSS_INLINE) == GESHIFILTER_CSS_CLASSES_AUTOMATIC) { + _geshifilter_generate_languages_css_file(); + } + _geshifilter_clear_filter_cache(); +} + +/** + * Helper function for some settings form fields usable as general and specific settings + */ +function _geshifilter_general_highlight_tags_settings($format=NULL) { + $form = array(); + $f = ($format === NULL) ? '' : "_$format"; + // generic tags + $form["geshifilter_tags$f"] = array( + '#type' => 'textfield', + '#title' => t('Generic syntax highlighting tags'), + '#default_value' => geshifilter_tags($format), + '#description' => t('Tags that should activate the GeSHi syntax highlighting. Specify a space-separated list of tagnames.'), + ); + // Container tag styles. + $form["geshifilter_tag_styles$f"] = array( + '#type' => 'checkboxes', + '#title' => t('Container tag style'), + '#options' => array( + GESHIFILTER_BRACKETS_ANGLE => ''. check_plain(' ... ') .'', + GESHIFILTER_BRACKETS_SQUARE => ''. check_plain('[foo] ... [/foo]') .'', + GESHIFILTER_BRACKETS_DOUBLESQUARE => ''. check_plain('[[foo]] ... [[/foo]]') .'', + GESHIFILTER_BRACKETS_PHPBLOCK => t('PHP style source code blocks: !php and !percent', array( + '!php' => ''. check_plain(''). '', + '!percent' => ''. check_plain('<% ... %>'). '', + )), + ), + '#default_value' => _geshifilter_tag_styles($format), + '#description' => t('Select the container tag styles that should trigger GeSHi syntax highlighting.'), + ); + return $form; +} + +/** + * function for generating a form table for per language settings + */ +function geshifilter_per_language_settings($format, $view, $add_checkbox, $add_tag_option) { + $form = array( + '#theme' => 'geshifilter_per_language_settings', + ); + // table header + $form['header'] = array( + '#type' => 'value', + '#value' => array(), + ); + $form['header']['#value'][] = t('Language'); + $form['header']['#value'][] = t('GeSHi language code'); + if ($add_tag_option) { + $form['header']['#value'][] = t('Tag/language attribute value'); + } + // table body + $form['languages'] = array(); + $languages = _geshifilter_get_available_languages(); + foreach ($languages as $language => $language_data) { + $enabled = variable_get("geshifilter_language_enabled_{$language}", FALSE); + // skip items to hide + if (($view == 'enabled' && !$enabled) || ($view == 'disabled' && $enabled)) { + continue; + } + // build language row + $form['languages'][$language] = array(); + // add enable/disable checkbox + if ($add_checkbox) { + $form['languages'][$language]["geshifilter_language_enabled_{$language}"] = array( + '#type' => 'checkbox', + '#default_value' => $enabled, + '#title' => $language_data['fullname'], + ); + } + else { + $form['languages'][$language]['fullname'] = array( + '#type' => 'markup', + '#value' => $language_data['fullname'], + ); + } + // language code + $form['languages'][$language]['name'] = array( + '#type' => 'markup', + '#value' => $language, + ); + // add a textfield for tags + if ($add_tag_option) { + $f = ($format === NULL) ? '' : "_$format"; + $form['languages'][$language]["geshifilter_language_tags_{$language}{$f}"] = array( + '#type' => 'textfield', + '#default_value' => geshifilter_language_tags($language, $format), + '#size' => 20, + ); + } + } + return $form; +} + +/** + * theming function for the per language settings table + */ +function theme_geshifilter_per_language_settings($form) { + // build table body + $rows = array(); + foreach (element_children($form['languages']) as $language) { + $row = array(); + foreach (element_children($form['languages'][$language]) as $key) { + $row[] = drupal_render($form['languages'][$language][$key]); + } + $rows[] = $row; + } + // build table header + $header = array(); + foreach ($form['header']['#value'] as $cell) { + if ($cell == t('Enabled')) { + // add JavaScript 'select all/select none' stuff + $header[] = array('data' => $cell) + theme('table_select_header_cell'); + } + else { + $header[] = $cell; + } + } + // return themed table + return theme('table', $header, $rows); +} + +/** + * Helper function for flushing the GeSHi language definition cache + */ +function _geshifilter_flush_language_definition_cache() { + if (GESHIFILTER_CSS_CLASSES_AUTOMATIC == variable_get('geshifilter_css_mode', GESHIFILTER_CSS_INLINE)) { + // Forced regeneration of the CSS file + _geshifilter_generate_languages_css_file(TRUE); + } + // Flush cache of available languages + variable_del('geshifilter_available_languages_cache'); + drupal_set_message(t('Flushed the GeSHi language definition cache.')); +} + +/** + * Helper function for clearing the appropriate filter cache entries + */ +function _geshifilter_clear_filter_cache() { + $message = FALSE; + + // Iterate over input formats and clear the ones GeSHi filter is active in. + foreach (filter_formats() as $format => $input_format) { + // Get the filters in this input format + $filters = filter_list_format($format); + // look if GeSHi is enabled in this input format + if (isset($filters['geshifilter/0'])) { + cache_clear_all($format .':', 'cache_filter', TRUE); + $message = TRUE; + } + } + + // Clear the geshifilter entries in the cache_filter table, + // created by geshifilter_geshi_process(). + cache_clear_all('geshifilter:', 'cache_filter', TRUE); + + // Show a message that the filter cache was cleared. + if ($message) { + drupal_set_message(t('GeSHi filter cleared the filter cache for the appropriate input formats.')); + } +} + +/** + * Helper function for generating the CSS rules + * + * @return string with the CSS rules + */ +function _geshifilter_generate_languages_css_rules() { + $output = ''; + $geshi_library = _geshifilter_check_geshi_library(); + if ($geshi_library['loaded']) { + require_once drupal_get_path('module', 'geshifilter') .'/geshifilter.pages.inc'; + $languages = _geshifilter_get_enabled_languages(); + foreach ($languages as $langcode => $language_full_name) { + // create GeSHi object + $geshi = _geshifilter_GeSHi_factory('', $langcode); + _geshifilter_override_geshi_defaults($geshi, $langcode); + // add CSS rules for current language + $output .= $geshi->get_stylesheet(FALSE) ."\n"; + // release GeSHi object + unset($geshi); + } + } + else { + drupal_set_message(t('Error while generating CSS rules: could not load GeSHi library.'), 'error'); + } + return $output; +} + +/** + * Function for generating the external stylesheet. + * + * @param $force force the regeneration of the CSS file + */ +function _geshifilter_generate_languages_css_file($force=FALSE) { + $languages = _geshifilter_get_enabled_languages(); + // Serialize the array of enabled languages as sort of hash. + $languages_hash = serialize($languages); + + // Check if generation of the CSS file is needed + if ($force || $languages_hash != variable_get('geshifilter_cssfile_languages', '')) { + // Build stylesheet. + $stylesheet = _geshifilter_generate_languages_css_rules(); + // Save stylesheet. + $stylesheet_filename = file_directory_path() .'/geshifilter-languages.css'; + $ret = file_save_data($stylesheet, $stylesheet_filename, FILE_EXISTS_REPLACE); + if ($ret) { + drupal_set_message(t('(Re)generated external CSS style sheet %file.', array('%file' => $ret))); + } + else { + drupal_set_message(t('Could not generate external CSS file. Check the settings of your file system.', + array('!filesystem' => url('admin/settings/file-system'))), 'error'); + } + // Remember for which list of languages the CSS file was generated + variable_set('geshifilter_cssfile_languages', $languages_hash); + } +} diff --git a/sites/all/modules/geshifilter/geshifilter.conflicts.inc b/sites/all/modules/geshifilter/geshifilter.conflicts.inc new file mode 100644 index 0000000..d94bdd9 --- /dev/null +++ b/sites/all/modules/geshifilter/geshifilter.conflicts.inc @@ -0,0 +1,108 @@ + '_geshifilter_htmlfilter_conflicts', + 'codefilter/0' => '_geshifilter_codefilter_conflicts', + ); + foreach (filter_formats() as $format => $input_format) { + // Get the filters in this input format + $filters = filter_list_format($format); + // look if GeSHi is enabled in this input format + if (isset($filters['geshifilter/0'])) { + $geshifilter = $filters['geshifilter/0']; + // Check if possibly conflicting filters are also present in input format + foreach ($conflict_detectors as $filter_key => $conflict_detector) { + // does this filter exist in the input format? + if (array_key_exists($filter_key, $filters)) { + $cfilter = $filters[$filter_key]; + $conflicts = $conflict_detector($format, $cfilter, $geshifilter); + foreach ($conflicts as $conflict) { + $alerts[] = array( + l(t($input_format->name), "admin/settings/filters/$format"), + $cfilter->name, + $conflict['description'], + $conflict['solution'], + ); + } + } + } + } + } + if ($check_only) { + return count($alerts); + } + else { + // show alerts + if (count($alerts) == 0) { + $alerts[] = array(array('data' => t('No known filter conflicts were detected.'), 'colspan' => 4)); + } + $header = array(t('Input format'), t('Filter'), t('Description'), t('Possible solutions')); + $output .= theme('table', $header, $alerts); + return $output; + } +} + +/** + * conflict detection for html filter + */ +function _geshifilter_htmlfilter_conflicts($format, $cfilter, $geshifilter) { + $conflicts = array(); + // check order + if ($cfilter->weight >= $geshifilter->weight) { + $conflicts[] = array( + 'description' => t('%cfilter should not come after %geshifilter to prevent loss of layout and highlighting.', + array('%cfilter' => $cfilter->name, '%geshifilter' => $geshifilter->name)), + 'solution' => l(t('Rearrange filters'), "admin/settings/filters/$format/order"), + ); + } + // check tag escaping of html filter + if (variable_get("filter_html_$format", FILTER_HTML_STRIP) == FILTER_HTML_ESCAPE) { + $conflicts[] = array( + 'description' => t('%cfilter is configured to "Escape all tags", which is likely to cause problems with %geshifilter.', + array('%cfilter' => $cfilter->name, '%geshifilter' => $geshifilter->name)), + 'solution' => l(t('Configure HTML filtering to "Strip disallowed tags"'), "admin/settings/filters/$format/configure", array('html' => TRUE)), + ); + } + return $conflicts; +} + +/** + * Conflict detection for codefilter. + */ +function _geshifilter_codefilter_conflicts($format, $cfilter, $geshifilter) { + $conflicts = array(); + if (in_array(GESHIFILTER_BRACKETS_ANGLE, array_filter(_geshifilter_tag_styles($format)))) { + list($generic_code_tags, $language_tags, $tag_to_lang) = _geshifilter_get_tags($format); + if (in_array('code', $generic_code_tags) || in_array('code', $language_tags)) { + $conflicts[] = array( + 'description' => t('%cfilter and %geshifilter trigger on the same tag "<code>".', + array('%cfilter' => $cfilter->name, '%geshifilter' => $geshifilter->name)), + 'solution' => t('Remove "code" as generic syntax highlighting tag for %geshifilter, limit %geshifilter to tag style "[foo]" only or disable %cfilter', + array('%cfilter' => $cfilter->name, '%geshifilter' => $geshifilter->name)), + ); + } + } + return $conflicts; +} diff --git a/sites/all/modules/geshifilter/geshifilter.css b/sites/all/modules/geshifilter/geshifilter.css new file mode 100644 index 0000000..31571c0 --- /dev/null +++ b/sites/all/modules/geshifilter/geshifilter.css @@ -0,0 +1,63 @@ + +/** + * CSS rules for the general GeSHi filter containers. + * The language specific rules are generated automatically and written to a + * CSS file in the files directory. + */ + + +/* Inline source code. */ +span.geshifilter { + display: inline; + padding: 0; + margin: 0; + border: none; +} + +/* Source code block. */ +div.geshifilter { + display: block; + padding: 0.5em; + margin: 0.5em; + border: 1px solid #ccc; + background-color: #f8f8f8; + color: #222; + line-height: 1.3; + overflow: auto; +} + +/* CSS reset for the 'pre' elements in the geshifilter code blocks. */ +div.geshifilter pre { + margin: 0; + padding: 0; + line-height: 1.3; +} + +/* CSS resets for 'ol'-based line numbering. */ +div.geshifilter ol { + margin: 0; + /* Left padding is for keeping space for the line numbers. */ + padding: 0 0 0 4em; + list-style-position: outside; + list-style-type: decimal; + line-height: 1.3; +} + +div.geshifilter li { + margin: 0; + padding: 0; + line-height: 1.3; +} + +/* CSS resets for the table elements in GESHI_HEADER_PRE_TABLE mode. */ +div.geshifilter table, div.geshifilter tbody, div.geshifilter tr, div.geshifilter td { + margin: 0; + padding: 0; + border-style: none; +} + +div.geshifilter-title { + padding: 0.5ex 0.5em; + margin: 0.5em 0.5em -0.5em 0.5em; + background-color: #ccc; +} diff --git a/sites/all/modules/geshifilter/geshifilter.filtertips.inc b/sites/all/modules/geshifilter/geshifilter.filtertips.inc new file mode 100644 index 0000000..8c0c164 --- /dev/null +++ b/sites/all/modules/geshifilter/geshifilter.filtertips.inc @@ -0,0 +1,207 @@ +'); + } + $tag_style_examples[] = ''. check_plain('') .''; + } + if (in_array(GESHIFILTER_BRACKETS_SQUARE, $tag_styles)) { + if (!$bracket_open) { + $bracket_open = check_plain('['); + $bracket_close = check_plain(']'); + } + $tag_style_examples[] = ''. check_plain('[foo]') .''; + } + if (in_array(GESHIFILTER_BRACKETS_DOUBLESQUARE, $tag_styles)) { + if (!$bracket_open) { + $bracket_open = check_plain('[['); + $bracket_close = check_plain(']]'); + } + $tag_style_examples[] = ''. check_plain('[[foo]]') .''; + } + if (!$bracket_open) { + drupal_set_message(t('Could not determine a valid tag style for GeSHi filtering.'), 'error'); + $bracket_open = check_plain('<'); + $bracket_close = check_plain('>'); + } + + if ($long) { + // get the available tags + list($generic_code_tags, $language_tags, $tag_to_lang) = _geshifilter_get_tags($format); + // get the available languages + $languages = _geshifilter_get_enabled_languages(); + $lang_attributes = _geshifilter_whitespace_explode(GESHIFILTER_ATTRIBUTES_LANGUAGE); + + // syntax highlighting tags + $output = '

    '. t('Syntax highlighting of source code can be enabled with the following tags:') .'

    '; + $items = array(); + // generic tags + $tags = array(); + foreach ($generic_code_tags as $tag) { + $tags[] = '"'. $bracket_open . $tag . $bracket_close .'"'; + } + $items[] = t('Generic syntax highlighting tags: !tags.', array('!tags' => implode(', ', $tags))); + // language tags + $tags = array(); + foreach ($language_tags as $tag) { + $tags[] = t('"!tag" for @lang source code', array( + '!tag' => $bracket_open . $tag . $bracket_close, + '@lang' => $languages[$tag_to_lang[$tag]]) + ); + } + $items[] = t('Language specific syntax highlighting tags: !tags.', array('!tags' => implode(', ', $tags))); + // PHP specific delimiters + if (in_array(GESHIFILTER_BRACKETS_PHPBLOCK, $tag_styles)) { + $items[] = t('PHP source code can also be enclosed in <?php ... ?> or <% ... %>, but additional options like line numbering are not possible here.'); + } + + $output .= theme('item_list', $items); + + // Options and tips + $output .= '

    '. t('Options and tips:') .'

    '; + $items = array(); + + // info about language attribute to language mapping + $att_to_full = array(); + foreach ($languages as $langcode => $fullname) { + $att_to_full[$langcode] = $fullname; + } + foreach ($tag_to_lang as $tag => $lang) { + $att_to_full[$tag] = $languages[$lang]; + } + ksort($att_to_full); + $att_for_full = array(); + foreach ($att_to_full as $att => $fullname) { + $att_for_full[] = t('"@langcode" (for @fullname)', array('@langcode' => $att, '@fullname' => $fullname)); + } + $items[] = t('The language for the generic syntax highlighting tags can be specified with one of the attribute(s): %attributes. The possible values are: !languages.', array('%attributes' => implode(', ', $lang_attributes), '!languages' => implode(', ', $att_for_full))); + + // Tag style options. + if (count($tag_style_examples) > 1) { + $items[] = t('The supported tag styles are: !tag_styles.' , array('!tag_styles' => implode(', ', $tag_style_examples))); + } + + // line numbering options + $items[] = t('Line numbering can be enabled/disabled with the attribute "%linenumbers". Possible values are: "%off" for no line numbers, "%normal" for normal line numbers and "%fancy" for fancy line numbers (every nth line number highlighted). The start line number can be specified with the attribute "%start", which implicitly enables normal line numbering. For fancy line numbering the interval for the highlighted line numbers can be specified with the attribute "%fancy", which implicitly enables fancy line numbering.', array('%linenumbers' => GESHIFILTER_ATTRIBUTE_LINE_NUMBERING, '%off' => 'off', '%normal' => 'normal', '%fancy' => 'fancy', '%start' => GESHIFILTER_ATTRIBUTE_LINE_NUMBERING_START, '%fancy' => GESHIFILTER_ATTRIBUTE_FANCY_N)); + + // block versus inline + $items[] = t('If the source code between the tags contains a newline (e.g. immediatly after the opening tag), the highlighted source code will be displayed as a code block. Otherwise it will be displayed inline.'); + + // Code block title + $items[] = t('A title can be added to a code block with the attribute "%title".', array( + '%title' => GESHIFILTER_ATTRIBUTE_TITLE, + )); + + + $output .= theme('item_list', $items); + + // Defaults + $output .= '

    '. t('Defaults:') .'

    '; + $items = array(); + $default_highlighting = variable_get('geshifilter_default_highlighting', GESHIFILTER_DEFAULT_PLAINTEXT); + switch ($default_highlighting) { + case GESHIFILTER_DEFAULT_DONOTHING: + $description = t('when no language attribute is specified the code block won\'t be processed by the GeSHi filter'); + break; + case GESHIFILTER_DEFAULT_PLAINTEXT: + $description = t('when no language attribute is specified, no syntax highlighting will be done'); + break; + default: + $description = t('the default language used for syntax highlighting is "%default_lang"', array('%default_lang' => $default_highlighting)); + break; + } + $items[] = t('Default highlighting mode for generic syntax highlighting tags: !description.', array('!description' => $description)); + $default_line_numbering = variable_get('geshifilter_default_line_numbering', GESHIFILTER_LINE_NUMBERS_DEFAULT_NONE); + switch ($default_line_numbering) { + case GESHIFILTER_LINE_NUMBERS_DEFAULT_NONE: + $description = t('no line numbers'); + break; + case GESHIFILTER_LINE_NUMBERS_DEFAULT_NORMAL: + $description = t('normal line numbers'); + break; + default: + $description = t('fancy line numbers (every @n lines)', array('@n' => $default_line_numbering)); + break; + } + $items[] = t('Default line numbering: !description.', array('!description' => $description)); + $output .= theme('item_list', $items); + + // Examples + $output .= '

    '. t('Examples:') .'

    '; + $header = array(t('You type'), t('You get')); + $rows = array(); + if (count($generic_code_tags)) { + $generic_code_tag = $generic_code_tags[0]; + $lang = array_rand($languages); + $generic_code_tag_open = $bracket_open . $generic_code_tag; + $generic_code_tag_close = $bracket_open .'/'. $generic_code_tag . $bracket_close; + $rows[] = array( + ''. $generic_code_tag_open . $bracket_close .'foo = "bar";'. $generic_code_tag_close .'', + t('Inline code with the default syntax highlighting mode.'), + ); + $rows[] = array( + ''. $generic_code_tag_open . $bracket_close .'
    foo = "bar";
    baz = "foz";
    '. $generic_code_tag_close .'
    ', + t('Code block with the default syntax highlighting mode.'), + ); + $rows[] = array( + ''. $generic_code_tag_open .' '. $lang_attributes[1 % count($lang_attributes)] .'="'. $lang .'" '. GESHIFILTER_ATTRIBUTE_LINE_NUMBERING .'="normal"'. $bracket_close .'
    foo = "bar";
    baz = "foz";
    '. $generic_code_tag_close .'
    ', + t('Code block with syntax highlighting for @lang source code
    and normal line numbers.', array('@lang' => $languages[$lang])), + ); + $rows[] = array( + ''. $generic_code_tag_open .' '. $lang_attributes[2 % count($lang_attributes)] .'="'. $lang .'" '. GESHIFILTER_ATTRIBUTE_LINE_NUMBERING_START .'="23" '. GESHIFILTER_ATTRIBUTE_FANCY_N .'="7"'. $bracket_close .'
    foo = "bar";
    baz = "foz";
    '. $generic_code_tag_close .'
    ', + t('Code block with syntax highlighting for @lang source code,
    line numbers starting from 23
    and highlighted line numbers every 7th line.', array('@lang' => $languages[$lang])), + ); + } + if (count($language_tags)) { + $language_tag = $language_tags[0]; + $rows[] = array( + ''. $bracket_open . $language_tag . $bracket_close .'
    foo = "bar";
    baz = "foz";
    '. $bracket_open .'/'. $language_tag . $bracket_close .'
    ', + t('Code block with syntax highlighting for @lang source code.', array('@lang' => $languages[$tag_to_lang[$language_tag]])), + ); + $rows[] = array( + ''. $bracket_open . $language_tag .' '. GESHIFILTER_ATTRIBUTE_LINE_NUMBERING_START .'="23" '. GESHIFILTER_ATTRIBUTE_FANCY_N .'="7"'. $bracket_close .'
    foo = "bar";
    baz = "foz";
    '. $bracket_open . $language_tag . $bracket_close .'
    ', + t('Code block with syntax highlighting for @lang source code,
    line numbers starting from 23
    and highlighted line numbers every 7th line.', array('@lang' => $languages[$tag_to_lang[$language_tag]])), + ); + } + $output .= theme('table', $header, $rows); + return $output; + } + else { + // get the available tags + list($generic_code_tags, $language_tags, $tag_to_lang) = _geshifilter_get_tags($format); + $tags = array(); + foreach ($generic_code_tags as $tag) { + $tags[] = ''. $bracket_open . $tag . $bracket_close .''; + } + foreach ($language_tags as $tag) { + $tags[] = ''. $bracket_open . $tag . $bracket_close .''; + } + $output = t('You can enable syntax highlighting of source code with the following tags: !tags.', array('!tags' => implode(', ', $tags))); + // Tag style options. + if (count($tag_style_examples) > 1) { + $output .= ' '. t('The supported tag styles are: !tag_styles.' , array('!tag_styles' => implode(', ', $tag_style_examples))); + } + if (in_array(GESHIFILTER_BRACKETS_PHPBLOCK, $tag_styles)) { + $output .= ' '. t('PHP source code can also be enclosed in <?php ... ?> or <% ... %>.'); + } + return $output; + } +} diff --git a/sites/all/modules/geshifilter/geshifilter.inc b/sites/all/modules/geshifilter/geshifilter.inc new file mode 100644 index 0000000..2b5ec1c --- /dev/null +++ b/sites/all/modules/geshifilter/geshifilter.inc @@ -0,0 +1,189 @@ + NULL, 'loaded' => FALSE, 'message' => NULL); + // no cache + if (!$geshi_dir) { + $geshi_dir = _geshifilter_get_geshi_dir(); + } + if (!is_dir($geshi_dir)) { + $geshi_library['success'] = FALSE; + $geshi_library['message'] = t('GeSHi library error: %dir is not a directory.', array('%dir' => $geshi_dir)); + } + elseif (is_file($geshi_dir .'/geshi.php')) { + // GeSHi 1.0.x found (probably, we can only be sure by loading it) + $geshi_library['success'] = TRUE; + if ($load_when_found) { + require_once($geshi_dir .'/geshi.php'); + // check version + $geshi_library_version = explode('.', GESHI_VERSION); + if (!($geshi_library_version[0] == '1' && $geshi_library_version[1] == '0')) { + $geshi_library['success'] = FALSE; + $geshi_library['loaded'] = FALSE; + $geshi_library['message'] = t('GeSHi library error: The detected version of GeSHi library (%version) is not supported. A version from the 1.0.x branch is required.', array('%version' => GESHI_VERSION)); + } + else { + $geshi_library['loaded'] = TRUE; + } + } + } + else { + $geshi_library['success'] = FALSE; + $geshi_library['message'] = t('GeSHi library error: Could not find a known version of the GeSHi library in directory %dir.' , array('%dir' => $geshi_dir)); + } + // store in cache if needed + if ($use_cache) { + $geshi_library_cache = $geshi_library; + } + } + return $geshi_library; +} + +/** + * List of available languages. + * @return an array mapping language code to array with the language path and full language name + */ +function _geshifilter_get_available_languages() { + // try to get it from cache (database actually) + $available_languages = variable_get('geshifilter_available_languages_cache', NULL); + if ($available_languages === NULL) { + // not in cache: build the array of available_languages + $geshi_library = _geshifilter_check_geshi_library(); + $available_languages = array(); + if ($geshi_library['success']) { + $dirs = array(_geshifilter_get_geshi_dir() .'/geshi', drupal_get_path('module', 'geshifilter') .'/geshi-extra'); + foreach ($dirs as $dir) { + foreach (file_scan_directory($dir, '\.[pP][hH][pP]$') as $filename => $fileinfo) { + // short name + $name = $fileinfo->name; + // get full name + $geshi = new GeSHi('', $name); + $geshi->set_language_path($dir); + $fullname = $geshi->get_language_name(); + unset($geshi); + // store + $available_languages[$name] = array('language_path' => $dir, 'fullname' => $fullname); + } + } + ksort($available_languages); + // save array to database + variable_set('geshifilter_available_languages_cache', $available_languages); + } + } + return $available_languages; +} + +/** + * List of enabled languages. + * (with caching) + * @return array with enabled languages mapping language code to full name. + */ +function _geshifilter_get_enabled_languages() { + static $enabled_languages = NULL; + if ($enabled_languages === NULL) { + $enabled_languages = array(); + $languages = _geshifilter_get_available_languages(); + foreach ($languages as $language => $language_data) { + if (variable_get('geshifilter_language_enabled_'. $language, FALSE)) { + $enabled_languages[$language] = $language_data['fullname']; + } + } + } + return $enabled_languages; +} + +/** + * Helper function for gettings the tags + * (with caching) + */ +function _geshifilter_get_tags($format) { + static $geshifilter_tags_cache = array(); + if (!isset($geshifilter_tags_cache[$format])) { + $generic_code_tags = _geshifilter_tag_split(geshifilter_tags($format)); + $language_tags = array(); + $tag_to_lang = array(); + $enabled_languages = _geshifilter_get_enabled_languages(); + foreach ($enabled_languages as $language => $fullname) { + $lang_tags = _geshifilter_tag_split(geshifilter_language_tags($language, $format)); + foreach ($lang_tags as $lang_tag) { + $language_tags[] = $lang_tag; + $tag_to_lang[$lang_tag] = $language; + } + } + $geshifilter_tags_cache[$format] = array($generic_code_tags, $language_tags, $tag_to_lang); + } + return $geshifilter_tags_cache[$format]; +} + +/** + * helper function for generating a GeSHi object + * @param $language the language to generate a GeSHi object for + */ +function _geshifilter_geshi_factory($source_code, $language) { + $available_languages = _geshifilter_get_available_languages(); + $geshi = new GeSHi($source_code, $language); + $geshi->set_language_path($available_languages[$language]['language_path']); + return $geshi; +} + +/** + * Helper function for splitting a string on white spaces. + * Using explode(' ', $string) is not enough because it returns empty elements + * if $string contains consecutive spaces. + */ +function _geshifilter_whitespace_explode($string) { + return preg_split('/\s+/', $string, -1, PREG_SPLIT_NO_EMPTY); +} + +function _geshifilter_tag_split($string) { + return preg_split('/\s+|<|>|\[|\]/', $string, -1, PREG_SPLIT_NO_EMPTY); +} + +// General settings +function geshifilter_use_format_specific_options() { + return variable_get('geshifilter_format_specific_options', FALSE); +} + +function geshifilter_tags($format = NULL) { + if (!geshifilter_use_format_specific_options() || $format === NULL) { + return variable_get('geshifilter_tags', 'code blockcode'); + } + return variable_get("geshifilter_tags_{$format}", geshifilter_tags()); +} + +function _geshifilter_tag_styles($format = NULL) { + if (!geshifilter_use_format_specific_options() || $format === NULL) { + return variable_get('geshifilter_tag_styles', array( + GESHIFILTER_BRACKETS_ANGLE => GESHIFILTER_BRACKETS_ANGLE, + GESHIFILTER_BRACKETS_SQUARE => GESHIFILTER_BRACKETS_SQUARE, + )); + } + return variable_get("geshifilter_tag_styles_{$format}", _geshifilter_tag_styles()); +} + +function geshifilter_language_tags($language, $format = NULL) { + if (!geshifilter_use_format_specific_options() || $format === NULL) { + return variable_get("geshifilter_language_tags_{$language}", ''); + } + return variable_get("geshifilter_language_tags_{$language}_{$format}", geshifilter_language_tags($language)); +} diff --git a/sites/all/modules/geshifilter/geshifilter.info b/sites/all/modules/geshifilter/geshifilter.info new file mode 100644 index 0000000..a2c6599 --- /dev/null +++ b/sites/all/modules/geshifilter/geshifilter.info @@ -0,0 +1,11 @@ +name = "GeSHi Filter" +description = "Provides a filter to highlight source code using the GeSHi library (Generic Syntax Highlighter)" +package = "Filters" +core = 6.x + +; Information added by drupal.org packaging script on 2013-03-18 +version = "6.x-1.5" +core = "6.x" +project = "geshifilter" +datestamp = "1363644611" + diff --git a/sites/all/modules/geshifilter/geshifilter.install b/sites/all/modules/geshifilter/geshifilter.install new file mode 100644 index 0000000..aa1f776 --- /dev/null +++ b/sites/all/modules/geshifilter/geshifilter.install @@ -0,0 +1,143 @@ +'); + } + + // what to do next? + drupal_set_message(t('GeSHi filter is installed. You should now configure the GeSHi filter and enable it in the desired input formats.', + array('!geshi_admin' => url('admin/settings/geshifilter'), '!input_formats' => url('admin/settings/filters')) + )); +} + +/** + * On uninstall: remove module variables and clear variable cache + */ +function geshifilter_uninstall() { + db_query("DELETE FROM {variable} WHERE name LIKE 'geshifilter_%'"); + cache_clear_all('variables', 'cache'); +} + +/** + * Implementation of hook_update_N(). + */ +function geshifilter_update_1() { + // clear the cache of available languages + variable_del('geshifilter_available_languages'); + return array(); +} + +/** + * Implementation of hook_update_N(). + * + * Upgrade path from usage of geshifilter_brackets variable + * to geshifilter_tag_styles variable. + */ +function geshifilter_update_6001() { + _geshifilter_update_6001_brackets_to_tag_styles(NULL); + foreach (filter_formats() as $format => $input_format) { + _geshifilter_update_6001_brackets_to_tag_styles($format); + } + return array(); +} + +/** + * Helper function for updating the old geshifilter_brackets variables + * to geshifilter_tag_styles variables. + * @param $format NULL (for global variable) or input format id. + */ +function _geshifilter_update_6001_brackets_to_tag_styles($format) { + // Make $format a suffix for usage in variable name. + $format = isset($format) ? "_{$format}" : ''; + // Try to fetch the variable value and convert it if found. + $geshifilter_brackets = variable_get('geshifilter_brackets'. $format, NULL); + if (isset($geshifilter_brackets)) { + switch ($geshifilter_brackets) { + case GESHIFILTER_BRACKETS_ANGLE: + case GESHIFILTER_BRACKETS_SQUARE: + variable_set('geshifilter_tag_styles'. $format, array( + $geshifilter_brackets => $geshifilter_brackets + )); + break; + case GESHIFILTER_BRACKETS_BOTH: + variable_set('geshifilter_tag_styles'. $format, array( + GESHIFILTER_BRACKETS_ANGLE => GESHIFILTER_BRACKETS_ANGLE, + GESHIFILTER_BRACKETS_SQUARE => GESHIFILTER_BRACKETS_SQUARE, + )); + break; + } + // Remove old variable. + variable_del('geshifilter_brackets'. $format); + } +} + +/** + * Implementation of hook_update_N(). + * + * Upgrade path for merging of geshifilter_enable_php_delimiters + * into to the geshifilter_tag_styles variable. + */ +function geshifilter_update_6002() { + _geshifilter_update_6002_php_delimter_into_tag_styles(NULL); + foreach (filter_formats() as $format => $input_format) { + _geshifilter_update_6002_php_delimter_into_tag_styles($format); + } + return array(); +} + +/** + * Helper function for merging old geshifilter_enable_php_delimiters + * into geshifilter_tag_styles variables. + * @param $format NULL (for global variable) or input format id. + */ +function _geshifilter_update_6002_php_delimter_into_tag_styles($format) { + // Load geshifilter.inc because we need _geshifilter_tag_styles(). + require_once drupal_get_path('module', 'geshifilter') .'/geshifilter.inc'; + + // Make $format a suffix for usage in variable name. + $format = isset($format) ? "_{$format}" : ''; + // Try to fetch the variable value and convert it if found. + $geshifilter_enable_php_delimiters = variable_get('geshifilter_enable_php_delimiters'. $format, NULL); + if (isset($geshifilter_enable_php_delimiters)) { + // First get the current value of the geshifilter_tag_styles variable. + $geshifilter_brackets = _geshifilter_tag_styles($format); + // Insert value for PHP style code blocks + if ($geshifilter_enable_php_delimiters) { + $geshifilter_brackets[GESHIFILTER_BRACKETS_PHPBLOCK] = GESHIFILTER_BRACKETS_PHPBLOCK; + } + else { + $geshifilter_brackets[GESHIFILTER_BRACKETS_PHPBLOCK] = 0; + } + // Save the new settings. + variable_set('geshifilter_tag_styles'. $format, $geshifilter_brackets); + // Remove old variable. + variable_del('geshifilter_enable_php_delimiters'. $format); + } +} + +/** + * Implementation of hook_update_N(). + * + * (Re)generate the languages CSS file to be sure it exists. + * (References: http://drupal.org/node/269140, http://drupal.org/node/682068) + */ +function geshifilter_update_6003() { + if (GESHIFILTER_CSS_CLASSES_AUTOMATIC == variable_get('geshifilter_css_mode', GESHIFILTER_CSS_INLINE)) { + require_once drupal_get_path('module', 'geshifilter') .'/geshifilter.admin.inc'; + _geshifilter_generate_languages_css_file(); + } + return array(); +} + diff --git a/sites/all/modules/geshifilter/geshifilter.js b/sites/all/modules/geshifilter/geshifilter.js new file mode 100644 index 0000000..e69de29 diff --git a/sites/all/modules/geshifilter/geshifilter.module b/sites/all/modules/geshifilter/geshifilter.module new file mode 100644 index 0000000..5ca3f83 --- /dev/null +++ b/sites/all/modules/geshifilter/geshifilter.module @@ -0,0 +1,281 @@ +'. t('The GeSHi filter module provides a filter for syntax highlighting of inline source code or blocks of source code based on the PHP library !GeSHi.', array('!GeSHi' => l('GeSHi (Generic Syntax Highlighter)', 'http://qbnz.com/highlighter/'))) .'

    '; + if ($path == 'admin/help#geshifilter') { + $output .= '

    '. t('The GeSHi filter module for Drupal requires the GeSHi library (version 1.0.x) to work. The GeSHi filter is actually just a Drupal wrapper module around the GeSHi library. Because of drupal.org repository policies however, the GeSHi library is not included in the GeSHi filter package, so you should download and install the GeSHi library separately.', array( + '!repositorypolicies' => url('http://drupal.org/node/66113'), + '!geshi' => url('http://qbnz.com/highlighter/'), + )) .'

    '; + $output .= t('

    Quick overview of how to set up and use the GeSHi filter:

    ', array( + '!geshifilter_settings' => url('admin/settings/geshifilter'), + '!geshifilter_languages' => url('admin/settings/geshifilter/languages/all'), + '!inputformats' => l(t('input formats'), 'admin/settings/filters'), + '!filterconflicts' => l(t('filter conflicts'), 'admin/settings/geshifilter/filterconflicts'), + '!filtertips' => l(t('filter tips'), 'filter/tips'), + )); + } + return $output; + break; + case 'admin/settings/geshifilter/languages': + case 'admin/settings/geshifilter/languages/enabled': + case 'admin/settings/geshifilter/languages/all': + case 'admin/settings/geshifilter/languages/disabled': + $output = '

    '. t('Here you can enable/disable the desired languages to use. It is suggested to disable languages that are not relevant for you site not only to avoid unnecessary cluttering of the GeSHi filter configuration pages and the !filtertips, but also to make the GeSHi filter processing lighter.', array('!filtertips' => l(t('filter tips'), 'filter/tips'))) .'

    '; + if (!geshifilter_use_format_specific_options()) { + $output .= '

    '. t('You can also define the language specific tags here.') .'

    '; + } + return $output; + break; + } +} + +/** + * Implementation of hook_menu(). + */ +function geshifilter_menu() { + $items = array(); + $items['admin/settings/geshifilter'] = array( + 'title' => 'GeSHi Filter', + 'description' => 'Configure the GeSHi filter.', + 'file' => 'geshifilter.admin.inc', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('geshifilter_admin_general_settings'), + 'access arguments' => array('administer site configuration'), + 'type' => MENU_NORMAL_ITEM, + ); + $items['admin/settings/geshifilter/general'] = array( + 'title' => 'General settings', + 'description' => 'General GeSHi filter settings.', + 'access arguments' => array('administer site configuration'), + 'type' => MENU_DEFAULT_LOCAL_TASK, + ); + $items['admin/settings/geshifilter/filterconflicts'] = array( + 'title' => 'Filter conflicts', + 'description' => 'Information on possible conflicts with other filters.', + 'file' => 'geshifilter.conflicts.inc', + 'page callback' => 'geshifilter_admin_filter_conflicts', + 'access arguments' => array('administer site configuration'), + 'type' => MENU_LOCAL_TASK, + 'weight' => 10, + ); + // language settings + $items['admin/settings/geshifilter/languages'] = array( + 'title' => 'Languages', + 'description' => 'Enable the desired languages and configure their settings.', + 'file' => 'geshifilter.admin.inc', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('geshifilter_admin_per_language_settings'), + 'access arguments' => array('administer site configuration'), + 'type' => MENU_LOCAL_TASK, + ); + $items['admin/settings/geshifilter/languages/enabled'] = array( + 'title' => 'Enabled', + 'description' => 'Show the enabled languages', + 'access arguments' => array('administer site configuration'), + 'type' => MENU_DEFAULT_LOCAL_TASK, + 'weight' => 3, + ); + $items['admin/settings/geshifilter/languages/all'] = array( + 'title' => 'All', + 'description' => 'Show all the available languages', + 'page arguments' => array('geshifilter_admin_per_language_settings', 4), + 'access arguments' => array('administer site configuration'), + 'type' => MENU_LOCAL_TASK, + 'weight' => 1, + ); + $items['admin/settings/geshifilter/languages/disabled'] = array( + 'title' => 'Disabled', + 'description' => 'Show the disabled languages', + 'page arguments' => array('geshifilter_admin_per_language_settings', 4), + 'access arguments' => array('administer site configuration'), + 'type' => MENU_LOCAL_TASK, + 'weight' => 6, + ); + // Callback for generating CSS rules. + $items['admin/settings/geshifilter/generate_css'] = array( + 'page callback' => 'geshifilter_generate_language_css_rules', + 'access arguments' => array('administer site configuration'), + 'type' => MENU_CALLBACK, + ); + + return $items; +} + + +/** + * Implementation of hook_init(). + */ +function geshifilter_init() { + // Since the filtered content is cached, it is not possible to know on which + // pages the css file is actually needed. Thus it is included on all pages. + if (variable_get('geshifilter_css_mode', GESHIFILTER_CSS_INLINE) == GESHIFILTER_CSS_CLASSES_AUTOMATIC) { + drupal_add_css(file_directory_path() .'/geshifilter-languages.css'); + } + drupal_add_css(drupal_get_path('module', 'geshifilter') .'/geshifilter.css'); +} + +/** + * Implementation of hook_filter_tips(). + */ +function geshifilter_filter_tips($delta, $format, $long = FALSE) { + require_once drupal_get_path('module', 'geshifilter') .'/geshifilter.filtertips.inc'; + return _geshifilter_filter_tips($delta, $format, $long); +} + +/** + * Implementation of hook_filter(). + */ +function geshifilter_filter($op, $delta = 0, $format = -1, $text = '') { + switch ($op) { + case 'list': + return array('GeSHi filter'); + + case 'description': + return t('Enables syntax highlighting of inline/block source code using the GeSHi engine'); + + case 'prepare': + require_once drupal_get_path('module', 'geshifilter') .'/geshifilter.pages.inc'; + return _geshifilter_prepare($format, $text); + + case 'process': + require_once drupal_get_path('module', 'geshifilter') .'/geshifilter.pages.inc'; + return _geshifilter_process($format, $text); + + case 'settings': + require_once drupal_get_path('module', 'geshifilter') .'/geshifilter.admin.inc'; + return _geshifilter_filter_settings($format); + + case 'no cache': + return FALSE; + + default: + return $text; + } +} + +/** + * Implementation of hook_theme(). + */ +function geshifilter_theme() { + return array( + 'geshifilter_per_language_settings' => array( + 'arguments' => array('form' => NULL) + ) + ); +} + +/** + * Implementation of hook_requirements(). + */ +function geshifilter_requirements($phase) { + $requirements = array(); + if ($phase == 'runtime') { + require_once drupal_get_path('module', 'geshifilter') .'/geshifilter.inc'; + // check if GeSHi library is available + $geshi_library = _geshifilter_check_geshi_library(); + if (!$geshi_library['loaded']) { + $requirements[] = array( + 'title' => 'GeSHi filter', + 'value' => t('GeSHi library not found.'), + 'description' => t('You should install the GeSHi library and set its path in the GeSHi settings.', + array('!geshisettings' => url('admin/settings/geshifilter'))), + 'severity' => REQUIREMENT_ERROR, + ); + } + else { + $requirements[] = array( + 'title' => 'GeSHi filter', + 'value' => t('Found GeSHi library version %version', + array('%version' => GESHI_VERSION)), // GESHI_VERSION is defined in GeSHi library + 'severity' => REQUIREMENT_OK, + ); + } + + // Warn if GeSHi filter is configured to automatically managed external stylesheet when it's not possible + if (variable_get('geshifilter_css_mode', GESHIFILTER_CSS_INLINE) == GESHIFILTER_CSS_CLASSES_AUTOMATIC && !_geshifilter_managed_external_stylesheet_possible()) { + $requirements[] = array( + 'title' => 'GeSHi filter CSS mode', + 'value' => t('GeSHi filter can not automatically manage an external style sheet when the download method is private.'), + 'severity' => REQUIREMENT_ERROR, + 'description' => t('Change the CSS mode of the GeSHi filter or change the download mode to public.', + array('!geshi' => url('admin/settings/geshifilter'), '!filesystem' => url('admin/settings/file-system'))), + ); + } + + // check for filter conflicts + require_once drupal_get_path('module', 'geshifilter') .'/geshifilter.conflicts.inc'; + if (geshifilter_admin_filter_conflicts(TRUE) > 0) { + $requirements[] = array( + 'title' => 'GeSHi filter', + 'value' => t('Some filter conflicts were detected.'), + 'description' => l(t('View and resolve the detected filter conflicts'), 'admin/settings/geshifilter/filterconflicts'), + 'severity' => REQUIREMENT_ERROR, + ); + } + } + return $requirements; +} + + +/** + * Helper function for checking if an automatically managed style sheet is possible + * + * @return boolean indicating if an automatically managed style sheet is possible + */ +function _geshifilter_managed_external_stylesheet_possible() { + $directory = file_directory_path(); + return is_dir($directory) && is_writable($directory) && (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PUBLIC); +} + +/** + * Callback function for generating the CSS rules for the syntax highlighting + */ +function geshifilter_generate_language_css_rules() { + require_once drupal_get_path('module', 'geshifilter') .'/geshifilter.admin.inc'; + drupal_set_header("Content-type: text/css"); + $output = _geshifilter_generate_languages_css_rules(); + print($output); + exit(); +} diff --git a/sites/all/modules/geshifilter/geshifilter.pages.inc b/sites/all/modules/geshifilter/geshifilter.pages.inc new file mode 100644 index 0000000..5a561bf --- /dev/null +++ b/sites/all/modules/geshifilter/geshifilter.pages.inc @@ -0,0 +1,413 @@ + $att_name) { + // get attribute value + $att_value = $attribute_matches[2][$a_key]; + + // Check for the language attributes. + if (in_array($att_name, $language_attributes)) { + // Try first to map the attribute value to geshi language code. + if (in_array($att_value, $language_tags)) { + $att_value = $tag_to_lang[$att_value]; + } + // Set language if extracted language is an enabled language. + if (array_key_exists($att_value, $enabled_languages)) { + $lang = $att_value; + } + } + + // Check for line numbering related attributes. + // $line_numbering defines the line numbering mode: + // 0: no line numbering + // 1: normal line numbering + // n>= 2: fancy line numbering every nth line + elseif ($att_name == GESHIFILTER_ATTRIBUTE_LINE_NUMBERING) { + switch (strtolower($att_value)) { + case "off": + $line_numbering = 0; + break; + case "normal": + $line_numbering = 1; + break; + case "fancy": + $line_numbering = 5; + break; + } + } + elseif ($att_name == GESHIFILTER_ATTRIBUTE_FANCY_N) { + $att_value = (int)($att_value); + if ($att_value >= 2) { + $line_numbering = $att_value; + } + } + elseif ($att_name == GESHIFILTER_ATTRIBUTE_LINE_NUMBERING_START) { + if ($line_numbering < 1) { + $line_numbering = 1; + } + $linenumbers_start = (int)($att_value); + } + elseif ($att_name == GESHIFILTER_ATTRIBUTE_TITLE) { + $title = $att_value; + } + } + // Return parsed results. + return array('language' => $lang, 'line_numbering' => $line_numbering, 'linenumbers_start' => $linenumbers_start, 'title' => $title); +} + +/** + * geshifilter_filter callback for preparing input text. + */ +function _geshifilter_prepare($format, $text) { + // get the available tags + list($generic_code_tags, $language_tags, $tag_to_lang) = _geshifilter_get_tags($format); + $tags = array_merge($generic_code_tags, $language_tags); + // escape special (regular expression) characters in tags (for tags like 'c++' and 'c#') + $tags = preg_replace('#(\\+|\\#)#', '\\\\$1', $tags); + $tags_string = implode('|', $tags); + // Pattern for matching "..." like stuff + // Also matches "...$" where "$" refers to end of string, not end of + // line (because PCRE_MULTILINE (modifier 'm') is not enabled), so matching + // still works when teaser view trims inside the source code. + + // Replace the code container tag brackets + // and prepare the container content (newline and angle bracket protection). + // @todo: make sure that these replacements can be done in series. + $tag_styles = array_filter(_geshifilter_tag_styles($format)); + if (in_array(GESHIFILTER_BRACKETS_ANGLE, $tag_styles)) { + // Prepare .. blocks. + $pattern = '#(<)('. $tags_string .')((\s+[^>]*)*)(>)(.*?)(|$)#s'; + $text = preg_replace_callback($pattern, create_function('$match', "return _geshifilter_prepare_callback(\$match, $format);"), $text); + } + if (in_array(GESHIFILTER_BRACKETS_SQUARE, $tag_styles)) { + // Prepare [foo]..[/foo] blocks. + $pattern = '#((? blocks. + $pattern = '#[\[<](\?php|\?PHP|%)(.+?)((\?|%)[\]>]|$)#s'; + $text = preg_replace_callback($pattern, '_geshifilter_prepare_php_callback', $text); + } + return $text; +} + +/** + * _geshifilter_prepare callback for preparing input text. + * Replaces the code tags brackets with geshifilter specific ones to prevent + * possible messing up by other filters, e.g. + * '[python]foo[/python]' to '[geshifilter-python]foo[/geshifilter-python]'. + * Replaces newlines with " " to prevent issues with the line break filter + * Escapes the tricky characters like angle brackets with check_plain() to + * prevent messing up by other filters like the HTML filter. + */ +function _geshifilter_prepare_callback($match, $format) { + // $match[0]: complete matched string + // $match[1]: opening bracket ('<' or '[') + // $match[2]: tag + // $match[3] and $match[4]: attributes + // $match[5]: closing bracket + // $match[6]: source code + // $match[7]: closing tag + $tag_name = $match[2]; + $tag_attributes = $match[3]; + $content = $match[6]; + + // get the default highlighting mode + $lang = variable_get('geshifilter_default_highlighting', GESHIFILTER_DEFAULT_PLAINTEXT); + if ($lang == GESHIFILTER_DEFAULT_DONOTHING) { + // If the default highlighting mode is GESHIFILTER_DEFAULT_DONOTHING + // and there is no language set (with language tag or language attribute), + // we should not do any escaping in this prepare phase, + // so that other filters can do their thing. + $enabled_languages = _geshifilter_get_enabled_languages(); + + // Usage of language tag? + list($generic_code_tags, $language_tags, $tag_to_lang) = _geshifilter_get_tags($format); + if (isset($tag_to_lang[$tag_name]) && isset($enabled_languages[$tag_to_lang[$tag_name]])) { + $lang = $tag_to_lang[$tag_name]; + } + // Usage of language attribute? + else { + // Get additional settings from the tag attributes. + $settings = _geshifilter_parse_attributes($tag_attributes, $format); + if ($settings['language'] && isset($enabled_languages[$settings['language']])) { + $lang = $settings['language']; + } + } + // If no language was set: prevent escaping and return original string + if ($lang == GESHIFILTER_DEFAULT_DONOTHING) { + return $match[0]; + } + } + // return escaped code block + return '[geshifilter-'. $tag_name . $tag_attributes .']' + . str_replace(array("\r", "\n"), array('', ' '), check_plain($content)) + .'[/geshifilter-'. $tag_name .']'; +} + +/** + * _geshifilter_prepare callback for < ?php ... ? > blocks + */ +function _geshifilter_prepare_php_callback($match) { + return '[geshifilter-questionmarkphp]' + . str_replace(array("\r", "\n"), array('', ' '), check_plain($match[2])) + .'[/geshifilter-questionmarkphp]'; +} + +/** + * geshifilter_filter callback for processing input text. + */ +function _geshifilter_process($format, $text) { + // load GeSHi library (if not already) + $geshi_library = _geshifilter_check_geshi_library(); + if (!$geshi_library['success']) { + drupal_set_message($geshi_library['message'], 'error'); + return $text; + } + // get the available tags + list($generic_code_tags, $language_tags, $tag_to_lang) = _geshifilter_get_tags($format); + if (in_array(GESHIFILTER_BRACKETS_PHPBLOCK, array_filter(_geshifilter_tag_styles($format)))) { + $language_tags[] = 'questionmarkphp'; + $tag_to_lang['questionmarkphp'] = 'php'; + } + $tags = array_merge($generic_code_tags, $language_tags); + // escape special (regular expression) characters in tags (for tags like 'c++' and 'c#') + $tags = preg_replace('#(\\+|\\#)#', '\\\\$1', $tags); + $tags_string = implode('|', $tags); + // Pattern for matching the prepared "..." stuff + $pattern = '#\\[geshifilter-('. $tags_string .')([^\\]]*)\\](.*?)(\\[/geshifilter-\1\\])#s'; + $text = preg_replace_callback($pattern, create_function('$match', "return _geshifilter_replace_callback(\$match, $format);"), $text); + return $text; +} + + +/** + * preg_replace_callback callback + */ +function _geshifilter_replace_callback($match, $format) { + // $match[0]: complete matched string + // $match[1]: tag name + // $match[2]: tag attributes + // $match[3]: tag content + $complete_match = $match[0]; + $tag_name = $match[1]; + $tag_attributes = $match[2]; + $source_code = $match[3]; + + // Undo linebreak and escaping from preparation phase. + $source_code = decode_entities($source_code); + + // Initialize to default settings. + $lang = variable_get('geshifilter_default_highlighting', GESHIFILTER_DEFAULT_PLAINTEXT); + $line_numbering = variable_get('geshifilter_default_line_numbering', GESHIFILTER_LINE_NUMBERS_DEFAULT_NONE); + $linenumbers_start = 1; + $title = NULL; + + // Determine language based on tag name if possible. + list($generic_code_tags, $language_tags, $tag_to_lang) = _geshifilter_get_tags($format); + if (in_array(GESHIFILTER_BRACKETS_PHPBLOCK, array_filter(_geshifilter_tag_styles($format)))) { + $language_tags[] = 'questionmarkphp'; + $tag_to_lang['questionmarkphp'] = 'php'; + } + if (isset($tag_to_lang[$tag_name])) { + $lang = $tag_to_lang[$tag_name]; + } + + // Get additional settings from the tag attributes. + $settings = _geshifilter_parse_attributes($tag_attributes, $format); + if (isset($settings['language'])) { + $lang = $settings['language']; + } + if (isset($settings['line_numbering'])) { + $line_numbering = $settings['line_numbering']; + } + if (isset($settings['linenumbers_start'])) { + $linenumbers_start = $settings['linenumbers_start']; + } + if (isset($settings['title'])) { + $title = $settings['title']; + } + + if ($lang == GESHIFILTER_DEFAULT_DONOTHING) { + // Do nothing, and return the original. + return $complete_match; + } + if ($lang == GESHIFILTER_DEFAULT_PLAINTEXT) { + // Use plain text 'highlighting' + $lang = 'text'; + } + $inline_mode = (strpos($source_code, "\n") === FALSE); + // process and return + return geshifilter_process($source_code, $lang, $line_numbering, $linenumbers_start, $inline_mode, $title); +} + +/** + * Helper function for overriding some GeSHi defaults + */ +function _geshifilter_override_geshi_defaults(&$geshi, $langcode) { + // override the some default GeSHi styles (e.g. GeSHi uses Courier by default, which is ugly) + $geshi->set_line_style('font-family: monospace; font-weight: normal;', 'font-family: monospace; font-weight: bold; font-style: italic;'); + $geshi->set_code_style('font-family: monospace; font-weight: normal; font-style: normal'); + // overall class needed for CSS + $geshi->set_overall_class('geshifilter-'. $langcode); + // set keyword linking + $geshi->enable_keyword_links(variable_get('geshifilter_enable_keyword_urls', TRUE)); +} + +/** + * General geshifilter processing function + */ +function geshifilter_process($source_code, $lang, $line_numbering=0, $linenumbers_start=1, $inline_mode=FALSE, $title = NULL) { + // process + if ($lang == 'php' && variable_get('geshifilter_use_highlight_string_for_php', FALSE)) { + return geshifilter_highlight_string_process($source_code, $inline_mode); + } + else { + // process with GeSHi + return geshifilter_geshi_process($source_code, $lang, $line_numbering, $linenumbers_start, $inline_mode, $title); + } +} + +/** + * geshifilter wrapper for GeSHi processing. + */ +function geshifilter_geshi_process($source_code, $lang, $line_numbering=0, $linenumbers_start=1, $inline_mode=FALSE, $title = NULL) { + // load GeSHi library (if not already) + $geshi_library = _geshifilter_check_geshi_library(); + if (!$geshi_library['loaded']) { + drupal_set_message($geshi_library['message'], 'error'); + return $source_code; + } + + // Check for a cached version of this source code and return it if available. + // @todo: Use a dedicated table instead of using cache_filter? If so, + // also take care of the flushing in _geshifilter_clear_filter_cache(). + $cache_id = "geshifilter:$lang:$line_numbering:$linenumbers_start:$inline_mode" . md5($title . $source_code); + if ($cached = cache_get($cache_id, 'cache_filter')) { + return $cached->data; + } + + // remove leading/trailing newlines + $source_code = trim($source_code, "\n\r"); + // create GeSHi object + $geshi = _geshifilter_geshi_factory($source_code, $lang); + + // CSS mode + $ccs_mode = variable_get('geshifilter_css_mode', GESHIFILTER_CSS_INLINE); + if ($ccs_mode == GESHIFILTER_CSS_CLASSES_AUTOMATIC || $ccs_mode == GESHIFILTER_CSS_CLASSES_ONLY) { + $geshi->enable_classes(TRUE); + } + _geshifilter_override_geshi_defaults($geshi, $lang); + // some more GeSHi settings and parsing + if ($inline_mode) { + // inline source code mode + $geshi->set_header_type(GESHI_HEADER_NONE); + // To make highlighting work we have to manually set a class on the code + // element we will wrap the code in. + // To counter a change between GeSHi version 1.0.7.22 and 1.0.8 (svn + // commit 1610), we use both the language and overall_class for the class, + // to mimic the 1.0.8 behavior, which is backward compatible. + $code_class = "{$geshi->language} {$geshi->overall_class}"; + $source_code = ''. $geshi->parse_code() .''; + } + else { + // block source code mode + $geshi->set_header_type((int)variable_get('geshifilter_code_container', GESHI_HEADER_PRE)); + if ($line_numbering == 1) { + $geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS); + $geshi->start_line_numbers_at($linenumbers_start); + } + elseif ($line_numbering >= 2) { + $geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, $line_numbering); + $geshi->start_line_numbers_at($linenumbers_start); + } + if (isset($title)) { + $source_code = '
    '. check_plain($title) .'
    '; + } + else { + $source_code = ''; + } + $source_code .= '
    '. $geshi->parse_code() .'
    '; + } + + // Store in cache with a minimum expiration time of 1 day. + cache_set($cache_id, $source_code, 'cache_filter', time() + (60 * 60 * 24)); + + + return $source_code; +} + +/** + * geshifilter wrapper for highlight_string() processing of PHP + */ +function geshifilter_highlight_string_process($source_code, $inline_mode) { + // Make sure that the source code starts with < ?php and ends with ? > + $text = trim($source_code); + if (substr($text, 0, 5) != '') { + $source_code = $source_code .'?>'; + } + // Use the right container + $container = $inline_mode ? 'span' : 'div'; + // Process with highlight_string() + $text = '<'. $container .' class="codeblock geshifilter">'. highlight_string($source_code, TRUE) .''; + // Remove newlines (added by highlight_string()) to avoid issues with the linebreak filter + $text = str_replace("\n", '', $text); + return $text; +} diff --git a/sites/all/modules/geshifilter/geshifilter.test b/sites/all/modules/geshifilter/geshifilter.test new file mode 100644 index 0000000..a9b908b --- /dev/null +++ b/sites/all/modules/geshifilter/geshifilter.test @@ -0,0 +1,554 @@ + t('GeSHi filter administration'), + 'description' => t('Test the GeSHi filter administration.'), + 'group' => t('GeSHi filter module'), + ); + } + + /** + * SimpleTest core method: code run before each and every test method. + * + * Optional. You only need this if you have setup tasks. + */ + function setUp() { + // Make sure the GeSHi filter module is enabled. + parent::setUp('geshifilter'); + // And set the path to the geshi library. + variable_set('geshifilter_geshi_dir','sites/all/libraries/geshi'); + + // Create a filter admin user + $permissions = array('administer filters', 'administer site configuration'); + $this->filter_admin_user = $this->drupalCreateUser($permissions); + + // log in with filter admin user + $this->drupalLogin($this->filter_admin_user); + + // add an input format with only geshi filter + $edit = array( + 'name' => $this->randomName(10, 'inputformat_'), + 'filters[geshifilter/0]' => TRUE, + 'roles[2]' => TRUE, + ); + $this->drupalPost('admin/settings/filters/add', $edit, t('Save configuration')); + // store the format id of the created input format + $this->input_format_id = db_result(db_query("SELECT format FROM {filter_formats} WHERE name = '%s'", $edit['name'])); + $this->assertTrue($this->input_format_id, t('Input format id (%s)')); + + // set some default GeSHi filter admin settings + variable_set('geshifilter_format_specific_options', FALSE); + variable_set('geshifilter_tag_styles', array( + GESHIFILTER_BRACKETS_ANGLE => GESHIFILTER_BRACKETS_ANGLE, + GESHIFILTER_BRACKETS_SQUARE => GESHIFILTER_BRACKETS_SQUARE, + )); + variable_set('geshifilter_default_line_numbering', GESHIFILTER_LINE_NUMBERS_DEFAULT_NONE); + + } + + /** + * SimpleTest core method: code run after each and every test method. + * + * Optional. You only need this if you have setup tasks. + */ + function tearDown() { + // Remove input format. + $this->drupalPost('admin/settings/filters/delete/'. $this->input_format_id, array(), t('Delete')); + + // Always call the tearDown() function from the parent class. + parent::tearDown(); + } + + /** + * Check tag unicity: tags should differ between languages and from generic tags + */ + function test_tag_unicity() { + // enable some languages first + variable_set('geshifilter_language_enabled_php', TRUE); + variable_set('geshifilter_language_enabled_python', TRUE); + + // first round: without format specific tag options + variable_set('geshifilter_format_specific_options', FALSE); + variable_set('geshifilter_tags', 'code blockcode generictag'); + + // a language tag should differ from the generic tags + $form_values = array( + 'geshifilter_language_tags_php' => 'php generictag', + ); + $this->drupalPost('admin/settings/geshifilter/languages', $form_values, t('Save configuration')); + $this->assertText(t('The language tags should differ between languages and from the generic tags.'), t('Language tags should differ from generic tags (with generic tag options)')); + + // language tags should differ between languages + $form_values = array( + 'geshifilter_language_tags_php' => 'php languagetag', + 'geshifilter_language_tags_python' => 'languagetag python', + ); + $this->drupalPost('admin/settings/geshifilter/languages/all', $form_values, t('Save configuration')); + $this->assertText(t('The language tags should differ between languages and from the generic tags.'), t('Language tags should differ between languages (with generic tag options)')); + + // second round: with format specific tag options + variable_set('geshifilter_format_specific_options', TRUE); + variable_set('geshifilter_tags_' . $this->input_format_id, 'code blockcode generictag'); + + // a language tag should differ from the generic tags + $form_values = array( + 'geshifilter_language_tags_php_' . $this->input_format_id => 'php generictag', + ); + $this->drupalPost('admin/settings/filters/' . $this->input_format_id . '/configure', $form_values, t('Save configuration')); + $this->assertText(t('The language tags should differ between languages and from the generic tags.'), t('Language tags should differ from generic tags (with format specific tag options)')); + + // language tags should differ between languages + $form_values = array( + 'geshifilter_language_tags_php_' . $this->input_format_id => 'php languagetag', + 'geshifilter_language_tags_python_' . $this->input_format_id => 'languagetag python', + ); + $this->drupalPost('admin/settings/filters/' . $this->input_format_id . '/configure', $form_values, t('Save configuration')); + $this->assertText(t('The language tags should differ between languages and from the generic tags.'), t('Language tags should differ between languages (with format specific tag options)')); + + } + +} + + + + + +class GeshiFilterTest extends DrupalWebTestCase { + + /** + * A global filter adminstrator + */ + protected $filter_admin_user; + + /** + * A global user for adding pages + */ + protected $normal_user; + + /** + * The id of the input format with only GeSHi filter in it + */ + protected $input_format_id; + + /** + * Drupal SimpleTest method: return metadata about the test. + */ + function getInfo() { + return array( + 'name' => t('GeSHi input filter'), + 'description' => t('Test the input filter capabilities of the GeSHi filter.'), + 'group' => t('GeSHi filter module'), + ); + } + + /** + * SimpleTest core method: code run before each and every test method. + * + * Optional. You only need this if you have setup tasks. + */ + function setUp() { + // Make sure that Geshi filter module is enabled. + parent::setUp('geshifilter'); + // And set the path to the geshi library. + variable_set('geshifilter_geshi_dir','sites/all/libraries/geshi'); + + // Create a filter admin user + $permissions = array( + 'administer filters', + ); + $this->filter_admin_user = $this->drupalCreateUser($permissions); + // Create a normal user for page creation + $permissions = array( + 'edit own page content', + 'create page content' + ); + $this->normal_user = $this->drupalCreateUser($permissions); + + // log in with filter admin user + $this->drupalLogin($this->filter_admin_user); + + // add an input format with only geshi filter + $edit = array( + 'name' => $this->randomName(10, 'inputformat_'), + 'filters[geshifilter/0]' => TRUE, + 'filters[filter/0]' => FALSE, + 'filters[filter/1]' => FALSE, + 'filters[filter/2]' => FALSE, + 'filters[filter/3]' => FALSE, + 'roles[2]' => TRUE, + ); + $this->drupalPost('admin/settings/filters/add', $edit, t('Save configuration')); + // store the format id of the created input format + $this->input_format_id = db_result(db_query("SELECT format FROM {filter_formats} WHERE name = '%s'", $edit['name'])); + $this->assertTrue($this->input_format_id, t('Valid input format id')); + + // set some default GeSHi filter admin settings + // Set default highlighting mode to "do nothing". + variable_set('geshifilter_default_highlighting', GESHIFILTER_DEFAULT_PLAINTEXT); + variable_set('geshifilter_format_specific_options', FALSE); + variable_set('geshifilter_tag_styles', array( + GESHIFILTER_BRACKETS_ANGLE => GESHIFILTER_BRACKETS_ANGLE, + GESHIFILTER_BRACKETS_SQUARE => GESHIFILTER_BRACKETS_SQUARE, + )); + variable_set('geshifilter_default_line_numbering', GESHIFILTER_LINE_NUMBERS_DEFAULT_NONE); + + // log out as filter admin + $this->drupalGet('logout'); + + // log in as the normal user for adding pages + $this->drupalLogin($this->normal_user); + + // include GeSHi filtering functions + require_once(drupal_get_path('module', 'geshifilter') .'/geshifilter.pages.inc'); + + } + + /** + * SimpleTest core method: code run after each and every test method. + * + * Optional. You only need this if you have setup tasks. + */ + function tearDown() { + // log in as filter admin + $this->drupalGet('logout'); + $this->drupalLogin($this->filter_admin_user); + + // remove input format + $this->drupalPost('admin/settings/filters/delete/'. $this->input_format_id, array(), t('Delete')); + + // Always call the tearDown() function from the parent class. + parent::tearDown(); + } + + /** + * Assert function for testing if GeSHi highlighting works + * @param string $body the body text of the node + * @param array $check_list list of items that should be in rendered output (assertRaw) + * an item is something like array($source_code, $lang, $line_numbering, $linenumbers_start, $inline_mode) + * if $lang is set, GeSHifilter syntax highlighting is applied to $sourcecode + * if $lang is false, $sourcecode is directly looked for + * @param string $description description of the assertion + * @param boolean $invert if assertNoRaw should be used instead of assertRaw + */ + function assertGeshiFilterHighlighting($body, $check_list, $description, $invert=false) { + // Create content. + $edit = array( + 'title' => $this->randomName(32, 'simpletest_pagetitle_'), + 'body' => $body ."\n". $this->randomName(100), + 'format' => $this->input_format_id, + ); + // Post node + $this->drupalPost('node/add/page', $edit, t('Save')); + // check posted node + $node = node_load(array('title' => $edit['title'])); + $this->assertTrue($node, 'Node found in database. %s'); + // check if highlighting succeeded + foreach ($check_list as $fragment) { + list($source_code, $lang, $line_numbering, $linenumbers_start, $inline_mode) = $fragment; + if ($lang) { + // apply syntax highlighting + $source_code = geshifilter_geshi_process($source_code, $lang, $line_numbering, $linenumbers_start, $inline_mode); + } + if ($invert) { + $this->assertNoRaw($source_code, $description); + } + else { + $this->assertRaw($source_code, $description); + } + } + } + + /** + * Test the standard functionality of the generic tags + */ + function testGenericTags() { + variable_set('geshifilter_tags', 'code'); + variable_set('geshifilter_language_enabled_c', TRUE); + variable_set('geshifilter_language_enabled_cpp', TRUE); + variable_set('geshifilter_language_enabled_csharp', TRUE); + variable_set('geshifilter_language_enabled_java', TRUE); + + // body material + $source_code = "//C++-ish source code\nfor (int i=0; i<10; ++i) {\n fun(i);\n bar.foo(x, y);\n server->start(&pool); \n}"; + + // check language argument + $this->assertGeshiFilterHighlighting(''. $source_code .'', + array(array($source_code, 'cpp', 0, 1, FALSE)), + t('Checking type="..." argument')); + $this->assertGeshiFilterHighlighting(''. $source_code .'', + array(array($source_code, 'cpp', 0, 1, FALSE)), + t('Checking lang="..." argument')); + $this->assertGeshiFilterHighlighting(''. $source_code .'', + array(array($source_code, 'cpp', 0, 1, FALSE)), + t('Checking language="..." argument')); + + // check some languages + $languages = array('c', 'cpp', 'java'); + foreach ($languages as $lang) { + $this->assertGeshiFilterHighlighting(''. $source_code .'', + array(array($source_code, $lang, 0, 1, FALSE)), + t('Checking language="@lang"', array('@lang' => $lang))); + } + + // check line_numbering argument + $this->assertGeshiFilterHighlighting(''. $source_code .'', + array(array($source_code, 'cpp', 0, 1, FALSE)), + t('Checking linenumbers="off" argument')); + $this->assertGeshiFilterHighlighting(''. $source_code .'', + array(array($source_code, 'cpp', 1, 1, FALSE)), + t('Checking linenumbers="normal" argument')); + $this->assertGeshiFilterHighlighting(''. $source_code .'', + array(array($source_code, 'cpp', 1, 27, FALSE)), + t('Checking start="27" argument')); + $this->assertGeshiFilterHighlighting(''. $source_code .'', + array(array($source_code, 'cpp', 5, 1, FALSE)), + t('Checking linenumbers="fancy" argument')); + $this->assertGeshiFilterHighlighting(''. $source_code .'', + array(array($source_code, 'cpp', 3, 1, FALSE)), + t('Checking fancy="3" argument')); + } + + + function testBracketsOnlyAngle() { + variable_set('geshifilter_tags', 'code'); + variable_set('geshifilter_language_enabled_cpp', TRUE); + $source_code = "//C++ source code\nfor (int i=0; i<10; ++i) {\n fun(i);\n bar.foo(x, y);\n server->start(&pool); \n}"; + // Enable only angle brackets + variable_set('geshifilter_tag_styles', array( + GESHIFILTER_BRACKETS_ANGLE => GESHIFILTER_BRACKETS_ANGLE, + )); + // This should be filtered. + $this->assertGeshiFilterHighlighting(''. $source_code .'', + array(array($source_code, 'cpp', 0, 1, FALSE)), + t('Checking angle brackets style in GESHIFILTER_BRACKETS_ANGLE mode')); + // This should not be filtered. + $this->assertGeshiFilterHighlighting('[code language="cpp"]'. $source_code .'[/code]', + array(array($source_code, NULL, 0, 1, FALSE)), + t('Checking [foo] brackets style in GESHIFILTER_BRACKETS_ANGLE mode')); + $this->assertGeshiFilterHighlighting('[[code language="cpp"]]'. $source_code .'[[/code]]', + array(array($source_code, NULL, 0, 1, FALSE)), + t('Checking [[foo]] brackets style in GESHIFILTER_BRACKETS_ANGLE mode')); + $this->assertGeshiFilterHighlighting('', + array(array($source_code, NULL, 0, 1, FALSE)), + t('Checking php code blocks in GESHIFILTER_BRACKETS_ANGLE mode')); + } + + function testBracketsOnlySquare() { + variable_set('geshifilter_tags', 'code'); + variable_set('geshifilter_language_enabled_cpp', TRUE); + $source_code = "//C++ source code\nfor (int i=0; i<10; ++i) {\n fun(i);\n bar.foo(x, y);\n server->start(&pool); \n}"; + // Enable only square brackets + variable_set('geshifilter_tag_styles', array( + GESHIFILTER_BRACKETS_SQUARE => GESHIFILTER_BRACKETS_SQUARE, + )); + // This should be filtered. + $this->assertGeshiFilterHighlighting('[code language="cpp"]'. $source_code .'[/code]', + array(array($source_code, 'cpp', 0, 1, FALSE)), + t('Checking [foo] brackets style in GESHIFILTER_BRACKETS_SQUARE mode')); + // This should not be filtered. + $this->assertGeshiFilterHighlighting(''. $source_code .'', + array(array($source_code, NULL, 0, 1, FALSE)), + t('Checking angle brackets style in GESHIFILTER_BRACKETS_SQUARE mode')); + $this->assertGeshiFilterHighlighting('[[code language="cpp"]]'. $source_code .'[[/code]]', + array(array($source_code, NULL, 0, 1, FALSE)), + t('Checking [[foo]] brackets style in GESHIFILTER_BRACKETS_SQUARE mode')); + $this->assertGeshiFilterHighlighting('', + array(array($source_code, NULL, 0, 1, FALSE)), + t('Checking php code blocks in GESHIFILTER_BRACKETS_SQUARE mode')); + } + + function testBracketsOnlyDoubleSquare() { + variable_set('geshifilter_tags', 'code'); + variable_set('geshifilter_language_enabled_cpp', TRUE); + $source_code = "//C++ source code\nfor (int i=0; i<10; ++i) {\n fun(i);\n bar.foo(x, y);\n server->start(&pool); \n}"; + // Enable only double square brackets + variable_set('geshifilter_tag_styles', array( + GESHIFILTER_BRACKETS_DOUBLESQUARE => GESHIFILTER_BRACKETS_DOUBLESQUARE, + )); + // This should be filtered. + $this->assertGeshiFilterHighlighting('[[code language="cpp"]]'. $source_code .'[[/code]]', + array(array($source_code, 'cpp', 0, 1, FALSE)), + t('Checking [[foo]] brackets style in GESHIFILTER_BRACKETS_DOUBLESQUARE mode')); + // This should not be filtered. + $this->assertGeshiFilterHighlighting(''. $source_code .'', + array(array($source_code, NULL, 0, 1, FALSE)), + t('Checking angle brackets style in GESHIFILTER_BRACKETS_DOUBLESQUARE mode')); + $this->assertGeshiFilterHighlighting('[code language="cpp"]'. $source_code .'[/code]', + array(array($source_code, NULL, 0, 1, FALSE)), + t('Checking [foo] brackets style in GESHIFILTER_BRACKETS_DOUBLESQUARE mode')); + $this->assertGeshiFilterHighlighting('', + array(array($source_code, NULL, 0, 1, FALSE)), + t('Checking php code blocks in GESHIFILTER_BRACKETS_DOUBLESQUARE mode')); + } + + function testBracketsOnlyPhpCodeBlock() { + variable_set('geshifilter_tags', 'code'); + variable_set('geshifilter_language_enabled_cpp', TRUE); + $source_code = "//C++ source code\nfor (int i=0; i<10; ++i) {\n fun(i);\n bar.foo(x, y);\n server->start(&pool); \n}"; + // Enable only double square brackets + variable_set('geshifilter_tag_styles', array( + GESHIFILTER_BRACKETS_PHPBLOCK => GESHIFILTER_BRACKETS_PHPBLOCK, + )); + // This should be filtered. + $this->assertGeshiFilterHighlighting('', + array(array($source_code, 'php', 0, 1, FALSE)), + t('Checking php code blocks in GESHIFILTER_BRACKETS_PHPBLOCK mode')); + // This should not be filtered. + $this->assertGeshiFilterHighlighting(''. $source_code .'', + array(array($source_code, NULL, 0, 1, FALSE)), + t('Checking angle brackets style in GESHIFILTER_BRACKETS_PHPBLOCK mode')); + $this->assertGeshiFilterHighlighting('[code language="cpp"]'. $source_code .'[/code]', + array(array($source_code, NULL, 0, 1, FALSE)), + t('Checking [foo] brackets style in GESHIFILTER_BRACKETS_PHPBLOCK mode')); + $this->assertGeshiFilterHighlighting('[[code language="cpp"]]'. $source_code .'[[/code]]', + array(array($source_code, NULL, 0, 1, FALSE)), + t('Checking [[foo]] brackets style in GESHIFILTER_BRACKETS_PHPBLOCK mode')); + } + + + /** + * Check if tags like [c++] and [c#] work + * Problem described in http://drupal.org/node/208720 + */ + function testSpecialTags() { + // Enabled the tags + variable_set('geshifilter_language_enabled_cpp', TRUE); + variable_set('geshifilter_language_tags_cpp', 'c++'); + variable_set('geshifilter_language_enabled_csharp', TRUE); + variable_set('geshifilter_language_tags_csharp', 'c#'); + // body material + $source_code = "//C++-ish source code\nfor (int i=0; i<10; ++i) {\n fun(i);\n bar.foo(x, y);\n server->start(&pool); \n}"; + // Test the tags + $this->assertGeshiFilterHighlighting(''. $source_code .'', + array(array($source_code, 'cpp', 0, 1, FALSE)), + t('Checking ..')); + $this->assertGeshiFilterHighlighting(''. $source_code .'', + array(array($source_code, 'csharp', 0, 1, FALSE)), + t('Checking ..')); + } + + /** + * Test if tags like [cpp], [css], [csharp] aren't highjacked by [c] + */ + function testPrefixTags() { + // enabled the tags + variable_set('geshifilter_language_enabled_c', TRUE); + variable_set('geshifilter_language_tags_c', 'c'); + variable_set('geshifilter_language_enabled_cpp', TRUE); + variable_set('geshifilter_language_tags_cpp', 'cpp'); + variable_set('geshifilter_language_enabled_csharp', TRUE); + variable_set('geshifilter_language_tags_csharp', 'csharp'); + // body material + $source_code = "//C++-ish source code\nfor (int i=0; i<10; ++i) {\n fun(i);\n bar.foo(x, y);\n server->start(&pool); \n}"; + // Test the tags + $this->assertGeshiFilterHighlighting(''. $source_code .'', + array(array($source_code, 'cpp', 0, 1, FALSE)), + t('Source code in ... should work when ... is also enabled')); + $this->assertGeshiFilterHighlighting(''. $source_code .'', + array(array($source_code, 'csharp', 0, 1, FALSE)), + t('Source code in ... should work when ... is also enabled')); + } + + function testDoNothingMode() { + // Enable C++. + variable_set('geshifilter_language_enabled_cpp', TRUE); + variable_set('geshifilter_language_tags_cpp', 'cpp'); + // Set default highlighting mode to "do nothing". + variable_set('geshifilter_default_highlighting', GESHIFILTER_DEFAULT_DONOTHING); + // Body material with some characters ('<' and '&') that would be escaped + // except in "do nothing" mode + $source_code = "//C++-ish source code\nfor (int i=0; i!=10; ++i) {\n fun(i);\n bar.foo(x, y);\n}"; + // Tests + $this->assertGeshiFilterHighlighting(''. $source_code .'', + array(array(''. $source_code .'', FALSE, 0, 1, FALSE)), + t('Do nothing mode should not touch given source code') + ); + $this->assertGeshiFilterHighlighting(''. $source_code .'', + array(array($source_code, 'cpp', 0, 1, FALSE)), + t('Highlighting with language="cpp" should work when default is "do nothing"') + ); + $this->assertGeshiFilterHighlighting(''. $source_code .'', + array(array($source_code, 'cpp', 0, 1, FALSE)), + t('Highlighting with ... should work when default is "do nothing"') + ); + } + + function testTitleAttributeOnCodeBlock(){ + $source_code = "for (int i=0; i!=10; ++i) {\n fun(i);\n bar.foo(x, y);\n}"; + // No title set + $this->assertGeshiFilterHighlighting(''. $source_code .'', + array(array('geshifilter-title', False, 0, 0, 0)), + t('Setting the title attritbute on code block.'), + true + ); + // Title set. + $this->assertGeshiFilterHighlighting(''. $source_code .'', + array(array('
    Foo the bar!
    ', False, 0, 0, 0)), + t('Setting the title attritbute on code block.') + ); + } + + function testTitleAttributeOnInlineCode(){ + $source_code = "for (int i=0; i!=10; ++i) { fun(i); }"; + // No title set. + $this->assertGeshiFilterHighlighting(''. $source_code .'', + array(array('', False, 0, 0, 0)), + t('Setting the title attritbute on inline code.') + ); + // Title set. + $this->assertGeshiFilterHighlighting(''. $source_code .'', + array(array('', False, 0, 0, 0)), + t('Setting the title attritbute on inline code.') + ); + } + + + /** + * Issue http://drupal.org/node/1010216 + */ + function testSquareBracketConfusion() { + variable_set('geshifilter_tags', 'code'); + variable_set('geshifilter_language_enabled_ini', TRUE); + $source_code = "[section]\nserver=192.0.2.62 ; IP address\nport=12345"; + // Enable square brackets + variable_set('geshifilter_tag_styles', array( + GESHIFILTER_BRACKETS_SQUARE => GESHIFILTER_BRACKETS_SQUARE, + )); + // This should be filtered. + $this->assertGeshiFilterHighlighting('[code]'. $source_code .'[/code]', + array(array($source_code, 'text', 0, 1, FALSE)), + t('Checking if [code][section]...[/code] works')); + $this->assertGeshiFilterHighlighting('[code language="ini"]'. $source_code .'[/code]', + array(array($source_code, 'ini', 0, 1, FALSE)), + t('Checking if [code language="ini"][section]...[/code] works')); + } + +} + diff --git a/sites/all/modules/geshifilter/geshinode.info b/sites/all/modules/geshifilter/geshinode.info new file mode 100644 index 0000000..e3c6af9 --- /dev/null +++ b/sites/all/modules/geshifilter/geshinode.info @@ -0,0 +1,12 @@ +name = "GeSHi node" +description = "Provides source code node with GeSHi syntax highlighting." +package = "Filters" +dependencies[] = geshifilter +core = 6.x + +; Information added by drupal.org packaging script on 2013-03-18 +version = "6.x-1.5" +core = "6.x" +project = "geshifilter" +datestamp = "1363644611" + diff --git a/sites/all/modules/geshifilter/geshinode.install b/sites/all/modules/geshifilter/geshinode.install new file mode 100644 index 0000000..36556c8 --- /dev/null +++ b/sites/all/modules/geshifilter/geshinode.install @@ -0,0 +1,85 @@ + t('The table for geshinodes.'), + 'fields' => array( + 'nid' => array( + 'description' => t('The primary identifier for a node.'), + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + ), + 'vid' => array( + 'description' => t('The current {node_revisions}.vid version identifier.'), + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'language' => array( + 'description' => t('The source code language of the node.'), + 'type' => 'varchar', + 'length' => 64, + 'not null' => TRUE, + 'default' => '', + ), + ), + 'primary key' => array('vid'), + 'indexes' => array('nid' => array('nid')), + ); + return $schema; +} + +/** + * Create tables on install + */ +function geshinode_install() { + // Create geshinode tables. + drupal_install_schema('geshinode'); +} + +/** + * Remove tables on uninstall. + */ +function geshinode_uninstall() { + // Drop geshinode tables. + drupal_uninstall_schema('geshinode'); +} + + +/** + * Implementation of hook_update_N(). + * + * Fix the primary key and indices on the geshinode table. + * See http://drupal.org/node/363770 . + */ +function geshinode_update_6001() { + $ret = array(); + // Drop unique key on 'vid'. + db_drop_unique_key($ret, 'geshinode', 'vid'); + // Change the 'nid' field to 'int' (from 'serial'). + db_change_field($ret, 'geshinode', 'nid', 'nid', + array( + 'description' => t('The primary identifier for a node.'), + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + ) + ); + // Drop primary key ('nid'). + db_drop_primary_key($ret, 'geshinode'); + // Add primary key on 'vid'. + db_add_primary_key($ret, 'geshinode', array('vid')); + // Add an index on 'nid'. + db_add_index($ret, 'geshinode', 'nid', array('nid')); + return $ret; +} diff --git a/sites/all/modules/geshifilter/geshinode.module b/sites/all/modules/geshifilter/geshinode.module new file mode 100644 index 0000000..00f8ef6 --- /dev/null +++ b/sites/all/modules/geshifilter/geshinode.module @@ -0,0 +1,184 @@ + 'GeSHi node', + 'description' => 'Settings of the GeSHi source code node type.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('geshinode_settings'), + 'access arguments' => array('administer site configuration'), + 'type' => MENU_LOCAL_TASK, + ); + return $items; +} + +/** + * Implementation of hook_help(). + */ +function geshinode_help($path, $arg) { + if ($path == 'admin/settings/geshifilter/geshinode') { + return '

    '. t('Settings of the GeSHi source code node type.') .'

    '; + } +} + +/** + * Implementation of hook_node_info(). + */ +function geshinode_node_info() { + return array( + 'geshinode' => array( + 'name' => t('Source code node'), + 'module' => 'geshinode', + 'description' => t('Source code with GeSHi syntax highlighting.'), + 'has_title' => TRUE, + 'title_label' => t('Title'), + 'has_body' => TRUE, + 'body_label' => t('Source code'), + ) + ); +} + +/** + * Implementation of hook_perm(). + */ +function geshinode_perm() { + return array('create source code node', 'edit source code node', 'edit own source code node'); +} + +/** + * Implementation of hook_access(). + */ +function geshinode_access($op, $node) { + global $user; + if ($op == 'create') { + return user_access('create source code node'); + } + if ($op == 'update' || $op == 'delete') { + return user_access('edit source code node') || + user_access('edit own source code node') && ($user->uid == $node->uid); + } +} + +/** + * Implementation of hook_form(). + */ +function geshinode_form(&$node, $form_state) { + require_once drupal_get_path('module', 'geshifilter') .'/geshifilter.inc'; + + $type = node_get_types('type', $node); + + // set the title field + $form['title'] = array( + '#type' => 'textfield', + '#title' => check_plain($type->title_label), + '#required' => TRUE, + '#default_value' => $node->title, + '#weight' => -5, + ); + + // the body field + $form['body_field'] = node_body_field($node, $type->body_label, $type->min_word_count); + unset($form['body_field']['format']); + + // the source code language field + $form['source_code_language'] = array( + '#type' => 'select', + '#title' => t('Syntax highlighting mode'), + '#default_value' => isset($node->source_code_language) ? $node->source_code_language: variable_get('geshinode_default_language', 'php'), + '#options' => _geshifilter_get_enabled_languages(), + '#description' => t('Select the syntax highlighting mode to use.') + ); + return $form; +} + +/** + * Implementation of hook_validate(). + */ +function geshinode_validate($node) { + ///TODO +} + +/** + * Implementation of hook_insert(). + */ +function geshinode_insert($node) { + db_query("INSERT INTO {geshinode} (nid, vid, language) VALUES (%d, %d, '%s')", + $node->nid, $node->vid, $node->source_code_language); +} + +/** + * Implementation of hook_update(). + */ +function geshinode_update($node) { + if ($node->revision) { + geshinode_insert($node); + } + else { + db_query("UPDATE {geshinode} SET language = '%s' WHERE vid=%d", $node->source_code_language, $node->vid); + } +} + +/** + * Implementation of hook_delete(). + */ +function geshinode_delete(&$node) { + db_query("DELETE FROM {geshinode} WHERE nid = '%d'", $node->nid); +} + +/** + * Implementation of hook_load(). + */ +function geshinode_load($node) { + return db_fetch_object(db_query('SELECT language AS source_code_language FROM {geshinode} WHERE vid = %d', $node->vid)); +} + +/** + * Implementation of hook_view() + */ +function geshinode_view($node, $teaser = FALSE, $page = FALSE) { + require_once drupal_get_path('module', 'geshifilter') .'/geshifilter.pages.inc'; + $node->readmore = (strlen($node->teaser) < strlen($node->body)); + $line_numbering = variable_get('geshinode_line_numbering', GESHIFILTER_LINE_NUMBERS_DEFAULT_NONE); + $source_code = $teaser ? $node->teaser : $node->body; + $node->content['body'] = array( + '#value' => geshifilter_process($source_code, $node->source_code_language, $line_numbering), + '#weight' => 0, + ); + return $node; +} + +/** + * Callback for geshinode settings form + */ +function geshinode_settings() { + require_once drupal_get_path('module', 'geshifilter') .'/geshifilter.inc'; + $form = array(); + $form['geshinode_line_numbering'] = array( + '#type' => 'select', + '#title' => t('Line numbering'), + '#default_value' => variable_get('geshinode_line_numbering', GESHIFILTER_LINE_NUMBERS_DEFAULT_NONE), + '#options' => array( + GESHIFILTER_LINE_NUMBERS_DEFAULT_NONE => t('no line numbers'), + GESHIFILTER_LINE_NUMBERS_DEFAULT_NORMAL => t('normal line numbers'), + GESHIFILTER_LINE_NUMBERS_DEFAULT_FANCY5 => t('fancy line numbers (every @n lines)', array('@n' => GESHIFILTER_LINE_NUMBERS_DEFAULT_FANCY5)), + GESHIFILTER_LINE_NUMBERS_DEFAULT_FANCY10 => t('fancy line numbers (every @n lines)', array('@n' => GESHIFILTER_LINE_NUMBERS_DEFAULT_FANCY10)), + GESHIFILTER_LINE_NUMBERS_DEFAULT_FANCY20 => t('fancy line numbers (every @n lines)', array('@n' => GESHIFILTER_LINE_NUMBERS_DEFAULT_FANCY20)), + ), + ); + $form['geshinode_default_language'] = array( + '#type' => 'select', + '#title' => t('Default language'), + '#options' => _geshifilter_get_enabled_languages(), + '#default_value' => variable_get('geshinode_default_language', 'php'), + ); + return system_settings_form($form); +}