RSS - Latest postsThinkRobot

17Feb
2009

Zend Framework Decorators – Labels and Checkboxes

Very often it is the smallest things that annoy us the most. It took me a while to figure out why the placement parameter was not changing anything. I started of with the following:

'decorators' => array(
	array('Label'),
	array('ViewHelper')
)

(more…)

Categories:

28Dec
2008

Using Zend_Mail and Google SMTP to send emails

You can set this globally, for example in your bootstrap.php file:

$tr = new Zend_Mail_Transport_Smtp('smtp.gmail.com', array(
	'auth' => 'login',
	'username' => 'YOUR_USERNAME@gmail.com',
	'password' => 'YOUR_PASSWORD',
	'ssl' => 'ssl',
	'port' => 465)
);
Zend_Mail::setDefaultTransport($tr);

(more…)

Categories:

13Dec
2008

Strong ownership list approach

When you are your own boss, things like responsibilities and project ownership are pretty obvious – you are liable for everything, period. However when working at an agency with projects coming and going, and sometimes resurfacing after even years of dormant life things get a bit more complicated.

At some point we tried to introduce project ownership. This unfortunately gets a bit problematic when you hit the projects that no one has any clue about and the original developer has left ages ago (or it can even be unclear who the original developer was!). It does mean that someone eventually will know something about the orphaned projects once they take responsibility for them. Though again in case that person moves on, the situation will start over.
(more…)

Categories:

12Nov
2008

WordPress NextGen gallery tweak

Recently I found myself in that very anoying situation where a very good piece of software seemed to lack just this one function… again. I have been doing a gallery website and used the NextGen gallery plugin to display the photos. Unfortunatelly it was a case of a gallery per post with about 1 or 2 photos per gallery.

The biggest issue with this setting was the process of creating galleries. By default in NextGen you create the gallery on one page, upload the images in another, and then create new post yet elsewhere. But there had to be a way to at least merge the gallery creation with photo upload, especially considering a new gallery form consisted of a single “gallery name” field. (more…)

Categories:

7Nov
2008

Nested sortable using jTree – clickable links

jTree is a lightweight solution for nested, sortable lists based on jQuery. I’ve been trying to find a good solution for quite a while, however the only good competitor to jTree is now not compatible with the new jQuery (1.2.6). After getting fed up at work with including totally different sets of javascript files depending on whether the nested sortable was needed on a page or not I have decided it was time for some clean-up.

Minimal is a very good word to describe jTree, which most of the time is good, however sometimes you might just want a little bit more. One of the biggest issues for me was lack of clickable links inside the LIs. Fortunately after some tweaking I came up with a hacky but working solution:

if ($("#jTreeHelper").is(":not(:animated)") && e.button !=2) {
 	//	Allow for clickable links
	if(new String(e.target).match(/(f|ht)tp(s{0,1}):///ig)){
 		return false;
	}
	$("body").css("cursor","move");

Just add the highlighted lines in the jquery.jtree.js file. Basically it just checks if the target of the click is a link and if it is it ignores the dragging.

Categories: