This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DebateCategory: | |
columns: | |
id: | |
primary: true | |
type: integer | |
autoincrement: true | |
debate_category_id: integer | |
section_id: integer | |
title: string(255) | |
content: string(1000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//THE CLASS | |
class AccountImageForm extends sfForm | |
{ | |
public function configure() | |
{ | |
$this->widgetSchema['image'] = new sfWidgetFormInputFile(); | |
$this->validatorSchema['image'] = new sfValidatorFile(array( | |
'path' => sfConfig::get('app_upload_dir') . '/users', | |
'required' => true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ArticleContributeForm extends ArticleForm | |
{ | |
public function configure() | |
{ | |
parent::configure(); | |
unset($this['article_draft_category_id']); | |
$this->embedForm('source', new ArticleSourceForm($this->object->ArticleSources[0])); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function array_compare($array1, $array2) { | |
$diff = false; | |
// Left-to-right | |
foreach ($array1 as $key => $value) { | |
if (!array_key_exists($key,$array2)) { | |
$diff[0][$key] = $value; | |
} elseif (is_array($value)) { | |
if (!is_array($array2[$key])) { | |
$diff[0][$key] = $value; | |
$diff[1][$key] = $array2[$key]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
*/ | |
class CommentTable extends Doctrine_Table | |
{ | |
public function getByObject($object) | |
{ | |
$tree = $this->createQuery('c') | |
->from('Comment c') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
*/ | |
class PluginCommentTable extends Doctrine_Table | |
{ | |
public function findTreeByModelAndModelId($model, $model_id, Doctrine_Query $query = null, $hydration = null) | |
{ | |
//if $query is null create a query | |
$query = $query ? $query : $this->createQuery('c'); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class sfRpx | |
{ | |
private | |
$methods = array( | |
'auth_info', | |
); | |
protected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class sfRpx | |
{ | |
private | |
$methods = array( | |
'auth_info', | |
); | |
protected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class sfRpx | |
{ | |
private | |
$methods = array( | |
'auth_info', | |
); | |
protected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.ac = function (options) { | |
options = $.extend({}, $.fn.ac.defaults, options); | |
var element = $(this); | |
var index = -1; | |
//Generate the lists that will be used for ac | |
var ul = $('<ul />').css({ display: 'none'}).insertAfter(this); | |
ul.attr('id', 'ac_' + $.data(this)); | |
//when the focus is lost of the input hide the ac list. 200ms so if we click the list it |