SpiffyJr's Blogaroo

Happenings of the man known as SpiffyJr

  • Home
  • About
    • Inspiration
    • Resume
  • Projects
    • Blitzaroo
    • phpRaider
    • Zend Calendar
  • Docs
    • Blitzaroo API
    • SpiffyCalendar Docs
    • SpiffyDb Docs
  • Downloads
  • Technologies
    • Doctrine ORM
    • Dojo
    • PHP
    • Zend Framework
  • Other
    • License
Twitter RSS
Tag Archives: Blitzaroo

Rendering Dojo Stylesheets with a view helper

Posted on October 26, 2010 by SpiffyJr
2 comments

I’ve been fervently coding Blitzaroo the passed week and I ran into a rather annoying issue when using AJAX with the Zend Framework and Dojo. Take, for example, using AjaxContext to load content for a dijit.layout.TabContainer that houses several dijit.layout.ContentPane(s).

$ajaxContext = $this->_helper->getHelper('AjaxContext');
$ajaxContext->addActionContexts(array(
    'overview' => 'html',
    'events' => 'html',
    'members' => 'html',
    'recruits' => 'html'))->initContext();

Now then, when the getHref() from a ContentPane is called they load the Ajax data which, in this case, happens to be a dojox.grid.DataGrid. The grid renders just fine without Ajax but when Ajax is used ZF fails to load the proper Stylesheets which need to be loaded manually. I thought, no big deal, I’ll just hit up $this->dojo()->{some method to spit out stylesheets} and to my dismay found that the method is protected. Why? I’m not quite sure. I went ahead and wrote a view helper to fix the problem which is merely a copy/paste of the _renderStylesheet() method but without requiring the Dojo container object. If there is another way around the issue I’m all ears!

class My_View_Helper_DojoStylesheets extends Zend_View_Helper_Abstract
{
	public function dojoStylesheets()
	{
		$dojo = $this->view->dojo();
		$isXhtml = $this->view->doctype()->isXhtml();

		if ($dojo->useCdn()) {
			$base = $dojo->getCdnBase() . $dojo->getCdnVersion();
		} else {
			$base = $dojo->_getLocalRelativePath();
		}

		$registeredStylesheets = $dojo->getStylesheetModules();
		foreach ($registeredStylesheets as $stylesheet) {
			$themeName = substr($stylesheet, strrpos($stylesheet, '.') + 1);
			$stylesheet = str_replace('.', '/', $stylesheet);
			$stylesheets[] = $base . '/' . $stylesheet . '/' . $themeName . '.css';
		}

		foreach ($dojo->getStylesheets() as $stylesheet) {
			$stylesheets[] = $stylesheet;
		}

		if ($dojo->registerDojoStylesheet()) {
			$stylesheets[] = $base . '/dojo/resources/dojo.css';
		}

		if (empty($stylesheets)) {
			return '';
		}

		array_reverse($stylesheets);
		$style = '<style type="text/css">' . PHP_EOL . (($isXhtml) ? '<!--' : '<!--') . PHP_EOL;
		foreach ($stylesheets as $stylesheet) {
			$style .= '    @import "' . $stylesheet . '";' . PHP_EOL;
		}
		$style .= (($isXhtml) ? '-->' : '-->') . PHP_EOL . '</style>';

		return $style;
	}
}

Now my {action}.ajax.phtml script is nice and happy.

// call the regular members action page - no need to duplicate code!
echo $this->render('team-manager/members.phtml');

// inlineScript contains all the formatters for the grid
echo $this->inlineScript();

// New view helper to include the data grid CSS files generated by my DataGrid view helper
echo $this->dojoStylesheets();
GD Star Rating
loading...
Categories: Blitzaroo, Dojo, PHP, View Helpers, Zend Framework | Tags: Ajax, api, Blitzaroo, Dojo, Dojo Toolkit, JavaScript, php, Programming, Scripts, Style Sheets, zend, Zend Framework

Blitzaroo signups

Posted on March 4, 2010 by SpiffyJr
5 comments

Dum da dum!

So, I spent most of last night working on event signups in Blitzaroo and I ran into a situation where I’m trying to decide what features I want to implement. This blog is my attempt to get the community involved so I’m going to throw up a little poll and see what you have to say. Let me elaborate on the options.

1. phpRaider

Signups should work exactly like phpRaider. There are three levels (accepted, queued, declined) and the freeze time determines when users can signup. If it’s past the freeze time all signups are disabled but users can still edit their note. The administrator can also automatically queue everyone.

2. Blitzaroo

I was tinkering around with with a combination of phpRaider features and new features. Levels will still exist (primary, alternate, declined) and I will keep the freeze time. I was planning on adding additional automatic signups such as:

  1. Let Blitzaroo handle signups automatically. This option would use an algorithm (currently unknown) to assign attendees based on various factors such as attendance, label (or role), and/or a roll of the dice. (Disables 2, 3, and 4)
  2. Allow users to choose their signup type. Gives users the ability to choose primary, alternate, or declined.
  3. Allow users to choose their own label. Gives users the ability to choose their role.
  4. Let the event coordinator handle signups. The event coordinator is required to assign signups types as well as labels. (Disables 1)

These are all checkable options and some can be used together.

Custom

If you choose this option please specify in the comments below what you think is the best way to handle signups.

How should signups work?

View Results

Loading ... Loading ...

Reblog this post [with Zemanta]
GD Star Rating
loading...
Categories: Blitzaroo, Projects | Tags: Algorithm, Blitzaroo, Google

Blitzaroo’s Tiers

Posted on November 24, 2009 by SpiffyJr
No comments

If you know me then you know I am a strong advocate of providing free services. I, however, do not have the massive advertising income of Google (who rocks, by the way)  nor the funding from any supporters. I have decided to implement several tiers of features to Blitzaroo users with varying costs to help circumvent the cost of hosting. There will always be a free level of service that provides the majority of functionality so that any user can benefit from Blitzaroo’s services without a fee. Listed below is what I’m planning to support for each tier. The initial beta will have all of the free features implemented and the other tiers will be expanded as time goes on. Once I implement all features of a given tier I will open it up so that users can subscribe to that tier. I absolutely hate contracts so there will be monthly, tri-annual, bi-annual, and annual subscription plans. The longer you subscribe for the more of a discount you will receive.

Free Tier

  • Will include advertising of some sort (probably the less annoying Google text ads).
  • All of the features of phpRaider.
GD Star Rating
loading...
Categories: Blitzaroo | Tags: Blitzaroo
Page 1 of 3123
  • Recent Posts

    • Keep your Git fork clean
    • Get started with Zend Framework 2 modules!
    • More Doctrine 2 and Zend Framework integration goodies!
    • Super sexy URLs with ZF and the joy of controller plugins!
    • Formatting your API to work with dojox.data.JsonRestStore (#dojo)
  • Categories

    • Other
      • Random
    • Projects
      • Blitzaroo
      • phpRaider
      • SpiffyDb
      • View Helpers
      • Zend Calendar
    • SpiffyJr
    • Technologies
      • Dojo
      • PHP
      • Zend Framework
  • Tag Cloud

      Ajax Algorithm api Blitzaroo Blog BSD licenses calendar Cascading Style Sheets CSS database Data Formats Dojo Dojo Toolkit event Framework game Google HTML HTML element JavaScript JQuery json Languages mapper Marketing mmorpg model php Programming Projects Scripts Source code Style sheet Style Sheets Twitter Website zend Zend Framework
  • Archives

    • December 2011
    • November 2011
    • July 2011
    • April 2011
    • March 2011
    • December 2010
    • November 2010
    • October 2010
    • March 2010
    • February 2010
    • November 2009
    • October 2009
    • September 2009
© SpiffyJr's Blogaroo. Proudly Powered by WordPress | Nest Theme by YChong