You are free to skin the interface of the application to however you see fit to your project. In order to do so, you need to edit the stylesheet and change the logo and images.
The stylesheet is located in [%application directory%]/styles/styles.css
The images are locatin in [%application directory%]/images/
The XML output of this application is based on a database query. To view the XML output publicly, go to your application for example:
http://demo.gallerycms.com/index.php/view - and view the Source of the page. You will see that is it perfectly formatted XML.
So in Flash, you need to define your XML path according to your installed application's directory + /index.php/view
As long as your SWF is making a document or root-relative call, you will avoid any sandbox restrictions.
Let's pretend our GalleryCMS installation is located at http://www.example.com/admin
This is how your code should look below when you publish to avoid sandbox restrictions:
var xmlFile:String = "/admin/index.php/view";
var loadMenuXML:URLLoader = new URLLoader();
var reqMenuXML:URLRequest = new URLRequest(xmlFile);
loadMenuXML.addEventListener(Event.COMPLETE, parseXML);
loadMenuXML.load(reqMenuXML);
function parseXML(e:Event):void {
// run your parsing here
}
When you are testing your SWF in Test Movie mode locally, change (so you can debug and see what you're doing):
var xmlFile:String = "http://www.example.com/admin/index.php/view"
Same concept as before, just different syntax.
var xml:XML = new XML();
var xmlFile:String = "/admin/index.php/view";
xml.ignoreWhite = true;
xml.onLoad = function(success) {
if (success) {
// run your parsing here...
} else {
trace("Cannot connect to XML file");
}
};
xml.load(xmlFile);
You will find that the XML that GalleryCMS outputs a certain XML tree. Some elements you may or may not need. You may like to keep the tree as it is and change your parser. If you have an existing gallery and want to use this, and not make changes in Flash, you will need to change the way the XML is being formatted.
To do so open: application/views/view_xml.php
Current Source:
<?php echo('<?xml version="1.0" encoding="UTF-8"?>'.PHP_EOL); ?>
<gallery>
<?php if(isset($row)) {
foreach($row as $r) { ?>
<category>
<title><![CDATA[<?php echo $r->title;?>]]></title>
<description><![CDATA[<?php echo $r->description;?>]]></description>
<assets>
<?php if(isset($r->images)) {
foreach($r->images as $img) { ?>
<image>
<large><?php echo base_url();?>uploads/<?php echo $img->filename;?></large>
<thumbnail><?php echo base_url();?>uploads/<?php echo $img->thumbnail;?></thumbnail>
<caption><![CDATA[<?php echo $img->caption;?>]]></caption>
</image>
<?php } } ?>
</assets>
</category>
<?php } } ?>
</gallery>
This is the file you will need to change in order to get an XML tree to suit your project.
Preview the JSON output: http://demo.gallerycms.com/index.php/view/json
JSON output is now available as an alternative to using XML. This also opens the CMS up to JavaScript front-end galleries.