Skip to content

Instantly share code, notes, and snippets.

View bshaffer's full-sized avatar

Brent Shaffer bshaffer

View GitHub Profile
<?php
/*
* This file is part of the symfony package.
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
<?php
$browser
->info('Check submission of form')
->login()
->click('Register')
->setField('user_comment[first_name]', csFactory::firstName())
<?php
/**
* sfWidgetFormJQueryDateTime class
*
* Combines jQueryDate widget with a regular time widget, for use of jQuery date
* when time is required.
*
* @package default
* @author Brent Shaffer
*/
<?php
class ForumTopic extends PluginForumTopic
{
public function getNewPostCount(sfUser $user)
{
if (!$user->isAuthenticated())
{
throw new InvalidArgumentException('This method can only be used with authenticated sfUser instances');
}
<?php
include dirname(__FILE__).'/sfPluginTestBootstrap.class.php';
$bootstrap = new sfPluginTestBootstrap();
$bootstrap->bootstrap();
$configuration = $bootstrap->getConfiguration();
$context = $bootstrap->getContex
@bshaffer
bshaffer / tag.sh
Created January 12, 2011 16:50
tag from svn
### USAGE ###
#
# tag [-u username] [-p password] repository version [last-version]
#
# Typing in -u but not -p will prompt you for a password.
# Priving a last-version argument will create a diff file between the new version and last-version tag.
# repository is automatically appended to REPOROOT.
REPOROOT=http://myrepo.com
<?php
class mycontrollerActions extends sfActions
{
public function executeSendAnEmail($r)
{
$emailBody = $this->getController()->getPresentationFor('mycontroller', 'email');
// yadda yadda
}
@bshaffer
bshaffer / _list_td_stacked.php
Created April 9, 2011 05:00
_list_td_stacked.php
<td colspan="13">
<?php echo __('%%id%% - %%first_name%% - %%last_name%% - %%email_address%% - %%username%% - %%algorithm%% - %%salt%% - %%password%% - %%is_active%% - %%is_super_admin%% - %%last_login%% - %%created_at%% - %%updated_at%%', array('%%id%%' => link_to($sf_guard_user->getId(), 'sf_guard_user_sf_guard_user_old_edit', $sf_guard_user), '%%first_name%%' => $sf_guard_user->getFirstName(), '%%last_name%%' => $sf_guard_user->getLastName(), '%%email_address%%' => $sf_guard_user->getEmailAddress(), '%%username%%' => $sf_guard_user->getUsername(), '%%algorithm%%' => $sf_guard_user->getAlgorithm(), '%%salt%%' => $sf_guard_user->getSalt(), '%%password%%' => $sf_guard_user->getPassword(), '%%is_active%%' => get_partial('sf_guard_user_old/list_field_boolean', array('value' => $sf_guard_user->getIsActive())), '%%is_super_admin%%' => get_partial('sf_guard_user_old/list_field_boolean', array('value' => $sf_guard_user->getIsSuperAdmin())), '%%last_login%%' => false !== strtotime($sf_guard_user->getLastLogin()) ?
@bshaffer
bshaffer / _list_th_tabular.php
Created April 9, 2011 05:04
_list_th_tabular.php
<?php slot('sf_admin.current_header') ?>
<th class="sf_admin_text sf_admin_list_th_id">
<?php if ('id' == $sort[0]): ?>
<?php echo link_to(__('Id', array(), 'messages'), '@sf_guard_user_sf_guard_user_old', array('query_string' => 'sort=id&sort_type='.($sort[1] == 'asc' ? 'desc' : 'asc'))) ?>
<?php echo image_tag(sfConfig::get('sf_admin_module_web_dir').'/images/'.$sort[1].'.png', array('alt' => __($sort[1], array(), 'sf_admin'), 'title' => __($sort[1], array(), 'sf_admin'))) ?>
<?php else: ?>
<?php echo link_to(__('Id', array(), 'messages'), '@sf_guard_user_sf_guard_user_old', array('query_string' => 'sort=id&sort_type=asc')) ?>
<?php endif; ?>
</th>
<?php end_slot(); ?>
@bshaffer
bshaffer / actions
Created April 9, 2011 05:07
Old Admin: from actions.class.php...
<?php
abstract class autoSf_guard_user_oldActions extends sfActions
{
// ....
protected function processForm(sfWebRequest $request, sfForm $form)
{
$form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
if ($form->isValid())
{