📄 advmphp.pas
字号:
unit advmphp;
{$I TMSDEFS.Inc}
interface
uses
Classes, AdvMemo,
{$IFDEF TMSCLX}
QGraphics
{$ENDIF}
{$IFNDEF TMSCLX}
Graphics
{$ENDIF}
;
type
TAdvPHPMemoStyler = class(TAdvCustomMemoStyler)
public
constructor Create(AOwner: TComponent); override;
published
property BlockStart;
property BlockEnd;
property LineComment;
property MultiCommentLeft;
property MultiCommentRight;
property CommentStyle;
property NumberStyle;
property AllStyles;
property AutoCompletion;
property HintParameter;
property HexIdentifier;
end;
implementation
//uses Graphics;
constructor TAdvPHPMemoStyler.Create(AOwner: TComponent);
var
itm:TElementStyle;
begin
inherited;
Description := 'PHP and E107';
StylerName := Description;
Extensions := 'php';
BlockStart := '{';
BlockEnd := '}';
LineComment := '//';
MultiCommentLeft := '/*';
MultiCommentRight := '*/';
CommentStyle.TextColor := clNavy;
CommentStyle.BkColor := clWhite;
CommentStyle.Style := [fsItalic];
NumberStyle.TextColor := clFuchsia;
NumberStyle.BkColor := clWhite;
NumberStyle.Style := [fsBold];
itm := AllStyles.Add;
itm.Info := 'PHP Standard';
itm.Font.Color := clGreen;
itm.Font.Style := [fsBold];
with itm.KeyWords do
begin
Add('BREAK');
Add('CLASS');
Add('CONTINUE');
Add('DECLARE');
Add('DEFINE');
Add('DO');
Add('ECHO');
Add('ELSE');
Add('ELSEIF');
Add('FOR');
Add('FOREACH');
Add('FUNCTION');
Add('IF');
Add('INCLUDE');
Add('INCLUDE_ONCE');
Add('PRINT');
Add('REQUIRE');
Add('REQUIRE_ONCE');
Add('RETURN');
Add('SWITCH');
Add('WHILE');
end;(* with *)
itm := AllStyles.Add;
itm.Info := 'E107';
itm.Font.Color := clOlive;
itm.Font.Style := [fsBold];
with itm.KeyWords do
begin
Add('AVATAR');
Add('BAN');
Add('check_class');
Add('convert_date');
Add('dbError');
Add('db_Close');
Add('db_Connect');
Add('db_Count');
Add('db_Delete');
Add('db_Fetch');
Add('db_Fieldname');
Add('db_Insert');
Add('db_Rows');
Add('db_Select');
Add('db_Select_gen');
Add('db_Update');
Add('delete_item');
Add('delete_poll');
Add('editparse');
Add('edit_item');
Add('enter_comment');
Add('flood');
Add('form_button');
Add('form_checkbox');
Add('form_comment');
Add('form_file');
Add('form_hidden');
Add('form_open');
Add('form_option');
Add('form_password');
Add('form_radio');
Add('form_select_close');
Add('form_select_open');
Add('form_text');
Add('form_textarea');
Add('getip');
Add('getperms');
Add('gettime');
Add('init_session');
Add('online');
Add('preview');
Add('render_comment');
Add('render_newsitem');
Add('render_poll');
Add('r_emote');
Add('save_prefs');
Add('sendemail');
Add('set_error_handler');
Add('submit_item');
Add('submit_poll');
Add('tablerender');
Add('cache_fname');
Add('tp');
Add('tpa');
Add('update_cache');
Add('userlogin');
Add('e107cache_page_md5');
Add('set');
Add('set_cache');
Add('retrieve_cache');
Add('clear');
Add('delete');
Add('checkvalidtheme');
Add('e107_parse');
Add('textparse');
Add('editparse');
Add('tpj');
end;(* with *)
//------------Simple Quote ' '----------------
itm := AllStyles.Add;
itm.StyleType := stBracket;
itm.Info := 'Simple Quote';
itm.Font.Color := clBlue;
itm.Font.Style := [];
itm.BracketStart := #39;
itm.BracketEnd := #39;
//------------Double Quote " "----------------
itm := AllStyles.Add;
itm.StyleType := stBracket;
itm.Info := 'Double Quote';
itm.Font.Color := clBlue;
itm.Font.Style := [];
itm.BracketStart := '"';
itm.BracketEnd := '"';
//----------SYMBOL --------------
itm := AllStyles.Add;
itm.StyleType := stSymbol;
itm.Info := 'Symbols Delimiters';
itm.Font.Color := clred;
itm.Font.Style := [];
itm.Symbols := #32+',;:.()&{}[]=-*/^%<>#'+#13+#10;
with HintParameter.Parameters do
begin
{ TODO 1 -ctodo : miten int ja void juttujen k鋝ittely. }
Add('print( string arg ) : int;');
Add('printf ( string format [, mixed args]);');
(* E107-SPESIFIC *)
Add('Avatar($user_image);');
Add('ban();');
Add('check_class($var, $userclass=USERCLASS);');
Add('convert_date($datestamp, $mode="long");');
Add('dbError($Form);');
Add('db_Close();');
Add('db_Connect($mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb);');
Add('db_Count($table, $fields="(*)", $arg="");');
Add('db_Delete($table, $arg="");');
Add('db_Fetch();');
Add('db_Fieldname($offset);');
Add('db_Insert($table, $arg);');
Add('db_Rows();');
Add('db_Select($table, $fields="*", $arg="", $mode="default");');
Add('db_Select_gen($arg);');
Add('db_Update($table, $arg);');
Add('delete_item($news_id);');
Add('delete_poll($existing);');
Add('editparse($text, $mode="off");');
Add('edit_item($existing);');
Add('enter_comment($author_name, $comment, $table, $id);');
Add('flood($table, $orderfield);');
Add('form_button($form_type, $form_name, $form_value, $form_js="", $form_image="", $form_tooltip="");');
Add('form_checkbox($form_name, $form_value, $form_checked=0, $form_tooltip="");');
Add('form_comment();');
Add('form_file($form_name, $form_size, $form_tooltip="");');
Add('form_hidden($form_name, $form_value);');
Add('form_open($form_method, $form_action, $form_name="", $form_target= "", $form_enctype="");');
Add('form_option($form_method, $form_action, $form_name="", $form_target = "", $form_enctype="");');
Add('form_password($form_name, $form_size, $form_value, $form_maxlength, $form_class="tbox", $form_readonly="", $form_tooltip="");');
Add('form_radio($form_name, $form_value, $form_checked=0, $form_tooltip="");');
Add('form_select_close();');
Add('form_select_open($form_name);');
Add('form_text($form_name, $form_size, $form_value, $form_maxlength, $form_class="tbox", $form_readonly="", $form_tooltip="");');
Add('form_textarea($form_name, $form_columns, $form_rows, $form_value, $form_js="", $form_style="", $form_wrap="", $form_readonly="", $form_tooltip="");');
Add('getip();');
Add('getperms($arg, $ap = ADMINPERMS);');
Add('gettime();');
Add('init_session();');
Add('online($page);');
Add('preview($news_id, $news_title, $news_body, $news_extended, $news_source, $news_url, $cat_id, $allow_comments, $active_start, $active_end, $news_active);');
Add('render_comment($row);');
Add('render_newsitem($news_id, $news_title, $news_body, $news_extended, $news_source, $news_url, $news_author, $comment_total, $category_id, $datestamp, $allow_comments, $active_start, $active_end, $news_active, $modex="");');
Add('render_poll($poll_id, $poll_question, $poll_option, $votes, $mode, $type="menu");');
Add('r_emote();');
Add('save_prefs($table = "core");');
Add('sendemail($send_to, $subject, $message);');
Add('set_error_handler($type, $message, $file, $line, $context);');
Add('submit_item($news_id, $news_title, $news_body, $news_extended, $news_source, $news_url, $category_id, $allow_comments, $news_start, $news_end, $news_active);');
Add('submit_poll($poll_id, $poll_name, $poll_option, $activate, $id=0, $ref="menu");');
Add('tablerender($caption, $text, $mode="default");');
Add('cache_fname($query);');
Add('tp($text, $mode="off");');
Add('tpa($text, $mode="off");');
Add('update_cache($table);');
Add('userlogin($username, $userpass, $autologin);');
Add('e107cache_page_md5();');
Add('set($query, $text);');
Add('set_cache();');
Add('retrieve_cache($query);');
Add('clear();');
Add('delete($dir, $pattern);');
Add('checkvalidtheme($theme_to_check);');
Add('e107_parse($text,$referrer);');
Add('textparse();');
Add('editparse($text, $mode="off");');
Add('tpj();');
end;
with AutoCompletion do
begin
{ TODO 1 -ctodo : miten pit滗 lis鋞
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -