Author: jablko
Date: Thu Sep 24 13:41:27 2009
New Revision: 3505
Log:
Cosmetic changes, move to alphabetic order, add some whitespace
Modified:
trunk/apps/qubit/modules/informationobject/actions/editAction.class.php
Modified:
trunk/apps/qubit/modules/informationobject/actions/editAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/actions/editAction.class.php
Thu Sep 24 13:35:52 2009 (r3504)
+++ trunk/apps/qubit/modules/informationobject/actions/editAction.class.php
Thu Sep 24 13:41:27 2009 (r3505)
@@ -62,15 +62,25 @@
break;
+ case 'language':
+ case 'languageOfDescription':
+ $this->form->setDefault($name, $this->informationObject[$name]);
+ $this->form->setValidator($name, new
sfValidatorI18nChoiceLanguage(array('multiple' => true)));
+ $this->form->setWidget($name, new
sfWidgetFormI18nSelectLanguage(array('culture' =>
$this->context->user->getCulture(), 'multiple' => true)));
+
+ break;
+
case 'publicationStatus':
$this->form->setDefault('publicationStatus',
$this->context->routing->generate(null, array('module' => 'term', 'action' =>
'show', 'id' => $this->informationObject->getStatus($options = array('typeId'
=> QubitTerm::STATUS_TYPE_PUBLICATION_ID))->statusId)));
$this->form->setValidator('publicationStatus', new sfValidatorString);
+
$choices = array();
$choices[null] = null;
foreach
(QubitTaxonomy::getTermsById(QubitTaxonomy::PUBLICATION_STATUS_ID) as $term)
{
$choices[$this->context->routing->generate(null, array('module' =>
'term', 'action' => 'show', 'id' => $term->id))] = $term;
}
+
if (QubitAcl::check($this->informationObject,
QubitAclAction::PUBLISH_ID))
{
$this->form->setWidget('publicationStatus', new
sfWidgetFormSelect(array('choices' => $choices)));
@@ -78,15 +88,8 @@
else
{
// disable widget if user does not have 'publish' permission
- $this->form->setWidget('publicationStatus', new
sfWidgetFormSelect($options = array('choices' => $choices), $attributes =
array('disabled' => true)));
+ $this->form->setWidget('publicationStatus', new
sfWidgetFormSelect(array('choices' => $choices), array('disabled' => true)));
}
- break;
-
- case 'language':
- case 'languageOfDescription':
- $this->form->setDefault($name, $this->informationObject[$name]);
- $this->form->setValidator($name, new
sfValidatorI18nChoiceLanguage(array('multiple' => true)));
- $this->form->setWidget($name, new
sfWidgetFormI18nSelectLanguage(array('culture' =>
$this->context->user->getCulture(), 'multiple' => true)));
break;
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---