|
Perforce Chronicle 2012.2/486814
API Documentation
|
A widget that displays a flickr photo stream. More...
Public Member Functions | |
| indexAction () | |
| Provides information needed for initial render of javascript. | |
Static Public Member Functions | |
| static | getConfigSubForm ($widget) |
| Get a widget config sub-form to present additional options to the user when configuring a widget instance. | |
Public Attributes | |
| $contexts | |
A widget that displays a flickr photo stream.
| static Flickr_StreamController::getConfigSubForm | ( | $ | widget | ) | [static] |
Get a widget config sub-form to present additional options to the user when configuring a widget instance.
| P4Cms_Widget | $widget | the widget model instance being configured. |
{
return new Flickr_Form_StreamWidget;
}
| Flickr_StreamController::indexAction | ( | ) |
Provides information needed for initial render of javascript.
{
$view = $this->view;
$widget = $this->_getWidget();
// ensure that the api key has been set
$values = P4Cms_Module::fetch('Flickr')->getConfig()->toArray();
$view->apiKey = isset($values['key']) ? $values['key'] : '';
// ensure that a type (tag/user/group) and key have been entered so the flickr search
// can be performed
$sourceType = $this->getOption('sourceType');
$sourceKey = $this->getOption('source' . $sourceType);
if ($sourceType && $sourceKey) {
$view->hasConfig = true;
switch($sourceType) {
case Flickr_Form_StreamWidget::SOURCE_TAG:
$view->tags = $sourceKey;
break;
case Flickr_Form_StreamWidget::SOURCE_USER:
$flickr = new Zend_Service_Flickr($view->apiKey);
$view->userId = $flickr->getIdByUsername($sourceKey);
break;
case Flickr_Form_StreamWidget::SOURCE_GROUP:
$view->groupId = $sourceKey;
break;
default:
$view->hasConfig = false;
}
$view->widgetId = $widget->getId();
$view->widgetRegion = $widget->getValue('region');
$view->imageDelay = $this->getOption('imageDelay');
$view->imageDimensions = Flickr_Form_StreamWidget::$sizeDimensions[$this->getOption('imageSize')];
$view->showTitle = $this->getOption('showImageTitle');
}
}
| Flickr_StreamController::$contexts |
array(
'image' => array('json')
)