Child pages
  • cPanel API 1 Functions - Fileman::htmleditor
Skip to end of metadata
Go to start of metadata

Description

This function opens a file in the HTML editor.

Warning:

cPanel API 1 is deprecated. We strongly recommend that you do not use cPanel API 1. However, no equivalent function exists in our newer APIs.


Examples


 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$open_html_editor = $cpanel->api1('Fileman', 'htmleditor', array('public_html', 'myfile.html', 'http://www.example.com/home/user/', '/home/user/public.html', 'UTF-8', '1')); // Call the function.


Note:

For more information, read our Guide to the LiveAPI System.

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $open_html_editor = $cpliveapi->api1('Fileman', 'htmleditor' ['public_html', 'myfile.html', 'http://www.example.com/home/user/', '/home/user/public.html', 'UTF-8', '1']); # Call the function.


Note:

For more information, read our Guide to the LiveAPI System.

 cPanel Tag System (deprecated)


Warning:

In cPanel & WHM version 11.30 and later, cPanel tags are deprecated. We provide this example to help developers move from the old cPanel tag system to our LiveAPI system. We strongly recommend that you only use the LiveAPI system to call the cPanel APIs.

<cpanel Module="Fileman::htmleditor ( $FORM('dir','file','baseurl','basedir','charset','write_stdin'))">
 Command Line
cpapi1 --user=username Fileman htmleditor public_html myfile.html http://www.example.com/home/user /home/user/public.html UTF-8 1


Notes:

  • You must URI-encode these values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to cPanel API 1 documentation or run the cpapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the cpapi1 command:

    /usr/local/cpanel/bin/cpapi1

 Output (web browser)

This function opens the HTML editor.

Parameters

ParameterTypeDescriptionPossible valuesExample
dirstring

Required

The file's directory.

Any valid directory name.public_html
filestring

Required

The file to open.

Any valid filename.myfile.tar
baseurlstring

Required

The base URL for automated functions.

Any valid base URL.
http://www.example.com/home/user/
basedirstring

The HTML file's base directory.

This value defaults to the home/user/public_html directory.

Any valid base directory.home/user/public_html
charsetstring

Required

The character set in which to encode the HTML.

Any valid character set.UTF-8
write_stdinBoolean

Required

Whether to replace the default HTML editor template strings with the values represented in the HTML editor's configuration hash.

  • 0 — Do not replace.
  • 1 — Replace.
1

Returns

This function opens the HTML editor in a web browser.