FCKEditor and Ajax Requests

This took me a while to figure out, so I hope this little tidbit helps someone…

If you want to send XHTML over GET or POST in an Ajax request with FCKEditor, be sure to do something like this:

var pars = 'page_content=' + escape(FCKeditorAPI.GetInstance('page_content').GetXHTML());

The critical part of this is escape() – it is the javascript equivalent of PHP’s urlencode.

Some Answers

Lee asked a few questions about the app, so I’ll answer ‘em here…

- How do you handle interactive elements – like forms?

At the moment, it’s really only for static pages. Currently the way I’m doing this is keeping the “content” and the interactive parts of the site separated.

- Will it be designed to handle add-ons?

Add-ons is a big term. I don’t see why someone would not be able to extend it, but currently writing the ability in for add-ons like mambots is a little overkill for my purpose.

- Will you be able to make “on-the-fly” changes to the html/css with certain permissions?

Nope. Let me explain the permissions a little more in depth when you ask about users. There’s going to be one CSS file powering the entire site that the app uses (and that is all set up by me)

- Is there a permissions scheme for users?

See the next answer.

- How do you handle users?

Currently I am doing it through something called LDAP. Think about it like this – the username and password you have for logging in to your computer, checking your email, and file server permissions is all the same. Why give users another account to deal with? Also, our LDAP system forces passwords to be changed at a specified interval.

In an LDAP setup, there are also user groups or “organizational units”. The way our system is set up is that each department/entity has it’s own group. Instead of dealing with a lot of permissions, I give everyone in the “Group A” group the ability to do whatever they want to do to Group A’s website.

There is a global admin — and it’s pretty easy to change. Think of it like editing a config file. I have a control panel that lists all of our user groups and links to edit their sites.

- What about images? I uploaded an image, but now I don’t know how to link it… and does it make automatic thumbnails? (edit – n/m – I found it, it’s just not graphical)

Images are a big concern. I will be thinking about how I want to handle this…

- Why is the sky blue?

Answer.

- Clicking on a child page does not keep the parent/child expanded menu open in nav

Right. Thank you. Will work on it.

- LOVE THE RE-ORDER NAV THING. HOLY CRAP, THAT IS COOL.

Thanks. Here’s how I did it.

- I did break it. I applied styles (custom bold, title) then de-applied them. Text disappeared. Plus, the text “here are the real questions” has the style “Code” applied – yet it doesn’t appear as such on the page.

I haven’t really done a lot of playing with the WYSIWYG except for pasting material in from MS Word with the “Paste from Word” button.

The Demo At Last

If you’re interested in a demo of what I’ve been referring to as “the app”, figure out a way to contact me about getting a URL and a Login/Pass.

Some more notes about it:

- Moving it to the server was a great learning experience. I’ve already made substantial improvements in performance and future compatibility which unfortunately are not in the version that I have somewhere on the web for demonstration purposes.

- The application’s purpose is becoming a lot more clear. It’s designed for the end users who need to be able to easily maintain the static parts of sites. It seems that everyone around here needs some type of database functionality. The directory structure I’ve been using is “site_url/content/page” for the static types of pages and “site_url/app/application” for others. I think it’s going to be pretty nice.

- It’s still early. I haven’t decided on a good way for users to include images in their pages. I originally wanted them to use some sort of 3rd photo gallery option, but that is not really sufficient regular inline images. Suggestions/ideas are welcome. I’d rather not do the uploading and thumbnailing on the server. =)

- The idea behind this is that I still maintain 100% of the control of the site’s “structure”/”look” while someone (typically a departmental secretary) maintains the content without having to talk to me. It’s very easy for me to make a new site with XHTML/CSS that uses content from this system.

They Upgraded, I’m getting it out there

So I’m working on getting everything working so I can test.

Lessons learned so far:

-Develop on the platform you’re implement on. Since I was developing this entirely locally with a WAMP server, I’ve run into a few quirks. Mainly with my inconsistent instantiation $nav = new Navigation(); versus $nav = new navigation(); — with PHP’s autoload function it was causing my stuff to die.

- Again with platform… backslashes versus forward slashes … ugh. Let’s also remember some servers have magic quotes enabled and some do not, in case you’re inserting to a database…

- Load times are a little slower than I was hoping for… I am going to try it later tonight to see if it’s an issue here, an application issue, or a dreamhost issue.

Google Maps MouseWheel Subtlety

It’s not much of a secret that you can use your Mouse Wheel with Google Maps… but you have to love the sense of direction even the smallest UI cue gives you:

Zooming Out:

zoom-out.gif

Zooming In:

zoom-in.gif

The Last 5%

A couple of days ago I mentioned the first indoctrination of “the app” is 95% done. The last 5% is hard. I’m actually spending this time removing a couple of those oh-so-nifty AJAX features.

The problem is they were taking away from page loads. I originally wanted to “deep link” to a couple of features, such as “Edit Content for this Page” and that wasn’t too possible because the WYSIWYG interface was being pulled up through an AJAX response.

So… I’m taking that (and a couple of others) out and fixing them.

I maaaaaaaay have a demo online by the beginning of the next week for review/suggestions. Wouldn’t that be special?

Rewrite’s Complete

That wasn’t too bad. It took me probably two days total to completely overhaul the app’s model to an object based design. Those two days are going to save me many many days down the road.

More updates today… lunch time.

Rewriting the App

In the interest of maintenance, learning, and becoming a reputable developer… I’ve decided to take today to rewrite the entire “killer app” that I’ve been talking about with objects.

Previously it was a big back of function soup in one large included functions.php (31 functions)… so here goes nothing. I’ll post the progress. If I’m happy, I’ll post the source.

Sortables with Scriptaculous, PHP, and MySQL in 6 Easy Steps

Hopefully I’ll start doing more of these tutorials. I posted about this a while ago, but it really sucked. I think this is much better.

Sortables with Scriptaculous, PHP, and MySQL in 6 Easy Steps

Here’s the Demo.

Feedback?

More about the unnamed Killer App

Alright, since Mr. “I’m Published” Sanders asked…

One of the core features of the app is LDAP authentication. It’s not that hard to do in PHP, but instead of maintaining a robust set of read/write/edit/delete permissions I’m letting LDAP take over. We have a well maintained user directory and I fully intend to utilize it.

The app is a wiki in the sense that any member of the OU has full control over their OU’s site. I’m a member of the Information Services OU, I have full permissions to edit any page on Information Service’s site.

That’s where accountability comes in – the app records who made the last revisions and keeps a copy of the previous state of the site. I’m debating on keeping the last N revisions, just to make it uber accountable.

Other features: Lots and lots of AJAX and a very popping user interface (in terms of response). I’m also offering users file uploads ALA GMail’s file attachment (add another/remove). I’m using the lethal scriptaculous/prototype/behaviour combination. Some screenshots:

app1.png app2.png

The WYSIWYG engine I’m using is FCKeditor with some custom configuration.

Re: WordPress MU

WordPress MU does not have reliable LDAP support that I know of although it’s offered in plugin format. It also does not meet my needs because I will need to integrate it across several domains and combine it with several apps. Basically, each department I work with will have a “stock” set of static pages that are occaisionally updated along with a couple of custom apps that I develop as we go that will need to be integrated into their site. MU also doesn’t have the accountability built in that I desire (that I know of).

I’m not married to the idea of the “Killer App” yet. If there’s something better out there that will meet my very specific needs, let me know.

Follow

Get every new post delivered to your Inbox.