Skip to content

Commit

Permalink
Merge branch 'grabSimonsChanges' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
QuackFuzed committed May 13, 2012
2 parents 37d1ee6 + 2479bc0 commit dc009ae
Show file tree
Hide file tree
Showing 40 changed files with 426 additions and 196 deletions.
44 changes: 27 additions & 17 deletions Application.cfc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Xindi - http://www.getxindi.com/ - Version 2012.5.8
Xindi - http://www.getxindi.com/ - Version 2012.5.11
Copyright (c) 2012, Simon Bingham
Expand All @@ -21,7 +21,7 @@ component extends="frameworks.org.corfield.framework"
/**
* application settings
*/
this.development = ListFind( "localhost,127.0.0.1", CGI.SERVER_NAME );
this.development = ListFind( "localhost,127.0.0.1,127.0.0.1:8888", CGI.SERVER_NAME ) != 0;
this.applicationroot = getDirectoryFromPath( getCurrentTemplatePath() );
this.sessionmanagement = true;
this.mappings[ "/model" ] = this.applicationroot & "model/";
Expand Down Expand Up @@ -70,12 +70,7 @@ component extends="frameworks.org.corfield.framework"
var ValidateThisConfig = { definitionPath="/model/" };
beanFactory.addBean( "Validator", new ValidateThis.ValidateThis( ValidateThisConfig ) );
beanFactory.addBean( "MetaData", new model.beans.MetaData() );

// define revision identifier
application.revision = Hash( Now() );

// get configuration
application.config = getConfig();
beanFactory.addBean( "config", getConfig() );
}

/**
Expand All @@ -91,8 +86,8 @@ component extends="frameworks.org.corfield.framework"
// define default meta data
rc.MetaData = getBeanFactory().getBean( "MetaData" );

// store revision identifier in request context
rc.revision = application.revision;
// store config in request context
rc.config = getBeanFactory().getBean( "Config" );

// call admin on every request (used for security)
controller( "admin:main.default" );
Expand Down Expand Up @@ -133,10 +128,25 @@ component extends="frameworks.org.corfield.framework"
private struct function getConfig()
{
var config = {
enquirysettings = {
// if using caching in Railo you will need to add action="content" to the CFCACHE tags
// see http://wiki.getrailo.org/wiki/3-1-Tags:CFCache (including comments) for more information

// if using caching in ColdFusion you may wish to add usecache="#rc.config.caching.enabled#"
// to the CFCACHE tags although it is not required
caching = {
enabled = false
, timespan = CreateTimeSpan( 0, 0, 5, 0 )
}
,enquirysettings = {
subject = "Enquiry"
, emailto = ""
}
, errorsettings = {
enabled=true
, to=""
, from=""
, subject="Error Notification (#ListLast( this.applicationroot, '\/' )#)"
}
, filemanagersettings = {
allowedextensions = "txt,gif,jpg,png,wav,mpeg3,pdf,zip"
}
Expand All @@ -145,19 +155,19 @@ component extends="frameworks.org.corfield.framework"
, rsstitle = ""
, rssdescription = ""
}
, errorsettings = {
enabled=true
, to=""
, from=""
, subject="Error Notification (#ListLast( this.applicationroot, '\/' )#)"
}
, pagesettings = {
enableadddelete=true
}
, revision = Hash( Now() ) // used to force latest versions of css and js files to load in browser
, securitysettings = {
whitelist = "^admin:security,^public:"
}
};
if( this.development || !config.caching.enabled )
{
config.caching.enabled = false;
config.caching.timespan = 0;
}
return config;
}

Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Introduction

Xindi is a completely free, open source CFML content management system that uses ORM and the [nested set model] (http://en.wikipedia.org/wiki/Nested_set_model).
Xindi is a completely free, open source CFML content management system.

## Features

Expand Down Expand Up @@ -51,12 +51,18 @@ Xindi uses the frameworks listed below.

Xindi is licensed under the [MIT License (MIT)] (http://www.opensource.org/licenses/mit-license.php).

The frameworks listed above have their own licenses which you should review before using Xindi.
However, the frameworks listed above have their own licenses which you should review before using Xindi.

## Contributors

Xindi is authored by [Simon Bingham] (https://twitter.com/#!/simonbingham), [John Whish] (https://twitter.com/#!/aliaspooryorik) and [Andy Beer] (https://twitter.com/#!/squirrelfactory) but anyone and everyone is welcome to contribute.

## Problems

If you experience any problems with Xindi please either amend the source code yourself and submit a pull request or [report the issue] (https://github.com/simonbingham/xindi/issues).
If you experience any problems with Xindi please either amend the source code yourself and submit a pull request or [report the issue] (https://github.com/simonbingham/xindi/issues).

## Contact

If you would like to get in touch you can email us at [enquiries@getxindi.com] (mailto:enquiries@getxindi.com).

Alternatively, you can find us on [Twitter] (https://twitter.com/#!/getxindi), [Facebook] (http://www.facebook.com/getxindi) and [Google+] (https://plus.google.com/112798469896267857099).
2 changes: 2 additions & 0 deletions _clientfiles/Application.cfm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<!--- this is here to stop users uploading malicious cfm scripts and executing them --->
<cfabort>
9 changes: 7 additions & 2 deletions _setup/setup.sql

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions admin/assets/css/core.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ td.chevron-right{ background:url("../img/ico-chevron-right.gif") no-repeat; }
.error{ color:#B94A48; }
.inline{ margin:0; }
.inline li{ display:inline-block; margin-right:10px; }
.center{ text-align:center !important; }
#image-preview{ background:#333; border:1px solid #ccc; color:#fff; display:none; padding:5px; position:absolute; }

@media ( max-width:979px ) {
#container{ padding-top:0; }
Expand Down
5 changes: 2 additions & 3 deletions admin/assets/js/core.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$(function() {
$( function() {

// return to top of page
$( "#top-of-page" ).click(function(e){
Expand Down Expand Up @@ -71,5 +71,4 @@ $(function() {
CKEDITOR.config[ "filebrowserImageUploadUrl" ] = "";
CKEDITOR.config[ "filebrowserFlashUploadUrl" ] = "";


});
} );
5 changes: 3 additions & 2 deletions admin/controllers/filemanager.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ component accessors="true" extends="abstract"
*/

property name="FileManagerService" setter="true" getter="false";
property name="config" setter="true" getter="false";

/*
* Public methods
Expand Down Expand Up @@ -61,7 +62,7 @@ component accessors="true" extends="abstract"

void function default( required struct rc )
{
rc.listing = variables.FileManagerService.getDirectoryList( rc.currentdirectory );
rc.listing = variables.FileManagerService.getDirectoryList( rc.currentdirectory, variables.config.filemanagersettings.allowedextensions );
}

void function delete( required struct rc )
Expand All @@ -75,7 +76,7 @@ component accessors="true" extends="abstract"
void function upload( required struct rc )
{
param name="rc.file" default="";
var result = variables.FileManagerService.uploadFile( "file", rc.currentdirectory, application.config.filemanagersettings.allowedextensions );
var result = variables.FileManagerService.uploadFile( "file", rc.currentdirectory, variables.config.filemanagersettings.allowedextensions );
rc.messages = result.messages;
variables.fw.redirect( action="filemanager.default", querystring="subdirectory=#urlSafePath( rc.subdirectory )#", preserve="messages" );
}
Expand Down
3 changes: 2 additions & 1 deletion admin/controllers/main.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ component accessors="true"
*/

property name="SecurityService" setter="true" getter="false";
property name="config" setter="true" getter="false";

/*
* Public methods
Expand All @@ -37,7 +38,7 @@ component accessors="true"
void function default( required rc )
{
var securearea = true;
var whitelist = application.config.securitysettings.whitelist;
var whitelist = variables.config.securitysettings.whitelist;
rc.loggedin = variables.SecurityService.hasCurrentUser();
if ( !rc.loggedin )
{
Expand Down
4 changes: 2 additions & 2 deletions admin/controllers/pages.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ component accessors="true" extends="abstract"
rc.messages = result.messages;
if( StructKeyExists( result.messages, "success" ) )
{
var refreshsitemap = new Http( url="#rc.basehref#index.cfm/public:main/xml", method="get" );
var refreshsitemap = new Http( url="#rc.basehref#index.cfm/public:navigation/xml", method="get" );
refreshsitemap.send();
}
variables.fw.redirect( "pages", "messages" );
Expand Down Expand Up @@ -76,7 +76,7 @@ component accessors="true" extends="abstract"
rc.messages = rc.result.messages;
if( StructKeyExists( rc.messages, "success" ) )
{
var refreshsitemap = new Http( url="#rc.basehref#index.cfm/public:main/xml", method="get" );
var refreshsitemap = new Http( url="#rc.basehref#index.cfm/public:navigation/xml", method="get" );
refreshsitemap.send();
variables.fw.redirect( "pages", "messages" );
}
Expand Down
6 changes: 3 additions & 3 deletions admin/layouts/default.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@
<link href="assets/css/bootstrap.min.css" rel="stylesheet">
<link href="assets/css/bootstrap-responsive.min.css" rel="stylesheet">
<link href="assets/css/smoothness/jquery-ui-1.8.19.custom.css" rel="stylesheet">
<link href="assets/css/core.css?r=#rc.revision#" rel="stylesheet">
<link href="assets/css/core.css?r=#rc.config.revision#" rel="stylesheet">

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="assets/js/jquery-ui-1.8.19.custom.min.js"></script>
<script src="assets/js/jquery.validate.pack.js"></script>
<script src="assets/js/jquery.field.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/ckeditor/ckeditor.js"></script>
<script src="assets/js/core.js?r=#rc.revision#"></script>
<script src="assets/js/core.js?r=#rc.config.revision#"></script>

<link rel="shortcut icon" href="assets/ico/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/ico/apple-touch-icon-114-precomposed.png">
Expand All @@ -66,7 +66,7 @@
<ul class="nav pull-right">
<cfif rc.loggedin>
<li><a href="#buildURL( 'pages' )#">Pages</a></li>
<cfif application.config.newssettings.enabled><li><a href="#buildURL( 'news' )#">News</a></li></cfif>
<cfif rc.config.newssettings.enabled><li><a href="#buildURL( 'news' )#">News</a></li></cfif>
<li><a href="#buildURL( 'users' )#">Users</a></li>
<li><a href="#buildURL( 'security/logout' )#">Logout</a></li>
</cfif>
Expand Down
46 changes: 41 additions & 5 deletions admin/views/filemanager/default.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@

<link href="assets/css/bootstrap.min.css" rel="stylesheet">
<link href="assets/css/bootstrap-responsive.min.css" rel="stylesheet">
<link href="assets/css/core.css?r=#rc.revision#" rel="stylesheet">
<link href="assets/css/core.css?r=#rc.config.revision#" rel="stylesheet">

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/core.js?r=#rc.revision#"></script>
<script src="assets/ckeditor/ckeditor.js"></script>
<script src="assets/js/core.js?r=#rc.config.revision#"></script>

<link rel="shortcut icon" href="assets/ico/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/ico/apple-touch-icon-114-precomposed.png">
Expand Down Expand Up @@ -111,24 +112,28 @@
</tr>
</cfif>
<cfelse>
<cfset local.relativepathtofile = rc.basehref & rc.clientfilesdirectory & rc.subdirectory & "/" & rc.listing.name>

<tr>
<td><i class="icon-file"></i></td>
<td><a href="##" onclick="return sendToEditor( '#rc.listing.name#' )">#rc.listing.name#</a></td>
<td>#NumberFormat( rc.listing.size / 1024 )# kb</td>
<td><a href="##" onclick="return sendToEditor( '#rc.listing.name#' )" <cfif IsImageFile( local.relativepathtofile )>class="image-preview" rel="#local.relativepathtofile#"</cfif>>#rc.listing.name#</a></td>
<td <cfif rc.listing.size gt 15360>class="error"</cfif>>#NumberFormat( rc.listing.size / 1024 )# kb</td>
<td><a href="#buildURL( action='filemanager.delete', querystring='subdirectory=*#urlSafePath( rc.subdirectory )#&delete=#rc.listing.name#' )#" title="Delete"><i class="icon-remove"></i></a></td>
</tr>
</cfif>
</cfloop>
</tbody>
</table>

<p class="error">Large files are highlighted and will be slow to download.</p>
<cfelse>
<hr />

<p>There are currently no files.</p>
</cfif>

<script>
function sendToEditor(fileUrl){
function sendToEditor( fileUrl ){
window.opener.CKEDITOR.tools.callFunction( #session.CKEditorFuncNum#, "#rc.clientfilesdirectory##rc.subdirectory#/" + fileUrl );
window.close();
return false;
Expand All @@ -139,6 +144,37 @@
window.location.href = url + "/newdirectory/" + newdirectory;
return false;
}
// method to display image preview on mouse over in file manager
this.imagePreview = function(){
xOffset = 10;
yOffset = 30;
$( "a.image-preview" ).hover( function( e ){
this.t = this.title;
this.title = "";
var c = ( this.t != "" ) ? "<br/>" + this.t : "";
$( "body" ).append( "<p id='image-preview'><img src='"+ this.rel +"' alt='url preview' />"+ c +"</p>" );
$( "##image-preview" )
.css( "top",( e.pageY - xOffset ) + "px" )
.css( "left", (e.pageX + yOffset) + "px" )
.css( "width", "300px" )
.fadeIn( "fast" );
},
function(){
this.title = this.t;
$( "##image-preview" ).remove();
});
$( "a.image-preview" ).mousemove( function( e ){
$( "##image-preview" )
.css( "top", ( e.pageY - xOffset ) + "px" )
.css( "left", ( e.pageX + yOffset ) + "px" )
.css( "width", "300px" );
});
};
$( function() {
imagePreview();
});
</script>
</div>
</div>
Expand Down
6 changes: 4 additions & 2 deletions admin/views/news/default.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
<tr>
<th>Title</th>
<th>Published</th>
<th>Delete</th>
<th class="center">View</th>
<th class="center">Delete</th>
</tr>
</thead>

Expand All @@ -38,7 +39,8 @@
<tr>
<td><a href="#buildURL( action='news.maintain', querystring='articleid/#local.Article.getArticleID()#' )#" title="Edit #local.Article.getTitle()#">#local.Article.getTitle()#</a></td>
<td>#DateFormat( local.Article.getPublished(), "full" )#</td>
<td><a href="#buildURL( 'news.delete' )#/articleid/#local.Article.getArticleID()#" title="Delete"><i class="icon-remove"></i></a></td>
<td class="center"><cfif local.Article.isPublished()><a href="#buildURL( action='public:news.article', querystring='uuid=#local.Article.getUUID()#' )#" title="Preview Page" target="_blank"><i class="icon-eye-open"></i></a></cfif></td>
<td class="center"><a href="#buildURL( 'news.delete' )#/articleid/#local.Article.getArticleID()#" title="Delete"><i class="icon-remove"></i></a></td>
</tr>
</cfloop>
</tbody>
Expand Down
18 changes: 10 additions & 8 deletions admin/views/pages/default.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@
<tr>
<th>Title</th>
<th>Published</th>
<cfif application.config.pagesettings.enableadddelete><th>Add Sub Page</th></cfif>
<th>Move Up</th>
<th>Move Down</th>
<cfif application.config.pagesettings.enableadddelete><th>Delete</th></cfif>
<th class="center">View</th>
<cfif rc.config.pagesettings.enableadddelete><th class="center">Add Page</th></cfif>
<th class="center">Move Up</th>
<th class="center">Move Down</th>
<cfif rc.config.pagesettings.enableadddelete><th class="center">Delete</th></cfif>
</tr>
</thead>

Expand All @@ -46,10 +47,11 @@
</cfif>
</td>
<td>#DateFormat( local.Page.getCreated(), "full" )#</td>
<cfif application.config.pagesettings.enableadddelete><td><a href="#buildURL( action='pages.maintain', querystring='ancestorid/#local.Page.getPageID()#' )#" title="Add Page"><i class="icon-plus-sign"></i></a></td></cfif>
<td><cfif local.Page.hasPreviousSibling()><a href="#buildURL( action='pages.move', querystring='pageid/#local.Page.getPageID()#/direction/up' )#" title="Move Up"><i class="icon-chevron-up"></i></a></cfif></td>
<td><cfif local.Page.hasNextSibling()><a href="#buildURL( action='pages.move', querystring='pageid/#local.Page.getPageID()#/direction/down' )#" title="Move Down"><i class="icon-chevron-down"></i></a></cfif></td>
<cfif application.config.pagesettings.enableadddelete><td><cfif local.Page.isLeaf() and !local.Page.isRoot() and !local.Page.hasRoute( local.routes )><a href="#buildURL( 'pages.delete' )#/pageid/#local.Page.getPageID()#" title="Delete"><i class="icon-remove"></i></a></cfif></td></cfif>
<td class="center"><a href="#buildURL( action="public:" & local.Page.getSlug() )#" title="View" target="_blank"><i class="icon-eye-open"></i></a></td>
<cfif rc.config.pagesettings.enableadddelete><td class="center"><a href="#buildURL( action='pages.maintain', querystring='ancestorid/#local.Page.getPageID()#' )#" title="Add Page"><i class="icon-plus-sign"></i></a></td></cfif>
<td class="center"><cfif local.Page.hasPreviousSibling()><a href="#buildURL( action='pages.move', querystring='pageid/#local.Page.getPageID()#/direction/up' )#" title="Move Up"><i class="icon-chevron-up"></i></a></cfif></td>
<td class="center"><cfif local.Page.hasNextSibling()><a href="#buildURL( action='pages.move', querystring='pageid/#local.Page.getPageID()#/direction/down' )#" title="Move Down"><i class="icon-chevron-down"></i></a></cfif></td>
<cfif rc.config.pagesettings.enableadddelete><td class="center"><cfif local.Page.isLeaf() and !local.Page.isRoot() and !local.Page.hasRoute( local.routes )><a href="#buildURL( 'pages.delete' )#/pageid/#local.Page.getPageID()#" title="Delete"><i class="icon-remove"></i></a></cfif></td></cfif>
</tr>
</cfloop>
</tbody>
Expand Down
4 changes: 2 additions & 2 deletions admin/views/users/default.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<th>Name</th>
<th>Email</th>
<th>Created</th>
<th>Delete</th>
<th class="center">Delete</th>
</tr>
</thead>

Expand All @@ -40,7 +40,7 @@
<td><a href="#buildURL( action='users.maintain', querystring='userid/#local.User.getUserID()#' )#" title="Edit #local.User.getFullName()#">#local.User.getFullName()#</a></td>
<td><a href="mailto:#local.User.getEmail()#">#local.User.getEmail()#</a></td>
<td>#DateFormat( local.User.getCreated(), "full" )#</td>
<td><a href="#buildURL( 'users.delete' )#/userid/#local.User.getUserID()#" title="Delete"><i class="icon-remove"></i></a></td>
<td class="center"><a href="#buildURL( 'users.delete' )#/userid/#local.User.getUserID()#" title="Delete"><i class="icon-remove"></i></a></td>
</tr>
</cfloop>
</tbody>
Expand Down
Loading

0 comments on commit dc009ae

Please sign in to comment.