[SOLVED] Exporting your module to XML (CreateXMLPackage)

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
Guido
Forum Members
Forum Members
Posts: 221
Joined: Sat Aug 29, 2009 3:00 pm

[SOLVED] Exporting your module to XML (CreateXMLPackage)

Post by Guido »

As I'm just beginning with developing for CMSMS, and am now creating the Ace Editor for CMSMS 2.x, I'd like some help on the following function from the main CMSModule class:

Code: Select all

CreateXMLPackage(string &$message, int &$filecount) : string
I understand the two arguments, they're not that hard. But should I place it in an action file? and then create something like:

Code: Select all

{cms_action_url action=MY_XML_EXPORT_ACTION_FILE}
in my admin page? And will this send an XML file to my browser?

Also, I can use it as a method of $this I think? Since it is a CMSModule class method and the module class extends that class?
Last edited by Guido on Sat Jan 09, 2016 1:50 pm, edited 1 time in total.
Jos
Support Guru
Support Guru
Posts: 4017
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

Re: Exporting your module to XML (CreateXMLPackage)

Post by Jos »

You need to add a setting to your config.php
developer_mode
Description: This config variable enables various functionality (Particularly in the ModuleManager) that is intended primarily for module developers.
Status: Optional
Type: boolean
Example: $config['developer_mode'] = true;
Default Value: false
After that you will see buttons in the list with modules. Hit the button and you will get the xml file
Guido
Forum Members
Forum Members
Posts: 221
Joined: Sat Aug 29, 2009 3:00 pm

Re: Exporting your module to XML (CreateXMLPackage)

Post by Guido »

Ah, thanks! Didn't know that, saves me the trouble of manually having to make this.

EDIT

Hmm, weird. Isn't working for me. I cleared the cache several times of course, but no cigar. You mean the module list in the Module Manager right?
Jos
Support Guru
Support Guru
Posts: 4017
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

Re: Exporting your module to XML (CreateXMLPackage)

Post by Jos »

Yes, after adding $config['developer_mode'] = true; to your config.php you will get a new column "Export" in ModuleManager. No need to clear cache.
Guido
Forum Members
Forum Members
Posts: 221
Joined: Sat Aug 29, 2009 3:00 pm

Re: Exporting your module to XML (CreateXMLPackage)

Post by Guido »

I have an old install of the 1.12 series, here the column is present by default. But in my fresh 2.1.1 install I set the developer mode in the config file but still no column in the module manager.

Here is the system info:
--------------------------------------------------------------------------------
Cms Version: 2.1.1

Installed Modules:

AdminSearch: 1.0
CMSContentManager: 1.1
DesignManager: 1.1.1
FileManager: 1.5.2
MicroTiny: 2.0.2
ModuleManager: 2.0.1
Navigator: 1.0.2
News: 2.50.3
Search: 1.50.2
TinyMCE: 3.0-alpha1
AceEditor2: 0.1


Config Information:

php_memory_limit:
max_upload_size: 64000000
url_rewriting: none
page_extension:
query_var: page
auto_alias_content: true
locale:
set_names: true
timezone: Europe/Amsterdam
permissive_smarty: false


Php Information:

phpversion: 5.4.45
md5_function: Aan (Waar)
json_function: Aan (Waar)
gd_version: 2
tempnam_function: Aan (Waar)
magic_quotes_runtime: Uit (Onwaar)
E_STRICT: 0
E_DEPRECATED: 0
test_file_timedifference: Geen tijdsverschillen gevonden
test_db_timedifference: Geen tijdsverschillen gevonden
create_dir_and_file: 1
memory_limit: 128M
max_execution_time: 30
register_globals: Uit (Onwaar)
output_buffering: 4096
disable_functions:
open_basedir: /home/majorlabel/:/tmp:/var/tmp:/usr/local/lib/php/:/usr/local/php54/lib/php/:/usr/local/php56/lib/php/
test_remote_url: Succes
file_uploads: Aan (Waar)
post_max_size: 64M
upload_max_filesize: 64M
session_save_path: Geen controle omdat 'open_basedir' actief is
session_use_cookies: Aan (Waar)
xml_function: Aan (Waar)
xmlreader_class: Aan (Waar)
check_ini_set: Aan (Waar)
curl: Aan


Performance Information:

allow_browser_cache: Uit (Onwaar)
browser_cache_expiry: 60
php_opcache: Uit (Onwaar)
smarty_cache: Uit (Onwaar)
smarty_compilecheck: Uit (Onwaar)
smarty_cache_udt: Uit (Onwaar)
auto_clear_cache_age: Aan (Waar)

Server Information:

Server Software: Apache/2
Server Api: apache2handler
Server Os: Linux 2.6.32-573.12.1.el6.x86_64 Aan x86_64
Server Db Type: MySQL (mysqli)
Server Db Version: 5.6.27
Server Db Grants: Er is een "GRAND ALL" permissie gevonden, alles lijkt in orde.
Jos
Support Guru
Support Guru
Posts: 4017
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

Re: Exporting your module to XML (CreateXMLPackage)

Post by Jos »

Did you look at the tab "Installed" in ModuleManager?
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: Exporting your module to XML (CreateXMLPackage)

Post by Rolf »

Look for the orange XML button
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Guido
Forum Members
Forum Members
Posts: 221
Joined: Sat Aug 29, 2009 3:00 pm

Re: Exporting your module to XML (CreateXMLPackage)

Post by Guido »

Stupid mistake on my side. I was used to CMSMS 1.12 series, that don't auto set the config.php file to 444 after install. I saved it but never saw the error in FileZilla telling me about the failed upload.
Jeff
Power Poster
Power Poster
Posts: 961
Joined: Mon Jan 21, 2008 5:51 pm
Location: MI

Re: [SOLVED] Exporting your module to XML (CreateXMLPackage)

Post by Jeff »

If the XML button isn't visible for the module row, make sure the module directory and all files are writable.
Guido
Forum Members
Forum Members
Posts: 221
Joined: Sat Aug 29, 2009 3:00 pm

Re: [SOLVED] Exporting your module to XML (CreateXMLPackage)

Post by Guido »

Thanks, but my problem was already solved. I edited the config.php file in Filezilla, which was working in the remote server. Before opening the config.php file, I forgot to set it to writeable (since CMSMS 2.x auto-444's it after install now). So I was hitting CTRL+S and missed the error in Filezilla about the file not being writeable.
Post Reply

Return to “Developers Discussion”