Skip to content

Instantly share code, notes, and snippets.

@brendo
brendo / README
Created September 10, 2009 00:32
Inline Validation for Symphony
------------------------------
@version 1.0
@release 10th September 2009
@jquery 1.3.2
Allows you attach inline Ajax validation to your forms.
The validation appears on inputs and textareas after the user
has filled them out (why validate on nothing..). The error
<?php
Class DatabaseException extends Exception{
/*
Array
(
[query] =>
[msg] => Access denied for user 'rdoot'@'localhost' (using password: YES)
[num] => 1045
@brendo
brendo / Extension: Meta Keys.md
Created September 4, 2010 02:33
Musings about a new Symphony extension

A Meta Keys field allows you to add arbitrary pieces of information to entries identified by a user generated key. The interface resembles the section editor in that any number of keyed information could be added to an entry (interface possibly provided by the Stage extension).

The values would always be text (at least initially).

For instance, a Meta Keys field could be added to a Products entry and then filled with this data:

  • Colour: Red
  • Size: 500ml

A datasource could then filter on the keys (in a yet to be determined syntax), eg. color=red.

@brendo
brendo / Symphony Developer Notes.md
Created January 9, 2011 06:06
A short note about `$this->_Parent`, `Administration::instance()`, `Frontend:instance` and the new `Symphony::Engine()`

Overview

The inner workings of the magical $this->_Parent have always been a bit of an unknown to Symphony developers and therefore, several ways have cropped up of doing the same things. Starting with Symphony 2.2, there is now a recommendation of how extensions should correctly use this variable.

In the early Symphony 2 days, $this->_Parent was used to manage a catalogue of all the available Managers and other objects such as Configuration and Database so extensions could use these instead of creating their own. Efforts were made in Symphony 2.0.6 to help cleanup this catalogue structure (which is memory intensive) by introducing static accessors to Symphony::Database() and Symphony::Configuration(). These allow extensions to reference these objects regardless of the instance Symphony is operating in (Frontend or Administration).

A typical Field extension works in both instances, functions such as displayPublishPanel work in Administration, others, such as `appendFormattedElement

Member: Password (Required)

  • Extends FieldInput (Text Input)
  • SHA1
  • Has a salt
  • Can have minimum strength/length

Member: Username

  • Extends FieldInput (Text Input)
@brendo
brendo / PDTasks.md
Created February 1, 2011 12:45
A never ending list of things I can do on my Personal Development time.

UC - Use Cases. CW - Collaborate with.

Watch & Learn

  • Watch the Think Vitamin videos
  • Watch Paul Irish's "Things I've learnt from the jQuery source code"
  • Learn to use SimpleTest, or any other Unit Testing library, that may help speed up Symphony development (CW: Rowan would probably have some ideas, or may have some experience in this already)
  • Read about UX in general
  • Read some Graffle tutorials to get more productive
@brendo
brendo / export_extension_list.extensions.css
Created March 10, 2011 06:04
Extension Listing export
#overlay {
display: none;
width: 50%;
height: auto;
background: #FFF;
padding: 20px;
border: 1px solid #E6E6E5;
position: absolute;
top: 0;
z-index: 10;
@brendo
brendo / Symphony221.md
Created March 24, 2011 07:11
Symphony 2.2.1 Release Notes

Symphony 2.2.1 Final

Fixes

  • #617 Taglist styling issue
  • Run General::sanitize on Taglist values in the backend to prevent errors
  • Fix issue with General::array_to_xml and nested arrays
  • Fix Upload field when used as a Dynamic Option with Select Box fields
@brendo
brendo / EventTutorial.md
Created April 4, 2011 11:06
Symphony Events: A Detailed Look

Forms have been an integral part of any interactive site since the dawn of time, they promote interactivity and are usually the most common way users interact with a site. It's commonplace that when a form is submitted, the website will take 'action' and do something with the data and then provide a user with the result. Symphony provides this logic layer via Events.

This tutorial assumes you have a basic understanding of how Events work in Symphony (if not, this may be a good introduction) and are semi comfortable writing some PHP code. I'll be showing you some of the lesser known features of Symphony Events, including event priority, event chaining and a brief demonstration of how to write a custom Event. The difficulty level progresses as we go through, but with any luck you'll be able to learn a thing or two :)

Getting Started

The Scenario

Our client requires a form that allows a user to submit some details about their new car purchase. Th

<?php
require_once(TOOLKIT . '/class.event.php');
require_once EXTENSIONS . '/xmlimporter/extension.driver.php';
require_once EXTENSIONS . '/facebook_albums/extension.driver.php';
require_once EXTENSIONS . '/facebook_albums/lib/class.json_to_xml.php';
Class eventimport_facebook_albums extends Event{
const ROOTELEMENT = 'import-facebook-albums';